Skip to content

Commit 9d7d815

Browse files
authored
chore: upgrade OpenSpec to 1.14.2 (#12)
Upgrade the pinned OpenSpec CLI, refresh generated agent workflows, and update existing specifications for the stricter 1.14.2 validator.
1 parent 890d750 commit 9d7d815

68 files changed

Lines changed: 4920 additions & 740 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/.openspec-target‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
codex
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
---
2+
name: openspec-apply-change
3+
description: Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks. Also use when the user says "openspec apply", "opsx apply", or "openspec implement".
4+
allowed-tools: Bash(openspec:*)
5+
license: MIT
6+
compatibility: Requires openspec CLI.
7+
metadata:
8+
author: openspec
9+
version: "1.0"
10+
generatedBy: "1.14.2"
11+
---
12+
13+
Implement tasks from an OpenSpec change.
14+
15+
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
16+
17+
**Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
18+
19+
One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
20+
21+
Otherwise, with no root, what happens next depends on how this workflow was reached:
22+
23+
- **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or running its slash command. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
24+
- **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or ran its slash command. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
25+
26+
In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
27+
28+
**Input**: Optionally specify a change name (e.g., `$openspec-apply-change (Codex) or /openspec-apply-change (other agents) add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
29+
30+
**Steps**
31+
32+
1. **Select the change**
33+
34+
If a name is provided, use it. Otherwise:
35+
- Infer from conversation context if the user mentioned a change
36+
- Auto-select if only one active change exists
37+
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
38+
39+
Always announce: "Using change: <name>" and how to override (e.g., `$openspec-apply-change (Codex) or /openspec-apply-change (other agents) <other>`).
40+
41+
2. **Check status to understand the schema**
42+
43+
```bash
44+
openspec status --change "<name>" --json
45+
```
46+
47+
Parse the JSON to understand:
48+
- `schemaName`: The workflow being used (e.g., "spec-driven")
49+
- `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
50+
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
51+
52+
3. **Get apply instructions**
53+
54+
```bash
55+
openspec instructions apply --change "<name>" --json
56+
```
57+
58+
This returns:
59+
- `contextFiles`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
60+
- Progress (total, complete, remaining)
61+
- Task list with status, source path, and source line
62+
- Dynamic instruction based on current state
63+
- Optional `context`: current required project instruction input from the selected root
64+
- Optional `operationGuidance`: current advisory guidance for apply
65+
- `missingArtifacts` (when present): required artifact ids with no output
66+
67+
**Handle states:**
68+
- If `state: "blocked"`: show the message and pause implementation.
69+
- If `missingArtifacts` is non-empty: suggest completing the missing artifacts. Run `openspec status --change "<name>" --json`, select the next `ready` artifact (not `skipped` or `blocked`), and use `openspec instructions "<artifact-id>" --change "<name>" --json` for its rules and template. Keep the selected `--store <id>` on both commands.
70+
- Otherwise, follow the CLI instruction to create or repair the schema-configured tracking file from existing planning artifacts. Do not assume another artifact is ready or start implementation while blocked.
71+
- If `state: "all_done"`: report that all tracked tasks are complete and suggest review or verification as appropriate before archiving
72+
- Otherwise: proceed to implementation
73+
74+
Treat `context` as a required prompt-level input. Read and consider it, and
75+
apply relevant project facts, conventions, and constraints while implementing.
76+
Treat `operationGuidance` as optional additive advice. Read and consider every
77+
entry, and follow entries that are applicable and compatible with the built-in
78+
workflow.
79+
80+
Keep both fields separate from CLI-returned state, missing artifacts, tasks,
81+
progress, `contextFiles`, and the built-in `instruction`. They are not
82+
evidence of task completion, do not replace the built-in instruction, and do
83+
not permit bypassing a blocked state. If context conflicts with the built-in
84+
instruction, an explicit user choice, or a CLI-controlled value, report the
85+
conflict and preserve the controlling value. If guidance is inapplicable or
86+
conflicts with those controlling inputs, do not follow it and explain why.
87+
These are prompt-level behavior contracts, not enforceable checks.
88+
89+
4. **Read context files**
90+
91+
Read every file path listed under `contextFiles` from the apply instructions output.
92+
The files depend on the schema being used:
93+
- **spec-driven**: proposal, specs, design, tasks
94+
- Other schemas: follow the contextFiles from CLI output
95+
96+
Do not copy `context` or `operationGuidance` verbatim into implementation
97+
files or planning artifacts unless the user separately asks for that content.
98+
99+
5. **Show current progress**
100+
101+
Display:
102+
- Schema being used
103+
- Progress: "N/M tasks complete"
104+
- Remaining tasks overview
105+
- Dynamic instruction from CLI
106+
107+
6. **Implement tasks (loop until done or blocked)**
108+
109+
For each pending task:
110+
- Show which task is being worked on
111+
- Make the code changes required
112+
- Keep changes minimal and focused
113+
- Before editing, confirm the checkbox at the returned `sourcePath` and `line` still matches the task description; if it does not, rerun the apply instructions and use the refreshed location
114+
- Mark the task complete at its returned `sourcePath` and `line`: `- [ ]` → `- [x]`
115+
- Rerun the apply instructions and confirm that task is now done and progress changed
116+
- Continue to next task
117+
118+
**Pause if:**
119+
- Task is unclear → ask for clarification
120+
- Implementation reveals a design issue → suggest updating artifacts
121+
- A task needs work beyond what the spec and tasks describe, or you are tempted to drop, narrow, defer, or accept exceptions to specified behavior to make it fit → surface the added scope and ask; do not absorb it silently
122+
- Error or blocker encountered → report and wait for guidance
123+
- User interrupts
124+
125+
7. **On completion or pause, show status**
126+
127+
Display:
128+
- Tasks completed this session
129+
- Overall progress: "N/M tasks complete"
130+
- If all done: report that tracked tasks are complete and suggest review or verification as appropriate before archiving
131+
- If paused: explain why and wait for guidance
132+
133+
**Output During Implementation**
134+
135+
```
136+
## Implementing: <change-name> (schema: <schema-name>)
137+
138+
Working on task 3/7: <task description>
139+
[...implementation happening...]
140+
✓ Task complete
141+
142+
Working on task 4/7: <task description>
143+
[...implementation happening...]
144+
✓ Task complete
145+
```
146+
147+
**Output On Completion**
148+
149+
```
150+
## Implementation Complete
151+
152+
**Change:** <change-name>
153+
**Schema:** <schema-name>
154+
**Progress:** 7/7 tasks complete ✓
155+
156+
### Completed This Session
157+
- [x] Task 1
158+
- [x] Task 2
159+
...
160+
161+
All tracked tasks are complete. Review or verify the change as appropriate
162+
before archiving. You can archive this change with `$openspec-archive-change (Codex) or /openspec-archive-change (other agents)`.
163+
```
164+
165+
**Output On Pause (Issue Encountered)**
166+
167+
```
168+
## Implementation Paused
169+
170+
**Change:** <change-name>
171+
**Schema:** <schema-name>
172+
**Progress:** 4/7 tasks complete
173+
174+
### Issue Encountered
175+
<description of the issue>
176+
177+
**Options:**
178+
1. <option 1>
179+
2. <option 2>
180+
3. Other approach
181+
182+
What would you like to do?
183+
```
184+
185+
**Guardrails**
186+
187+
- Keep going through tasks until done or blocked
188+
- Always read context files before starting (from the apply instructions output)
189+
- If task is ambiguous, pause and ask before implementing
190+
- If implementation reveals issues, pause and suggest artifact updates
191+
- Keep code changes minimal and scoped to each task
192+
- Update task checkbox immediately after completing each task
193+
- Pause on errors, blockers, or unclear requirements - don't guess
194+
- When a task needs work beyond what the spec describes, surface the added scope and pause - never silently narrow, defer, or simplify away specified behavior
195+
- Only mark a task `- [x]` when its specified behavior is fully implemented, not when it is partially done or deferred
196+
- Use contextFiles from CLI output, don't assume specific file names
197+
- Use each task's sourcePath and line to update its exact checkbox
198+
- Do not use context or operation guidance as proof that a task is complete
199+
- Apply relevant project context; report conflicts with controlling workflow inputs
200+
- Consider every guidance entry; explain any inapplicable or conflicting advice
201+
- Do not copy runtime context or operation guidance into implementation files or planning artifacts
202+
- Preserve CLI-controlled blocked/ready/all-done behavior and completion criteria
203+
204+
**Fluid Workflow Integration**
205+
206+
This skill supports the "actions on a change" model:
207+
208+
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
209+
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly

0 commit comments

Comments
 (0)