# Spec First

> Write the goal spec on disk before the agent acts, so it can't drift. Use before any multi-step task.

- Skill: `elitongadotti/spec-first` (Agent Skill)
- Install (CLI): `npx skillmds@latest add elitongadotti/spec-first`
- Raw SKILL.md: https://api.skillmd.com/api/skills/elitongadotti/spec-first/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: elitongadotti (https://skillmd.com/u/elitongadotti)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/elitongadotti/spec-first

---

# Spec First
Without an external contract, the agent drifts after ~3 iterations — and the failure looks like progress (code written, tests pass, wrong goal solved).
Write `PROMPT.md` BEFORE acting:
- **Goal** — one sentence.
- **Done when** — concrete, checkable conditions. "Test suite green: <cmd>".
- **Never touch** — files/areas off-limits.
- **Stop if** — more than N files outside scope change; a passing test starts failing.
The agent re-reads this file every iteration. State (what's done) goes in a separate `IMPLEMENTATION_PLAN.md` it updates in place. If you can't write "done when" concretely, the task isn't ready — clarify before coding.

