Chuyển đến nội dung
Skillpedia
Prompt và LLM8.0k · #12682

goal-prompt

Skill này làm gì

Soạn một điều kiện mục tiêu một dòng, giữ agent làm việc trên một tác vụ dài cho đến khi đạt một mốc kiểm tra được. Dành cho người dùng chế độ goal trong Claude Code hoặc Codex.

Khi nào nên dùng

  • ✓Khi người dùng muốn viết hoặc cải thiện lệnh /goal cho một tác vụ chạy dài.
  • ✓Khi người dùng muốn rút gọn hoặc làm sạch điều kiện mục tiêu trước khi dán.
  • ✓Khi người dùng muốn một mốc kết thúc mà agent có thể kiểm tra.

Liên kết skill

https://github.com/trailofbits/skills/blob/main/plugins/goal-prompt/skills/goal-prompt/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/trailofbits/skills/blob/main/plugins/goal-prompt/skills/goal-prompt/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Viết cho tôi một lệnh /goal để tiếp tục di chuyển code xác thực của chúng tôi cho đến khi các test đạt.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill viết điều kiện gồm trạng thái kết thúc, phạm vi cần đọc trước, cách kiểm tra đã nêu, những thứ không được thay đổi và giới hạn dừng. Sau đó nó định dạng thành một dòng duy nhất dưới giới hạn ký tự.

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.

Goal Prompt

/goal keeps the agent working until a completion condition is met. Both Claude Code and Codex take it as one line, max 4,000 characters. In Claude Code a small model re-judges the condition after each turn from the transcript alone — it cannot run commands.

Draft a condition that can terminate, then format it. A goal fits work bigger than one turn with a checkable finish line; chain small goals with review between them rather than writing one giant goal.

Draft

Include, joined with AND — never "or", the loop takes the cheaper branch:

  1. End state, not activity — "all legacyAuth() call sites use auth.verify()", not "migrate the auth code". An activity can be claimed; an end state is true or false.
  2. Scope to read first — the files, issue, logs, or plan to read before acting.
  3. Stated check — the exact command and its observable result ("npm test exits 0"), plus an instruction to run it and show the output; a result that never lands in the transcript does not exist to the evaluator.
  4. Invariants — what must not change ("without modifying vendor/"), always including "do not weaken, skip, or edit the checks themselves".
  5. Stop bound or blocked clause — "or stop after 20 turns", "if blocked, stop and report the blocker". Without one, a mis-stated condition loops forever; the formatter warns when it is missing. (Claude Code resets the turn counter on session resume, so a turn bound silently extends across resumes.)

Keep it small. Every constraint narrows the state space the model can explore. Collapse to one terminating criterion when possible, move scope and definitions into a referenced file, and drop non-goals — a constraint earns its place only by closing a real easy-out.

For long goals, also name the final evidence (diff, report, artifact) and require a progress log file — durable state across compaction and resume. If the brief exceeds 4,000 characters, put the details in a GOAL.md and reference that file from the objective.

Never invent missing elements. Ground every element in the user's request, the conversation, or the repository — look things up rather than guessing. If an element cannot be filled from available information, still optimize and format what the user provided, leave the element out, and flag it as missing (see Format). A goal with an invented success condition terminates on the wrong contract.

Close the easy-outs

Before formatting, reread the drafted condition as a lazy model would: what is the cheapest way to make every check pass without doing the intended work? Close the cheapest ones — prefer pairing checks you already have over adding constraints, and do not enumerate every conceivable out into a non-goal list. The recurring outs:

  • Delete or stub instead of fix — "search prints nothing" also holds when the callers are gone; pair such checks with one that proves the feature still works.
  • Pass on a subset — running one test file, narrowing the search path, excluding directories from the check.
  • Game the gate — skipping/xfail-ing tests, hardcoding expected outputs, special-casing the test inputs, editing the check (the invariants rule).
  • Claim without running — declaring done or blocked with no check output in the transcript (the show-the-output rule).

Same discipline as above: an out you cannot close from available information goes in the Missing: list as a warning — an invented or absurd constraint is worse than a flagged gap.

Security research goals

Collapse audit goals to one terminating criterion, such as identifying, triggering, and validating one high-severity vulnerability valid under a referenced threat-model file. That file, not the goal, carries scope, attacker powers, severity baseline, and known findings to skip. Use neutral wording ("trigger and validate", not "prove this is exploitable"), require demonstrated preconditions — assumed attacker access is the most common false positive — and stop for human review after each finding rather than piling up untriaged reports. Validate findings with a second pass by a fresh agent, never the finder alone.

Format

Run uv run --no-project {baseDir}/scripts/format_goal_prompt.py --fenced on the draft (file or stdin). It collapses whitespace to one line, strips /goal prefixes, quotes, and fences, warns on a missing stop clause, and rejects output over 4,000 characters — shorten or move detail to a file and rerun.

Return exactly one fenced

Câu hỏi thường gặp

Vì sao một mục tiêu cần giới hạn dừng?

Nếu không có, một điều kiện được nêu kém có thể lặp vô hạn, nên skill thêm một giới hạn dừng hoặc mệnh đề bị chặn.

Điều kiện có thể dùng or không?

Không. Skill nói nên nối các điều kiện bằng AND, vì or cho phép vòng lặp chọn nhánh dễ hơn.

Giới hạn độ dài là bao nhiêu?

Skill nói một mục tiêu là một dòng với tối đa 4.000 ký tự.

Chi tiết

Mô tả gốc của tác giả

Drafts copy-paste-ready /goal commands for goal mode in Claude Code and Codex. Use when the user asks to create, write, rewrite, improve, compress, clean up, or prepare a goal prompt, goal condition, /goal command, goal-mode objective, or copy-ready long-running task objective.

repo: trailofbits/skills

Độ phổ biến

Sao GitHub
8.0k
Vị trí xếp hạng
#12682
Giấy phép
CC-BY-SA-4.0
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự