-
Notifications
You must be signed in to change notification settings - Fork 1
feat: implement company template system with 7 built-in presets #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| """Shared configuration utilities.""" | ||
|
|
||
| import copy | ||
| from typing import Any | ||
|
|
||
|
|
||
| def deep_merge( | ||
| base: dict[str, Any], | ||
| override: dict[str, Any], | ||
| ) -> dict[str, Any]: | ||
| """Recursively merge *override* into *base*, returning a new dict. | ||
|
|
||
| Nested dicts are merged recursively. Lists, scalars, and all other | ||
| types in *override* replace the corresponding value in *base* | ||
| entirely. Keys present only in *base* are preserved unchanged in | ||
| the result. Neither input dict is mutated. | ||
|
|
||
| Args: | ||
| base: Base configuration dict. | ||
| override: Override values to layer on top. | ||
|
|
||
| Returns: | ||
| A new merged dict. | ||
| """ | ||
| result = copy.deepcopy(base) | ||
| for key, value in override.items(): | ||
| if key in result and isinstance(result[key], dict) and isinstance(value, dict): | ||
| result[key] = deep_merge(result[key], value) | ||
| else: | ||
| result[key] = copy.deepcopy(value) | ||
| return result |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| """Company templates: built-in presets and custom template loading. | ||
|
|
||
| Public API | ||
| ---------- | ||
| .. autosummary:: | ||
| load_template | ||
| load_template_file | ||
| list_templates | ||
| list_builtin_templates | ||
| render_template | ||
| CompanyTemplate | ||
| LoadedTemplate | ||
| TemplateInfo | ||
| TemplateMetadata | ||
| TemplateVariable | ||
| TemplateAgentConfig | ||
| TemplateDepartmentConfig | ||
| TemplateError | ||
| TemplateNotFoundError | ||
| TemplateRenderError | ||
| TemplateValidationError | ||
| """ | ||
|
|
||
| from ai_company.templates.errors import ( | ||
| TemplateError, | ||
| TemplateNotFoundError, | ||
| TemplateRenderError, | ||
| TemplateValidationError, | ||
| ) | ||
| from ai_company.templates.loader import ( | ||
| LoadedTemplate, | ||
| TemplateInfo, | ||
| list_builtin_templates, | ||
| list_templates, | ||
| load_template, | ||
| load_template_file, | ||
| ) | ||
| from ai_company.templates.renderer import render_template | ||
| from ai_company.templates.schema import ( | ||
| CompanyTemplate, | ||
| TemplateAgentConfig, | ||
| TemplateDepartmentConfig, | ||
| TemplateMetadata, | ||
| TemplateVariable, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "CompanyTemplate", | ||
| "LoadedTemplate", | ||
| "TemplateAgentConfig", | ||
| "TemplateDepartmentConfig", | ||
| "TemplateError", | ||
| "TemplateInfo", | ||
| "TemplateMetadata", | ||
| "TemplateNotFoundError", | ||
| "TemplateRenderError", | ||
| "TemplateValidationError", | ||
| "TemplateVariable", | ||
| "list_builtin_templates", | ||
| "list_templates", | ||
| "load_template", | ||
| "load_template_file", | ||
| "render_template", | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| template: | ||
| name: "Agency" | ||
| description: "Client-focused agency with project management and creative roles" | ||
| version: "1.0.0" | ||
| tags: | ||
| - "agency" | ||
| - "client-work" | ||
| - "creative" | ||
|
|
||
| variables: | ||
| - name: "company_name" | ||
| description: "Name of your agency" | ||
| default: "Creative Agency" | ||
| - name: "budget" | ||
| description: "Monthly budget in USD" | ||
| var_type: "float" | ||
| default: 100.0 | ||
|
|
||
| company: | ||
| type: "agency" | ||
| budget_monthly: {{ budget | default(100.0) }} | ||
| autonomy: 0.5 | ||
|
|
||
| departments: | ||
| - name: "operations" | ||
| budget_percent: 30 | ||
| head_role: "Project Manager" | ||
| - name: "engineering" | ||
| budget_percent: 40 | ||
| head_role: "Full-Stack Developer" | ||
| - name: "design" | ||
| budget_percent: 30 | ||
| head_role: "UI Designer" | ||
|
|
||
| agents: | ||
| - role: "Project Manager" | ||
| level: "senior" | ||
| model: "sonnet" | ||
| personality_preset: "visionary_leader" | ||
| department: "operations" | ||
| - role: "UI Designer" | ||
| level: "mid" | ||
| model: "sonnet" | ||
| department: "design" | ||
| - role: "Full-Stack Developer" | ||
| level: "senior" | ||
| model: "sonnet" | ||
| personality_preset: "pragmatic_builder" | ||
| department: "engineering" | ||
|
|
||
| workflow: "kanban" | ||
| communication: "hybrid" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| template: | ||
| name: "Dev Shop" | ||
| description: "Software development focused team with QA and DevOps" | ||
| version: "1.0.0" | ||
| tags: | ||
| - "development" | ||
| - "engineering" | ||
| - "qa" | ||
|
|
||
| variables: | ||
| - name: "company_name" | ||
| description: "Name of your company" | ||
| default: "Dev Shop" | ||
| - name: "budget" | ||
| description: "Monthly budget in USD" | ||
| var_type: "float" | ||
| default: 75.0 | ||
|
|
||
| company: | ||
| type: "dev_shop" | ||
| budget_monthly: {{ budget | default(75.0) }} | ||
| autonomy: 0.5 | ||
|
|
||
| departments: | ||
| - name: "engineering" | ||
| budget_percent: 70 | ||
| head_role: "Software Architect" | ||
| - name: "quality_assurance" | ||
| budget_percent: 20 | ||
| head_role: "QA Lead" | ||
| - name: "operations" | ||
| budget_percent: 10 | ||
| head_role: "DevOps/SRE Engineer" | ||
|
|
||
| agents: | ||
| - role: "Software Architect" | ||
| level: "principal" | ||
| model: "opus" | ||
| personality_preset: "methodical_analyst" | ||
| department: "engineering" | ||
| - role: "Backend Developer" | ||
| level: "senior" | ||
| model: "sonnet" | ||
| personality_preset: "pragmatic_builder" | ||
| department: "engineering" | ||
| - role: "Backend Developer" | ||
| level: "mid" | ||
| model: "haiku" | ||
| personality_preset: "eager_learner" | ||
| department: "engineering" | ||
| - role: "QA Lead" | ||
| level: "lead" | ||
| model: "sonnet" | ||
| personality_preset: "methodical_analyst" | ||
| department: "quality_assurance" | ||
| - role: "DevOps/SRE Engineer" | ||
| level: "mid" | ||
| model: "sonnet" | ||
| personality_preset: "pragmatic_builder" | ||
| department: "operations" | ||
|
|
||
| workflow: "agile_kanban" | ||
| communication: "hybrid" | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,68 @@ | ||||||
| template: | ||||||
| name: "Full Company" | ||||||
| description: "Enterprise simulation with all departments and full hierarchy" | ||||||
| version: "1.0.0" | ||||||
| tags: | ||||||
| - "enterprise" | ||||||
| - "full-hierarchy" | ||||||
| - "all-departments" | ||||||
|
|
||||||
| variables: | ||||||
| - name: "company_name" | ||||||
| description: "Name of your company" | ||||||
| default: "Acme Corp" | ||||||
| - name: "budget" | ||||||
| description: "Monthly budget in USD" | ||||||
| var_type: "float" | ||||||
| default: 200.0 | ||||||
|
|
||||||
| company: | ||||||
| type: "full_company" | ||||||
| budget_monthly: {{ budget | default(200.0) }} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix Jinja braces spacing on Line 21 to satisfy YAML linting.
Suggested fix- budget_monthly: {{ budget | default(200.0) }}
+ budget_monthly: {{budget | default(200.0)}}As per coding guidelines 📝 Committable suggestion
Suggested change
🧰 Tools🪛 YAMLlint (1.38.0)[error] 21-21: too many spaces inside braces (braces) [error] 21-21: too many spaces inside braces (braces) 🤖 Prompt for AI Agents |
||||||
| autonomy: 0.5 | ||||||
|
|
||||||
| departments: | ||||||
| - name: "executive" | ||||||
| budget_percent: 15 | ||||||
| head_role: "CEO" | ||||||
| - name: "engineering" | ||||||
| budget_percent: 50 | ||||||
| head_role: "CTO" | ||||||
| - name: "product" | ||||||
| budget_percent: 15 | ||||||
| head_role: "Product Manager" | ||||||
| - name: "quality_assurance" | ||||||
| budget_percent: 10 | ||||||
| head_role: "QA Engineer" | ||||||
| - name: "operations" | ||||||
| budget_percent: 10 | ||||||
| head_role: "CFO" | ||||||
|
|
||||||
| agents: | ||||||
| - role: "CEO" | ||||||
| level: "c_suite" | ||||||
| model: "opus" | ||||||
| personality_preset: "visionary_leader" | ||||||
| department: "executive" | ||||||
| - role: "CTO" | ||||||
| level: "c_suite" | ||||||
| model: "opus" | ||||||
| personality_preset: "methodical_analyst" | ||||||
| department: "executive" | ||||||
| - role: "CFO" | ||||||
| level: "c_suite" | ||||||
| model: "opus" | ||||||
| department: "operations" | ||||||
| - role: "Backend Developer" | ||||||
| level: "senior" | ||||||
| model: "sonnet" | ||||||
| personality_preset: "pragmatic_builder" | ||||||
| department: "engineering" | ||||||
| - role: "QA Engineer" | ||||||
| level: "mid" | ||||||
| model: "haiku" | ||||||
| personality_preset: "methodical_analyst" | ||||||
| department: "quality_assurance" | ||||||
|
|
||||||
| workflow: "agile_kanban" | ||||||
| communication: "hybrid" | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix Jinja braces spacing on Line 21 to satisfy YAML linting.
budget_monthly: {{ budget | default(75.0) }}is flagged by YAMLlint (braces).Suggested fix
As per coding guidelines
**/*.{yaml,yml,json,toml}: Use check-yaml, check-json, and check-toml pre-commit hooks to validate configuration files.📝 Committable suggestion
🧰 Tools
🪛 YAMLlint (1.38.0)
[error] 21-21: too many spaces inside braces
(braces)
[error] 21-21: too many spaces inside braces
(braces)
🤖 Prompt for AI Agents