[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H6CN2DDZ8CNQECM9R4AM4R":3,"skill-same:01M6H6CN2DDZ8CNQECM9R4AM4R":57},{"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":30,"linkOnly":31,"markdownContent":32,"markdownBody":33,"frontMatter":34,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":41,"ownerDescription":6,"updatedAt":42,"install":43,"resources":56},"01M6H6CN2DDZ8CNQECM9R4AM4R","m04-zero-cost",null,"CRITICAL: Use for generics, traits, zero-cost abstraction. Triggers: E0277, E0308, E0599, generic, trait, impl, dyn, where, monomorphization, static dispatch, dynamic dispatch, impl Trait, trait bound not satisfied, 泛型, 特征, 零成本抽象, 单态化","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\u002Fm04-zero-cost\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29],"ZeRO","m04 zero cost","cost","use","dispatch","triggers","impl","critical","false","traits","for","2026-11-10 10:12:30",false,"---\nname: m04-zero-cost\ndescription: \"CRITICAL: Use for generics, traits, zero-cost abstraction. Triggers: E0277, E0308, E0599, generic, trait, impl, dyn, where, monomorphization, static dispatch, dynamic dispatch, impl Trait, trait bound not satisfied, 泛型, 特征, 零成本抽象, 单态化\"\nuser-invocable: false\n---\n\n# Zero-Cost Abstraction\n\n> **Layer 1: Language Mechanics**\n\n## Core Question\n\n**Do we need compile-time or runtime polymorphism?**\n\nBefore choosing between generics and trait objects:\n- Is the type known at compile time?\n- Is a heterogeneous collection needed?\n- What's the performance priority?\n\n---\n\n## Error → Design Question\n\n| Error | Don't Just Say | Ask Instead |\n|-------|----------------|-------------|\n| E0277 | \"Add trait bound\" | Is this abstraction at the right level? |\n| E0308 | \"Fix the type\" | Should types be unified or distinct? |\n| E0599 | \"Import the trait\" | Is the trait the right abstraction? |\n| E0038 | \"Make object-safe\" | Do we really need dynamic dispatch? |\n\n---\n\n## Thinking Prompt\n\nBefore adding trait bounds:\n\n1. **What abstraction is needed?**\n   - Same behavior, different types → trait\n   - Different behavior, same type → enum\n   - No abstraction needed → concrete type\n\n2. **When is type known?**\n   - Compile time → generics (static dispatch)\n   - Runtime → trait objects (dynamic dispatch)\n\n3. **What's the trade-off priority?**\n   - Performance → generics\n   - Compile time → trait objects\n   - Flexibility → depends\n\n---\n\n## Trace Up ↑\n\nWhen type system fights back:\n\n```\nE0277 (trait bound not satisfied)\n    ↑ Ask: Is the abstraction level correct?\n    ↑ Check: m09-domain (what behavior is being abstracted?)\n    ↑ Check: m05-type-driven (should use newtype?)\n```\n\n| Persistent Error | Trace To | Question |\n|-----------------|----------|----------|\n| Complex trait bounds | m09-domain | Is the abstraction right? |\n| Object safety issues | m05-type-driven | Can typestate help? |\n| Type explosion | m10-performance | Accept dyn overhead? |\n\n---\n\n## Trace Down ↓\n\nFrom design to implementation:\n\n```\n\"Need to abstract over types with same behavior\"\n    ↓ Types known at compile time → impl Trait or generics\n    ↓ Types determined at runtime → dyn Trait\n\n\"Need collection of different types\"\n    ↓ Closed set → enum\n    ↓ Open set → Vec\u003CBox\u003Cdyn Trait>>\n\n\"Need to return different types\"\n    ↓ Same type → impl Trait\n    ↓ Different types → Box\u003Cdyn Trait>\n```\n\n---\n\n## Quick Reference\n\n| Pattern | Dispatch | Code Size | Runtime Cost |\n|---------|----------|-----------|--------------|\n| `fn foo\u003CT: Trait>()` | Static | +bloat | Zero |\n| `fn foo(x: &dyn Trait)` | Dynamic | Minimal | vtable lookup |\n| `impl Trait` return | Static | +bloat | Zero |\n| `Box\u003Cdyn Trait>` | Dynamic | Minimal | Allocation + vtable |\n\n## Syntax Comparison\n\n```rust\n\u002F\u002F Static dispatch - type known at compile time\nfn process(x: impl Display) { }      \u002F\u002F argument position\nfn process\u003CT: Display>(x: T) { }     \u002F\u002F explicit generic\nfn get() -> impl Display { }         \u002F\u002F return position\n\n\u002F\u002F Dynamic dispatch - type determined at runtime\nfn process(x: &dyn Display) { }      \u002F\u002F reference\nfn process(x: Box\u003Cdyn Display>) { }  \u002F\u002F owned\n```\n\n## Error Code Reference\n\n| Error | Cause | Quick Fix |\n|-------|-------|-----------|\n| E0277 | Type doesn't impl trait | Add impl or change bound |\n| E0308 | Type mismatch | Check generic params |\n| E0599 | No method found | Import trait with `use` |\n| E0038 | Trait not object-safe | Use generics or redesign |\n\n---\n\n## Decision Guide\n\n| Scenario | Choose | Why |\n|----------|--------|-----|\n| Performance critical | Generics | Zero runtime cost |\n| Heterogeneous collection | `dyn Trait` | Different types at runtime |\n| Plugin architecture | `dyn Trait` | Unknown types at compile |\n| Reduce compile time | `dyn Trait` | Less monomorphization |\n| Small, known type set | `enum` | No indirection |\n\n---\n\n## Object Safety\n\nA trait is object-safe if it:\n- Doesn't have `Self: Sized` bound\n- Doesn't return `Self`\n- Doesn't have generic methods\n- Uses `where Self: Sized` for non-object-safe methods\n\n---\n\n## Anti-Patterns\n\n| Anti-Pattern | Why Bad | Better |\n|--------------|---------|--------|\n| Over-generic everything | Compile time, complexity | Concrete types when possible |\n| `dyn` for known types | Unnecessary indirection | Generics |\n| Complex trait hierarchies | Hard to understand | Simpler design |\n| Ignore object safety | Limits flexibility | Plan for dyn if needed |\n\n---\n\n## Related Skills\n\n| When | See |\n|------|-----|\n| Type-driven design | m05-type-driven |\n| Domain abstraction | m09-domain |\n| Performance concerns | m10-performance |\n| Send\u002FSync bounds | m07-concurrency |\n","# Zero-Cost Abstraction\n\n> **Layer 1: Language Mechanics**\n\n## Core Question\n\n**Do we need compile-time or runtime polymorphism?**\n\nBefore choosing between generics and trait objects:\n- Is the type known at compile time?\n- Is a heterogeneous collection needed?\n- What's the performance priority?\n\n---\n\n## Error → Design Question\n\n| Error | Don't Just Say | Ask Instead |\n|-------|----------------|-------------|\n| E0277 | \"Add trait bound\" | Is this abstraction at the right level? |\n| E0308 | \"Fix the type\" | Should types be unified or distinct? |\n| E0599 | \"Import the trait\" | Is the trait the right abstraction? |\n| E0038 | \"Make object-safe\" | Do we really need dynamic dispatch? |\n\n---\n\n## Thinking Prompt\n\nBefore adding trait bounds:\n\n1. **What abstraction is needed?**\n   - Same behavior, different types → trait\n   - Different behavior, same type → enum\n   - No abstraction needed → concrete type\n\n2. **When is type known?**\n   - Compile time → generics (static dispatch)\n   - Runtime → trait objects (dynamic dispatch)\n\n3. **What's the trade-off priority?**\n   - Performance → generics\n   - Compile time → trait objects\n   - Flexibility → depends\n\n---\n\n## Trace Up ↑\n\nWhen type system fights back:\n\n```\nE0277 (trait bound not satisfied)\n    ↑ Ask: Is the abstraction level correct?\n    ↑ Check: m09-domain (what behavior is being abstracted?)\n    ↑ Check: m05-type-driven (should use newtype?)\n```\n\n| Persistent Error | Trace To | Question |\n|-----------------|----------|----------|\n| Complex trait bounds | m09-domain | Is the abstraction right? |\n| Object safety issues | m05-type-driven | Can typestate help? |\n| Type explosion | m10-performance | Accept dyn overhead? |\n\n---\n\n## Trace Down ↓\n\nFrom design to implementation:\n\n```\n\"Need to abstract over types with same behavior\"\n    ↓ Types known at compile time → impl Trait or generics\n    ↓ Types determined at runtime → dyn Trait\n\n\"Need collection of different types\"\n    ↓ Closed set → enum\n    ↓ Open set → Vec\u003CBox\u003Cdyn Trait>>\n\n\"Need to return different types\"\n    ↓ Same type → impl Trait\n    ↓ Different types → Box\u003Cdyn Trait>\n```\n\n---\n\n## Quick Reference\n\n| Pattern | Dispatch | Code Size | Runtime Cost |\n|---------|----------|-----------|--------------|\n| `fn foo\u003CT: Trait>()` | Static | +bloat | Zero |\n| `fn foo(x: &dyn Trait)` | Dynamic | Minimal | vtable lookup |\n| `impl Trait` return | Static | +bloat | Zero |\n| `Box\u003Cdyn Trait>` | Dynamic | Minimal | Allocation + vtable |\n\n## Syntax Comparison\n\n```rust\n\u002F\u002F Static dispatch - type known at compile time\nfn process(x: impl Display) { }      \u002F\u002F argument position\nfn process\u003CT: Display>(x: T) { }     \u002F\u002F explicit generic\nfn get() -> impl Display { }         \u002F\u002F return position\n\n\u002F\u002F Dynamic dispatch - type determined at runtime\nfn process(x: &dyn Display) { }      \u002F\u002F reference\nfn process(x: Box\u003Cdyn Display>) { }  \u002F\u002F owned\n```\n\n## Error Code Reference\n\n| Error | Cause | Quick Fix |\n|-------|-------|-----------|\n| E0277 | Type doesn't impl trait | Add impl or change bound |\n| E0308 | Type mismatch | Check generic params |\n| E0599 | No method found | Import trait with `use` |\n| E0038 | Trait not object-safe | Use generics or redesign |\n\n---\n\n## Decision Guide\n\n| Scenario | Choose | Why |\n|----------|--------|-----|\n| Performance critical | Generics | Zero runtime cost |\n| Heterogeneous collection | `dyn Trait` | Different types at runtime |\n| Plugin architecture | `dyn Trait` | Unknown types at compile |\n| Reduce compile time | `dyn Trait` | Less monomorphization |\n| Small, known type set | `enum` | No indirection |\n\n---\n\n## Object Safety\n\nA trait is object-safe if it:\n- Doesn't have `Self: Sized` bound\n- Doesn't return `Self`\n- Doesn't have generic methods\n- Uses `where Self: Sized` for non-object-safe methods\n\n---\n\n## Anti-Patterns\n\n| Anti-Pattern | Why Bad | Better |\n|--------------|---------|--------|\n| Over-generic everything | Compile time, complexity | Concrete types when possible |\n| `dyn` for known types | Unnecessary indirection | Generics |\n| Complex trait hierarchies | Hard to understand | Simpler design |\n| Ignore object safety | Limits flexibility | Plan for dyn if needed |\n\n---\n\n## Related Skills\n\n| When | See |\n|------|-----|\n| Type-driven design | m05-type-driven |\n| Domain abstraction | m09-domain |\n| Performance concerns | m10-performance |\n| Send\u002FSync bounds | m07-concurrency |\n",{"name":5,"description":7,"user-invocable":31},"main","6c13f6f4ac5a3bc1e6b78cd2bb1704f122c4a73e","archive\u002Fupstream\u002Fchasebuild-agent-skills\u002Frust\u002Fskills\u002Fm04-zero-cost",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":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add 0xharryriddle\u002Fcodex-field-kit --skill m04-zero-cost",{"tool":49,"command":50},"bunx","bunx skills add 0xharryriddle\u002Fcodex-field-kit --skill m04-zero-cost",{"tool":52,"command":53},"pnpm","pnpm dlx skills add 0xharryriddle\u002Fcodex-field-kit --skill m04-zero-cost","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Farchive\u002Fupstream\u002Fchasebuild-agent-skills\u002Frust\u002Fskills\u002Fm04-zero-cost\u002FSKILL.md",true,[],[58,84,102,112,138,162],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":30},"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",[],[65,66,67,68,69,70,71,24,72,73,74,75,76,77,78,79,80,81,82,83],"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":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":30},"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",[],[91,92,93,94,95,96,97,98,99,29,100,101],"swarm","swarm planner","planner","parallel","multi-agent","only","execution","plans","dependency","multi","implementation",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":30},"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",[],[109,91,110,96,111],"super swarm spark","spark","commands",{"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":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":30},"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",[],[119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137],"role","creator","role creator","keys","users","roles","toml","enforce","install","guide","instructions","model","developer","reasoning","generate","create","config","codex","files",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":30},"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",[],[145,146,147,78,148,149,150,151,29,152,153,154,155,156,157,22,158,159,160,161],"github","read github","read","documentation","docs","MCP","search","when to use","URL","via","io","service","do","user","repo","format","repository",{"skillNo":163,"name":93,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":30},"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",[],[93,168,29,169,170,171,24,98,111,172,173,22,174,175,176,177,178,134,70,179],"outline","atomic","with","sprints","draft","me","write","phased implementation","plan","help","planning","design"]