[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DVYBRBGN0QPRXASRC0VQXG":3,"skill-same:01M6DVYBRBGN0QPRXASRC0VQXG":86},{"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},"01M6DVYBRBGN0QPRXASRC0VQXG","php-test-conventions",null,"ACTIVATE when writing or modifying PHPUnit tests, creating test classes, using Prophecy, test doubles, test factories, or data providers. ACTIVATE for 'test naming', 'test doubles', 'spy vs mock', 'serialization tests', 'deserialization tests', 'data provider', 'MockHandler' in PHP. Provides framework-agnostic PHPUnit\u002FProphecy patterns; cross-language testing principles (DAMP, AAA, spy over mock, what NOT to test, factories) live in craft:testing-principles. DO NOT use for: tests that boot Symfony — WebTestCase, KernelTestCase, TypeTestCase, crawler assertions, container doubles (see symfony:symfony-test-conventions), TDD workflow\u002Fiteration process (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\u002Fphpunit\u002Fskills\u002Fphp-test-conventions\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"php test conventions","test","conventions","php","container","testing principles","tests","iteration","do","activate","craft","provider","testing","use","process","deserialization","boot","workflow","tdd","writing","2026-11-10 10:12:30",false,"---\nname: php-test-conventions\ndescription: \"ACTIVATE when writing or modifying PHPUnit tests, creating test classes, using Prophecy, test doubles, test factories, or data providers. ACTIVATE for 'test naming', 'test doubles', 'spy vs mock', 'serialization tests', 'deserialization tests', 'data provider', 'MockHandler' in PHP. Provides framework-agnostic PHPUnit\u002FProphecy patterns; cross-language testing principles (DAMP, AAA, spy over mock, what NOT to test, factories) live in craft:testing-principles. DO NOT use for: tests that boot Symfony — WebTestCase, KernelTestCase, TypeTestCase, crawler assertions, container doubles (see symfony:symfony-test-conventions), TDD workflow\u002Fiteration process (see phpunit:php-tdd-workflow).\"\n---\n\n# Test Conventions — PHP\n\n> The **cross-language testing principles** (DAMP, AAA, spy over mock, what NOT to test, factories, structured assertions) are defined in `craft:testing-principles`. This skill keeps the PHPUnit\u002FProphecy patterns that hold in any PHP project, framework or not.\n\n> **Anything that boots Symfony** — `WebTestCase` \u002F `KernelTestCase` \u002F `TypeTestCase`, crawler and built-in HTTP assertions, FormType tests, container doubles — lives in `symfony:symfony-test-conventions`. Load both when the test needs a kernel.\n\n> For TDD workflow \u002F iteration process, see `php-tdd-workflow`.\n\n## PHP-specific: Exception Test Naming\n\nWhen a test verifies an exception, the test method name **must include the exception class name**:\n\n```php\n\u002F\u002F ❌ Avoid\npublic function itThrowsWhenBirthDateIsMissing(): void\n\n\u002F\u002F ✅ Correct\npublic function itThrowsMissingBuyerBirthDateWhenBirthDateIsMissing(): void\n```\n\nPattern: `itThrows{ExceptionClassName}When{Condition}`\n\n## PHP-specific: Test Method Naming\n\nCheck the project's convention:\n\n```php\n\u002F** @test *\u002F\npublic function buyerWith100PercentProfileIsEligible(): void   \u002F\u002F @test annotation\n\npublic function testBuyerWith100PercentProfileIsEligible(): void \u002F\u002F test prefix\n```\n\n## PHP-specific: Spy Pattern (Prophecy)\n\n```php\n\u002F\u002F ❌ Mock pattern (expectations before act — violates AAA)\n$service->method('call')->with($arg)->shouldBeCalled();\n$sut->execute();\n\n\u002F\u002F ✅ Spy pattern (verification after act)\n$sut->execute();\n$service->call($arg)->shouldHaveBeenCalled();\n```\n\n## PHP-specific: Test Doubles\n\nPrefer an existing real \u002F null implementation when it reads cleaner (an unverified logger → `new NullLogger()`, not a mocked interface). Otherwise: **manual stubs** for simple cases, **Prophecy** for complex dependencies, **Guzzle MockHandler** for HTTP clients.\n\n**Prophecy is the rule, not a statistic.** A double that needs scripting or verification is\n`prophesize()` — not `createMock()` + `willReturnCallback()`. Never arbitrate by counting\nexisting usages in the repo (\"15 files use createMock\"): a convention is a rule, not a\nmajority vote. `createMock` survives only where Prophecy technically cannot (final class\nwithout an interface).\n\n> For the full hierarchy and examples, see [references\u002Ftest-doubles.md](references\u002Ftest-doubles.md).\n\n## PHP-specific: Data Providers (PHPUnit syntax)\n\n```php\n\u002F**\n * @dataProvider provideProfileAndExpectedEligibility\n *\u002F\npublic function isSatisfiedByDependingOnProfile(\n    int $profilePercentage,\n    bool $expectedEligibility,\n): void {\n    $specification = new IsBuyerEligibleForDiscount();\n    $buyer = $this->createBuyerWithProfile($profilePercentage);\n\n    self::assertSame($expectedEligibility, $specification->isSatisfiedBy($buyer));\n}\n\npublic static function provideProfileAndExpectedEligibility(): \\Generator\n{\n    yield '0% - not eligible' => [\n        'profilePercentage' => 0,\n        'expectedEligibility' => false,\n    ];\n\n    yield '100% - eligible' => [\n        'profilePercentage' => 100,\n        'expectedEligibility' => true,\n    ];\n}\n```\n\n## PHP-specific: Providers That Decline a Contract Enum\n\nWhen the datasets enumerate an enum's cases, **derive them from `::cases()`** — a hardcoded\nlist breaks at the first new case and buries which one is excluded:\n\n```php\n$everySource = SwisslifeFundSourceOption::cases();\n$everySourceButTheEmploymentIncome = [];\n\nforeach ($everySource as $source) {\n    if ($source === SwisslifeFundSourceOption::EmploymentIncome) {\n        continue;\n    }\n\n    $everySourceButTheEmploymentIncome[] = $source;\n}\n```\n\nAssert with `assertSame` on **lists of the same enum** — map the SUT's output back with\n`::from()` — never `in_array` on strings plus an arithmetic `assertCount`: only compared\nlists show exactly which case went missing.\n\n## PHP-specific: SUT Naming\n\nUse meaningful names when clear, `$sut` when generic:\n\n```php\n$specification = new IsBuyerEligibleForDiscount();  \u002F\u002F ✅ Clear\n$sut = new IsBuyerEligibleForDiscount();            \u002F\u002F ✅ Also acceptable\n```\n\n## PHP-specific: Factory Methods\n\nHelper methods in the test class. When duplicated across tests, extract to a dedicated Factory class:\n\n```php\nprivate function createBuyerWithProfile(int $percentage): Buyer\n{\n    $profileCompletion = ProfileCompletionFactory::createAtPercentage($percentage);\n    $profile = new Profile();\n    $profile->setProfileCompletion($profileCompletion);\n    $buyer = new Buyer();\n    $buyer->setProfile($profile);\n\n    return $buyer;\n}\n```\n\n## PHP-specific: Assertion Patterns\n\nUse `assertEquals` with a complete expected object rather than multiple property assertions. For advanced patterns (computed properties, guard assertions), see [references\u002Fassertion-patterns.md](references\u002Fassertion-patterns.md).\n\n## PHP-specific: HTTP Client Testing\n\nWhen testing API clients, always use a **real serializer** to catch deserialization issues. For detailed patterns and SerializerRegistry setup, see [references\u002Fhttp-testing.md](references\u002Fhttp-testing.md).\n\n## Quick Reference (PHP-specific)\n\n| Situation | Approach |\n|-----------|----------|\n| Simple value objects | Manual stubs |\n| Complex dependencies | Prophecy — see [references\u002Ftest-doubles.md](references\u002Ftest-doubles.md) |\n| HTTP client testing | Guzzle MockHandler — see [references\u002Fhttp-testing.md](references\u002Fhttp-testing.md) |\n| Verify method called (Prophecy) | `$dep->method($args)->shouldHaveBeenCalled()` |\n| Double needing scripting\u002Fverification | Prophecy (`prophesize`) — never `createMock`; never arbitrate by usage counts |\n| Provider over a contract enum | Derive datasets from `::cases()` with a named exclusion; `assertSame` on enum lists |\n| Anything needing a Symfony kernel | `symfony:symfony-test-conventions` — `WebTestCase` \u002F `KernelTestCase` \u002F `TypeTestCase`, crawler, container doubles |\n| Advanced assertions | See [references\u002Fassertion-patterns.md](references\u002Fassertion-patterns.md) |\n| Exception test naming | `itThrows{ExceptionClassName}When{Condition}` |\n","# Test Conventions — PHP\n\n> The **cross-language testing principles** (DAMP, AAA, spy over mock, what NOT to test, factories, structured assertions) are defined in `craft:testing-principles`. This skill keeps the PHPUnit\u002FProphecy patterns that hold in any PHP project, framework or not.\n\n> **Anything that boots Symfony** — `WebTestCase` \u002F `KernelTestCase` \u002F `TypeTestCase`, crawler and built-in HTTP assertions, FormType tests, container doubles — lives in `symfony:symfony-test-conventions`. Load both when the test needs a kernel.\n\n> For TDD workflow \u002F iteration process, see `php-tdd-workflow`.\n\n## PHP-specific: Exception Test Naming\n\nWhen a test verifies an exception, the test method name **must include the exception class name**:\n\n```php\n\u002F\u002F ❌ Avoid\npublic function itThrowsWhenBirthDateIsMissing(): void\n\n\u002F\u002F ✅ Correct\npublic function itThrowsMissingBuyerBirthDateWhenBirthDateIsMissing(): void\n```\n\nPattern: `itThrows{ExceptionClassName}When{Condition}`\n\n## PHP-specific: Test Method Naming\n\nCheck the project's convention:\n\n```php\n\u002F** @test *\u002F\npublic function buyerWith100PercentProfileIsEligible(): void   \u002F\u002F @test annotation\n\npublic function testBuyerWith100PercentProfileIsEligible(): void \u002F\u002F test prefix\n```\n\n## PHP-specific: Spy Pattern (Prophecy)\n\n```php\n\u002F\u002F ❌ Mock pattern (expectations before act — violates AAA)\n$service->method('call')->with($arg)->shouldBeCalled();\n$sut->execute();\n\n\u002F\u002F ✅ Spy pattern (verification after act)\n$sut->execute();\n$service->call($arg)->shouldHaveBeenCalled();\n```\n\n## PHP-specific: Test Doubles\n\nPrefer an existing real \u002F null implementation when it reads cleaner (an unverified logger → `new NullLogger()`, not a mocked interface). Otherwise: **manual stubs** for simple cases, **Prophecy** for complex dependencies, **Guzzle MockHandler** for HTTP clients.\n\n**Prophecy is the rule, not a statistic.** A double that needs scripting or verification is\n`prophesize()` — not `createMock()` + `willReturnCallback()`. Never arbitrate by counting\nexisting usages in the repo (\"15 files use createMock\"): a convention is a rule, not a\nmajority vote. `createMock` survives only where Prophecy technically cannot (final class\nwithout an interface).\n\n> For the full hierarchy and examples, see [references\u002Ftest-doubles.md](references\u002Ftest-doubles.md).\n\n## PHP-specific: Data Providers (PHPUnit syntax)\n\n```php\n\u002F**\n * @dataProvider provideProfileAndExpectedEligibility\n *\u002F\npublic function isSatisfiedByDependingOnProfile(\n    int $profilePercentage,\n    bool $expectedEligibility,\n): void {\n    $specification = new IsBuyerEligibleForDiscount();\n    $buyer = $this->createBuyerWithProfile($profilePercentage);\n\n    self::assertSame($expectedEligibility, $specification->isSatisfiedBy($buyer));\n}\n\npublic static function provideProfileAndExpectedEligibility(): \\Generator\n{\n    yield '0% - not eligible' => [\n        'profilePercentage' => 0,\n        'expectedEligibility' => false,\n    ];\n\n    yield '100% - eligible' => [\n        'profilePercentage' => 100,\n        'expectedEligibility' => true,\n    ];\n}\n```\n\n## PHP-specific: Providers That Decline a Contract Enum\n\nWhen the datasets enumerate an enum's cases, **derive them from `::cases()`** — a hardcoded\nlist breaks at the first new case and buries which one is excluded:\n\n```php\n$everySource = SwisslifeFundSourceOption::cases();\n$everySourceButTheEmploymentIncome = [];\n\nforeach ($everySource as $source) {\n    if ($source === SwisslifeFundSourceOption::EmploymentIncome) {\n        continue;\n    }\n\n    $everySourceButTheEmploymentIncome[] = $source;\n}\n```\n\nAssert with `assertSame` on **lists of the same enum** — map the SUT's output back with\n`::from()` — never `in_array` on strings plus an arithmetic `assertCount`: only compared\nlists show exactly which case went missing.\n\n## PHP-specific: SUT Naming\n\nUse meaningful names when clear, `$sut` when generic:\n\n```php\n$specification = new IsBuyerEligibleForDiscount();  \u002F\u002F ✅ Clear\n$sut = new IsBuyerEligibleForDiscount();            \u002F\u002F ✅ Also acceptable\n```\n\n## PHP-specific: Factory Methods\n\nHelper methods in the test class. When duplicated across tests, extract to a dedicated Factory class:\n\n```php\nprivate function createBuyerWithProfile(int $percentage): Buyer\n{\n    $profileCompletion = ProfileCompletionFactory::createAtPercentage($percentage);\n    $profile = new Profile();\n    $profile->setProfileCompletion($profileCompletion);\n    $buyer = new Buyer();\n    $buyer->setProfile($profile);\n\n    return $buyer;\n}\n```\n\n## PHP-specific: Assertion Patterns\n\nUse `assertEquals` with a complete expected object rather than multiple property assertions. For advanced patterns (computed properties, guard assertions), see [references\u002Fassertion-patterns.md](references\u002Fassertion-patterns.md).\n\n## PHP-specific: HTTP Client Testing\n\nWhen testing API clients, always use a **real serializer** to catch deserialization issues. For detailed patterns and SerializerRegistry setup, see [references\u002Fhttp-testing.md](references\u002Fhttp-testing.md).\n\n## Quick Reference (PHP-specific)\n\n| Situation | Approach |\n|-----------|----------|\n| Simple value objects | Manual stubs |\n| Complex dependencies | Prophecy — see [references\u002Ftest-doubles.md](references\u002Ftest-doubles.md) |\n| HTTP client testing | Guzzle MockHandler — see [references\u002Fhttp-testing.md](references\u002Fhttp-testing.md) |\n| Verify method called (Prophecy) | `$dep->method($args)->shouldHaveBeenCalled()` |\n| Double needing scripting\u002Fverification | Prophecy (`prophesize`) — never `createMock`; never arbitrate by usage counts |\n| Provider over a contract enum | Derive datasets from `::cases()` with a named exclusion; `assertSame` on enum lists |\n| Anything needing a Symfony kernel | `symfony:symfony-test-conventions` — `WebTestCase` \u002F `KernelTestCase` \u002F `TypeTestCase`, crawler, container doubles |\n| Advanced assertions | See [references\u002Fassertion-patterns.md](references\u002Fassertion-patterns.md) |\n| Exception test naming | `itThrows{ExceptionClassName}When{Condition}` |\n",{"name":5,"description":7},"main","479b264ec17cc5fafbf36287a1087472d3a386d3","plugins\u002Fphpunit\u002Fskills\u002Fphp-test-conventions",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 php-test-conventions",{"tool":58,"command":59},"bunx","bunx skills add FabienSalles\u002Fclaude-marketplace --skill php-test-conventions",{"tool":61,"command":62},"pnpm","pnpm dlx skills add FabienSalles\u002Fclaude-marketplace --skill php-test-conventions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fphpunit\u002Fskills\u002Fphp-test-conventions\u002FSKILL.md",true,[66,72,78,82],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"methods.csv","ASSET","资产文件",9911,"https:\u002F\u002Fgithub.com\u002Fvladtara\u002Fhealthcabinet\u002Fblob\u002Fmaster\u002F.agents\u002Fskills\u002Fbmad-advanced-elicitation\u002Fmethods.csv",{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fassertion-patterns.md","REFERENCE","参考文档",3636,"https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fphpunit\u002Fskills\u002Fphp-test-conventions\u002Freferences\u002Fassertion-patterns.md",{"path":79,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Fhttp-testing.md",6010,"https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fphpunit\u002Fskills\u002Fphp-test-conventions\u002Freferences\u002Fhttp-testing.md",{"path":83,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Ftest-doubles.md",6853,"https:\u002F\u002Fgithub.com\u002FFabienSalles\u002Fclaude-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fphpunit\u002Fskills\u002Fphp-test-conventions\u002Freferences\u002Ftest-doubles.md",[87,103,119,139,160,177],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"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",[],[20,94,21,95,31,38,37,36,96,97,32,98,99,28,27,100,25,101,102,24],"vitest","vitest test conventions","file","testing patterns","files","nestjs","project","module","fn",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"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",[],[37,36,110,94,111,38,112,96,113,114,32,115,98,28,27,116,100,25,117,118],"tdd workflow","vitest tdd workflow","dev","examples","fix","red-green-refactor","green","feature","app",{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"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",[],[126,127,38,128,129,113,130,131,132,133,134,32,135,136,137,99,29,28,27,138],"refactoring","ts refactoring","typescript","code","refactor","simplify","Rules","node","redesign","up","general","clean","patterns",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"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",[],[146,147,148,20,149,150,32,23,151,99,152,28,27,153,154,155,156,157,158,159],"ports","ts ports adapters","memory","ddd","Composition","functions","Literal","dependency-injection","domain","tokens","as","type","id","adapter",{"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},"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",[],[167,168,169,128,149,113,170,171,126,132,172,32,173,29,28,27,174,175,176,156],"oop","ts oop","design","methodology","immutable","ask","refactoring methodology","objects","record","collections",{"skillNo":178,"name":179,"nameZh":6,"description":180,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":181,"categories":182,"keywords":183,"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",[],[184,148,149,185,186,150,146,32,187,188,189,28,27,190,154,191,192,157,159,193],"ts layer boundaries","controller","boundary","router","only","endpoints","structure","cqrs","worker","import"]