Achieve Goal
Generic goal-oriented skill that plans, executes, debugs, and (when needed) iterates until the goal is met or stop conditions fire.
Modes
| Mode |
Trigger style |
Behavior |
| execute |
"use achieve-goal to run X" |
Plan how to achieve the goal, execute, debug failures using debugging-protocol.md, recover, retry until goal is met. Differs from direct execution: this loop continues through failures rather than reporting and stopping. |
| optimization |
"run the experiment and iterate to achieve metric < target" |
Loop: try → measure → propose new approach → repeat until metric goal met or stop condition. Absorbs the previous iterative-experiment use case. References repo-specific strategy docs (e.g. recsys-experiment-strategies.md) surfaced via fetch-repo-skill. |
| orchestrate |
"execute this multi-milestone plan" (after plan confirmation) |
Create one milestone_N.md per milestone per milestone-execution-protocol.md, embed autonomous prompt, run end-to-end with re-read guard at each step. |
Modes are not strictly mutually exclusive. Orchestrate may dispatch to itself in execute or optimization mode for individual milestones.
When NOT to use
- Request is unambiguous and mechanical ("run this notebook with python3", "rename function X to Y")
- Task is exploratory ("look at this and tell me what you see")
- User explicitly waives planning ("just do it")
References
kb/context/agent-design/clarification-protocol.md — used in the planning phase of all modes
kb/context/agent-design/debugging-protocol.md — used on failure in any mode
kb/context/agent-design/milestone-execution-protocol.md — used in orchestrate mode
kb/context/agent-design/autonomous-behavior.md — embedded at the top of milestone files and any execution document
- Repo-specific context docs (e.g.
kb/context/experiments/experiment-policies.md, kb/context/experiments/recsys-experiment-strategies.md) — surfaced via fetch-repo-skill when working on a registered repo
~/.claude/skills/dispatching-parallel-agents/SKILL.md (obra/superpowers) — methodology for concurrent subagent workflows; consult before scaling out parallel work in execute or optimization mode
~/.claude/skills/verification-before-completion/SKILL.md (obra/superpowers) — evidence gating before declaring a milestone or goal met
~/.claude/skills/cli-review/SKILL.md — CLI-based review gates via Gemini CLI (plans, large corpora) and Codex CLI (code); consult for routing and invocation patterns
- For ML benchmarks:
kb/context/experiments/dataset-sources.md + scripts at ~/.claude/tools/experiment-tools/ (download_dataset.py, train_mlp.py)
Steps
Phase 1 — Clarify (all modes)
- Apply
kb/context/agent-design/clarification-protocol.md — close ambiguity in goal, success criteria, scope, constraints, failure handling, interaction expectations
- Detect mode from clarified goal:
- Single-stage goal with potential failures → execute
- Iteration toward a metric target → optimization
- Multi-milestone with checkpoints → orchestrate
- State the chosen mode and the plan back to the user. Interactive invocation: wait for confirmation before proceeding to Phase 2. Autonomous invocation (dreaming mission, NEVER-STOP context, scheduled/headless run): do NOT wait — state the plan, proceed, and flag the plan in the mission log / REVIEW_INBOX for retroactive review
Phase 2 — Plan
- For execute: lay out the steps and known risk points; identify dispatch targets (which subagents/skills will run each step)
- For optimization: define the metric, the iteration unit, the proposal strategy (reference
recsys-experiment-strategies.md if recsys), and stop conditions
- For orchestrate: enumerate milestones, success criteria for each, and any cross-milestone state
CLI Review Routing (apply to every plan before confirming with user):
Is the plan large, cross-cutting, or uncertain?
→ add a Gemini CLI review gate before Phase 3 (see cli-review skill)
Will implementation touch non-trivial code across multiple files?
→ add a Codex CLI review gate after Phase 3 execution (see cli-review skill)
Reviews are optional gates — include them when task risk or complexity justifies the overhead. Reference ~/.claude/skills/cli-review/SKILL.md for routing rules and invocation patterns.
Phase 3 — Execute
- Dispatch to subagents (no single-agent execution loops)
- Embed the
autonomous-behavior.md NEVER STOP + HEADLESS-SAFE prompt verbatim at the start of execution AND in every subagent brief — briefs are the only channel subagents receive (memory files never reach them)
- On failure → apply
debugging-protocol.md (reproduce → minimize → validate single → scale)
- For orchestrate specifically: create
milestone_N.md files per milestone-execution-protocol.md; write to the active project folder
Phase 4 — Stop conditions
| Condition |
Action |
| Goal met |
Report; close milestone files if any; summarize |
| 3 consecutive failures with no path forward |
Escalate to user |
| Hard iteration cap reached (configurable, default 10) |
Surface to user |
| A step would need a confirmation-gated command (rm/mv/kill/pkill/sudo/destructive git) |
Never issue it in autonomous mode — use the HEADLESS-SAFE substitute from autonomous-behavior.md; if no substitute fits, escalate and log via document-agent-failure |
| User interrupts |
Pause, summarize state |
Output
- Goal achieved → summary of what was done, key decisions, any open follow-ups
- Or: structured escalation to user with current state, blockers, and proposed next steps
1---2name: achieve-goal3description: Generic skill for tasks that require planning, debugging, or iteration before they can be completed. Three modes — execute / optimization / orchestrate — selected by the request shape. Discriminator: does the task require planning? If the request is unambiguous and mechanical ("run this notebook with python3"), do NOT use this skill — direct execution is correct. If achieving the goal requires planning, recovery from failures, or iterating toward a target, this skill applies. Triggers: "use achieve-goal to X", "iterate to achieve metric Y", "execute this multi-milestone plan", or any goal that needs planning + recovery.4---56# Achieve Goal78Generic goal-oriented skill that plans, executes, debugs, and (when needed) iterates until the goal is met or stop conditions fire.910## Modes1112| Mode | Trigger style | Behavior |13|------|--------------|----------|14| **execute** | "use achieve-goal to run X" | Plan how to achieve the goal, execute, debug failures using `debugging-protocol.md`, recover, retry until goal is met. Differs from direct execution: this loop continues *through* failures rather than reporting and stopping. |15| **optimization** | "run the experiment and iterate to achieve metric < target" | Loop: try → measure → propose new approach → repeat until metric goal met or stop condition. Absorbs the previous `iterative-experiment` use case. References repo-specific strategy docs (e.g. `recsys-experiment-strategies.md`) surfaced via `fetch-repo-skill`. |16| **orchestrate** | "execute this multi-milestone plan" (after plan confirmation) | Create one `milestone_N.md` per milestone per `milestone-execution-protocol.md`, embed autonomous prompt, run end-to-end with re-read guard at each step. |1718Modes are not strictly mutually exclusive. Orchestrate may dispatch to itself in execute or optimization mode for individual milestones.1920## When NOT to use2122- Request is unambiguous and mechanical ("run this notebook with python3", "rename function X to Y")23- Task is exploratory ("look at this and tell me what you see")24- User explicitly waives planning ("just do it")2526## References2728- `kb/context/agent-design/clarification-protocol.md` — used in the planning phase of all modes29- `kb/context/agent-design/debugging-protocol.md` — used on failure in any mode30- `kb/context/agent-design/milestone-execution-protocol.md` — used in orchestrate mode31- `kb/context/agent-design/autonomous-behavior.md` — embedded at the top of milestone files and any execution document32- Repo-specific context docs (e.g. `kb/context/experiments/experiment-policies.md`, `kb/context/experiments/recsys-experiment-strategies.md`) — surfaced via `fetch-repo-skill` when working on a registered repo33- `~/.claude/skills/dispatching-parallel-agents/SKILL.md` (obra/superpowers) — methodology for concurrent subagent workflows; consult before scaling out parallel work in execute or optimization mode34- `~/.claude/skills/verification-before-completion/SKILL.md` (obra/superpowers) — evidence gating before declaring a milestone or goal met35- `~/.claude/skills/cli-review/SKILL.md` — CLI-based review gates via Gemini CLI (plans, large corpora) and Codex CLI (code); consult for routing and invocation patterns36- For ML benchmarks: `kb/context/experiments/dataset-sources.md` + scripts at `~/.claude/tools/experiment-tools/` (download_dataset.py, train_mlp.py)3738## Steps3940### Phase 1 — Clarify (all modes)41421. Apply `kb/context/agent-design/clarification-protocol.md` — close ambiguity in goal, success criteria, scope, constraints, failure handling, interaction expectations432. Detect mode from clarified goal:44 - Single-stage goal with potential failures → **execute**45 - Iteration toward a metric target → **optimization**46 - Multi-milestone with checkpoints → **orchestrate**473. State the chosen mode and the plan back to the user. **Interactive invocation:** wait for confirmation before proceeding to Phase 2. **Autonomous invocation** (dreaming mission, NEVER-STOP context, scheduled/headless run): do NOT wait — state the plan, proceed, and flag the plan in the mission log / REVIEW_INBOX for retroactive review4849### Phase 2 — Plan5051- For **execute**: lay out the steps and known risk points; identify dispatch targets (which subagents/skills will run each step)52- For **optimization**: define the metric, the iteration unit, the proposal strategy (reference `recsys-experiment-strategies.md` if recsys), and stop conditions53- For **orchestrate**: enumerate milestones, success criteria for each, and any cross-milestone state5455**CLI Review Routing** (apply to every plan before confirming with user):56```57Is the plan large, cross-cutting, or uncertain?58 → add a Gemini CLI review gate before Phase 3 (see cli-review skill)5960Will implementation touch non-trivial code across multiple files?61 → add a Codex CLI review gate after Phase 3 execution (see cli-review skill)62```63Reviews are optional gates — include them when task risk or complexity justifies the overhead. Reference `~/.claude/skills/cli-review/SKILL.md` for routing rules and invocation patterns.6465### Phase 3 — Execute6667- Dispatch to subagents (no single-agent execution loops)68- Embed the `autonomous-behavior.md` NEVER STOP + HEADLESS-SAFE prompt verbatim at the start of execution AND in every subagent brief — briefs are the only channel subagents receive (memory files never reach them)69- On failure → apply `debugging-protocol.md` (reproduce → minimize → validate single → scale)70- For **orchestrate** specifically: create `milestone_N.md` files per `milestone-execution-protocol.md`; write to the active project folder7172### Phase 4 — Stop conditions7374| Condition | Action |75|-----------|--------|76| Goal met | Report; close milestone files if any; summarize |77| 3 consecutive failures with no path forward | Escalate to user |78| Hard iteration cap reached (configurable, default 10) | Surface to user |79| A step would need a confirmation-gated command (rm/mv/kill/pkill/sudo/destructive git) | Never issue it in autonomous mode — use the HEADLESS-SAFE substitute from `autonomous-behavior.md`; if no substitute fits, escalate and log via `document-agent-failure` |80| User interrupts | Pause, summarize state |8182## Output8384- Goal achieved → summary of what was done, key decisions, any open follow-ups85- Or: structured escalation to user with current state, blockers, and proposed next steps