[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CZMEPW06D0XTR48AKA47J0":3,"skill-same:01M6CZMEPW06D0XTR48AKA47J0":75},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":7,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":7,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":34,"frontMatter":35,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":7,"ownerHtmlUrl":41,"ownerBlogUrl":7,"ownerDescription":7,"updatedAt":42,"install":43,"resources":56},"01M6CZMEPW06D0XTR48AKA47J0","improve-codebase-architecture","代码库架构优化",null,"","Testing-itay\u002FDevTools-Security-Lab","Testing-itay","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F230151326?v=4","01M6CZH4Q5Z571N5ZRZWMQ3YBS","01M6CZH4W55EHV4P1D3SNNRXSS",0,"MIT","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fimprove-codebase-architecture\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01M8BT7QTSZKB08EAW9P9ZCDNQ","设计评审与架构优化","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01M8C4ZVS0ZJKF2T2G58PW5VR2","系统架构师","PROFESSION","适用职业",[29,30,31],"improve codebase architecture","architecture","improve","2026-11-10 10:12:30",false,"\n\n\n\n---\nname: improve-codebase-architecture\ndescription: Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs\u002Fadr\u002F. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.\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** — 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, the same template as before, but rendered as a card:\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 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 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, drop into a grilling conversation. Walk the design 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:\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](..\u002Fgrill-with-docs\u002FCONTEXT-FORMAT.md)). Create the file lazily if it doesn't exist.\n- **Sharpening a fuzzy term during the conversation?** Update `CONTEXT.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. See [ADR-FORMAT.md](..\u002Fgrill-with-docs\u002FADR-FORMAT.md).\n- **Want to explore alternative interfaces for the deepened module?** See [INTERFACE-DESIGN.md](INTERFACE-DESIGN.md).\n",{},"main","1188d0dcbd4e64256d35bfe14c955ba1c541b1de",".cursor\u002Fskills\u002Fimprove-codebase-architecture",13,"https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab","https:\u002F\u002Fgithub.com\u002FTesting-itay","2026-10-16 16:13:27",{"source":9,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add Testing-itay\u002FDevTools-Security-Lab --skill improve-codebase-architecture",{"tool":49,"command":50},"bunx","bunx skills add Testing-itay\u002FDevTools-Security-Lab --skill improve-codebase-architecture",{"tool":52,"command":53},"pnpm","pnpm dlx skills add Testing-itay\u002FDevTools-Security-Lab --skill improve-codebase-architecture","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fimprove-codebase-architecture\u002FSKILL.md",true,[57,63,67,71],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"DEEPENING.md","REFERENCE","参考文档",2569,"https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fimprove-codebase-architecture\u002FDEEPENING.md",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"HTML-REPORT.md",6675,"https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fimprove-codebase-architecture\u002FHTML-REPORT.md",{"path":68,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":69,"sourceHtmlUrl":70},"INTERFACE-DESIGN.md",2729,"https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fimprove-codebase-architecture\u002FINTERFACE-DESIGN.md",{"path":72,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":73,"sourceHtmlUrl":74},"LANGUAGE.md",3808,"https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fimprove-codebase-architecture\u002FLANGUAGE.md",[76,85,94,110,126,138],{"skillNo":77,"name":78,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":7,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":7,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":32},"01M6CZR9VVRMS754ZKH7NPNMB1","sds-plugin-a11y-check","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002Fsrc\u002FnewDIR\u002Fbundles\u002Fplugins\u002Fsds-frontend-plugin\u002Fskills\u002Fsds-plugin-a11y-check\u002FSKILL.md",[],[82,83,84],"sds plugin a11y check","check","plugin",{"skillNo":86,"name":87,"nameZh":7,"description":7,"descriptionZh":7,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":7,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":7,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":32},"01M6CZR8FQ30QGEV5D3SB6DDKP","endpoint-review","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002Fsrc\u002FnewDIR\u002Fbundles\u002Fplugins\u002Fpython-api-plugin\u002Fskills\u002Fendpoint-review\u002FSKILL.md",[],[91,92,93],"endpoint review","endpoint","review",{"skillNo":95,"name":96,"nameZh":97,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":7,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":7,"sourceHtmlUrl":98,"categories":99,"keywords":106,"publishedAt":32},"01M6CZR6TYBN5EMBM70E096E66","schema-draft","数据库Schema草案设计","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002Fsrc\u002FnewDIR\u002Fbundles\u002Fplugins\u002Fpython-api-plugin\u002Fagents\u002Fpy-plugin-endpoint-designer\u002Fskills\u002Fschema-draft\u002FSKILL.md",[100,103],{"categoryNo":101,"categoryName":102,"taxonomyType":21,"taxonomyTypeDesc":22},"01M8BS1P4QM1G70C9FKMTZ88VK","数据库管理",{"categoryNo":104,"categoryName":105,"taxonomyType":26,"taxonomyTypeDesc":27},"01M8BTGTEHKD89NSZ5CT4Y5AGV","数据工程师",[107,108,109],"schema","schema draft","draft",{"skillNo":111,"name":112,"nameZh":113,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":7,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":7,"sourceHtmlUrl":114,"categories":115,"keywords":122,"publishedAt":32},"01M6CZR5SDWF91FHDK54XHXS67","doc-outline","文档大纲生成","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002Fsrc\u002FnewDIR\u002Fbundles\u002Fplugins\u002Fai-documentation-workflow\u002Fskills\u002Fdoc-outline\u002FSKILL.md",[116,119],{"categoryNo":117,"categoryName":118,"taxonomyType":21,"taxonomyTypeDesc":22},"01M8BQ6TK1MPB82068236GSXDE","文档处理",{"categoryNo":120,"categoryName":121,"taxonomyType":26,"taxonomyTypeDesc":27},"01M8BVB0FJ0RR8KXYVFTKEA3XX","技术文档工程师",[123,124,125],"doc outline","outline","doc",{"skillNo":127,"name":78,"nameZh":128,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":7,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":7,"sourceHtmlUrl":129,"categories":130,"keywords":137,"publishedAt":32},"01M6CZR3Z4WZCBA5FVJZB65B1Y","SDS插件无障碍检查","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002Fsrc\u002FnewD\u002FnewDIR\u002Fbundles\u002Fplugins\u002Fsds-frontend-plugin\u002Fskills\u002Fsds-plugin-a11y-check\u002FSKILL.md",[131,134],{"categoryNo":132,"categoryName":133,"taxonomyType":26,"taxonomyTypeDesc":27},"01M8BQ6TQMKHSMFVQHR2KYAEVN","界面设计师",{"categoryNo":135,"categoryName":136,"taxonomyType":21,"taxonomyTypeDesc":22},"01M8C0KXSTFVNZCAY3CD7ATQM3","无障碍合规检查",[82,83,84],{"skillNo":139,"name":87,"nameZh":140,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":7,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":7,"sourceHtmlUrl":141,"categories":142,"keywords":149,"publishedAt":32},"01M6CZR2PR7T4XYSJJWQYYPXVW","API端点审查","https:\u002F\u002Fgithub.com\u002FTesting-itay\u002FDevTools-Security-Lab\u002Fblob\u002Fmain\u002Fsrc\u002FnewD\u002FnewDIR\u002Fbundles\u002Fplugins\u002Fpython-api-plugin\u002Fskills\u002Fendpoint-review\u002FSKILL.md",[143,146],{"categoryNo":144,"categoryName":145,"taxonomyType":26,"taxonomyTypeDesc":27},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":147,"categoryName":148,"taxonomyType":21,"taxonomyTypeDesc":22},"01M8CJ3T58C1GFPAH8M3Y8VR5K","后端开发",[93,91,92]]