goal-loop
Skill này làm gì
Lệnh `/goal` biến một công việc thành quy trình liên tục mà agent tự xử lý. Quy trình gồm các bước lập kế hoạch, thực hiện, kiểm tra và đánh giá, lặp lại cho đến khi công việc xong, bạn tạm dừng, hoặc hết thời gian hay tài nguyên.
Khi nào nên dùng
- ✓Khi công việc dự kiến mất hơn 30 phút để hoàn thành.
- ✓Khi có cách rõ ràng để kiểm tra công việc đã xong chưa (ví dụ: các bài test đều chạy đúng).
- ✓Khi dự án đã được thiết lập sẵn để tự động hóa (có test và tài liệu).
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/goal-loop/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy lập kế hoạch để chuyển dự án của chúng tôi từ Python 2 sang Python 3, đảm bảo tất cả test đều chạy đúng và API công khai không thay đổi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent nhận hướng dẫn rõ ràng về mục tiêu, những gì không được thay đổi, cách kiểm tra tiến độ và lúc nào thì dừng. Agent làm việc theo từng giai đoạn, báo cáo các việc đã làm, cho đến khi đạt mục tiêu hoặc cần con người can thiệp.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
/goalfeature — 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:
- Task is >30 min of mechanical work.
- There's a verifiable stop condition (tests pass, coverage hit, eval ≥ X, build green).
- Repo is agent-ready (working build, decent tests,
AGENTS.mdpresent).
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)
- Objective — one sentence, one concrete outcome.
- Constraints — what must NOT change (public API, files, libs, conventions).
- Validation command — the exact shell command that proves progress (
pytest -q,pnpm test, etc.). - Stop condition — verifiable: "Stop when X passes" OR "when further changes need human/product input."
- Documentation — one sentence instructing the agent to write concise, targeted docs for every change, either creating new
.mdfiles 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
/goalprompt must include a single sentence committing the agent to concise, targeted docs — new.mdfiles or focused updates to existing docs.
…
Câu hỏi thường gặp
“Ralph loop” là gì?
Đây là tên nội bộ của quy trình mà `/goal` sử dụng: lập kế hoạch, thực hiện, kiểm tra, đánh giá, rồi lặp lại cho đến khi đạt mục tiêu.
Tôi có thể dùng `/goal` cho mọi công việc không?
Không. Lệnh này phù hợp nhất với công việc dài, được xác định rõ ràng và có tiêu chí “xong” cụ thể. Không phù hợp với việc thử nghiệm mở hoặc công việc không có điểm kết thúc.
“Điều kiện dừng có thể kiểm chứng” là gì?
Đó là một quy tắc rõ ràng, khách quan cho biết công việc đã kết thúc, chẳng hạn “tất cả test đã chạy đúng” hoặc “độ bao phủ mã đạt X%”. Đây là thứ có thể đo được.
Chi tiết
Mô tả gốc của tác giả
Draft and explain persistent goal-loop prompts for long-running agent work with clear stop conditions.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #4765
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.