Agent Skillsshinpr/claude-code-workflows › recipe-add-integration-tests

recipe-add-integration-tests

GitHub

根据设计文档为现有代码库添加集成和E2E测试。通过编排器协调发现文档、生成骨架、创建任务文件,并委派子代理执行实现与审查,确保测试质量。

skills/recipe-add-integration-tests/SKILL.md shinpr/claude-code-workflows

Trigger Scenarios

需要为现有后端或前端代码添加集成测试 需要为现有系统添加端到端测试

Install

npx skills add shinpr/claude-code-workflows --skill recipe-add-integration-tests -g -y
More Options

Use without installing

npx skills use shinpr/claude-code-workflows@recipe-add-integration-tests

指定 Agent (Claude Code)

npx skills add shinpr/claude-code-workflows --skill recipe-add-integration-tests -a claude-code -g -y

安装 repo 全部 skill

npx skills add shinpr/claude-code-workflows --all -g -y

预览 repo 内 skill

npx skills add shinpr/claude-code-workflows --list

SKILL.md

Frontmatter
{
    "name": "recipe-add-integration-tests",
    "description": "Add integration\/E2E tests to existing codebase using Design Docs",
    "disable-model-invocation": true
}

Execute Skill: llm-friendly-context before writing Agent prompts, handoffs, or generated artifacts.

Context: Test addition workflow for existing implementations (backend, frontend, or fullstack)

Orchestrator Definition

Core Identity: "I am an orchestrator."

First Action: Register Steps 0-8 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. Task files create context boundaries. Subagents work in isolated context.

Execution Method:

  • Skeleton generation → delegate to acceptance-test-generator
  • Task file creation → orchestrator creates directly (minimal context usage)
  • Test implementation → delegate to task-executor
  • Test review → delegate to integration-test-reviewer
  • Quality checks → delegate to quality-fixer

Document paths: $ARGUMENTS

Prerequisites

  • At least one Design Doc must exist (created manually or via reverse-engineer)
  • Existing implementation to test

Execution Flow

Step 0: Execute Skill

Execute Skill: documentation-criteria (for task file template in Step 3)

Step 1: Discover and Validate Documents

# 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:

  • Filename contains backendDesign Doc (backend)
  • Filename contains frontendDesign Doc (frontend)
  • Located in docs/ui-spec/UI Spec (optional)
  • None of the above → treat as single-layer Design Doc

Step 2: Skeleton Generation

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

Step 3: Create Task Files [GATE]

Create one task file per layer, using the monorepo-flow.md naming convention for deterministic agent routing:

  • Backend skeletons exist → docs/plans/tasks/integration-tests-backend-task-YYYYMMDD.md
  • Frontend skeletons exist → docs/plans/tasks/integration-tests-frontend-task-YYYYMMDD.md
  • Single-layer (no backend/frontend distinction) → docs/plans/tasks/integration-tests-backend-task-YYYYMMDD.md

Template (per task file):

---
name: Implement [layer] integration tests for [feature name]
type: test-implementation
---

## Objective

Implement test cases defined in skeleton files.

## Target Files

- Skeleton: [layer-specific paths from Step 2 generatedFiles]
- Design Doc: [layer-specific Design Doc from Step 1]

## Tasks

- [ ] Implement each test case in skeleton
- [ ] Verify all tests pass
- [ ] Ensure coverage meets requirements

## Acceptance Criteria

- All skeleton test cases implemented
- All tests passing
- quality-fixer reports approved

Output: "Task file(s) created at [path(s)]. Ready for Step 4."

Step 4: Test Implementation

For each task file from Step 3, invoke task-executor routed by filename pattern (per monorepo-flow.md):

  • *-backend-task-*subagent_type: "dev-workflows:task-executor"
  • *-frontend-task-*subagent_type: "dev-workflows-frontend:task-executor-frontend"
  • description: "Implement integration tests"
  • prompt: "Task file: [task file path from Step 3]. Implement tests following the task file."

Execute one task file at a time through Steps 4→5→6→7 before starting the next.

Expected output: status, testsAdded

Step 5: Test Review

Invoke integration-test-reviewer using Agent tool:

  • subagent_type: "dev-workflows:integration-test-reviewer"
  • description: "Review test quality"
  • prompt: "Review test quality. Test files: [paths from Step 4 testsAdded]. Skeleton files: [layer-specific paths from Step 2 generatedFiles matching current task's layer]"

Expected output: status (approved/needs_revision), requiredFixes

Step 6: Apply Review Fixes

Check Step 5 result:

  • status: approved → Mark complete, proceed to Step 7
  • status: needs_revision → Invoke task-executor with requiredFixes, then return to Step 5

Invoke task-executor routed by task filename pattern:

  • *-backend-task-*subagent_type: "dev-workflows:task-executor"
  • *-frontend-task-*subagent_type: "dev-workflows-frontend:task-executor-frontend"
  • description: "Fix review findings"
  • prompt: "Fix the following issues in test files: [requiredFixes from Step 5]"

Step 7: Quality Check

Invoke quality-fixer routed by task filename pattern:

  • *-backend-task-*subagent_type: "dev-workflows:quality-fixer"
  • *-frontend-task-*subagent_type: "dev-workflows-frontend:quality-fixer-frontend"
  • description: "Final quality assurance"
  • 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 4 with incompleteImplementations[] details, then re-execute Steps 4→5→6→7
  • blocked → Escalate to user
  • approved → Proceed to Step 8

Step 8: Commit

On approved from quality-fixer:

  • Commit test files using Bash with message format: "test: add [layer] integration tests for [feature name]"

Step 9: Final Cleanup

After all task files have been processed and committed, delete the task files this recipe created. Their work is committed; docs/plans/ is ephemeral working state and is not retained between recipe runs:

  • Delete every file matching docs/plans/tasks/integration-tests-backend-task-*.md and docs/plans/tasks/integration-tests-frontend-task-*.md created during this run

If task files cannot be deleted (filesystem error), report the failure but do not block completion.

Scope Boundary for Subagents

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.

Version History

  • 66e3b29 Current 2026-07-05 12:01

Same Skill Collection

dev-skills/skills/ai-development-guide/SKILL.md
dev-skills/skills/coding-principles/SKILL.md
dev-skills/skills/documentation-criteria/SKILL.md
dev-skills/skills/external-resource-context/SKILL.md
dev-skills/skills/frontend-ai-guide/SKILL.md
dev-skills/skills/implementation-approach/SKILL.md
dev-skills/skills/integration-e2e-testing/SKILL.md
dev-skills/skills/llm-friendly-context/SKILL.md
dev-skills/skills/test-implement/SKILL.md
dev-skills/skills/testing-principles/SKILL.md
dev-skills/skills/typescript-rules/SKILL.md
dev-workflows-frontend/skills/ai-development-guide/SKILL.md
dev-workflows-frontend/skills/coding-principles/SKILL.md
dev-workflows-frontend/skills/documentation-criteria/SKILL.md
dev-workflows-frontend/skills/external-resource-context/SKILL.md
dev-workflows-frontend/skills/frontend-ai-guide/SKILL.md
dev-workflows-frontend/skills/implementation-approach/SKILL.md
dev-workflows-frontend/skills/integration-e2e-testing/SKILL.md
dev-workflows-frontend/skills/llm-friendly-context/SKILL.md
dev-workflows-frontend/skills/recipe-diagnose/SKILL.md
dev-workflows-frontend/skills/recipe-front-adjust/SKILL.md
dev-workflows-frontend/skills/recipe-front-build/SKILL.md
dev-workflows-frontend/skills/recipe-front-design/SKILL.md
dev-workflows-frontend/skills/recipe-front-plan/SKILL.md
dev-workflows-frontend/skills/recipe-front-review/SKILL.md
dev-workflows-frontend/skills/recipe-task/SKILL.md
dev-workflows-frontend/skills/recipe-update-doc/SKILL.md
dev-workflows-frontend/skills/subagents-orchestration-guide/SKILL.md
dev-workflows-frontend/skills/task-analyzer/SKILL.md
dev-workflows-frontend/skills/test-implement/SKILL.md
dev-workflows-frontend/skills/testing-principles/SKILL.md
dev-workflows-frontend/skills/typescript-rules/SKILL.md
dev-workflows-fullstack/skills/ai-development-guide/SKILL.md
dev-workflows-fullstack/skills/coding-principles/SKILL.md
dev-workflows-fullstack/skills/documentation-criteria/SKILL.md
dev-workflows-fullstack/skills/external-resource-context/SKILL.md
dev-workflows-fullstack/skills/frontend-ai-guide/SKILL.md
dev-workflows-fullstack/skills/implementation-approach/SKILL.md
dev-workflows-fullstack/skills/integration-e2e-testing/SKILL.md
dev-workflows-fullstack/skills/llm-friendly-context/SKILL.md
dev-workflows-fullstack/skills/recipe-add-integration-tests/SKILL.md
dev-workflows-fullstack/skills/recipe-build/SKILL.md
dev-workflows-fullstack/skills/recipe-design/SKILL.md
dev-workflows-fullstack/skills/recipe-diagnose/SKILL.md
dev-workflows-fullstack/skills/recipe-front-adjust/SKILL.md
dev-workflows-fullstack/skills/recipe-front-build/SKILL.md
dev-workflows-fullstack/skills/recipe-front-design/SKILL.md
dev-workflows-fullstack/skills/recipe-front-plan/SKILL.md
dev-workflows-fullstack/skills/recipe-front-review/SKILL.md
dev-workflows-fullstack/skills/recipe-fullstack-build/SKILL.md
dev-workflows-fullstack/skills/recipe-fullstack-implement/SKILL.md
dev-workflows-fullstack/skills/recipe-implement/SKILL.md
dev-workflows-fullstack/skills/recipe-plan/SKILL.md
dev-workflows-fullstack/skills/recipe-prepare-implementation/SKILL.md
dev-workflows-fullstack/skills/recipe-reverse-engineer/SKILL.md
dev-workflows-fullstack/skills/recipe-review/SKILL.md
dev-workflows-fullstack/skills/recipe-task/SKILL.md
dev-workflows-fullstack/skills/recipe-update-doc/SKILL.md
dev-workflows-fullstack/skills/subagents-orchestration-guide/SKILL.md
dev-workflows-fullstack/skills/task-analyzer/SKILL.md
dev-workflows-fullstack/skills/test-implement/SKILL.md
dev-workflows-fullstack/skills/testing-principles/SKILL.md
dev-workflows-fullstack/skills/typescript-rules/SKILL.md
dev-workflows/skills/ai-development-guide/SKILL.md
dev-workflows/skills/coding-principles/SKILL.md
dev-workflows/skills/documentation-criteria/SKILL.md
dev-workflows/skills/external-resource-context/SKILL.md
dev-workflows/skills/implementation-approach/SKILL.md
dev-workflows/skills/integration-e2e-testing/SKILL.md
dev-workflows/skills/llm-friendly-context/SKILL.md
dev-workflows/skills/recipe-add-integration-tests/SKILL.md
dev-workflows/skills/recipe-build/SKILL.md
dev-workflows/skills/recipe-design/SKILL.md
dev-workflows/skills/recipe-diagnose/SKILL.md
dev-workflows/skills/recipe-implement/SKILL.md
dev-workflows/skills/recipe-plan/SKILL.md
dev-workflows/skills/recipe-prepare-implementation/SKILL.md
dev-workflows/skills/recipe-reverse-engineer/SKILL.md
dev-workflows/skills/recipe-review/SKILL.md
dev-workflows/skills/recipe-task/SKILL.md
dev-workflows/skills/recipe-update-doc/SKILL.md
dev-workflows/skills/subagents-orchestration-guide/SKILL.md
dev-workflows/skills/task-analyzer/SKILL.md
dev-workflows/skills/testing-principles/SKILL.md
skills/ai-development-guide/SKILL.md
skills/coding-principles/SKILL.md
skills/documentation-criteria/SKILL.md
skills/external-resource-context/SKILL.md
skills/frontend-ai-guide/SKILL.md
skills/implementation-approach/SKILL.md
skills/integration-e2e-testing/SKILL.md
skills/llm-friendly-context/SKILL.md
skills/recipe-build/SKILL.md
skills/recipe-design/SKILL.md
skills/recipe-diagnose/SKILL.md
skills/recipe-front-adjust/SKILL.md
skills/recipe-front-build/SKILL.md
skills/recipe-front-design/SKILL.md
skills/recipe-front-plan/SKILL.md
skills/recipe-front-review/SKILL.md
skills/recipe-fullstack-build/SKILL.md
skills/recipe-fullstack-implement/SKILL.md
skills/recipe-implement/SKILL.md
skills/recipe-plan/SKILL.md
skills/recipe-prepare-implementation/SKILL.md
skills/recipe-reverse-engineer/SKILL.md
skills/recipe-review/SKILL.md
skills/recipe-task/SKILL.md
skills/recipe-update-doc/SKILL.md
skills/subagents-orchestration-guide/SKILL.md
skills/task-analyzer/SKILL.md
skills/test-implement/SKILL.md
skills/testing-principles/SKILL.md
skills/typescript-rules/SKILL.md

Metadata

Files
0
Version
66e3b29
Hash
69c96762
Indexed
2026-07-05 12:01

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-08 23:58
浙ICP备14020137号-1 $Carte des visiteurs$