/team-gen — Generate an agent team from a product description
This skill turns "build me a team" from a one-off craft into a measurable pipeline. It composes new teams from validated archetypes, then runs the evaluator on the result so you start with grade-A specialists, not whatever you happened to write at 2am.
Quick start
# From a PRD file
/team-gen ./docs/product.md --target .
# Inline brief (you'll be asked clarifying questions)
/team-gen "An e-commerce backend with TypeScript API + React web + Stripe payments"
# Dry-run: show what would be generated, don't write
/team-gen ./docs/product.md --target . --dry-run
Procedure
1. Parse the brief
- If the argument is a file path, read it.
- If inline, treat the string as the brief.
- Extract:
- Domains (which services exist: api, web, mobile, payments, data, ml, devops, etc.)
- Tech stack (TypeScript / Go / Python / Rust / Flutter, Postgres / Mongo, Vercel / GCP, etc.)
- Team size hint (small = 4–6 specialists, default = 7–9, large = 10–12)
- Constraints (regulated industry, multi-locale, always-on monitor needed, etc.)
- If anything is ambiguous, ask the user via
AskUserQuestion. Do not invent.
2. Pick archetypes
Available agent archetypes in plugins/agents-team/templates/agents/:
orchestrator — Opus, broad tools, delegates to all specialists
tech-leader — Opus, read-only, architecture review
domain-engineer — Sonnet, narrow whitelist, owns one path; instantiate one per domain
designer — Sonnet, design system + UX
qa-engineer — Sonnet, isolation: worktree
security-engineer — Sonnet, read-mostly, OWASP focus
devops-engineer — Sonnet, broad bash, smallest pipeline diffs
monitor — Haiku, background: true, silent-by-default
Always include orchestrator + qa-engineer + security-engineer. Add specialists per detected domain. Add a monitor if the team is ≥6 agents or the brief mentions "always-on" / "production".
3. Pick rules
plugins/agents-team/templates/rules/ has 13 numbered rule templates. Always include 01-plan-first, 03-definition-of-done, 04-clarify-unknowns, 08-client-first-communication, 09-no-quick-fixes, 13-model-selection. Add 02-service-boundaries and 10-style-per-service if there are 2+ services. Add 12-security-vapt if the brief mentions auth, payments, PII, or external traffic.
4. Pick hooks
plugins/agents-team/templates/hooks/ has notify, session-init, teammate-idle-gate, post-commit-check. Default to all four. The settings.json.partial wires them up.
5. Build a team.json spec
Write a JSON file at <target>/.claude/team.json (or /tmp/team-gen-<timestamp>.json for dry-run) with this shape:
{
"team_name": "<team-name>",
"services": ["api", "web", "payments"],
"primary_locale": "en",
"orchestrator": {
"archetype": "orchestrator",
"values": {
"name": "<team>-orch",
"description": "<routing description, third person, includes 'use when' trigger>",
"color": "#5B8DEF",
"display_name": "<friendly name>",
"role_title": "Routing & Sequencing",
"specialists": "api-engineer, web-engineer, qa-engineer, security-engineer",
"delegations": "API change → api-engineer\nWeb UI change → web-engineer\n..."
}
},
"agents": [
{
"archetype": "domain-engineer",
"values": {
"name": "api-engineer", "description": "...", "color": "#22C55E",
"display_name": "API Engineer", "domain": "API",
"owned_paths": "services/api/",
"primary_language": "TypeScript", "test_framework": "Vitest",
"build_command": "pnpm --filter api build",
"lint_command": "pnpm --filter api lint"
}
}
],
"skills": [],
"rules": ["01-plan-first", "03-definition-of-done", ...],
"hooks": ["notify", "session-init", "teammate-idle-gate"]
}
Every agent value must be filled — descriptions in third person, use when/use proactively/MUST BE USED triggers present, names lowercase-hyphens. The static linter will flag misses.
6. Materialize
python3 plugins/agents-team/lib/gen/scaffold.py <team.json> --target <project-dir>
This:
- Creates
<target>/.claude/{agents,skills,rules,hooks}.
- Renders archetype templates with each agent's values.
- Copies rules with
{{services}} / {{primary_locale}} filled in.
- Copies hooks with
{{TEAM_NAME}} filled in, marks them executable.
- Merges
settings.json.partial into <target>/.claude/settings.json.
- Runs the static linter (
/evaluate-agent) on every produced agent + skill — the self-eval gate.
Gate flags
--min-grade A|B|C|D|F — lowest acceptable grade per produced agent. Default B. Any agent below the floor exits with code 3 even when no agent triggered a revise/reject verdict. Use --min-grade A for production teams.
--no-self-eval — skips the linter entirely. Hard-gated: requires AGENTS_TEAM_DEV=1 in the environment, otherwise exits 64. The gate exists to catch the mistakes you'll make at 2am; do not skip it for production runs.
Exit codes
| Code |
Meaning |
0 |
All produced agents ship and at-or-above the floor |
1 |
At least one revise verdict from the linter |
2 |
At least one reject verdict from the linter |
3 |
All ship but at least one agent below --min-grade |
64 |
Bad CLI args (incl. --no-self-eval without AGENTS_TEAM_DEV=1) |
66 |
team.json or --target not found |
7. Read the self-eval report
If any agent comes back with verdict: reject, fix the offending values and re-run. Common fixes:
- Description too short / vague → expand to ≥80 chars with a
use when clause.
- Reviewer role with
Edit in tools → drop write tools.
- Body says read-only but tools include write → reconcile.
The whole point of the evaluator is that you don't ship a sub-par team because you forgot to put a use-when trigger in a description.
8. Idempotence
- If
<target>/.claude/agents/<name>.md already exists, ask before overwriting. Use AskUserQuestion.
- If the user wants to regenerate cleanly, archive the old
.claude/ to .claude.bak.YYYYMMDD-HHMMSS/ first.
- Re-running with the same team.json is safe (idempotent file writes).
Output
Generated team for E-Shop at /Users/.../my-shop/.claude
agents: 6
skills: 1
rules: 8
hooks: 4
settings: 1
=== Self-evaluation ===
shop-orch.md A 100/100 ship
api-engineer.md A 97/100 ship
web-engineer.md A 100/100 ship
payments-engineer.md A 95/100 ship
qa-engineer.md A 97/100 ship
security-engineer.md A 100/100 ship
=== Self-eval worst verdict: exit 0 ===
When to use this skill
- Brand-new project that needs a Claude Code agent team.
- Existing team where you want to regenerate cleanly from a refreshed PRD.
- Proof-of-concept where you want a team standing up in minutes.
Anti-patterns
- Inventing details the PRD doesn't specify. If the user said "TypeScript backend" and didn't pick a framework, ask. Don't pick Express on their behalf.
- Two specialists with overlapping mandates. The generator must enforce a clean delegation graph. If
api-engineer and services-engineer both say "owns the backend", merge them.
- Skipping the self-eval gate. It exists to catch the mistakes you'll make at 2am.
--no-self-eval is for development only, not for shipping.
- Auto-overwriting an existing team. Always ask, archive first.
- Persona names from sentra-hub or orch. Templates are de-personalized. Keep them that way unless the user explicitly asks for personas.
References
- Templates:
plugins/agents-team/templates/{agents,skills,rules,hooks}/
- Renderer:
plugins/agents-team/lib/gen/render.py
- Scaffolder:
plugins/agents-team/lib/gen/scaffold.py
- Self-eval:
/evaluate-agent (Phase 1 static linter)
- Sentra-hub layout (canonical reference for what "good" looks like):
/Users/fadymondy/Sites/sentra/sentra-hub/.claude/
Source: fadymondy/agents-team — distributed by TomeVault.
1---2name: team-gen3description: Generate a complete Claude Code agent team (orchestrator + specialists, skills, rules, hooks) from a product description. Reads a PRD file or inline brief, picks archetypes, fills templates, writes to .claude/, and runs the static linter on every produced file before exiting. Use when a new project needs an agent team, when an existing team needs to be regenerated cleanly, or when scaffolding a fresh proof-of-concept. Use when this capability is needed.4---56# /team-gen — Generate an agent team from a product description78This skill turns "build me a team" from a one-off craft into a measurable pipeline. It composes new teams from validated archetypes, then runs the evaluator on the result so you start with grade-A specialists, not whatever you happened to write at 2am.910## Quick start1112```bash13# From a PRD file14/team-gen ./docs/product.md --target .1516# Inline brief (you'll be asked clarifying questions)17/team-gen "An e-commerce backend with TypeScript API + React web + Stripe payments"1819# Dry-run: show what would be generated, don't write20/team-gen ./docs/product.md --target . --dry-run21```2223## Procedure2425### 1. Parse the brief2627- If the argument is a file path, read it.28- If inline, treat the string as the brief.29- Extract:30 - **Domains** (which services exist: api, web, mobile, payments, data, ml, devops, etc.)31 - **Tech stack** (TypeScript / Go / Python / Rust / Flutter, Postgres / Mongo, Vercel / GCP, etc.)32 - **Team size hint** (small = 4–6 specialists, default = 7–9, large = 10–12)33 - **Constraints** (regulated industry, multi-locale, always-on monitor needed, etc.)34- If anything is ambiguous, ask the user via `AskUserQuestion`. Do not invent.3536### 2. Pick archetypes3738Available agent archetypes in `plugins/agents-team/templates/agents/`:39- `orchestrator` — Opus, broad tools, delegates to all specialists40- `tech-leader` — Opus, read-only, architecture review41- `domain-engineer` — Sonnet, narrow whitelist, owns one path; instantiate one per domain42- `designer` — Sonnet, design system + UX43- `qa-engineer` — Sonnet, isolation: worktree44- `security-engineer` — Sonnet, read-mostly, OWASP focus45- `devops-engineer` — Sonnet, broad bash, smallest pipeline diffs46- `monitor` — Haiku, background: true, silent-by-default4748Always include **orchestrator + qa-engineer + security-engineer**. Add specialists per detected domain. Add a `monitor` if the team is ≥6 agents or the brief mentions "always-on" / "production".4950### 3. Pick rules5152`plugins/agents-team/templates/rules/` has 13 numbered rule templates. Always include `01-plan-first`, `03-definition-of-done`, `04-clarify-unknowns`, `08-client-first-communication`, `09-no-quick-fixes`, `13-model-selection`. Add `02-service-boundaries` and `10-style-per-service` if there are 2+ services. Add `12-security-vapt` if the brief mentions auth, payments, PII, or external traffic.5354### 4. Pick hooks5556`plugins/agents-team/templates/hooks/` has `notify`, `session-init`, `teammate-idle-gate`, `post-commit-check`. Default to all four. The `settings.json.partial` wires them up.5758### 5. Build a `team.json` spec5960Write a JSON file at `<target>/.claude/team.json` (or `/tmp/team-gen-<timestamp>.json` for dry-run) with this shape:6162```json63{64 "team_name": "<team-name>",65 "services": ["api", "web", "payments"],66 "primary_locale": "en",67 "orchestrator": {68 "archetype": "orchestrator",69 "values": {70 "name": "<team>-orch",71 "description": "<routing description, third person, includes 'use when' trigger>",72 "color": "#5B8DEF",73 "display_name": "<friendly name>",74 "role_title": "Routing & Sequencing",75 "specialists": "api-engineer, web-engineer, qa-engineer, security-engineer",76 "delegations": "API change → api-engineer\nWeb UI change → web-engineer\n..."77 }78 },79 "agents": [80 {81 "archetype": "domain-engineer",82 "values": {83 "name": "api-engineer", "description": "...", "color": "#22C55E",84 "display_name": "API Engineer", "domain": "API",85 "owned_paths": "services/api/",86 "primary_language": "TypeScript", "test_framework": "Vitest",87 "build_command": "pnpm --filter api build",88 "lint_command": "pnpm --filter api lint"89 }90 }91 ],92 "skills": [],93 "rules": ["01-plan-first", "03-definition-of-done", ...],94 "hooks": ["notify", "session-init", "teammate-idle-gate"]95}96```9798Every agent value must be filled — descriptions in third person, `use when`/`use proactively`/`MUST BE USED` triggers present, names lowercase-hyphens. The static linter will flag misses.99100### 6. Materialize101102```bash103python3 plugins/agents-team/lib/gen/scaffold.py <team.json> --target <project-dir>104```105106This:107- Creates `<target>/.claude/{agents,skills,rules,hooks}`.108- Renders archetype templates with each agent's values.109- Copies rules with `{{services}}` / `{{primary_locale}}` filled in.110- Copies hooks with `{{TEAM_NAME}}` filled in, marks them executable.111- Merges `settings.json.partial` into `<target>/.claude/settings.json`.112- Runs the static linter (`/evaluate-agent`) on every produced agent + skill — the **self-eval gate**.113114#### Gate flags115116- `--min-grade A|B|C|D|F` — lowest acceptable grade per produced agent. Default `B`. Any agent below the floor exits with code `3` even when no agent triggered a `revise`/`reject` verdict. Use `--min-grade A` for production teams.117- `--no-self-eval` — skips the linter entirely. **Hard-gated**: requires `AGENTS_TEAM_DEV=1` in the environment, otherwise exits `64`. The gate exists to catch the mistakes you'll make at 2am; do not skip it for production runs.118119#### Exit codes120121| Code | Meaning |122|------|------------------------------------------------------------|123| `0` | All produced agents `ship` and at-or-above the floor |124| `1` | At least one `revise` verdict from the linter |125| `2` | At least one `reject` verdict from the linter |126| `3` | All `ship` but at least one agent below `--min-grade` |127| `64` | Bad CLI args (incl. `--no-self-eval` without `AGENTS_TEAM_DEV=1`) |128| `66` | `team.json` or `--target` not found |129130### 7. Read the self-eval report131132If any agent comes back with `verdict: reject`, fix the offending values and re-run. Common fixes:133- Description too short / vague → expand to ≥80 chars with a `use when` clause.134- Reviewer role with `Edit` in tools → drop write tools.135- Body says read-only but tools include write → reconcile.136137The whole point of the evaluator is that you don't ship a sub-par team because you forgot to put a use-when trigger in a description.138139### 8. Idempotence140141- If `<target>/.claude/agents/<name>.md` already exists, **ask before overwriting**. Use `AskUserQuestion`.142- If the user wants to regenerate cleanly, archive the old `.claude/` to `.claude.bak.YYYYMMDD-HHMMSS/` first.143- Re-running with the same team.json is safe (idempotent file writes).144145## Output146147```148Generated team for E-Shop at /Users/.../my-shop/.claude149 agents: 6150 skills: 1151 rules: 8152 hooks: 4153 settings: 1154155=== Self-evaluation ===156 shop-orch.md A 100/100 ship157 api-engineer.md A 97/100 ship158 web-engineer.md A 100/100 ship159 payments-engineer.md A 95/100 ship160 qa-engineer.md A 97/100 ship161 security-engineer.md A 100/100 ship162=== Self-eval worst verdict: exit 0 ===163```164165## When to use this skill166167- Brand-new project that needs a Claude Code agent team.168- Existing team where you want to regenerate cleanly from a refreshed PRD.169- Proof-of-concept where you want a team standing up in minutes.170171## Anti-patterns172173- **Inventing details the PRD doesn't specify.** If the user said "TypeScript backend" and didn't pick a framework, ask. Don't pick Express on their behalf.174- **Two specialists with overlapping mandates.** The generator must enforce a clean delegation graph. If `api-engineer` and `services-engineer` both say "owns the backend", merge them.175- **Skipping the self-eval gate.** It exists to catch the mistakes you'll make at 2am. `--no-self-eval` is for development only, not for shipping.176- **Auto-overwriting an existing team.** Always ask, archive first.177- **Persona names from sentra-hub or orch.** Templates are de-personalized. Keep them that way unless the user explicitly asks for personas.178179## References180181- Templates: `plugins/agents-team/templates/{agents,skills,rules,hooks}/`182- Renderer: `plugins/agents-team/lib/gen/render.py`183- Scaffolder: `plugins/agents-team/lib/gen/scaffold.py`184- Self-eval: `/evaluate-agent` (Phase 1 static linter)185- Sentra-hub layout (canonical reference for what "good" looks like): `/Users/fadymondy/Sites/sentra/sentra-hub/.claude/`186187---188> Source: [fadymondy/agents-team](https://github.com/fadymondy/agents-team) — distributed by [TomeVault](https://tomevault.io).189<!-- tomevault:4.0:skill_md:2026-05-23 -->