Team lead skill that decomposes a feature, defines shared contracts, coordinates Agent Teams (creative track) and Ralph loops (mechanical track).
You are the team lead. Your job is to decompose a feature, define shared contracts, coordinate creative work via Agent Teams, and hand off mechanical work to Ralph loops.
Read the existing prd.json. If it doesn't exist, tell the user to run /prd first.
Analyze all stories and identify:
BEFORE any agent starts working, create shared-contracts.md with EXACT values for everything shared across stories. This is the most critical step — without it, agents will invent incompatible names.
Create the file with these sections:
| Endpoint | Method | Request Schema | Response Schema | Used by |
|----------|--------|---------------|-----------------|---------|
| /api/v1/users | POST | { email: string, name: string } | { id: string, ... } | story-003, story-005 |
| Component | File Path | Props Interface | Used by |
|-----------|-----------|-----------------|---------|
| UserCard | src/components/UserCard.tsx | UserCardProps | story-004, story-006 |
| Element | data-testid | Used by |
|---------|-------------|---------|
| Login button | login-submit-btn | story-003, story-008 |
| Table | Column | Type | Used by |
|-------|--------|------|---------|
| users | email | VARCHAR(255) UNIQUE | story-002, story-003 |
| Type Name | File | Definition | Used by |
|-----------|------|------------|---------|
| User | src/types/user.ts | { id: string; email: string; name: string } | story-002 through story-008 |
For stories marked "track": "creative", spawn an Agent Team:
Create an agent team for the creative design phase. Spawn teammates:
- API Designer: Design REST endpoints and data contracts per shared-contracts.md
- UX Strategist: Define component hierarchy, user flows, and interaction patterns
- Test Architect: Design test strategy, define E2E scenarios, set up test infrastructure
Require plan approval before any teammate writes code.
All teammates MUST reference shared-contracts.md for identifiers. Do NOT invent new names.
Wait for the creative track to complete and update shared-contracts.md with any new decisions before proceeding.
Once creative stories are done and contracts are finalized:
shared-contracts.md is completeprd.json are marked passes: trueThe creative phase is complete. Shared contracts are defined.
Run the mechanical track:
./scripts/ralph.sh 15 --worktree
Or for parallel execution on independent modules:
./scripts/ralph.sh 10 --branch feature/frontend --worktree &
./scripts/ralph.sh 10 --branch feature/backend --worktree &
wait
After both tracks complete:
Use a subagent to verify all shared contracts are satisfied:
Use a subagent to grep across all source files, test files, and E2E specs.
Verify every identifier in shared-contracts.md is used correctly and consistently.
Report any mismatches.
Run the full test suite
Run type checking
Review any stories that failed and decide on next steps