agentleFS
gerard-labsgerard-labs/superpowers-api-platform/skills/tdd-with-phpunit/SKILL.md

tdd-with-phpunit

Skill2 starsChanged 6 months agoMITView on GitHub

Apply RED-GREEN-REFACTOR TDD with PHPUnit 12 on a Symfony project — `extends TestCase` / `KernelTestCase` / `WebTestCase`, attributes (`#[DataProvider]`, `#[Group]`, `#[CoversClass]`, `#[Depends]`), PHPUnit 12 accepts both `test_business_behavior` snake_case AND `testBusinessBehavior` camelCase (criterion: method starts with `test`), BDD-descriptive naming over implementation names. ParaTest for parallel runs. Trigger on "write a PHPUnit test", "TDD a Symfony service", or "RED-GREEN-REFACTOR a controller". For Pest-syntax preference, see `gerard:tdd-with-pest`.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write failing test for target behavior and one boundary case.

    line 20
  2. Distinctive:

    Prefer deterministic fixtures/builders.

    line 26
  3. Distinctive:

    Keep tests isolated and stable in CI.

    line 28
  4. Distinctive:

    Use this file for execution posture and risk controls.

    line 31
  5. Distinctive:

    Test files changed and executed commands.

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Tdd With Phpunit (Symfony)

Use when

  • Building regression-safe behavior with TDD/functional/e2e tests.
  • Converting bug reports into executable failing tests.

Default workflow

  1. Write failing test for target behavior and one boundary case.
  2. Implement minimal code to pass.
  3. Refactor while preserving green suite.
  4. Broaden coverage for invalid/unauthorized/not-found paths.

Guardrails

  • Prefer deterministic fixtures/builders.
  • Assert observable behavior, not internal implementation.
  • Keep tests isolated and stable in CI.

Progressive disclosure

  • Use this file for execution posture and risk controls.
  • Open references when deep implementation details are needed.

Output contract

  • RED/GREEN/REFACTOR trace.
  • Test files changed and executed commands.
  • Coverage and confidence notes.

References

  • reference.md
  • docs/complexity-tiers.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.