[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H6DM6YQ4PACCYMJR2FTZV2":3,"skill-same:01M6H6DM6YQ4PACCYMJR2FTZV2":76},{"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":23,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":6,"ownerHtmlUrl":53,"ownerBlogUrl":54,"ownerDescription":6,"updatedAt":55,"install":56,"resources":69},"01M6H6DM6YQ4PACCYMJR2FTZV2","m15-anti-pattern",null,"Use when reviewing code for anti-patterns. Keywords: anti-pattern, common mistake, pitfall, code smell, bad practice, code review, is this an anti-pattern, better way to do this, common mistake to avoid, why is this bad, idiomatic way, beginner mistake, fighting borrow checker, clone everywhere, unwrap in production, should I refactor, 反模式, 常见错误, 代码异味, 最佳实践, 地道写法","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\u002Fm15-anti-pattern\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"m15 anti pattern","pattern","anti-patterns","for","checker","beginner","reviewing code","false","bad","patterns","do","code review","use","common","why","refactor","Production","code","review","2026-11-10 10:12:30",false,"---\nname: m15-anti-pattern\ndescription: \"Use when reviewing code for anti-patterns. Keywords: anti-pattern, common mistake, pitfall, code smell, bad practice, code review, is this an anti-pattern, better way to do this, common mistake to avoid, why is this bad, idiomatic way, beginner mistake, fighting borrow checker, clone everywhere, unwrap in production, should I refactor, 反模式, 常见错误, 代码异味, 最佳实践, 地道写法\"\nuser-invocable: false\n---\n\n# Anti-Patterns\n\n> **Layer 2: Design Choices**\n\n## Core Question\n\n**Is this pattern hiding a design problem?**\n\nWhen reviewing code:\n- Is this solving the symptom or the cause?\n- Is there a more idiomatic approach?\n- Does this fight or flow with Rust?\n\n---\n\n## Anti-Pattern → Better Pattern\n\n| Anti-Pattern | Why Bad | Better |\n|--------------|---------|--------|\n| `.clone()` everywhere | Hides ownership issues | Proper references or ownership |\n| `.unwrap()` in production | Runtime panics | `?`, `expect`, or handling |\n| `Rc` when single owner | Unnecessary overhead | Simple ownership |\n| `unsafe` for convenience | UB risk | Find safe pattern |\n| OOP via `Deref` | Misleading API | Composition, traits |\n| Giant match arms | Unmaintainable | Extract to methods |\n| `String` everywhere | Allocation waste | `&str`, `Cow\u003Cstr>` |\n| Ignoring `#[must_use]` | Lost errors | Handle or `let _ =` |\n\n---\n\n## Thinking Prompt\n\nWhen seeing suspicious code:\n\n1. **Is this symptom or cause?**\n   - Clone to avoid borrow? → Ownership design issue\n   - Unwrap \"because it won't fail\"? → Unhandled case\n\n2. **What would idiomatic code look like?**\n   - References instead of clones\n   - Iterators instead of index loops\n   - Pattern matching instead of flags\n\n3. **Does this fight Rust?**\n   - Fighting borrow checker → restructure\n   - Excessive unsafe → find safe pattern\n\n---\n\n## Trace Up ↑\n\nTo design understanding:\n\n```\n\"Why does my code have so many clones?\"\n    ↑ Ask: Is the ownership model correct?\n    ↑ Check: m09-domain (data flow design)\n    ↑ Check: m01-ownership (reference patterns)\n```\n\n| Anti-Pattern | Trace To | Question |\n|--------------|----------|----------|\n| Clone everywhere | m01-ownership | Who should own this data? |\n| Unwrap everywhere | m06-error-handling | What's the error strategy? |\n| Rc everywhere | m09-domain | Is ownership clear? |\n| Fighting lifetimes | m09-domain | Should data structure change? |\n\n---\n\n## Trace Down ↓\n\nTo implementation (Layer 1):\n\n```\n\"Replace clone with proper ownership\"\n    ↓ m01-ownership: Reference patterns\n    ↓ m02-resource: Smart pointer if needed\n\n\"Replace unwrap with proper handling\"\n    ↓ m06-error-handling: ? operator\n    ↓ m06-error-handling: expect with message\n```\n\n---\n\n## Top 5 Beginner Mistakes\n\n| Rank | Mistake | Fix |\n|------|---------|-----|\n| 1 | Clone to escape borrow checker | Use references |\n| 2 | Unwrap in production | Propagate with `?` |\n| 3 | String for everything | Use `&str` |\n| 4 | Index loops | Use iterators |\n| 5 | Fighting lifetimes | Restructure to own data |\n\n## Code Smell → Refactoring\n\n| Smell | Indicates | Refactoring |\n|-------|-----------|-------------|\n| Many `.clone()` | Ownership unclear | Clarify data flow |\n| Many `.unwrap()` | Error handling missing | Add proper handling |\n| Many `pub` fields | Encapsulation broken | Private + accessors |\n| Deep nesting | Complex logic | Extract methods |\n| Long functions | Multiple responsibilities | Split |\n| Giant enums | Missing abstraction | Trait + types |\n\n---\n\n## Common Error Patterns\n\n| Error | Anti-Pattern Cause | Fix |\n|-------|-------------------|-----|\n| E0382 use after move | Cloning vs ownership | Proper references |\n| Panic in production | Unwrap everywhere | ?, matching |\n| Slow performance | String for all text | &str, Cow |\n| Borrow checker fights | Wrong structure | Restructure |\n| Memory bloat | Rc\u002FArc everywhere | Simple ownership |\n\n---\n\n## Deprecated → Better\n\n| Deprecated | Better |\n|------------|--------|\n| Index-based loops | `.iter()`, `.enumerate()` |\n| `collect::\u003CVec\u003C_>>()` then iterate | Chain iterators |\n| Manual unsafe cell | `Cell`, `RefCell` |\n| `mem::transmute` for casts | `as` or `TryFrom` |\n| Custom linked list | `Vec`, `VecDeque` |\n| `lazy_static!` | `std::sync::OnceLock` |\n\n---\n\n## Quick Review Checklist\n\n- [ ] No `.clone()` without justification\n- [ ] No `.unwrap()` in library code\n- [ ] No `pub` fields with invariants\n- [ ] No index loops when iterator works\n- [ ] No `String` where `&str` suffices\n- [ ] No ignored `#[must_use]` warnings\n- [ ] No `unsafe` without SAFETY comment\n- [ ] No giant functions (>50 lines)\n\n---\n\n## Related Skills\n\n| When | See |\n|------|-----|\n| Ownership patterns | m01-ownership |\n| Error handling | m06-error-handling |\n| Mental models | m14-mental-model |\n| Performance | m10-performance |\n","# Anti-Patterns\n\n> **Layer 2: Design Choices**\n\n## Core Question\n\n**Is this pattern hiding a design problem?**\n\nWhen reviewing code:\n- Is this solving the symptom or the cause?\n- Is there a more idiomatic approach?\n- Does this fight or flow with Rust?\n\n---\n\n## Anti-Pattern → Better Pattern\n\n| Anti-Pattern | Why Bad | Better |\n|--------------|---------|--------|\n| `.clone()` everywhere | Hides ownership issues | Proper references or ownership |\n| `.unwrap()` in production | Runtime panics | `?`, `expect`, or handling |\n| `Rc` when single owner | Unnecessary overhead | Simple ownership |\n| `unsafe` for convenience | UB risk | Find safe pattern |\n| OOP via `Deref` | Misleading API | Composition, traits |\n| Giant match arms | Unmaintainable | Extract to methods |\n| `String` everywhere | Allocation waste | `&str`, `Cow\u003Cstr>` |\n| Ignoring `#[must_use]` | Lost errors | Handle or `let _ =` |\n\n---\n\n## Thinking Prompt\n\nWhen seeing suspicious code:\n\n1. **Is this symptom or cause?**\n   - Clone to avoid borrow? → Ownership design issue\n   - Unwrap \"because it won't fail\"? → Unhandled case\n\n2. **What would idiomatic code look like?**\n   - References instead of clones\n   - Iterators instead of index loops\n   - Pattern matching instead of flags\n\n3. **Does this fight Rust?**\n   - Fighting borrow checker → restructure\n   - Excessive unsafe → find safe pattern\n\n---\n\n## Trace Up ↑\n\nTo design understanding:\n\n```\n\"Why does my code have so many clones?\"\n    ↑ Ask: Is the ownership model correct?\n    ↑ Check: m09-domain (data flow design)\n    ↑ Check: m01-ownership (reference patterns)\n```\n\n| Anti-Pattern | Trace To | Question |\n|--------------|----------|----------|\n| Clone everywhere | m01-ownership | Who should own this data? |\n| Unwrap everywhere | m06-error-handling | What's the error strategy? |\n| Rc everywhere | m09-domain | Is ownership clear? |\n| Fighting lifetimes | m09-domain | Should data structure change? |\n\n---\n\n## Trace Down ↓\n\nTo implementation (Layer 1):\n\n```\n\"Replace clone with proper ownership\"\n    ↓ m01-ownership: Reference patterns\n    ↓ m02-resource: Smart pointer if needed\n\n\"Replace unwrap with proper handling\"\n    ↓ m06-error-handling: ? operator\n    ↓ m06-error-handling: expect with message\n```\n\n---\n\n## Top 5 Beginner Mistakes\n\n| Rank | Mistake | Fix |\n|------|---------|-----|\n| 1 | Clone to escape borrow checker | Use references |\n| 2 | Unwrap in production | Propagate with `?` |\n| 3 | String for everything | Use `&str` |\n| 4 | Index loops | Use iterators |\n| 5 | Fighting lifetimes | Restructure to own data |\n\n## Code Smell → Refactoring\n\n| Smell | Indicates | Refactoring |\n|-------|-----------|-------------|\n| Many `.clone()` | Ownership unclear | Clarify data flow |\n| Many `.unwrap()` | Error handling missing | Add proper handling |\n| Many `pub` fields | Encapsulation broken | Private + accessors |\n| Deep nesting | Complex logic | Extract methods |\n| Long functions | Multiple responsibilities | Split |\n| Giant enums | Missing abstraction | Trait + types |\n\n---\n\n## Common Error Patterns\n\n| Error | Anti-Pattern Cause | Fix |\n|-------|-------------------|-----|\n| E0382 use after move | Cloning vs ownership | Proper references |\n| Panic in production | Unwrap everywhere | ?, matching |\n| Slow performance | String for all text | &str, Cow |\n| Borrow checker fights | Wrong structure | Restructure |\n| Memory bloat | Rc\u002FArc everywhere | Simple ownership |\n\n---\n\n## Deprecated → Better\n\n| Deprecated | Better |\n|------------|--------|\n| Index-based loops | `.iter()`, `.enumerate()` |\n| `collect::\u003CVec\u003C_>>()` then iterate | Chain iterators |\n| Manual unsafe cell | `Cell`, `RefCell` |\n| `mem::transmute` for casts | `as` or `TryFrom` |\n| Custom linked list | `Vec`, `VecDeque` |\n| `lazy_static!` | `std::sync::OnceLock` |\n\n---\n\n## Quick Review Checklist\n\n- [ ] No `.clone()` without justification\n- [ ] No `.unwrap()` in library code\n- [ ] No `pub` fields with invariants\n- [ ] No index loops when iterator works\n- [ ] No `String` where `&str` suffices\n- [ ] No ignored `#[must_use]` warnings\n- [ ] No `unsafe` without SAFETY comment\n- [ ] No giant functions (>50 lines)\n\n---\n\n## Related Skills\n\n| When | See |\n|------|-----|\n| Ownership patterns | m01-ownership |\n| Error handling | m06-error-handling |\n| Mental models | m14-mental-model |\n| Performance | m10-performance |\n",{"name":5,"description":7,"user-invocable":44},"main","6c13f6f4ac5a3bc1e6b78cd2bb1704f122c4a73e","archive\u002Fupstream\u002Fchasebuild-agent-skills\u002Frust\u002Fskills\u002Fm15-anti-pattern",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":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add 0xharryriddle\u002Fcodex-field-kit --skill m15-anti-pattern",{"tool":62,"command":63},"bunx","bunx skills add 0xharryriddle\u002Fcodex-field-kit --skill m15-anti-pattern",{"tool":65,"command":66},"pnpm","pnpm dlx skills add 0xharryriddle\u002Fcodex-field-kit --skill m15-anti-pattern","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Farchive\u002Fupstream\u002Fchasebuild-agent-skills\u002Frust\u002Fskills\u002Fm15-anti-pattern\u002FSKILL.md",true,[70],{"path":71,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":74,"sourceHtmlUrl":75},"patterns\u002Fcommon-mistakes.md","REFERENCE","参考文档",8259,"https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Farchive\u002Fupstream\u002Fchasebuild-agent-skills\u002Frust\u002Fskills\u002Fm15-anti-pattern\u002Fpatterns\u002Fcommon-mistakes.md",[77,106,124,134,160,186],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":86,"publishedAt":43},"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",[83],{"categoryNo":84,"categoryName":85,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[87,88,89,90,91,92,93,94,95,96,97,98,99,100,41,101,102,103,104,105],"react best practices","react","vercel react best practices","best practices","vercel","tasks","data fetching","triggers","pages","next","performance optimization","refactoring","Next.js","Optimization","guidelines","react components","components","performance","writing",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":43},"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",[],[113,114,115,116,117,118,119,120,121,27,122,123],"swarm","swarm planner","planner","parallel","multi-agent","only","execution","plans","dependency","multi","implementation",{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":43},"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",[],[131,113,132,118,133],"super swarm spark","spark","commands",{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":43},"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",[],[141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159],"role","creator","role creator","keys","users","roles","toml","enforce","install","guide","instructions","model","developer","reasoning","generate","create","config","codex","files",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":169,"publishedAt":43},"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",[166],{"categoryNo":167,"categoryName":168,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[170,171,172,41,173,174,175,176,27,177,178,179,180,181,34,36,182,183,184,185],"github","read github","read","documentation","docs","MCP","search","when to use","URL","via","io","service","user","repo","format","repository",{"skillNo":187,"name":115,"nameZh":6,"description":188,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":189,"categories":190,"keywords":191,"publishedAt":43},"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",[],[115,192,27,193,194,195,94,120,133,196,197,36,198,199,200,201,202,156,92,203],"outline","atomic","with","sprints","draft","me","write","phased implementation","plan","help","planning","design"]