From petekp-agent-skills
Compiles plain-language tasks into concise, auditable `/goal` blocks for Claude Code or Codex with definitions of done, proof surfaces, and stop conditions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/petekp-agent-skills:write-goalThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Act as a host-aware goal compiler, not a generic prompt rewriter. Turn the user's request into a compact `/goal` that has a clear definition of done, operating instructions, proof the evaluator can see, and a bounded stop policy. Draft the goal; do not activate it unless the user explicitly asks you to start or set the goal.
Act as a host-aware goal compiler, not a generic prompt rewriter. Turn the user's request into a compact /goal that has a clear definition of done, operating instructions, proof the evaluator can see, and a bounded stop policy. Draft the goal; do not activate it unless the user explicitly asks you to start or set the goal.
/goal completion-condition evaluator./goal and call out host assumptions only if they matter./goal short enough to be readable. Prefer one compact block, but use labels like Definition of done: and Operating instructions: when they make evaluator behavior clearer.Codex goals are for long-running work that should keep progressing across turns toward a verifiable stopping condition. Good Codex goals name the durable objective, validation loop, checkpoint evidence, scope boundary, and pause/blocked behavior.
Claude Code /goal sets a session-scoped completion condition. A small evaluator model checks the condition after each turn. It does not run commands or read files independently, so the goal must require Claude to surface proof in the transcript. A strong Claude Code condition has one measurable end state, a stated check such as a passing command or empty queue, and constraints that matter. Include a turn, time, or cost bound when runaway work is a risk. Claude Code goals are limited to 4,000 characters and require Claude Code v2.1.139 or later.
Every compiled goal should answer these questions:
Prefer this shape:
/goal Definition of done: <one measurable end state>, verified by <specific proof surfaced in the transcript>, while preserving <constraints and scope>. Operating instructions: use <allowed inputs/tools/files>, inspect <latest evidence> between iterations, make the smallest defensible next move, and print a completion receipt with <changed files/artifacts, exact check results, review outcome, and remaining risks>. Review depth: <risk tier and required review loop>. Stop if <blocked condition, no defensible path, or turn/time/cost bound> with <attempted paths, evidence gathered, blocker, unresolved findings, and next input needed>.
Do not prescribe every implementation step unless the user already did. Leave enough room for the agent to adapt.
Use the lightest review loop that protects the user:
Treat severity as impact on the goal:
Return:
Recommended Goal: a ready-to-use /goal ... block.Assumptions: only if you filled gaps that matter.Compiler Notes: one or two bullets naming the host, proof surface, stop bound, and review tier.If a goal is not appropriate, return:
Better As A Prompt: a concise normal prompt.Why Not A Goal: one sentence explaining the missing durable objective or verification surface.Keep the answer concise. The user came for the goal, not a lecture about goals.
User prompt:
Use $write-goal for Claude Code: keep working on this flaky checkout test until it is fixed or we know exactly why it cannot be fixed.
Recommended Goal:
/goal Definition of done: the flaky checkout test either passes reliably or has a transcript-supported blocker, verified by reproducing the failure when possible and then surfacing exact focused test results plus the relevant regression command output, while preserving public checkout behavior and existing test coverage. Operating instructions: use the checkout code, fixtures, local logs, and test commands; after each failure, update the hypothesis, make the smallest defensible change, and rerun focused verification. Print a completion receipt with changed files, exact commands and exits, review outcome, and remaining risks. Review depth: medium, with one adversarial review and all medium-or-above findings resolved. Stop after 20 turns, if the failure cannot be reproduced after reasonable attempts, or if no valid path remains; report attempted reproductions, evidence gathered, blocker, unresolved findings, and next input needed.
User prompt:
Use $write-goal for Codex: migrate the billing module to the new API.
Recommended Goal:
/goal Definition of done: the billing module uses the new API at every intended call site, verified by source inspection surfaced in the transcript plus passing focused billing tests and the relevant build/typecheck command, while preserving public billing behavior, existing data contracts, and unrelated files. Operating instructions: use the billing code, migration docs, tests, and local commands; work in small slices, inspect failures after each run, and keep a progress receipt of migrated call sites. Print a completion receipt with changed files, exact validation results, unresolved risks, and review outcome. Review depth: high because this is a behavior-affecting migration; require two consecutive adversarial reviews with no medium-or-above findings before completion. Stop if verification cannot run, API behavior cannot be confirmed, or no defensible path remains; report attempted paths, evidence, blocker, and next input needed.
Bad goal:
/goal Improve the docs.
Better goal:
/goal Definition of done: the Goals docs clearly explain when to use `/goal`, how to set/check/clear one, and two realistic examples, verified by a successful docs build and transcript-visible source checks against the current host docs, while preserving existing terminology and avoiding unrelated docs churn. Operating instructions: edit only the relevant docs, compare each claim to source docs, and print changed files, exact build result, review outcome, and remaining risks. Review depth: medium because command semantics are described; run one adversarial review and resolve medium-or-above findings. Stop if source behavior cannot be confirmed or validation cannot run, with attempted checks and next input needed.
Bad goal:
/goal Make the app better and faster.
Better As A Prompt:
Inspect the app and propose the three highest-impact improvements for performance or UX, with evidence for each and a suggested verification command.
Why Not A Goal: The request has multiple undefined outcomes and no single proof surface.
Bad goal:
/goal All tests pass.
Better goal:
/goal Definition of done: the currently failing test suite passes without hiding or deleting coverage, verified by transcript-visible output from the failing command rerun plus a clean `git diff` review showing no unrelated test weakening. Operating instructions: identify the first failure, fix the smallest root cause, rerun focused checks before broad checks, and print changed files, exact commands/exits, review outcome, and remaining risks. Review depth: medium; run one adversarial review and resolve medium-or-above findings. Stop after 15 turns, if the suite cannot be run, or if failures require product decisions; report evidence, blocker, and next input needed.
User prompt:
Use $write-goal: explain this error message.
Better As A Prompt:
Explain this error message in plain English, identify the likely cause, and suggest the next command or file to inspect.
Why Not A Goal: This is a one-off explanation request without a durable objective that needs continued work.
npx claudepluginhub petekp/agent-skills --plugin rustGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.