Goal Prompt
Trail of BitsOfficialPublished by Trail of Bits
- Skill
- Content generator
- Agent tooling
- CC-BY-SA-4.0
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured methodology for creating effective /goal commands for AI agents. It emphasizes defining clear, verifiable end states rather than activities, incorporating necessary invariants, and establishing stop bounds to prevent infinite loops. The skill guides users through closing common 'easy-outs' that models might take to satisfy a goal without performing the actual work, ensuring that objectives are grounded in existing repository or conversation context.
What it does
- Drafts single-line objective strings for /goal commands.
- Ensures objectives are defined by end states rather than activities.
- Integrates verification commands and invariants into the goal definition.
- Adds mandatory stop bounds to prevent runaway agent loops.
- Identifies and flags missing information that cannot be grounded in the current context.
- Formats output to meet the 4,000-character limit for Claude Code and Codex.
When to use it
- When you need to define a long-running task for an agent that requires multiple turns.
- When you want to ensure an agent stops only after a verifiable condition is met.
- When you need to prevent an agent from taking shortcuts or 'easy-outs' during task execution.
- When you are preparing complex objectives that require specific invariants or safety constraints.
Advantages
- Reduces agent hallucination by grounding goals in verifiable commands.
- Prevents infinite loops by enforcing stop bounds.
- Improves task reliability by closing common logical loopholes.
- Standardizes the format for agent objectives across different sessions.
Usage examples
- “Create a goal to migrate the authentication module from legacyAuth to auth.verify.”
- Returns a formatted /goal command that includes specific search and test verification steps, along with invariants to protect vendor code and a turn-based stop bound.
- “I need a goal to make the checkout process faster, but I don't have a benchmark.”
- Returns the /goal command with the objective and a Missing list identifying the need for a measurable end state, a verification benchmark, and a stop bound.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/trailofbits/goal-prompt/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip goal-prompt.zip -d .agents/skills
Documentation by Trail of Bits
Goal Prompt
/goal keeps the agent working until a completion condition is met. Both Claude Code and Codex take it as one line, max 4,000 characters. In Claude Code a small model re-judges the condition after each turn from the transcript alone — it cannot run commands.
Draft a condition that can terminate, then format it. A goal fits work bigger than one turn with a checkable finish line; chain small goals with review between them rather than writing one giant goal.
Draft
Include, joined with AND — never "or", the loop takes the cheaper branch:
End state, not activity — "all
legacyAuth()call sites useauth.verify()", not "migrate the auth code". An activity can be claimed; an end state is true or false.Scope to read first — the files, issue, logs, or plan to read before acting.
Stated check — the exact command and its observable result ("
npm testexits 0"), plus an instruction to run it and show the output; a result that never lands in the transcript does not exist to the evaluator.Invariants — what must not change ("without modifying vendor/"), always including "do not weaken, skip, or edit the checks themselves".
Stop bound or blocked clause — "or stop after 20 turns", "if blocked, stop and report the blocker". Without one, a mis-stated condition loops forever; the formatter warns when it is missing. (Claude Code resets the turn counter on session resume, so a turn bound silently extends across resumes.)
Keep it small. Every constraint narrows the state space the model can explore. Collapse to one terminating criterion when possible, move scope and definitions into a referenced file, and drop non-goals — a constraint earns its place only by closing a real easy-out.
For long goals, also name the final evidence (diff, report, artifact) and require a progress log file — durable state across compaction and resume. If the brief exceeds 4,000 characters, put the details in a GOAL.md and reference that file from the objective.
Never invent missing elements. Ground every element in the user's request, the conversation, or the repository — look things up rather than guessing. If an element cannot be filled from available information, still optimize and format what the user provided, leave the element out, and flag it as missing (see Format). A goal with an invented success condition terminates on the wrong contract.
Close the easy-outs
Before formatting, reread the drafted condition as a lazy model would: what is the cheapest way to make every check pass without doing the intended work? Close the cheapest ones — prefer pairing checks you already have over adding constraints, and do not enumerate every conceivable out into a non-goal list. The recurring outs:
Delete or stub instead of fix — "search prints nothing" also holds when the callers are gone; pair such checks with one that proves the feature still works.
Pass on a subset — running one test file, narrowing the search path, excluding directories from the check.
Game the gate — skipping/xfail-ing tests, hardcoding expected outputs, special-casing the test inputs, editing the check (the invariants rule).
Claim without running — declaring done or blocked with no check output in the transcript (the show-the-output rule).
Same discipline as above: an out you cannot close from available information goes in the Missing: list as a warning — an invented or absurd constraint is worse than a flagged gap.
Security research goals
Collapse audit goals to one terminating criterion, such as identifying, triggering, and validating one high-severity vulnerability valid under a referenced threat-model file. That file, not the goal, carries scope, attacker powers, severity baseline, and known findings to skip. Use neutral wording ("trigger and validate", not "prove this is exploitable"), require demonstrated preconditions — assumed attacker access is the most common false positive — and stop for human review after each finding rather than piling up untriaged reports. Validate findings with a second pass by a fresh agent, never the finder alone.
Format
Run uv run --no-project {baseDir}/scripts/format_goal_prompt.py --fenced on the draft (file or stdin). It collapses whitespace to one line, strips /goal prefixes, quotes, and fences, warns on a missing stop clause, and rejects output over 4,000 characters — shorten or move detail to a file and rerun.
Return exactly one fenced text block, one line:
/goal <single normalized objective>Add no prose around it — except when checklist elements could not be grounded: then follow the block with a Missing: list, one line per gap, telling the user what to supply.
Example
Draft:
/goal Migrate the auth module:
- replace legacyAuth() with auth.verify()
- make sure the tests still workRedrafted and formatted:
/goal All legacyAuth() call sites use auth.verify(): `rg "legacyAuth\(" -t ts` prints nothing AND `npm test` exits 0 (run both, show the output), without modifying vendor/ or weakening any test. If blocked, stop and report attempted paths and the blocker, or stop after 20 turns.Here npm test came from the repo's package.json — not a guess — and pairing it with the zero-matches check closes the cheapest out: deleting the call sites instead of migrating them. When nothing grounds an element, format what exists and flag the gaps:
Draft: make checkout faster, with no metric or benchmark anywhere in context:
/goal Make checkout fasterMissing:
measurable end state — which metric and threshold count as "faster"
verification — the benchmark or command that proves it
stop bound — e.g. "or stop after 20 turns"
Files
- ATTRIBUTION.mdAdded by AutoGineer927 B
- LICENSELicence file added by AutoGineer19.7 KiB
- SKILL.md6.0 KiB
- agents/openai.yaml185 B
- scripts/format_goal_prompt.pyScript3.5 KiB
- scripts/test_format_goal_prompt.pyScript3.3 KiB
ATTRIBUTION.md
Attribution
This folder is an unmodified copy of the Agent Skill "goal-prompt", distributed by AutoGineer (https://autogineer.com/agent-skills).
Commit: e4dd0bb5b15535f7c5a0834187dffba6ac37e4ff
Published by: Trail of Bits (https://github.com/trailofbits)
Publisher: Trail of Bits (https://github.com/trailofbits)
Licence: Creative Commons Attribution-ShareAlike 4.0 International (https://github.com/trailofbits/skills/blob/e4dd0bb5b15535f7c5a0834187dffba6ac37e4ff/LICENSE)
Licence evidence: repository licence LICENSE
Retrieved: 2026-11-07
The skill's own files are unmodified copies. AutoGineer is not affiliated with or endorsed by the author or the publisher.
Files added by AutoGineer
ATTRIBUTION.md: this file, written by AutoGineer
LICENSE: copied from LICENSE
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Declares allowed tools, Needs Python
Security
What our scanner noticed· Low risk
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Trail of Bits
- Publisher
- Trail of Bits (Official)
- Source
- trailofbits/skills · plugins/goal-prompt/skills/goal-prompt · commit e4dd0bb
- Licence
- Creative Commons Attribution-ShareAlike 4.0 International (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Trail of Bits or Trail of Bits.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download goal-prompt.zip