一键导入
openspec-apply-change
Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.
Continue working on an OpenSpec change by creating the next artifact. Use when the user wants to progress their change, create the next artifact, or continue their workflow.
Fast-forward through OpenSpec artifact creation. Use when the user wants to quickly create all artifacts needed for implementation without stepping through each one individually.
Start a new OpenSpec change using the experimental artifact workflow. Use when the user wants to create a new feature, fix, or modification with a structured step-by-step approach.
Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
| name | openspec-apply-change |
| description | Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks. |
| license | MIT |
| compatibility | Requires openspec CLI. |
| metadata | {"author":"openspec","version":"1.0","generatedBy":"1.3.1"} |
Project context preflight before workflow actions: before this skill takes a workflow action, follow the project-constitution skill. Read root CONSTITUTION.md when present, enforce relevant project rules, stop on material conflicts, and follow the strict missing-constitution bootstrap/diagnostic policy. For architecture-sensitive work, also read ARCHITECTURE.md, adr/README.md, and relevant in-force adr/*.md. Read .secrets.local.env only when the current workflow actually needs a listed external system, and never reveal secret values.
Artifact review session controls: when scripts/openspec-session-state exists, inspect artifactReview.decision before key entry workflows create or consume reviewable artifacts. If the decision is unset, ask once whether to enable OpenAI-compatible artifact review for this session and record the answer with --review on|off; later commands reuse the recorded decision until the user changes it with the /opsx:review-* prompts. Session settings are non-secret local overlays and must not edit .codex/openspec-artifact-review.json unless the user explicitly asks for a global default change.
Implement tasks from an OpenSpec change.
Input: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
Steps
Select the change
If a name is provided, use it. Otherwise:
openspec list --json to get available changes and use the Codex interactive user question tool when available, otherwise a concise Markdown question to let the user selectAlways announce: "Using change: " and how to override (e.g., /opsx:apply <other>).
Check status to understand the schema
openspec status --change "<name>" --json
Parse the JSON to understand:
schemaName: The workflow being used (e.g., "spec-driven")Git hard gate before apply
Run:
git status --short
openspec status --change "<name>" --json
Refuse to implement if planning artifacts under openspec/changes/<name>/ are missing or uncommitted (proposal.md, specs/**, grill.md, design.md, design-review.md, adr.md, test-plan.md, tasks.md) unless the user gives an explicit one-time override naming the files/gate.
Get apply instructions
openspec instructions apply --change "<name>" --json
This returns:
contextFiles: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/grill/design/design-review/adr/test-plan/tasks or spec/tests/implementation/docs)Handle states:
state: "blocked" (missing artifacts): show message, suggest using openspec-continue-changestate: "all_done": congratulate, suggest archiveRead context files
Read every file path listed under contextFiles from the apply instructions output.
The files depend on the schema being used:
CONTEXT.md/CONTEXT-MAP.md when present, top-level adr/*.md when present, and derive the in-force ADR set by following supersession linksFor intent-driven changes, implementation must obey grill and design-review resolutions, the per-change ADR review, Matt TDD test-plan ordering/evidence, and the in-force durable ADR set. If openspec/changes/<name>/reviews/*.json OpenAI-compatible artifact review reports exist, read them as auxiliary reviewer context; they do not replace required OpenSpec artifacts, validation, grill, ADR, or TDD evidence.
Show current progress
Display:
Goal-guidance preflight before implementation
Run this preflight after apply eligibility and context are known, but before implementation file edits.
Skip goal generation and continue normal apply when:
<name> (avoid nested goals).Do not generate a goal prompt when:
openspec instructions apply returned state: "blocked" or state: "all_done".Generate a copy-paste /goal prompt and stop before implementation when
any of these deterministic conditions apply:
Generated apply goal prompt shape (localize prose to the user's language, but keep command, change, and skill names exact):
/goal Реализуй Intent-Driven OpenSpec change <change> в текущем проекте до состояния verify-ready.
Первое действие: запусти workflow `/opsx:apply <change>`. Если вложенная slash-команда не исполняется буквально, используй workflow/skill `openspec-apply-change` для этого change.
Критерии завершения: все применимые pending tasks выполнены и отмечены только после проверки; `/opsx:verify <change>` завершен без critical issues; итоговый отчет перечисляет выполненные задачи, измененные файлы, статус проверки и нерешенные предупреждения; необходимые checkpoint boundaries показаны пользователю.
Остановись без завершения goal, если planning artifacts грязные, grill/design-review/test-plan отсутствуют или грязные, OpenSpec state blocked/all-done, отсутствуют credentials/secrets, недоступен внешний сервис, проверки падают по причинам вне контроля Codex, артефакты противоречат друг другу, требуется design/spec/ADR decision, либо нужен archive/merge/push/destructive git action или другое действие с отдельным approval. В отчете укажи blocker, trusted state, files changed so far и recommended next user action.
Implement tasks (loop until done or blocked)
For each pending task or coherent task group:
tdd skill automatically: one vertical RED -> GREEN -> REFACTOR slice at a timetest-plan.md has an explicit approved exception- [ ] → - [x] only after RED/GREEN evidence or an approved exceptionPause if:
Artifact Review reporting during apply:
## Artifact Review block after every reviewer call; tool output alone is not sufficient.## Artifact Review block MUST contain Budget / cost: cost.total_cost_usd when present, otherwise стоимость недоступна; the configured maxBudgetUsd / budget cap from budgetLimitUsd or the effective config, including null / none; and skipped/unavailable status such as review не запускался, cost unavailable, budget cap: none.User-facing questions: list only questions requiring user decision; if none remain, write exactly Вопросов, требующих участия пользователя: нет. Resolve context-answerable questions yourself and summarize the resolution.Short summary: verdict, artifact reviewer's short message, and the finding disposition: fixed and reran review; deferred to a concrete artifact/file/section; non-actionable with reason; or stopped on blocker. Do not print every mustFix/shouldFix/question unless user participation is required.Total artifact review cost: $<value> using current-run tracked costs when available, or scripts/openspec-artifact-review --cost-summary --change "<name>" over persisted reports when available. If no numeric cost exists despite review activity/reports, state Total artifact review cost: unavailable.On completion or pause, show status
Display:
Output During Implementation
## Implementing: <change-name> (schema: <schema-name>)
Working on task 3/7: <task description>
[...implementation happening...]
✓ Task complete
Working on task 4/7: <task description>
[...implementation happening...]
✓ Task complete
Output On Goal Hand-Off
## Goal Guidance Recommended
**Change:** <change-name>
**Schema:** <schema-name>
**Reason:** <deterministic condition, e.g. 12 pending tasks and ADR constraints>
Copy and send this as the next message if you want Codex Goal to manage the run:
<generated /goal prompt>
Stopping before implementation file edits.
Output On Completion
## Implementation Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓
### Completed This Session
- [x] Task 1
- [x] Task 2
...
Total artifact review cost: <amount, persisted report total, or unavailable>
All tasks complete! Ready to archive this change.
Output On Pause (Issue Encountered)
## Implementation Paused
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 4/7 tasks complete
### Issue Encountered
<description of the issue>
**Options:**
1. <option 1>
2. <option 2>
3. Other approach
What would you like to do?
Guardrails
/goal prompt and stop before implementation file edits.git status --short and checkpoint according to session git mode. Safe apply-group checkpoint commits may run automatically in auto mode after paths/message/hash are shown; manual mode stops for approval. Merge, push, archive, destructive operations, and hard-gate bypasses still require explicit approval.Fluid Workflow Integration
This skill supports the "actions on a change" model: