[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6R5V0XQKYVM41GHHC0T2778":3,"skill-same:01M6R5V0XQKYVM41GHHC0T2778":74},{"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":33,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":13,"repositoryHtmlUrl":57,"repositoryHomepageUrl":6,"ownerHtmlUrl":58,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":59,"install":60,"resources":73},"01M6R5V0XQKYVM41GHHC0T2778","design-an-api-or-interface",null,"Design APIs\u002Finterfaces with Design It Twice: create alternatives, compare tradeoffs, choose one. Use when designing an API, module, class, or boundary.","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\u002Fdesign-an-api-or-interface\u002FSKILL.md",[17,22,25,30],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",{"categoryNo":31,"categoryName":32,"taxonomyType":28,"taxonomyTypeDesc":29},"01JBSEEDCAT000000000000032","设计师",[34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"design","api","interface","design an api or interface","create","boundary","choose","use","module","compare","it","with","design it","alternatives","when","2026-11-10 10:12:30",false,"---\nname: design-an-api-or-interface\ndescription: 'Design APIs\u002Finterfaces with Design It Twice: create alternatives, compare tradeoffs, choose one. Use when designing an API, module, class, or boundary.'\n---\n\n# Design an API or Interface\n\n## Quick Start\n\n1. Gather requirements (problem, callers, key ops, constraints)\n2. Spawn 3+ sub-agents in parallel, each with different design constraints\n3. Present each design with signature, examples, trade-offs\n4. Compare and recommend\n5. Synthesize best elements\n\n## Workflow\n\n### Step 1 — Gather Requirements\n\nBefore generating designs, understand:\n- **Problem**: What does this interface solve?\n- **Callers**: Who will use it? What do they need?\n- **Key operations**: Most common operations?\n- **Constraints**: Performance, memory, API compatibility?\n- **Surface area**: What to hide vs expose?\n\n### Step 2 — Generate Designs in Parallel\n\nSpawn 3+ sub-agents with different constraints:\n\n| Agent | Constraint |\n|-------|------------|\n| A | Minimize method count — leanest possible |\n| B | Maximize flexibility — most general-purpose |\n| C | Optimize for common case — prioritize frequent ops |\n| D | Ports & adapters pattern for cross-boundary deps |\n\nEach produces: interface signature, usage examples, internal complexity, trade-offs.\n\n### Step 3 — Present Each Design\n\nShow: interface signature, usage code, hidden complexity, key trade-offs.\n\n### Step 4 — Compare Designs\n\nEvaluate on: simplicity, flexibility, implementation efficiency, depth, ease of use vs misuse.\n\n### Step 5 — Synthesize\n\nCombine insights. Often best design borrows from multiple options.\n\n## Key Principles\n\n1. **Interface simplicity**: Fewer methods with focused purpose\n2. **General-purpose without over-generalization**: Don't bloat for hypothetical needs\n3. **Implementation efficiency**: Interface shape allows performant internals\n4. **Depth**: Small surface area hiding significant complexity\n\nBased on \"A Philosophy of Software Design\" by John Ousterhout — \"Design It Twice\" principle.\n","# Design an API or Interface\n\n## Quick Start\n\n1. Gather requirements (problem, callers, key ops, constraints)\n2. Spawn 3+ sub-agents in parallel, each with different design constraints\n3. Present each design with signature, examples, trade-offs\n4. Compare and recommend\n5. Synthesize best elements\n\n## Workflow\n\n### Step 1 — Gather Requirements\n\nBefore generating designs, understand:\n- **Problem**: What does this interface solve?\n- **Callers**: Who will use it? What do they need?\n- **Key operations**: Most common operations?\n- **Constraints**: Performance, memory, API compatibility?\n- **Surface area**: What to hide vs expose?\n\n### Step 2 — Generate Designs in Parallel\n\nSpawn 3+ sub-agents with different constraints:\n\n| Agent | Constraint |\n|-------|------------|\n| A | Minimize method count — leanest possible |\n| B | Maximize flexibility — most general-purpose |\n| C | Optimize for common case — prioritize frequent ops |\n| D | Ports & adapters pattern for cross-boundary deps |\n\nEach produces: interface signature, usage examples, internal complexity, trade-offs.\n\n### Step 3 — Present Each Design\n\nShow: interface signature, usage code, hidden complexity, key trade-offs.\n\n### Step 4 — Compare Designs\n\nEvaluate on: simplicity, flexibility, implementation efficiency, depth, ease of use vs misuse.\n\n### Step 5 — Synthesize\n\nCombine insights. Often best design borrows from multiple options.\n\n## Key Principles\n\n1. **Interface simplicity**: Fewer methods with focused purpose\n2. **General-purpose without over-generalization**: Don't bloat for hypothetical needs\n3. **Implementation efficiency**: Interface shape allows performant internals\n4. **Depth**: Small surface area hiding significant complexity\n\nBased on \"A Philosophy of Software Design\" by John Ousterhout — \"Design It Twice\" principle.\n",{"name":5,"description":7},"main","037fe34299eb9c4a30b51f1a6bd101eae1c469b1","02-govern-plan\u002Fdesign-an-api-or-interface","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills","https:\u002F\u002Fgithub.com\u002Fr3dlex","2026-10-29 16:22:54",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add r3dlex\u002Fskills --skill design-an-api-or-interface",{"tool":66,"command":67},"bunx","bunx skills add r3dlex\u002Fskills --skill design-an-api-or-interface",{"tool":69,"command":70},"pnpm","pnpm dlx skills add r3dlex\u002Fskills --skill design-an-api-or-interface","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002F02-govern-plan\u002Fdesign-an-api-or-interface\u002FSKILL.md",true,[],[75,83,94,103,113,136],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":49},"01M6R652E42RZT7M2V3RWW991Z","skill","Fixture.","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fcatalog-malformed\u002Fskill\u002FSKILL.md",[],[82],"fixture",{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":92,"publishedAt":49},"01M6R64MTPF0FGWHFS4DWP40GR","stable-skill","Fixture stable-skill.","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fcatalog-lifecycle\u002Fstable-skill\u002FSKILL.md",[89],{"categoryNo":90,"categoryName":91,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[93,82],"stable skill",{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":101,"publishedAt":49},"01M6R64HD4QVAYM2R0JSYNVDJW","experimental-skill","Fixture experimental-skill.","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fcatalog-lifecycle\u002Fexperimental-skill\u002FSKILL.md",[100],{"categoryNo":90,"categoryName":91,"taxonomyType":20,"taxonomyTypeDesc":21},[102,82],"experimental skill",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":110,"publishedAt":49},"01M6R64FZH05TEJQW75QX1E5XD","deprecated-skill","Fixture deprecated-skill.","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fcatalog-lifecycle\u002Fdeprecated-skill\u002FSKILL.md",[109],{"categoryNo":90,"categoryName":91,"taxonomyType":20,"taxonomyTypeDesc":21},[111,112,82],"deprecated skill","deprecated",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":49},"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",[],[120,121,122,123,41,124,125,126,127,128,129,130,48,131,132,133,134,135],"karpathy guidelines","karpathy","guidelines","Rules","simplicity","goal","think","driven","reviewing code","implementing","apply","coding","change","code","planning","engineering",{"skillNo":137,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":49},"01M6R640ZS60BRV9P49FT46ZJX","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Fskills\u002Fblob\u002Fmain\u002Freference\u002Fgolden-root\u002F.agents\u002Fskills\u002Fkarpathy-guidelines\u002FSKILL.md",[],[122,120,121,132,127,133,134,135,131,123,41,124,125,126,128,129,130,48]]