shinpr/claude-code-workflows-recipe-add-integration-tests
Add integration/E2E tests to existing codebase using Design Docs
npx skills add https://github.com/shinpr/claude-code-workflows --skill recipe-add-integration-tests
Execute Skill: llm-friendly-context before writing Agent prompts, handoffs, or generated artifacts.
Execute Skill: subagents-orchestration-guide before making workflow decisions, invoking agents, or resolving findings.
Context: Test addition workflow for existing implementations (backend, frontend, or fullstack)
Core Identity: "I am an orchestrator."
Local authority gate: Make this recipe's workflow decisions and validate each returned result directly; delegate semantic deliverable production to the named specialist.
Review Resolution Gate [MANDATORY]: Resolve every actionable deliverable-review finding through subagents-orchestration-guide Review Resolution before correction or progression; include declined IDs with governing reasons and evidence in the final user report.
Before the first finding disposition, read references/review-resolution.md from the loaded subagents-orchestration-guide skill.
First Action: Register Steps 1-7 using TaskCreate before any execution.
Why Delegate: Orchestrator's context is shared across all steps. Direct implementation consumes context needed for review and quality check phases. Subagents work in isolated context.
Execution Method:
Document paths: $ARGUMENTS
# Verify at least one document path was provided
test -n "$ARGUMENTS" || { echo "ERROR: No document paths provided"; exit 1; }
# Verify provided paths exist
ls $ARGUMENTS
# Discover additional documents
ls docs/design/*.md 2>/dev/null | grep -v template
ls docs/ui-spec/*.md 2>/dev/null
Classify discovered documents by filename:
backend → Design Doc (backend)frontend → Design Doc (frontend)docs/ui-spec/ → UI Spec (optional)Invoke acceptance-test-generator using Agent tool:
subagent_type: "dev-workflows:acceptance-test-generator"description: "Generate test skeletons"prompt: List only the documents that exist from Step 1: Generate test skeletons from the following documents:
- Design Doc (backend): [path] ← include only if exists
- Design Doc (frontend): [path] ← include only if exists
- UI Spec: [path] ← include only if exists
Expected output: generatedFiles containing integration and e2e paths
For each layer with generated skeletons, record the current HEAD as diffBase, then invoke the layer's task-executor:
subagent_type: "dev-workflows:task-executor"subagent_type: "dev-workflows-frontend:task-executor-frontend"description: "Implement integration tests"prompt: "Implement every test defined by these generated skeletons: [layer-specific Step 2 paths]. Governing documents: [layer-specific Design Doc and UI Spec when present]. Keep changes within the generated tests and the setup or fixture files they require. Verify the implemented tests against the skeleton claims."Execute one layer at a time through Steps 3→4→5→6→7 before starting the next.
Expected output: status, filesModified, testsAdded, mutationEvidence
Apply this response gate after every task-executor invocation in Steps 3 and 5:
status: completed, filesModified and testsAdded are present, and at least one changed integration/E2E path can be identified from the cumulative response paths against diffBase → Proceed to Step 4status: escalation_needed → Escalate to the userInvoke integration-test-reviewer using Agent tool:
subagent_type: "dev-workflows:integration-test-reviewer"description: "Review test quality"prompt: "Review test quality. changedTestFiles: [integration/E2E paths in Step 3 filesModified or testsAdded that differ from diffBase]. diffBase: [revision recorded before Step 3]. skeletonFiles: [layer-specific paths from Step 2 generatedFiles]. mutationEvidence: [Step 3 mutationEvidence]."Expected output: status (approved/needs_revision/blocked), testFiles, reviewBasis, qualityIssues, requiredFixes
Check Step 4 result:
status: approved → Mark complete, proceed to Step 6status: blocked → Escalate to userstatus: needs_revision → Apply the Review Resolution Gateapply findings → Invoke task-executor with those findings, apply the executor response gate above, then return to Step 4 with prior_feedbackdecline → Mark review complete and proceed to Step 6user_decision_required finding → Escalate to userInvoke the same layer's task-executor:
description: "Fix review findings"prompt: "Fix these adjudicated test-review findings directly: [apply findings with IDs, governing basis, smallest correction, affected paths, and observable verification condition]."Invoke quality-fixer for the current layer:
subagent_type: "dev-workflows:quality-fixer"subagent_type: "dev-workflows-frontend:quality-fixer-frontend"description: "Final quality assurance"filesModified and mutationEvidence.prompt: "Final quality assurance for test files added in this workflow. Run all tests and verify coverage."Expected output: status (approved/stub_detected/blocked)
Check quality-fixer response:
stub_detected → Return to Step 3 with incompleteImplementations[] details, then re-execute Steps 3→4→5→6blocked → Escalate to userapproved → Proceed to Step 7On approved from quality-fixer:
Append the following block to every subagent prompt invoked from this recipe:
Scope boundary for subagents:
Operate within the task scope and referenced files in the prompt.
Use loaded skills to execute that scope.
Escalate when the required fix or investigation falls outside that scope.
Take shinpr/claude-code-workflows-recipe-add-integration-tests from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.