[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M70P01C2PM1KH0N9MNQQMQ19":3,"skill-same:01M70P01C2PM1KH0N9MNQQMQ19":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":48,"linkOnly":49,"markdownContent":50,"markdownBody":51,"frontMatter":52,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":57,"repositoryHtmlUrl":58,"repositoryHomepageUrl":59,"ownerHtmlUrl":60,"ownerBlogUrl":61,"ownerDescription":62,"updatedAt":63,"install":64,"resources":77},"01M70P01C2PM1KH0N9MNQQMQ19","orchestration",null,"Multi-agent workflow patterns for Claude Code -- parallel dispatch, sequential pipelines, QC gates, retry loops, shared partials. Use when designing systems with multiple agents, commands, or processing stages.","shengdabai\u002FTony-Claude-Code-Skills","shengdabai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F116417419?v=4","01M70F6D2WY5PQV5A92BKYJQEW","Tony Sheng","01M70F6D3GAAAYZ5H4CC1G8VXM",3,"MIT","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fxiaolai\u002Fnlpm\u002Fskills\u002Fnlpm\u002Forchestration\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[5,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"commands","when","for","retry","with","loops","multi","processing","qc","gates","shared","patterns","workflow patterns","use","parallel dispatch","parallel","multi-agent","code","workflow","2026-11-10 10:12:30",false,"---\nname: orchestration\ndescription: \"Multi-agent workflow patterns for Claude Code -- parallel dispatch, sequential pipelines, QC gates, retry loops, shared partials. Use when designing systems with multiple agents, commands, or processing stages.\"\nversion: 0.1.0\n---\n\n# Orchestration\n\n> Scope: covers multi-agent workflow design. For individual agent authoring, see [[writing-agents]]. For plugin architecture, see [[writing-plugins]].\n\n## 1. Four Orchestration Patterns\n\n### Pattern A: Parallel Dispatch\n\nMultiple agents run simultaneously on independent work. A command dispatches them via the Task tool and synthesizes results.\n\n```\nCommand dispatches via Task:\n  |-- agent-1 (analyzes security)\n  |-- agent-2 (analyzes performance)\n  |-- agent-3 (analyzes architecture)\n  --> Command synthesizes all results into final report\n```\n\n**Use when**: agents don't depend on each other's output.\n\n**Real examples**:\n- grill plugin: 6 review agents analyze code from different angles in parallel\n- docs-guardian: 4 agents (staleness, accuracy, coverage, quality) run simultaneously\n\n**Implementation pattern in command body**:\n```markdown\n## Execution\n1. Dispatch the following agents in parallel using Task:\n   - security-agent: analyze for vulnerabilities\n   - performance-agent: analyze for bottlenecks\n   - architecture-agent: analyze for structural issues\n2. Collect all agent outputs\n3. Synthesize into a unified report with cross-references\n```\n\n**Key decisions**:\n| Decision | Recommendation |\n|----------|---------------|\n| Max parallel agents | 6 (diminishing returns above this) |\n| Timeout per agent | 120 seconds for sonnet, 300 for opus |\n| Failure handling | Continue with other agents if one fails |\n| Result merging | Deduplicate findings that appear in multiple agents |\n\n### Pattern B: Sequential Pipeline\n\nEach stage feeds into the next. Output of stage N is input to stage N+1.\n\n```\nparse --> chunk --> summarize --> QC --> output\n```\n\n**Use when**: each stage depends on the previous stage's output.\n\n**Real examples**:\n- reading-assistant: parse PDF -> chunk content -> summarize chunks -> QC summaries -> output\n- tdd-guardian: discover tests -> run tests -> check coverage -> analyze failures -> report -> enforce\n\n**Implementation pattern**:\n```markdown\n## Execution\n### Phase 1: Parse (haiku)\n1. Scan input files\n2. Extract structured content\n3. Output: parsed data as JSON\n\n### Phase 2: Process (sonnet)\n4. Receive parsed data from Phase 1\n5. Analyze and transform\n6. Output: processed results\n\n### Phase 3: QC (sonnet)\n7. Verify Phase 2 output meets quality bar\n8. Output: pass\u002Fwarn\u002Ffail verdict\n\n### Phase 4: Output\n9. If QC passed: format and deliver final report\n10. If QC failed: report failures and stop\n```\n\n**Key decisions**:\n| Decision | Recommendation |\n|----------|---------------|\n| Phase boundary | Each phase should have a clear input type and output type |\n| Error propagation | Fail fast -- don't continue past a failed phase |\n| State passing | Use structured output (JSON) between phases |\n| Resumability | Track phase status for long pipelines (see section 4) |\n\n### Pattern C: QC Gate\n\nAI processing followed by quality verification before output reaches the user.\n\n```\nPhase 1: Mechanical prep (haiku)\nPhase 2: AI work (sonnet)\nPhase 3: QC verification (sonnet\u002Fopus)\n  --> pass: proceed to output\n  --> warn: output with warnings\n  --> fail: stop, report issues\nPhase 4: Output\n```\n\n**Use when**: AI output needs verification before the user sees it.\n\n**Threshold design**:\n| Verdict | Condition | Action |\n|---------|-----------|--------|\n| PASS | All checks green | Deliver output directly |\n| WARN | Minor issues (\u003C 3 low-severity) | Deliver output with warnings section |\n| FAIL | Any critical issue OR > 5 total issues | Stop, report what failed, suggest re-run |\n\n**Real examples**:\n- reading-assistant: QC agents verify summaries for accuracy, completeness, fidelity\n- codex-toolkit audit-fix: audit -> fix -> verify loop\n\n### Pattern D: Retry Loop\n\nOn failure, re-dispatch with error context. The agent gets a second chance with specific feedback about what went wrong.\n\n```\nagent produces output\n  --> QC checks output\n    --> pass: done\n    --> fail: re-dispatch agent with error context\n      --> QC re-checks\n        --> pass: done\n        --> fail (attempt 2): re-dispatch again\n          --> max retries reached: fail with report\n```\n\n**Use when**: quality failures are recoverable by re-trying with more context.\n\n**Implementation**:\n```markdown\n## Retry Protocol\n- Max retries: 3\n- On retry, include in the agent prompt:\n  - Previous output (or summary if too long)\n  - Specific failures from QC\n  - Instruction: \"Fix ONLY the listed failures. Do not change passing sections.\"\n- If max retries exhausted: output best attempt with failure annotations\n```\n\n**Key decisions**:\n| Decision | Recommendation |\n|----------|---------------|\n| Max retries | 3 (rarely succeeds after 3 if it failed 3 times) |\n| Error context | Include specific failures, not \"try again\" |\n| Scope of retry | Fix only failures, preserve passing output |\n| Cost cap | Each retry costs full agent invocation -- budget accordingly |\n\n## 2. Shared Partials for DRY\n\nExtract common logic into `commands\u002Fshared\u002F*.md` with `user-invocable: false` in frontmatter.\n\n### When to Extract\n\n| Situation | Extract? |\n|-----------|----------|\n| Same logic in 3+ commands | Yes -- always extract |\n| Same logic in 2 commands, complex (> 20 lines) | Yes -- extract |\n| Same logic in 2 commands, simple (\u003C 10 lines) | No -- duplication is fine |\n| Logic used by 1 command but might be reused | No -- wait until it's actually reused |\n\n### Good Candidates for Extraction\n\n| Partial | What it contains | Who includes it |\n|---------|-----------------|-----------------|\n| `shared\u002Fload-config.md` | Read and validate plugin config file | All commands that need config |\n| `shared\u002Fdiscover-files.md` | Find target files by pattern\u002Fextension | Commands that scan the repo |\n| `shared\u002Fvalidate-prereqs.md` | Check tool availability, environment | Commands with external dependencies |\n| `shared\u002Fformat-report.md` | Common report header, footer, severity colors | Commands that output reports |\n\n### Partial File Structure\n\n```yaml\n---\nuser-invocable: false\ndescription: \"Shared config loading logic — reads and validates the plugin config file\"\n---\n```\n\n```markdown\n## Config Loading\n\n1. Look for `.config.md` in the project root\n2. If not found, look for `.config.yaml`\n3. If neither found, output error: \"Run `\u002Fplugin:init` first to create a config file\"\n4. Parse the config file\n5. Validate required fields: [list fields]\n6. Return parsed config\n```\n\n## 3. Cost Gates\n\nFor expensive AI pipelines, add a cost estimation step between mechanical prep and AI processing.\n\n### Implementation\n\n```\nPhase 1: Parse and discover (haiku -- cheap)\n  --> Count items to process\n  --> Estimate cost: items x model cost per item\n  --> Display estimate to user\n\nUser confirms or adjusts scope\n\nPhase 2: AI processing (sonnet\u002Fopus -- expensive)\n  --> Process confirmed scope\n```\n\n### Cost Estimation Table\n\n| Model | Approx cost per item | 10 items | 100 items | 1000 items |\n|-------|---------------------|----------|-----------|------------|\n| haiku | $0.001 | $0.01 | $0.10 | $1.00 |\n| sonnet | $0.01 | $0.10 | $1.00 | $10.00 |\n| opus | $0.03 | $0.30 | $3.00 | $30.00 |\n\n\"Item\" = one agent invocation processing one unit of work (one file, one chunk, one component).\n\n### User Confirmation Pattern\n\n```markdown\n## Cost Gate\nAfter Phase 1, display:\n- Items to process: {N}\n- Estimated model: {model}\n- Estimated cost: ~${amount}\n- Estimated time: ~{minutes} minutes\n\nAsk: \"Proceed with {N} items? (You can reduce scope with --filter)\"\n```\n\n## 4. Pipeline State\n\nFor resumable pipelines (long-running, expensive, or failure-prone), track state in a JSON file.\n\n### State File Schema\n\n```json\n{\n  \"pipeline\": \"my-pipeline\",\n  \"startedAt\": \"2024-01-15T10:00:00Z\",\n  \"configFingerprint\": \"sha256:abc123\",\n  \"phases\": {\n    \"parse\": {\n      \"status\": \"completed\",\n      \"startedAt\": \"2024-01-15T10:00:00Z\",\n      \"completedAt\": \"2024-01-15T10:00:05Z\",\n      \"itemsProcessed\": 42,\n      \"output\": \"parse-output.json\"\n    },\n    \"analyze\": {\n      \"status\": \"running\",\n      \"startedAt\": \"2024-01-15T10:00:06Z\",\n      \"itemsProcessed\": 15,\n      \"itemsTotal\": 42\n    },\n    \"qc\": {\n      \"status\": \"pending\"\n    }\n  },\n  \"lock\": {\n    \"pid\": 12345,\n    \"acquiredAt\": \"2024-01-15T10:00:00Z\"\n  }\n}\n```\n\n### State Transitions\n\n```\npending --> running --> completed\n                   --> failed\n                   --> skipped (if previous phase failed)\n```\n\n### Resumability Rules\n\n1. On start: check for existing state file\n2. If state exists and `configFingerprint` matches: resume from last incomplete phase\n3. If state exists and `configFingerprint` differs: warn user, offer fresh start or resume\n4. If lock exists: check if PID is alive. If dead, clear stale lock. If alive, abort.\n\n## 5. Model Tier Allocation\n\nAssign models by cognitive load, not by importance.\n\n```\nMechanical \u002F IO:     haiku    (parser, scanner, formatter, counter)\nReasoning \u002F AI:      sonnet   (summarizer, extractor, reviewer, linter)\nJudgment \u002F QC:       opus     (coordinator, architect, final reviewer)\n```\n\n### Pipeline Model Assignment Example\n\n```\nPhase 1: Discover files          → haiku  (just glob + read)\nPhase 2: Parse and chunk         → haiku  (mechanical splitting)\nPhase 3: Analyze each chunk      → sonnet (requires judgment)\nPhase 4: QC all analyses         → sonnet (verify, not create)\nPhase 5: Synthesize final report → opus   (cross-reference, prioritize)\n```\n\n### Cost Optimization\n\n| Optimization | How | Savings |\n|-------------|-----|---------|\n| Batch mechanical work | One haiku call processes all files, not one per file | 5-10x |\n| Pre-filter before AI | Use grep\u002Fglob to skip irrelevant files before sonnet | 2-5x |\n| Cache phase outputs | Don't re-run completed phases on retry | 1-3x |\n| Scope reduction | Let user filter to subset before expensive phases | Variable |\n\n## 6. Error Propagation\n\n### Rules\n\n1. **Phase fails -> STOP.** Set status \"failed\" + error message in state. Do not continue to next phase.\n2. **Agent fails -> report and continue** (in parallel dispatch). One agent's failure shouldn't block others.\n3. **Retry fails -> escalate.** After max retries, surface the failure to the user with full context.\n4. **Never swallow errors silently.** Every failure must be visible in the final output.\n\n### Error Report Format\n\n```markdown\n## Pipeline Error\n\n**Phase**: {phase_name}\n**Status**: FAILED\n**Error**: {error_message}\n\n### Context\n- Items processed before failure: {N} of {M}\n- Last successful item: {item_id}\n- Time elapsed: {duration}\n\n### Recovery Options\n1. Fix the issue and run `\u002Fcommand --resume` to continue from this phase\n2. Run `\u002Fcommand --restart` to start fresh\n3. Run `\u002Fcommand --skip-phase {phase_name}` to skip this phase (not recommended)\n```\n\n### Fallback Paths\n\nAlways offer a manual fallback when automation fails:\n\n```markdown\n## Fallback\nIf the pipeline fails after 3 retries:\n1. Output all successfully processed items\n2. List failed items with error context\n3. Suggest manual analysis for failed items\n```\n\n## 7. Pattern Selection Guide\n\n| Your situation | Pattern | Why |\n|---------------|---------|-----|\n| Multiple independent analyses of same input | A: Parallel | No dependencies, maximize throughput |\n| Each step needs previous step's output | B: Sequential | Data flows in one direction |\n| AI output must be verified before delivery | C: QC Gate | Catch errors before user sees them |\n| Quality failures are recoverable with feedback | D: Retry | Cheaper than manual re-run |\n| Complex multi-stage with verification | B + C | Pipeline with QC gates between expensive phases |\n| Multiple analyses with quality bar | A + C | Parallel dispatch, then QC all results |\n","# Orchestration\n\n> Scope: covers multi-agent workflow design. For individual agent authoring, see [[writing-agents]]. For plugin architecture, see [[writing-plugins]].\n\n## 1. Four Orchestration Patterns\n\n### Pattern A: Parallel Dispatch\n\nMultiple agents run simultaneously on independent work. A command dispatches them via the Task tool and synthesizes results.\n\n```\nCommand dispatches via Task:\n  |-- agent-1 (analyzes security)\n  |-- agent-2 (analyzes performance)\n  |-- agent-3 (analyzes architecture)\n  --> Command synthesizes all results into final report\n```\n\n**Use when**: agents don't depend on each other's output.\n\n**Real examples**:\n- grill plugin: 6 review agents analyze code from different angles in parallel\n- docs-guardian: 4 agents (staleness, accuracy, coverage, quality) run simultaneously\n\n**Implementation pattern in command body**:\n```markdown\n## Execution\n1. Dispatch the following agents in parallel using Task:\n   - security-agent: analyze for vulnerabilities\n   - performance-agent: analyze for bottlenecks\n   - architecture-agent: analyze for structural issues\n2. Collect all agent outputs\n3. Synthesize into a unified report with cross-references\n```\n\n**Key decisions**:\n| Decision | Recommendation |\n|----------|---------------|\n| Max parallel agents | 6 (diminishing returns above this) |\n| Timeout per agent | 120 seconds for sonnet, 300 for opus |\n| Failure handling | Continue with other agents if one fails |\n| Result merging | Deduplicate findings that appear in multiple agents |\n\n### Pattern B: Sequential Pipeline\n\nEach stage feeds into the next. Output of stage N is input to stage N+1.\n\n```\nparse --> chunk --> summarize --> QC --> output\n```\n\n**Use when**: each stage depends on the previous stage's output.\n\n**Real examples**:\n- reading-assistant: parse PDF -> chunk content -> summarize chunks -> QC summaries -> output\n- tdd-guardian: discover tests -> run tests -> check coverage -> analyze failures -> report -> enforce\n\n**Implementation pattern**:\n```markdown\n## Execution\n### Phase 1: Parse (haiku)\n1. Scan input files\n2. Extract structured content\n3. Output: parsed data as JSON\n\n### Phase 2: Process (sonnet)\n4. Receive parsed data from Phase 1\n5. Analyze and transform\n6. Output: processed results\n\n### Phase 3: QC (sonnet)\n7. Verify Phase 2 output meets quality bar\n8. Output: pass\u002Fwarn\u002Ffail verdict\n\n### Phase 4: Output\n9. If QC passed: format and deliver final report\n10. If QC failed: report failures and stop\n```\n\n**Key decisions**:\n| Decision | Recommendation |\n|----------|---------------|\n| Phase boundary | Each phase should have a clear input type and output type |\n| Error propagation | Fail fast -- don't continue past a failed phase |\n| State passing | Use structured output (JSON) between phases |\n| Resumability | Track phase status for long pipelines (see section 4) |\n\n### Pattern C: QC Gate\n\nAI processing followed by quality verification before output reaches the user.\n\n```\nPhase 1: Mechanical prep (haiku)\nPhase 2: AI work (sonnet)\nPhase 3: QC verification (sonnet\u002Fopus)\n  --> pass: proceed to output\n  --> warn: output with warnings\n  --> fail: stop, report issues\nPhase 4: Output\n```\n\n**Use when**: AI output needs verification before the user sees it.\n\n**Threshold design**:\n| Verdict | Condition | Action |\n|---------|-----------|--------|\n| PASS | All checks green | Deliver output directly |\n| WARN | Minor issues (\u003C 3 low-severity) | Deliver output with warnings section |\n| FAIL | Any critical issue OR > 5 total issues | Stop, report what failed, suggest re-run |\n\n**Real examples**:\n- reading-assistant: QC agents verify summaries for accuracy, completeness, fidelity\n- codex-toolkit audit-fix: audit -> fix -> verify loop\n\n### Pattern D: Retry Loop\n\nOn failure, re-dispatch with error context. The agent gets a second chance with specific feedback about what went wrong.\n\n```\nagent produces output\n  --> QC checks output\n    --> pass: done\n    --> fail: re-dispatch agent with error context\n      --> QC re-checks\n        --> pass: done\n        --> fail (attempt 2): re-dispatch again\n          --> max retries reached: fail with report\n```\n\n**Use when**: quality failures are recoverable by re-trying with more context.\n\n**Implementation**:\n```markdown\n## Retry Protocol\n- Max retries: 3\n- On retry, include in the agent prompt:\n  - Previous output (or summary if too long)\n  - Specific failures from QC\n  - Instruction: \"Fix ONLY the listed failures. Do not change passing sections.\"\n- If max retries exhausted: output best attempt with failure annotations\n```\n\n**Key decisions**:\n| Decision | Recommendation |\n|----------|---------------|\n| Max retries | 3 (rarely succeeds after 3 if it failed 3 times) |\n| Error context | Include specific failures, not \"try again\" |\n| Scope of retry | Fix only failures, preserve passing output |\n| Cost cap | Each retry costs full agent invocation -- budget accordingly |\n\n## 2. Shared Partials for DRY\n\nExtract common logic into `commands\u002Fshared\u002F*.md` with `user-invocable: false` in frontmatter.\n\n### When to Extract\n\n| Situation | Extract? |\n|-----------|----------|\n| Same logic in 3+ commands | Yes -- always extract |\n| Same logic in 2 commands, complex (> 20 lines) | Yes -- extract |\n| Same logic in 2 commands, simple (\u003C 10 lines) | No -- duplication is fine |\n| Logic used by 1 command but might be reused | No -- wait until it's actually reused |\n\n### Good Candidates for Extraction\n\n| Partial | What it contains | Who includes it |\n|---------|-----------------|-----------------|\n| `shared\u002Fload-config.md` | Read and validate plugin config file | All commands that need config |\n| `shared\u002Fdiscover-files.md` | Find target files by pattern\u002Fextension | Commands that scan the repo |\n| `shared\u002Fvalidate-prereqs.md` | Check tool availability, environment | Commands with external dependencies |\n| `shared\u002Fformat-report.md` | Common report header, footer, severity colors | Commands that output reports |\n\n### Partial File Structure\n\n```yaml\n---\nuser-invocable: false\ndescription: \"Shared config loading logic — reads and validates the plugin config file\"\n---\n```\n\n```markdown\n## Config Loading\n\n1. Look for `.config.md` in the project root\n2. If not found, look for `.config.yaml`\n3. If neither found, output error: \"Run `\u002Fplugin:init` first to create a config file\"\n4. Parse the config file\n5. Validate required fields: [list fields]\n6. Return parsed config\n```\n\n## 3. Cost Gates\n\nFor expensive AI pipelines, add a cost estimation step between mechanical prep and AI processing.\n\n### Implementation\n\n```\nPhase 1: Parse and discover (haiku -- cheap)\n  --> Count items to process\n  --> Estimate cost: items x model cost per item\n  --> Display estimate to user\n\nUser confirms or adjusts scope\n\nPhase 2: AI processing (sonnet\u002Fopus -- expensive)\n  --> Process confirmed scope\n```\n\n### Cost Estimation Table\n\n| Model | Approx cost per item | 10 items | 100 items | 1000 items |\n|-------|---------------------|----------|-----------|------------|\n| haiku | $0.001 | $0.01 | $0.10 | $1.00 |\n| sonnet | $0.01 | $0.10 | $1.00 | $10.00 |\n| opus | $0.03 | $0.30 | $3.00 | $30.00 |\n\n\"Item\" = one agent invocation processing one unit of work (one file, one chunk, one component).\n\n### User Confirmation Pattern\n\n```markdown\n## Cost Gate\nAfter Phase 1, display:\n- Items to process: {N}\n- Estimated model: {model}\n- Estimated cost: ~${amount}\n- Estimated time: ~{minutes} minutes\n\nAsk: \"Proceed with {N} items? (You can reduce scope with --filter)\"\n```\n\n## 4. Pipeline State\n\nFor resumable pipelines (long-running, expensive, or failure-prone), track state in a JSON file.\n\n### State File Schema\n\n```json\n{\n  \"pipeline\": \"my-pipeline\",\n  \"startedAt\": \"2024-01-15T10:00:00Z\",\n  \"configFingerprint\": \"sha256:abc123\",\n  \"phases\": {\n    \"parse\": {\n      \"status\": \"completed\",\n      \"startedAt\": \"2024-01-15T10:00:00Z\",\n      \"completedAt\": \"2024-01-15T10:00:05Z\",\n      \"itemsProcessed\": 42,\n      \"output\": \"parse-output.json\"\n    },\n    \"analyze\": {\n      \"status\": \"running\",\n      \"startedAt\": \"2024-01-15T10:00:06Z\",\n      \"itemsProcessed\": 15,\n      \"itemsTotal\": 42\n    },\n    \"qc\": {\n      \"status\": \"pending\"\n    }\n  },\n  \"lock\": {\n    \"pid\": 12345,\n    \"acquiredAt\": \"2024-01-15T10:00:00Z\"\n  }\n}\n```\n\n### State Transitions\n\n```\npending --> running --> completed\n                   --> failed\n                   --> skipped (if previous phase failed)\n```\n\n### Resumability Rules\n\n1. On start: check for existing state file\n2. If state exists and `configFingerprint` matches: resume from last incomplete phase\n3. If state exists and `configFingerprint` differs: warn user, offer fresh start or resume\n4. If lock exists: check if PID is alive. If dead, clear stale lock. If alive, abort.\n\n## 5. Model Tier Allocation\n\nAssign models by cognitive load, not by importance.\n\n```\nMechanical \u002F IO:     haiku    (parser, scanner, formatter, counter)\nReasoning \u002F AI:      sonnet   (summarizer, extractor, reviewer, linter)\nJudgment \u002F QC:       opus     (coordinator, architect, final reviewer)\n```\n\n### Pipeline Model Assignment Example\n\n```\nPhase 1: Discover files          → haiku  (just glob + read)\nPhase 2: Parse and chunk         → haiku  (mechanical splitting)\nPhase 3: Analyze each chunk      → sonnet (requires judgment)\nPhase 4: QC all analyses         → sonnet (verify, not create)\nPhase 5: Synthesize final report → opus   (cross-reference, prioritize)\n```\n\n### Cost Optimization\n\n| Optimization | How | Savings |\n|-------------|-----|---------|\n| Batch mechanical work | One haiku call processes all files, not one per file | 5-10x |\n| Pre-filter before AI | Use grep\u002Fglob to skip irrelevant files before sonnet | 2-5x |\n| Cache phase outputs | Don't re-run completed phases on retry | 1-3x |\n| Scope reduction | Let user filter to subset before expensive phases | Variable |\n\n## 6. Error Propagation\n\n### Rules\n\n1. **Phase fails -> STOP.** Set status \"failed\" + error message in state. Do not continue to next phase.\n2. **Agent fails -> report and continue** (in parallel dispatch). One agent's failure shouldn't block others.\n3. **Retry fails -> escalate.** After max retries, surface the failure to the user with full context.\n4. **Never swallow errors silently.** Every failure must be visible in the final output.\n\n### Error Report Format\n\n```markdown\n## Pipeline Error\n\n**Phase**: {phase_name}\n**Status**: FAILED\n**Error**: {error_message}\n\n### Context\n- Items processed before failure: {N} of {M}\n- Last successful item: {item_id}\n- Time elapsed: {duration}\n\n### Recovery Options\n1. Fix the issue and run `\u002Fcommand --resume` to continue from this phase\n2. Run `\u002Fcommand --restart` to start fresh\n3. Run `\u002Fcommand --skip-phase {phase_name}` to skip this phase (not recommended)\n```\n\n### Fallback Paths\n\nAlways offer a manual fallback when automation fails:\n\n```markdown\n## Fallback\nIf the pipeline fails after 3 retries:\n1. Output all successfully processed items\n2. List failed items with error context\n3. Suggest manual analysis for failed items\n```\n\n## 7. Pattern Selection Guide\n\n| Your situation | Pattern | Why |\n|---------------|---------|-----|\n| Multiple independent analyses of same input | A: Parallel | No dependencies, maximize throughput |\n| Each step needs previous step's output | B: Sequential | Data flows in one direction |\n| AI output must be verified before delivery | C: QC Gate | Catch errors before user sees them |\n| Quality failures are recoverable with feedback | D: Retry | Cheaper than manual re-run |\n| Complex multi-stage with verification | B + C | Pipeline with QC gates between expensive phases |\n| Multiple analyses with quality bar | A + C | Parallel dispatch, then QC all results |\n",{"name":5,"version":53,"description":7},"0.1.0","main","7850740bd837adb32f0a109ab2af82482196c6f2","skills\u002Fxiaolai\u002Fnlpm\u002Fskills\u002Fnlpm\u002Forchestration",1,"https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills","https:\u002F\u002Fzturnsgo.com","https:\u002F\u002Fgithub.com\u002Fshengdabai","https:\u002F\u002Fzturnsgo.com\u002F","AI × education creator — producer, not consumer. Taught 6,000+ learners; shipping learning tools & daily essays with Claude Code, practicing @xiaolai's way 🥋","2026-11-01 21:28:23",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":76},[66,69,72],{"tool":67,"command":68},"npx","npx skills add shengdabai\u002FTony-Claude-Code-Skills --skill orchestration",{"tool":70,"command":71},"bunx","bunx skills add shengdabai\u002FTony-Claude-Code-Skills --skill orchestration",{"tool":73,"command":74},"pnpm","pnpm dlx skills add shengdabai\u002FTony-Claude-Code-Skills --skill orchestration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fxiaolai\u002Fnlpm\u002Fskills\u002Fnlpm\u002Forchestration\u002FSKILL.md",true,[],[79,88,96,104,112,120],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":83,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":87},"01M73H7XKBHE1ETQDZT94MF9HH","seedance-prompt-en","Write effective prompts for Jimeng Seedance 2.0 multimodal AI video generation. Use when users want to create video prompts using text, images, videos, and audio inputs with the @ reference system. Covers camera movements, effects replication, video extension, editing, music beat-matching, e-commerce ads, short dramas, and educational content.","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fseedance-prompt-en\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fseedance-prompt-en\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":92,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":87},"01M73GRE9998Q1DZWC71N41JWG","onepage-pdf","Convert an HTML page into a single continuous-page PDF (one tall page, no pagination breaks), preserving desktop layout, backgrounds and selectable text. Use when the user asks to turn an HTML file\u002Freport\u002Fproposal into a \"single-page PDF\", \"long PDF\", \"不分页 PDF\", \"单页 PDF\", \"长图式 PDF\", or complains that an HTML-to-PDF export breaks into pages or cuts content. Supports optional string redaction with leak verification.","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fonepage-pdf\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fonepage-pdf\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":100,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":87},"01M73GQG1KZDADVPV3MHAT1J5A","native-feel-cross-platform-desktop","Use when the user is designing, prototyping, or rewriting a desktop app that must run on multiple OSes (macOS + Windows, optionally Linux) AND feel indistinguishable from a native app to its users — fast launch, native windowing, native input handling, native materials. Trigger words include \"cross-platform desktop\", \"Electron alternative\", \"Tauri vs native\", \"WebView wrapper\", \"near-native performance\", \"Raycast architecture\", \"WebKit\u002FWebView2 quirks\", \"WKWebView\", \"system tray app\", \"global hotkey app\", \"launcher app\". Do NOT trigger this skill for pure web apps, pure mobile apps, or for greenfield projects that have no native-feel requirement.","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnative-feel-cross-platform-desktop\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnative-feel-cross-platform-desktop\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":108,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":87},"01M73G87PDNSMKG2FHWCYER6N8","gstack","Router for the gstack skill suite. (gstack)","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fgstack\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fgstack\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":116,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":87},"01M73G3EAQWKCM8DB8D0N0QSVG","fireworks-tech-graph","Use when the user wants to create any technical diagram - architecture, data flow, flowchart, sequence, agent\u002Fmemory, or concept map - and export as SVG+PNG. Trigger on: \"画图\" \"帮我画\" \"生成图\" \"做个图\" \"架构图\" \"流程图\" \"可视化一下\" \"出图\" \"generate diagram\" \"draw diagram\" \"visualize\" or any system\u002Fflow description the user wants illustrated.","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ffireworks-tech-graph\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ffireworks-tech-graph\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":87},"01M73G086AXAH9DW1H5G5N3CPB","dbs-video-extract","接收抖音、小红书、微信视频号等短视频链接或分享文案，查询作品／账号数据并提取语音文字稿，按作者和标题归档为 Markdown。用户希望完整解析短视频、取得数据或文字稿时使用；运行前检查 TikHub 与轻抖使用凭证，缺少时用新手能理解的方式引导购买和安全配置。","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdbs-video-extract\u002FSKILL.md",[],[]]