Craft Organization

Crafting test structure. File layout for large suites.

attac-t 9581852 2 files · 2.4 KB Updated

File contents

Skill: Craft Organization

"Structure scales. Chaos doesn't."

The Standard

  1. Separate Concerns: Pest.php for config, Expectations.php for custom assertions, Datasets/ for shared data.
  2. Split at 5: When a behavioral domain reaches 5+ tests, extract to its own file.
  3. Group Slow Tests: Isolate slow tests for selective execution.

The Anti-Patterns

Don't Do Why
One massive test file Split by capability Maintainability
Split by model Split by behavior Zero overlap
Mix config with tests Separate Pest.php Clarity
Run slow tests always Group and exclude Fast feedback

Real-World Examples

See examples.md.

attac-t/the-foundry/tree/main/plugins/pest/skills/craft-organization commit 95818521ba

Frequently asked questions

npx skillmds@latest add attac-t/craft-organization