Specs

Spec-first task brief

Write the goal, inputs, outputs and done-criteria down before the agent touches anything.

The problem

A one-line request like "add login" leaves the agent to guess scope, stack, edge cases and what "finished" means. It will guess confidently, and you only find the wrong guesses after it has written a lot of code.

The pattern

Before starting a task, write a short brief with a fixed shape. The agent works from the brief, not from your chat history.

If you cannot fill in a section, that is the real problem to solve first. The brief is cheap to rewrite; a wrong implementation is not.

Template

# Task brief

## Goal
<One or two sentences: what should be true when this is done, and why.>

## Context
- Relevant files/dirs: <paths>
- Existing behaviour: <what happens today>
- Related decisions: <links or one-liners>

## Inputs / outputs
- Input: <shape, source, example>
- Output: <shape, destination, example>

## Constraints
- Must use: <language, framework, library versions>
- Must not change: <public APIs, schemas, files>
- Style: <conventions to follow>

## Done when
- [ ] <checkable condition 1>
- [ ] <checkable condition 2>
- [ ] All existing tests still pass

## Out of scope
- <thing the agent should not do, even if tempting>

If anything in this brief is ambiguous or contradictory, stop and ask before writing code.

When not to use it