[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H6CTWVPM35J9EJ73VXGW2T":3,"skill-same:01M6H6CTWVPM35J9EJ73VXGW2T":66},{"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":18,"publishedAt":29,"linkOnly":30,"markdownContent":31,"markdownBody":32,"frontMatter":33,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":37,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":40,"ownerDescription":6,"updatedAt":41,"install":42,"resources":55},"01M6H6CTWVPM35J9EJ73VXGW2T","m06-error-handling",null,"CRITICAL: Use for error handling. Triggers: Result, Option, Error, ?, unwrap, expect, panic, anyhow, thiserror, when to panic vs return Result, custom error, error propagation, 错误处理, Result 用法, 什么时候用 panic","0xharryriddle\u002Fcodex-field-kit","0xharryriddle","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F100945007?v=4","01M6H686JV0QKZYP2RWG6B2B8T","harryriddle","01M6H686PVZ8JGKWEG7B3GM5PD",3,"MIT","https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Farchive\u002Fupstream\u002Fchasebuild-agent-skills\u002Frust\u002Fskills\u002Fm06-error-handling\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28],"error handling","m06 error handling","error","option","use","propagation","triggers","critical","false","for","2026-11-10 10:12:30",false,"---\nname: m06-error-handling\ndescription: \"CRITICAL: Use for error handling. Triggers: Result, Option, Error, ?, unwrap, expect, panic, anyhow, thiserror, when to panic vs return Result, custom error, error propagation, 错误处理, Result 用法, 什么时候用 panic\"\nuser-invocable: false\n---\n\n# Error Handling\n\n> **Layer 1: Language Mechanics**\n\n## Core Question\n\n**Is this failure expected or a bug?**\n\nBefore choosing error handling strategy:\n- Can this fail in normal operation?\n- Who should handle this failure?\n- What context does the caller need?\n\n---\n\n## Error → Design Question\n\n| Pattern | Don't Just Say | Ask Instead |\n|---------|----------------|-------------|\n| unwrap panics | \"Use ?\" | Is None\u002FErr actually possible here? |\n| Type mismatch on ? | \"Use anyhow\" | Are error types designed correctly? |\n| Lost error context | \"Add .context()\" | What does the caller need to know? |\n| Too many error variants | \"Use Box\u003Cdyn Error>\" | Is error granularity right? |\n\n---\n\n## Thinking Prompt\n\nBefore handling an error:\n\n1. **What kind of failure is this?**\n   - Expected → Result\u003CT, E>\n   - Absence normal → Option\u003CT>\n   - Bug\u002Finvariant → panic!\n   - Unrecoverable → panic!\n\n2. **Who handles this?**\n   - Caller → propagate with ?\n   - Current function → match\u002Fif-let\n   - User → friendly error message\n   - Programmer → panic with message\n\n3. **What context is needed?**\n   - Type of error → thiserror variants\n   - Call chain → anyhow::Context\n   - Debug info → anyhow or tracing\n\n---\n\n## Trace Up ↑\n\nWhen error strategy is unclear:\n\n```\n\"Should I return Result or Option?\"\n    ↑ Ask: Is absence\u002Ffailure normal or exceptional?\n    ↑ Check: m09-domain (what does domain say?)\n    ↑ Check: domain-* (error handling requirements)\n```\n\n| Situation | Trace To | Question |\n|-----------|----------|----------|\n| Too many unwraps | m09-domain | Is the data model right? |\n| Error context design | m13-domain-error | What recovery is needed? |\n| Library vs app errors | m11-ecosystem | Who are the consumers? |\n\n---\n\n## Trace Down ↓\n\nFrom design to implementation:\n\n```\n\"Expected failure, library code\"\n    ↓ Use: thiserror for typed errors\n\n\"Expected failure, application code\"\n    ↓ Use: anyhow for ergonomic errors\n\n\"Absence is normal (find, get, lookup)\"\n    ↓ Use: Option\u003CT>\n\n\"Bug or invariant violation\"\n    ↓ Use: panic!, assert!, unreachable!\n\n\"Need to propagate with context\"\n    ↓ Use: .context(\"what was happening\")\n```\n\n---\n\n## Quick Reference\n\n| Pattern | When | Example |\n|---------|------|---------|\n| `Result\u003CT, E>` | Recoverable error | `fn read() -> Result\u003CString, io::Error>` |\n| `Option\u003CT>` | Absence is normal | `fn find() -> Option\u003C&Item>` |\n| `?` | Propagate error | `let data = file.read()?;` |\n| `unwrap()` | Dev\u002Ftest only | `config.get(\"key\").unwrap()` |\n| `expect()` | Invariant holds | `env.get(\"HOME\").expect(\"HOME set\")` |\n| `panic!` | Unrecoverable | `panic!(\"critical failure\")` |\n\n## Library vs Application\n\n| Context | Error Crate | Why |\n|---------|-------------|-----|\n| Library | `thiserror` | Typed errors for consumers |\n| Application | `anyhow` | Ergonomic error handling |\n| Mixed | Both | thiserror at boundaries, anyhow internally |\n\n## Decision Flowchart\n\n```\nIs failure expected?\n├─ Yes → Is absence the only \"failure\"?\n│        ├─ Yes → Option\u003CT>\n│        └─ No → Result\u003CT, E>\n│                 ├─ Library → thiserror\n│                 └─ Application → anyhow\n└─ No → Is it a bug?\n        ├─ Yes → panic!, assert!\n        └─ No → Consider if really unrecoverable\n\nUse ? → Need context?\n├─ Yes → .context(\"message\")\n└─ No → Plain ?\n```\n\n---\n\n## Common Errors\n\n| Error | Cause | Fix |\n|-------|-------|-----|\n| `unwrap()` panic | Unhandled None\u002FErr | Use `?` or match |\n| Type mismatch | Different error types | Use `anyhow` or `From` |\n| Lost context | `?` without context | Add `.context()` |\n| `cannot use ?` | Missing Result return | Return `Result\u003C(), E>` |\n\n---\n\n## Anti-Patterns\n\n| Anti-Pattern | Why Bad | Better |\n|--------------|---------|--------|\n| `.unwrap()` everywhere | Panics in production | `.expect(\"reason\")` or `?` |\n| Ignore errors silently | Bugs hidden | Handle or propagate |\n| `panic!` for expected errors | Bad UX, no recovery | Result |\n| Box\u003Cdyn Error> everywhere | Lost type info | thiserror |\n\n---\n\n## Related Skills\n\n| When | See |\n|------|-----|\n| Domain error strategy | m13-domain-error |\n| Crate boundaries | m11-ecosystem |\n| Type-safe errors | m05-type-driven |\n| Mental models | m14-mental-model |\n","# Error Handling\n\n> **Layer 1: Language Mechanics**\n\n## Core Question\n\n**Is this failure expected or a bug?**\n\nBefore choosing error handling strategy:\n- Can this fail in normal operation?\n- Who should handle this failure?\n- What context does the caller need?\n\n---\n\n## Error → Design Question\n\n| Pattern | Don't Just Say | Ask Instead |\n|---------|----------------|-------------|\n| unwrap panics | \"Use ?\" | Is None\u002FErr actually possible here? |\n| Type mismatch on ? | \"Use anyhow\" | Are error types designed correctly? |\n| Lost error context | \"Add .context()\" | What does the caller need to know? |\n| Too many error variants | \"Use Box\u003Cdyn Error>\" | Is error granularity right? |\n\n---\n\n## Thinking Prompt\n\nBefore handling an error:\n\n1. **What kind of failure is this?**\n   - Expected → Result\u003CT, E>\n   - Absence normal → Option\u003CT>\n   - Bug\u002Finvariant → panic!\n   - Unrecoverable → panic!\n\n2. **Who handles this?**\n   - Caller → propagate with ?\n   - Current function → match\u002Fif-let\n   - User → friendly error message\n   - Programmer → panic with message\n\n3. **What context is needed?**\n   - Type of error → thiserror variants\n   - Call chain → anyhow::Context\n   - Debug info → anyhow or tracing\n\n---\n\n## Trace Up ↑\n\nWhen error strategy is unclear:\n\n```\n\"Should I return Result or Option?\"\n    ↑ Ask: Is absence\u002Ffailure normal or exceptional?\n    ↑ Check: m09-domain (what does domain say?)\n    ↑ Check: domain-* (error handling requirements)\n```\n\n| Situation | Trace To | Question |\n|-----------|----------|----------|\n| Too many unwraps | m09-domain | Is the data model right? |\n| Error context design | m13-domain-error | What recovery is needed? |\n| Library vs app errors | m11-ecosystem | Who are the consumers? |\n\n---\n\n## Trace Down ↓\n\nFrom design to implementation:\n\n```\n\"Expected failure, library code\"\n    ↓ Use: thiserror for typed errors\n\n\"Expected failure, application code\"\n    ↓ Use: anyhow for ergonomic errors\n\n\"Absence is normal (find, get, lookup)\"\n    ↓ Use: Option\u003CT>\n\n\"Bug or invariant violation\"\n    ↓ Use: panic!, assert!, unreachable!\n\n\"Need to propagate with context\"\n    ↓ Use: .context(\"what was happening\")\n```\n\n---\n\n## Quick Reference\n\n| Pattern | When | Example |\n|---------|------|---------|\n| `Result\u003CT, E>` | Recoverable error | `fn read() -> Result\u003CString, io::Error>` |\n| `Option\u003CT>` | Absence is normal | `fn find() -> Option\u003C&Item>` |\n| `?` | Propagate error | `let data = file.read()?;` |\n| `unwrap()` | Dev\u002Ftest only | `config.get(\"key\").unwrap()` |\n| `expect()` | Invariant holds | `env.get(\"HOME\").expect(\"HOME set\")` |\n| `panic!` | Unrecoverable | `panic!(\"critical failure\")` |\n\n## Library vs Application\n\n| Context | Error Crate | Why |\n|---------|-------------|-----|\n| Library | `thiserror` | Typed errors for consumers |\n| Application | `anyhow` | Ergonomic error handling |\n| Mixed | Both | thiserror at boundaries, anyhow internally |\n\n## Decision Flowchart\n\n```\nIs failure expected?\n├─ Yes → Is absence the only \"failure\"?\n│        ├─ Yes → Option\u003CT>\n│        └─ No → Result\u003CT, E>\n│                 ├─ Library → thiserror\n│                 └─ Application → anyhow\n└─ No → Is it a bug?\n        ├─ Yes → panic!, assert!\n        └─ No → Consider if really unrecoverable\n\nUse ? → Need context?\n├─ Yes → .context(\"message\")\n└─ No → Plain ?\n```\n\n---\n\n## Common Errors\n\n| Error | Cause | Fix |\n|-------|-------|-----|\n| `unwrap()` panic | Unhandled None\u002FErr | Use `?` or match |\n| Type mismatch | Different error types | Use `anyhow` or `From` |\n| Lost context | `?` without context | Add `.context()` |\n| `cannot use ?` | Missing Result return | Return `Result\u003C(), E>` |\n\n---\n\n## Anti-Patterns\n\n| Anti-Pattern | Why Bad | Better |\n|--------------|---------|--------|\n| `.unwrap()` everywhere | Panics in production | `.expect(\"reason\")` or `?` |\n| Ignore errors silently | Bugs hidden | Handle or propagate |\n| `panic!` for expected errors | Bad UX, no recovery | Result |\n| Box\u003Cdyn Error> everywhere | Lost type info | thiserror |\n\n---\n\n## Related Skills\n\n| When | See |\n|------|-----|\n| Domain error strategy | m13-domain-error |\n| Crate boundaries | m11-ecosystem |\n| Type-safe errors | m05-type-driven |\n| Mental models | m14-mental-model |\n",{"name":5,"description":7,"user-invocable":30},"main","6c13f6f4ac5a3bc1e6b78cd2bb1704f122c4a73e","archive\u002Fupstream\u002Fchasebuild-agent-skills\u002Frust\u002Fskills\u002Fm06-error-handling",0,"https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit","https:\u002F\u002Fgithub.com\u002F0xharryriddle","https:\u002F\u002Fharryriddle.vercel.app","2026-04-11 11:49:51",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add 0xharryriddle\u002Fcodex-field-kit --skill m06-error-handling",{"tool":48,"command":49},"bunx","bunx skills add 0xharryriddle\u002Fcodex-field-kit --skill m06-error-handling",{"tool":51,"command":52},"pnpm","pnpm dlx skills add 0xharryriddle\u002Fcodex-field-kit --skill m06-error-handling","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Farchive\u002Fupstream\u002Fchasebuild-agent-skills\u002Frust\u002Fskills\u002Fm06-error-handling\u002FSKILL.md",true,[56,62],{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"examples\u002Flibrary-vs-app.md","REFERENCE","参考文档",8210,"https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Farchive\u002Fupstream\u002Fchasebuild-agent-skills\u002Frust\u002Fskills\u002Fm06-error-handling\u002Fexamples\u002Flibrary-vs-app.md",{"path":63,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":64,"sourceHtmlUrl":65},"patterns\u002Ferror-patterns.md",8592,"https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Farchive\u002Fupstream\u002Fchasebuild-agent-skills\u002Frust\u002Fskills\u002Fm06-error-handling\u002Fpatterns\u002Ferror-patterns.md",[67,98,116,126,152,179],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":78,"publishedAt":29},"01M6H7ZKE6MR33HC84QZ1TA6MV","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-react-best-practices\u002FSKILL.md",[73],{"categoryNo":74,"categoryName":75,"taxonomyType":76,"taxonomyTypeDesc":77},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",[79,80,81,82,83,84,85,25,86,87,88,89,90,91,92,93,94,95,96,97],"react best practices","react","vercel react best practices","best practices","vercel","tasks","data fetching","pages","next","performance optimization","refactoring","Next.js","Optimization","code","guidelines","react components","components","performance","writing",{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":29},"01M6H7ZGC2WK8SEKYHWDNTMDA9","swarm-planner","[EXPLICIT INVOCATION ONLY] Creates dependency-aware implementation plans optimized for parallel multi-agent execution.","https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Fskills\u002Fswarm-planner\u002FSKILL.md",[],[105,106,107,108,109,110,111,112,113,28,114,115],"swarm","swarm planner","planner","parallel","multi-agent","only","execution","plans","dependency","multi","implementation",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":29},"01M6H7ZD93853RZCYQWH1D38TM","super-swarm-spark","Only to be triggered by explicit super-swarm-spark commands.","https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Fskills\u002Fsuper-swarm-spark\u002FSKILL.md",[],[123,105,124,110,125],"super swarm spark","spark","commands",{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":29},"01M6H7Z987QBY49JCCPT953EAZ","role-creator","Create and install Codex custom agent roles in ~\u002F.codex\u002Fconfig.toml, generate role config files, enforce supported keys, and guide users through required role inputs (model, reasoning effort, developer_instructions).","https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Fskills\u002Frole-creator\u002FSKILL.md",[],[133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151],"role","creator","role creator","keys","users","roles","toml","enforce","install","guide","instructions","model","developer","reasoning","generate","create","config","codex","files",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":161,"publishedAt":29},"01M6H7Z5TRPMDQ7YSZQXPN1G60","read-github","Read and search GitHub repository documentation via gitmcp.io MCP service.\n\n**WHEN TO USE:**\n- User provides a GitHub URL\n- User mentions a specific repo in owner\u002Frepo format\n- User asks \"what does this repo do?\", \"read the docs for X repo\", or similar\n- User wants to search code or docs within a repo","https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Fskills\u002Fread-github\u002FSKILL.md",[158],{"categoryNo":159,"categoryName":160,"taxonomyType":76,"taxonomyTypeDesc":77},"01JBSEEDCAT000000000000023","Skill与智能体开发",[162,163,164,92,165,166,167,168,28,169,170,171,172,173,174,23,175,176,177,178],"github","read github","read","documentation","docs","MCP","search","when to use","URL","via","io","service","do","user","repo","format","repository",{"skillNo":180,"name":107,"nameZh":6,"description":181,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":182,"categories":183,"keywords":184,"publishedAt":29},"01M6H7Z215CTKYJ4Y1X6EQWN6M","Create comprehensive, phased implementation plans with sprints and atomic tasks. Use when user says: \"make a plan\", \"create a plan\", \"plan this out\", \"plan the implementation\", \"help me plan\", \"design a plan\", \"draft a plan\", \"write a plan\", \"outline the steps\", \"break this down into tasks\", \"what's the plan for\", or any similar planning request. Also triggers on explicit \"\u002Fplanner\" or \"\u002Fplan\" commands.","https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Fskills\u002Fplanner\u002FSKILL.md",[],[107,185,28,186,187,188,25,112,125,189,190,23,191,192,193,194,195,148,84,196],"outline","atomic","with","sprints","draft","me","write","phased implementation","plan","help","planning","design"]