本文へスキップ
Skillpedia
エージェント48k · #4765

goal-loop

できること

`/goal` コマンドは、タスクを自動で進め続ける仕組みを作ります。エージェントは計画、実行、テスト、振り返りのサイクルを繰り返し、タスクが完了するか、ユーザーが一時停止するか、時間や資源が尽きるまで作業を続けます。

使う場面

  • ✓完了までに30分以上かかると予想されるタスクを任せたいとき。
  • ✓タスクが終わったかどうかを確認する明確な方法があるとき(例:テストが通る)。
  • ✓プロジェクトがすでに自動化に対応しているとき(テストやドキュメントが整っているとき)。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/goal-loop/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/goal-loop/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“Python 2から Python 3へプロジェクトを移行する計画を作成してください。すべてのテストが通り、公開APIが変わらないようにしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントには、目的、変更してはいけない部分、進捗の確認方法、停止するタイミングが伝えられます。エージェントは作業を段階ごとに進めながら行動を報告し、目的が達成されるか、人の判断が必要になるまで続けます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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 themselves 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.

…

よくある質問

「Ralph loop」とは何ですか?

`/goal` が内部で使っている仕組みの名前です。計画、実行、テスト、振り返りを行い、目的が達成されるまで繰り返します。

`/goal` はどんなタスクにも使えますか?

いいえ。長くて、完了の基準がはっきりしたタスクに最適です。探索的な作業や、終わりが決まっていないタスクには向いていません。

「検証可能な終了条件」とは何ですか?

「すべてのテストが通った」「コードカバレッジがX%に達した」のように、タスクの終わりを示す明確で客観的なルールのことです。数値などで測定できるものを指します。

詳細

作者による元の説明

Draft and explain persistent goal-loop prompts for long-running agent work with clear stop conditions.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#4765
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル