[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DW2VFE6NPFCGQKQ68P1MVZ":3,"skill-same:01M6DW2VFE6NPFCGQKQ68P1MVZ":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":6,"ownerHtmlUrl":54,"ownerBlogUrl":55,"ownerDescription":6,"updatedAt":56,"install":57,"resources":70},"01M6DW2VFE6NPFCGQKQ68P1MVZ","vitest-tdd-workflow",null,"ACTIVATE when building new features, endpoints, or user stories using TDD with Vitest in a TypeScript\u002FNestJS context. ACTIVATE for '\u002Ffeature-tdd-dev', 'TDD', 'red-green-refactor' in TS context. Provides Vitest\u002FNestJS-specific TDD examples and commands; cross-language TDD workflow (cross-layer iterations, RED-GREEN-REFACTOR, working app, bug-fix-first-test, mocks-hiding-bugs) lives in craft:tdd-workflow-principles. DO NOT use for: node:test files (a file importing node:test) or a project whose tests run under node --test (see node-test:node-test-conventions), test writing conventions (see vitest:vitest-test-conventions), PHP TDD (see phpunit:php-tdd-workflow).","FabienSalles\u002Fclaude-marketplace","FabienSalles","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F937901?v=4","01M6DVJBD31CJKRB382FQFZ5FH","Fabien Salles","01M6DVJBQNY8Q18KJD1ESAD6TX",9,"MIT","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvitest\u002Fskills\u002Fvitest-tdd-workflow\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"tdd","vitest tdd workflow","vitest","tdd workflow","workflow","file","examples","dev","fix","use","red-green-refactor","files","activate","do","green","project","tests","feature","app","writing","2026-11-10 10:12:30",false,"---\nname: vitest-tdd-workflow\ndescription: \"ACTIVATE when building new features, endpoints, or user stories using TDD with Vitest in a TypeScript\u002FNestJS context. ACTIVATE for '\u002Ffeature-tdd-dev', 'TDD', 'red-green-refactor' in TS context. Provides Vitest\u002FNestJS-specific TDD examples and commands; cross-language TDD workflow (cross-layer iterations, RED-GREEN-REFACTOR, working app, bug-fix-first-test, mocks-hiding-bugs) lives in craft:tdd-workflow-principles. DO NOT use for: node:test files (a file importing node:test) or a project whose tests run under node --test (see node-test:node-test-conventions), test writing conventions (see vitest:vitest-test-conventions), PHP TDD (see phpunit:php-tdd-workflow).\"\n---\n\n# TDD Workflow — Vitest \u002F NestJS\n\n> The **cross-language TDD process** (cross-layer iterations, RED-GREEN-REFACTOR, working-app-at-each-GREEN, bug-fix workflow, mocks-hiding-bugs) is defined in `craft:tdd-workflow-principles`. This skill keeps Vitest\u002FNestJS-specific examples and commands.\n\n> See also: `vitest-test-conventions` for test writing conventions (DAMP, doubles, factories).\n\n## NestJS-specific: Iteration Example\n\n**\"Generate Receipt\" feature** — each iteration can touch Controller, Domain, and Repository as needed:\n\n**Iteration 1: Controller route exists**\n```\nTest:      E2E → authenticated user gets 200\nImplement: Empty controller with route\n```\n\n**Iteration 2: Eligibility check**\n```\nTest:      E2E → tenant without lease gets 403\nImplement: Guard or check in controller\n```\n\n**Iteration 3: Domain logic**\n```\nTest:      Unit → receipt calculates correct amount\nImplement: Receipt domain model\n```\n\n**Iteration 4: Wire it up**\n```\nTest:      E2E → full flow works\nImplement: Connect domain to controller\n```\n\n**Iteration 5: Edge case**\n```\nTest:      Unit → partial month prorates correctly\nImplement: Update calculation logic\n```\n\n## NestJS-specific: The Incomplete Stub Trap\n\n```typescript\n\u002F\u002F ❌ FORBIDDEN — referencing a non-registered service\n@Controller('receipts')\nexport class ReceiptController {\n  constructor(private readonly service: ReceiptService) {} \u002F\u002F Not registered!\n}\n\u002F\u002F → Test may pass with mocks, but app crashes at runtime\n\n\u002F\u002F ✅ CORRECT — register the service\n@Module({\n  providers: [ReceiptService],\n})\nexport class ReceiptModule {}\n```\n\n## NestJS-specific: End-of-Iteration GREEN Checklist\n\nIn addition to the cross-language checklist (see `craft:tdd-workflow-principles`):\n\n| Check | NestJS action |\n|-------|---------------|\n| Service injected? | Register in module `providers` |\n| Repository used? | Implement or create a stub, register provider |\n| Module imported? | Add to parent module `imports` |\n| Guard added? | Register in module |\n\n## Vitest-specific: Mocks Hiding Bugs\n\n```typescript\n\u002F\u002F ❌ This test passes but hides a calculation bug\nconst repo = new InMemoryLeaseRepository([mockLease]);\n\n\u002F\u002F ✅ Use real domain objects to catch real problems\nconst lease = Lease.create(realLeaseData);\nconst receipt = Receipt.create(lease, period);\n```\n\n## NestJS-specific: Default Test Level\n\nWhether a unit earns a test at all is `craft:testing-principles`' call, not this table's. Once a test **is** earned, these are the NestJS defaults:\n\n| Code Created | Default level |\n|--------------|----------------|\n| Domain model | Unit test for business logic |\n| Controller | E2E test (`supertest`) for endpoint |\n| Repository | Integration test with database |\n| Use case | Unit test with in-memory port stubs |\n| The access rule a guard enforces | Wherever refusal is observable, usually E2E |\n\n## Vitest-specific: Commands\n\n```bash\n# All tests\npnpm test\n\n# Specific test file\npnpm vitest run src\u002Freceipt\u002Freceipt.service.spec.ts\n\n# Watch mode\npnpm vitest src\u002Freceipt\u002F\n\n# Filter by test name\npnpm vitest run -t \"prorated amount\"\n\n# Verbose for debugging\npnpm vitest run --reporter=verbose receipt\n```\n","# TDD Workflow — Vitest \u002F NestJS\n\n> The **cross-language TDD process** (cross-layer iterations, RED-GREEN-REFACTOR, working-app-at-each-GREEN, bug-fix workflow, mocks-hiding-bugs) is defined in `craft:tdd-workflow-principles`. This skill keeps Vitest\u002FNestJS-specific examples and commands.\n\n> See also: `vitest-test-conventions` for test writing conventions (DAMP, doubles, factories).\n\n## NestJS-specific: Iteration Example\n\n**\"Generate Receipt\" feature** — each iteration can touch Controller, Domain, and Repository as needed:\n\n**Iteration 1: Controller route exists**\n```\nTest:      E2E → authenticated user gets 200\nImplement: Empty controller with route\n```\n\n**Iteration 2: Eligibility check**\n```\nTest:      E2E → tenant without lease gets 403\nImplement: Guard or check in controller\n```\n\n**Iteration 3: Domain logic**\n```\nTest:      Unit → receipt calculates correct amount\nImplement: Receipt domain model\n```\n\n**Iteration 4: Wire it up**\n```\nTest:      E2E → full flow works\nImplement: Connect domain to controller\n```\n\n**Iteration 5: Edge case**\n```\nTest:      Unit → partial month prorates correctly\nImplement: Update calculation logic\n```\n\n## NestJS-specific: The Incomplete Stub Trap\n\n```typescript\n\u002F\u002F ❌ FORBIDDEN — referencing a non-registered service\n@Controller('receipts')\nexport class ReceiptController {\n  constructor(private readonly service: ReceiptService) {} \u002F\u002F Not registered!\n}\n\u002F\u002F → Test may pass with mocks, but app crashes at runtime\n\n\u002F\u002F ✅ CORRECT — register the service\n@Module({\n  providers: [ReceiptService],\n})\nexport class ReceiptModule {}\n```\n\n## NestJS-specific: End-of-Iteration GREEN Checklist\n\nIn addition to the cross-language checklist (see `craft:tdd-workflow-principles`):\n\n| Check | NestJS action |\n|-------|---------------|\n| Service injected? | Register in module `providers` |\n| Repository used? | Implement or create a stub, register provider |\n| Module imported? | Add to parent module `imports` |\n| Guard added? | Register in module |\n\n## Vitest-specific: Mocks Hiding Bugs\n\n```typescript\n\u002F\u002F ❌ This test passes but hides a calculation bug\nconst repo = new InMemoryLeaseRepository([mockLease]);\n\n\u002F\u002F ✅ Use real domain objects to catch real problems\nconst lease = Lease.create(realLeaseData);\nconst receipt = Receipt.create(lease, period);\n```\n\n## NestJS-specific: Default Test Level\n\nWhether a unit earns a test at all is `craft:testing-principles`' call, not this table's. Once a test **is** earned, these are the NestJS defaults:\n\n| Code Created | Default level |\n|--------------|----------------|\n| Domain model | Unit test for business logic |\n| Controller | E2E test (`supertest`) for endpoint |\n| Repository | Integration test with database |\n| Use case | Unit test with in-memory port stubs |\n| The access rule a guard enforces | Wherever refusal is observable, usually E2E |\n\n## Vitest-specific: Commands\n\n```bash\n# All tests\npnpm test\n\n# Specific test file\npnpm vitest run src\u002Freceipt\u002Freceipt.service.spec.ts\n\n# Watch mode\npnpm vitest src\u002Freceipt\u002F\n\n# Filter by test name\npnpm vitest run -t \"prorated amount\"\n\n# Verbose for debugging\npnpm vitest run --reporter=verbose receipt\n```\n",{"name":5,"description":7},"main","479b264ec17cc5fafbf36287a1087472d3a386d3","plugins\u002Fvitest\u002Fskills\u002Fvitest-tdd-workflow",2,"https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace","https:\u002F\u002Fgithub.com\u002FFabienSalles","https:\u002F\u002Ffabiensalles.com","2026-10-13 04:33:22",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add FabienSalles\u002Fclaude-marketplace --skill vitest-tdd-workflow",{"tool":63,"command":64},"bunx","bunx skills add FabienSalles\u002Fclaude-marketplace --skill vitest-tdd-workflow",{"tool":66,"command":67},"pnpm","pnpm dlx skills add FabienSalles\u002Fclaude-marketplace --skill vitest-tdd-workflow","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvitest\u002Fskills\u002Fvitest-tdd-workflow\u002FSKILL.md",true,[71,77],{"path":72,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fsite-patterns\u002Fportal-a.example.test.md","REFERENCE","参考文档",88,"https:\u002F\u002Fgithub.com\u002FSanAntonio021\u002Fagents-skills\u002Fblob\u002Fmain\u002Fchat-notes\u002Fevals\u002Ffiles\u002Fexperience-placement\u002F100\u002Fskills\u002Fsample-integration\u002Freferences\u002Fsite-patterns\u002Fportal-a.example.test.md",{"path":78,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":75,"sourceHtmlUrl":79},"references\u002Fsite-patterns\u002Fportal-b.example.test.md","https:\u002F\u002Fgithub.com\u002FSanAntonio021\u002Fagents-skills\u002Fblob\u002Fmain\u002Fchat-notes\u002Fevals\u002Ffiles\u002Fexperience-placement\u002F100\u002Fskills\u002Fsample-integration\u002Freferences\u002Fsite-patterns\u002Fportal-b.example.test.md",[81,100,121,144,161,178],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":90,"publishedAt":44},"01M6DW2YS1MGF65JNS1QQ15QHS","vitest-test-conventions","ACTIVATE when writing Vitest tests, creating test files, using vi.fn()\u002Fvi.mock()\u002Fvi.spyOn(), or test factories. ACTIVATE for 'Vitest', 'it.each', 'NestJS testing module', 'supertest', 'vi.fn', 'vi.mock', 'spyOn'. Provides Vitest\u002FNestJS-specific testing patterns; cross-language testing principles (DAMP, AAA, spy over mock, what NOT to test) live in craft:testing-principles. DO NOT use for: node:test files (a file importing node:test) or a project whose tests run under node --test (see node-test:node-test-conventions), TDD workflow\u002Fiterations (see vitest:vitest-tdd-workflow), PHP\u002FPHPUnit tests (see phpunit:php-test-conventions).","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvitest\u002Fskills\u002Fvitest-test-conventions\u002FSKILL.md",[87],{"categoryNo":88,"categoryName":89,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",[91,26,92,93,94,43,24,28,29,95,33,35,96,36,37,39,40,97,98,99],"test","conventions","vitest test conventions","testing","testing patterns","nestjs","module","fn","testing principles",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":44},"01M6DW2RGMQE10D8C5Z5MA2RMY","ts-refactoring","ACTIVATE when refactoring TypeScript code. ACTIVATE for 'refactor', 'extract', 'redesign', 'simplify', or 'clean up' in a TypeScript \u002F Node \u002F NestJS context. This skill provides TS-specific examples for the cross-language refactoring rules defined in craft:refactoring-principles. DO NOT use for: writing new features from scratch, general OOP patterns (see ts-oop).","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Fts-refactoring\u002FSKILL.md",[],[107,108,43,109,110,30,111,112,113,114,115,33,116,117,118,96,119,36,37,120],"refactoring","ts refactoring","typescript","code","refactor","simplify","Rules","node","redesign","up","general","clean","craft","patterns",{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":128,"publishedAt":44},"01M6DW2MHYXNBBVYEGB058Y48J","ts-ports-adapters","ACTIVATE when a TypeScript codebase with no dependency-injection container has to declare a port and wire its adapter — a repository, a clock, an id generator, an event dispatcher the domain depends on. ACTIVATE for 'port', 'adapter', 'SPI', 'dependency inversion' or 'composition root' in a codebase that wires its dependencies by hand. Covers: the port as a type of functions in the domain layer, the adapter as an object literal annotated with it, the handler that takes its dependencies first and its data second, the composition root in the infrastructure layer, and the in-memory stub that substitutes for the adapter in a unit test. DO NOT use for: NestJS, or any container-based DI with decorators and tokens (see nest-ddd-conventions), aggregate operations and smart constructors (see ddd-ts-fp), the Result type itself (see ts-functional).","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Fts-ports-adapters\u002FSKILL.md",[127],{"categoryNo":88,"categoryName":89,"taxonomyType":21,"taxonomyTypeDesc":22},[129,130,131,91,132,133,33,134,135,96,136,36,37,137,138,139,140,141,142,143],"ports","ts ports adapters","memory","ddd","Composition","container","functions","Literal","dependency-injection","domain","tokens","as","type","id","adapter",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":44},"01M6DW2GRXZFYT05HEDB26C9B8","ts-oop","ACTIVATE when designing TypeScript classes, and the value objects or collections modelled as classes, or when the user asks about object design, encapsulation, Tell Don't Ask, or Symbol.iterator. Provides TS-specific examples for the cross-language OOP rules defined in craft:oop-principles, plus TS-specific patterns (Symbol.iterator, branded types for primitive identifiers). DO NOT use for: a value object or an aggregate modelled as an immutable record rather than a class (see ddd-ts-fp), refactoring methodology (see ts-refactoring).","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Fts-oop\u002FSKILL.md",[],[151,152,153,109,132,30,154,155,107,113,156,33,157,119,36,37,158,159,160,140],"oop","ts oop","design","methodology","immutable","ask","refactoring methodology","objects","record","collections",{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":44},"01M6DW2D26XG5MJMTP9MSE43S2","ts-layer-boundaries","ACTIVATE when wiring a Worker entry point, a Router, a controller, or a domain event consumer in a TypeScript CQRS codebase, or when deciding where a port belongs. ACTIVATE for 'composition root', 'layer boundary', 'ESLint zones', 'domain must not import infrastructure'. Covers: the *Worker.ts composition root, the curried consumer, Router wiring of command endpoints, the five-gesture controller, the domain-to-infrastructure import boundary enforced by ESLint, infrastructure-only ports, in-memory doubles for every port, the read-can-reach-write asymmetry, and read endpoints going through a domain handler. DO NOT use for: the port's own shape and adapter binding (see ts-ports-adapters), the Result type (see ts-functional), domain event structure (see ts-ddd-events).","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Fts-layer-boundaries\u002FSKILL.md",[],[168,131,132,169,170,133,129,33,171,172,173,36,37,174,138,175,176,141,143,177],"ts layer boundaries","controller","boundary","router","only","endpoints","structure","cqrs","worker","import",{"skillNo":179,"name":180,"nameZh":6,"description":181,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":182,"categories":183,"keywords":189,"publishedAt":44},"01M6DW29A825FAK3T1VGKTK3EM","ts-functional","ACTIVATE when writing functional-style TypeScript: pipe, compose, currying, Result types, railway-oriented programming, or AsyncResult. ACTIVATE for 'pipe', 'Result type', 'railway', 'functional', 'chain'. Covers: type-safe pipe implementation, currying patterns, generic Result type, railway-oriented error handling, AsyncResult for async pipelines. DO NOT use for: DDD aggregate modeling (see ddd-ts-fp), OOP patterns (see ts-oop), imperative code.","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Fts-functional\u002FSKILL.md",[184],{"categoryNo":185,"categoryName":186,"taxonomyType":187,"taxonomyTypeDesc":188},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[190,43,191,109,110,192,132,193,33,194,195,196,36,37,120,197,198,141,199,200],"ts functional","safe","error handling","programming","compose","implementation","async","pipe","modeling","style","chain"]