skills/dbx-goal-writer/SKILL.md
Use when the user wants to create, refine, start, or audit an OpenAI Codex goal contract for coding work, especially long-running or validation-heavy tasks. Produces copy-pasteable /goal commands, optional GOAL.md files, and only for large or strict tasks a goal package directory with plan, acceptance, validation, and status files. Do not implement the coding task unless explicitly asked.
npx skillsauth add dbvc/skills dbx-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.
Turn a rough coding request into a clear Codex /goal contract.
This skill is a goal foundry, not the implementation agent. While using it, do not edit the product code unless the user explicitly asks for implementation. Produce goal artifacts and the exact /goal command needed to start the run.
Treat /goal as a thread-level objective workflow, not a stable general-purpose CLI subcommand. In Codex CLI 0.128.0, OpenAI release notes describe persisted /goal workflows with app-server APIs, model tools, runtime continuation, and TUI controls for create, pause, resume, and clear. In current local builds, goals may still appear as an under-development feature flag, and official slash-command docs may lag behind the release surface.
Before making compatibility claims, use references/codex-goal-compatibility.md. When the user's environment is unknown, say that /goal is feature-gated or surface-dependent and should be verified with codex --version, codex features list, and the TUI slash popup.
A /goal can reference a file or directory path, but do not assume native /goal --file or /goal --dir flags. Do not invent pause/resume/clear slash syntax; point users to the local TUI controls or slash popup unless the current environment has been verified.
For file-based goals, always provide a copy-pasteable /goal command that tells Codex to read the referenced file or directory before editing code. Keep a short objective summary inside the command, not only the path.
$dbx-goal-writer direct: 修复 checkout 优惠券空字符串校验问题$dbx-goal-writer file: 为 account 表单迁移到 zod 生成 GOAL.md$dbx-goal-writer package strict: 为 React 19 迁移生成完整 goal 目录$dbx-goal-writer start .codex/goals/account-zod/GOAL.md$dbx-goal-writer audit .codex/goals/account-zod/GOAL.mdPreserve the user's language. If the user writes Chinese, write the goal and files in Chinese unless repository conventions clearly require English.
Choose the smallest mode that makes the task safe and reviewable.
Use for small or medium tasks where one command is enough.
Choose direct when the task is specific, scope is narrow, validation is simple, and no persistent plan/status file is needed.
Output:
Mode: direct/goal ... commandUse for medium tasks that need durable context but not a full directory.
Choose file when the task has several target files, meaningful constraints, important non-goals, or the user wants a reviewable contract before execution.
Default path for local/private goals:
.codex/goals/<slug>/GOAL.md
Default path for team-reviewed/versioned goals:
docs/codex-goals/<slug>/GOAL.md
Output:
Mode: fileGOAL.md/goal ... command referencing the fileUse only for large, risky, long-running, strict, cross-cutting, migration, performance, security, benchmark, rollout, or multi-phase work.
Do not choose package merely because the request is a little ambiguous. When unsure between file and package, choose file and include open questions or pause conditions.
Recommended package tree:
.codex/goals/<slug>/
GOAL.md # Goal contract and boundaries
PLAN.md # Milestones and sequencing
ACCEPTANCE.md # Completion and review contract
VALIDATION.md # Commands, manual checks, evidence
STATUS.md # Progress log for long runs
scripts/validate.sh # Optional; create only if commands are known and useful
Output:
Mode: package/goal ... command referencing the directory or GOAL.mdUse when the user already has a GOAL.md or goal directory and wants the short command to activate it.
Input examples:
$dbx-goal-writer start .codex/goals/foo/GOAL.md$dbx-goal-writer start docs/codex-goals/react-19-migration/Output only the copy-pasteable /goal ... command plus one short note if the path looks suspicious.
Start command template:
/goal Execute <short objective if known> according to <path>. Read the goal contract before editing code. Respect Scope, Non-goals, Constraints, Acceptance Criteria, Validation, Budget and Stop Rules, and Pause Conditions. Use STATUS.md for progress if present. Completion requires all required validation to pass, or a clear explanation of why a check could not be run.
Use when the user gives an existing /goal, GOAL.md, or goal package and asks whether it is clear enough.
Output:
Verdict: ready | needs revision | unsafe | too broad/goal or file patchdirect for one bug fix, one component change, one targeted test addition, or tasks under roughly 1 to 3 files.file for medium refactors, migrations limited to one feature area, or tasks where future review matters.package only for long-running, strict, multi-phase, cross-cutting, risky, or high-ambiguity work.Every goal must contain these parts, inline or in files:
Reject or rewrite vague goals such as:
A good goal answers:
Prefer commands already present in the repository:
package.json scriptspnpm-lock.yaml, yarn.lock, package-lock.json, bun.lockbMakefilepyproject.tomlCargo.tomlgo.modDo not invent project-specific commands confidently. If uncertain, mark commands as assumptions or TODOs.
For frontend repositories, common candidates are:
pnpm test
pnpm typecheck
pnpm lint
pnpm build
Only include commands that likely exist, or explicitly label them as assumptions.
Create scripts/validate.sh only when:
VALIDATION.md.Do not place destructive commands in validation scripts unless explicitly authorized. Avoid deploy, production migration, database reset, lockfile deletion, secret rotation, or dependency installation commands unless the user requested them.
Include these unless clearly irrelevant:
For small direct goals, a budget can be omitted unless the user asks for one. For medium or large goals, include a clear stop rule:
For goal artifacts:
.codex/goals/<slug>/ for personal, local, temporary, or experiment-oriented goal contracts.docs/codex-goals/<slug>/ for team-reviewed, versioned, PR-visible goal contracts.apps/web/.codex/goals/<slug>/ in a monorepo.GOAL.md unless the repository is dedicated to one task.AGENTS.md. AGENTS.md is for durable repository instructions.For skill installation:
$HOME/.agents/skills/dbx-goal-writer/<repo>/.agents/skills/dbx-goal-writer/If the user asks to create files, create them. Otherwise propose file contents in the response.
When creating files, prefer the smallest useful artifact:
GOAL.md: one durable contract.If using the helper script, run it from the repository root or intended workspace root.
python <skill-path>/scripts/create_goal_artifact.py --title "<title>" --mode file
or:
python <skill-path>/scripts/create_goal_artifact.py --title "<title>" --mode package --validation-command "pnpm test"
Then edit generated placeholders before starting /goal.
/goal <objective>. Context: <relevant files, symptoms, evidence, references>. Target paths: <paths or discovery boundaries>. Scope: <allowed changes>. Non-goals: <out of scope>. Constraints: <compatibility, architecture, dependencies, style>. Done when: <observable behavior and reviewable artifacts>. Validation: <exact commands or checks>. Budget/stop rule: <token/time budget if known, and summarize progress instead of starting new work when budget is reached>. Pause if: <stop conditions>. Report: <summary, risks, validation results>.
/goal Execute <short objective> according to <path>. Read the goal contract before editing code. Respect Scope, Non-goals, Constraints, Acceptance Criteria, Validation, Budget and Stop Rules, and Pause Conditions. Use STATUS.md for progress if present. Completion requires all required validation to pass, or a clear explanation of why a check could not be run.
When no files are created:
Mode: <direct | file | package | start | audit>
<copy-pasteable /goal command or proposed files>
Why this is ready:
- <short checklist>
When files are created:
Mode: <file | package>
Created:
- <paths>
Start with:
```text
/goal ...
Validate goal package:
python <skill-path>/scripts/check_goal_artifact.py <goal-path-or-dir>
Do not end by offering to implement the task unless the user explicitly asked for implementation.
testing
Manual trigger only. Use only when the user explicitly names `dbx-software-plan-first-showhand`, `$dbx-software-plan-first-showhand`, or asks to manually trigger this exact DBX Software Plan-First safe automatic execution phase. Do not auto-trigger for ordinary automatic execution, do-it-all, showhand, or plan-first requests.
testing
Manual trigger only. Use only when the user explicitly names `dbx-software-plan-first-plan-issue`, `$dbx-software-plan-first-plan-issue`, or asks to manually trigger this exact DBX Software Plan-First plan convergence phase. Do not auto-trigger for ordinary planning, Plan mode, repository exploration, or implementation requests.
testing
Manual trigger only. Use only when the user explicitly names `dbx-software-plan-first-implement-feature`, `$dbx-software-plan-first-implement-feature`, or asks to manually trigger this exact DBX Software Plan-First review-gated single-task implementation phase. Do not auto-trigger for ordinary implementation, tasks.md, next-task, or plan-first requests.
testing
Manual trigger only. Use only when the user explicitly names `dbx-software-plan-first-ground-plan`, `$dbx-software-plan-first-ground-plan`, or asks to manually trigger this exact DBX Software Plan-First read-only grounding phase. Do not auto-trigger for ordinary repo reading, fact checking, plan writing, or implementation requests.