goal-prompt
O que ela faz
Redige uma condição de meta em uma linha que mantém um agente trabalhando em uma tarefa longa até que uma linha de chegada verificável seja atingida. É para quem usa o modo goal no Claude Code ou no Codex.
Quando usar
- ✓Quando um usuário quer escrever ou melhorar um comando /goal para uma tarefa de longa duração.
- ✓Quando um usuário quer uma condição de meta compactada ou limpa antes de colá-la.
- ✓Quando um usuário quer uma linha de chegada que um agente consiga verificar.
Link da skill
https://github.com/trailofbits/skills/blob/main/plugins/goal-prompt/skills/goal-prompt/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Escreva um comando /goal que mantenha o trabalho de migração do nosso código de autenticação até que os testes passem.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
A skill escreve uma condição com um estado final, um escopo a ser lido primeiro, uma verificação declarada, as coisas que não podem mudar e um limite de parada. Depois a formata como uma linha única abaixo do limite de caracteres.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do GitHub.
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
Perguntas frequentes
Por que uma meta precisa de um limite de parada?
Sem um, uma condição mal formulada pode entrar em loop para sempre, então a skill acrescenta um limite de parada ou uma cláusula de bloqueio.
A condição pode usar or?
Não. A skill diz para juntar as condições com AND, já que um or deixa o loop escolher o caminho mais fácil.
Qual é o limite de tamanho?
A skill diz que uma meta é uma linha de até 4.000 caracteres.
Detalhes
Descrição original do autor
Drafts copy-paste-ready /goal commands for goal mode in Claude Code and Codex. Use when the user asks to create, write, rewrite, improve, compress, clean up, or prepare a goal prompt, goal condition, /goal command, goal-mode objective, or copy-ready long-running task objective.
repo: trailofbits/skills
Popularidade
- Estrelas no GitHub
- 8,0 mil
- Posição no ranking
- #12682
- Licença
- CC-BY-SA-4.0
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
audit-context-building
8,0 milAjuda seu agente a conhecer uma base de código desconhecida antes de uma revisão de segurança, mapeando o que cada função assume, garante e depende.
algorand-vulnerability-scanner
8,0 milAjuda seu agente a analisar contratos inteligentes da Algorand, escritos em TEAL ou PyTeal, em busca de 11 problemas comuns de segurança, como ataques de rekeying e taxas não verificadas.
audit-prep-assistant
8,0 milAjuda seu agente a preparar uma base de código para uma revisão de segurança externa, com análise estática, cobertura de testes, limpeza de código morto e documentação clara.
cairo-vulnerability-scanner
8,0 milAjuda seu agente a analisar contratos inteligentes em Cairo na StarkNet em busca de 6 problemas graves, incluindo estouro aritmético, mensagens arriscadas entre camadas e replay de assinatura.
Skills parecidas
writing-skills
311 milEnsina seu agente a escrever novas skills e testar cada uma antes, conferindo se a skill realmente muda o comportamento do agente.
writing-for-agents
310 milExplica como escrever instruções claras para agentes de IA, incluindo skills, arquivos AGENTS.md e CLAUDE.md, para que o agente se comporte de forma previsível.
bengali-nlp
280 milFaz seu agente processar textos em bengali. Ajuda a entender e trabalhar com a língua, normalizando o texto e lidando com suas características únicas.