[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6R5W41XFE3N6HWA8VFNBE21":3,"skill-same:01M6R5W41XFE3N6HWA8VFNBE21":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":13,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":41,"install":42,"resources":55},"01M6R5W41XFE3N6HWA8VFNBE21","improve-codebase-architecture",null,"Find deepening opportunities from CONTEXT.md and ADRs. Use when refactoring shallow modules, boundaries, coupling, or testability.","r3dlex\u002Fskills","r3dlex","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F291373160?v=4","01M6PEFNGGBVB7SHAPWXFFX933","01M6R5SDWFHT94734KJFMYE1SX",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002F02-govern-plan\u002Fimprove-codebase-architecture\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30],"improve codebase architecture","architecture","improve","codebase","refactoring","find","context","use","modules","testability","coupling","deepening","when","2026-11-10 10:12:30",false,"---\nname: improve-codebase-architecture\ndescription: 'Find deepening opportunities from CONTEXT.md and ADRs. Use when refactoring shallow modules, boundaries, coupling, or testability.'\n---\n\n# Improve Codebase Architecture\n\nSurface architectural friction and propose **deepening opportunities**: refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.\n\n## Glossary\n\nUse these terms exactly in every suggestion. Consistent language is the point — don't drift into \"component,\" \"service,\" \"API,\" or \"boundary.\" Full definitions in [LANGUAGE.md](LANGUAGE.md).\n\n- **Module** — anything with an interface and an implementation (function, class, package, slice).\n- **Interface** — everything a caller must know to use the module: types, invariants, error modes, ordering, config. Not just the type signature.\n- **Implementation** — the code inside.\n- **Depth** — leverage at the interface: a lot of behaviour behind a small interface. **Deep** = high leverage. **Shallow** = interface nearly as complex as the implementation.\n- **Seam** — where an interface lives; a place behaviour can be altered without editing in place. (Use this, not \"boundary.\")\n- **Adapter** — a concrete thing satisfying an interface at a seam.\n- **Leverage** — what callers get from depth.\n- **Locality** — what maintainers get from depth: change, bugs, knowledge concentrated in one place.\n\nKey principles (see [LANGUAGE.md](LANGUAGE.md) for the full list):\n\n- **Deletion test**: imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.\n- **The interface is the test surface.**\n- **One adapter = hypothetical seam. Two adapters = real seam.**\n\nThis skill is _informed_ by the project's domain model. The domain language gives names to good seams; ADRs record decisions the skill should not re-litigate.\n\n## Process\n\n### 1. Explore\n\nRead the project's domain glossary and any ADRs in the area you're touching first.\n\nThen use the Agent tool with `subagent_type=Explore` to walk the codebase. Don't follow rigid heuristics — explore organically and note where you experience friction:\n\n- Where does understanding one concept require bouncing between many small modules?\n- Where are modules **shallow**, with an interface nearly as complex as the implementation?\n- Where have pure functions been extracted just for testability, but the real bugs hide in how they're called (no **locality**)?\n- Where do tightly-coupled modules leak across their seams?\n- Which parts of the codebase are untested, or hard to test through their current interface?\n\nApply the **deletion test** to anything you suspect is shallow: would deleting it concentrate complexity, or just move it? A \"yes, concentrates\" is the signal you want.\n\n### 2. Present candidates\n\nPresent a numbered list of deepening opportunities. For each candidate:\n\n- **Files** — which files\u002Fmodules are involved\n- **Problem** — why the current architecture is causing friction\n- **Solution** — plain English description of what would change\n- **Benefits** — explained in terms of locality and leverage, and also in how tests would improve\n\n**Use CONTEXT.md vocabulary for the domain, and [LANGUAGE.md](LANGUAGE.md) vocabulary for the architecture.** If `CONTEXT.md` defines \"Order,\" talk about \"the Order intake module\" — not \"the FooBarHandler,\" and not \"the Order service.\"\n\n**ADR conflicts**: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR. Mark it clearly (e.g. _\"contradicts ADR-0007 — but worth reopening because…\"_). Don't list every theoretical refactor an ADR forbids.\n\nDo NOT propose interfaces yet. Recommend the highest-impact candidate and proceed. If the user hasn't specified a preference, pick the deepest opportunity (highest leverage gain) and start there.\n\n### 3. Deepen\n\nDeepen the selected candidate. Walk the design tree — constraints, dependencies, the shape of the deepened module, what sits behind the seam. Prefer codebase exploration over asking the user.\n\nSide effects happen inline as decisions crystallize:\n\n- **Naming a deepened module after a concept not in `CONTEXT.md`?** Add the term to `CONTEXT.md` — same discipline as `\u002Fgrill-with-docs` (see [CONTEXT-FORMAT.md](..\u002F..\u002F01-discover-decide\u002Fdomain-modeling\u002FCONTEXT-FORMAT.md)). Create the file lazily if it doesn't exist.\n- **Sharpening a fuzzy term?** Update `CONTEXT.md` right there.\n- **Surfacing a load-bearing architectural reason?** Record it as an ADR if it meets the 3-part test (hard to reverse, surprising without context, real trade-off). See [ADR-FORMAT.md](..\u002F..\u002F01-discover-decide\u002Fdomain-modeling\u002FADR-FORMAT.md).\n- **Exploring alternative interfaces for the deepened module?** See [INTERFACE-DESIGN.md](INTERFACE-DESIGN.md).\n","# Improve Codebase Architecture\n\nSurface architectural friction and propose **deepening opportunities**: refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.\n\n## Glossary\n\nUse these terms exactly in every suggestion. Consistent language is the point — don't drift into \"component,\" \"service,\" \"API,\" or \"boundary.\" Full definitions in [LANGUAGE.md](LANGUAGE.md).\n\n- **Module** — anything with an interface and an implementation (function, class, package, slice).\n- **Interface** — everything a caller must know to use the module: types, invariants, error modes, ordering, config. Not just the type signature.\n- **Implementation** — the code inside.\n- **Depth** — leverage at the interface: a lot of behaviour behind a small interface. **Deep** = high leverage. **Shallow** = interface nearly as complex as the implementation.\n- **Seam** — where an interface lives; a place behaviour can be altered without editing in place. (Use this, not \"boundary.\")\n- **Adapter** — a concrete thing satisfying an interface at a seam.\n- **Leverage** — what callers get from depth.\n- **Locality** — what maintainers get from depth: change, bugs, knowledge concentrated in one place.\n\nKey principles (see [LANGUAGE.md](LANGUAGE.md) for the full list):\n\n- **Deletion test**: imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.\n- **The interface is the test surface.**\n- **One adapter = hypothetical seam. Two adapters = real seam.**\n\nThis skill is _informed_ by the project's domain model. The domain language gives names to good seams; ADRs record decisions the skill should not re-litigate.\n\n## Process\n\n### 1. Explore\n\nRead the project's domain glossary and any ADRs in the area you're touching first.\n\nThen use the Agent tool with `subagent_type=Explore` to walk the codebase. Don't follow rigid heuristics — explore organically and note where you experience friction:\n\n- Where does understanding one concept require bouncing between many small modules?\n- Where are modules **shallow**, with an interface nearly as complex as the implementation?\n- Where have pure functions been extracted just for testability, but the real bugs hide in how they're called (no **locality**)?\n- Where do tightly-coupled modules leak across their seams?\n- Which parts of the codebase are untested, or hard to test through their current interface?\n\nApply the **deletion test** to anything you suspect is shallow: would deleting it concentrate complexity, or just move it? A \"yes, concentrates\" is the signal you want.\n\n### 2. Present candidates\n\nPresent a numbered list of deepening opportunities. For each candidate:\n\n- **Files** — which files\u002Fmodules are involved\n- **Problem** — why the current architecture is causing friction\n- **Solution** — plain English description of what would change\n- **Benefits** — explained in terms of locality and leverage, and also in how tests would improve\n\n**Use CONTEXT.md vocabulary for the domain, and [LANGUAGE.md](LANGUAGE.md) vocabulary for the architecture.** If `CONTEXT.md` defines \"Order,\" talk about \"the Order intake module\" — not \"the FooBarHandler,\" and not \"the Order service.\"\n\n**ADR conflicts**: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR. Mark it clearly (e.g. _\"contradicts ADR-0007 — but worth reopening because…\"_). Don't list every theoretical refactor an ADR forbids.\n\nDo NOT propose interfaces yet. Recommend the highest-impact candidate and proceed. If the user hasn't specified a preference, pick the deepest opportunity (highest leverage gain) and start there.\n\n### 3. Deepen\n\nDeepen the selected candidate. Walk the design tree — constraints, dependencies, the shape of the deepened module, what sits behind the seam. Prefer codebase exploration over asking the user.\n\nSide effects happen inline as decisions crystallize:\n\n- **Naming a deepened module after a concept not in `CONTEXT.md`?** Add the term to `CONTEXT.md` — same discipline as `\u002Fgrill-with-docs` (see [CONTEXT-FORMAT.md](..\u002F..\u002F01-discover-decide\u002Fdomain-modeling\u002FCONTEXT-FORMAT.md)). Create the file lazily if it doesn't exist.\n- **Sharpening a fuzzy term?** Update `CONTEXT.md` right there.\n- **Surfacing a load-bearing architectural reason?** Record it as an ADR if it meets the 3-part test (hard to reverse, surprising without context, real trade-off). See [ADR-FORMAT.md](..\u002F..\u002F01-discover-decide\u002Fdomain-modeling\u002FADR-FORMAT.md).\n- **Exploring alternative interfaces for the deepened module?** See [INTERFACE-DESIGN.md](INTERFACE-DESIGN.md).\n",{"name":5,"description":7},"main","037fe34299eb9c4a30b51f1a6bd101eae1c469b1","02-govern-plan\u002Fimprove-codebase-architecture","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills","https:\u002F\u002Fgithub.com\u002Fr3dlex","2026-10-29 16:22:54",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add r3dlex\u002Fskills --skill improve-codebase-architecture",{"tool":48,"command":49},"bunx","bunx skills add r3dlex\u002Fskills --skill improve-codebase-architecture",{"tool":51,"command":52},"pnpm","pnpm dlx skills add r3dlex\u002Fskills --skill improve-codebase-architecture","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002F02-govern-plan\u002Fimprove-codebase-architecture\u002FSKILL.md",true,[56,62,66],{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"DEEPENING.md","REFERENCE","参考文档",2565,"https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002F02-govern-plan\u002Fimprove-codebase-architecture\u002FDEEPENING.md",{"path":63,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":64,"sourceHtmlUrl":65},"INTERFACE-DESIGN.md",2725,"https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002F02-govern-plan\u002Fimprove-codebase-architecture\u002FINTERFACE-DESIGN.md",{"path":67,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":68,"sourceHtmlUrl":69},"LANGUAGE.md",3804,"https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002F02-govern-plan\u002Fimprove-codebase-architecture\u002FLANGUAGE.md",[71,79,92,101,111,134],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":31},"01M6R652E42RZT7M2V3RWW991Z","skill","Fixture.","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fcatalog-malformed\u002Fskill\u002FSKILL.md",[],[78],"fixture",{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":90,"publishedAt":31},"01M6R64MTPF0FGWHFS4DWP40GR","stable-skill","Fixture stable-skill.","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fcatalog-lifecycle\u002Fstable-skill\u002FSKILL.md",[85],{"categoryNo":86,"categoryName":87,"taxonomyType":88,"taxonomyTypeDesc":89},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[91,78],"stable skill",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":99,"publishedAt":31},"01M6R64HD4QVAYM2R0JSYNVDJW","experimental-skill","Fixture experimental-skill.","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fcatalog-lifecycle\u002Fexperimental-skill\u002FSKILL.md",[98],{"categoryNo":86,"categoryName":87,"taxonomyType":88,"taxonomyTypeDesc":89},[100,78],"experimental skill",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":108,"publishedAt":31},"01M6R64FZH05TEJQW75QX1E5XD","deprecated-skill","Fixture deprecated-skill.","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fcatalog-lifecycle\u002Fdeprecated-skill\u002FSKILL.md",[107],{"categoryNo":86,"categoryName":87,"taxonomyType":88,"taxonomyTypeDesc":89},[109,110,78],"deprecated skill","deprecated",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":31},"01M6R64D13X5DC980GREWFSSFQ","karpathy-guidelines","Apply think-before-coding, simplicity, surgical-change, and goal-driven engineering rules. Use when planning, implementing, or reviewing code.","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002Freference\u002Fgolden-skills\u002F.agents\u002Fskills\u002Fkarpathy-guidelines\u002FSKILL.md",[],[118,119,120,121,25,122,123,124,125,126,127,128,30,129,130,131,132,133],"karpathy guidelines","karpathy","guidelines","Rules","simplicity","goal","think","driven","reviewing code","implementing","apply","coding","change","code","planning","engineering",{"skillNo":135,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":31},"01M6R640ZS60BRV9P49FT46ZJX","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002Freference\u002Fgolden-root\u002F.agents\u002Fskills\u002Fkarpathy-guidelines\u002FSKILL.md",[],[120,118,119,130,125,131,132,133,129,121,25,122,123,124,126,127,128,30]]