[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ASY4S915KSTA5Z15W2ZHQ3":3,"skill-same:01M7ASY4S915KSTA5Z15W2ZHQ3":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"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":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7ASY4S915KSTA5Z15W2ZHQ3","test-doubles-first",null,"Select and implement the right test double with a default preference for fakes, stubs, and spies over mocks. Use when writing or refactoring tests, especially when users mention test doubles, mocking strategy, interaction assertions, or flaky tests caused by over-mocking.","saski\u002Farnesto","saski","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F140356?v=4","01M7ASBDSNXTRYDYB4K1PEA1RV","01M7ASBDTAKBDAAV99S1GE7HK6",6,"Unlicense","https:\u002F\u002Fgithub.com\u002Fsaski\u002Farnesto\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftest-doubles-first\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: test-doubles-first\ndescription: Select and implement the right test double with a default preference for fakes, stubs, and spies over mocks. Use when writing or refactoring tests, especially when users mention test doubles, mocking strategy, interaction assertions, or flaky tests caused by over-mocking.\n---\n\n# Test Doubles First\n\n## Quick Navigation\n\n- [Goal](#goal)\n- [Default Rule](#default-rule)\n- [Decision Tree](#decision-tree)\n- [Naming and Placement](#naming-and-placement)\n- [Style Constraints](#style-constraints)\n- [What Can Be Doubled](#what-can-be-doubled)\n- [Quick PR Smell Check](#quick-pr-smell-check)\n- [Minimal Templates](#minimal-templates)\n\n## Goal\n\nWrite tests that describe behavior and state, not implementation details. Avoid mock-by-default.\n\n## Default Rule\n\n1. Prefer state\u002Foutput assertions first.\n2. Choose the lightest double that makes the test clear.\n3. Use mocks only when interaction contract is the behavior under test.\n\n## Decision Tree\n\n1. Can the test assert state (persisted data, returned value, emitted event)?\n   - Yes -> use a `Fake` (in-memory or lightweight real implementation).\n   - No -> continue.\n2. Do you need to force a branch (success\u002Ffailure\u002Ftimeout) with controlled responses?\n   - Yes -> use a `Stub`.\n   - No -> continue.\n3. Do you need to observe an outbound effect (email, message, metrics) without prescribing internal construction?\n   - Yes -> use a `Spy`.\n   - No -> continue.\n4. Do you need to verify interaction contract (never called, called once, call order\u002Fprotocol)?\n   - Yes -> use a `Mock`, with minimal expectations.\n\nIf one test needs many interaction expectations, treat it as a design smell and raise the abstraction of the port.\n\n## Naming and Placement\n\n- Names\n  - `FakeXxxRepo`, `InMemoryXxxRepo`\n  - `StubXxxGateway`, `FailingXxxStub`, `FixedClockStub`\n  - `SpyXxxPublisher`, `SpyEmailService`\n  - `MockXxxClient` only for contract-driven tests\n- Paths (cross-platform style)\n  - Python: `tests\u002Fdoubles\u002F`\n  - TypeScript: `test\u002Fdoubles\u002F` or `__tests__\u002Fdoubles\u002F`\n\nAlways use forward slashes in paths.\n\n## Style Constraints\n\n- Prefer state\u002Foutput assertions over `called_with` assertions.\n- For spies, assert only relevant facts (for example count, recipient, subject).\n- Keep stubs configurable per scenario; do not build mini-systems.\n- Keep fakes honest to domain invariants; add contract tests for real adapters when needed.\n\n## What Can Be Doubled\n\n- Usually yes: ports to I\u002FO (database, network, queues), time\u002Frandomness, email, logs, metrics.\n- Usually no by default: value objects, entities, pure domain logic, internal mappers.\n\n## Quick PR Smell Check\n\n- Would renaming an internal method break the test without behavior change? If yes, likely over-mocked.\n- More than 2-3 interaction expectations in one test? Prefer fake\u002Fspy or redesign the port.\n- Could the fake diverge from the real adapter? Add a contract test.\n\n## Minimal Templates\n\nSee [references\u002Fexamples.md](references\u002Fexamples.md) for Jest-based JavaScript and TypeScript templates for fake, stub, spy, and contract-focused mock.\nSee [references\u002Fusage.md](references\u002Fusage.md) for trigger prompts and copy-paste templates.\nSee [references\u002Fquick.md](references\u002Fquick.md) for single-page fast reference.\n","# Test Doubles First\n\n## Quick Navigation\n\n- [Goal](#goal)\n- [Default Rule](#default-rule)\n- [Decision Tree](#decision-tree)\n- [Naming and Placement](#naming-and-placement)\n- [Style Constraints](#style-constraints)\n- [What Can Be Doubled](#what-can-be-doubled)\n- [Quick PR Smell Check](#quick-pr-smell-check)\n- [Minimal Templates](#minimal-templates)\n\n## Goal\n\nWrite tests that describe behavior and state, not implementation details. Avoid mock-by-default.\n\n## Default Rule\n\n1. Prefer state\u002Foutput assertions first.\n2. Choose the lightest double that makes the test clear.\n3. Use mocks only when interaction contract is the behavior under test.\n\n## Decision Tree\n\n1. Can the test assert state (persisted data, returned value, emitted event)?\n   - Yes -> use a `Fake` (in-memory or lightweight real implementation).\n   - No -> continue.\n2. Do you need to force a branch (success\u002Ffailure\u002Ftimeout) with controlled responses?\n   - Yes -> use a `Stub`.\n   - No -> continue.\n3. Do you need to observe an outbound effect (email, message, metrics) without prescribing internal construction?\n   - Yes -> use a `Spy`.\n   - No -> continue.\n4. Do you need to verify interaction contract (never called, called once, call order\u002Fprotocol)?\n   - Yes -> use a `Mock`, with minimal expectations.\n\nIf one test needs many interaction expectations, treat it as a design smell and raise the abstraction of the port.\n\n## Naming and Placement\n\n- Names\n  - `FakeXxxRepo`, `InMemoryXxxRepo`\n  - `StubXxxGateway`, `FailingXxxStub`, `FixedClockStub`\n  - `SpyXxxPublisher`, `SpyEmailService`\n  - `MockXxxClient` only for contract-driven tests\n- Paths (cross-platform style)\n  - Python: `tests\u002Fdoubles\u002F`\n  - TypeScript: `test\u002Fdoubles\u002F` or `__tests__\u002Fdoubles\u002F`\n\nAlways use forward slashes in paths.\n\n## Style Constraints\n\n- Prefer state\u002Foutput assertions over `called_with` assertions.\n- For spies, assert only relevant facts (for example count, recipient, subject).\n- Keep stubs configurable per scenario; do not build mini-systems.\n- Keep fakes honest to domain invariants; add contract tests for real adapters when needed.\n\n## What Can Be Doubled\n\n- Usually yes: ports to I\u002FO (database, network, queues), time\u002Frandomness, email, logs, metrics.\n- Usually no by default: value objects, entities, pure domain logic, internal mappers.\n\n## Quick PR Smell Check\n\n- Would renaming an internal method break the test without behavior change? If yes, likely over-mocked.\n- More than 2-3 interaction expectations in one test? Prefer fake\u002Fspy or redesign the port.\n- Could the fake diverge from the real adapter? Add a contract test.\n\n## Minimal Templates\n\nSee [references\u002Fexamples.md](references\u002Fexamples.md) for Jest-based JavaScript and TypeScript templates for fake, stub, spy, and contract-focused mock.\nSee [references\u002Fusage.md](references\u002Fusage.md) for trigger prompts and copy-paste templates.\nSee [references\u002Fquick.md](references\u002Fquick.md) for single-page fast reference.\n",{"name":5,"description":7},"main","3c24fc2c035029b08c7326774bee3fef8fb95566",".agents\u002Fskills\u002Ftest-doubles-first",0,"https:\u002F\u002Fgithub.com\u002Fsaski\u002Farnesto","https:\u002F\u002Fgithub.com\u002Fsaski","http:\u002F\u002Fsaski.com","2026-11-12 20:09:16",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add saski\u002Farnesto --skill test-doubles-first",{"tool":37,"command":38},"bunx","bunx skills add saski\u002Farnesto --skill test-doubles-first",{"tool":40,"command":41},"pnpm","pnpm dlx skills add saski\u002Farnesto --skill test-doubles-first","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsaski\u002Farnesto\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftest-doubles-first\u002FSKILL.md",true,[45,51,55],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"references\u002Fexamples.md","REFERENCE","参考文档",1682,"https:\u002F\u002Fgithub.com\u002Fsaski\u002Farnesto\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftest-doubles-first\u002Freferences\u002Fexamples.md",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Fquick.md",2670,"https:\u002F\u002Fgithub.com\u002Fsaski\u002Farnesto\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftest-doubles-first\u002Freferences\u002Fquick.md",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fusage.md",3289,"https:\u002F\u002Fgithub.com\u002Fsaski\u002Farnesto\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftest-doubles-first\u002Freferences\u002Fusage.md",[60,67,74,81,88,95],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M7AT7F5FSHNAMFMF01N0QA1X","visualize","Use \u002Fvisualize for creating compact charts, diagrams, or other visuals inline as part of the conversation itself. It chooses among Markdown tables, Mermaid, inline HTML, and other supported in-transcript forms. Use Canvas for durable artifacts outside the transcript that users may revisit, refine, or share.","https:\u002F\u002Fgithub.com\u002Fsaski\u002Farnesto\u002Fblob\u002Fmain\u002F.cursor\u002Fskills-cursor\u002Fvisualize\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M7AT79MHSAR3JDDMP7DGERM9","update-cursor-settings","Modify Cursor\u002FVSCode user settings in settings.json. Use when you want to change editor settings, preferences, configuration, themes, font size, tab size, format on save, auto save, keybindings, or any settings.json values.","https:\u002F\u002Fgithub.com\u002Fsaski\u002Farnesto\u002Fblob\u002Fmain\u002F.cursor\u002Fskills-cursor\u002Fupdate-cursor-settings\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M7AT73WF3Y22E0FKYAMCCJES","update-cli-config","View and modify Cursor CLI configuration settings in ~\u002F.cursor\u002Fcli-config.json. Use when the user wants to change CLI settings, configure permissions, switch approval mode, enable vim mode, toggle display options, configure sandbox, or manage any CLI preferences.","https:\u002F\u002Fgithub.com\u002Fsaski\u002Farnesto\u002Fblob\u002Fmain\u002F.cursor\u002Fskills-cursor\u002Fupdate-cli-config\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M7AT6F3FBP85AJJ5BJNR8B5W","statusline","Configure a custom status line in the CLI. Use when the user mentions status line, statusline, statusLine, CLI status bar, prompt footer customization, or wants to add session context above the prompt.","https:\u002F\u002Fgithub.com\u002Fsaski\u002Farnesto\u002Fblob\u002Fmain\u002F.cursor\u002Fskills-cursor\u002Fstatusline\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":18},"01M7AT6D24QFS5XRAFN8S5XJ7W","split-to-prs","Split current work into small reviewable PRs. Use when the user asks to split a chat, set of changes, branch, or PR.","https:\u002F\u002Fgithub.com\u002Fsaski\u002Farnesto\u002Fblob\u002Fmain\u002F.cursor\u002Fskills-cursor\u002Fsplit-to-prs\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":18},"01M7AT69FYFN84XZKW452JV5DF","shell","Runs the rest of a \u002Fshell request as a literal shell command. Use only when the user explicitly invokes \u002Fshell and wants the following text executed directly in the terminal.","https:\u002F\u002Fgithub.com\u002Fsaski\u002Farnesto\u002Fblob\u002Fmain\u002F.cursor\u002Fskills-cursor\u002Fshell\u002FSKILL.md",[],[]]