一键导入
ospec-goal
Create or advance a full OSpec goal using the current document, task graph, worker, review, and evidence workflow.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create or advance a full OSpec goal using the current document, task graph, worker, review, and evidence workflow.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | ospec-goal |
| description | Create or advance a full OSpec goal using the current document, task graph, worker, review, and evidence workflow. |
| tags | ["ospec","cli","workflow","goal"] |
Use this skill for complex work that needs the full OSpec workflow. A goal is intentionally heavier than a change and is the place to use design docs, implementation planning, task graph dispatch, worker/reviewer handoffs, and durable evidence.
ospec goal creates a session-bound Loop automatically (artifacts/loop/loop.json + state.json + run-log.jsonl). You do not run a separate init step. Key contracts:
ospec loop run --once performs a two-phase tick — it first observes the previous pending action's verification evidence, then plans/produces the next controller instruction. The controller (you) executes the instruction and records completion + verification.AskUserQuestion for L1/L2/L3 as the first decision; otherwise pass ospec goal <name> --level L1|L2|L3 (default L1). L1 = report-only (findings go to triage, no code changes); L2 = assisted (real changes but required-decision gates hard-block); L3 = unattended within an allowlist.ospec loop run hard-blocks while any required user decision is pending — present each one to the user (never auto-select the recommended option) and record the answer with ospec execute decision ... --select before the loop proceeds. Only L3 may auto-advance within its allowlist. The level is not a hint; it decides whether you may proceed without asking./goal is capability-probed, not hardcoded. ospec execute launch --primitive goal produces a native-/goal instruction when the target supports it (claude, codex), otherwise an emulated-goal verify-driven plan. CLI-driven targets use claude -p / codex exec (never claude --goal).loop run --once on the controller's tick cadence (ospec loop tick-plan); CLI-driven loops use ospec loop watch (dies with the session). Stop with ospec loop pause / a STOP file / closing the session.ospec execute verify --status, then confirm with ospec verify.This skill covers the full lifecycle inside an initialized OSpec project:
Use ospec-change for small routine changes that only need the classic fast flow.
.skillrc.ospec/SKILL.index.json for nested projects, or root SKILL.index.json.ospec/for-ai/ai-guide.md and .ospec/for-ai/execution-protocol.md, or legacy for-ai/.ospec/changes/active/<goal>/proposal.md.ospec/changes/active/<goal>/design.md.ospec/changes/active/<goal>/implementation-plan.md.ospec/changes/active/<goal>/artifacts/agents/task-graph.json.ospec/changes/active/<goal>/artifacts/reviews/design-review.md.ospec/changes/active/<goal>/artifacts/reviews/implementation-plan-review.md.ospec/changes/active/<goal>/artifacts/agents/bootstrap.md.ospec/changes/active/<goal>/artifacts/agents/workflow-route.md.ospec/changes/active/<goal>/artifacts/agents/workspace-status.md.ospec/changes/active/<goal>/artifacts/agents/launch-plan.md.ospec/changes/active/<goal>/artifacts/agents/worker-runs/.ospec/changes/active/<goal>/artifacts/agents/review-runs/.ospec/changes/active/<goal>/artifacts/agents/decisions/.ospec/changes/active/<goal>/artifacts/reviews/final-review.md.ospec/changes/active/<goal>/artifacts/agents/worker-status.md.ospec/changes/active/<goal>/artifacts/agents/tdd-evidence.json.ospec/changes/active/<goal>/artifacts/agents/debug-evidence.json.ospec/changes/active/<goal>/artifacts/agents/verification-evidence.json.ospec/changes/active/<goal>/tasks.md.ospec/changes/active/<goal>/state.json.ospec/changes/active/<goal>/verification.md.ospec/changes/active/<goal>/review.mdFor legacy root-layout projects, use the same paths without the .ospec/ prefix.
for-ai/ guidance, .skillrc documentLanguage, and existing change docs.proposal.md, design.md, implementation-plan.md, tasks.md, verification.md, review.md, review artifacts, and brainstorm content — in that one language. Do not mix Chinese and English within a change.Announce-Before-Act: never run the goal workflow silently. Announce in one line which skill you are using (ospec-goal) and the current stage; say which ospec execute ... command you are about to run and the artifact it writes; when you dispatch native subagents, announce how many workers you launch, which task each takes, and the mechanism (Task for Claude Code, spawn_agent/wait_agent/close_agent for Codex/GPT, @generalist for Gemini, @mention for OpenCode); when a gate blocks progress, tell the user what is blocked and what unblocks it.Brainstorm-First: open each goal with a short brainstorming pass before locking design. Surface the open questions for direction, architecture, API, data, UI, risk, and scope, and ask the user one question at a time instead of silently assuming. NEVER auto-select the recommended option or resolve a decision gate yourself — recommended is only a hint to show the user. Present every gate to the user and wait for their actual choice; required gates block implementation and dispatch until the user answers. Do not run the whole goal in one shot without asking. Persist exploration with ospec brainstorm [path] --topic "..." when useful, and do not leave a brainstorm as an unanswered template — ask the user its decision gates and record each answer with ospec brainstorm resolve [path] --brainstorm <id> --gate <gate-id> --select <option-id> so it has a result. Resolve the brainstorm while its change is the active change (or pass --change <name>) so it links to that change and archives together with it — the brainstorm directory name need not match the change name. When any of those is genuinely open, prefer raising a durable decision gate over guessing: ospec execute decision [changes/active/<goal>] --id <id> --question "..." --option id:label:impact --required, present the decision report Chat Prompt or artifacts/agents/decisions/index.md, then record the answer with --select <option-id>. Only record an autonomous assumption in design.md when the user explicitly defers or is unavailable, and label it as an assumption to confirm. Present options using the best interactive mechanism your harness has: a native question UI (Claude Code AskUserQuestion, Gemini ask_user) if available, otherwise your plan/approval UI (Codex Plan mode) if available, otherwise the decision report Chat Prompt as plain chat text. ospec session hook --target claude --apply installs hooks that re-affirm this contract and hard-block subagent dispatch while a required decision is pending. On harnesses without a native picker or plan UI present the decision report Chat Prompt in chat instead — the asking step and the ospec execute dispatch block on required pending decisions are identical on every harness, so you always ask the user, only the presentation differs.Zero-Setup: the user only starts a goal and describes the requirement — never make them run setup or ospec execute ... commands; you run every OSpec command yourself and the user only answers questions in chat. In a Claude Code harness at goal entry, if .claude/settings.json does not yet reference .ospec/hooks/claude/ospec-claude-hook.cjs, run ospec session hook --target claude --apply once (idempotent) so hard enforcement is active for the next session.ospec goal <goal-name> [path].design.md from the requirement, proposal.md, and project context before editing implementation-plan.md, deriving artifacts/agents/task-graph.json, editing tasks.md, or editing code.implementation-plan.md from design.md; identify target files, expected results, verification commands, dependencies, parallelizable work, and conflicts.artifacts/agents/task-graph.json from implementation-plan.md; derive tasks.md from the task graph.ospec execute doc-review [changes/active/<goal>] --stage design, then approve artifacts/reviews/design-review.md before plan review.ospec execute doc-review [changes/active/<goal>] --stage plan, then approve artifacts/reviews/implementation-plan-review.md before worker dispatch or closeout.ospec execute decision for direction, architecture, API, UI, risk, or scope choices that need explicit user selection.ospec execute workspace, dispatch, launch, complete, review, feedback, sync, tdd, debug, and verify as needed for the full workflow.ospec execute finish before finalize when the goal used task graph execution or worktree planning.ospec finalize [changes/active/<goal>] as the normal closeout path. Closeout is automatic when ready: once the goal is complete and ospec verify passes with no required user decision or blocking gate pending, run ospec finalize yourself — do not stop at ospec archive ... --check (preview only) or wait for the user to ask. ospec execute finish strategy prompts (PR / merge / branch / worktree) are optional with safe defaults (direct-closeout + manual merge) — do NOT ask the user about them; uncommitted change/OSpec files are normal and do not block archive. Only open a PR if the user explicitly asked. Only pause for a genuine human gate: a pending required decision, an unapproved blocking plugin gate (e.g. Checkpoint), real verify/archive blockers, or an explicit user request to preview or approve first. Archiving — even when the user explicitly asks you to archive — goes through ospec finalize only; never move the change directory manually. ospec finalize archives the change's linked brainstorm at the same moment, so a manual move orphans it. If the change needed human/device verification and ospec finalize reports not-ready because the review decision is not APPROVED, record the user's confirmed approval in that review (set decision: APPROVED) and rerun ospec finalize — do not work around the gate by relocating files.Token economy: pass
--briefonospec execute …commands to get a token-lean summary (status, key fields, and the next instruction) instead of the full report — the artifacts are still written in full, so read them only when you need detail. Drive each step fromospec execute status --briefrather than re-reading the fulltask-graph.json/worker-status.md/launch-plan.mdevery turn.
ospec status [path]
ospec goal <goal-name> [path] [--flags flag1,flag2] [--level L1|L2|L3]
ospec execute status [changes/active/<goal>] --brief
ospec loop status [changes/active/<goal>]
ospec loop run [changes/active/<goal>] [--once]
ospec loop watch [changes/active/<goal>] [--interval 10m] [--max-ticks N]
ospec loop tick-plan [changes/active/<goal>]
ospec loop level [changes/active/<goal>] <L1|L2|L3>
ospec loop pause [changes/active/<goal>]
ospec loop resume [changes/active/<goal>]
ospec triage list [path]
ospec triage claim [path] --id <id> --by <name>
ospec triage promote [path] --id <id>
ospec execute launch [changes/active/<goal>] [--task task-id] [--target ...] [--primitive subagent|goal|loop] [--until "..."] [--max-iterations N] [--interval 10m]
ospec execute bootstrap [changes/active/<goal>]
ospec execute doc-review [changes/active/<goal>] --stage design
ospec execute doc-review [changes/active/<goal>] --stage plan
ospec execute decision [changes/active/<goal>] --id <id> --question "..." --option id:label:impact --required
ospec execute workspace [changes/active/<goal>]
ospec execute dispatch [changes/active/<goal>] [--task task-id] [--limit N]
ospec execute launch [changes/active/<goal>] [--task task-id] [--target codex|gpt|claude|gemini|opencode|cursor|copilot|shell|generic]
ospec execute complete <task-id> [changes/active/<goal>] --status DONE --summary "..."
ospec execute review [changes/active/<goal>] --task task-id # per-task: one combined code review (spec compliance + code quality)
ospec execute review [changes/active/<goal>] # whole-change: one combined final code review (after all task reviews approved)
ospec execute tdd [changes/active/<goal>] --phase red|green|refactor --command "..." --status ...
ospec execute debug [changes/active/<goal>] --phase reproduce|isolate|hypothesize|fix|verify --symptom "..." --status ...
ospec execute verify [changes/active/<goal>] --command "..." --status PASSED
ospec execute sync [changes/active/<goal>]
ospec execute finish [changes/active/<goal>] [--target main] [--remote origin]
ospec verify [changes/active/<goal>]
ospec archive [changes/active/<goal>] --check
ospec finalize [changes/active/<goal>]
launch --run --command, orchestrate --command, or review --run --command.