[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H6CJ97BZZRJ4X4P53KXBR6":3,"skill-same:01M6H6CJ97BZZRJ4X4P53KXBR6":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},"01M6H6CJ97BZZRJ4X4P53KXBR6","m03-mutability",null,"CRITICAL: Use for mutability issues. Triggers: E0596, E0499, E0502, cannot borrow as mutable, already borrowed as immutable, mut, &mut, interior mutability, Cell, RefCell, Mutex, RwLock, 可变性, 内部可变性, 借用冲突","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\u002Fm03-mutability\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29],"m03 mutability","issues","immutable","mutex","use","cell","triggers","as","critical","false","for","2026-11-10 10:12:30",false,"---\nname: m03-mutability\ndescription: \"CRITICAL: Use for mutability issues. Triggers: E0596, E0499, E0502, cannot borrow as mutable, already borrowed as immutable, mut, &mut, interior mutability, Cell, RefCell, Mutex, RwLock, 可变性, 内部可变性, 借用冲突\"\nuser-invocable: false\n---\n\n# Mutability\n\n> **Layer 1: Language Mechanics**\n\n## Core Question\n\n**Why does this data need to change, and who can change it?**\n\nBefore adding interior mutability, understand:\n- Is mutation essential or accidental complexity?\n- Who should control mutation?\n- Is the mutation pattern safe?\n\n---\n\n## Error → Design Question\n\n| Error | Don't Just Say | Ask Instead |\n|-------|----------------|-------------|\n| E0596 | \"Add mut\" | Should this really be mutable? |\n| E0499 | \"Split borrows\" | Is the data structure right? |\n| E0502 | \"Separate scopes\" | Why do we need both borrows? |\n| RefCell panic | \"Use try_borrow\" | Is runtime check appropriate? |\n\n---\n\n## Thinking Prompt\n\nBefore adding mutability:\n\n1. **Is mutation necessary?**\n   - Maybe transform → return new value\n   - Maybe builder → construct immutably\n\n2. **Who controls mutation?**\n   - External caller → `&mut T`\n   - Internal logic → interior mutability\n   - Concurrent access → synchronized mutability\n\n3. **What's the thread context?**\n   - Single-thread → Cell\u002FRefCell\n   - Multi-thread → Mutex\u002FRwLock\u002FAtomic\n\n---\n\n## Trace Up ↑\n\nWhen mutability conflicts persist:\n\n```\nE0499\u002FE0502 (borrow conflicts)\n    ↑ Ask: Is the data structure designed correctly?\n    ↑ Check: m09-domain (should data be split?)\n    ↑ Check: m07-concurrency (is async involved?)\n```\n\n| Persistent Error | Trace To | Question |\n|-----------------|----------|----------|\n| Repeated borrow conflicts | m09-domain | Should data be restructured? |\n| RefCell in async | m07-concurrency | Is Send\u002FSync needed? |\n| Mutex deadlocks | m07-concurrency | Is the lock design right? |\n\n---\n\n## Trace Down ↓\n\nFrom design to implementation:\n\n```\n\"Need mutable access from &self\"\n    ↓ T: Copy → Cell\u003CT>\n    ↓ T: !Copy → RefCell\u003CT>\n\n\"Need thread-safe mutation\"\n    ↓ Simple counters → AtomicXxx\n    ↓ Complex data → Mutex\u003CT> or RwLock\u003CT>\n\n\"Need shared mutable state\"\n    ↓ Single-thread: Rc\u003CRefCell\u003CT>>\n    ↓ Multi-thread: Arc\u003CMutex\u003CT>>\n```\n\n---\n\n## Borrow Rules\n\n```\nAt any time, you can have EITHER:\n├─ Multiple &T (immutable borrows)\n└─ OR one &mut T (mutable borrow)\n\nNever both simultaneously.\n```\n\n## Quick Reference\n\n| Pattern | Thread-Safe | Runtime Cost | Use When |\n|---------|-------------|--------------|----------|\n| `&mut T` | N\u002FA | Zero | Exclusive mutable access |\n| `Cell\u003CT>` | No | Zero | Copy types, no refs needed |\n| `RefCell\u003CT>` | No | Runtime check | Non-Copy, need runtime borrow |\n| `Mutex\u003CT>` | Yes | Lock contention | Thread-safe mutation |\n| `RwLock\u003CT>` | Yes | Lock contention | Many readers, few writers |\n| `Atomic*` | Yes | Minimal | Simple types (bool, usize) |\n\n## Error Code Reference\n\n| Error | Cause | Quick Fix |\n|-------|-------|-----------|\n| E0596 | Borrowing immutable as mutable | Add `mut` or redesign |\n| E0499 | Multiple mutable borrows | Restructure code flow |\n| E0502 | &mut while & exists | Separate borrow scopes |\n\n---\n\n## Interior Mutability Decision\n\n| Scenario | Choose |\n|----------|--------|\n| T: Copy, single-thread | `Cell\u003CT>` |\n| T: !Copy, single-thread | `RefCell\u003CT>` |\n| T: Copy, multi-thread | `AtomicXxx` |\n| T: !Copy, multi-thread | `Mutex\u003CT>` or `RwLock\u003CT>` |\n| Read-heavy, multi-thread | `RwLock\u003CT>` |\n| Simple flags\u002Fcounters | `AtomicBool`, `AtomicUsize` |\n\n---\n\n## Anti-Patterns\n\n| Anti-Pattern | Why Bad | Better |\n|--------------|---------|--------|\n| RefCell everywhere | Runtime panics | Clear ownership design |\n| Mutex for single-thread | Unnecessary overhead | RefCell |\n| Ignore RefCell panic | Hard to debug | Handle or restructure |\n| Lock inside hot loop | Performance killer | Batch operations |\n\n---\n\n## Related Skills\n\n| When | See |\n|------|-----|\n| Smart pointer choice | m02-resource |\n| Thread safety | m07-concurrency |\n| Data structure design | m09-domain |\n| Anti-patterns | m15-anti-pattern |\n","# Mutability\n\n> **Layer 1: Language Mechanics**\n\n## Core Question\n\n**Why does this data need to change, and who can change it?**\n\nBefore adding interior mutability, understand:\n- Is mutation essential or accidental complexity?\n- Who should control mutation?\n- Is the mutation pattern safe?\n\n---\n\n## Error → Design Question\n\n| Error | Don't Just Say | Ask Instead |\n|-------|----------------|-------------|\n| E0596 | \"Add mut\" | Should this really be mutable? |\n| E0499 | \"Split borrows\" | Is the data structure right? |\n| E0502 | \"Separate scopes\" | Why do we need both borrows? |\n| RefCell panic | \"Use try_borrow\" | Is runtime check appropriate? |\n\n---\n\n## Thinking Prompt\n\nBefore adding mutability:\n\n1. **Is mutation necessary?**\n   - Maybe transform → return new value\n   - Maybe builder → construct immutably\n\n2. **Who controls mutation?**\n   - External caller → `&mut T`\n   - Internal logic → interior mutability\n   - Concurrent access → synchronized mutability\n\n3. **What's the thread context?**\n   - Single-thread → Cell\u002FRefCell\n   - Multi-thread → Mutex\u002FRwLock\u002FAtomic\n\n---\n\n## Trace Up ↑\n\nWhen mutability conflicts persist:\n\n```\nE0499\u002FE0502 (borrow conflicts)\n    ↑ Ask: Is the data structure designed correctly?\n    ↑ Check: m09-domain (should data be split?)\n    ↑ Check: m07-concurrency (is async involved?)\n```\n\n| Persistent Error | Trace To | Question |\n|-----------------|----------|----------|\n| Repeated borrow conflicts | m09-domain | Should data be restructured? |\n| RefCell in async | m07-concurrency | Is Send\u002FSync needed? |\n| Mutex deadlocks | m07-concurrency | Is the lock design right? |\n\n---\n\n## Trace Down ↓\n\nFrom design to implementation:\n\n```\n\"Need mutable access from &self\"\n    ↓ T: Copy → Cell\u003CT>\n    ↓ T: !Copy → RefCell\u003CT>\n\n\"Need thread-safe mutation\"\n    ↓ Simple counters → AtomicXxx\n    ↓ Complex data → Mutex\u003CT> or RwLock\u003CT>\n\n\"Need shared mutable state\"\n    ↓ Single-thread: Rc\u003CRefCell\u003CT>>\n    ↓ Multi-thread: Arc\u003CMutex\u003CT>>\n```\n\n---\n\n## Borrow Rules\n\n```\nAt any time, you can have EITHER:\n├─ Multiple &T (immutable borrows)\n└─ OR one &mut T (mutable borrow)\n\nNever both simultaneously.\n```\n\n## Quick Reference\n\n| Pattern | Thread-Safe | Runtime Cost | Use When |\n|---------|-------------|--------------|----------|\n| `&mut T` | N\u002FA | Zero | Exclusive mutable access |\n| `Cell\u003CT>` | No | Zero | Copy types, no refs needed |\n| `RefCell\u003CT>` | No | Runtime check | Non-Copy, need runtime borrow |\n| `Mutex\u003CT>` | Yes | Lock contention | Thread-safe mutation |\n| `RwLock\u003CT>` | Yes | Lock contention | Many readers, few writers |\n| `Atomic*` | Yes | Minimal | Simple types (bool, usize) |\n\n## Error Code Reference\n\n| Error | Cause | Quick Fix |\n|-------|-------|-----------|\n| E0596 | Borrowing immutable as mutable | Add `mut` or redesign |\n| E0499 | Multiple mutable borrows | Restructure code flow |\n| E0502 | &mut while & exists | Separate borrow scopes |\n\n---\n\n## Interior Mutability Decision\n\n| Scenario | Choose |\n|----------|--------|\n| T: Copy, single-thread | `Cell\u003CT>` |\n| T: !Copy, single-thread | `RefCell\u003CT>` |\n| T: Copy, multi-thread | `AtomicXxx` |\n| T: !Copy, multi-thread | `Mutex\u003CT>` or `RwLock\u003CT>` |\n| Read-heavy, multi-thread | `RwLock\u003CT>` |\n| Simple flags\u002Fcounters | `AtomicBool`, `AtomicUsize` |\n\n---\n\n## Anti-Patterns\n\n| Anti-Pattern | Why Bad | Better |\n|--------------|---------|--------|\n| RefCell everywhere | Runtime panics | Clear ownership design |\n| Mutex for single-thread | Unnecessary overhead | RefCell |\n| Ignore RefCell panic | Hard to debug | Handle or restructure |\n| Lock inside hot loop | Performance killer | Batch operations |\n\n---\n\n## Related Skills\n\n| When | See |\n|------|-----|\n| Smart pointer choice | m02-resource |\n| Thread safety | m07-concurrency |\n| Data structure design | m09-domain |\n| Anti-patterns | m15-anti-pattern |\n",{"name":5,"description":7,"user-invocable":31},"main","6c13f6f4ac5a3bc1e6b78cd2bb1704f122c4a73e","archive\u002Fupstream\u002Fchasebuild-agent-skills\u002Frust\u002Fskills\u002Fm03-mutability",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 m03-mutability",{"tool":49,"command":50},"bunx","bunx skills add 0xharryriddle\u002Fcodex-field-kit --skill m03-mutability",{"tool":52,"command":53},"pnpm","pnpm dlx skills add 0xharryriddle\u002Fcodex-field-kit --skill m03-mutability","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F0xharryriddle\u002Fcodex-field-kit\u002Fblob\u002Fmain\u002Farchive\u002Fupstream\u002Fchasebuild-agent-skills\u002Frust\u002Fskills\u002Fm03-mutability\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,25,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,23,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,25,98,111,172,173,23,174,175,176,177,178,134,70,179],"outline","atomic","with","sprints","draft","me","write","phased implementation","plan","help","planning","design"]