{"id":"6a2d86df-0c79-4b6c-aa99-653404479e88","shortId":"Hsksqu","kind":"skill","title":"recipe-add-integration-tests","tagline":"Add integration/E2E tests to existing codebase using Design Docs","description":"**Context**: Test addition workflow for existing implementations (backend, frontend, or fullstack)\n\n## Orchestrator Definition\n\n**Core Identity**: \"I am an orchestrator.\"\n\n**First Action**: Register Steps 0-8 using TaskCreate before any execution.\n\n**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.\n\n**Execution Method**:\n- Skeleton generation → delegate to acceptance-test-generator\n- Task file creation → orchestrator creates directly (minimal context usage)\n- Test implementation → delegate to task-executor\n- Test review → delegate to integration-test-reviewer\n- Quality checks → delegate to quality-fixer\n\nDocument paths: $ARGUMENTS\n\n## Prerequisites\n\n- At least one Design Doc must exist (created manually or via reverse-engineer)\n- Existing implementation to test\n\n## Execution Flow\n\n### Step 0: Execute Skill\n\nExecute Skill: documentation-criteria (for task file template in Step 3)\n\n### Step 1: Discover and Validate Documents\n\n```bash\n# Verify at least one document path was provided\ntest -n \"$ARGUMENTS\" || { echo \"ERROR: No document paths provided\"; exit 1; }\n\n# Verify provided paths exist\nls $ARGUMENTS\n\n# Discover additional documents\nls docs/design/*.md 2>/dev/null | grep -v template\nls docs/ui-spec/*.md 2>/dev/null\n```\n\nClassify discovered documents by filename:\n- Filename contains `backend` → **Design Doc (backend)**\n- Filename contains `frontend` → **Design Doc (frontend)**\n- Located in `docs/ui-spec/` → **UI Spec** (optional)\n- None of the above → treat as single-layer Design Doc\n\n### Step 2: Skeleton Generation\n\nInvoke acceptance-test-generator using Agent tool:\n- `subagent_type`: \"dev-workflows:acceptance-test-generator\"\n- `description`: \"Generate test skeletons\"\n- `prompt`: List only the documents that exist from Step 1:\n  ```\n  Generate test skeletons from the following documents:\n  - Design Doc (backend): [path]    ← include only if exists\n  - Design Doc (frontend): [path]   ← include only if exists\n  - UI Spec: [path]                 ← include only if exists\n  ```\n\n**Expected output**: `generatedFiles` containing integration and e2e paths\n\n### Step 3: Create Task Files [GATE]\n\nCreate one task file per layer, using the monorepo-flow.md naming convention for deterministic agent routing:\n- Backend skeletons exist → `docs/plans/tasks/integration-tests-backend-task-YYYYMMDD.md`\n- Frontend skeletons exist → `docs/plans/tasks/integration-tests-frontend-task-YYYYMMDD.md`\n- Single-layer (no backend/frontend distinction) → `docs/plans/tasks/integration-tests-backend-task-YYYYMMDD.md`\n\n**Template** (per task file):\n```markdown\n---\nname: Implement [layer] integration tests for [feature name]\ntype: test-implementation\n---\n\n## Objective\n\nImplement test cases defined in skeleton files.\n\n## Target Files\n\n- Skeleton: [layer-specific paths from Step 2 generatedFiles]\n- Design Doc: [layer-specific Design Doc from Step 1]\n\n## Tasks\n\n- [ ] Implement each test case in skeleton\n- [ ] Verify all tests pass\n- [ ] Ensure coverage meets requirements\n\n## Acceptance Criteria\n\n- All skeleton test cases implemented\n- All tests passing\n- quality-fixer reports approved\n```\n\n**Output**: \"Task file(s) created at [path(s)]. Ready for Step 4.\"\n\n### Step 4: Test Implementation\n\nFor each task file from Step 3, invoke task-executor routed by filename pattern (per monorepo-flow.md):\n- `*-backend-task-*` → `subagent_type`: \"dev-workflows:task-executor\"\n- `*-frontend-task-*` → `subagent_type`: \"dev-workflows-frontend:task-executor-frontend\"\n- `description`: \"Implement integration tests\"\n- `prompt`: \"Task file: [task file path from Step 3]. Implement tests following the task file.\"\n\nExecute one task file at a time through Steps 4→5→6→7 before starting the next.\n\n**Expected output**: `status`, `testsAdded`\n\n### Step 5: Test Review\n\nInvoke integration-test-reviewer using Agent tool:\n- `subagent_type`: \"dev-workflows:integration-test-reviewer\"\n- `description`: \"Review test quality\"\n- `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]\"\n\n**Expected output**: `status` (approved/needs_revision), `requiredFixes`\n\n### Step 6: Apply Review Fixes\n\nCheck Step 5 result:\n- `status: approved` → Mark complete, proceed to Step 7\n- `status: needs_revision` → Invoke task-executor with requiredFixes, then return to Step 5\n\nInvoke task-executor routed by task filename pattern:\n- `*-backend-task-*` → `subagent_type`: \"dev-workflows:task-executor\"\n- `*-frontend-task-*` → `subagent_type`: \"dev-workflows-frontend:task-executor-frontend\"\n- `description`: \"Fix review findings\"\n- `prompt`: \"Fix the following issues in test files: [requiredFixes from Step 5]\"\n\n### Step 7: Quality Check\n\nInvoke quality-fixer routed by task filename pattern:\n- `*-backend-task-*` → `subagent_type`: \"dev-workflows:quality-fixer\"\n- `*-frontend-task-*` → `subagent_type`: \"dev-workflows-frontend:quality-fixer-frontend\"\n- `description`: \"Final quality assurance\"\n- `prompt`: \"Final quality assurance for test files added in this workflow. Run all tests and verify coverage.\"\n\n**Expected output**: `status` (approved/stub_detected/blocked)\n\nCheck quality-fixer response:\n- `stub_detected` → Return to Step 4 with `incompleteImplementations[]` details, then re-execute Steps 4→5→6→7\n- `blocked` → Escalate to user\n- `approved` → Proceed to Step 8\n\n### Step 8: Commit\n\nOn `approved` from quality-fixer:\n- Commit test files using Bash with message format: \"test: add [layer] integration tests for [feature name]\"\n\n### Step 9: Final Cleanup\n\nAfter 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:\n\n- 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\n\nIf task files cannot be deleted (filesystem error), report the failure but do not block completion.\n\n## Scope Boundary for Subagents\n\nAppend the following block to every subagent prompt invoked from this recipe:\n\n```\nScope boundary for subagents:\nOperate within the task scope and referenced files in the prompt.\nUse loaded skills to execute that scope.\nEscalate when the required fix or investigation falls outside that scope.\n```","tags":["recipe","add","integration","tests","claude","code","workflows","shinpr","agent-skills","agentic-ai","ai-agents","automation"],"capabilities":["skill","source-shinpr","skill-recipe-add-integration-tests","topic-agent-skills","topic-agentic-ai","topic-ai-agents","topic-automation","topic-claude-code","topic-claude-code-plugin","topic-code-quality","topic-developer-tools","topic-development-workflow","topic-llm-orchestration","topic-productivity","topic-prompt-engineering"],"categories":["claude-code-workflows"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/shinpr/claude-code-workflows/recipe-add-integration-tests","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add shinpr/claude-code-workflows","source_repo":"https://github.com/shinpr/claude-code-workflows","install_from":"skills.sh"}},"qualityScore":"0.613","qualityRationale":"deterministic score 0.61 from registry signals: · indexed on github topic:agent-skills · 327 github stars · SKILL.md body (6,543 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-02T18:53:51.893Z","embedding":null,"createdAt":"2026-04-18T22:03:05.494Z","updatedAt":"2026-05-02T18:53:51.893Z","lastSeenAt":"2026-05-02T18:53:51.893Z","tsv":"'-8':39 '/dev/null':196,204 '0':38,142 '1':158,182,273,393 '2':195,203,240,382,565 '3':156,313,446,493 '4':435,437,509,555,729,738 '5':510,522,584,607,656,739 '6':511,578,740 '7':512,593,658,741 '8':750,752 '9':777 'accept':83,245,257,409 'acceptance-test-gener':82,244,256 'across':52 'action':35 'ad':705 'add':3,6,769 'addit':17,190 'agent':249,331,531 'append':845 'appli':579 'approv':423,587,746,755 'approved/needs_revision':575 'approved/stub_detected/blocked':718 'argument':119,174,188 'assur':697,701 'backend':22,212,215,283,333,458,618,671 'backend-task':457,617,670 'backend/frontend':345 'bash':163,764 'block':742,839,848 'boundari':70,842,858 'cannot':828 'case':368,398,414 'check':64,111,582,660,719 'classifi':205 'cleanup':779 'codebas':11 'commit':753,760,788,799 'complet':589,840 'consum':57 'contain':211,217,307 'context':15,49,58,69,75,93 'convent':328 'core':28 'coverag':406,714 'creat':68,90,128,314,318,428,795,821 'creation':88 'criteria':149,410 'current':568 'defin':369 'definit':27 'deleg':46,80,97,104,112 'delet':789,812,830 'descript':260,481,542,641,694 'design':13,124,213,219,237,281,289,384,389 'detail':732 'detect':725 'determinist':330 'dev':254,463,474,536,623,634,676,687 'dev-workflow':253,462,535,622,675 'dev-workflows-frontend':473,633,686 'direct':55,91 'discov':159,189,206 'distinct':346 'doc':14,125,214,220,238,282,290,385,390 'docs/design':193 'docs/plans':800 'docs/plans/tasks/integration-tests-backend-task-':816 'docs/plans/tasks/integration-tests-backend-task-yyyymmdd.md':336,347 'docs/plans/tasks/integration-tests-frontend-task-':819 'docs/plans/tasks/integration-tests-frontend-task-yyyymmdd.md':340 'docs/ui-spec':201,224 'document':117,148,162,168,178,191,207,268,280 'documentation-criteria':147 'e2e':310 'echo':175 'engin':134 'ensur':405 'ephemer':802 'error':176,832 'escal':743,879 'everi':813,850 'execut':44,76,139,143,145,500,736,876 'executor':101,450,467,479,600,611,627,639 'exist':10,20,127,135,186,270,288,296,303,335,339 'exit':181 'expect':304,517,572,715 'failur':835 'fall':886 'featur':359,774 'file':67,87,152,316,321,351,372,374,426,443,487,489,499,503,551,558,652,704,762,783,792,814,827,868 'filenam':209,210,216,453,615,668 'filesystem':831 'final':695,699,778 'find':644 'first':34 'fix':581,642,646,883 'fixer':116,421,664,680,692,722,759 'flow':140 'follow':279,496,648,847 'format':767 'frontend':23,218,221,291,337,469,476,480,629,636,640,682,689,693 'frontend-task':468,628,681 'fullstack':25 'gate':317 'generat':79,85,242,247,259,261,274 'generatedfil':306,383,566 'grep':197 'ident':29 'implement':21,56,96,136,354,364,366,395,415,439,482,494 'includ':285,293,300 'incompleteimplement':731 'integr':4,107,308,356,483,527,539,771 'integration-test-review':106,526,538 'integration/e2e':7 'investig':885 'invok':243,447,525,597,608,661,853 'isol':74 'issu':649 'layer':236,323,343,355,377,387,560,571,770 'layer-specif':376,386,559 'least':122,166 'list':265 'load':873 'locat':222 'ls':187,192,200 'manual':129 'mark':588 'markdown':352 'match':567,815 'md':194,202,817,820 'meet':407 'messag':766 'method':77 'minim':92 'monorepo-flow.md':326,456 'must':126 'n':173 'name':327,353,360,775 'need':59,595 'next':516 'none':228 'object':365 'one':123,167,319,501 'oper':861 'option':227 'orchestr':26,33,47,89 'output':305,424,518,573,716 'outsid':887 'pass':404,418 'path':118,169,179,185,284,292,299,311,379,430,490,552,562 'pattern':454,616,669 'per':322,349,455 'phase':65 'prerequisit':120 'proceed':590,747 'process':786 'prompt':264,485,546,645,698,852,871 'provid':171,180,184 'qualiti':63,110,115,420,545,549,659,663,679,691,696,700,721,758 'quality-fix':114,419,662,678,720,757 'quality-fixer-frontend':690 're':735 're-execut':734 'readi':432 'recip':2,794,810,856 'recipe-add-integration-test':1 'referenc':867 'regist':36 'report':422,833 'requir':408,882 'requiredfix':576,602,653 'respons':723 'result':585 'retain':808 'return':604,726 'revers':133 'reverse-engin':132 'review':61,103,109,524,529,541,543,547,580,643 'revis':596 'rout':332,451,612,665 'run':709,811,824 'scope':841,857,865,878,889 'share':51 'singl':235,342 'single-lay':234,341 'skeleton':78,241,263,276,334,338,371,375,400,412,557 'skill':144,146,874 'skill-recipe-add-integration-tests' 'source-shinpr' 'spec':226,298 'specif':378,388,561 'start':514 'state':804 'status':519,574,586,594,717 'step':37,54,141,155,157,239,272,312,381,392,434,436,445,492,508,521,554,564,577,583,592,606,655,657,728,737,749,751,776 'stub':724 'subag':71,251,460,471,533,620,631,673,684,844,851,860 'target':373 'task':66,86,100,151,315,320,350,394,425,442,449,459,466,470,478,486,488,498,502,569,599,610,614,619,626,630,638,667,672,683,782,791,826,864 'task-executor':99,448,465,598,609,625 'task-executor-frontend':477,637 'taskcreat':41 'templat':153,199,348 'test':5,8,16,84,95,102,108,138,172,246,258,262,275,357,363,367,397,403,413,417,438,484,495,523,528,540,544,548,550,651,703,711,761,768,772 'test-implement':362 'testsad':520,556 'time':506 'tool':250,532 'topic-agent-skills' 'topic-agentic-ai' 'topic-ai-agents' 'topic-automation' 'topic-claude-code' 'topic-claude-code-plugin' 'topic-code-quality' 'topic-developer-tools' 'topic-development-workflow' 'topic-llm-orchestration' 'topic-productivity' 'topic-prompt-engineering' 'treat':232 'type':252,361,461,472,534,621,632,674,685 'ui':225,297 'usag':94 'use':12,40,248,324,530,763,872 'user':745 'v':198 'valid':161 'verifi':164,183,401,713 'via':131 'within':862 'work':72,797,803 'workflow':18,255,464,475,537,624,635,677,688,708","prices":[{"id":"950dec4a-0180-448d-b90e-b280dfcd91af","listingId":"6a2d86df-0c79-4b6c-aa99-653404479e88","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"shinpr","category":"claude-code-workflows","install_from":"skills.sh"},"createdAt":"2026-04-18T22:03:05.494Z"}],"sources":[{"listingId":"6a2d86df-0c79-4b6c-aa99-653404479e88","source":"github","sourceId":"shinpr/claude-code-workflows/recipe-add-integration-tests","sourceUrl":"https://github.com/shinpr/claude-code-workflows/tree/main/skills/recipe-add-integration-tests","isPrimary":false,"firstSeenAt":"2026-04-18T22:03:05.494Z","lastSeenAt":"2026-05-02T18:53:51.893Z"}],"details":{"listingId":"6a2d86df-0c79-4b6c-aa99-653404479e88","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"shinpr","slug":"recipe-add-integration-tests","github":{"repo":"shinpr/claude-code-workflows","stars":327,"topics":["agent-skills","agentic-ai","ai-agents","automation","claude-code","claude-code-plugin","code-quality","developer-tools","development-workflow","llm-orchestration","productivity","prompt-engineering","skills"],"license":"mit","html_url":"https://github.com/shinpr/claude-code-workflows","pushed_at":"2026-05-02T15:39:17Z","description":"Production-ready development workflows for Claude Code, powered by specialized AI agents.","skill_md_sha":"b05f1110e929a18936d6d547aef17d3481102cc7","skill_md_path":"skills/recipe-add-integration-tests/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/shinpr/claude-code-workflows/tree/main/skills/recipe-add-integration-tests"},"layout":"multi","source":"github","category":"claude-code-workflows","frontmatter":{"name":"recipe-add-integration-tests","description":"Add integration/E2E tests to existing codebase using Design Docs"},"skills_sh_url":"https://skills.sh/shinpr/claude-code-workflows/recipe-add-integration-tests"},"updatedAt":"2026-05-02T18:53:51.893Z"}}