goal-loop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoal Loop
Goal Loop
Operator-invoked objective loop. Turn a bounded goal into success criteria, execute small passes, verify, and loop only on remaining gaps. Stop cleanly when the goal is complete, blocked, or the loop budget is exhausted.
由操作员调用的目标循环机制。将有界目标转化为成功标准,执行小步迭代,进行验证,仅针对剩余差距重复循环。当目标完成、遇到阻塞或循环预算耗尽时,干净地停止循环。
Invocation Boundary
调用边界
- Run only when the operator explicitly asks for or equivalent loop/until-done behavior.
goal-loop - Use for non-ticket objectives, refactors, cleanup, docs rewrites, or follow-up work after a ticket.
- Do not replace for ticket lifecycle planning, and do not replace
/ticketfor review-only cleanup of an existing diff.goal-review - Never stage, commit, push, continue a git operation, or invoke .
ship
- 仅当操作员明确要求使用或类似的“循环直至完成”行为时运行。
goal-loop - 适用于非工单目标、重构、代码清理、文档重写或工单完成后的跟进工作。
- 请勿替代用于工单生命周期规划,也不要替代
/ticket用于仅对现有差异进行审核清理。goal-review - 绝对不要执行暂存、提交、推送、继续Git操作或调用命令。
ship
Arguments
参数
Parse these optional flags before reading files:
| Flag | Meaning |
|---|---|
| Use an existing plan as the goal source. |
| Limit reads and edits to a path or package. |
| Verification command to run after each round. |
| Loop budget. Default |
| After all criteria pass, run one single-pass quality gate on the loop's diff against the shared review rubric. |
Everything else is the goal text.
在读取文件前解析这些可选标志:
| 标志 | 含义 |
|---|---|
| 使用现有计划作为目标来源。 |
| 将读取和编辑操作限制在指定路径或包内。 |
| 每轮迭代后运行的验证命令。 |
| 循环预算。默认值为 |
| 当所有标准都满足后,针对循环产生的差异,对照通用审核准则运行一次单轮质量检查。 |
其余内容均为目标文本。
Goal Contract
目标契约
Before editing, write a compact contract:
markdown
Goal: <one sentence>
Scope: <files/packages allowed, or "current diff" / "ask required">
Success criteria:
- [ ] <criterion 1>
- [ ] <criterion 2>
Verification:
- <command or manual/static check>
Loop budget: <N> rounds
Stop conditions: complete | blocked | budget exhausted | human decision neededIf the goal, scope, success criteria, or verification cannot be stated concretely, stop and ask one clarifying question. Never start broad cleanup from a vague goal such as "clean the repo" without an explicit scope.
在编辑前,编写一份简洁的契约:
markdown
Goal: <一句话描述>
Scope: <允许操作的文件/包,或“当前差异”/“需确认”>
Success criteria:
- [ ] <标准1>
- [ ] <标准2>
Verification:
- <命令或手动/静态检查>
Loop budget: <N> rounds
Stop conditions: complete | blocked | budget exhausted | human decision needed如果无法明确表述目标、范围、成功标准或验证方式,请停止操作并提出一个澄清问题。绝对不要在没有明确范围的情况下,从诸如“清理仓库”之类的模糊目标开始大范围清理工作。
Loop
循环流程
For each round, up to the loop budget:
- Inspect. Read the goal source, current , relevant project rules (
git status --short, else.turkit.yaml -> rules.docs/CLAUDE.md/AGENTS.mdwhen present), and only the files needed for the current round.docs/conventions/*.md - Plan the round. Pick the smallest set of edits that can satisfy the next unmet criteria. If a change would expand scope, stop and ask.
- Edit. Apply changes in place. Keep edits focused on the contract. Do not batch unrelated cleanup.
- Verify. Run when provided. Otherwise resolve the project
--verify/check/lintcommand pertestand run the narrowest relevant gate. If no command is available, do a static self-check and mark verification asreferences/build-tool-detection.md.unverified - Score. Mark each success criterion as ,
done, orgap. Continue only for concrete gaps that can be safely fixed inside the scope.blocked
Stop early when all criteria are and verification passes. If the same verification failure survives two rounds, stop as and report it instead of looping blindly.
doneblockedQuality gate ( only). When all criteria are and verification passes, review the diff the loop produced against : apply its Auto-fix bucket, then treat remaining P0/P1 findings as gaps for at most one extra round. Never loop the gate; findings that survive that round go under in the report.
--reviewdonereferences/review-rubric.mdRemaining在循环预算范围内,每轮执行以下步骤:
- 检查。读取目标来源、当前输出、相关项目规则(
git status --short,若不存在则读取.turkit.yaml -> rules.docs/CLAUDE.md/AGENTS.md,如果有这些文件),以及当前轮次所需的唯一文件。docs/conventions/*.md - 规划本轮迭代。选择最小的编辑集来满足下一个未达成的标准。如果某项变更会扩大范围,请停止并询问。
- 编辑。在原地应用变更。保持编辑内容聚焦于契约要求。不要批量处理无关的清理工作。
- 验证。如果提供了命令则运行它。否则,根据
--verify确定项目的references/build-tool-detection.md/check/lint命令,并运行最相关的窄范围检查。如果没有可用命令,则进行静态自我检查,并将验证标记为test。unverified - 评分。将每个成功标准标记为、
done或gap。仅针对可在范围内安全修复的具体差距继续循环。blocked
当所有标准均为且验证通过时,提前停止循环。如果同一验证失败连续出现两轮,则标记为并停止循环,进行报告,而非盲目重复循环。
doneblocked质量检查(仅模式)。当所有标准均为且验证通过时,对照审核循环产生的差异:应用其自动修复分类,然后将剩余的P0/P1问题视为差距,进行最多一轮额外迭代。绝对不要重复运行质量检查;若经过该轮后仍有问题,则将其归入报告的部分。
--reviewdonereferences/review-rubric.mdRemainingOrchestration & Platform
编排与平台
Use parallel subagents only for read-only investigation, such as surveying candidate files or checking whether a criterion is satisfied. The main agent applies all edits. If subagents or Workflow tools are unavailable, run the same inspection sequentially. Correctness must not depend on Claude-only orchestration.
仅在只读调查场景下使用并行子Agent,例如调查候选文件或检查某标准是否已满足。主Agent负责应用所有编辑。如果子Agent或工作流工具不可用,则按顺序执行相同的检查操作。正确性不得依赖于仅Claude支持的编排方式。
Output Format
输出格式
Keep the final report short:
markdown
undefined最终报告需简洁:
markdown
undefinedGoal Loop Result
Goal Loop Result
Status: complete | partial | blocked | budget-exhausted
Rounds: <used>/<max>
Goal: <one sentence>
Criteria:
- [done|gap|blocked] <criterion>
Changes:
- <file> - <one-line change>
Verification:
- Ran: <commands or "static check only">
- Result: pass | fail | unverified
- Quality gate (--review): not requested | clean | residual findings under Remaining
Remaining:
- <none or concrete follow-up>
undefinedStatus: complete | partial | blocked | budget-exhausted
Rounds: <已使用>/<最大>
Goal: <一句话描述>
Criteria:
- [done|gap|blocked] <标准>
Changes:
- <文件> - <一行描述变更>
Verification:
- Ran: <命令或“仅静态检查”>
- Result: pass | fail | unverified
- Quality gate (--review): not requested | clean | residual findings under Remaining
Remaining:
- <无或具体跟进事项>
undefinedGuardrails
防护规则
- Never continue a vague or whole-repo goal without explicit scope.
- Never broaden the goal mid-loop without asking.
- Never hide skipped verification or coverage caps.
- Never keep looping after a repeated failure with no new evidence.
- Never stage, commit, push, amend, rebase, reset, or rewrite history.
- Apply for operator-facing language/style.
references/output-preferences.md
- 若无明确范围,绝对不要继续执行模糊或全仓库范围的目标。
- 循环过程中,未经询问绝对不要扩大目标范围。
- 绝对不要隐瞒跳过的验证或覆盖限制。
- 若重复出现失败且无新证据,绝对不要继续循环。
- 绝对不要执行暂存、提交、推送、修正、变基、重置或重写历史记录的操作。
- 面向操作员的语言/风格需遵循的要求。
references/output-preferences.md