skills/code-goal-writer/SKILL.md
Write complete, measurable Codex Goal contracts for coding work from user intent. Use when defining, clarifying, refining, or validating goals, /goal prompts, durable coding objectives, acceptance criteria, measurable outcomes, stop conditions, validation loops, Figma or design parity, behavior-preserving migrations, refactors, debugging, implementation tasks, or long-running code agent work. Produces intent, scope, non-goals, acceptance results, verification, checkpoints, pause conditions, and stop conditions before planning or execution.
npx skillsauth add plimeor/agent-skills code-goal-writerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produce a self-contained coding Goal contract that another agent can follow across a long-running engineering task without losing the user's intent, acceptance bar, boundaries, or stopping condition.
The contract emphasizes final acceptance results over implementation approach. It names what done means in observable, measurable terms, and it keeps design, planning, and execution as separate downstream work.
A strong Goal contract:
Start from the user's request and any artifacts they provided. Inspect local files, screenshots, Figma references, docs, issues, tests, logs, or existing plans only when they affect the goal's acceptance bar, validation loop, boundary, or stop condition.
Ask one narrow question when missing information would materially change acceptance. Otherwise proceed with a conservative assumption and label it in the contract.
High-impact missing facts include:
If the user provides a Figma URL, screenshot, mock, design frame, or asks to match a design, the Goal contract is incomplete unless it includes a first-class visual acceptance result.
Default threshold: 0 unapproved visual diffs.
The visual acceptance result must name:
Do not treat manual smoke, Figma inspect, screenshot comparison, visual review, or looks aligned as substitutes for pixel diff evidence unless the user explicitly waives pixel comparison.
When the user asks for a goal, produce this shape. Keep the Ready Goal self-contained enough to paste into /goal or a long-running task prompt.
Ready Goal:
[One complete goal statement. Include the objective, boundaries, acceptance bar, validation loop, and stop condition.]
Intent:
- [Why the user wants this outcome, in the user's terms.]
Objective:
- [One durable objective.]
Scope:
- [Included surfaces, artifacts, states, routes, modules, or workflows.]
Non-goals:
- [Explicitly excluded work, behaviors, files, systems, or decisions.]
Required context:
- [Files, docs, links, screenshots, Figma frames, logs, tests, commands, plans, or issues to read first.]
Acceptance results:
- Result: [Observable outcome.]
Metric: [What is measured.]
Threshold: [Pass/fail boundary.]
Data source / verification: [Command, screenshot diff, test, API response, rendered UI, log, artifact, or human review gate.]
Scope: [Browsers, viewports, fixtures, states, locales, modules, or inputs.]
Allowed differences:
- [Changes explicitly permitted by the user or existing project contract.]
Validation loop:
- [Exact checks to run, when to run them, and how to react to failure.]
Checkpoints:
- [Milestones and proof required at each checkpoint.]
Stop condition:
- [Concrete state where the agent should stop because the goal is met.]
Pause conditions:
- [Conditions requiring user input, such as ambiguous product judgment, missing access, failed validation needing scope choice, destructive action, deployment, or boundary conflict.]
Progress report format:
- Current checkpoint:
- Changes made:
- Verification run:
- Result:
- Remaining work:
- Blockers:
For small goals, keep the same fields but collapse empty or obvious sections. Keep Acceptance results, Validation loop, and Stop condition explicit.
When the Visual Reference Gate applies, make the visual acceptance result the first Acceptance result.
Each acceptance result should be as measurable as the domain permits.
Prefer:
All existing tests pass with [command] over works correctly.No public API signatures, exported names, event payloads, or persisted formats change over compatible.Score reaches at least 0.90 on [eval command] over improves quality.No new console errors, type errors, lint errors, accessibility violations, or failed network requests in [scope] over polished.When exact automation is unavailable, define the manual acceptance evidence: who reviews, what artifact they inspect, which rubric they apply, and what result counts as pass.
If the user asks to migrate a component, module, workflow, framework, or implementation from a source project/path into the current project, the Goal contract is incomplete unless it includes a first-class migration parity acceptance result.
Adapting imports, file layout, naming, formatting, framework conventions, local helpers, and design-system primitives does not permit observable behavior changes.
The migration acceptance result must name:
When a migration also has a Figma/screenshot/design reference, both the Visual Reference Gate and Migration Parity Gate apply. Make the visual acceptance result first, then the migration parity acceptance result.
Ask at most one question at a time. Ask only when the answer changes the goal's objective, acceptance threshold, validation method, authorization boundary, or stop condition.
Useful narrow questions:
Which Figma frame or selection URL is the source of truth?What viewport and state matrix must count for acceptance?Which source project path is the behavior baseline for this migration?Are any behavior differences allowed, or should parity be exact?Which command is the authoritative validation check?Ask about visual diff threshold only if the user explicitly wants a lower bar than the default. Default is 0 unapproved diffs.
If the user says to proceed without the answer, write the conservative assumption into Required context, Acceptance results, or Allowed differences.
Before returning the Goal contract, check:
The skill is complete when the user has either an approvable Goal contract or a short list of blockers that materially prevent writing one.
The next phase is a separate action: setting /goal, planning, coding, writing documentation, running tests, or changing files requires the user's current request or an already active execution task.
tools
Decide whether and how to use authorized sub-agents, then coordinate delegated work while preserving the main agent's context. Use when the user asks for orchestration, parallel agents, delegation, background workers, context isolation, or when another skill needs delegated research, review, implementation, or verification. Owns host-policy checks, delegation packets, non-overlap, report verification, and stop rules. Do not use to bypass tool policy, infer user authorization, or add coordination overhead to simple single-threaded tasks.
development
Use before finalizing a non-trivial answer, recommendation, review, or decision to reconsider it and raise its quality, especially when shallow reasoning, context inertia, false framing, overconfidence, unfit analogy transfer, or an obvious-but-missed defect could distort the result. Trigger especially before applying external evidence, familiar frameworks, or comparisons to the user's specific request, and when the user asks to reconsider, double-check, take a second look, or sanity-check an answer. Reconsider the draft against its most likely failure mode, and use independent scrutiny only when it is useful and authorized.
development
Review concrete code plan drafts, specs, diffs, and implementation shapes. Use for code-review requests, serious code-plan design critique, and judging whether a proposed direction is sound. Prioritize solution direction, premise validity, logic chain, constraints, alternatives, design shape, contracts, tests, local fit, and actionable findings. Near miss: use code-plan to create or revise plans; use code-scope-gate for pre-spec scope shaping.
development
Write evidence-backed coding plans for implementation, debugging, refactoring, migrations, design parity work, and long-running agent tasks. Use when defining, clarifying, refining, or validating a development plan, /goal prompt, implementation approach, scope and non-goals, work sequence, acceptance criteria, regression evidence, verification strategy, or stop condition. Near miss: use code-review when judging an existing diff, spec, or already drafted plan rather than drafting or revising a plan. Also use when the user says `design twice` after a plan and wants an APOSD-style second-design pass over the completed plan.