# Craft Test

> Crafting a test. The unit of specification.

- Skill: `attac-t/craft-test` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add attac-t/craft-test`
- Raw SKILL.md: https://api.skillmd.com/api/skills/attac-t/craft-test/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: attac-t (https://skillmd.com/u/attac-t)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/attac-t/craft-test

---


# Skill: Craft Test

> "Test behavior, not implementation."

## The Standard

1. **One Behavior Per Test**: A test verifies one thing. If the name has "and", split it.
2. **Arrange-Act-Assert**: Setup, execute, verify. No interleaving.
3. **Test the API**: Public interface only. Implementation changes shouldn't break tests.

## The Anti-Patterns

| Don't                  | Do                      | Why           |
|------------------------|-------------------------|---------------|
| Test private methods   | Test through public API | Coupling      |
| Assert implementation  | Assert behavior         | Fragility     |
| Multiple acts per test | One act, one test       | Clarity       |
| Dense setup chains     | Two-line setup          | Readability   |
| Vague names            | Complete sentences      | Documentation |

## Real-World Examples

See [examples.md](examples.md).

