Write a level 3+ goal.md with no possible shortcut
In the kit's pilot, with a level 3 criterion and 14 frozen tests, the run finished in the first cycle, in 3 minutes. Most of the work in a long run is writing the criterion. Here you write your own goal.md so that the only way to meet it is to do the work.
2Add a lock: minimum count, frozen test, validator
3Make the proof show up in the /goal output
4Test the criterion against the cheapest cheat
Goal: write a goal.md with command → output criteria that cover function, regression and limit and that can't be met by a shortcut.
01 · From result to proof on screen
A good goal.md has these five parts. Tap each one.
Click each block in the diagram to see what it does.
Function + regression + limit, each with a lock, and the proof visible. The full 0–4 scale is in course 0; how to build the verifier, in course 1.
02 · The five questions from templates/goal.md
Each "no" lowers the criterion's level.
1. Can you check it with a command?
"Make it good" and "reviewed and clean" have no command. Rewrite until you have one.
Rewrittenpython3 validar.py && echo OK → OK
2. Is the answer yes or no?
"Improved performance" is a comparison. Fix the number: "p95 under 200 ms on benchmark X".
3. Is it impossible to meet without doing the work?
Look for the cheapest cheat: deleting a test, an empty page, a hardcoded value. For each one, a lock: minimum count, hash or git diff of the tests, content validator.
Level 2 → level 3"0 failures" becomes "0 failures AND ≥ 48 tests AND tests/ untouched".
4. Does the proof show up in the output?
For Claude's /goal, write the condition as something the agent prints: "the npm test output shows 0 failures". "The state.md says done" only counts if the agent shows the file.
5. Are function, regression and limit covered?
All three, each with at least one line. And two tests: a quick one per cycle (seconds or minutes) and the full one at the end.
03 · The goal.md and the two /goal prompts
Filled-in example for a small task (counting words). Swap in your own.
longrun/[date]-contador-palavras/goal.md
# Goal — contador-palavras
- **Início:** 2026-10-19 09:00 · **Agente:** Claude /goal
- **Tetos:** tempo 2 h · memória 2G
## Resultado
`conta.py` tem conta_palavras(texto) que conta palavras separadas por qualquer espaço.
## Critérios de pronto (verificáveis)
**Função**
- [ ] `python3 -m pytest -q` → `3 passed`, 0 failed (e nunca menos de 3 testes)
**Regressão**
- [ ] `python3 -c "import conta"` → sem erro (o módulo continua importável)
**Limite**
- [ ] `git diff --exit-code -- tests/ pytest.ini` → código 0 (testes congelados)
- [ ] `git diff --stat` → só `conta.py` e a pasta longrun/
**Teste rápido por ciclo**: `python3 -m pytest -q`
**Teste completo no final**: `python3 -m pytest -q`
## Restrições
- só pela assinatura; nenhuma API
- não mexer em: tests/, pytest.ini
## Portões humanos (parar e perguntar)
- qualquer mudança fora de conta.py e da pasta longrun/
Claude Code · /goal (templates/prompt-goal-claude.md)
/goal The terminal output shows <comando de verificação> passing with <resultado esperado>, and longrun/<pasta>/state.md says "concluído".
Codex · /goal (templates/prompt-goal-codex.md)
/goal
RESULT: <final result in one sentence>
VERIFICATION (it only ends when all of these pass):
- <comando> → <saída esperada>
CONSTRAINTS: <what is off limits>. Subscription use only; no API without authorization.
STATE: use longrun/<pasta>/ (goal.md, plan.md, state.md, progress.md, failures.md, decisions.md, canal.md).
After any compaction or resume, reread goal.md, state.md, plan.md and canal.md before acting. Record in canal.md (append only) facts, lessons, glossary and traps as soon as they appear.
CYCLE: analyze → pick the next useful action → execute → test → observe → fix → update state/progress → commit at the checkpoint → continue.
As long as there is a next action that is objective, safe and aligned with the goal, execute it without waiting for new instructions.
3 cycles without measurable progress = stop, record it in failures.md and call me.
STOP AND CALL ME ONLY IF: credit/API spending, irreversible or external action (push to production, email, delete), missing credential, business decision, real conflict between requirements.
Example from the repository
From the kit's longrun/2026-10-01-medir-sessao/goal.md, the run that built medir-sessao.py:
Função
- pytest -q → todos passam (12 rápidos + 2 com sessões reais), 0 falhas, 0 skips
Regressão
- python3 tools/medicao/cx.py | head -1 e cc.py continuam rodando
Limite
- git diff --exit-code -- tests/ pytest.ini → vazio
(testes congelados; hash inicial 3ae1ba7975508cba)
- só criar/alterar tools/medir-sessao.py e a pasta longrun/
Teste rápido por ciclo: pytest -q -m "not real"
Teste completo no final: pytest -q
Result: done in the 1st cycle (3 min). Independent check afterward: test hash intact, no hardcoded values in the code, 14 passed reproduced, and a never-before-seen session checked.
Words like "good", "clean", "adequate", "complete".
Depends on the agent saying it's done.
Only a count, with no check of the content (20 empty pages pass).
Doesn't say what must NOT change.
The check takes hours: the loop can't measure progress each cycle.
List from the kit's templates/goal.md.
04 · Practice
Use the folder you created in lesson 1.
E4 · The goal.md for your long run
30 min
Fill in goal.md with the result, function, regression, limit, the two tests, constraints and human gates. Before any work, run each criterion in the terminal.
Done when: every criterion has a command that runs now; the function ones fail before the work (if they already pass, the criterion doesn't measure the task) and the limit one already passes: git diff --exit-code -- tests/; echo $? → 0.
E5 · Attack your own criterion
20 min
On a throwaway branch (git switch -c ataque), pull the cheapest cheat: delete a failing test, or swap the function for a fixed value. Run the criteria again and go back with git switch -.
Done when: for each cheat, at least one criterion fails; when you delete a test, git diff --exit-code -- tests/; echo $? → 1.
05 · Lesson quiz
Question 1 of 4
The criterion is "pytest -q → 0 falhas". Which cheat does it let through?skill
Correct
With no minimum count and no frozen tests/, deleting the failing test gives 0 failures. Level 3 adds "≥ N tests" and "git diff --exit-code -- tests/ → 0".
Not this one
With no minimum count and no frozen tests/, deleting the failing test gives 0 failures. Level 3 adds "≥ N tests" and "git diff --exit-code -- tests/ → 0".Review: From result to proof on screen
Question 2 of 4
In Claude Code's /goal, why does the condition have to show up in the output?skill
Correct
The /goal docs say the evaluator judges only what's in the conversation. That's why the condition is something the agent prints, like the test output.
Not this one
The /goal docs say the evaluator judges only what's in the conversation. That's why the condition is something the agent prints, like the test output.Review: From result to proof on screen
Question 3 of 4
Before any work, you ran the function criterion and it already passed. What does that tell you?
Correct
A function criterion that passes before the work can't tell done from not done. The limit one, on the other hand, should pass from the start.
Not this one
A function criterion that passes before the work can't tell done from not done. The limit one, on the other hand, should pass from the start.Review: Practice
Question 4 of 4
Which layer answers "didn't touch what it shouldn't and didn't spend what it shouldn't"?
Correct
Limit: frozen files, folders out of scope and forbidden spending. It's the one that closes the shortcut of tampering with the judge itself.
Not this one
Limit: frozen files, folders out of scope and forbidden spending. It's the one that closes the shortcut of tampering with the judge itself.Review: From result to proof on screen
Quiz complete
You got {a} of {n} right. Get them all right and the lesson is marked as complete.
Pick an answer. The explanation shows up after you try.
06 · In three sentences
Three layersFunction, regression and limit, each with a command and the expected output.
Locks on each oneMinimum count, tests frozen by git diff or hash, content validator: the shortcut has to fail.
Proof in plain sightClaude's /goal evaluator only reads the conversation; the headless loop runs the test itself (lesson 6).