{"id":"de6c9117-3a7e-423a-90ea-dc3a7964c5b5","shortId":"QSNbAB","kind":"skill","title":"recipe-diagnose","tagline":"Investigate problem, verify findings, and derive solutions","description":"**Context**: Diagnosis flow to identify root cause and present solutions\n\nTarget problem: $ARGUMENTS\n\n## Orchestrator Definition\n\n**Core Identity**: \"I am not a worker. I am an orchestrator.\"\n\n**Execution Method**:\n- Investigation → performed by investigator\n- Verification → performed by verifier\n- Solution derivation → performed by solver\n\nOrchestrator invokes sub-agents and passes structured JSON between them.\n\n**Task Registration**: Register execution steps using TaskCreate and proceed systematically. Update status using TaskUpdate.\n\n## Step 0: Problem Structuring (Before investigator invocation)\n\n### 0.1 Problem Type Determination\n\n| Type | Criteria |\n|------|----------|\n| Change Failure | Indicates some change occurred before the problem appeared |\n| New Discovery | No relation to changes is indicated |\n\nIf uncertain, ask the user whether any changes were made right before the problem occurred.\n\n### 0.2 Information Supplementation for Change Failures\n\nIf the following are unclear, **ask with AskUserQuestion** before proceeding:\n- What was changed (cause change)\n- What broke (affected area)\n- Relationship between both (shared components, etc.)\n\n### 0.3 Problem Essence Understanding\n\n**Invoke rule-advisor via Agent tool**:\n```\nsubagent_type: rule-advisor\ndescription: \"Problem essence analysis\"\nprompt: Identify the essence and required rules for this problem: [Problem reported by user]\n```\n\nConfirm from rule-advisor output:\n- `taskAnalysis.mainFocus`: Primary focus of the problem\n- `mandatoryChecks.taskEssence`: Root problem beyond surface symptoms\n- `selectedRules`: Applicable rule sections\n- `warningPatterns`: Patterns to avoid\n\n### 0.4 Reflecting in investigator Prompt\n\n**Include the following in investigator prompt**:\n1. Problem essence (taskEssence)\n2. Key applicable rules summary (from selectedRules)\n3. Investigation focus (investigationFocus): Convert warningPatterns to \"points prone to confusion or oversight in this investigation\"\n4. **For change failures, additionally include**:\n   - Detailed analysis of the change content\n   - Commonalities between cause change and affected area\n   - Determination of whether the change is a \"correct fix\" or \"new bug\" with comparison baseline selection\n\n## Diagnosis Flow Overview\n\n```\nProblem → investigator → verifier → solver ─┐\n                 ↑                          │\n                 └── coverage insufficient ─┘\n                      (max 2 iterations)\n\ncoverage sufficient → Report\n```\n\n**Context Separation**: Pass only structured JSON output to each step. Each step starts fresh with the JSON data only.\n\n## Execution Steps\n\nRegister the following using TaskCreate and execute:\n\n### Step 1: Investigation (investigator)\n\n**Agent tool invocation**:\n```\nsubagent_type: investigator\ndescription: \"Investigate problem\"\nprompt: |\n  Comprehensively collect information related to the following phenomenon.\n\n  Phenomenon: [Problem reported by user]\n\n  Problem essence: [taskEssence from Step 0.3]\n  Investigation focus: [investigationFocus from Step 0.4]\n\n  [For change failures, additionally include:]\n  Change details: [What was changed]\n  Affected area: [What broke]\n  Shared components: [Commonalities between cause and effect]\n```\n\n**Expected output**: pathMap (execution paths per symptom), failurePoints (faults found at each node), impactAnalysis per failure point, unexplored areas, investigation limitations\n\n### Step 2: Investigation Quality Check\n\nReview investigation output:\n\n**Quality Check** (verify JSON output contains the following):\n- [ ] `pathMap` exists with at least one symptom, and each symptom has at least one path with nodes listed\n- [ ] Each failure point has: `location`, `upstreamDependency`, `symptomExplained`, `causalChain` (reaching a stop condition), `checkStatus`, `evidence` with a `source` citing a specific file or location\n- [ ] Each failure point has `comparisonAnalysis` (normalImplementation found or explicitly null)\n- [ ] `causeCategory` for each failure point is one of: typo / logic_error / missing_constraint / design_gap / external_factor\n- [ ] `investigationSources` covers at least 3 distinct source types (code, history, dependency, config, document, external)\n- [ ] Investigation covers `investigationFocus` items (when provided in Step 0.4)\n- [ ] All nodes on mapped paths have been checked (no path was abandoned after finding the first fault)\n\n**If quality insufficient**: Re-run investigator specifying missing items explicitly:\n```\nprompt: |\n  Re-investigate with focus on the following gaps:\n  - Missing: [list specific missing items from quality check]\n\n  Previous investigation results (for context, do not re-investigate covered areas):\n  [Previous investigation JSON]\n```\n\n**design_gap Escalation**:\n\nWhen investigator output contains `causeCategory: design_gap` or `recurrenceRisk: high`:\n1. **Insert user confirmation before verifier execution**\n2. Use AskUserQuestion:\n   \"A design-level issue was detected. How should we proceed?\"\n   - A: Attempt fix within current design\n   - B: Include design reconsideration\n3. If user selects B, pass `includeRedesign: true` to solver\n\nProceed to verifier once quality is satisfied.\n\n### Step 3: Verification (verifier)\n\n**Agent tool invocation**:\n```\nsubagent_type: verifier\ndescription: \"Verify investigation results\"\nprompt: Verify the following investigation results.\n\nInvestigation results: [Investigation JSON output]\n```\n\n**Expected output**: Coverage check (missing paths, unchecked nodes), Devil's Advocate evaluation per failure point, failure point evaluation with checkStatus, coverage assessment\n\n**Coverage Criteria**:\n- **sufficient**: Main paths traced, all critical nodes checked, each failure point individually evaluated\n- **partial**: Main paths traced, some nodes unchecked or some failure points at blocked/not_reached\n- **insufficient**: Significant paths untraced, or critical nodes not investigated\n\n### Step 4: Solution Derivation (solver)\n\n**Agent tool invocation**:\n```\nsubagent_type: solver\ndescription: \"Derive solutions\"\nprompt: Derive solutions based on the following verified failure points.\n\nConfirmed failure points: [verifier's conclusion.confirmedFailurePoints]\nRefuted failure points: [verifier's conclusion.refutedFailurePoints]\nFailure point relationships: [verifier's conclusion.failurePointRelationships]\nImpact analysis: [investigator's impactAnalysis]\nCoverage assessment: [sufficient/partial/insufficient]\n```\n\n**Expected output**: Multiple solutions (at least 3), tradeoff analysis, recommendation and implementation steps, residual risks\n\n**Completion condition**: coverageAssessment=sufficient\n\n**When not reached**:\n1. Return to Step 1 with unchecked areas identified by verifier as investigation targets\n2. Maximum 2 additional investigation iterations\n3. After 2 iterations without reaching sufficient, present user with options:\n   - Continue additional investigation\n   - Execute solution at current coverage level\n\n### Step 5: Final Report Creation\n\n**Prerequisite**: coverageAssessment=sufficient achieved\n\nAfter diagnosis completion, report to user in the following format:\n\n```\n## Diagnosis Result Summary\n\n### Identified Failure Points\n[Confirmed failure points from verification results]\n- Per failure point: location, symptom explained, finalStatus\n\n### Verification Process\n- Path coverage: [Paths traced and nodes checked]\n- Additional investigation iterations: [0/1/2]\n- Coverage assessment: [sufficient/partial/insufficient]\n\n### Recommended Solution\n[Solution derivation recommendation]\n\nRationale: [Selection rationale]\n\n### Implementation Steps\n1. [Step 1]\n2. [Step 2]\n...\n\n### Alternatives\n[Alternative description]\n\n### Residual Risks\n[solver's residualRisks]\n\n### Post-Resolution Verification Items\n- [Verification item 1]\n- [Verification item 2]\n```\n\n## Completion Criteria\n\n- [ ] Executed investigator and obtained pathMap, failurePoints, and impactAnalysis\n- [ ] Performed investigation quality check and re-ran if insufficient\n- [ ] Executed verifier and obtained coverage assessment\n- [ ] Executed solver\n- [ ] Achieved coverageAssessment=sufficient (or obtained user approval after 2 additional iterations)\n- [ ] Presented final report to user","tags":["recipe","diagnose","claude","code","workflows","shinpr","agent-skills","agentic-ai","ai-agents","automation","claude-code","claude-code-plugin"],"capabilities":["skill","source-shinpr","skill-recipe-diagnose","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-diagnose","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 (8,216 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:52.178Z","embedding":null,"createdAt":"2026-04-18T22:03:07.917Z","updatedAt":"2026-05-02T18:53:52.178Z","lastSeenAt":"2026-05-02T18:53:52.178Z","tsv":"'0':78 '0.1':84 '0.2':123 '0.3':154,362 '0.4':214,368,517 '0/1/2':886 '1':225,331,592,796,800,900,902,921 '2':229,297,412,599,810,812,818,903,905,924,961 '3':236,499,623,641,780,816 '4':252,725 '5':837 'abandon':529 'achiev':844,953 'addit':256,372,813,828,883,962 'advisor':161,169,192 'advoc':675 'affect':146,269,379 'agent':56,163,334,644,729 'altern':906,907 'analysi':173,259,767,782 'appear':99 'applic':207,231 'approv':959 'area':147,270,380,408,575,803 'argument':23 'ask':110,134 'askuserquest':136,601 'assess':686,772,888,950 'attempt':614 'avoid':213 'b':619,627 'base':741 'baselin':285 'beyond':203 'blocked/not_reached':714 'broke':145,382 'bug':282 'caus':17,142,266,387 'causalchain':452 'causecategori':478,586 'chang':90,94,105,115,127,141,143,254,262,267,275,370,374,378 'check':415,420,525,563,668,696,882,938 'checkstatus':457,684 'cite':462 'code':503 'collect':345 'common':264,385 'comparison':284 'comparisonanalysi':472 'complet':789,847,925 'compon':152,384 'comprehens':344 'conclusion.confirmedfailurepoints':753 'conclusion.failurepointrelationships':765 'conclusion.refutedfailurepoints':759 'condit':456,790 'config':506 'confirm':188,595,748,861 'confus':246 'constraint':490 'contain':424,585 'content':263 'context':11,302,568 'continu':827 'convert':240 'core':26 'correct':278 'cover':496,510,574 'coverag':294,299,667,685,687,771,834,877,887,949 'coverageassess':791,842,954 'creation':840 'criteria':89,688,926 'critic':694,720 'current':617,833 'data':319 'definit':25 'depend':505 'deriv':9,48,727,736,739,893 'descript':170,340,650,735,908 'design':491,579,587,604,618,621 'design-level':603 'detail':258,375 'detect':608 'determin':87,271 'devil':673 'diagnos':3 'diagnosi':12,287,846,855 'discoveri':101 'distinct':500 'document':507 'effect':389 'error':488 'escal':581 'essenc':156,172,177,227,358 'etc':153 'evalu':676,682,701 'evid':458 'execut':37,66,321,329,393,598,830,927,945,951 'exist':428 'expect':390,665,774 'explain':872 'explicit':476,545 'extern':493,508 'factor':494 'failur':91,128,255,371,405,446,469,481,678,680,698,711,746,749,755,760,859,862,868 'failurepoint':397,932 'fault':398,534 'file':465 'final':838,965 'finalstatus':873 'find':7,531 'first':533 'fix':279,615 'flow':13,288 'focus':196,238,364,551 'follow':131,221,325,350,426,554,657,744,853 'format':854 'found':399,474 'fresh':315 'gap':492,555,580,588 'high':591 'histori':504 'ident':27 'identifi':15,175,804,858 'impact':766 'impactanalysi':403,770,934 'implement':785,898 'includ':219,257,373,620 'includeredesign':629 'indic':92,107 'individu':700 'inform':124,346 'insert':593 'insuffici':295,537,715,944 'investig':4,39,42,82,217,223,237,251,291,332,333,339,341,363,409,413,417,509,541,549,565,573,577,583,652,658,660,662,723,768,808,814,829,884,928,936 'investigationfocus':239,365,511 'investigationsourc':495 'invoc':83,336,646,731 'invok':53,158 'issu':606 'item':512,544,560,918,920,923 'iter':298,815,819,885,963 'json':60,307,318,422,578,663 'key':230 'least':431,439,498,779 'level':605,835 'limit':410 'list':444,557 'locat':449,467,870 'logic':487 'made':117 'main':690,703 'mandatorychecks.taskessence':200 'map':521 'max':296 'maximum':811 'method':38 'miss':489,543,556,559,669 'multipl':776 'new':100,281 'node':402,443,519,672,695,707,721,881 'normalimplement':473 'null':477 'obtain':930,948,957 'occur':95,122 'one':432,440,484 'option':826 'orchestr':24,36,52 'output':193,308,391,418,423,584,664,666,775 'oversight':248 'overview':289 'partial':702 'pass':58,304,628 'path':394,441,522,527,670,691,704,717,876,878 'pathmap':392,427,931 'pattern':211 'per':395,404,677,867 'perform':40,44,49,935 'phenomenon':351,352 'point':243,406,447,470,482,679,681,699,712,747,750,756,761,860,863,869 'post':915 'post-resolut':914 'prerequisit':841 'present':19,823,964 'previous':564,576 'primari':195 'problem':5,22,79,85,98,121,155,171,183,184,199,202,226,290,342,353,357 'proceed':71,138,612,633 'process':875 'prompt':174,218,224,343,546,654,738 'prone':244 'provid':514 'qualiti':414,419,536,562,637,937 'ran':942 'rational':895,897 're':539,548,572,941 're-investig':547,571 're-ran':940 're-run':538 'reach':453,795,821 'recip':2 'recipe-diagnos':1 'recommend':783,890,894 'reconsider':622 'recurrencerisk':590 'reflect':215 'refut':754 'regist':65,323 'registr':64 'relat':103,347 'relationship':148,762 'report':185,301,354,839,848,966 'requir':179 'residu':787,909 'residualrisk':913 'resolut':916 'result':566,653,659,661,856,866 'return':797 'review':416 'right':118 'risk':788,910 'root':16,201 'rule':160,168,180,191,208,232 'rule-advisor':159,167,190 'run':540 'satisfi':639 'section':209 'select':286,626,896 'selectedrul':206,235 'separ':303 'share':151,383 'signific':716 'skill' 'skill-recipe-diagnose' 'solut':10,20,47,726,737,740,777,831,891,892 'solver':51,293,632,728,734,911,952 'sourc':461,501 'source-shinpr' 'specif':464,558 'specifi':542 'start':314 'status':74 'step':67,77,311,313,322,330,361,367,411,516,640,724,786,799,836,899,901,904 'stop':455 'structur':59,80,306 'sub':55 'sub-ag':54 'subag':165,337,647,732 'suffici':300,689,792,822,843,955 'sufficient/partial/insufficient':773,889 'summari':233,857 'supplement':125 'surfac':204 'symptom':205,396,433,436,871 'symptomexplain':451 'systemat':72 'target':21,809 'task':63 'taskanalysis.mainfocus':194 'taskcreat':69,327 'taskess':228,359 'taskupd':76 'tool':164,335,645,730 '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' 'trace':692,705,879 'tradeoff':781 'true':630 'type':86,88,166,338,502,648,733 'typo':486 'uncertain':109 'uncheck':671,708,802 'unclear':133 'understand':157 'unexplor':407 'untrac':718 'updat':73 'upstreamdepend':450 'use':68,75,326,600 'user':112,187,356,594,625,824,850,958,968 'verif':43,642,865,874,917,919,922 'verifi':6,46,292,421,597,635,643,649,651,655,745,751,757,763,806,946 'via':162 'warningpattern':210,241 'whether':113,273 'within':616 'without':820 'worker':32","prices":[{"id":"f50bc8ff-a37c-4885-9a83-ac4924ec07a7","listingId":"de6c9117-3a7e-423a-90ea-dc3a7964c5b5","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:07.917Z"}],"sources":[{"listingId":"de6c9117-3a7e-423a-90ea-dc3a7964c5b5","source":"github","sourceId":"shinpr/claude-code-workflows/recipe-diagnose","sourceUrl":"https://github.com/shinpr/claude-code-workflows/tree/main/skills/recipe-diagnose","isPrimary":false,"firstSeenAt":"2026-04-18T22:03:07.917Z","lastSeenAt":"2026-05-02T18:53:52.178Z"}],"details":{"listingId":"de6c9117-3a7e-423a-90ea-dc3a7964c5b5","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"shinpr","slug":"recipe-diagnose","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":"16827f233c08eab166af4c5c3f855048791d69f3","skill_md_path":"skills/recipe-diagnose/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/shinpr/claude-code-workflows/tree/main/skills/recipe-diagnose"},"layout":"multi","source":"github","category":"claude-code-workflows","frontmatter":{"name":"recipe-diagnose","description":"Investigate problem, verify findings, and derive solutions"},"skills_sh_url":"https://skills.sh/shinpr/claude-code-workflows/recipe-diagnose"},"updatedAt":"2026-05-02T18:53:52.178Z"}}