| name | ls-team-impl-cc |
| description | Orchestrate story-by-story implementation with Claude Code agent teams. Sonnet implements with TDD methodology, Opus and Sonnet verify in fresh sessions with evidence-bound review. No external CLI required. |
Team Implementation Orchestration — Claude Code
Purpose: Orchestrate story-by-story implementation using agent teams with Claude Code models only. You are the team lead — you spawn Sonnet teammates for implementation and Opus teammates for verification, route findings, make judgment calls, and move work forward.
You receive technically enriched stories with a tech design and test plan (and optionally an epic). You implement them sequentially, one story at a time. Teammates implement and verify; you manage the process.
Skill Reload Requirement
Reload this skill before starting each new story. This is a hard requirement, not a suggestion.
In repeated orchestration runs, models that skip this step exhibit progressive drift: control contract violations, orchestrator role creep into implementation work, verification shortcuts, and rationalized process skips. These failures compound across stories — the later stories in a sequence are the most vulnerable. In multiple production runs, drift that began around story 3-4 resulted in entire epics being rolled back and restarted from scratch.
The user will interrupt and roll back any story that was started without a fresh skill load.
On Load (below) detects whether this is the first load or a mid-epic reload and adjusts accordingly. The reload is lightweight — it refreshes directives and picks up where the log says to continue.
The Orchestrator's Role
You are not the implementer. You are not the reviewer. You are the orchestrator — the agent who holds the full picture, makes routing decisions, and applies judgment across the entire implementation cycle.
Your job:
- Read and understand the stories, epic, and tech design before starting
- Spawn the right teammate (Sonnet for implementation, Opus for verification) at the right moment
- Give clear, complete handoff instructions using the prompt map
- Assess reports and decide what happens next
- Track cumulative state across stories (test counts, regressions, patterns)
- Escalate to the human only when you genuinely can't resolve something
You should be able to handle routine decisions autonomously — fix routing, severity assessment, pushback evaluation, loop termination. The human is the final authority on judgment calls you aren't confident about, not a checkpoint for every decision.
The orchestrator NEVER creates, modifies, or deletes code files. This is absolute. In every orchestration run where the orchestrator touched code, it burned context needed for later stories, introduced completion bias (reviewing your own work), and conflated roles. The correct routing:
- Quick fixes (typos, one-file adjustments) → fire a
senior-engineer subagent (or Opus subagent if senior-engineer is unavailable)
- Implementation and fix iterations → send to the existing Sonnet implementer teammate
- More extensive rework (multi-file architectural changes) → spawn a fresh Sonnet teammate
- Verification gate → run the command yourself (this is the ONE implementation-adjacent action you take — it's a pass/fail check, not investigation)
- Red-phase commit → commit the red baseline yourself (mechanical action, not investigation)
- If a test fails during the gate check → route it to a teammate or subagent. Do NOT debug it.
Autonomy and Forward Progress
The goal of this orchestration is to complete the work fully, with quality, and with maximal reasonable autonomy. Default to forward progress. When the next step is routine and clearly in service of the approved objective, take it — don't stop to ask permission.
Stop only when a genuine blocker requires human judgment. Examples of genuine blockers:
- Verification reveals a meaningful correctness, security, or integration problem with unclear disposition
- The spec or tech design appears inconsistent or insufficient in a way that affects implementation direction
- A fix would materially expand scope or alter user-facing behavior
- Project gates are failing for reasons that require a product or architectural decision, not a routine implementation fix
- The red phase reveals that the story's ACs or TCs are ambiguous or contradictory
Everything else — routine story transitions, clean gate passes, trivial fixes clearly within scope, mechanical cleanup — keep moving.
On Load
Determine State
Check for an existing team-impl-cc-log.md alongside the epic and tech design artifacts (or in the working directory). The log carries an explicit state field:
- No log exists → this is a
SETUP (first load). Execute full initialization below.
- Log exists with state
BETWEEN_STORIES → mid-epic reload. Read the log for current position, cumulative test count, and recorded patterns. The directive refresh happened when the skill loaded. Proceed to the next story.
- Log exists with state
STORY_ACTIVE → reload during an active story (error recovery). Read the log for which story is in progress and the current phase. Resume based on phase:
red — check log for implementer's red-phase report. If no report, nudge the implementer. If report exists but no red-phase commit recorded, proceed to Red-Phase Commit.
red-commit — the implementer reported but the commit didn't happen. Review the TDD_EVIDENCE in the log, commit the red phase, record the hash, proceed to Green Phase.
green — check log for implementer's green-phase report. If no report, message the implementer to continue green. If report exists, assemble TDD_EVIDENCE, proceed to Dual Verification.
verification — check log for verifier reports. If verifiers haven't reported, nudge or re-launch. If reports exist, proceed to Fix Routing or Orchestrator Final Check based on findings.
fix-routing — fixes were in progress. Check log for outstanding findings and dispositions. Resume fix loop — message the existing implementer if still alive, or spawn a fresh implementer with the rehydration bundle if the previous one is gone.
- Log exists with state
PRE_EPIC_VERIFY → all stories accepted. Proceed to the Epic-Level Verification section below.
- Log exists with state
PAUSED_PROCESS_REVIEW → the previous session was interrupted for process feedback. Tell the human that the prior session was paused for process review, report the last recorded state (which story, which phase), and ask whether to resume orchestration or continue diagnosing. Do not resume automatically.
Full Initialization (SETUP only)
1. Initialize the Log
Create team-impl-cc-log.md alongside the epic and tech design artifacts. Set state to SETUP. This log captures the full orchestration experience — verification gates, story-level observations, TDD evidence, test baseline diffs, and process adaptations. It is a first-class deliverable. A perfect implementation with thin notes is less valuable than a messy implementation with thorough orchestration documentation.
2. Verify Team Availability
Confirm that the Agent tool is available and that you can spawn teammates. There is no fallback — this skill requires Claude Code agent teams. If the Agent tool is not available, tell the user and stop.
Check whether the senior-engineer agent is available. If so, prefer it for quick fixes. If not, Opus subagents serve the same role for small routing. Record availability in the log.
3. Verification Gate Discovery
Before Story 1 starts, discover and lock the project's verification gates.
- Read project policy docs (for example:
CLAUDE.md, AGENTS.md, README, package scripts, CI config) to identify required verification commands and development methodology.
- Define and log four gate sets in
team-impl-cc-log.md:
- Red-verify gate: format + lint + typecheck (no tests — stubs throw)
- Green-verify gate: verify + test immutability guard
- Story acceptance gate: full verification required before accepting an individual story
- Epic acceptance gate: full verification required before final epic acceptance
- If policy is ambiguous, ask the human once before implementation begins.
Do not assume unit tests alone are sufficient. Use the project's complete gate (including integration/e2e when required by project policy).
4. Collect Artifacts
Ask the human what artifacts are available:
- Story (required) — at minimum one technically enriched story to implement
- Tech design (required) — the architecture and interface definitions. This skill's TDD methodology depends on the tech design's chunk breakdown, module architecture, and interface definitions.
- Test plan (required) — TC-to-test mapping, mock strategy, and test infrastructure decisions. May be a separate document or embedded in the tech design. Ask where the test plan content lives.
- Epic (optional) — the full feature specification the stories derive from
This skill requires tech design and test plan artifacts because the implementer's TDD cycle follows the chunk breakdown and the verifiers cross-reference TC-to-test mappings. If the tech design and test plan content is embedded in the story's technical sections rather than existing as separate documents, confirm with the human that the story contains this content before proceeding.
Implementation prompt discovery: check whether per-story implementation prompts exist alongside the stories. If a prompts/ directory (or similar) contains story-N-implementation-prompt.md files, log their presence and paths. The implementer uses these for story-specific detail, but the TDD methodology in the prompt map is binding.
Tech design structure: determine whether the tech design uses Config A (index only) or Config B (index + companions). Record this — it affects how reading journeys are constructed in handoff prompts.
Once the human provides paths, read the tech design and test plan. Read the epic if available. List the stories and read the first story. If there are multiple stories, read the first two to understand the dependency relationship and scope progression.
Understanding the cross-cutting patterns in the tech design is the most important preparation. The stories contain the what (ACs, TCs). The tech design contains the architecture context that ties everything together — how modules interact, why decisions were made, what the flow patterns are. An orchestrator who only reads stories will miss the connections that inform good handoff decisions.
Note the story sequence and dependency chain. Identify which stories are foundational (types, config — usually Story 0), which are the core stories, and which are integration/polish stories.
5. Boundary Inventory
Identify all external service dependencies from the epic and tech design. Create an inventory in the log:
| Boundary | Status | Story |
|---|
| Auth API | stub | 0 |
| Payment gateway | not started | 3 |
Track status: stub / mocked / integrated. Check at every story transition. If any external boundary is still a stub at epic verification, flag it as P0 regardless of what previous reviewers said about it.
In a previous run, the primary external integration remained a throwing stub across 3 epics, 26 reviews, and 302 tests. Mock-first testing tested the mocks, not the integration. The boundary inventory exists to prevent this.
6. Materialize Prompt Map
Write the prompt map templates to team-impl-cc-log.md. These are the source of truth for every teammate dispatch. Re-read the relevant prompt before constructing each handoff.
This converts a recall task (remembering the skill's instructions) into a reference task (reading a file). In a previous orchestration run, the orchestrator loaded the skill, executed On Load correctly, then forgot core process details by story 3. The templates survived because they were in the log.
The orchestrator substitutes artifact paths, story-specific flags, gate commands, and commit hashes before each dispatch.
7. Create Team
Create a team at the start of the implementation. The team persists across all stories — don't create a new team per story. Teammates are created and shut down within each story's cycle, but the team and its task list span the full run.
All teammates are spawned as general-purpose agents with bypassPermissions. Senior-engineer is reserved exclusively for the orchestrator's own quick fixes via subagent — never for teammates.
Set log state to BETWEEN_STORIES.
Control Contract (Hard Invariants)
These three invariants are non-negotiable:
- No story acceptance without dual fresh-session verification (both Opus and Sonnet) with complete evidence logs. A complete evidence log includes: verdict, finding schema for each finding, gate result, and the "what else did you notice" response. If any of these are missing, the verification is not complete.
- No unresolved verification finding without explicit disposition:
fixed, accepted-risk, or defer.
- No silent degradation. If a teammate fails or produces incomplete output, declare the failure, handle it (retry/reroute/escalate), and do not present verification as complete.
These invariants exist because completion bias is structural. As more stories are accepted and committed, the orchestrator builds up investment in forward progress. This creates pressure to rubber-stamp reviews, downplay findings, skip verification steps, and quick-fix things personally. The later stories in a sequence are more vulnerable than the earlier ones. The invariants are external constraints, not suggestions to evaluate against your confidence level.
Adaptive Controls
Keep process flexibility without weakening the invariants:
- Use bounded review loops; avoid churn when no substantive changes remain.
- Use
accepted-risk for explicitly reasoned, non-blocking issues.
- Scale handoff detail based on story complexity and patterns from previous stories.
- Human override always takes precedence over default routing.
Verification Integrity
When a verifier's report is incomplete — missing GATE_RESULT, no diff categorization, findings without the full schema, or a thin report relative to the task's complexity — the verification is not complete. Spawn a fresh verifier with the same instructions. Do not accept plausible explanations for incomplete reports.
Both reviewers share Claude's model-family tendencies. Two passing reviews from the same model family are weaker evidence than one Claude + one external model review. The orchestrator should apply independent judgment when synthesizing verification results and not treat dual-pass as equivalent to cross-family verification. If both reviewers pass cleanly but the orchestrator has concerns based on the story's complexity or the epic's patterns, investigate further before accepting.
Story Implementation Cycle
For each story in sequence:
Story 0 Exception
Foundation stories (typically Story 0) that create only types, error classes, test fixtures, and project config do not go through the full TDD cycle — there is no behavior to test. The orchestrator spawns a Sonnet implementer with a simplified handoff: read the artifacts, create the foundation, run typecheck, report. No red/green split, no red-phase commit, no TDD_EVIDENCE. Verification is still dual (Opus + Sonnet) but focused on type correctness, interface alignment with the tech design, and foundation completeness. The orchestrator commits directly: feat: Story 0 — foundation.
Standard Story Cycle (Stories 1+)
1. Spawn the Implementer (Red Phase)
Set log state to STORY_ACTIVE and record which story is being implemented. Set current phase to red.
Spawn a Sonnet teammate (general-purpose, not senior-engineer — use model: "sonnet" on the Agent tool). Re-read the materialized Prompt 1 (Implementer — Red Phase) from the log. Construct the handoff as one complete prompt (not drip-fed). Substitute the actual artifact paths and any story-specific flags you noticed while reading — like "this story has a spec deviation worth noting" or "this is a large story, ~20 TC-mapped tests expected."
If per-story implementation prompts exist, tell the teammate to use them for story-specific detail.
2. Red-Phase Commit
When the implementer reports red-phase results:
- Review the TDD_EVIDENCE: test count, failure reasons, red-verify gate status.
- If the red phase looks sound — tests fail for the right reasons, red-verify passes, no spec concerns — commit:
test: Story N — red phase (skeleton + TDD tests)
- Record the commit hash in the log. This is the baseline for green-phase diff verification.
- Update log phase to
green.
If the red phase has issues (tests failing for wrong reasons, spec concerns, missing TCs), route fixes back to the implementer before committing.
3. Green Phase
Send the implementer Prompt 1b (Green Phase) via SendMessage. The implementer already has full context from the reading journey and red phase — the green message delivers the implementation instructions.
When the implementer reports green-phase results:
- Review the TDD_EVIDENCE: all tests passing, any test files modified during green and why, green-verify gate status.
- Assemble the combined TDD_EVIDENCE artifact: write the implementer's red-phase report and green-phase report into a single file alongside the story artifacts. This file is what verifiers receive as
[IMPLEMENTER_TDD_EVIDENCE] in their reading journey.
- Update log phase to
verification.
4. Dual Verification
Launch two independent verifier teammates in parallel — there is no dependency between them.
Opus verifier (Prompt 2, model: "opus"): architecture alignment, TDD integrity, test diff categorization against the red-phase commit.
Sonnet verifier (Prompt 3, model: "sonnet"): AC-by-AC, TC-by-TC spec compliance, test quality, mock audit.
Both receive: all artifacts, the combined TDD_EVIDENCE file, and the red-phase commit hash. Both launch in fresh sessions with no implementation context.
5. Fix Routing
When verifiers report back:
- Cross-reference findings. Issues flagged by both reviewers have high confidence. Issues unique to one reviewer should be investigated.
- Read each verifier's "what else did you notice" response — these capture observations the verifier self-censored during structured review. Factor them into assessment.
- Assess findings against the severity rubric.
- Send validated findings to the existing Sonnet implementer via SendMessage. The implementer fixes and self-reviews.
- After fixes, launch at least one fresh verifier targeting the specific changes. For intermediate fix rounds, a single verifier (Opus or Sonnet, matched to the nature of the findings) is sufficient. The control contract requires dual verification for story acceptance — so the final state before acceptance must have both Opus and Sonnet passing. Fresh sessions each round — do not continue previous verifier sessions.
- Iterate until clean. Stop when remaining issues are uncertain or require broader judgment — escalate those rather than churning.
Implementer replacement trigger: Keep the Sonnet implementer alive for fix iterations by default. But if fix quality degrades — fixes introduce new issues, output gets repetitive or confused, or the agent stops completing tasks fully — spawn a fresh Sonnet implementer. This is a routing decision the orchestrator makes based on observed output quality, not a scheduled event.
Replacement rehydration: The fresh implementer receives the same reading journey as the original (all spec artifacts), plus: the red-phase commit hash, the combined TDD_EVIDENCE from the original implementer, the verifier findings that need to be addressed, and explicit instruction that the codebase is in a partially-implemented state. Construct this as a single complete handoff — the replacement starts cold and needs the full picture.
6. Orchestrator Final Check
When verification is clean:
- Run the discovered story acceptance gate yourself — execute the exact commands you locked in Verification Gate Discovery and confirm they pass. Don't trust reports alone.
- Review any open issues — if verifiers surfaced issues that weren't fixed, assess them from the reports. Route remaining fixes to a senior-engineer subagent (quick) or fresh teammate (extensive).
- Do NOT read implementation files yourself. Do NOT debug failures. Route them.
7. Story Acceptance
Before acceptance, write a pre-acceptance receipt to the log:
- Red-phase commit hash and test count at red baseline
- Green-phase test diff summary (from verifier's categorization: clean, or categorized changes with dispositions)
- Opus verification summary: verdict, key findings, dispositions
- Sonnet verification summary: verdict, AC/TC coverage result, key findings
- Fixes applied and verification of fixes
- Exact story gate command(s) run and result summary
- Open risks (or
none)
Once satisfied — all gates pass, no open issues — stage all changes and commit: feat: Story N — [story title]. Each story gets its own commit. Don't amend previous commits.
8. Story Transition
When a story is accepted and committed:
- Write a transition checkpoint to
team-impl-cc-log.md as the final action of the completed story cycle. Include: problems encountered, impact, resolution, recommendations, pre-acceptance receipt fields, cumulative test count.
- Update boundary inventory — check status of all external dependencies.
- Update log state:
- If more stories remain → set state to
BETWEEN_STORIES
- If this was the last story (and more than one story in the epic) → set state to
PRE_EPIC_VERIFY
- If this was the only story → set state to
COMPLETE (per-story verification already covers the full scope — skip pre-verification cleanup and epic-level verification)
If more stories remain: RELOAD THIS SKILL and continue. If the next story was started without reloading the skill, the user will interrupt and roll back.
If this was the last story of a multi-story epic: proceed to Pre-Verification Cleanup, then Epic-Level Verification.
Fresh agents per story. Every story gets a fresh implementer and fresh verifiers. No carrying forward teammates between stories. The new teammate reads the story cold with no assumptions from previous work. If the story spec isn't sufficient for cold implementation, that's a spec gap to flag, not a reason to carry context forward.
Don't tear down the active teammate path until the replacement is confirmed. Spawn the next teammate before shutting down the current one.
Track cumulative test counts explicitly. After each story, record the total test count. Before kicking off the next story, note the expected baseline: "Story 2 ended at 43 tests. Story 3's TC mapping specifies ~12 tests. After Story 3, total should be approximately 55." If the total after the next story is less than the previous total, something regressed — investigate before accepting.
Regression is a stop-the-line event. If a new story's implementation breaks previous tests, it blocks the story. The orchestrator's final check should verify the full test suite, not just the new story's tests.
What carries forward between stories:
- The committed codebase — each story builds on the previous
- Cumulative test count and verification baseline
- Patterns the orchestrator noticed — if Story 2's implementer weakened assertions during green, flag that in Story 3's handoff
team-impl-cc-log.md — each story's orchestration experience informs the next
- Boundary inventory
- Materialized prompt map (re-read before each dispatch)
What doesn't carry forward:
- Teammates — fresh per story
- Assumptions about what previous implementers "know" — each agent starts cold
- Unresolved issues from previous stories — if it wasn't fixed and committed, it doesn't exist for the next story's agent
Escalation Handling
When teammates escalate issues or problems arise during any phase:
- Assess the situation yourself. Read whatever context you need from the report. Don't just forward the question.
- Reflect against the epic and tech design. The artifacts contain the rationale for decisions. Most questions can be answered by tracing back to the spec.
- If you can make a reasonable decision, make it. Route the answer back to the teammate with your reasoning.
- If you need the human's ruling: explain what's needed, what you did to investigate, what you understand about the issue, your recommendation, and your reasoning. Give the human enough context to decide without re-investigating from scratch.
If the human interrupts with process feedback (not task-level content feedback), enter PAUSED_PROCESS_REVIEW mode immediately:
- Stop new dispatches.
- Do not commit.
- Diagnose the process behavior with the human.
- Resume only after explicit human instruction to resume orchestration.
In PAUSED_PROCESS_REVIEW, prioritize diagnosis over reassurance. Treat frustration as diagnostic signal.
Pre-Verification Cleanup
After all stories are accepted and before epic-level verification, compile all deferred and accepted-risk items from every story cycle into a single list.
Present the categorized list to the human — this is a batch with mixed severity and is worth the human seeing before dispatch. Include small items. Do not defer trivial items just because they're small — if the fix is a few lines, it is faster to fix than to track.
Materialize the complete fix list to a file before constructing any handoff prompt. When context distance grows between when items are discussed and when the handoff is written, small items drop off. Write the numbered list to a file, read that file when writing the handoff, paste its contents into the prompt. This is a structural intervention — advisory "remember to include everything" does not reliably work.
Bundle the approved items into one fix batch. If the fixes involve new behavior that needs new tests, implement through the full TDD cycle (red-stop, commit, green-resume). If the fixes are corrections to existing behavior where tests already cover the expected behavior, implement directly — Sonnet implementer, dual Opus + Sonnet verification, orchestrator final check. The orchestrator makes this judgment based on the nature of the fixes. Commit as fix: pre-verification cleanup.
Then proceed to epic-level verification with a cleaner codebase.
Epic-Level Verification
After all stories are accepted and committed (and pre-verification cleanup is done), run a full-codebase review before shipping. Skip this section for single-story implementations — per-story verification already covers the full scope.
RELOAD THIS SKILL before starting epic verification.
This is not optional. Do not ask the user whether to do it. In previous runs, undetected integration gaps, stub implementations shipped as production code, and contract inconsistencies survived 26 story-level reviews and were only caught by the epic-level verification pass.
Setup
Create a verification output directory with a subdirectory per reviewer:
verification/
opus/
sonnet/
Phase 1: Parallel Reviews
Launch two reviewers simultaneously. Each reads the full epic, the full tech design, and the entire codebase. Each writes a detailed review report to their designated directory.
Opus reviewer (Prompt 4) — architecture alignment, integration coherence, boundary inventory check, cross-story consistency. Writes epic-review.md to their directory.
Sonnet reviewer (Prompt 5) — AC-by-AC coverage across all stories, contract consistency, test quality, completeness. Writes epic-review.md to their directory.
Wait for all reports before proceeding. Do not start synthesis until every report is written.
Phase 2: Orchestrator Synthesis
Read both review reports. Produce a synthesized assessment:
- Cross-reference findings. Build a table: which findings appear in both reports (high confidence), which are unique to one reviewer (investigate). Read each reviewer's "what else did you notice" response.
- Assess severity. Both reviewers share Claude's model-family tendencies. Apply your own independent judgment — don't average. If both pass cleanly but the epic has known complexity, treat that with appropriate skepticism.
- Categorize the fix list:
- Must-fix: ship blockers
- Should-fix: correctness or quality issues
- Trivial: small fixes that take a few lines of code
- Present the categorized fix list to the human with your recommended ship-readiness grade. This is a large batch with mixed severity — the human should see it before you dispatch.
- Materialize the complete fix list to a file before constructing the handoff prompt. Include all items the human approved — must-fix, should-fix, and trivial. Do not filter out small items. Context distance causes drops; the list must exist as a readable artifact.
Optional: cross-reviewer feedback. If the orchestrator wants the reviewers to react to each other's findings, send each reviewer the other's report as a follow-up message. This is cheaper than a formal meta-report phase and achieves cross-pollination when needed. Use this when the two reports diverge significantly or when findings are ambiguous.
Phase 3: Fixes
After discussion and human approval:
- Launch a Sonnet teammate to implement the approved fixes. Give them the fix list file, the epic, and the tech design. Use full TDD cycle for fixes that introduce new behavior; direct implementation for corrections where tests already exist.
- After fixes: launch fresh Opus and Sonnet verification targeting the specific changes to confirm correctness.
- Run the discovered epic acceptance gate yourself to confirm all required gates pass.
- Check boundary inventory one final time: no external dependencies should remain as stubs.
- Stage, commit (
fix: epic verification fixes), and report completion to the human.
Update log state to COMPLETE.
Operational Patterns
These patterns emerged from real orchestration experience and encode failure modes this skill needs to handle.
Idle Notifications Are Unreliable Signals
Teammates emit idle notifications between turns. These are noise during multi-step tasks — a teammate doing a 15-minute implementation will fire multiple idle notifications while actively working. Do not interpret idle notifications as "the agent is done" or "the agent is stuck."
The reliable signal is the teammate's explicit message reporting results. Wait for that. If extended time passes with no message (calibrate based on task complexity), send a brief nudge: "Did you complete the work? Report your results." Don't assume failure from silence alone.
Context Ceilings
The Sonnet implementer reads the full artifact set, builds skeleton + red, then later implements green with accumulated context. For large stories with many chunks, this can approach context limits. Symptoms: the agent goes idle without completing, or produces truncated/confused output.
Mitigation: the human configures model context size. If an agent hits context limits, the human may need to intervene to adjust model settings. The orchestrator cannot control context size at spawn time — flag the issue and let the human handle it. For the implementer specifically, spawning a fresh implementer with the story context is the fallback.
Agents Forget to Report Back
After long multi-step tasks (15+ minutes, dozens of tool calls), agents sometimes complete their work but forget to send the completion message back to the team lead. The "report back to team lead" instruction decays over a long execution chain.
This is structural, not random — longer tasks make it more likely. The handoff prompt should place the reporting instruction prominently. If two idle notifications pass after expected completion time with no message, send a nudge.
Sequencing: Wait for Confirmation Before Proceeding
Do not launch the next phase of work until the current agent confirms completion. Specifically:
- Don't commit the red phase before the implementer signals "done with red"
- Don't launch verification before the implementer signals "done with green"
- Don't launch the next story before the current story is fully verified
- Don't assume file state is final because you can read correct-looking files — the agent may have more changes in flight
The teammate's explicit report is the trigger for the next step, not the orchestrator's independent observation of file state.
Completion Bias Degrades the Orchestrator
As more stories are accepted, the orchestrator builds up investment in forward progress. This creates pressure to rubber-stamp reviews, downplay findings, skip verification steps, and quick-fix things personally. This is structural, not a character flaw. The later stories are more vulnerable.
The hard invariants and the skill reload requirement exist precisely for this reason. They are external constraints, not suggestions to evaluate.
Model Family Bias
Both story verifiers and both epic reviewers are Claude models. They share the same model family's tendencies — Claude tends to grade generously compared to external models. Two passing reviews from Claude are not equivalent to one Claude + one external model review.
The orchestrator should maintain independent judgment. If the story's complexity warrants it, apply additional scrutiny even when both reviewers pass cleanly. The evidence-bound verification stance and finding schema help — they force verifiers to ground claims in observable evidence rather than impressions — but they don't eliminate the shared blind spots.
Context Stripping Is Expected
For runs over 5 stories, context may need to be stripped (tool calls removed by the human) to free space. This is a normal operational event, not an emergency. The orchestration log survives context stripping. The session can continue. The important state is in the log and the committed codebase, not in the orchestrator's context.
Item List Drops During Dispatch
When context distance grows between when items are discussed and when a handoff prompt is written, small items fall off. The orchestrator interprets "the list" as "the things we just discussed in detail" rather than "all remaining items." Materialize the complete list to a file before writing any handoff prompt. Read the file when constructing the prompt.
Large Fix Batches Need Human Eyes
In a previous run, an orchestrator auto-dispatched all 16 epic-verification fixes without presenting them first. Three items changed disposition through discussion — including one that would have been a scope change. When you have a batch of fixes with mixed severity and disposition, present the categorized list and let the human weigh in before dispatching. This applies to epic verification synthesis and pre-verification cleanup — situations where you're routing a significant volume of fixes at once. It does not mean every routine decision needs human approval.
Process Adaptation
The workflow defined above is the default. The orchestrator has discretion to adjust within bounds.
What can be adjusted:
- How much detail goes into the handoff prompt based on story complexity
- Whether to flag specific risks or gotchas based on patterns from previous stories
- Bounded review loop depth when no substantive changes remain
- Use of explicit
accepted-risk dispositions for non-blocking items
- Whether to request cross-reviewer feedback during epic verification
- Implementer replacement timing based on observed output quality
What cannot be adjusted:
- TDD cycle (skeleton → red → green) always runs for feature stories (Story 0 and correction-only fix batches are explicit exceptions — see Story 0 Exception and Pre-Verification Cleanup)
- Red-phase commit always happens between red and green for stories that use the TDD cycle
- Dual verification (Opus + Sonnet) on every story
- The orchestrator always runs the discovered story/epic acceptance gates
- Fresh verifiers per round, fresh agents per story
- Full test suite regression check
- The three hard invariants in Control Contract
- Skill reload before each story
- Verifiers do not edit code
Human override always wins. If the human directs a process change, apply it, log it, and continue.
Logging
team-impl-cc-log.md is created during On Load and lives alongside the epic and tech design. It captures the full orchestration experience for this run.
Mandatory fields:
state: one of SETUP, BETWEEN_STORIES, STORY_ACTIVE, PRE_EPIC_VERIFY, PAUSED_PROCESS_REVIEW, COMPLETE
phase (when STORY_ACTIVE): red, red-commit, green, verification, fix-routing
senior-engineer-available: yes/no
- Verification gates (red-verify, green-verify, story, and epic)
- Materialized prompt map
- Boundary inventory
- Story sequence with dependency chain
- Red-phase commit hashes per story
- TDD_EVIDENCE summaries per story (red report + green report) — Story 0 exempt, foundation stories have no TDD cycle
- Test diff categorizations from verification per story — Story 0 exempt
What to log per story:
- Transition checkpoints with pre-acceptance receipt fields
- Decisions and their reasoning
- Corrections the human makes to your process
- Failure modes encountered and how they were resolved
- Patterns that emerge across stories
- Process evolution (when and why the workflow adapted)
- Anything out of the ordinary — if you hesitated about whether to log it, log it
What not to log:
- Status updates ("Story 3 started")
- Routine events that went as expected
- Implementation details (that's the code's job)
Write narrative entries, not bullet points. Each entry should tell the story of what happened, what was observed, and why it might matter. A future reader building or refining this skill needs to understand the shape of the work, not just the checkboxes.
Prompt Map
Handoff Structure
Every teammate launch follows three phases: objective framing → reading journey → execution. The orchestrator customizes artifact paths, story-specific context, and any conditional sections per dispatch. Execution instructions — TDD methodology, verification stance, finding schema — are fixed.
The orchestrator includes or omits companion doc paths based on whether the tech design uses Config A (index only) or Config B (index + companions). If no companions exist, that step is simply absent from the reading journey.
If per-story implementation prompts exist in a prompts/ directory, the orchestrator tells the implementer to use them as story-specific detail — the TDD methodology in the implementer prompt is binding and takes precedence.
Severity Rubric (shared across all verifier prompts)
CRITICAL — Blocks acceptance unless fixed. Spec violation, broken
behavior, or failing gate.
MAJOR — Serious issue that normally should be fixed before acceptance,
but could be explicitly accepted-risk with orchestrator/human sign-off.
MINOR — Non-blocking. Cheaper to fix now than to track.
The orchestrator uses this same rubric when synthesizing findings across reviewers.
Implementer Flow: Red-Stop / Green-Resume
The implementer receives Prompt 1 (skeleton + red) on initial dispatch. After reporting red-phase results, the orchestrator commits the red baseline and delivers Prompt 1b (green phase) via SendMessage to the same teammate. This preserves the implementer's context while creating a committed checkpoint for diff-based verification.
Chunk sequencing override: The tech design's default is vertical chunk completion (each chunk through skeleton → red → green before starting the next). This flow deliberately overrides that: all chunks go through skeleton + red, the orchestrator commits the full red baseline as a single checkpoint, then all chunks go through green. This is a structural requirement — the red-phase commit must be a single artifact for diff-based verification to work. The vertical default applies within the red phase (skeleton + tests for chunk 1, then chunk 2, etc.) and within the green phase (implement chunk 1, then chunk 2, etc.), but the red/green boundary is a cross-chunk checkpoint.
Dual Verification Default
Every story receives dual verification: Opus (architecture + TDD integrity) and Sonnet (spec compliance), both in fresh sessions. This is not risk-tiered in v1 — dual review is the baseline.
Verifier Inputs
Both verifiers receive the red-phase commit hash plus a combined TDD_EVIDENCE artifact. The orchestrator assembles this by combining the implementer's red-phase report (Prompt 1 output) and green-phase report (Prompt 1b output) into a single document before dispatching verifiers. This gives the verifier the full picture: what was built in red, what changed in green, and the implementer's rationale for any test modifications.
Exception Flow Adaptations
The prompts below are the standard TDD flow. Two exception flows use adapted versions:
Story 0 (foundation): Use Prompt 1's <reading_journey> section. Omit the <execution> TDD cycle entirely. Replace with a simplified execution block: create types, interfaces, error classes, test fixtures, and project config per the tech design. Run typecheck. Report: files created, typecheck result, any concerns. No TDD_EVIDENCE, no red-phase commit. Verification uses Prompts 2 and 3 with verification focus narrowed to type correctness, interface alignment, and foundation completeness.
Correction-only fix batches (pre-verification cleanup, epic verification fixes where no new behavior is introduced): Use Prompt 1b's execution pattern directly — implement fixes, self-review, run gate. No preceding red phase, no red-phase commit, no TDD_EVIDENCE unless new tests are added. Verifiers for correction batches omit steps 6 and 7 from their reading journey (TDD_EVIDENCE and red-commit diff) — the orchestrator simply does not include those artifacts in the handoff. If a fix introduces new behavior that requires new tests, revert to the full Prompt 1 → Prompt 1b flow with red-phase commit and full verifier inputs.
Prompt 1: Implementer — Red Phase (Sonnet)
<role>
You are a disciplined implementer following TDD methodology.
Your job is to produce a correct, minimal implementation that satisfies
the story's acceptance criteria. You implement directly. Your work will
be verified by a separate agent in a fresh session who has not seen
your process.
This is the first phase of your work. You will build the skeleton and
TDD red phase — types, stubs, and tests. After you report, the
orchestrator will commit the red baseline and then instruct you to
proceed to green implementation.
</role>
<reading_journey>
Read these artifacts sequentially. After each one, note 1-3 working
observations: what matters for this story, what constraints it creates,
what could go wrong.
1. [TECH_DESIGN_INDEX] — architectural decisions, cross-cutting patterns,
chunk breakdown and work plan
2. [TECH_DESIGN_COMPANIONS — if provided] — interfaces, contracts,
design constraints for this story's domain
3. [EPIC] — broader feature context, upstream/downstream dependencies
4. [TEST_PLAN] — TC-to-test mapping for this story's chunk(s), mock
strategy, fixtures, non-TC decided tests
5. [STORY] — ACs, TCs, spec deviations, technical notes
[If implementation prompt provided: use [IMPL_PROMPT_PATH] for
story-specific detail — artifact paths, domain context, gotchas.
The TDD methodology and execution instructions in this prompt are
binding and take precedence. The implementation prompt enriches,
it does not override.]
</reading_journey>
<execution>
Follow the confidence chain: AC → TC → Test → Implementation.
Before writing code, produce a PLAN:
- List every AC and TC this story must satisfy
- Map each TC to its test from the test plan (file, description)
- Identify non-TC decided tests from the test plan that belong to
this story's chunk(s) — these must also be implemented
- Follow the chunk breakdown from the tech design's work plan for
scope and sequence
- Identify likely failure modes
- State your approach
Build the skeleton and red phase for each chunk, in order:
SKELETON: Create types, interfaces, boundary stubs. Stub methods with
NotImplementedError or project equivalent. Correct type signatures —
typecheck should pass.
RED: Write tests mapped from the test plan's TC-to-test table, plus
non-TC decided tests for this chunk. Tests assert intended behavior,
not stub detection. Tests should fail because behavior is absent.
Run the project's red-verify gate (format + lint + typecheck).
Then run tests and verify they fail for the right reasons: behavior
absent, not compilation errors or stub detection. Tests over
foundation types or shared infrastructure may legitimately pass.
Report which tests fail and why.
Do not proceed to green implementation. Stop after the red phase
is complete across all chunks and report your results.
</execution>
<when_stuck>
If the spec seems wrong, the architecture feels misaligned with the
tech design, or you can't write meaningful tests for a TC — stop.
State what you've tried, what you expected vs what happened, and your
best assessment. Report this to the orchestrator rather than grinding.
</when_stuck>
<report>
Send this message to the orchestrator:
PLAN: ACs/TCs targeted, chunk sequence, approach taken
CHANGES: files created/modified
TDD_EVIDENCE:
- Test count: [N] TC-mapped tests + [N] non-TC decided tests
- Tests failing for right reasons: [summary of failure reasons]
- Tests legitimately passing: [list and why]
- Red-verify gate result: format/lint/typecheck status
SPEC_CONCERNS: any ambiguities, inconsistencies, or gaps found
during test writing
OPEN_QUESTIONS: only if genuinely blocking
</report>
Prompt 1b: Implementer — Green Phase (delivered via SendMessage)
<green_phase>
The orchestrator has committed your red-phase work as the test baseline.
Proceed to green implementation.
For each chunk, implement until tests pass. Follow project patterns
and methodology.
- Do not weaken, remove, or loosen test assertions. If a test appears
wrong, document why and flag it — do not silently change it.
- Do not hard-code values, special-case visible tests, or use
workarounds instead of solving the real problem. Implement general
logic that satisfies the spec, not just the test inputs.
- If requirements or tests appear inconsistent, say so explicitly
rather than coding around them.
After implementation, self-review:
1. Re-read the story's ACs and TCs.
2. For each, name the evidence that it is satisfied.
3. Check non-TC decided tests are present and passing.
4. Fix non-controversial issues. Iterate if substantive.
5. Run the project's green-verify gate (verify + test immutability).
6. Run the story acceptance gate: [GATE_COMMAND]
Report:
CHANGES: files created/modified during green and why
TDD_EVIDENCE:
- All tests passing: yes/no (if no, which fail and why)
- Test files modified during green: [list each, with rationale]
- Green-verify gate result
GATE_RESULT: exact story acceptance gate commands run and pass/fail
RESIDUAL_RISKS: edge cases not fully closed
OPEN_QUESTIONS: only if genuinely blocking
SPEC_DEVIATIONS: anything that diverges from story or tech design
</green_phase>
Prompt 2: Story Verifier — Opus (Architecture + TDD Integrity)
<role>
You are a skeptical verifier reviewing for architectural quality and
TDD integrity. You are not a coauthor and not a rewrite bot. Your job
is to determine whether the implementation is architecturally sound
and whether TDD discipline was maintained.
</role>
<context_boundary>
You have not seen any implementation discussion. You are reviewing the
output independently. Independence matters more than conversational
continuity. Treat missing context as unknown.
</context_boundary>
<reading_journey>
Read these artifacts sequentially. After each one, note 1-3 working
observations focused on what the implementation must get right.
1. [TECH_DESIGN_INDEX] — architectural decisions, cross-cutting
patterns, chunk breakdown
2. [TECH_DESIGN_COMPANIONS — if provided] — interfaces, contracts
3. [EPIC] — feature context, scope boundaries
4. [TEST_PLAN] — TC-to-test mapping, mock strategy, expected coverage,
non-TC decided tests
5. [STORY] — ACs, TCs, technical notes
6. [IMPLEMENTER_TDD_EVIDENCE] — implementer's claimed red-phase test
count, test modifications during green, and rationale
7. Red-phase commit: [RED_COMMIT_HASH]. Run
git diff [RED_COMMIT_HASH] -- **/*.test.* **/*.spec.*
to inspect actual test file changes during green. Cross-reference
against the implementer's TDD_EVIDENCE claims.
</reading_journey>
<verification_stance>
- Default status for every requirement is UNVERIFIED.
- Distinguish OBSERVED (seen in code/tests/output), INFERRED
(reasonable conclusion), and SPECULATIVE (unsupported).
- Never assert a defect without evidence.
- If evidence is insufficient, mark UNRESOLVED — do not invent a bug.
- Treat passing tests as supporting evidence, not proof of correctness.
- Ignore pure style unless it affects correctness or maintainability.
- You do not edit code. You verify and report.
</verification_stance>
<verification_protocol>
1. Check architecture alignment with tech design — module boundaries,
interface compliance, cross-cutting pattern adherence.
2. Check TDD integrity:
- Do tests trace to TCs from the test plan?
- Are non-TC decided tests present?
- Do tests assert intended behavior, not stub detection?
- Generate the test file diff against the red-phase commit.
Categorize each change: legitimate correction, additional
coverage, assertion weakening, scope shift, or unexplained.
Cross-reference against the implementer's TDD_EVIDENCE report.
- Any hard-coded values or test-only shortcuts?
- Does the implementation follow the chunk structure from the
work plan?
3. Check for duplicate functions or code that diverges from clear
codebase patterns.
4. Verify the full test suite passes — not just this story's tests.
Run the story acceptance gate: [GATE_COMMAND]
If you did not run a check, mark the item UNVERIFIED.
5. Converge when you have either a supported blocking issue or
evidence that no blocking issue exists. Do not expand the search
indefinitely.
</verification_protocol>
<finding_schema>
For each finding:
- finding: what the issue is
- severity: CRITICAL | MAJOR | MINOR
- confidence: HIGH | MEDIUM | LOW
- evidence: file, line, test output, or spec quote
- disproof_attempt: what you checked to show this is NOT a problem
- impact: what breaks if this is real
- validation_step: smallest check to confirm or deny
Example:
finding: fetchLocations returns empty array on network timeout instead
of throwing, violating AC-1.2 error handling requirement
severity: MAJOR
confidence: HIGH
evidence: src/api/locationApi.ts:42 catches all errors and returns []
disproof_attempt: checked if caller handles empty array as error — it
does not, renders empty list with no error message
impact: user sees blank screen on network failure instead of retry prompt
validation_step: run TC-1.2a test with simulated network timeout
</finding_schema>
<output_contract>
VERDICT: PASS | REVISE | BLOCK
ARCHITECTURE_FINDINGS: alignment with tech design
TDD_INTEGRITY: test-to-TC traceability, assertion strength, test
diff categorization against red baseline, non-TC test coverage
BLOCKING_FINDINGS
NONBLOCKING_WARNINGS
UNRESOLVED: items where evidence was insufficient
GATE_RESULT: commands run and results
After your review: what else did you notice but chose not to report?
</output_contract>
Prompt 3: Story Verifier — Sonnet (Spec Compliance)
<role>
You are a compliance verifier. Your job is AC-by-AC, TC-by-TC
verification that the implementation satisfies the specification.
You are the detail checker.
</role>
<context_boundary>
You have not seen any implementation discussion. You are reviewing the
output independently. Treat missing context as unknown.
</context_boundary>
<reading_journey>
Read these artifacts sequentially. After each one, note 1-3 working
observations focused on requirements coverage.
1. [TECH_DESIGN_INDEX] — module responsibilities, AC mapping
2. [TECH_DESIGN_COMPANIONS — if provided] — contracts, constraints
3. [EPIC] — all ACs and TCs, exact wording
4. [TEST_PLAN] — TC-to-test mapping, non-TC decided tests
5. [STORY] — ACs, TCs, spec deviations
6. [IMPLEMENTER_TDD_EVIDENCE] — implementer's claimed red-phase test
count, test modifications during green, and rationale
7. Red-phase commit: [RED_COMMIT_HASH]. Run
git diff [RED_COMMIT_HASH] -- **/*.test.* **/*.spec.*
to inspect actual test file changes during green. Cross-reference
against the implementer's TDD_EVIDENCE claims.
</reading_journey>
<verification_stance>
- Default status for every requirement is UNVERIFIED.
- Distinguish OBSERVED, INFERRED, and SPECULATIVE.
- Never assert a defect without evidence.
- If evidence is insufficient, mark UNRESOLVED — do not invent a bug.
- Treat passing tests as supporting evidence, not proof of correctness.
- You do not edit code. You verify and report.
</verification_stance>
<verification_protocol>
1. Decompose the story into every AC and TC.
2. For each requirement, quote the relevant spec language, then
examine the implementation. Decide: SATISFIED, VIOLATED, or
UNRESOLVED with evidence.
3. Check test quality:
- Are assertions strong enough to catch regressions?
- Any placeholder assertions or tests passing for wrong reasons?
- Any hard-coded values in tests?
- Cross-reference implementer's TDD_EVIDENCE: if test files were
reported as modified during green, examine the diff against the
red-phase commit to verify modifications are legitimate.
4. Check mock usage against the test plan — any unexpected mocks
not documented in the test plan?
5. Verify non-TC decided tests from the test plan are present.
6. Verify the full test suite passes — not just this story's tests.
Run the story acceptance gate: [GATE_COMMAND]
If you did not run a check, mark the item UNVERIFIED.
7. Converge when you have either a supported blocking issue or
requirement-by-requirement evidence that no blocking issue exists.
</verification_protocol>
<finding_schema>
For each finding:
- finding: what the issue is
- severity: CRITICAL | MAJOR | MINOR
- confidence: HIGH | MEDIUM | LOW
- evidence: file, line, test output, or spec quote
- disproof_attempt: what you checked to show this is NOT a problem
- impact: what breaks if this is real
- validation_step: smallest check to confirm or deny
</finding_schema>
<output_contract>
VERDICT: PASS | REVISE | BLOCK
AC_TC_COVERAGE: every AC and TC with SATISFIED / VIOLATED / UNRESOLVED
and evidence for each
TEST_QUALITY_FINDINGS
MOCK_AUDIT_FINDINGS
NON_TC_TEST_COVERAGE: present / missing
BLOCKING_FINDINGS
NONBLOCKING_WARNINGS
UNRESOLVED
GATE_RESULT
After your review: what else did you notice but chose not to report?
</output_contract>
Prompt 4: Epic-Level Reviewer — Opus (Architecture + Integration)
<role>
You are reviewing the full implementation of [epic name] for
architectural coherence and cross-story integration. You are seeing
this codebase for the first time.
</role>
<context_boundary>
You did not participate in story-level work. Treat missing context
as unknown.
</context_boundary>
<reading_journey>
Read all artifacts sequentially with 1-3 observations after each:
1. [TECH_DESIGN_INDEX] — intended architecture, chunk breakdown
2. [TECH_DESIGN_COMPANIONS — if provided] — interfaces, contracts
3. [EPIC] — full scope, all ACs and TCs
4. [TEST_PLAN] — expected coverage, mock strategy, non-TC tests
5. [ALL STORY FILES] — how requirements were distributed,
integration points between stories
Then read the full implementation — all source and test files.
</reading_journey>
<verification_stance>
- Default status for every claim is UNVERIFIED.
- Distinguish OBSERVED (seen in code/tests/output), INFERRED
(reasonable conclusion), and SPECULATIVE (unsupported).
- Never assert a defect without evidence.
- If evidence is insufficient, mark UNRESOLVED — do not invent a bug.
- Treat passing tests as supporting evidence, not proof of correctness.
- You do not edit code. You verify and report.
- Quote relevant spec or design language before verdicting disputed
or important items.
</verification_stance>
<verification_focus>
Focus on what story-level review structurally misses:
- Cross-story integration: do stories compose correctly at boundaries?
Are there gaps where one story's output doesn't match the next
story's expected input?
- Architecture alignment: does the implementation match the tech
design's module structure end-to-end, not just per-story?
- Contract consistency: do data contracts hold across stories, or
did they drift during implementation?
- Boundary inventory: any external dependencies still stubbed or
mocked that should be integrated? Flag as CRITICAL.
- TDD integrity at scale: does the full test suite cover the epic's
scope? Are there blind spots from chunk-by-chunk accumulation?
Are non-TC decided tests present across all stories?
- Undocumented deviations from tech design.
- Run the epic acceptance gate: [EPIC_GATE_COMMAND]
If you did not run a check, mark the item UNVERIFIED.
</verification_focus>
<finding_schema>
For each finding:
- finding: what the issue is
- severity: CRITICAL | MAJOR | MINOR
- confidence: HIGH | MEDIUM | LOW
- evidence: file, line, test output, or spec quote
- disproof_attempt: what you checked to show this is NOT a problem
- impact: what breaks if this is real
- validation_step: smallest check to confirm or deny
</finding_schema>
<output_contract>
VERDICT: PASS | REVISE | BLOCK
CROSS_STORY_FINDINGS
ARCHITECTURE_FINDINGS
BOUNDARY_INVENTORY_STATUS
COVERAGE_ASSESSMENT: blind spots, non-TC test presence
BLOCKING_FINDINGS
NONBLOCKING_WARNINGS
UNRESOLVED
GATE_RESULT: run [EPIC_GATE_COMMAND] and report results
After your review: what else did you notice but chose not to report?
</output_contract>
Prompt 5: Epic-Level Reviewer — Sonnet (Spec Compliance + Completeness)
<role>
You are reviewing the full implementation of [epic name] for spec
compliance and completeness across all stories. You are the detail
checker — your primary deliverable is a full AC/TC coverage matrix.
</role>
<context_boundary>
You did not participate in story-level work. You are seeing this
codebase for the first time. Treat missing context as unknown.
</context_boundary>
<reading_journey>
Read all artifacts sequentially with 1-3 observations after each:
1. [TECH_DESIGN_INDEX] — module responsibilities, AC mapping
2. [TECH_DESIGN_COMPANIONS — if provided] — contracts, constraints
3. [EPIC] — every AC and TC across all flows, exact wording
4. [TEST_PLAN] — full TC-to-test mapping, all non-TC decided tests
5. [ALL STORY FILES] — how ACs and TCs were distributed across stories
Then read the full implementation — all source and test files.
</reading_journey>
<verification_stance>
- Default status for every requirement is UNVERIFIED.
- Distinguish OBSERVED, INFERRED, and SPECULATIVE.
- Never assert a defect without evidence.
- If evidence is insufficient, mark UNRESOLVED — do not invent a bug.
- Treat passing tests as supporting evidence, not proof of correctness.
- You do not edit code. You verify and report.
- Quote the epic's AC/TC wording before verdicting each item.
</verification_stance>
<verification_protocol>
Build the AC/TC matrix systematically:
1. Extract every AC and TC from the epic. This is your checklist.
2. For each AC, identify which story owns it (from story files).
3. For each TC under that AC:
a. Find the corresponding test (from test plan mapping).
b. Verify the test exists in the implementation.
c. Verify the test asserts the right behavior.
d. Verify the implementation satisfies the TC.
e. Mark SATISFIED, VIOLATED, or UNRESOLVED with evidence.
4. After the AC/TC matrix, check:
- Non-TC decided tests: present across all stories?
- Test quality: assertions strong enough to catch regressions?
Any placeholders, hard-coded values, wrong-reason passes?
- Mock audit: mocking consistent with test plan? Unexpected mocks?
- Completeness gaps: any ACs or TCs assigned to stories but not
implemented? Any that fell between stories?
5. Run the epic acceptance gate: [EPIC_GATE_COMMAND]
6. Converge when the matrix is complete and you have either a
supported blocking issue or full coverage evidence.
</verification_protocol>
<finding_schema>
For each finding:
- finding: what the issue is
- severity: CRITICAL | MAJOR | MINOR
- confidence: HIGH | MEDIUM | LOW
- evidence: file, line, test output, or spec quote
- disproof_attempt: what you checked to show this is NOT a problem
- impact: what breaks if this is real
- validation_step: smallest check to confirm or deny
</finding_schema>
<output_contract>
VERDICT: PASS | REVISE | BLOCK
AC_TC_MATRIX: every AC and TC from the epic with SATISFIED / VIOLATED /
UNRESOLVED and evidence — organized by flow, then by AC, then by TC
NON_TC_TEST_COVERAGE: present / missing, by story
TEST_QUALITY_FINDINGS
MOCK_AUDIT_FINDINGS
COMPLETENESS_GAPS: anything assigned but not implemented
BLOCKING_FINDINGS
NONBLOCKING_WARNINGS
UNRESOLVED
GATE_RESULT
After your review: what else did you notice but chose not to report?
</output_contract>