[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DM1GNE3JFR8WV1SWJ5EXJ9":3,"skill-same:01M7DM1GNE3JFR8WV1SWJ5EXJ9":44},{"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":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":13,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7DM1GNE3JFR8WV1SWJ5EXJ9","codebase-design",null,"Deep modules, interfaces and seams. Load when designing or restructuring modules or deciding where an interface goes.","Anemos-labs\u002FSleipnir","Anemos-labs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F292271065?v=4","01M7DM0NMRCBK5YXDB4DPZDJJG","01M7DM0NNVMEW7T30EG9YW2G88",0,"MIT","https:\u002F\u002Fgithub.com\u002FAnemos-labs\u002FSleipnir\u002Fblob\u002Fmain\u002Finternal\u002Fskills\u002Fbuiltin\u002Fdata\u002Fcodebase-design\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: codebase-design\ndescription: Deep modules, interfaces and seams. Load when designing or restructuring modules or deciding where an interface goes.\nlicense: MIT\nauthor: Adapted from Matt Pocock's codebase-design skill (github.com\u002Fmattpocock\u002Fskills) and pstack principles by Lauren Tan (github.com\u002Fcursor\u002Fplugins), MIT licence\n---\n\n# Codebase design\n\nDesign **deep modules**: a lot of behaviour behind a small interface, at a clean seam, tested through that interface. The aim is leverage for callers, locality for maintainers and testability for everyone.\n\n## Terms\n\nUse these words exactly, in agreements, tasks and reviews, so every agent means the same thing.\n\n- **Module:** anything with an interface and an implementation, at any scale: a function, a type, a package, a slice through several tiers.\n- **Interface:** everything a caller must know to use the module correctly: the signature, and also invariants, ordering constraints, error modes, required configuration and performance characteristics.\n- **Implementation:** the code inside the module.\n- **Depth:** how much behaviour a caller or a test gets per unit of interface it has to learn. Deep means a small interface over a lot of behaviour; shallow means the interface is nearly as complex as what it hides.\n- **Seam:** the place where the module's interface lives and where behaviour can be swapped without editing callers.\n- **Adapter:** a concrete thing that fills a seam (a Postgres store, an in-memory fake).\n- **Leverage:** what callers gain from depth. **Locality:** what maintainers gain: change, bugs and knowledge concentrate in one place.\n\n## Principles\n\n- **The deletion test.** Imagine deleting the module. If complexity vanishes, it was a pass-through; inline it. If the complexity reappears in every caller, it earns its place.\n- **The interface is the test surface.** Callers and tests cross the same seam. Wanting to test past the interface means the module has the wrong shape.\n- **One adapter is a hypothetical seam; two make it real.** Do not add a seam until something varies across it.\n- **Depth belongs to the interface.** A deep module may be built from small parts inside; they are just not part of its interface.\n- **Organise by domain knowledge, not by sequence.** A module owns one body of knowledge and its invariants. Modules named for steps (load, validate, transform, save) repeat the same rules in each step.\n- **Encode the domain in a structure:** a state machine, a typed model, a table or registry, a reducer, the right collection. Prefer boring code when the current shape is already clear and unlikely to grow; an abstraction must remove branches, duplicated rules or invalid states, not only add indirection.\n- **Boundaries:** parse external data into domain types where it enters, expose domain concepts rather than wire, storage or framework types, keep general mechanism inside and special-purpose policy at the edge.\n\n## Designing for testability\n\n1. **Accept dependencies, do not create them.** `processOrder(order, gateway)` is testable; a function that constructs its own payment client is not.\n2. **Return results instead of producing side effects** where you can: `discount(cart)` returning a value beats `applyDiscount(cart)` mutating it.\n3. **Small surface.** Fewer operations and fewer parameters mean fewer tests and simpler setup.\n\nWhen you design an interface, ask: can it have fewer operations, simpler parameters, more hidden inside?\n\n## Design it twice\n\nFor an interface that many parts will depend on, sketch two or three radically different shapes (different operations, different seam placement) and compare them on depth, locality and where the seam sits before choosing. Say in the agreement or report which you rejected and why.\n\n## Wide changes\n\nA mechanical change whose blast radius crosses the codebase (renaming a shared type, a column) cannot land as one green step. Sequence it as expand, migrate, contract: add the new form beside the old, move callers over in batches that each keep the build green, then delete the old form once no caller remains.\n","# Codebase design\n\nDesign **deep modules**: a lot of behaviour behind a small interface, at a clean seam, tested through that interface. The aim is leverage for callers, locality for maintainers and testability for everyone.\n\n## Terms\n\nUse these words exactly, in agreements, tasks and reviews, so every agent means the same thing.\n\n- **Module:** anything with an interface and an implementation, at any scale: a function, a type, a package, a slice through several tiers.\n- **Interface:** everything a caller must know to use the module correctly: the signature, and also invariants, ordering constraints, error modes, required configuration and performance characteristics.\n- **Implementation:** the code inside the module.\n- **Depth:** how much behaviour a caller or a test gets per unit of interface it has to learn. Deep means a small interface over a lot of behaviour; shallow means the interface is nearly as complex as what it hides.\n- **Seam:** the place where the module's interface lives and where behaviour can be swapped without editing callers.\n- **Adapter:** a concrete thing that fills a seam (a Postgres store, an in-memory fake).\n- **Leverage:** what callers gain from depth. **Locality:** what maintainers gain: change, bugs and knowledge concentrate in one place.\n\n## Principles\n\n- **The deletion test.** Imagine deleting the module. If complexity vanishes, it was a pass-through; inline it. If the complexity reappears in every caller, it earns its place.\n- **The interface is the test surface.** Callers and tests cross the same seam. Wanting to test past the interface means the module has the wrong shape.\n- **One adapter is a hypothetical seam; two make it real.** Do not add a seam until something varies across it.\n- **Depth belongs to the interface.** A deep module may be built from small parts inside; they are just not part of its interface.\n- **Organise by domain knowledge, not by sequence.** A module owns one body of knowledge and its invariants. Modules named for steps (load, validate, transform, save) repeat the same rules in each step.\n- **Encode the domain in a structure:** a state machine, a typed model, a table or registry, a reducer, the right collection. Prefer boring code when the current shape is already clear and unlikely to grow; an abstraction must remove branches, duplicated rules or invalid states, not only add indirection.\n- **Boundaries:** parse external data into domain types where it enters, expose domain concepts rather than wire, storage or framework types, keep general mechanism inside and special-purpose policy at the edge.\n\n## Designing for testability\n\n1. **Accept dependencies, do not create them.** `processOrder(order, gateway)` is testable; a function that constructs its own payment client is not.\n2. **Return results instead of producing side effects** where you can: `discount(cart)` returning a value beats `applyDiscount(cart)` mutating it.\n3. **Small surface.** Fewer operations and fewer parameters mean fewer tests and simpler setup.\n\nWhen you design an interface, ask: can it have fewer operations, simpler parameters, more hidden inside?\n\n## Design it twice\n\nFor an interface that many parts will depend on, sketch two or three radically different shapes (different operations, different seam placement) and compare them on depth, locality and where the seam sits before choosing. Say in the agreement or report which you rejected and why.\n\n## Wide changes\n\nA mechanical change whose blast radius crosses the codebase (renaming a shared type, a column) cannot land as one green step. Sequence it as expand, migrate, contract: add the new form beside the old, move callers over in batches that each keep the build green, then delete the old form once no caller remains.\n",{"name":5,"author":23,"license":14,"description":7},"Adapted from Matt Pocock's codebase-design skill (github.com\u002Fmattpocock\u002Fskills) and pstack principles by Lauren Tan (github.com\u002Fcursor\u002Fplugins), MIT licence","main","23fde6dd293bd85fcb7b6a5d37af1ba7ea752a24","internal\u002Fskills\u002Fbuiltin\u002Fdata\u002Fcodebase-design","https:\u002F\u002Fgithub.com\u002FAnemos-labs\u002FSleipnir","https:\u002F\u002Fgithub.com\u002FAnemos-labs","2026-11-13 05:46:48",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add Anemos-labs\u002FSleipnir --skill codebase-design",{"tool":36,"command":37},"bunx","bunx skills add Anemos-labs\u002FSleipnir --skill codebase-design",{"tool":39,"command":40},"pnpm","pnpm dlx skills add Anemos-labs\u002FSleipnir --skill codebase-design","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAnemos-labs\u002FSleipnir\u002Fblob\u002Fmain\u002Finternal\u002Fskills\u002Fbuiltin\u002Fdata\u002Fcodebase-design\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M7DM2MTFM5P9A96RBMK0CEWW","spec","Goal to specification, vertical slices and milestones a judge can check. Load when planning a product or large feature or splitting work into tasks.","https:\u002F\u002Fgithub.com\u002FAnemos-labs\u002FSleipnir\u002Fblob\u002Fmain\u002Finternal\u002Fskills\u002Fbuiltin\u002Fdata\u002Fspec\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M7DM2HSF795J7BGMN9BSZZYJ","sleipnir-plugin","Make or change a Sleipnir plugin and load it live (sleipnir tool).","https:\u002F\u002Fgithub.com\u002FAnemos-labs\u002FSleipnir\u002Fblob\u002Fmain\u002Finternal\u002Fskills\u002Fbuiltin\u002Fdata\u002Fsleipnir-plugin\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M7DM26NQQ5343G12M2SWC957","reverse-engineering-ui","Tear down a live site or web UI into an evidence-backed spec (layout, tokens, components, states, network) for an original rebuild. Use to clone or match one.","https:\u002F\u002Fgithub.com\u002FAnemos-labs\u002FSleipnir\u002Fblob\u002Fmain\u002Finternal\u002Fskills\u002Fbuiltin\u002Fdata\u002Freverse-engineering-ui\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M7DM2391M8KK319ZXMWVK6PJ","prototype","Throwaway prototype that settles a design question by observation. Load when choosing between layouts, interactions or state models.","https:\u002F\u002Fgithub.com\u002FAnemos-labs\u002FSleipnir\u002Fblob\u002Fmain\u002Finternal\u002Fskills\u002Fbuiltin\u002Fdata\u002Fprototype\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M7DM1YHX1MNZJ262D8B7X782","plain-writing","Clear technical writing without machine-generated tells. Load before writing a README, docs, site copy, release notes, a commit or PR message.","https:\u002F\u002Fgithub.com\u002FAnemos-labs\u002FSleipnir\u002Fblob\u002Fmain\u002Finternal\u002Fskills\u002Fbuiltin\u002Fdata\u002Fplain-writing\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M7DM1P5W6Y88NHYFQG9JWMDR","diagnose","Feedback-loop-first diagnosis of hard bugs, flaky tests and performance regressions. Load before changing code when the cause is not obvious.","https:\u002F\u002Fgithub.com\u002FAnemos-labs\u002FSleipnir\u002Fblob\u002Fmain\u002Finternal\u002Fskills\u002Fbuiltin\u002Fdata\u002Fdiagnose\u002FSKILL.md",[],[]]