[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BVCVC4JQ7PFX29NS7N20E1":3,"skill-same:01M6BVCVC4JQ7PFX29NS7N20E1":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":17,"ownerHtmlUrl":46,"ownerBlogUrl":47,"ownerDescription":17,"updatedAt":48,"install":49,"resources":61},"01M6BVCVC4JQ7PFX29NS7N20E1","improve-codebase-architecture","代码库架构优化","Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.","扫描代码库以发现架构深化改进的机会，以可视化 HTML 报告的形式呈现，然后针对你选定的某一项进行深入剖析（严格审视）。","SamFleming\u002Fdotfiles","SamFleming","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F573318?v=4","01M6BVCCB0H1C12FM8T54ZH5R4","Sam Fleming","01M6BVCCF0G9K0TXCYZ894P432",2,"MIT",null,"https:\u002F\u002Fgithub.com\u002FSamFleming\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fhome\u002Fclaude\u002F.claude\u002Fskills\u002Fimprove-codebase-architecture\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BT7QTSZKB08EAW9P9ZCDNQ","设计评审与架构优化","SCENARIO","使用场景",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C4ZVS0ZJKF2T2G58PW5VR2","系统架构师","PROFESSION","适用职业",[31,32,33,34],"improve codebase architecture","architecture","improve","report","2026-11-10 10:12:30",false,"---\nname: improve-codebase-architecture\ndescription: Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.\ndisable-model-invocation: true\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\nThis command is _informed_ by the project's domain model and built on a shared design vocabulary:\n\n- Call the Skill tool with \"codebase-design\" for the architecture vocabulary (**module**, **interface**, **depth**, **seam**, **adapter**, **leverage**, **locality**) and its principles (the deletion test, \"the interface is the test surface\", \"one adapter = hypothetical seam, two = real\"). Use these terms exactly in every suggestion, and don't drift into \"component,\" \"service,\" \"API,\" or \"boundary.\"\n- The domain language in `GLOSSARY.md` gives names to good seams; ADRs in `docs\u002Fadr\u002F` record decisions this command should not re-litigate.\n\n## Process\n\n### 1. Explore\n\n**Scope before you scan: YAGNI.** Deepening a module pays off by making future changes to it easier, so put extra weight on the parts of the codebase that have recently changed. Decide *where* to look before you look:\n\n- If the user named a direction (a module, a subsystem, a pain point), take it, and skip the inference below.\n- Otherwise, walk back a good stretch of the commit history (`git log --oneline`) to find the codebase's hot spots, the files and areas that keep coming up, and let those paths pull your attention first. If the changes are scattered with no clear hot spot, widen the net.\n\nRead the project's domain glossary (`GLOSSARY.md`) and any ADRs in the area you're touching first.\n\nThen spawn a sub-agent 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 as an HTML report\n\nWrite a self-contained HTML file to the OS temp directory so nothing lands in the repo. Resolve the temp dir from `$TMPDIR`, falling back to `\u002Ftmp` (or `%TEMP%` on Windows), and write to `\u003Ctmpdir>\u002Farchitecture-review-\u003Ctimestamp>.html` so each run gets a fresh file. Open it for the user (`xdg-open \u003Cpath>` on Linux, `open \u003Cpath>` on macOS, `start \u003Cpath>` on Windows) and tell them the absolute path.\n\nThe report uses **Tailwind via CDN** for layout and styling, and **Mermaid via CDN** for diagrams where a graph\u002Fflow\u002Fsequence reliably communicates the structure. Mix Mermaid with hand-crafted CSS\u002FSVG visuals: use Mermaid when relationships are graph-shaped (call graphs, dependencies, sequences), and hand-built divs\u002FSVG when you want something more editorial (mass diagrams, cross-sections, collapse animations). Each candidate gets a **before\u002Fafter visualisation**. Be visual.\n\nFor each candidate, render a card with:\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 how tests would improve\n- **Before \u002F After diagram**: side-by-side, custom-drawn, illustrating the shallowness and the deepening\n- **Recommendation strength**: one of `Strong`, `Worth exploring`, `Speculative`, rendered as a badge\n\nEnd the report with a **Top recommendation** section: which candidate you'd tackle first and why.\n\n**Use GLOSSARY.md vocabulary for the domain, and the `\u002Fcodebase-design` vocabulary for the architecture.** If `GLOSSARY.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 in the card (e.g. a warning callout: _\"contradicts ADR-0007, but worth reopening because…\"_). Don't list every theoretical refactor an ADR forbids.\n\nSee [HTML-REPORT.md](HTML-REPORT.md) for the full HTML scaffold, diagram patterns, and styling guidance.\n\nDo NOT propose interfaces yet. After the file is written, ask the user: \"Which of these would you like to explore?\"\n\n### 3. Grilling loop\n\nOnce the user picks a candidate, call the Skill tool with \"grilling\" to walk the decision tree with them: constraints, dependencies, the shape of the deepened module, what sits behind the seam, what tests survive.\n\nSide effects happen inline as decisions crystallize; call the Skill tool with \"domain-modeling\" to keep the domain model current as you go:\n\n- **Naming a deepened module after a concept not in `GLOSSARY.md`?** Add the term to `GLOSSARY.md`. Create the file lazily if it doesn't exist.\n- **Sharpening a fuzzy term during the conversation?** Update `GLOSSARY.md` right there.\n- **User rejects the candidate with a load-bearing reason?** Offer an ADR, framed as: _\"Want me to record this as an ADR so future architecture reviews don't re-suggest it?\"_ Only offer when the reason would actually be needed by a future explorer to avoid re-suggesting the same thing; skip ephemeral reasons (\"not worth it right now\") and self-evident ones.\n- **Want to explore alternative interfaces for the deepened module?** Call the Skill tool with \"codebase-design\" and use its design-it-twice parallel sub-agent pattern.\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\nThis command is _informed_ by the project's domain model and built on a shared design vocabulary:\n\n- Call the Skill tool with \"codebase-design\" for the architecture vocabulary (**module**, **interface**, **depth**, **seam**, **adapter**, **leverage**, **locality**) and its principles (the deletion test, \"the interface is the test surface\", \"one adapter = hypothetical seam, two = real\"). Use these terms exactly in every suggestion, and don't drift into \"component,\" \"service,\" \"API,\" or \"boundary.\"\n- The domain language in `GLOSSARY.md` gives names to good seams; ADRs in `docs\u002Fadr\u002F` record decisions this command should not re-litigate.\n\n## Process\n\n### 1. Explore\n\n**Scope before you scan: YAGNI.** Deepening a module pays off by making future changes to it easier, so put extra weight on the parts of the codebase that have recently changed. Decide *where* to look before you look:\n\n- If the user named a direction (a module, a subsystem, a pain point), take it, and skip the inference below.\n- Otherwise, walk back a good stretch of the commit history (`git log --oneline`) to find the codebase's hot spots, the files and areas that keep coming up, and let those paths pull your attention first. If the changes are scattered with no clear hot spot, widen the net.\n\nRead the project's domain glossary (`GLOSSARY.md`) and any ADRs in the area you're touching first.\n\nThen spawn a sub-agent 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 as an HTML report\n\nWrite a self-contained HTML file to the OS temp directory so nothing lands in the repo. Resolve the temp dir from `$TMPDIR`, falling back to `\u002Ftmp` (or `%TEMP%` on Windows), and write to `\u003Ctmpdir>\u002Farchitecture-review-\u003Ctimestamp>.html` so each run gets a fresh file. Open it for the user (`xdg-open \u003Cpath>` on Linux, `open \u003Cpath>` on macOS, `start \u003Cpath>` on Windows) and tell them the absolute path.\n\nThe report uses **Tailwind via CDN** for layout and styling, and **Mermaid via CDN** for diagrams where a graph\u002Fflow\u002Fsequence reliably communicates the structure. Mix Mermaid with hand-crafted CSS\u002FSVG visuals: use Mermaid when relationships are graph-shaped (call graphs, dependencies, sequences), and hand-built divs\u002FSVG when you want something more editorial (mass diagrams, cross-sections, collapse animations). Each candidate gets a **before\u002Fafter visualisation**. Be visual.\n\nFor each candidate, render a card with:\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 how tests would improve\n- **Before \u002F After diagram**: side-by-side, custom-drawn, illustrating the shallowness and the deepening\n- **Recommendation strength**: one of `Strong`, `Worth exploring`, `Speculative`, rendered as a badge\n\nEnd the report with a **Top recommendation** section: which candidate you'd tackle first and why.\n\n**Use GLOSSARY.md vocabulary for the domain, and the `\u002Fcodebase-design` vocabulary for the architecture.** If `GLOSSARY.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 in the card (e.g. a warning callout: _\"contradicts ADR-0007, but worth reopening because…\"_). Don't list every theoretical refactor an ADR forbids.\n\nSee [HTML-REPORT.md](HTML-REPORT.md) for the full HTML scaffold, diagram patterns, and styling guidance.\n\nDo NOT propose interfaces yet. After the file is written, ask the user: \"Which of these would you like to explore?\"\n\n### 3. Grilling loop\n\nOnce the user picks a candidate, call the Skill tool with \"grilling\" to walk the decision tree with them: constraints, dependencies, the shape of the deepened module, what sits behind the seam, what tests survive.\n\nSide effects happen inline as decisions crystallize; call the Skill tool with \"domain-modeling\" to keep the domain model current as you go:\n\n- **Naming a deepened module after a concept not in `GLOSSARY.md`?** Add the term to `GLOSSARY.md`. Create the file lazily if it doesn't exist.\n- **Sharpening a fuzzy term during the conversation?** Update `GLOSSARY.md` right there.\n- **User rejects the candidate with a load-bearing reason?** Offer an ADR, framed as: _\"Want me to record this as an ADR so future architecture reviews don't re-suggest it?\"_ Only offer when the reason would actually be needed by a future explorer to avoid re-suggesting the same thing; skip ephemeral reasons (\"not worth it right now\") and self-evident ones.\n- **Want to explore alternative interfaces for the deepened module?** Call the Skill tool with \"codebase-design\" and use its design-it-twice parallel sub-agent pattern.\n",{"name":5,"description":7,"disable-model-invocation":40},true,"master","dc8003d37a723360f1d73b2889ca447ff4a16844","home\u002Fclaude\u002F.claude\u002Fskills\u002Fimprove-codebase-architecture",1,"https:\u002F\u002Fgithub.com\u002FSamFleming\u002Fdotfiles","https:\u002F\u002Fgithub.com\u002FSamFleming","samfleming.me","2026-10-26 07:52:31",{"source":9,"skillName":5,"commands":50,"prompt":60,"zipAvailable":40},[51,54,57],{"tool":52,"command":53},"npx","npx skills add SamFleming\u002Fdotfiles --skill improve-codebase-architecture",{"tool":55,"command":56},"bunx","bunx skills add SamFleming\u002Fdotfiles --skill improve-codebase-architecture",{"tool":58,"command":59},"pnpm","pnpm dlx skills add SamFleming\u002Fdotfiles --skill improve-codebase-architecture","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSamFleming\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fhome\u002Fclaude\u002F.claude\u002Fskills\u002Fimprove-codebase-architecture\u002FSKILL.md",[62,68,72,76],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"HTML-REPORT.md","REFERENCE","参考文档",6641,"https:\u002F\u002Fgithub.com\u002FSamFleming\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fhome\u002Fclaude\u002F.claude\u002Fskills\u002Fimprove-codebase-architecture\u002FHTML-REPORT.md",{"path":69,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":70,"sourceHtmlUrl":71},"REFERENCE.md",8357,"https:\u002F\u002Fgithub.com\u002Flaurigates\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fpython-plugin\u002Fskills\u002Fruff-linting\u002FREFERENCE.md",{"path":73,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fcommand-recipes.md",2099,"https:\u002F\u002Fgithub.com\u002Flaurigates\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fpython-plugin\u002Fskills\u002Fruff-linting\u002Freferences\u002Fcommand-recipes.md",{"path":77,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fplugin-configuration.md",761,"https:\u002F\u002Fgithub.com\u002Flaurigates\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fpython-plugin\u002Fskills\u002Fruff-linting\u002Freferences\u002Fplugin-configuration.md",[81,99,118,131,145,160],{"skillNo":82,"name":83,"nameZh":84,"description":85,"descriptionZh":86,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":87,"categories":88,"keywords":95,"publishedAt":35},"01M6BVCYMF5PJ3GTNS7477TNVB","zoom-out","宏观视角上下文梳理","Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.","让智能体（agent）拉远视角，提供更广泛的上下文或更高层次的视角。当你不熟悉某段代码，或需要理解它如何融入整体大局时使用。","https:\u002F\u002Fgithub.com\u002FSamFleming\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fhome\u002Fclaude\u002F.claude\u002Fskills\u002Fzoom-out\u002FSKILL.md",[89,92],{"categoryNo":90,"categoryName":91,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TKQDF2K4KQS863Q79P4","开发参考",{"categoryNo":93,"categoryName":94,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",[96,97,98],"zoom out","code","how",{"skillNo":100,"name":101,"nameZh":102,"description":103,"descriptionZh":104,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":105,"categories":106,"keywords":111,"publishedAt":35},"01M6BVCWXARRXMPJEA3R0J1Y0D","tdd","测试驱动开发（TDD）","Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions \"red-green-refactor\", or wants integration tests.","测试驱动开发。当用户希望以测试优先的方式构建功能或修复缺陷、提到“红-绿-重构”（red-green-refactor），或需要集成测试时使用。","https:\u002F\u002Fgithub.com\u002FSamFleming\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fhome\u002Fclaude\u002F.claude\u002Fskills\u002Ftdd\u002FSKILL.md",[107,108],{"categoryNo":93,"categoryName":94,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":109,"categoryName":110,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[101,112,113,114,115,116,117],"test","integration tests","development","integration","refactor","first",{"skillNo":119,"name":120,"nameZh":121,"description":122,"descriptionZh":123,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":124,"categories":125,"keywords":130,"publishedAt":35},"01M6BVCT2AD4MTJ3GENDX15XMS","handoff","会话交接文档生成","Compact the current conversation into a handoff document for another agent to pick up.","将当前对话精简为一份交接文档，供另一个智能体接手继续工作。","https:\u002F\u002Fgithub.com\u002FSamFleming\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fhome\u002Fclaude\u002F.claude\u002Fskills\u002Fhandoff\u002FSKILL.md",[126,127],{"categoryNo":93,"categoryName":94,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":128,"categoryName":129,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BTBRVQZ06FQWD8P64214B2","会话上下文交接",[120],{"skillNo":132,"name":133,"nameZh":134,"description":135,"descriptionZh":136,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":137,"categories":138,"keywords":143,"publishedAt":35},"01M6BVCRZMCZYCK99DZKV81YFB","grilling","方案压力质询","Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.","对用户提出的计划、决策或想法进行不留情面的连续追问。当用户想要压力测试自己的思路，或使用任何'grill'触发短语时使用。","https:\u002F\u002Fgithub.com\u002FSamFleming\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fhome\u002Fclaude\u002F.claude\u002Fskills\u002Fgrilling\u002FSKILL.md",[139,140],{"categoryNo":93,"categoryName":94,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":141,"categoryName":142,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BTBRV70X1T1B33XJ0GW1TW","方案质询与决策压力测试",[133,112,144],"plan",{"skillNo":146,"name":147,"nameZh":148,"description":149,"descriptionZh":150,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":151,"categories":152,"keywords":155,"publishedAt":35},"01M6BVCQCMATEZ7Z7WWFTGMJSH","grill-with-docs","方案质询与文档生成","A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.","一场不留情面的连续追问式访谈，用于打磨计划或设计，同时在此过程中创建文档（ADR 和术语表）。","https:\u002F\u002Fgithub.com\u002FSamFleming\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fhome\u002Fclaude\u002F.claude\u002Fskills\u002Fgrill-with-docs\u002FSKILL.md",[153,154],{"categoryNo":93,"categoryName":94,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":141,"categoryName":142,"taxonomyType":23,"taxonomyTypeDesc":24},[156,157,144,158,159],"grill with docs","docs","design","go",{"skillNo":161,"name":162,"nameZh":163,"description":164,"descriptionZh":165,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":166,"categories":167,"keywords":170,"publishedAt":35},"01M6BVCP6ZDGYAF694GPXHP23Y","grill-me","方案设计深度质询","A relentless interview to sharpen a plan or design.","通过不留情面的连续追问式访谈，打磨你的计划或设计。","https:\u002F\u002Fgithub.com\u002FSamFleming\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fhome\u002Fclaude\u002F.claude\u002Fskills\u002Fgrill-me\u002FSKILL.md",[168,169],{"categoryNo":93,"categoryName":94,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":141,"categoryName":142,"taxonomyType":23,"taxonomyTypeDesc":24},[171,158,144],"grill me"]