[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78714MAWJQJ25CS1MCQ2K92":3,"skill-same:01M78714MAWJQJ25CS1MCQ2K92":46},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":14,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M78714MAWJQJ25CS1MCQ2K92","php-testing",null,"Use ONLY when user explicitly requests PHP test code, PHPUnit\u002FPest configuration,\ntest failure diagnosis, or coverage improvement for PHP projects.\n\nTriggers: \"write test php\", \"phpunit\", \"pest php\", \"laravel test\",\n\"PHP coverage\", \"refresh database test\", \"data provider php\".\n\nDo NOT activate for: general PHP coding without test context, composer autoload\nissues, PHP framework setup, or non-test Laravel\u002FWordPress configuration.","chenziyang110\u002Flaunchdeck","chenziyang110","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43693913?v=4","01M7863EBWK1D0P6A29YGEMAS4","Robin11","01M7863ECM1VB6RXDMHTW90D2T",0,"MIT","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fphp-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: php-testing\ndescription: |\n  Use ONLY when user explicitly requests PHP test code, PHPUnit\u002FPest configuration,\n  test failure diagnosis, or coverage improvement for PHP projects.\n\n  Triggers: \"write test php\", \"phpunit\", \"pest php\", \"laravel test\",\n  \"PHP coverage\", \"refresh database test\", \"data provider php\".\n\n  Do NOT activate for: general PHP coding without test context, composer autoload\n  issues, PHP framework setup, or non-test Laravel\u002FWordPress configuration.\norigin: ECC\n---\n\n# PHP Testing (Agent Skill)\n\nAgent-focused testing workflow for modern PHP (8.2+) using PHPUnit, the industry-standard test framework for PHP with Mockito-style mocking.\n\n## When to Use\n\n- Writing new PHP tests or fixing existing tests\n- Designing unit\u002Fintegration test coverage for PHP components\n- Adding test coverage, CI gating, or regression protection\n- Configuring PHPUnit workflows for consistent execution\n- Investigating test failures or flaky behavior\n- Testing Laravel, Symfony, Slim, or library code\n\n### When NOT to Use\n\n- Implementing new product features without test changes\n- Large-scale refactors unrelated to test coverage or failures\n- Performance tuning without test regressions to validate\n- Non-PHP projects or non-test tasks\n\n### Stop Conditions — When to ASK instead of generating\n\nBefore generating any test code, STOP and ask the user if:\n- The code under test has **zero testability** (static method chains, hard-coded includes, global state in functions)\n- **No test framework** is detected (no phpunit.xml, no PHPUnit\u002FPest in composer.json)\n- The request is **ambiguous**: \"test my app\" or \"add tests\" without specifying files or classes\n- A **required test dependency** (phpunit, pest) is not installed via Composer\n- The test would require **secrets, real credentials, or production database access**\n\n## Core Concepts\n\n- **TDD loop**: red → green → refactor (tests first, minimal fix, then cleanups).\n- **Test layout**: `tests\u002F` directory mirroring `src\u002F` structure, `phpunit.xml` config.\n- **Naming**: `*Test.php` files with `test*` methods or `#[Test]` attribute.\n- **Mocks**: PHPUnit's built-in `createMock()` \u002F `getMockBuilder()` (Mockito-style).\n- **Data providers**: `@dataProvider` methods returning iterables of test cases.\n- **CI signal**: `vendor\u002Fbin\u002Fphpunit --display-warnings --log-junit junit.xml`.\n\n## Agent Execution Protocol\n\nWhen this skill is activated, follow this exact execution sequence:\n\n### Phase 1: Context Analysis\nBefore writing any test code:\n1. Identify the PHP version (8.2+) and framework (PHPUnit or Pest).\n2. Check for existing test files (`tests\u002F`) to infer naming conventions and style.\n3. Analyze the code under test: identify public API surface, side effects, database interactions, and Laravel\u002FSymfony context.\n4. Determine request type: (a) new tests, (b) fixing broken tests, (c) coverage improvement, (d) flaky test diagnosis.\n\n### Phase 2: Strategy Selection\nBased on Phase 1, select the appropriate strategy:\n- **Pure functions \u002F utilities**: unit tests only, no mocks. Use PHPUnit `TestCase` or Pest `it()`.\n- **External dependencies (DB, HTTP, filesystem)**: use PHPUnit mocks (`createMock`) or Laravel `Http::fake()` \u002F `Bus::fake()`; prefer in-memory SQLite for DB tests.\n- **Laravel applications**: use `RefreshDatabase` for feature tests, `DatabaseTransactions` for unit tests; use model factories for test data.\n- **Async code**: PHP is mostly synchronous; use `expectException` for error paths.\n\n### Decision Tree (Complex Scenarios)\n\n```text\nQ1: External I\u002FO (DB, HTTP, filesystem)?\n  → Yes → Q2\n  → No  → Pure unit test, no mocks needed\n\nQ2: Mockable (DI, service container, facade)?\n  → Yes → Mock at boundary (createMock, Http::fake(), Bus::fake())\n  → No  → Q3\n\nQ3: Needs real DB behavior?\n  → Yes → In-memory SQLite + RefreshDatabase \u002F DatabaseTransactions\n  → No  → Use simple stub\n\nQ4: Laravel feature test?\n  → Yes → RefreshDatabase + factory() + actingAs()\n  → No  → Q5\n\nQ5: Modern functional API preferred?\n  → Yes → Pest (it(), expect(), dataset())\n  → No  → PHPUnit TestCase\n```\n\n### Phase 3: Test Case Design\nApply systematic test design before coding:\n1. **Happy path**: normal input → expected output\u002Fresponse.\n2. **Boundary values**: empty arrays, `null`, empty strings, `0`, `PHP_INT_MAX`, empty models.\n3. **Error cases**: exceptions (`expectException`), validation errors (`assertSessionHasErrors`), 4xx\u002F5xx responses.\n4. **State & database**: transaction isolation, factory states, seeded data conflicts.\n\n### Phase 4: Code Generation\nOutput tests in this exact structure:\n```\n#### Test Strategy Summary\n- [ ] Scope: Unit \u002F Feature \u002F Integration\n- [ ] Framework: PHPUnit or Pest + Laravel Testing (if applicable)\n- [ ] Mocking: Yes\u002FNo — PHPUnit mocks \u002F Laravel fakes\n- [ ] Edge cases covered: \u003Clist>\n\n#### Generated Test Code\n\u003Cfile_path>\n\u003Ccode>\n\n#### Running Commands\n```bash\nvendor\u002Fbin\u002Fphpunit --filter testMethod tests\u002FClassTest.php\nvendor\u002Fbin\u002Fphpunit --testsuite Unit\n# Or with Pest:\n.\u002Fvendor\u002Fbin\u002Fpest\n```\n\n#### Coverage Impact (if applicable)\n- Estimated coverage change: \u003CX%>\n- Command to verify: `vendor\u002Fbin\u002Fphpunit --coverage-html coverage`\n```\n\n### Phase 5: Verification Checklist\nBefore completing, verify:\n- [ ] Tests run without parse errors (`vendor\u002Fbin\u002Fphpunit`).\n- [ ] Each test has exactly one logical assertion focus.\n- [ ] Global state is reset between tests (`setUp()` or `RefreshDatabase`).\n- [ ] No `sleep()` used for synchronization.\n- [ ] Flaky test guardrails applied (database transactions, deterministic factories, no real HTTP calls).\n\n## TDD Workflow\n\n```php\n\u002F\u002F tests\u002FMathTest.php\nfunction add(int $a, int $b): int { throw new \\Exception(); } \u002F\u002F stub\n\nfinal class MathTest extends TestCase {\n    public function testAddsTwoNumbers(): void { \u002F\u002F RED\n        self::assertSame(5, add(2, 3));\n    }\n}\n\n\u002F\u002F src\u002FMath.php\nfunction add(int $a, int $b): int { return $a + $b; } \u002F\u002F GREEN\n\n\u002F\u002F REFACTOR: simplify\u002Frename once tests pass\n```\n\n## Code Examples\n\n### Basic Unit Test\n\n```php\n\u002F\u002F tests\u002FCalculatorTest.php\nnamespace Tests;\n\nuse PHPUnit\\Framework\\TestCase;\n\nfinal class CalculatorTest extends TestCase\n{\n    public function testAddsTwoNumbers(): void\n    {\n        self::assertSame(5, Calculator::add(2, 3));\n    }\n\n    public function testHandlesNegativeNumbers(): void\n    {\n        self::assertSame(0, Calculator::add(-1, 1));\n    }\n}\n```\n\n### Setup \u002F Teardown\n\n```php\n\u002F\u002F tests\u002FUserStoreTest.php\nfinal class UserStoreTest extends TestCase\n{\n    private UserStore $store;\n\n    protected function setUp(): void\n    {\n        $this->store = new UserStore();\n        $this->store->seed([new User('alice'), new User('bob')]);\n    }\n\n    public function testFindsExistingUser(): void\n    {\n        $user = $this->store->find('alice');\n        self::assertNotNull($user);\n        self::assertSame('alice', $user->name);\n    }\n\n    protected function tearDown(): void\n    {\n        unset($this->store);\n    }\n}\n```\n\n### Mocking (PHPUnit)\n\n```php\n\u002F\u002F tests\u002FNotifierTest.php\nfinal class ServiceTest extends TestCase\n{\n    public function testSendsNotifications(): void\n    {\n        $notifier = $this->createMock(Notifier::class);\n        $notifier->expects($this->once())\n            ->method('send')\n            ->with('hello');\n\n        $service = new Service($notifier);\n        $service->publish('hello');\n    }\n}\n```\n\n### Stub (Return Values)\n\n```php\nfinal class PaymentTest extends TestCase\n{\n    public function testChargesCorrectAmount(): void\n    {\n        $gateway = $this->createMock(PaymentGateway::class);\n        $gateway->method('charge')\n            ->with(100.0)\n            ->willReturn(true);\n\n        $service = new PaymentService($gateway);\n        $result = $service->processOrder(100.0);\n\n        self::assertTrue($result);\n    }\n}\n```\n\n### Data Provider\n\n```php\nfinal class MathTest extends TestCase\n{\n    \u002F** @dataProvider additionProvider *\u002F\n    public function testAdd(int $a, int $b, int $expected): void\n    {\n        self::assertSame($expected, Math::add($a, $b));\n    }\n\n    public static function additionProvider(): array\n    {\n        return [\n            [1, 2, 3],\n            [-1, 1, 0],\n            [0, 0, 0],\n            [100, 200, 300],\n        ];\n    }\n}\n```\n\n### Exception Testing\n\n```php\nfinal class ValidationTest extends TestCase\n{\n    public function testThrowsOnNegativeAge(): void\n    {\n        $this->expectException(\\InvalidArgumentException::class);\n        $this->expectExceptionMessage('must be non-negative');\n\n        Validator::validateAge(-1);\n    }\n}\n```\n\n### Attribute-Based (PHPUnit 10+)\n\n```php\nuse PHPUnit\\Framework\\Attributes\\Test;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\n\n#[CoversClass(Calculator::class)]\nfinal class CalculatorTest extends TestCase\n{\n    #[Test]\n    #[DataProvider('additionProvider')]\n    public function add(int $a, int $b, int $expected): void\n    {\n        self::assertSame($expected, Calculator::add($a, $b));\n    }\n}\n```\n\n## Installation\n\n```bash\ncomposer require --dev phpunit\u002Fphpunit:^11\n```\n\n## PHPUnit Configuration\n\n```xml\n\u003C!-- phpunit.xml -->\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003Cphpunit\n    xmlns:xsi=\"http:\u002F\u002Fwww.w3.org\u002F2001\u002FXMLSchema-instance\"\n    xsi:noNamespaceSchemaLocation=\"vendor\u002Fphpunit\u002Fphpunit\u002Fphpunit.xsd\"\n    bootstrap=\"vendor\u002Fautoload.php\"\n    colors=\"true\"\n    cacheDirectory=\".phpunit.cache\"\n>\n    \u003Ctestsuites>\n        \u003Ctestsuite name=\"Unit\">\n            \u003Cdirectory>tests\u002FUnit\u003C\u002Fdirectory>\n        \u003C\u002Ftestsuite>\n        \u003Ctestsuite name=\"Feature\">\n            \u003Cdirectory>tests\u002FFeature\u003C\u002Fdirectory>\n        \u003C\u002Ftestsuite>\n    \u003C\u002Ftestsuites>\n\n    \u003Csource>\n        \u003Cinclude>\n            \u003Cdirectory>src\u003C\u002Fdirectory>\n        \u003C\u002Finclude>\n    \u003C\u002Fsource>\n\n    \u003Ccoverage>\n        \u003Creport>\n            \u003Chtml outputDirectory=\"coverage\"\u002F>\n            \u003Cclover outputFile=\"coverage.xml\"\u002F>\n        \u003C\u002Freport>\n    \u003C\u002Fcoverage>\n\u003C\u002Fphpunit>\n```\n\n## Running Tests\n\n```bash\nvendor\u002Fbin\u002Fphpunit                        # all tests\nvendor\u002Fbin\u002Fphpunit tests\u002FCalculatorTest.php  # single file\nvendor\u002Fbin\u002Fphpunit --filter \"testAdd\"     # match method name\nvendor\u002Fbin\u002Fphpunit --testsuite Unit       # specific suite\nvendor\u002Fbin\u002Fphpunit --display-warnings     # show warnings\nvendor\u002Fbin\u002Fphpunit --log-junit junit.xml  # CI output\n```\n\n## Coverage\n\n```bash\nvendor\u002Fbin\u002Fphpunit --coverage-html coverage\nvendor\u002Fbin\u002Fphpunit --coverage-clover coverage.xml\nvendor\u002Fbin\u002Fphpunit --coverage-text        # terminal report\n```\n\n```xml\n\u003C!-- phpunit.xml — coverage thresholds -->\n\u003Ccoverage>\n    \u003Creport>\n        \u003Chtml outputDirectory=\"coverage\"\u002F>\n    \u003C\u002Freport>\n\u003C\u002Fcoverage>\n```\n\n## Debugging Failures\n\n1. Re-run with `--filter` to isolate the failing test.\n2. Add `--display-warnings` for PHP deprecation warnings.\n3. Use `var_dump()` (output is shown by default in PHPUnit).\n4. Use `--process-isolation` to isolate side effects between tests.\n5. Expand to full suite once the root cause is fixed.\n\n## CI\u002FCD Integration (GitHub Actions)\n\n```yaml\n# .github\u002Fworkflows\u002Ftest.yml\nname: Test\non: [push, pull_request]\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: shivammathur\u002Fsetup-php@v2\n        with: { php-version: '8.3', coverage: xdebug }\n      - run: composer install\n      - run: vendor\u002Fbin\u002Fphpunit --coverage-clover=coverage.xml --log-junit=report.xml\n      - uses: actions\u002Fupload-artifact@v4\n        if: always()\n        with: { name: test-results, path: report.xml }\n```\n\n## Flaky Tests Guardrails\n\n- Never use `sleep()` for synchronization.\n- Use `Faker\\Factory::create()->unique()` for unique test data.\n- Reset global state between tests with `setUp()`.\n- Use `DatabaseTransactions` trait in Laravel for DB isolation.\n- Avoid real HTTP calls — use `Http::fake()` in Laravel or `GuzzleHttp\\Handler\\MockHandler`.\n\n## Test Case Design Patterns\n\nApply these systematic patterns before writing test code to ensure robust coverage beyond the happy path.\n\n### 1. Boundary Value Analysis\nTest at the edges of valid input domains: empty, zero, maximum, null, and just-outside valid ranges.\n\n```php\n\u002F\u002F tests\u002FValidatorTest.php\nfinal class ValidatorTest extends TestCase\n{\n    \u002F** @dataProvider invalidInputProvider *\u002F\n    public function testRejectsInvalidInput(string $input): void\n    {\n        $this->expectException(\\InvalidArgumentException::class);\n        Validator::validate($input);\n    }\n\n    public static function invalidInputProvider(): array\n    {\n        return [[''], [' '], [str_repeat('a', 10001)]];\n    }\n}\n```\n\n### 2. Negative \u002F Error Case Testing\nVerify the system behaves correctly under invalid or unexpected conditions.\n\n```php\n\u002F\u002F tests\u002FCalculatorTest.php\nfinal class CalculatorTest extends TestCase\n{\n    public function testThrowsOnDivideByZero(): void\n    {\n        $this->expectException(\\DivisionByZeroError::class);\n        Calculator::divide(10, 0);\n    }\n}\n```\n\n### 3. State-Based Testing\nFor objects with internal state, verify transitions between states are correct and irreversible where expected.\n\n```php\n\u002F\u002F tests\u002FConnectionTest.php\nfinal class ConnectionTest extends TestCase\n{\n    public function testStateTransitions(): void\n    {\n        $conn = new Connection();\n        $this->assertSame(State::Closed, $conn->state());\n        $conn->open();\n        $this->assertSame(State::Open, $conn->state());\n        $conn->close();\n        $this->assertSame(State::Closed, $conn->state());\n        \u002F\u002F Idempotency\n        $conn->close();\n        $this->assertSame(State::Closed, $conn->state());\n    }\n}\n```\n\n## Common Test Smells to Avoid\n\n- **Assertion Roulette**: Many assertions without descriptive messages, making failure diagnosis ambiguous. *Fix: Use `$this->assertSame($expected, $actual, 'should calculate sum')` with descriptive messages.*\n- **Happy Path Bias**: Only testing successful scenarios, leaving error paths uncovered. *Fix: Test `expectException()` cases, null\u002Fempty\u002Fzero inputs, invalid types.*\n- **Mock Overdose**: Too many mocks hiding integration issues or coupling tests to implementation. *Fix: Mock only at architectural boundaries (HTTP, queue, filesystem); use `RefreshDatabase` for DB.*\n- **The Free Ride**: Tests that execute code but assert nothing meaningful. *Fix: Every test must have at least one specific, falsifiable assertion.*\n- **Obscure Test**: Long test methods with no clear arrange\u002Fact\u002Fassert structure. *Fix: Follow AAA, use `#[CoversClass]` attribute, keep test names descriptive.*\n- **Flaky Test**: Non-deterministic results from database state or external services. *Fix: Use `DatabaseTransactions`, `Carbon::setTestNow()`, `Http::fake()` for HTTP isolation.*\n\n## Best Practices\n\n### DO\n\n- Use `self::assert*` over `$this->assert*` for consistency\n- Use `@dataProvider` or `#[DataProvider]` for multiple test cases\n- Use `setUp()` for shared state initialization\n- Use `@covers` \u002F `#[CoversClass]` to document which class is tested\n- Use strict typing (`declare(strict_types=1)`) in test files\n- Use `assertSame` instead of `assertEquals` for type-safe comparisons\n\n### DON'T\n\n- Don't extend `TestCase` with custom base classes that add global state\n- Don't use `sleep()` for synchronization\n- Don't depend on real databases or external APIs in unit tests\n- Don't test private or protected methods directly — test through public API\n- Don't use `@depends` for test ordering when possible\n- Don't mock `EntityManagerInterface` or similar — use in-memory DB instead\n\n### Common Pitfalls\n\n- **Global state pollution** → Reset singletons and static properties in `setUp()`.\n- **Flaky DB tests** → Use transactions rollback or `RefreshDatabase` (Laravel).\n- **Time-dependent tests** → Use `Carbon::setTestNow()` (Laravel\u002FCarbon).\n- **Slow tests** → Use `@group slow` and exclude from default suite.\n- **Over-mocking** → Prefer in-memory implementations for domain logic.\n- **Missing type checks** → Add `strict_types=1` and run with `--display-warnings`.\n- **Coverage threshold** → Use `@requires PHP` to skip on incompatible versions.\n\n## Optional: Laravel Feature Tests\n\n```php\n\u002F\u002F tests\u002FFeature\u002FUserApiTest.php\nnamespace Tests\\Feature;\n\nuse Tests\\TestCase;\n\nfinal class UserApiTest extends TestCase\n{\n    public function testCanGetUser(): void\n    {\n        $user = User::factory()->create(['name' => 'alice']);\n\n        $response = $this->getJson(\"\u002Fapi\u002Fusers\u002F{$user->id}\");\n\n        $response->assertOk();\n        $response->assertJson(['name' => 'alice']);\n    }\n}\n```\n\n## Pest (Modern PHP Testing)\n\nPest is a rapidly growing testing framework built on top of PHPUnit with an elegant, function-based API. Many Laravel and modern PHP projects now use Pest as the default.\n\n### Basic Test\n\n```php\n\u002F\u002F tests\u002FCalculatorTest.php\nit('adds two numbers', function () {\n    expect(Calculator::add(2, 3))->toBe(5);\n});\n```\n\n### Dataset (Parametrized)\n\n```php\n\u002F\u002F tests\u002FMathTest.php\nit('adds numbers correctly', function (int $a, int $b, int $expected) {\n    expect(Math::add($a, $b))->toBe($expected);\n})->with([\n    [1, 2, 3],\n    [-1, 1, 0],\n    [0, 0, 0],\n    [100, 200, 300],\n]);\n```\n\n### Exception Testing\n\n```php\n\u002F\u002F tests\u002FValidationTest.php\nit('throws on negative age', function () {\n    expect(fn () => Validator::validateAge(-1))\n        ->toThrow(\\InvalidArgumentException::class, 'non-negative');\n});\n```\n\n### Laravel Feature Test\n\n```php\n\u002F\u002F tests\u002FFeature\u002FUserApiTest.php\nit('can get user', function () {\n    $user = User::factory()->create(['name' => 'alice']);\n\n    $response = $this->getJson(\"\u002Fapi\u002Fusers\u002F{$user->id}\");\n\n    $response->assertOk()\n             ->assertJson(['name' => 'alice']);\n});\n```\n\n### Running Pest\n\n```bash\n.\u002Fvendor\u002Fbin\u002Fpest                        # all tests\n.\u002Fvendor\u002Fbin\u002Fpest tests\u002FCalculatorTest.php\n.\u002Fvendor\u002Fbin\u002Fpest --filter=\"adds two numbers\"\n.\u002Fvendor\u002Fbin\u002Fpest --coverage --min=80\n```\n\n### PHPUnit → Pest Migration\n\n```bash\ncomposer require pestphp\u002Fpest:^3 --dev\n.\u002Fvendor\u002Fbin\u002Fpest --init                   # creates Pest.php config\n# Rename TestCase classes to plain functions\n# Replace $this->assert* with expect()->to*()\n```\n\n## Optional: Property-Based Testing\n\n```bash\ncomposer require --dev giorgiosironi\u002Feris:^0.15\n```\n\n```php\nuse Eris\\Generator;\nuse Eris\\TestTrait;\nuse PHPUnit\\Framework\\TestCase;\n\nfinal class CalculatorPropertyTest extends TestCase\n{\n    use TestTrait;\n\n    public function testAdditionIsCommutative(): void\n    {\n        $this\n            ->forAll(\n                Generator\\int(),\n                Generator\\int()\n            )\n            ->then(function (int $a, int $b) {\n                self::assertSame(\n                    Calculator::add($a, $b),\n                    Calculator::add($b, $a)\n                );\n            });\n    }\n}\n```\n\n> Run with: `vendor\u002Fbin\u002Fphpunit tests\u002FCalculatorPropertyTest.php`. Eris generates hundreds of random inputs per property to uncover edge cases. Target mathematical invariants (commutativity, associativity, identity).\n\n## Alternatives\n\n- **Pest**: Modern, elegant wrapper around PHPUnit with function-based API.\n- **Codeception**: BDD-style with acceptance, functional, and unit testing.\n- **Behat**: Gherkin-based BDD framework.\n","# PHP Testing (Agent Skill)\n\nAgent-focused testing workflow for modern PHP (8.2+) using PHPUnit, the industry-standard test framework for PHP with Mockito-style mocking.\n\n## When to Use\n\n- Writing new PHP tests or fixing existing tests\n- Designing unit\u002Fintegration test coverage for PHP components\n- Adding test coverage, CI gating, or regression protection\n- Configuring PHPUnit workflows for consistent execution\n- Investigating test failures or flaky behavior\n- Testing Laravel, Symfony, Slim, or library code\n\n### When NOT to Use\n\n- Implementing new product features without test changes\n- Large-scale refactors unrelated to test coverage or failures\n- Performance tuning without test regressions to validate\n- Non-PHP projects or non-test tasks\n\n### Stop Conditions — When to ASK instead of generating\n\nBefore generating any test code, STOP and ask the user if:\n- The code under test has **zero testability** (static method chains, hard-coded includes, global state in functions)\n- **No test framework** is detected (no phpunit.xml, no PHPUnit\u002FPest in composer.json)\n- The request is **ambiguous**: \"test my app\" or \"add tests\" without specifying files or classes\n- A **required test dependency** (phpunit, pest) is not installed via Composer\n- The test would require **secrets, real credentials, or production database access**\n\n## Core Concepts\n\n- **TDD loop**: red → green → refactor (tests first, minimal fix, then cleanups).\n- **Test layout**: `tests\u002F` directory mirroring `src\u002F` structure, `phpunit.xml` config.\n- **Naming**: `*Test.php` files with `test*` methods or `#[Test]` attribute.\n- **Mocks**: PHPUnit's built-in `createMock()` \u002F `getMockBuilder()` (Mockito-style).\n- **Data providers**: `@dataProvider` methods returning iterables of test cases.\n- **CI signal**: `vendor\u002Fbin\u002Fphpunit --display-warnings --log-junit junit.xml`.\n\n## Agent Execution Protocol\n\nWhen this skill is activated, follow this exact execution sequence:\n\n### Phase 1: Context Analysis\nBefore writing any test code:\n1. Identify the PHP version (8.2+) and framework (PHPUnit or Pest).\n2. Check for existing test files (`tests\u002F`) to infer naming conventions and style.\n3. Analyze the code under test: identify public API surface, side effects, database interactions, and Laravel\u002FSymfony context.\n4. Determine request type: (a) new tests, (b) fixing broken tests, (c) coverage improvement, (d) flaky test diagnosis.\n\n### Phase 2: Strategy Selection\nBased on Phase 1, select the appropriate strategy:\n- **Pure functions \u002F utilities**: unit tests only, no mocks. Use PHPUnit `TestCase` or Pest `it()`.\n- **External dependencies (DB, HTTP, filesystem)**: use PHPUnit mocks (`createMock`) or Laravel `Http::fake()` \u002F `Bus::fake()`; prefer in-memory SQLite for DB tests.\n- **Laravel applications**: use `RefreshDatabase` for feature tests, `DatabaseTransactions` for unit tests; use model factories for test data.\n- **Async code**: PHP is mostly synchronous; use `expectException` for error paths.\n\n### Decision Tree (Complex Scenarios)\n\n```text\nQ1: External I\u002FO (DB, HTTP, filesystem)?\n  → Yes → Q2\n  → No  → Pure unit test, no mocks needed\n\nQ2: Mockable (DI, service container, facade)?\n  → Yes → Mock at boundary (createMock, Http::fake(), Bus::fake())\n  → No  → Q3\n\nQ3: Needs real DB behavior?\n  → Yes → In-memory SQLite + RefreshDatabase \u002F DatabaseTransactions\n  → No  → Use simple stub\n\nQ4: Laravel feature test?\n  → Yes → RefreshDatabase + factory() + actingAs()\n  → No  → Q5\n\nQ5: Modern functional API preferred?\n  → Yes → Pest (it(), expect(), dataset())\n  → No  → PHPUnit TestCase\n```\n\n### Phase 3: Test Case Design\nApply systematic test design before coding:\n1. **Happy path**: normal input → expected output\u002Fresponse.\n2. **Boundary values**: empty arrays, `null`, empty strings, `0`, `PHP_INT_MAX`, empty models.\n3. **Error cases**: exceptions (`expectException`), validation errors (`assertSessionHasErrors`), 4xx\u002F5xx responses.\n4. **State & database**: transaction isolation, factory states, seeded data conflicts.\n\n### Phase 4: Code Generation\nOutput tests in this exact structure:\n```\n#### Test Strategy Summary\n- [ ] Scope: Unit \u002F Feature \u002F Integration\n- [ ] Framework: PHPUnit or Pest + Laravel Testing (if applicable)\n- [ ] Mocking: Yes\u002FNo — PHPUnit mocks \u002F Laravel fakes\n- [ ] Edge cases covered: \u003Clist>\n\n#### Generated Test Code\n\u003Cfile_path>\n\u003Ccode>\n\n#### Running Commands\n```bash\nvendor\u002Fbin\u002Fphpunit --filter testMethod tests\u002FClassTest.php\nvendor\u002Fbin\u002Fphpunit --testsuite Unit\n# Or with Pest:\n.\u002Fvendor\u002Fbin\u002Fpest\n```\n\n#### Coverage Impact (if applicable)\n- Estimated coverage change: \u003CX%>\n- Command to verify: `vendor\u002Fbin\u002Fphpunit --coverage-html coverage`\n```\n\n### Phase 5: Verification Checklist\nBefore completing, verify:\n- [ ] Tests run without parse errors (`vendor\u002Fbin\u002Fphpunit`).\n- [ ] Each test has exactly one logical assertion focus.\n- [ ] Global state is reset between tests (`setUp()` or `RefreshDatabase`).\n- [ ] No `sleep()` used for synchronization.\n- [ ] Flaky test guardrails applied (database transactions, deterministic factories, no real HTTP calls).\n\n## TDD Workflow\n\n```php\n\u002F\u002F tests\u002FMathTest.php\nfunction add(int $a, int $b): int { throw new \\Exception(); } \u002F\u002F stub\n\nfinal class MathTest extends TestCase {\n    public function testAddsTwoNumbers(): void { \u002F\u002F RED\n        self::assertSame(5, add(2, 3));\n    }\n}\n\n\u002F\u002F src\u002FMath.php\nfunction add(int $a, int $b): int { return $a + $b; } \u002F\u002F GREEN\n\n\u002F\u002F REFACTOR: simplify\u002Frename once tests pass\n```\n\n## Code Examples\n\n### Basic Unit Test\n\n```php\n\u002F\u002F tests\u002FCalculatorTest.php\nnamespace Tests;\n\nuse PHPUnit\\Framework\\TestCase;\n\nfinal class CalculatorTest extends TestCase\n{\n    public function testAddsTwoNumbers(): void\n    {\n        self::assertSame(5, Calculator::add(2, 3));\n    }\n\n    public function testHandlesNegativeNumbers(): void\n    {\n        self::assertSame(0, Calculator::add(-1, 1));\n    }\n}\n```\n\n### Setup \u002F Teardown\n\n```php\n\u002F\u002F tests\u002FUserStoreTest.php\nfinal class UserStoreTest extends TestCase\n{\n    private UserStore $store;\n\n    protected function setUp(): void\n    {\n        $this->store = new UserStore();\n        $this->store->seed([new User('alice'), new User('bob')]);\n    }\n\n    public function testFindsExistingUser(): void\n    {\n        $user = $this->store->find('alice');\n        self::assertNotNull($user);\n        self::assertSame('alice', $user->name);\n    }\n\n    protected function tearDown(): void\n    {\n        unset($this->store);\n    }\n}\n```\n\n### Mocking (PHPUnit)\n\n```php\n\u002F\u002F tests\u002FNotifierTest.php\nfinal class ServiceTest extends TestCase\n{\n    public function testSendsNotifications(): void\n    {\n        $notifier = $this->createMock(Notifier::class);\n        $notifier->expects($this->once())\n            ->method('send')\n            ->with('hello');\n\n        $service = new Service($notifier);\n        $service->publish('hello');\n    }\n}\n```\n\n### Stub (Return Values)\n\n```php\nfinal class PaymentTest extends TestCase\n{\n    public function testChargesCorrectAmount(): void\n    {\n        $gateway = $this->createMock(PaymentGateway::class);\n        $gateway->method('charge')\n            ->with(100.0)\n            ->willReturn(true);\n\n        $service = new PaymentService($gateway);\n        $result = $service->processOrder(100.0);\n\n        self::assertTrue($result);\n    }\n}\n```\n\n### Data Provider\n\n```php\nfinal class MathTest extends TestCase\n{\n    \u002F** @dataProvider additionProvider *\u002F\n    public function testAdd(int $a, int $b, int $expected): void\n    {\n        self::assertSame($expected, Math::add($a, $b));\n    }\n\n    public static function additionProvider(): array\n    {\n        return [\n            [1, 2, 3],\n            [-1, 1, 0],\n            [0, 0, 0],\n            [100, 200, 300],\n        ];\n    }\n}\n```\n\n### Exception Testing\n\n```php\nfinal class ValidationTest extends TestCase\n{\n    public function testThrowsOnNegativeAge(): void\n    {\n        $this->expectException(\\InvalidArgumentException::class);\n        $this->expectExceptionMessage('must be non-negative');\n\n        Validator::validateAge(-1);\n    }\n}\n```\n\n### Attribute-Based (PHPUnit 10+)\n\n```php\nuse PHPUnit\\Framework\\Attributes\\Test;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\n\n#[CoversClass(Calculator::class)]\nfinal class CalculatorTest extends TestCase\n{\n    #[Test]\n    #[DataProvider('additionProvider')]\n    public function add(int $a, int $b, int $expected): void\n    {\n        self::assertSame($expected, Calculator::add($a, $b));\n    }\n}\n```\n\n## Installation\n\n```bash\ncomposer require --dev phpunit\u002Fphpunit:^11\n```\n\n## PHPUnit Configuration\n\n```xml\n\u003C!-- phpunit.xml -->\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003Cphpunit\n    xmlns:xsi=\"http:\u002F\u002Fwww.w3.org\u002F2001\u002FXMLSchema-instance\"\n    xsi:noNamespaceSchemaLocation=\"vendor\u002Fphpunit\u002Fphpunit\u002Fphpunit.xsd\"\n    bootstrap=\"vendor\u002Fautoload.php\"\n    colors=\"true\"\n    cacheDirectory=\".phpunit.cache\"\n>\n    \u003Ctestsuites>\n        \u003Ctestsuite name=\"Unit\">\n            \u003Cdirectory>tests\u002FUnit\u003C\u002Fdirectory>\n        \u003C\u002Ftestsuite>\n        \u003Ctestsuite name=\"Feature\">\n            \u003Cdirectory>tests\u002FFeature\u003C\u002Fdirectory>\n        \u003C\u002Ftestsuite>\n    \u003C\u002Ftestsuites>\n\n    \u003Csource>\n        \u003Cinclude>\n            \u003Cdirectory>src\u003C\u002Fdirectory>\n        \u003C\u002Finclude>\n    \u003C\u002Fsource>\n\n    \u003Ccoverage>\n        \u003Creport>\n            \u003Chtml outputDirectory=\"coverage\"\u002F>\n            \u003Cclover outputFile=\"coverage.xml\"\u002F>\n        \u003C\u002Freport>\n    \u003C\u002Fcoverage>\n\u003C\u002Fphpunit>\n```\n\n## Running Tests\n\n```bash\nvendor\u002Fbin\u002Fphpunit                        # all tests\nvendor\u002Fbin\u002Fphpunit tests\u002FCalculatorTest.php  # single file\nvendor\u002Fbin\u002Fphpunit --filter \"testAdd\"     # match method name\nvendor\u002Fbin\u002Fphpunit --testsuite Unit       # specific suite\nvendor\u002Fbin\u002Fphpunit --display-warnings     # show warnings\nvendor\u002Fbin\u002Fphpunit --log-junit junit.xml  # CI output\n```\n\n## Coverage\n\n```bash\nvendor\u002Fbin\u002Fphpunit --coverage-html coverage\nvendor\u002Fbin\u002Fphpunit --coverage-clover coverage.xml\nvendor\u002Fbin\u002Fphpunit --coverage-text        # terminal report\n```\n\n```xml\n\u003C!-- phpunit.xml — coverage thresholds -->\n\u003Ccoverage>\n    \u003Creport>\n        \u003Chtml outputDirectory=\"coverage\"\u002F>\n    \u003C\u002Freport>\n\u003C\u002Fcoverage>\n```\n\n## Debugging Failures\n\n1. Re-run with `--filter` to isolate the failing test.\n2. Add `--display-warnings` for PHP deprecation warnings.\n3. Use `var_dump()` (output is shown by default in PHPUnit).\n4. Use `--process-isolation` to isolate side effects between tests.\n5. Expand to full suite once the root cause is fixed.\n\n## CI\u002FCD Integration (GitHub Actions)\n\n```yaml\n# .github\u002Fworkflows\u002Ftest.yml\nname: Test\non: [push, pull_request]\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: shivammathur\u002Fsetup-php@v2\n        with: { php-version: '8.3', coverage: xdebug }\n      - run: composer install\n      - run: vendor\u002Fbin\u002Fphpunit --coverage-clover=coverage.xml --log-junit=report.xml\n      - uses: actions\u002Fupload-artifact@v4\n        if: always()\n        with: { name: test-results, path: report.xml }\n```\n\n## Flaky Tests Guardrails\n\n- Never use `sleep()` for synchronization.\n- Use `Faker\\Factory::create()->unique()` for unique test data.\n- Reset global state between tests with `setUp()`.\n- Use `DatabaseTransactions` trait in Laravel for DB isolation.\n- Avoid real HTTP calls — use `Http::fake()` in Laravel or `GuzzleHttp\\Handler\\MockHandler`.\n\n## Test Case Design Patterns\n\nApply these systematic patterns before writing test code to ensure robust coverage beyond the happy path.\n\n### 1. Boundary Value Analysis\nTest at the edges of valid input domains: empty, zero, maximum, null, and just-outside valid ranges.\n\n```php\n\u002F\u002F tests\u002FValidatorTest.php\nfinal class ValidatorTest extends TestCase\n{\n    \u002F** @dataProvider invalidInputProvider *\u002F\n    public function testRejectsInvalidInput(string $input): void\n    {\n        $this->expectException(\\InvalidArgumentException::class);\n        Validator::validate($input);\n    }\n\n    public static function invalidInputProvider(): array\n    {\n        return [[''], [' '], [str_repeat('a', 10001)]];\n    }\n}\n```\n\n### 2. Negative \u002F Error Case Testing\nVerify the system behaves correctly under invalid or unexpected conditions.\n\n```php\n\u002F\u002F tests\u002FCalculatorTest.php\nfinal class CalculatorTest extends TestCase\n{\n    public function testThrowsOnDivideByZero(): void\n    {\n        $this->expectException(\\DivisionByZeroError::class);\n        Calculator::divide(10, 0);\n    }\n}\n```\n\n### 3. State-Based Testing\nFor objects with internal state, verify transitions between states are correct and irreversible where expected.\n\n```php\n\u002F\u002F tests\u002FConnectionTest.php\nfinal class ConnectionTest extends TestCase\n{\n    public function testStateTransitions(): void\n    {\n        $conn = new Connection();\n        $this->assertSame(State::Closed, $conn->state());\n        $conn->open();\n        $this->assertSame(State::Open, $conn->state());\n        $conn->close();\n        $this->assertSame(State::Closed, $conn->state());\n        \u002F\u002F Idempotency\n        $conn->close();\n        $this->assertSame(State::Closed, $conn->state());\n    }\n}\n```\n\n## Common Test Smells to Avoid\n\n- **Assertion Roulette**: Many assertions without descriptive messages, making failure diagnosis ambiguous. *Fix: Use `$this->assertSame($expected, $actual, 'should calculate sum')` with descriptive messages.*\n- **Happy Path Bias**: Only testing successful scenarios, leaving error paths uncovered. *Fix: Test `expectException()` cases, null\u002Fempty\u002Fzero inputs, invalid types.*\n- **Mock Overdose**: Too many mocks hiding integration issues or coupling tests to implementation. *Fix: Mock only at architectural boundaries (HTTP, queue, filesystem); use `RefreshDatabase` for DB.*\n- **The Free Ride**: Tests that execute code but assert nothing meaningful. *Fix: Every test must have at least one specific, falsifiable assertion.*\n- **Obscure Test**: Long test methods with no clear arrange\u002Fact\u002Fassert structure. *Fix: Follow AAA, use `#[CoversClass]` attribute, keep test names descriptive.*\n- **Flaky Test**: Non-deterministic results from database state or external services. *Fix: Use `DatabaseTransactions`, `Carbon::setTestNow()`, `Http::fake()` for HTTP isolation.*\n\n## Best Practices\n\n### DO\n\n- Use `self::assert*` over `$this->assert*` for consistency\n- Use `@dataProvider` or `#[DataProvider]` for multiple test cases\n- Use `setUp()` for shared state initialization\n- Use `@covers` \u002F `#[CoversClass]` to document which class is tested\n- Use strict typing (`declare(strict_types=1)`) in test files\n- Use `assertSame` instead of `assertEquals` for type-safe comparisons\n\n### DON'T\n\n- Don't extend `TestCase` with custom base classes that add global state\n- Don't use `sleep()` for synchronization\n- Don't depend on real databases or external APIs in unit tests\n- Don't test private or protected methods directly — test through public API\n- Don't use `@depends` for test ordering when possible\n- Don't mock `EntityManagerInterface` or similar — use in-memory DB instead\n\n### Common Pitfalls\n\n- **Global state pollution** → Reset singletons and static properties in `setUp()`.\n- **Flaky DB tests** → Use transactions rollback or `RefreshDatabase` (Laravel).\n- **Time-dependent tests** → Use `Carbon::setTestNow()` (Laravel\u002FCarbon).\n- **Slow tests** → Use `@group slow` and exclude from default suite.\n- **Over-mocking** → Prefer in-memory implementations for domain logic.\n- **Missing type checks** → Add `strict_types=1` and run with `--display-warnings`.\n- **Coverage threshold** → Use `@requires PHP` to skip on incompatible versions.\n\n## Optional: Laravel Feature Tests\n\n```php\n\u002F\u002F tests\u002FFeature\u002FUserApiTest.php\nnamespace Tests\\Feature;\n\nuse Tests\\TestCase;\n\nfinal class UserApiTest extends TestCase\n{\n    public function testCanGetUser(): void\n    {\n        $user = User::factory()->create(['name' => 'alice']);\n\n        $response = $this->getJson(\"\u002Fapi\u002Fusers\u002F{$user->id}\");\n\n        $response->assertOk();\n        $response->assertJson(['name' => 'alice']);\n    }\n}\n```\n\n## Pest (Modern PHP Testing)\n\nPest is a rapidly growing testing framework built on top of PHPUnit with an elegant, function-based API. Many Laravel and modern PHP projects now use Pest as the default.\n\n### Basic Test\n\n```php\n\u002F\u002F tests\u002FCalculatorTest.php\nit('adds two numbers', function () {\n    expect(Calculator::add(2, 3))->toBe(5);\n});\n```\n\n### Dataset (Parametrized)\n\n```php\n\u002F\u002F tests\u002FMathTest.php\nit('adds numbers correctly', function (int $a, int $b, int $expected) {\n    expect(Math::add($a, $b))->toBe($expected);\n})->with([\n    [1, 2, 3],\n    [-1, 1, 0],\n    [0, 0, 0],\n    [100, 200, 300],\n]);\n```\n\n### Exception Testing\n\n```php\n\u002F\u002F tests\u002FValidationTest.php\nit('throws on negative age', function () {\n    expect(fn () => Validator::validateAge(-1))\n        ->toThrow(\\InvalidArgumentException::class, 'non-negative');\n});\n```\n\n### Laravel Feature Test\n\n```php\n\u002F\u002F tests\u002FFeature\u002FUserApiTest.php\nit('can get user', function () {\n    $user = User::factory()->create(['name' => 'alice']);\n\n    $response = $this->getJson(\"\u002Fapi\u002Fusers\u002F{$user->id}\");\n\n    $response->assertOk()\n             ->assertJson(['name' => 'alice']);\n});\n```\n\n### Running Pest\n\n```bash\n.\u002Fvendor\u002Fbin\u002Fpest                        # all tests\n.\u002Fvendor\u002Fbin\u002Fpest tests\u002FCalculatorTest.php\n.\u002Fvendor\u002Fbin\u002Fpest --filter=\"adds two numbers\"\n.\u002Fvendor\u002Fbin\u002Fpest --coverage --min=80\n```\n\n### PHPUnit → Pest Migration\n\n```bash\ncomposer require pestphp\u002Fpest:^3 --dev\n.\u002Fvendor\u002Fbin\u002Fpest --init                   # creates Pest.php config\n# Rename TestCase classes to plain functions\n# Replace $this->assert* with expect()->to*()\n```\n\n## Optional: Property-Based Testing\n\n```bash\ncomposer require --dev giorgiosironi\u002Feris:^0.15\n```\n\n```php\nuse Eris\\Generator;\nuse Eris\\TestTrait;\nuse PHPUnit\\Framework\\TestCase;\n\nfinal class CalculatorPropertyTest extends TestCase\n{\n    use TestTrait;\n\n    public function testAdditionIsCommutative(): void\n    {\n        $this\n            ->forAll(\n                Generator\\int(),\n                Generator\\int()\n            )\n            ->then(function (int $a, int $b) {\n                self::assertSame(\n                    Calculator::add($a, $b),\n                    Calculator::add($b, $a)\n                );\n            });\n    }\n}\n```\n\n> Run with: `vendor\u002Fbin\u002Fphpunit tests\u002FCalculatorPropertyTest.php`. Eris generates hundreds of random inputs per property to uncover edge cases. Target mathematical invariants (commutativity, associativity, identity).\n\n## Alternatives\n\n- **Pest**: Modern, elegant wrapper around PHPUnit with function-based API.\n- **Codeception**: BDD-style with acceptance, functional, and unit testing.\n- **Behat**: Gherkin-based BDD framework.\n",{"name":5,"origin":24,"description":25},"ECC","Use ONLY when user explicitly requests PHP test code, PHPUnit\u002FPest configuration,\ntest failure diagnosis, or coverage improvement for PHP projects.\n\nTriggers: \"write test php\", \"phpunit\", \"pest php\", \"laravel test\",\n\"PHP coverage\", \"refresh database test\", \"data provider php\".\n\nDo NOT activate for: general PHP coding without test context, composer autoload\nissues, PHP framework setup, or non-test Laravel\u002FWordPress configuration.\n","main","021f5cbe02157229460a577e9a585f2da6d78cb0",".specify\u002Ftemplates\u002Fpassive-skills\u002Fphp-testing","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck","https:\u002F\u002Fgithub.com\u002Fchenziyang110","2026-08-07 18:10:54",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add chenziyang110\u002Flaunchdeck --skill php-testing",{"tool":38,"command":39},"bunx","bunx skills add chenziyang110\u002Flaunchdeck --skill php-testing",{"tool":41,"command":42},"pnpm","pnpm dlx skills add chenziyang110\u002Flaunchdeck --skill php-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fphp-testing\u002FSKILL.md",true,[],[47,54,60,66,73,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M7875F3HQ1GF5F6BR36KY3JE","launchdeck-agent","Codex host adapter contract fixture for Launchdeck.","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fagent-hosts\u002Fcodex\u002Fskill\u002FSKILL.md",[],[],{"skillNo":55,"name":49,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7875DV2DQR33K1NFJHKAMZP","Claude host adapter contract fixture for Launchdeck.","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fagent-hosts\u002Fclaude\u002Fskill\u002FSKILL.md",[],[],{"skillNo":61,"name":49,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M78759JQ7A6FQ8KDQTNYS3X9","Use this skill aggressively for local project lifecycle operations even when the user does not mention Launchdeck: start this project, run the dev server, dev, build, test, restart service, stop service, show logs, inspect ports, port is occupied, clean cache; and when the user explicitly asks to configure this local project for Launchdeck or create or generate a project-adapted `.launchdeck.yml`, including 为这个项目生成 Launchdeck 配置. Do not use for ordinary code edits, docs-only work, general explanations, API design discussion, or production deployment unless the user also asks to operate or configure a local project or service.","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002Fagent\u002Finstaller-payload\u002Fskill\u002Flaunchdeck-agent\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M78753ZJQ7G2CZT1W1G8WRJV","zig-testing","Use ONLY when user explicitly requests Zig test code, built-in test runner configuration,\ntest failure diagnosis, or coverage for Zig projects.\n\nTriggers: \"write test zig\", \"zig test\", \"testing.allocator\", \"zig coverage\",\n\"comptime test\", \"zig expectError\", \"zig snapshot test\", \"zig fuzz\".\n\nDo NOT activate for: general Zig coding without test context, build.zig configuration\nfor non-test targets, Zig compiler errors, or Zig build system setup.","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fzig-testing\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":78,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M78750JXY4Z5D5W1EX3PQ31Z","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7874X2T83EQQFRCEY5SJJVC","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fchenziyang110\u002Flaunchdeck\u002Fblob\u002Fmain\u002F.specify\u002Ftemplates\u002Fpassive-skills\u002Fverification-before-completion\u002FSKILL.md",[],[]]