write-agent-goal
Skill0 starsChanged 4 months agoMITView on GitHub
Drafts or fixes the goal text for an autonomous agent run (/goal, unattended sessions) - checkable success conditions, evidence requirements, scope and permission limits, retry and budget exits. Use when writing an agent goal, run definition of done, or run success criteria, or when a goal gets gamed or marked done early. Not for generic project goals, prompt rewrites, or loop runtime design.
- Commits and pushes
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-skillSkill
- publish-repoSkill
- engineer-agent-loopSkill
- evaluate-promptsSkill
- optimize-promptSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 70
Size it: Prefer several small sequential goals with a crisp check each over one giant goal — reliability compounds per step.
- Distinctive: line 96
Don't demand evidence the run cannot produce (a check command the agent lacks permission to run is an infinite non-exit).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
write-agent-goal
Turns a task into a goal contract an autonomous agent can be held to: a verifiable end state, the evidence that proves it, the boundaries the run must respect, and the exits that stop it. Fixes the two failures goal-gated runs actually die of: a run "marked done" on the worker's own word, and a run that can never satisfy its condition because the condition was never checkable.
When NOT to use
- Runtime symptoms — the loop stalls, repeats itself, drifts, or ignores
caps →
engineer-agent-loop. Diagnose the harness first; the goal text may be fine. - Ordinary prompt work — rewriting a system/task prompt →
optimize-prompt. - Comparing or benchmarking prompts →
evaluate-prompts. - Human/project goal-setting — OKRs, tickets, roadmap "definition of done" with no autonomous run attached.
- Compound asks ("rewrite the goal AND add harness caps"): write the goal
text here, then hand off to
engineer-agent-loopfor enforcement.
Workflow
- Extract the contract. Five parts: objective, why it matters, hard constraints, available tools, machine-checkable definition of done. Not a numbered procedure — step lists cause checklist blindness on frontier models; describe the destination (exception: when the exact method is itself a requirement, the method becomes a constraint).
- Design the success condition. Apply the checklist from
references/goal-patterns.md: the measurable end-state predicates (often one primary state plus constraint checks); the named check command whose output proves each; do-not-touch constraints. Close gaming shortcuts by protecting the oracle: when tests verify the work, forbid weakening them ("tests pass without modifying files under tests/"); when tests ARE the work (a test migration), protect a different oracle instead (test count, coverage, CI on unchanged assertions). Ban adjectives ("high quality", "improved"). If the task is genuinely subjective — no machine check exists — say so and gate on explicit human approval or a declared measurable proxy; never fake verifiability. - Set the exits, in priority order. Success (the condition holds); failure ceilings — same failure ~3 consecutive times AND a total-attempt cap (alternating failures burn budget without tripping a same-failure counter) → stop and escalate with a diagnosis; budget ceiling (turns/tokens/cost → checkpoint, park partial work, report). Write the caps into the condition text — a goal has no built-in budget. For irreversible or multi-stage work (rotations, migrations, deploys): never start a non-interruptible phase without budget to finish it, and name the rollback/roll-forward rule so a budget exit cannot strand half-done state.
- Bound the blast radius. Explicit off-limits paths; side-effect limits
(no deploys, no spending, no git push, no external posts — whatever
applies); an approval gate for irreversible or outward-facing actions;
secrets never quoted into the goal or printed by its check commands. Say
the quiet part in the output: these clauses reduce accidental
violations only — "must never touch prod", hard cost limits, and trusted
completion need sandboxing, credential separation, and supervisor caps
(
engineer-agent-loop). - Set the evidence standard. Require bounded, redacted evidence: the
command, its exit status, and the relevant non-sensitive lines or an
artifact hash — never full log dumps, never secret-printing commands.
Include the audit instruction (verbatim in
references/goal-patterns.md); on a blocked condition, instruct the agent to stop and report the blocker rather than work around it. Note the limit honestly: a transcript evaluator cannot authenticate pasted output — where authenticity matters, the harness must run the check itself. - Size it. Prefer several small sequential goals with a crisp check each
over one giant goal — reliability compounds per step. Keep the condition
compact (community-reported ~4,000-char cap for
/goal). - Read it back as the laziest compliant agent. Can the letter be satisfied while the spirit fails (edit the tests, weaken the assertion, declare victory without running the check)? Patch every shortcut found, then answer the four pre-flight questions in the reference.
Output spec
A paste-ready goal text containing: objective + why; hard constraints
including off-limits paths and permission/side-effect lines; the tools the
run may use; the checkable end state(s) with their check commands; the
bounded-evidence requirement; failure and budget exits with an escalation
trigger. Follow it with 2–3 lines of rationale listing the gaming shortcuts
you closed. $ARGUMENTS, when present, is the task to convert.
Gotchas
- The
/goalevaluator is a small model that sees only the transcript and cannot run commands — a condition that doesn't force check output into the transcript is unverifiable by construction. - "Done" can be hallucinated: completion must be a predicate on state (command output, file diff, artifact), never the absence of further tool calls.
- Prompt-level caps are advisory. If nothing but text enforces the budget,
say so and recommend
engineer-agent-loopfor supervisor-enforced caps. - Don't demand evidence the run cannot produce (a check command the agent lacks permission to run is an infinite non-exit).
- Goal text is the task layer, not the system layer: durable identity rules and boundaries belong in the system prompt; the goal carries this run's condition, scope, and evidence standard.
Pointers
references/goal-patterns.md— goal-contract anatomy, condition checklists, the three exits, evidence discipline, verified/goal+ Stop-hook mechanics, prompt layering.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

