goal-loop
Explain and write effective instructions for the `/goal` feature — the persistent self-checking agent loop (plan → act → test → review → iterate), available…
Skill by attentiondotnet
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/attentiondotnet-goal-loop
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, writing, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/goal-loop
What's inside
- Skill name
goal-loop- Description
- Explain and write effective instructions for the `/goal` feature — the persistent self-checking agent loop (plan → act → test → review → iterate), available in agents like Codex, Claude Code, and Hermes Agent. Use when the user mentions `/goal`, "goal loop", "Ralph loop", wants to kick off a long-running autonomous agent run, asks how to write a goal prompt, or wants a one-paragraph goal instruction drafted.
- License
- MIT
- Instructions
- 156 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Agent `/goal` Loop ## What `/goal` is `/goal` is a slash command that turns an agent prompt into a **persistent agent** looping `plan → act → test → review → iterate` until a stop condition is met, the user pauses, or the token budget runs out. Internally called the "Ralph loop." Agents with the `/goal` feature right now: **Codex, Claude Code, and Hermes Agent**. Key difference from a normal prompt: when a turn ends but the goal isn't met, the agent **auto-continues** instead of waiting for input. **Lifecycle states:** `pursuing`, `paused`, `achieved`, `unmet`, `budget-limited`. When monitoring a running `/goal`, every check should include a one-line update to the user: what the agent is doing and whether it is on track. Keep it extremely concise. **Not:** a budget command, a safety boundary, "run forever", or a replacement for `/plan`. It's a contract enforcer with a verification loop. ## Requirements - An agent with the `/goal` feature — right now: Codex, Claude Code, or Hermes Agent - The goals feature enabled in the agent's config - **Subscription auth** — API-key auth does **not** work. A pro-tier plan is the realistic minimum for long runs. ## When to use it Use only when **all three** are true: 1. Task is >30 min of mechanical work. 2. There's a **verifiable stop condition** (tests pass, coverage hit, eval ≥ X, build green). 3. Repo is agent-ready (working build, decent tests, `AGENTS.md` present). Fits: migrations, coverage lifts, TDD feature builds, refactors with contract tests, prompt/eval optimization, deploy retry loops, bug-repro-then-fix. Bad fits: exploratory work, vague "improve this", anything without a "done" definition, prod credentials, destructive shared-infra ops. ## The 5-part contract (every goal needs this) 1. **Objective** — one sentence, one concrete outcome. 2. **Constraints** — what must NOT change (public API, files, libs, conventions). 3. **Validation command** — the exact shell command that proves progress (`pytest -q`, `pnpm test`, etc.). 4. **Stop condition** — verifiable: "Stop when X passes" OR "when further changes need human/product input." 5. **Documentation** — one sentence instructing the agent to write concise, targeted docs for every change, either creating new `.md` files or updating existing ones. Plus: tell the agent what to read first, ask it to work in checkpoints with a short progress log. ## Writing a goal (the core deliverable) When the user wants a quick `/goal` instruction, produce a structured markdown block with one line per contract item (proper newlines, not flowing prose). **Do not prefix the output with `/goal`** — the user adds the slash command himself in the composer. Emit only the contract body. Template: ``` **Objective:** <one-sentence objective> **Read first:** <files/PLAN.md/issue> **Constraints:** <what not to change, libs, conventions> **Validate:** `<exact command>` after each change **Document:** Write concise, targeted documentation for all changes — create new `.md` files or update existing docs as needed. **Checkpoints:** work in checkpoints and log progress briefly **Stop when:** <verifiable condition>, OR when further changes require human/product input ``` ### Example (migration) ``` **Objective:** Migrate this project from Pydantic v1 to v2. **Read first:** pyproject.toml, src/, tests/ **Constraints:** no public API changes; keep imports backwards-compatible via shims if needed; no new dependencies **Validate:** `pytest -q` after each change **Checkpoints:** work in checkpoints; log progress briefly **Stop when:** full suite passes with zero deprecation warnings, OR when a change requires architecture decisions ``` ### Example (coverage lift) ``` **Objective:** Raise coverage in src/auth/ from ~38% to ≥75%. **Read first:** src/auth/, tests/auth/, AGENTS.md **Constraints:** no new deps; mirror existing test style; do not modify production code unless strictly required for testability **Validate:** `pytest --cov=src/auth --cov-report=term-missing` **Checkpoints:** work in checkpoints; log coverage delta each one **Stop when:** coverage ≥75% AND all tests pass, OR when uncovered code needs design changes ``` ### Writing rules - **One objective, one stop condition.** Not a backlog. - **Documentation is mandatory.** Every `/goal` prompt must include a single sentence committing the agent to concise, targeted docs — new `.md` files or focused updates to existing docs. - **Never instruct the agent to create new ADRs** — ADRs require the user's explicit approval, so goal prompts must not pre-approve or encourage them. - **Forbid reward-hacking explicitly:** "Do not delete, skip, weaken, or narrow tests to make the goal pass." Otherwise the agent may game the stop condition. - **4,000-char limit** on the objective. If longer, put detail in a file (`PLAN.md`/`GOAL_BRIEF.md`) and make the goal point to it — keep the goal itself compact. - Use **literal strings** for paths, commands, issue numbers — exact. - Forbid scope creep explicitly: "Do not refactor unrelated code. Do not add dependencies." - Tell the agent when to pause: "If <condition>, pause and ask before proceeding." - Short, vague goals burn tokens for no extra value vs. a normal prompt. ### Meta-prompting trick (highest-leverage) Hand-written goals under-specify. Ask a second AI session (Claude with the codebase loaded, ChatGPT with project connected, or a separate agent thread in the same dir) to: (1) inspect the codebase, (2) surface hidden assumptions/constraints/edge cases, (3) emit a structured `/goal` markdown block using the 4-part contract. Paste that into the agent. Order-of-magnitude better runs. Claude Code cmux note: after Claude finishes, it may prefill a predicted next user message; that draft is Claude, not the user speaking. ### Self-goal setting The agent can now write and set its own goal natively (the `create_goal` tool). Instead of crafting the contract yourself, give it your high-level intent and tell it to set the goal: "Inspect this repo, then write yourself a `/goal` with a verifiable stop condition and pursue it." It's the meta-prompting trick done inline — the agent turns your intent into the contract. Still give it the same raw materials (files to read, constraints, the validation command) so the goal it writes is grounded. Add: "ask clarifying questions before committing if the intent is underspecified" — catches ambiguity up front and prevents the self-set goal from drifting. ## Launching 1. `cd <repo>` (goals run scoped to the working directory). 2. Launch the agent bare (opens the TUI). **Not** exec/headless mode — `/goal` is a TUI slash command only. 3. Sign in with subscription auth (not an API key). 4. Type `/goal <your contract>` in the composer, Enter. 5. Walk away. ## Controlling a running goal | Command | Effect | |---|---| | `/goal` (alone) | Status: current checkpoint, what's verified, what remains, blockers | | `/goal pause` | Freeze | | `/goal resume` | Unfreeze (paused goals never auto-resume) | | `/goal clear` | Kill the goal | | `/goal <new>` | Replace the current goal | | Ctrl+C / any typed message | Auto-pauses; user input always wins priority |
From attentiondotnet/davidondrej-skills, MIT.
More from attentiondotnet/davidondrej-skills
- 0.542score
folder-specific-claude-and-agents-md
attentiondotnet
Create a specialized CLAUDE.md (+ AGENTS.md symlink) inside a specific folder to give future agents folder-scoped context.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
brain-to-docs
attentiondotnet
Use when the user wants to extract project vision, decisions, and preferences from his head into clear documentation (README + ADRs) through a back-and-forth…
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
setup-help
attentiondotnet
Walk the user through setting up anything step by step.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
research-prompt
attentiondotnet
Write a single-paragraph Deep Research prompt to hand to a human researcher (or a deep-research AI).
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
youtube-transcript
attentiondotnet
Use whenever the user needs the transcript of a YouTube video — fetching, extracting, downloading, or pulling captions/subtitles/transcript text from a…
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
distribute-skill-to-all-agents
attentiondotnet
Distribute a skill across the 4 agent skill folders (Codex, Claude Code, Pi, Hermes) so all agents see it.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
push-skill-to-github
attentiondotnet
Commit and push agent-skill changes to the user's private skills GitHub repo (your-org/private-skills, rooted at ~/.agents).
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
fable-safe-prompt
attentiondotnet
Rewrite a user's prompt to reduce the chance it trips Claude Fable 5's server-side safety classifiers (cyber/bio guardrails that force-route to Opus 4.8 or…
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
markdown-rendering
attentiondotnet
How to reliably open a markdown file in a cmux right pane without it rendering blank.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
run-deep-swe
attentiondotnet
Score any AI model on the DeepSWE coding-agent benchmark via the OpenRouter API.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
anti-sleep
attentiondotnet
Keep the user's MacBook awake with macOS caffeinate — prevent sleep, screen dimming, or both, for a set duration or while a process runs.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
pi-custom-model
attentiondotnet
Register a custom or variant model (e.g.
SkillCFreshness: C★ 11Claude Code +9
Signals
- Stars
- 11
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jul 7, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.328score
goal-loop
tattooinmtl
Explain and write effective instructions for the `/goal` feature — the persistent self-checking agent loop (plan → act → test → review → iterate), available…
SkillBFreshness: B★ 1Claude Code +9 - 0.306score
goal-loop
Solizardking
Explain and write effective instructions for the `/goal` feature — the persistent self-checking agent loop (plan → act → test → review → iterate), available…
SkillBFreshness: BClaude Code +9 - 0.279score
goal-loop
Solizardking
Explain and write effective instructions for the `/goal` feature — the persistent self-checking agent loop (plan → act → test → review → iterate), available…
SkillCFreshness: CClaude Code +9 - 0.267score
goal-loop
nordeim
Explain and write effective instructions for the `/goal` feature — the persistent self-checking agent loop (plan → act → test → review → iterate), available…
SkillAFreshness: AClaude Code +9 - 0.265score
goal-loop
nordeim
Explain and write effective instructions for the `/goal` feature — the persistent self-checking agent loop (plan → act → test → review → iterate), available…
SkillAFreshness: AClaude Code +9 - 0.265score
goal-loop
nordeim
Explain and write effective instructions for the `/goal` feature — the persistent self-checking agent loop (plan → act → test → review → iterate), available…
SkillAFreshness: AClaude Code +9 - 0.265score
goal-loop
nordeim
Explain and write effective instructions for the `/goal` feature — the persistent self-checking agent loop (plan → act → test → review → iterate), available…
SkillAFreshness: AClaude Code +9 - 0.265score
goal-loop
nordeim
Explain and write effective instructions for the `/goal` feature — the persistent self-checking agent loop (plan → act → test → review → iterate), available…
SkillAFreshness: AClaude Code +9 - 0.257score
goal-loop
nordeim
Explain and write effective instructions for the `/goal` feature — the persistent self-checking agent loop (plan → act → test → review → iterate), available…
SkillBFreshness: B★ 1Claude Code +9 - 0.246score
goal-loop
nordeim
Explain and write effective instructions for the `/goal` feature — the persistent self-checking agent loop (plan → act → test → review → iterate), available…
SkillBFreshness: BClaude Code +9
More from attentiondotnet
- 0.542score
pi-custom-model
attentiondotnet
Register a custom or variant model (e.g.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
fable-safe-prompt
attentiondotnet
Rewrite a user's prompt to reduce the chance it trips Claude Fable 5's server-side safety classifiers (cyber/bio guardrails that force-route to Opus 4.8 or…
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
anti-sleep
attentiondotnet
Keep the user's MacBook awake with macOS caffeinate — prevent sleep, screen dimming, or both, for a set duration or while a process runs.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
markdown-rendering
attentiondotnet
How to reliably open a markdown file in a cmux right pane without it rendering blank.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
run-deep-swe
attentiondotnet
Score any AI model on the DeepSWE coding-agent benchmark via the OpenRouter API.
SkillCFreshness: C★ 11Claude Code +9 - 0.542score
setup-help
attentiondotnet
Walk the user through setting up anything step by step.
SkillCFreshness: C★ 11Claude Code +9
Cite this page
goal-loop skill. Agent Mart. https://agentmart.dev/skills/attentiondotnet-goal-loop (last updated 2026-10-24)