[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DVNREB7GDFS1BHMRSDKCGZ":3,"skill-same:01M6DVNREB7GDFS1BHMRSDKCGZ":66},{"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":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M6DVNREB7GDFS1BHMRSDKCGZ","tdd-workflow-principles",null,"ACTIVATE when the user wants to build, implement, or develop any new feature, endpoint, or user story using TDD, test-first, or red-green-refactor methodology. ACTIVATE for '\u002Ffeature-tdd-dev', 'TDD', 'test first', 'red-green-refactor' alongside building something new. Covers cross-language TDD workflow: cross-layer iterations, happy-path first, working app at each GREEN, bug-fix-first-test, mocks-hide-bugs pitfall, interface design (deep modules), tests-survive-refactor heuristic, common rationalizations. Language-specific test runner commands and module wiring (PHPUnit, vitest, NestJS modules, Symfony container) live in phpunit:php-tdd-workflow \u002F vitest:vitest-tdd-workflow. DO NOT use for: splitting a spec or story into shippable slices, or judging whether a split is vertical or horizontal (see product:vertical-slice).","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\u002Fcraft\u002Fskills\u002Ftdd-workflow-principles\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"tdd","tdd workflow principles","tdd workflow","workflow","bug","design","app","live","commands","deep","green","runner","activate","product","red-green-refactor","modules","user story","fix","common","refactor","2026-11-10 10:12:30",false,"---\nname: tdd-workflow-principles\ndescription: \"ACTIVATE when the user wants to build, implement, or develop any new feature, endpoint, or user story using TDD, test-first, or red-green-refactor methodology. ACTIVATE for '\u002Ffeature-tdd-dev', 'TDD', 'test first', 'red-green-refactor' alongside building something new. Covers cross-language TDD workflow: cross-layer iterations, happy-path first, working app at each GREEN, bug-fix-first-test, mocks-hide-bugs pitfall, interface design (deep modules), tests-survive-refactor heuristic, common rationalizations. Language-specific test runner commands and module wiring (PHPUnit, vitest, NestJS modules, Symfony container) live in phpunit:php-tdd-workflow \u002F vitest:vitest-tdd-workflow. DO NOT use for: splitting a spec or story into shippable slices, or judging whether a split is vertical or horizontal (see product:vertical-slice).\"\n---\n\n# TDD Workflow — Cross-Language Principles\n\n> The **process** below is language-agnostic. Test-runner commands and framework specifics (PHPUnit with Symfony container, vitest with NestJS modules, etc.) live in:\n> - `phpunit:php-tdd-workflow`\n> - `vitest:vitest-tdd-workflow`\n> - `node-test:node-test-conventions` (a file importing `node:test`, or a package whose test script runs `node --test`)\n\n> For test-writing conventions (DAMP, AAA, spy vs mock, factories), see `testing-principles`.\n\n## Core Principle: Cross-Layer Iterations\n\nThe key difference from textbook TDD: each iteration cuts **across all layers** (Controller \u002F Domain \u002F Repository \u002F SPI \u002F UI), not one layer at a time.\n\n```\nIteration 1: Controller stub + first Domain behavior\n     ↓\nIteration 2: Domain logic + Repository\u002FSPI interface\n     ↓\nIteration 3: Back to Controller → complete happy path\n     ↓\nIteration 4: Edge case handling\n     ↓\n… continue until feature complete\n```\n\n**Pattern:** happy path first (Controller → Domain → SPI → back to Controller), then edge cases.\n\n### Anti-Pattern: Horizontal Slicing\n\nWriting all tests up front, then all implementation, is **horizontal slicing**. It produces brittle tests because:\n\n- Bulk-written tests verify **imagined** behavior, not real behavior — you haven't written the code yet, so you don't know what actually matters.\n- Tests end up checking the **shape** of things (signatures, data structures) instead of user-facing behavior.\n- You commit to a test structure before learning from the implementation.\n\n**Correct approach: vertical slices.** One test → one minimal implementation → next test. Each cycle informs the next.\n\n## Interface Design During TDD\n\nTDD only forces good interfaces if you let it. Before each iteration, ask:\n\n> **What is the smallest public surface that would let me write this test?**\n\nApply the **deep modules** principle (Ousterhout, _A Philosophy of Software Design_): small interface, deep implementation. A method with 1-2 parameters that does meaningful work is deeper than a method with 5 optional parameters that does the same thing.\n\n### Signals That Your Interface Is Too Wide\n\n- You need to mock 3+ internal collaborators to test one behavior → the unit under test is leaking implementation through its dependencies.\n- The test setup has more lines than the assertion → the API forces too much ceremony.\n- An options bag (`{maxRetries, backoff, onRetry, logger, …}`) grew because each new test needed a new knob → the interface is being pulled out of shape by its callers.\n\nWhen you spot these, pause the RED phase, redesign the interface (often: collapse parameters into a domain object, push a decision behind a private method, replace a flag with two methods), then re-write the test against the cleaner surface.\n\n> Testing through the public interface forces a good interface — but it's an **effect**, not an automatic outcome. The designer consciously decides the surface.\n\nSee also: `craft:oop-principles` (Tell-Don't-Ask, encapsulation), `craft:ddd-principles` (aggregates as natural deep modules).\n\n## Red — Green — Refactor\n\nEach iteration follows the strict cycle:\n\n1. **RED** — write **one** failing test for the next behavior.\n2. **RUN** — execute the test, confirm it FAILS.\n3. **GREEN** — write the **minimum** code to make the test pass.\n4. **RUN** — execute the test, confirm it PASSES.\n5. **REFACTOR** — clean up production AND test code if needed.\n6. **RUN** the suite — confirm everything still passes.\n\n**Never assume a test passes without running it.**\n\n## Working Application at Each Iteration\n\nAt the end of each GREEN, the app **must work** in dev and prod. The most common mistake: tests pass but the app is broken.\n\n### End-of-Iteration GREEN Checklist\n\n| Check | Action |\n|---|---|\n| Template \u002F view referenced? | Create the file (even empty) |\n| Service injected? | Register in DI container \u002F module |\n| Repository used? | Implement or stub it |\n| Module imported? | Add to parent module |\n| Guard \u002F middleware added? | Register in module \u002F pipeline |\n| Route added? | Verify routing (`debug:router` \u002F equivalent) |\n\n## Refactor Phase — Check Both Code AND Tests\n\nAfter each GREEN, look for duplication in **both** production code and tests.\n\n- **Same test structure, different data?** → parameterize (data provider \u002F `it.each`).\n- **Duplicated fixture setup?** → factory method\u002Ffunction.\n- **Production duplication?** → extract function\u002Fclass.\n\nDo NOT parameterize when assertions differ or setup is specific.\n\n**Merge only the same rule — never different rules that happen to share a shape.** Two tests with the same Arrange\u002FAct where only the data differs are the same rule at two data points (a date before vs after a threshold, a percentage above vs below a cutoff) — merge them. Two tests that hit the same code path but assert **different business rules** (field A is required vs field B is required) are not duplicates just because their structure looks similar — merging them behind a shared \"state\" object trades one assertion-per-concern for an omnibus test that fails without saying which rule broke.\n\n**Criterion:** \"is this the same rule tested on different inputs, or two rules that happen to produce a similarly-shaped test?\" Only the first merges. When in doubt, keep them separate — an unmerged duplicate costs a few lines; a wrongly-merged test hides which rule regressed.\n\n## Bug-Fix Workflow\n\nWhen something is broken, follow this order **before any code change**:\n\n1. **Find existing tests** — does a test exist? Why does it pass if the behavior is broken? Are mocks hiding the real problem?\n2. **Write a failing test** that reproduces the bug with **REAL** dependencies (not mocks).\n3. **Run it** — verify it FAILS.\n4. **Fix the implementation** — the failing test guides the solution.\n5. **Run it** — verify it PASSES.\n\n### Mocks Hide Real Issues\n\n```\n\u002F\u002F Mock pattern — always passes regardless of real bug\nservice.method('x').willReturn(expectedResponse)\n\n\u002F\u002F Real pattern — exposes the bug\nrealService = createServiceWithRealDeps()\nresult = realService.method('x')  \u002F\u002F fails when real impl is broken\n```\n\n## Which Level a Test Belongs To\n\nWhether a unit earns a test at all is `testing-principles`' call, not this table's: §2 lists what is not worth testing and §3 is the checklist that has to answer yes three times. Once a test **is** earned, §14 picks the level where its intent reads best — this table is the default starting point:\n\n| Created | Default level |\n|---|---|\n| Domain model \u002F specification \u002F use case | Unit test |\n| Controller \u002F endpoint | Functional \u002F E2E test |\n| Repository \u002F adapter | Integration test |\n| Serialization carrying its own mapping or format rules | Serialization test — the plain data holder underneath earns none |\n| The access rule a guard or middleware enforces | Wherever refusal is observable, usually functional |\n\n## Anti-Patterns\n\n- ❌ Completing one layer entirely before starting the next.\n- ❌ Writing all tests before any implementation (**horizontal slicing**).\n- ❌ Using Integration when Unit suffices (no container needed).\n- ❌ Writing implementation before the failing test.\n- ❌ Skipping back to the entry point — always return to API regularly.\n- ❌ Not running tests after each phase.\n- ❌ Incomplete stubs that break the app at runtime.\n- ❌ Skipping the test for code that earned one under `testing-principles` §3.\n\n### Warning Sign: Tests That Don't Survive Refactor\n\n> **If you rename an internal function\u002Fmethod (without changing its behavior) and a test breaks, that test was checking the implementation, not the behavior.**\n\nRewrite it in terms of the public API before continuing. A test should only break when an observable behavior changes.\n\nConcrete examples:\n\n- You extract a private `calculateTaxFromGross()` from a public `submit()` → if `submit_appliesTax` breaks, it was coupled to the old internal layout.\n- You replace an internal `Collection\u003COrder>` with an `OrderBook` → if a test asserts on the internal type\u002Fstructure instead of the business outcome, it breaks for no good reason.\n- You move logic from a `Controller` to a `UseCase` → a functional test exercising the route should **not** break (same HTTP behavior).\n\n## Common Rationalizations\n\nWhen you catch yourself saying one of these, treat it as a signal — not an excuse:\n\n| Excuse | Reality |\n|---|---|\n| \"Too simple to deserve a test\" | Simple code breaks too. The test takes 30 seconds; the prod bug costs an hour. |\n| \"I'll test after, I'm just coding quickly right now\" | Tests written after pass immediately. Passing immediately proves nothing — they may verify wrong behavior, implementation, or miss requirements. |\n| \"I already tested it manually\" | Manual = ad-hoc, no trace, not replayable at the next refactor. Automated tests run the same way every time. |\n| \"Deleting X hours of code would be wasteful\" | Sunk cost fallacy. Keeping code whose test you never saw fail is technical debt. Rewriting test-first takes X hours; picking up the bug three months later takes X × 5. |\n| \"I keep the code as reference and write the test after\" | You'll adapt it instead of rediscovering the design. That's tests-after in disguise. Delete means delete. |\n| \"It's an exception, I know what I'm doing\" | All exceptions look the same. If it happens twice, it's the rule, not the exception. |\n| \"The spec is clear, no need for RED\" | RED isn't there to clarify the need; it's there to prove the test will catch a regression. Skipping RED means the test may pass by accident. |\n\n**If you catch yourself coding before the failing test → delete the code and start over test-first. No adaptation, no \"reference\".**\n\n## Quick Reference\n\n| Phase | Verify |\n|---|---|\n| RED | Test fails for the right reason |\n| GREEN | Test passes AND the app starts\u002Fruns |\n| REFACTOR | Suite still passes, no new duplication |\n| End of iteration | App works in dev and prod |\n","# TDD Workflow — Cross-Language Principles\n\n> The **process** below is language-agnostic. Test-runner commands and framework specifics (PHPUnit with Symfony container, vitest with NestJS modules, etc.) live in:\n> - `phpunit:php-tdd-workflow`\n> - `vitest:vitest-tdd-workflow`\n> - `node-test:node-test-conventions` (a file importing `node:test`, or a package whose test script runs `node --test`)\n\n> For test-writing conventions (DAMP, AAA, spy vs mock, factories), see `testing-principles`.\n\n## Core Principle: Cross-Layer Iterations\n\nThe key difference from textbook TDD: each iteration cuts **across all layers** (Controller \u002F Domain \u002F Repository \u002F SPI \u002F UI), not one layer at a time.\n\n```\nIteration 1: Controller stub + first Domain behavior\n     ↓\nIteration 2: Domain logic + Repository\u002FSPI interface\n     ↓\nIteration 3: Back to Controller → complete happy path\n     ↓\nIteration 4: Edge case handling\n     ↓\n… continue until feature complete\n```\n\n**Pattern:** happy path first (Controller → Domain → SPI → back to Controller), then edge cases.\n\n### Anti-Pattern: Horizontal Slicing\n\nWriting all tests up front, then all implementation, is **horizontal slicing**. It produces brittle tests because:\n\n- Bulk-written tests verify **imagined** behavior, not real behavior — you haven't written the code yet, so you don't know what actually matters.\n- Tests end up checking the **shape** of things (signatures, data structures) instead of user-facing behavior.\n- You commit to a test structure before learning from the implementation.\n\n**Correct approach: vertical slices.** One test → one minimal implementation → next test. Each cycle informs the next.\n\n## Interface Design During TDD\n\nTDD only forces good interfaces if you let it. Before each iteration, ask:\n\n> **What is the smallest public surface that would let me write this test?**\n\nApply the **deep modules** principle (Ousterhout, _A Philosophy of Software Design_): small interface, deep implementation. A method with 1-2 parameters that does meaningful work is deeper than a method with 5 optional parameters that does the same thing.\n\n### Signals That Your Interface Is Too Wide\n\n- You need to mock 3+ internal collaborators to test one behavior → the unit under test is leaking implementation through its dependencies.\n- The test setup has more lines than the assertion → the API forces too much ceremony.\n- An options bag (`{maxRetries, backoff, onRetry, logger, …}`) grew because each new test needed a new knob → the interface is being pulled out of shape by its callers.\n\nWhen you spot these, pause the RED phase, redesign the interface (often: collapse parameters into a domain object, push a decision behind a private method, replace a flag with two methods), then re-write the test against the cleaner surface.\n\n> Testing through the public interface forces a good interface — but it's an **effect**, not an automatic outcome. The designer consciously decides the surface.\n\nSee also: `craft:oop-principles` (Tell-Don't-Ask, encapsulation), `craft:ddd-principles` (aggregates as natural deep modules).\n\n## Red — Green — Refactor\n\nEach iteration follows the strict cycle:\n\n1. **RED** — write **one** failing test for the next behavior.\n2. **RUN** — execute the test, confirm it FAILS.\n3. **GREEN** — write the **minimum** code to make the test pass.\n4. **RUN** — execute the test, confirm it PASSES.\n5. **REFACTOR** — clean up production AND test code if needed.\n6. **RUN** the suite — confirm everything still passes.\n\n**Never assume a test passes without running it.**\n\n## Working Application at Each Iteration\n\nAt the end of each GREEN, the app **must work** in dev and prod. The most common mistake: tests pass but the app is broken.\n\n### End-of-Iteration GREEN Checklist\n\n| Check | Action |\n|---|---|\n| Template \u002F view referenced? | Create the file (even empty) |\n| Service injected? | Register in DI container \u002F module |\n| Repository used? | Implement or stub it |\n| Module imported? | Add to parent module |\n| Guard \u002F middleware added? | Register in module \u002F pipeline |\n| Route added? | Verify routing (`debug:router` \u002F equivalent) |\n\n## Refactor Phase — Check Both Code AND Tests\n\nAfter each GREEN, look for duplication in **both** production code and tests.\n\n- **Same test structure, different data?** → parameterize (data provider \u002F `it.each`).\n- **Duplicated fixture setup?** → factory method\u002Ffunction.\n- **Production duplication?** → extract function\u002Fclass.\n\nDo NOT parameterize when assertions differ or setup is specific.\n\n**Merge only the same rule — never different rules that happen to share a shape.** Two tests with the same Arrange\u002FAct where only the data differs are the same rule at two data points (a date before vs after a threshold, a percentage above vs below a cutoff) — merge them. Two tests that hit the same code path but assert **different business rules** (field A is required vs field B is required) are not duplicates just because their structure looks similar — merging them behind a shared \"state\" object trades one assertion-per-concern for an omnibus test that fails without saying which rule broke.\n\n**Criterion:** \"is this the same rule tested on different inputs, or two rules that happen to produce a similarly-shaped test?\" Only the first merges. When in doubt, keep them separate — an unmerged duplicate costs a few lines; a wrongly-merged test hides which rule regressed.\n\n## Bug-Fix Workflow\n\nWhen something is broken, follow this order **before any code change**:\n\n1. **Find existing tests** — does a test exist? Why does it pass if the behavior is broken? Are mocks hiding the real problem?\n2. **Write a failing test** that reproduces the bug with **REAL** dependencies (not mocks).\n3. **Run it** — verify it FAILS.\n4. **Fix the implementation** — the failing test guides the solution.\n5. **Run it** — verify it PASSES.\n\n### Mocks Hide Real Issues\n\n```\n\u002F\u002F Mock pattern — always passes regardless of real bug\nservice.method('x').willReturn(expectedResponse)\n\n\u002F\u002F Real pattern — exposes the bug\nrealService = createServiceWithRealDeps()\nresult = realService.method('x')  \u002F\u002F fails when real impl is broken\n```\n\n## Which Level a Test Belongs To\n\nWhether a unit earns a test at all is `testing-principles`' call, not this table's: §2 lists what is not worth testing and §3 is the checklist that has to answer yes three times. Once a test **is** earned, §14 picks the level where its intent reads best — this table is the default starting point:\n\n| Created | Default level |\n|---|---|\n| Domain model \u002F specification \u002F use case | Unit test |\n| Controller \u002F endpoint | Functional \u002F E2E test |\n| Repository \u002F adapter | Integration test |\n| Serialization carrying its own mapping or format rules | Serialization test — the plain data holder underneath earns none |\n| The access rule a guard or middleware enforces | Wherever refusal is observable, usually functional |\n\n## Anti-Patterns\n\n- ❌ Completing one layer entirely before starting the next.\n- ❌ Writing all tests before any implementation (**horizontal slicing**).\n- ❌ Using Integration when Unit suffices (no container needed).\n- ❌ Writing implementation before the failing test.\n- ❌ Skipping back to the entry point — always return to API regularly.\n- ❌ Not running tests after each phase.\n- ❌ Incomplete stubs that break the app at runtime.\n- ❌ Skipping the test for code that earned one under `testing-principles` §3.\n\n### Warning Sign: Tests That Don't Survive Refactor\n\n> **If you rename an internal function\u002Fmethod (without changing its behavior) and a test breaks, that test was checking the implementation, not the behavior.**\n\nRewrite it in terms of the public API before continuing. A test should only break when an observable behavior changes.\n\nConcrete examples:\n\n- You extract a private `calculateTaxFromGross()` from a public `submit()` → if `submit_appliesTax` breaks, it was coupled to the old internal layout.\n- You replace an internal `Collection\u003COrder>` with an `OrderBook` → if a test asserts on the internal type\u002Fstructure instead of the business outcome, it breaks for no good reason.\n- You move logic from a `Controller` to a `UseCase` → a functional test exercising the route should **not** break (same HTTP behavior).\n\n## Common Rationalizations\n\nWhen you catch yourself saying one of these, treat it as a signal — not an excuse:\n\n| Excuse | Reality |\n|---|---|\n| \"Too simple to deserve a test\" | Simple code breaks too. The test takes 30 seconds; the prod bug costs an hour. |\n| \"I'll test after, I'm just coding quickly right now\" | Tests written after pass immediately. Passing immediately proves nothing — they may verify wrong behavior, implementation, or miss requirements. |\n| \"I already tested it manually\" | Manual = ad-hoc, no trace, not replayable at the next refactor. Automated tests run the same way every time. |\n| \"Deleting X hours of code would be wasteful\" | Sunk cost fallacy. Keeping code whose test you never saw fail is technical debt. Rewriting test-first takes X hours; picking up the bug three months later takes X × 5. |\n| \"I keep the code as reference and write the test after\" | You'll adapt it instead of rediscovering the design. That's tests-after in disguise. Delete means delete. |\n| \"It's an exception, I know what I'm doing\" | All exceptions look the same. If it happens twice, it's the rule, not the exception. |\n| \"The spec is clear, no need for RED\" | RED isn't there to clarify the need; it's there to prove the test will catch a regression. Skipping RED means the test may pass by accident. |\n\n**If you catch yourself coding before the failing test → delete the code and start over test-first. No adaptation, no \"reference\".**\n\n## Quick Reference\n\n| Phase | Verify |\n|---|---|\n| RED | Test fails for the right reason |\n| GREEN | Test passes AND the app starts\u002Fruns |\n| REFACTOR | Suite still passes, no new duplication |\n| End of iteration | App works in dev and prod |\n",{"name":5,"description":7},"main","479b264ec17cc5fafbf36287a1087472d3a386d3","plugins\u002Fcraft\u002Fskills\u002Ftdd-workflow-principles",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":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add FabienSalles\u002Fclaude-marketplace --skill tdd-workflow-principles",{"tool":58,"command":59},"bunx","bunx skills add FabienSalles\u002Fclaude-marketplace --skill tdd-workflow-principles",{"tool":61,"command":62},"pnpm","pnpm dlx skills add FabienSalles\u002Fclaude-marketplace --skill tdd-workflow-principles","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fcraft\u002Fskills\u002Ftdd-workflow-principles\u002FSKILL.md",true,[],[67,91,102,122,144,160],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":39},"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",[],[74,75,76,77,78,79,19,22,80,81,82,83,84,31,85,86,87,88,89,90],"test","vitest","conventions","vitest test conventions","testing","writing","file","testing patterns","use","files","nestjs","do","project","tests","module","fn","testing principles",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":39},"01M6DW2VFE6NPFCGQKQ68P1MVZ","vitest-tdd-workflow","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).","https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fvitest\u002Fskills\u002Fvitest-tdd-workflow\u002FSKILL.md",[],[19,22,21,75,98,79,99,80,100,36,82,33,83,31,85,29,86,87,101,25],"vitest tdd workflow","dev","examples","feature",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":39},"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",[],[109,110,79,111,112,100,38,113,114,115,116,82,117,118,119,84,120,31,85,121],"refactoring","ts refactoring","typescript","code","simplify","Rules","node","redesign","up","general","clean","craft","patterns",{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":39},"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",[],[129,130,131,74,132,133,82,134,135,84,136,31,85,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":39},"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,24,111,132,100,153,154,109,114,155,82,156,120,31,85,157,158,159,140],"oop","ts oop","methodology","immutable","ask","refactoring methodology","objects","record","collections",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":166,"publishedAt":39},"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",[],[167,131,132,168,169,133,129,82,170,171,172,31,85,173,138,174,175,141,143,176],"ts layer boundaries","controller","boundary","router","only","endpoints","structure","cqrs","worker","import"]