一键导入
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 职业分类
Use when the user wants the laziest solution that actually works — types /ponytail, says "be lazy", "lazy mode", "simplest solution", "minimal solution", "yagni", "do less", or "shortest path", or complains about over-engineering, bloat, boilerplate, or unnecessary dependencies. Supports intensity levels lite, full, ultra (default). Pairs with caveman, which compresses prose, not code.
Use when the user wants a whole-repo audit for over-engineering — says "audit this codebase", "audit for over-engineering", "what can I delete from this repo", "find bloat", or invokes /ponytail-audit. Like ponytail-review but scans the entire tree, not a diff. One-shot report, applies no fixes. Gated by the ponytail audit_ponytail component.
Use when the user wants to harvest every `ponytail:` comment in the codebase into a tracked debt ledger — says "ponytail debt", "/ponytail-debt", "what did ponytail defer", "list the shortcuts", "ponytail ledger", or "what did we mark to do later". One-shot report, changes nothing. Gated by the ponytail debt_ponytail component.
Use when the user asks how ponytail mode works, what intensity levels exist, what the slash commands are, how to toggle it, or wants a quick-reference card before turning the mode on. One-shot display, not a persistent mode. Trigger: /ponytail-help, "ponytail help", "what ponytail commands", "how do I use ponytail".
Use when the user wants a code review focused exclusively on over-engineering — says "review for over-engineering", "what can we delete", "is this over-engineered", "simplify review", or invokes /ponytail-review. Complements correctness/security review; this one only hunts complexity in the current diff. Gated by the ponytail review_ponytail component.
Use when navigating an unfamiliar codebase, tracing how code connects (callers, dependencies, the blast radius of a change), or whenever the repo ships a graphify-out/graph.json knowledge graph. Query the graph before grepping/reading raw source for orientation.
| 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.1","generatedBy":"1.3.0"} |
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
Write apply-session start marker (required, added v1.1)
Before reading any context files or performing implementation, signal that
this apply session is skill-orchestrated. The PreToolUse hook installed
per docs/rules/apply-skill-enforcement.rule.md BLOCKS the first Edit/Write on a
slice's write_paths unless this marker exists for the current session.
python .ai-playbook/scripts/openspec_apply_marker.py start --change-id "<name>" --skill-version 1.1
The marker is appended to openspec/changes/<name>/.apply_log.jsonl (one
JSONL record per session start; committed to git for audit). If the helper
script is missing (consumer pre-v0.14.0 of ai-playbook), the hook is also
missing — proceed; older consumers see no enforcement. Inform the user that
their playbook bump is overdue.
See: docs/rules/apply-skill-enforcement.rule.md §1 (marker contract) and §3
(break-glass via AIPLAYBOOK_APPLY_ENFORCE_OVERRIDE env).
Select the change
If a name is provided, use it. Otherwise:
openspec list --json to get available changes and use the AskUserQuestion tool 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")Get apply instructions
openspec instructions apply --change "<name>" --json
This returns:
Handle states:
state: "blocked" (missing artifacts): show message, suggest using openspec-continue-changestate: "all_done": congratulate, suggest archiveRead context files
Read the files listed in contextFiles from the apply instructions output.
The files depend on the schema being used:
4b. Preflight re-grep cited identifiers (added v0.11.0)
Per release-management.md §6.5 (pre-flight rebase) the worktree base is fresh, but proposal.md may have been written days earlier. Identifiers cited in the proposal (class names, function names, file paths, migration slot numbers, fact-kind enum values, ADR numbers) may have changed on main since the proposal landed. Apply silently against stale citations produces silent divergence.
Before starting implementation, re-grep every identifier the proposal/design/tasks cites:
Walk proposal.md + design.md + tasks.md and extract:
apps/api/src/.../foo.py).`IBClient`, `place_order`).0007_*, 0010_*).ADR-021).For each, run git grep -n "<identifier>" (or Grep tool) on main.
If any cited identifier returns 0 hits, surface as a divergence warning:
⚠ Citation drift detected
proposal.md cites `FactKindEnum.MOMENTUM_SCORE` but no occurrence found on main.
Likely renamed or removed in a parallel slice merged after this proposal landed.
Options:
1. Re-read the current main code to find the new name; update tasks.md citations.
2. Re-open Gate D for design refresh (recommended for ≥3 drifted citations).
3. Override with --skip-preflight-grep (logs deviation in retro carry-forward).
If 1-2 identifiers drifted, show the diff and let the user decide (small drift is normal across week-old proposals).
If ≥3 identifiers drifted OR a critical surface (migration slot, FK, public API) drifted, refuse to proceed without explicit --skip-preflight-grep flag.
This catches the failure mode surfaced 2026-05-06 in consumer-e (proposals written before parallel slices renamed cited classes) — without preflight grep, the worker AI would silently apply against drifted state and either fail at typecheck (best case) or ship broken code (worst case).
Show current progress
Display:
Implement tasks (loop until done or blocked)
For each pending task:
- [ ] → - [x]Pause if:
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 Completion
## Implementation Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓
### Completed This Session
- [x] Task 1
- [x] Task 2
...
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
Fluid Workflow Integration
This skill supports the "actions on a change" model: