# Polish

> Pest polish. Test-specific standards for each polish pass. Invoke when polishing Pest test files.

- Skill: `attac-t/polish` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add attac-t/polish`
- Raw SKILL.md: https://api.skillmd.com/api/skills/attac-t/polish/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/polish

---


# Skill: Pest Polish

> "Tests are specifications. Polish them like production code."

Tests are production code. They earn all seven passes — 1. Docblocks · 2. Names · 3. Methods · 4. Framework internals · 5. Whitespace · 6. Conditionals · 7. Tests — plus the test-specific standards below. One concern per pass, in order. Zero behavior change.

Pairs with `kernel:polish` for the wider protocol — enumeration, reporting, team mode.

## Pass 7: Tests — Specification Grade

### `it()` Descriptions Are Requirements

Present tense. No "should." No "correctly handles." No "tests that."

```php
// Requirement
it('syncs only the receipted portion')
it('rejects negative quantities')
it('calculates total from line items')

// Narration — fix these
it('should correctly handle the split payment case')
it('tests that the sync works properly')
```

### ~8 Lines Max

Arrange (builder chain) → Act (one call) → Assert (one expectation).

If longer, the helpers aren't absorbing enough.

### No Raw Factory Calls

The arrange phase uses builders or helper methods, not raw factory chains.

### Domain Assertions Over Raw

`$order->assertTotal(50_00)` — not `expect($response->json('data.total'))->toBe(50_00)`.

### `describe()` Blocks Name Concerns

```php
// Concerns
describe('split-item orders', function () { ... });
describe('partial payments', function () { ... });

// Categories — fix these
describe('edge cases', function () { ... });
describe('regression tests', function () { ... });
```

### Boring Variable Names

`$order`, `$result`, `$coverage`. Not `$splitItemOrderWithPartialFiscalCoverage`.

---

See [examples.md](examples.md) for full before/after test polish patterns.

