目标提示
- 作者仓库星标 0
- 作者更新于 2026年8月24日 23:09
- 作者仓库 skills
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @trailofbits · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
/goal Migrate the auth module:
- replace legacyAuth() with auth.verify()
- make sure the tests still work
# 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:
1. **End state, not activity** — "all `legacyAuth()` call sites use `auth.verify()`", not "migrate the auth code". An activity can be claimed; an end state is true or false.
2. **Scope to read first** — the files, issue, logs, or plan to read before acting.
3. **Stated check** — the exact command and its observable result ("`npm test` exits 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.
4. **Invariants** — what must not change ("without modifying vendor/"), always including "do not weaken, skip, or edit the checks themselves".
5. **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:
```text
/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 work
```
Redrafted and formatted:
```text
/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:
```text
/goal Make checkout faster
```
Missing:
- 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"
章节与文件索引
按说明文件中的顺序排列。
吃水
关闭简单的出口
安全研究目标
格式
示例
文件/命令 -> /goal · legacyAuth() · auth.verify() · npm test · GOAL.md · Missing: · uv run --no-project {baseDir}/scripts/format_goal_prompt.py --fenced · text
内容校验值 -> 8596c53513d5
当前原文的自动摘译,尚未人工审校。
吃水
包含,用 AND 连接 — 绝不是“或”,循环采用更便宜的分支:结束状态,而不是活动 — “所有
legacyAuth()调用站点都使用auth.verify()”,而不是“迁移身份验证代码”。可以申报一项活动;最终状态是真还是假。首先阅读的范围——行动前阅读的文件、问题、日志或计划。规定的检查 - 确切的命令及其可观察的结果(“npm testexits 0”),加上运行它并显示输出的指令;对于评估者来说,从未出现在成绩单中的结果并不存在。关闭简单的出口
在格式化之前,像惰性模型一样重新阅读起草的条件:在不执行预期工作的情况下使每项检查通过的最便宜的方法是什么?关闭最便宜的——更喜欢你已经拥有的配对检查而不是添加约束,并且不要将所有可能的情况都枚举到非目标列表中。反复出现的结果:删除或存根而不是修复——当呼叫者离开时,“搜索不会打印任何内容”;将此类检查与证明该功能仍然有效的检查配对。
安全研究目标
将审核目标压缩为一项终止标准,例如识别、触发和验证在引用的威胁模型文件下有效的一个高严重性漏洞。该文件(而不是目标)包含范围、攻击者能力、严重性基线和要跳过的已知结果。使用中性措辞(“触发和验证”,而不是“证明这是可利用的”),需要经过论证的先决条件——假设攻击者访问是最常见的误报——并在每次发现后停止进行人工审查,而不是堆积未经分类的报告。由新特工第二次验证发现,而不是仅由发现者一人验证。
格式
在草稿(文件或标准输入)上运行
uv run --no-project {baseDir}/scripts/format_goal_prompt.py --fenced。它将空格压缩为一行,去除/goal前缀、引号和栅栏,对缺少的停止子句发出警告,并拒绝超过 4,000 个字符的输出 - 缩短或将详细信息移至文件并重新运行。准确地返回一个被围住的text块,一行:在其周围不添加任何散文 - 除非清单元素无法接地:然后在该块后面添加一个Missing:列表,每个间隙一行,告诉用户要提供什么。示例
草稿:重新起草和格式化:这里的
npm test来自存储库的package.json——不是猜测——并将其与零匹配检查配对关闭了最便宜的方法:删除调用站点而不是迁移它们。当没有任何元素支撑时,格式化存在的内容并标记差距:草案:make checkout faster,上下文中任何地方都没有度量或基准:缺少: