feat: add consultancy and data team template archetypes#764
Conversation
Add two new builtin company templates covering non-tech-product org archetypes: Consultancy (client-facing advisory/delivery, 5 agents, supervised/hierarchical) and Data Team (analytics/ML focused, 6 agents, full autonomy/event-driven). Both use existing roles and personality presets including client_advisor from #721. Closes #720 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Update docs/design/organization.md: add Consultancy and Data Team to Company Types table and Skill Pattern Taxonomy table - Update docs/user_guide.md: list all 9 builtin templates - Update docs/design/communication.md: add new templates to examples - Update docs/design/operations.md: add new templates to examples - Add CONSULTANCY and DATA_TEAM value assertions to test_company_type_values - Add TestBuiltinEnumSync: verify CompanyType members match BUILTIN_TEMPLATES Pre-reviewed by 11 agents, 7 findings addressed Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the system's flexibility by introducing two new foundational company templates: 'Consultancy' and 'Data Team'. These additions provide users with more diverse starting points for simulating different organizational structures, complete with predefined agent roles, communication patterns, and workflows. The changes also ensure that all documentation and internal enumerations are updated to support these new archetypes, alongside a new test to maintain data consistency. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
WalkthroughThis pull request introduces two new organization archetypes—Consultancy and Data Team—to the codebase. The 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces two new built-in company templates: 'Consultancy' and 'Data Team'. The changes include the YAML template definitions, updates to the CompanyType enum, and corresponding additions to the template loader. The documentation has been updated across several files to reflect these new archetypes. The test suite has also been expanded to cover the new templates and now includes a valuable new test to ensure the CompanyType enum stays in sync with the built-in templates, which improves future maintainability. My review found the changes to be well-implemented, with only minor feedback on redundant default values in the new template files.
|
|
||
| company: | ||
| type: "consultancy" | ||
| budget_monthly: {{ budget | default(60.0) }} |
There was a problem hiding this comment.
The budget variable is already defined with a default value of 60.0 on line 28. Using the default filter here is redundant and could lead to inconsistencies if the two default values diverge in the future. The template rendering engine should handle providing the default value for the variable.
budget_monthly: {{ budget }}|
|
||
| company: | ||
| type: "data_team" | ||
| budget_monthly: {{ budget | default(55.0) }} |
There was a problem hiding this comment.
The budget variable is already defined with a default value of 55.0 on line 29. Using the default filter here is redundant and could lead to inconsistencies if the two default values diverge in the future. The template rendering engine should handle providing the default value for the variable.
budget_monthly: {{ budget }}There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/synthorg/templates/builtins/consultancy.yaml`:
- Line 32: The Jinja expression in the template key "budget_monthly: {{ budget |
default(60.0) }}" has spaces inside the mustache braces which triggers the
YAMLlint braces rule; update the template to remove the space immediately after
'{{' and immediately before '}}' so it reads "budget_monthly: {{budget |
default(60.0)}}" (keep the variable name budget and the default filter intact).
In `@src/synthorg/templates/builtins/data_team.yaml`:
- Line 33: The YAML Jinja expression for budget_monthly has extra spaces inside
the braces; update the template expression for the budget_monthly value to
remove the spaces immediately after '{{' and before '}}' so it reads with no
inner-brace padding (change the current "{{ budget | default(55.0) }}" usage for
the budget variable/default into the compact form for the same expression),
preserving the variable name budget and the default filter call.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 8dd9346c-0b74-4f40-9b0c-467b47bca7fc
📒 Files selected for processing (10)
docs/design/communication.mddocs/design/operations.mddocs/design/organization.mddocs/user_guide.mdsrc/synthorg/core/enums.pysrc/synthorg/templates/builtins/consultancy.yamlsrc/synthorg/templates/builtins/data_team.yamlsrc/synthorg/templates/loader.pytests/unit/core/test_enums.pytests/unit/templates/test_loader.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Build Sandbox
- GitHub Check: Build Backend
- GitHub Check: Test (Python 3.14)
- GitHub Check: Analyze (python)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.py: Nofrom __future__ import annotationsin Python files -- Python 3.14 has PEP 649 native lazy annotations
Useexcept A, B:syntax without parentheses (PEP 758 except syntax) in exception handlers
All public functions and methods must have type hints; enforce strict mypy mode
Use Google-style docstrings on all public classes and functions; enforced by ruff D rules
Files:
tests/unit/core/test_enums.pysrc/synthorg/core/enums.pysrc/synthorg/templates/loader.pytests/unit/templates/test_loader.py
tests/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
tests/**/*.py: Use@pytest.mark.unit,@pytest.mark.integration,@pytest.mark.e2e,@pytest.mark.slowmarkers on all tests
Maintain 80% minimum code coverage (enforced in CI)
Useasyncio_mode = 'auto'-- no manual@pytest.mark.asyncioneeded on async tests
Global test timeout is 30 seconds per test; do not add per-filepytest.mark.timeout(30)markers; non-default overrides liketimeout(60)are allowed
ALWAYS run pytest with-n autofor parallelism via pytest-xdist; never run tests sequentially
Prefer@pytest.mark.parametrizefor testing similar cases
Tests must usetest-provider,test-small-001, etc. instead of real vendor names
Use Hypothesis for Python property-based testing with@given+@settingsdecorators; use profiles:ci(50 examples, default) anddev(1000 examples) controlled viaHYPOTHESIS_PROFILEenv var
Run Hypothesis dev profile with:HYPOTHESIS_PROFILE=dev uv run python -m pytest tests/ -m unit -n auto -k properties
For timing-sensitive tests, mocktime.monotonic()andasyncio.sleep()to make them deterministic instead of widening timing margins. For tasks that must block indefinitely until cancelled, useasyncio.Event().wait()instead ofasyncio.sleep(large_number)
NEVER skip, dismiss, or ignore flaky tests -- always fix them fully and fundamentally
Files:
tests/unit/core/test_enums.pytests/unit/templates/test_loader.py
docs/**
📄 CodeRabbit inference engine (CLAUDE.md)
Run
uv run zensical buildto build docs (output:_site/docs/);uv run zensical servefor local preview
Files:
docs/user_guide.mddocs/design/communication.mddocs/design/operations.mddocs/design/organization.md
docs/**/*.md
📄 CodeRabbit inference engine (CLAUDE.md)
Use Markdown for documentation in
docs/directory, built with Zensical (config:mkdocs.yml)
Files:
docs/user_guide.mddocs/design/communication.mddocs/design/operations.mddocs/design/organization.md
src/synthorg/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
src/synthorg/**/*.py: Every module with business logic must import and usefrom synthorg.observability import get_loggerwith variable namelogger
Never useimport logging,logging.getLogger(), orprint()in application code except in observability/setup.py and observability/sinks.py
Use event name constants from domain-specific modules undersynthorg.observability.events(e.g.,API_REQUEST_STARTEDfromevents.api); import directly:from synthorg.observability.events.<domain> import EVENT_CONSTANT
Use structured logging with kwargs:logger.info(EVENT, key=value)-- never use old-style string formatting likelogger.info('msg %s', val)
Immutability: create new objects, never mutate existing ones. For non-Pydantic internal collections (registries,BaseTool), usecopy.deepcopy()at construction +MappingProxyTypewrapping for read-only enforcement
Usecopy.deepcopy()at system boundaries (tool execution, LLM provider serialization, inter-agent delegation, serializing for persistence) fordict/listfields in frozen Pydantic models
Use frozen Pydantic models for config/identity; use separate mutable-via-copy models withmodel_copy(update=...)for runtime state that evolves (e.g., agent execution state, task progress)
Never mix static config fields with mutable runtime fields in one Pydantic model
Use@computed_fieldfor derived values instead of storing + validating redundant fields (e.g.,TokenUsage.total_tokens)
UseNotBlankStrfromcore.typesfor all identifier/name fields, including optional (NotBlankStr | None) and tuple (tuple[NotBlankStr, ...]) variants, instead of manual whitespace validators
Preferasyncio.TaskGroupfor fan-out/fan-in parallel operations in new code (e.g., multiple tool invocations, parallel agent calls) instead of barecreate_task
Keep functions under 50 lines and files under 800 lines
Handle errors explicitly; never silently swallow exceptions
Validate at system boundaries (user input, exter...
Files:
src/synthorg/core/enums.pysrc/synthorg/templates/loader.py
src/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
src/**/*.py: Runuv run ruff check src/ tests/for linting;uv run ruff check src/ tests/ --fixfor auto-fix;uv run ruff format src/ tests/for formatting
Runuv run mypy src/ tests/for strict type-checking
Files:
src/synthorg/core/enums.pysrc/synthorg/templates/loader.py
docs/design/**/*.md
📄 CodeRabbit inference engine (CLAUDE.md)
Design spec in
docs/design/(7 pages); use for all architecture, data models, and behavior decisions. Reference with format:docs/design/<page>
Files:
docs/design/communication.mddocs/design/operations.mddocs/design/organization.md
🧠 Learnings (2)
📚 Learning: 2026-03-20T08:28:32.845Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-20T08:28:32.845Z
Learning: Applies to src/synthorg/templates/**/*.py : Templates: pre-built company templates, personality presets, and builder.
Applied to files:
docs/user_guide.mddocs/design/communication.mddocs/design/operations.mdsrc/synthorg/templates/loader.pysrc/synthorg/templates/builtins/consultancy.yamltests/unit/templates/test_loader.pysrc/synthorg/templates/builtins/data_team.yaml
📚 Learning: 2026-03-19T07:12:14.508Z
Learnt from: CR
Repo: Aureliolo/synthorg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-19T07:12:14.508Z
Learning: Applies to src/synthorg/communication/**/*.py : Communication package (communication/): message bus, dispatcher, messenger, channels, delegation, loop prevention, conflict resolution; meeting/ subpackage for meeting protocol (round-robin, position papers, structured phases), scheduler (frequency, participant resolver), orchestrator
Applied to files:
docs/design/communication.md
🧬 Code graph analysis (2)
tests/unit/core/test_enums.py (1)
src/synthorg/core/enums.py (1)
CompanyType(148-160)
tests/unit/templates/test_loader.py (1)
src/synthorg/core/enums.py (1)
CompanyType(148-160)
🪛 YAMLlint (1.38.0)
src/synthorg/templates/builtins/consultancy.yaml
[error] 32-32: too many spaces inside braces
(braces)
[error] 32-32: too many spaces inside braces
(braces)
src/synthorg/templates/builtins/data_team.yaml
[error] 33-33: too many spaces inside braces
(braces)
[error] 33-33: too many spaces inside braces
(braces)
🔇 Additional comments (12)
src/synthorg/core/enums.py (1)
158-159: Enum additions are consistent and correct.The new
CompanyTypemembers are well-formed and align with template identifiers.docs/design/operations.md (1)
846-847: Autonomy mapping update looks accurate.The updated archetype examples are consistent with the new templates.
tests/unit/core/test_enums.py (1)
56-57: Enum tests were updated correctly for new company types.Count and string-value checks now cover
CONSULTANCYandDATA_TEAM.Also applies to: 145-146
src/synthorg/templates/loader.py (1)
59-60: Builtin template registry update is correct.Both new template keys are properly registered for discovery/loading.
docs/user_guide.md (1)
90-98: Template catalog update is clear and consistent.The table now reflects the expanded builtin template set and naming scheme.
docs/design/communication.md (1)
89-90: Communication pattern mapping update looks good.The new archetype examples are integrated cleanly.
docs/design/organization.md (1)
21-22: Organization design tables are updated consistently.Both new archetypes and their skill-pattern mappings are documented clearly.
Also applies to: 53-54
src/synthorg/templates/builtins/consultancy.yaml (1)
1-31: Template structure and archetype modeling look solid overall.Role mix, reporting lines, handoffs, and escalation paths are coherent for the consultancy profile.
Also applies to: 33-113
tests/unit/templates/test_loader.py (3)
384-397: Operational config parametrization update is robust.Adding the new rows and deriving
idsfrom_EXPECTED_CONFIGSkeeps the dataset and test labels in sync.
415-424: Enum-to-builtin sync guard is a strong regression check.This test will reliably catch drift when
CompanyTypeorBUILTIN_TEMPLATESchanges.
450-452: Skill-pattern coverage for new builtins looks correct.The added expectations are cleanly integrated into the existing matrix-based assertions.
src/synthorg/templates/builtins/data_team.yaml (1)
1-32: Data Team template structure is well-composed.Department topology, role mix, reporting lines, and orchestration defaults are consistent and testable.
Also applies to: 34-122
|
|
||
| company: | ||
| type: "consultancy" | ||
| budget_monthly: {{ budget | default(60.0) }} |
There was a problem hiding this comment.
Fix Jinja brace spacing to resolve lint error.
Line 32 is flagged by YAMLlint (braces) for spaces inside {{ ... }}.
🔧 Proposed fix
- budget_monthly: {{ budget | default(60.0) }}
+ budget_monthly: {{budget | default(60.0)}}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| budget_monthly: {{ budget | default(60.0) }} | |
| budget_monthly: {{budget | default(60.0)}} |
🧰 Tools
🪛 YAMLlint (1.38.0)
[error] 32-32: too many spaces inside braces
(braces)
[error] 32-32: too many spaces inside braces
(braces)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/synthorg/templates/builtins/consultancy.yaml` at line 32, The Jinja
expression in the template key "budget_monthly: {{ budget | default(60.0) }}"
has spaces inside the mustache braces which triggers the YAMLlint braces rule;
update the template to remove the space immediately after '{{' and immediately
before '}}' so it reads "budget_monthly: {{budget | default(60.0)}}" (keep the
variable name budget and the default filter intact).
|
|
||
| company: | ||
| type: "data_team" | ||
| budget_monthly: {{ budget | default(55.0) }} |
There was a problem hiding this comment.
Fix Jinja brace spacing to satisfy YAMLlint.
Line [33] triggers the braces lint rule due to spaces inside {{ ... }}.
Proposed fix
- budget_monthly: {{ budget | default(55.0) }}
+ budget_monthly: {{budget | default(55.0)}}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| budget_monthly: {{ budget | default(55.0) }} | |
| budget_monthly: {{budget | default(55.0)}} |
🧰 Tools
🪛 YAMLlint (1.38.0)
[error] 33-33: too many spaces inside braces
(braces)
[error] 33-33: too many spaces inside braces
(braces)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/synthorg/templates/builtins/data_team.yaml` at line 33, The YAML Jinja
expression for budget_monthly has extra spaces inside the braces; update the
template expression for the budget_monthly value to remove the spaces
immediately after '{{' and before '}}' so it reads with no inner-brace padding
(change the current "{{ budget | default(55.0) }}" usage for the budget
variable/default into the compact form for the same expression), preserving the
variable name budget and the default filter call.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #764 +/- ##
=======================================
Coverage 92.31% 92.31%
=======================================
Files 573 573
Lines 29727 29729 +2
Branches 2881 2881
=======================================
+ Hits 27441 27443 +2
Misses 1806 1806
Partials 480 480 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🤖 I have created a release *beep* *boop* --- ## [0.4.9](v0.4.8...v0.4.9) (2026-03-23) ### Features * add consultancy and data team template archetypes ([#764](#764)) ([81dc75f](81dc75f)) * add personality presets for new template archetypes ([#758](#758)) ([de4e661](de4e661)) * improve wipe command UX with interactive prompts ([#759](#759)) ([bbd4d2d](bbd4d2d)) ### Bug Fixes * stable channel detects update for dev builds ([#753](#753)) ([f53da9f](f53da9f)) ### Documentation * add version banner to docs header ([#761](#761)) ([8f8c1f8](8f8c1f8)) ### Maintenance * adopt new features from web dependency upgrades ([#763](#763)) ([1bb6336](1bb6336)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
CONSULTANCYandDATA_TEAMtoCompanyTypeenumTestBuiltinEnumSynctest ensuringCompanyTypemembers stay in sync withBUILTIN_TEMPLATESTest plan
test_all_builtins_load_successfully,test_render_all_builtins_produce_valid_root_config,test_template_agent_count_in_range)TestBuiltinEnumSyncverifies every non-CUSTOMCompanyTypehas aBUILTIN_TEMPLATESentryPre-reviewed by 11 agents, 7 findings addressed.
🤖 Generated with Claude Code
Closes #720