Work
Team-based TDD execution with adaptive complexity and agent delegation
SKILL.md.claude/skills/compound/work/SKILL.md
GitHubWork Skill
Overview
Execute implementation through an AgentTeam using adaptive TDD. The lead coordinates and delegates -- agents write code.
Methodology
- Pick tasks from
bd readyor$ARGUMENTS - Mark tasks in progress:
bd update <id> --status=in_progress - Read the epic description (
bd show <epic>) for spec context -- EARS requirements guide what "done" looks like - Read Acceptance Criteria: Locate the
## Acceptance Criteriatable in the parent epic description. Each AC row defines a testable criterion that the implementation must satisfy. If no AC section exists, flag as a process gap and proceed using EARS requirements directly. - Read Verification Contract: Locate the
## Verification Contractsection in the parent epic description.- Treat
Required evidenceas the epic's definition of done. - Use
Profile,Surfaces, andRisksto decide what evidence must be produced during implementation, not just at review time. - If the contract is missing: flag it as a process gap and fall back to the acceptance criteria, EARS requirements, and legacy
test+lintgates.
- Treat
- Run
ca searchper agent/subtask for targeted context. Display results. - Assess parallelization: identify independent tasks that can be worked simultaneously
- Deploy an AgentTeam (TeamCreate + Task with
team_name) with MULTIPLE test-writers and implementers:- Role skills:
.claude/skills/compound/agents/{test-writer,implementer}/SKILL.md - Scale teammate count to independent tasks; pairs coordinate via SendMessage on shared interfaces
- Role skills:
- Agents communicate via SendMessage when working on overlapping areas.
- Lead coordinates: review agent outputs, resolve conflicts, verify tests pass. Do not write code directly.
- If implementation diverges from spec requirements, acceptance criteria, or the Verification Contract, stop and discuss with user via AskUserQuestion before proceeding.
- If blocked, use AskUserQuestion to get user direction.
- Shut down the team when done: send shutdown_request to all teammates.
- Commit incrementally as tests pass.
- Run full test suite for regressions.
- Close tasks:
bd close <id>
Memory Integration
- Run
ca searchper delegated subtask with the subtask's specific description - Each agent receives memory items tailored to their assigned task, not a shared blob
- Run
ca learnafter corrections or novel discoveries
MANDATORY VERIFICATION -- DO NOT CLOSE TASK WITHOUT THIS
Before bd close, you MUST:
- Read the parent epic's
Required evidencelist and satisfy every listed item. The minimum legacy floor istestandlint. - Run
pnpm testthenpnpm lint - If
Required evidenceincludesbuild, runpnpm build - Produce the contract-specific evidence needed for the touched surfaces:
browser_evidence/responsive_check/edge_states_check/a11y_smoke: capture runtime/browser proof and summarize it in the review handoffcontract_checks/contract_examples: run representative requests/examples and record outcomescommand_transcript: record happy-path and bad-input CLI flowsexamples_run/docs_examples_sync: run or update public examples alongside the code
- Run
/implementation-revieweron changed code -- wait for APPROVED If REJECTED: fix ALL issues, re-run required evidence, resubmit. INVIOLABLE per CLAUDE.md.
The full 8-step pipeline (invariant-designer through implementation-reviewer) is recommended
for complex changes. For all changes, /implementation-reviewer is the minimum required gate.
Beads Lifecycle
bd readyto find available tasksbd update <id> --status=in_progresswhen startingbd close <id>when all tests pass
Parallelization Strategy
- Always prefer parallel work: independent tasks should be assigned to different teammate pairs simultaneously
- Scale the team adaptively: deploy multiple test-writer + implementer pairs proportional to independent task count
- Subagent spawning within teammates: each teammate should spawn opus subagents for independent subtasks (e.g., a test-writer spawning subagents to write tests for multiple modules in parallel)
- Coordinate on shared interfaces: teammates working on overlapping APIs must communicate via SendMessage before implementing
Literature
- Consult
docs/compound/research/tdd/for TDD methodology, test-first development evidence, and best practices - Consult
docs/compound/research/property-testing/for property-based testing theory and invariant design - Run
ca knowledge "TDD test-first"for indexed knowledge on testing methodology - Run
ca search "testing"for lessons from past TDD cycles
Common Pitfalls
- Lead writing code instead of delegating to agents
- Not injecting memory context into agent prompts
- Modifying tests to make them pass instead of fixing implementation
- Not running the full test suite after agent work completes
- Ignoring acceptance criteria from the parent epic
- Ignoring the Verification Contract and closing work with only test/lint evidence
Quality Criteria
- Tests existed before implementation code
- Agents received relevant memory context
- Lead coordinated without writing implementation code
- Incremental commits made as tests pass
- All tests pass after refactoring
- Task lifecycle tracked via beads (
bd) - Implementation aligns with spec requirements from epic
- Implementation satisfies acceptance criteria from parent epic
- Implementation produced the evidence required by the parent epic's Verification Contract
PHASE GATE 3 -- MANDATORY
Before starting Review, verify ALL work tasks are closed:
bd list --status=in_progressmust return emptybd list --status=openshould only have Review and Compound tasks remaining If any work tasks remain open, DO NOT proceed. Complete them first.