team-feature
Feature Team
Create an Agent Team with automatically selected specialists to implement new features through parallel workstreams.
Instructions
- Analyze the feature (description, issue, or spec) to determine scope and components
- Select appropriate specialists based on the selection matrix below
- Create the agent team with only the selected specialists
- Have them coordinate on integration points and produce a completion report
Step 0: Scope Detection
Parse $ARGUMENTS to determine the analysis target.
See references/agent-team/scope-detection.md for full detection rules.
| Flag | Scope | Action |
|---|---|---|
--pr <N> |
PR | gh pr diff <N> + gh pr view <N> --json title,body,files |
--issue <N> |
Issue | gh issue view <N> --json title,body,comments |
--commit <ref> |
Commit | git show <ref> or git diff <range> |
--diff |
Unstaged changes | git diff |
--staged |
Staged changes | git diff --staged |
--branch <name> |
Branch diff | git diff main...<name> |
| Path pattern | File/Directory | Glob + Read |
| Free text | Description | Use as context for analysis |
| (empty or ambiguous) | Unknown | Ask user to specify target |
Step 1: Feature Analysis
Before spawning any teammates, analyze the target to determine the feature type:
| Signal | Type |
|---|---|
| UI components, screens, layouts, user interactions, styling | UI Feature |
| Endpoints, handlers, request/response schemas, middleware | API Feature |
| Schemas, migrations, queries, storage, ETL, indexing | Data Feature |
| Third-party APIs, webhooks, OAuth, external services | Integration |
| CI/CD, deployment, monitoring, scaling, configuration | Infrastructure |
| Mixed signals | Analyze dominant patterns and apply multiple types |
Step 2: Specialist Selection Matrix
| Specialist | UI Feature | API Feature | Data Feature | Integration | Infrastructure |
|---|---|---|---|---|---|
| API Designer | If needs API | Always | Always | Always | Skip |
| UI Implementer | Always | Skip | If has UI | If has UI | Skip |
| Data Modeler | If data-driven | Always | Always | Always | If storage-related |
| Business Logic | Always | Always | Always | Always | Skip |
| Test Writer | Always | Always | Always | Always | Always |
| Doc Writer | Always | Always | Always | Always | Always |
| Security Analyst | If auth-related | Always | If PII | Always | Always |
Selection Rules
- Always: Spawn this specialist unconditionally
- Skip: Do not spawn this specialist
- Conditional: Spawn only if the condition is met based on feature analysis
When uncertain, include the specialist (prefer thoroughness over efficiency).
Step 3: Team Creation
Spawn only the selected specialists using the Task tool (subagent_type: "general-purpose").
Execution Rules:
- Send ALL Task tool calls in a single message for parallel execution
- Each subagent runs in its own context and returns findings to the lead (main context)
- Provide each subagent with the full target context (feature spec, file contents, etc.) in the prompt
- The lead (main context) is responsible for synthesis — do NOT spawn a subagent for synthesis
-
API Designer: Design API endpoints, request/response schemas, error handling, versioning, and integration contracts.
-
UI Implementer: Implement user interface components, layouts, interactions, accessibility, and responsive design.
-
Data Modeler: Design data schemas, migrations, relationships, indexes, and data access patterns.
-
Business Logic Implementer: Implement core business rules, validation logic, workflows, and domain-specific algorithms.
-
Test Writer: Create unit tests, integration tests, and edge case tests for all new functionality.
-
Doc Writer: Create or update API documentation, user guides, and inline code documentation.
-
Security Analyst: Review for authentication, authorization, input validation, data protection, and security best practices.
Workflow
- Lead analyzes the feature and decomposes it into parallel workstreams
- Each selected specialist works on their designated component
- Specialists coordinate on integration points and shared interfaces
- Lead orchestrates integration and produces a completion report with:
- Completed components and their status
- Integration verification results
- Remaining tasks or follow-up items
Output
The lead produces a final implementation summary including:
- Feature type detected and specialists selected (with reasoning)
- Completed components with integration status
- Test coverage summary
- Remaining tasks or known limitations