@syncfusion/ej2-vue-pdfviewer 35.2.12 → 35.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/opsx/apply.md +202 -0
- package/.claude/commands/opsx/archive.md +264 -0
- package/.claude/commands/opsx/explore.md +241 -0
- package/.claude/commands/opsx/propose.md +171 -0
- package/.claude/commands/opsx/sync.md +286 -0
- package/.claude/commands/opsx/update.md +105 -0
- package/.claude/skills/openspec-apply-change/SKILL.md +206 -0
- package/.claude/skills/openspec-archive-change/SKILL.md +221 -0
- package/.claude/skills/openspec-explore/SKILL.md +356 -0
- package/.claude/skills/openspec-propose/SKILL.md +175 -0
- package/.claude/skills/openspec-sync-specs/SKILL.md +290 -0
- package/.claude/skills/openspec-update-change/SKILL.md +109 -0
- package/dist/ej2-vue-pdfviewer.umd.min.js +2 -2
- package/dist/ej2-vue-pdfviewer.umd.min.js.map +1 -1
- package/dist/es6/ej2-vue-pdfviewer.es2015.js +1 -1
- package/dist/es6/ej2-vue-pdfviewer.es2015.js.map +1 -1
- package/dist/es6/ej2-vue-pdfviewer.es5.js +1 -1
- package/dist/es6/ej2-vue-pdfviewer.es5.js.map +1 -1
- package/package.json +2 -2
- package/src/pdfviewer/pdfviewer.component.js +1 -1
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-archive-change
|
|
3
|
+
description: Archive a completed OpenSpec change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete. Also use when the user says "openspec archive" or "opsx archive".
|
|
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.16.0"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
Archive a completed change in the experimental workflow.
|
|
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
|
+
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve the full path from each delta spec when resolving its main spec.
|
|
29
|
+
|
|
30
|
+
**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.
|
|
31
|
+
|
|
32
|
+
**Steps**
|
|
33
|
+
|
|
34
|
+
1. **Select the change**
|
|
35
|
+
|
|
36
|
+
If a name is provided, use it. Otherwise:
|
|
37
|
+
- Infer from conversation context if the user mentioned a change
|
|
38
|
+
- Auto-select if only one active change exists
|
|
39
|
+
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
|
|
40
|
+
|
|
41
|
+
When prompting, show only active changes (not already archived).
|
|
42
|
+
Include the schema used for each change if available.
|
|
43
|
+
|
|
44
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:archive <other>`).
|
|
45
|
+
|
|
46
|
+
**Load current archive inputs before the existing archive checks:**
|
|
47
|
+
|
|
48
|
+
After resolving the selected change and planning root, run:
|
|
49
|
+
```bash
|
|
50
|
+
openspec instructions archive --change "<name>" --json
|
|
51
|
+
```
|
|
52
|
+
Keep the same selected-root flags on this command. This lookup is advisory and
|
|
53
|
+
optional: it only supplies extra prompt inputs, so it must never block archiving.
|
|
54
|
+
If it exits non-zero or returns invalid JSON — for example on an older CLI that
|
|
55
|
+
does not support this command yet — continue the archive workflow with no
|
|
56
|
+
context and no operation guidance. Do not report an error and do not stop.
|
|
57
|
+
|
|
58
|
+
A successful response may omit both optional fields. Treat `context` as a
|
|
59
|
+
required prompt-level input: read and consider it, and apply relevant project
|
|
60
|
+
facts, conventions, and constraints. Treat `operationGuidance` as optional
|
|
61
|
+
additive advice: read and consider every entry, and follow entries that are
|
|
62
|
+
applicable and compatible with the built-in archive workflow.
|
|
63
|
+
|
|
64
|
+
Keep both fields separate from built-in steps, explicit user choices, resolved
|
|
65
|
+
paths, CLI checks, and command contracts. If context conflicts with one of those
|
|
66
|
+
controlling inputs, report the conflict and preserve the controlling value. If
|
|
67
|
+
guidance is inapplicable or conflicts with a controlling input, do not follow it
|
|
68
|
+
and explain why. Do not infer replacement paths, skipped prompts, or flags from
|
|
69
|
+
either field, and do not copy their text verbatim into specs, change artifacts,
|
|
70
|
+
or archive summaries unless the user separately asks for it. These are
|
|
71
|
+
prompt-level behavior contracts, not enforceable checks.
|
|
72
|
+
|
|
73
|
+
2. **Check artifact completion status**
|
|
74
|
+
|
|
75
|
+
Run `openspec status --change "<name>" --json` to check artifact completion.
|
|
76
|
+
|
|
77
|
+
Parse the JSON to understand:
|
|
78
|
+
- `schemaName`: The workflow being used
|
|
79
|
+
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
|
|
80
|
+
- `artifacts`: List of artifacts with their status (`done`, `skipped`, or other)
|
|
81
|
+
|
|
82
|
+
**If any artifacts are neither `done` nor `skipped`** (skipped artifacts satisfy the requirement - the change declares skip_specs):
|
|
83
|
+
- Display warning listing incomplete artifacts
|
|
84
|
+
- Ask the user to confirm they want to proceed
|
|
85
|
+
- Proceed if user confirms
|
|
86
|
+
|
|
87
|
+
3. **Check task completion status**
|
|
88
|
+
|
|
89
|
+
Run `openspec list --json` with the same selected-root flags and find the
|
|
90
|
+
entry in `changes` whose `name` exactly matches the selected change.
|
|
91
|
+
Require exactly one match and nonnegative integer `totalTasks` and
|
|
92
|
+
`completedTasks`, with `completedTasks <= totalTasks`. The CLI resolves
|
|
93
|
+
the schema's tracked task files, including custom artifact names, output
|
|
94
|
+
paths, and globs.
|
|
95
|
+
Incomplete tasks = `totalTasks - completedTasks`.
|
|
96
|
+
|
|
97
|
+
Do not infer task completion from artifact status or the absence of a
|
|
98
|
+
top-level `tasks.md`. If the lookup fails, returns invalid JSON, omits or
|
|
99
|
+
duplicates the selected change, or returns invalid counts, report the problem
|
|
100
|
+
and stop before syncing or archiving.
|
|
101
|
+
The CLI counts only `x`/`X` checkbox markers as complete;
|
|
102
|
+
other markers, including unfamiliar ones, remain incomplete.
|
|
103
|
+
|
|
104
|
+
**If incomplete tasks found:**
|
|
105
|
+
- Display warning showing count of incomplete tasks
|
|
106
|
+
- Ask the user to confirm they want to proceed
|
|
107
|
+
- Proceed if user confirms
|
|
108
|
+
|
|
109
|
+
**If `totalTasks` is zero:** Proceed without a task-related warning.
|
|
110
|
+
|
|
111
|
+
4. **Assess delta spec sync state**
|
|
112
|
+
|
|
113
|
+
Use `artifactPaths.specs.existingOutputPaths` from status JSON as the only
|
|
114
|
+
delta-spec source. If the `specs` entry is missing or
|
|
115
|
+
`existingOutputPaths` is empty, proceed without a sync prompt and do not infer
|
|
116
|
+
delta specs from other artifacts.
|
|
117
|
+
|
|
118
|
+
**If delta specs exist:**
|
|
119
|
+
- Compare each delta spec with its corresponding main spec at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (use the store-aware `planningHome.root` from step 2, not a hardcoded repo path)
|
|
120
|
+
- A missing main spec is **not automatically** "already synced". For a new capability, the main spec is an *output* of the sync, not an input:
|
|
121
|
+
- If the delta has MODIFIED or RENAMED requirements, report that only ADDED requirements can create a new main spec and mark that capability as sync-blocked. Never invent a requirement that has no current version.
|
|
122
|
+
- Otherwise, if the delta has only REMOVED requirements and the change's `.openspec.yaml` declares `retire_capabilities: true`, the capability is already retired: count it as already synced, warn that there is nothing left to remove, and do not recreate the main spec. Apply this rule both now and when verifying a completed sync.
|
|
123
|
+
- Otherwise, if the delta has no ADDED requirements, report that no sync is possible and mark that capability as sync-blocked. For a REMOVED-only delta, warn that there is no main spec to remove from and leave the main-spec tree unchanged. `openspec archive` refuses the unmarked REMOVED-only case with `Spec must have at least one requirement`.
|
|
124
|
+
- Otherwise, count the capability as needing sync and name it in the summary (`<capability-path>: new main spec will be created`). If the delta also has REMOVED requirements, warn that they will be ignored because there is no main spec to remove from. The sync creates the main spec from only the delta's ADDED requirements, exactly as `openspec archive` does.
|
|
125
|
+
- Determine what changes would be applied (adds, modifications, removals, renames)
|
|
126
|
+
- Continue assessing the remaining capabilities even when one is sync-blocked. Show a combined summary before prompting.
|
|
127
|
+
|
|
128
|
+
**Prompt options:**
|
|
129
|
+
- If any capability is sync-blocked: explain why and offer only "Archive without syncing", "Cancel"
|
|
130
|
+
- Otherwise, if changes needed: "Sync now (recommended)", "Archive without syncing"
|
|
131
|
+
- Otherwise, if already synced: "Archive now", "Sync anyway", "Cancel"
|
|
132
|
+
|
|
133
|
+
Route on the answer:
|
|
134
|
+
- "Cancel" — stop, do not archive
|
|
135
|
+
- "Archive without syncing" or "Archive now" — proceed to archive
|
|
136
|
+
- "Sync now" or "Sync anyway" — sync, then verify (below). Do not start any sync while a capability is sync-blocked; explain the blocker and repeat the available choices.
|
|
137
|
+
- Anything else — ask again rather than archiving
|
|
138
|
+
|
|
139
|
+
Before a selected sync writes any main spec, run
|
|
140
|
+
`openspec instructions specs --change "<name>" --json` once with the same
|
|
141
|
+
selected-root flags. Require a zero exit status and valid artifact-instruction
|
|
142
|
+
JSON. If the lookup fails or returns invalid JSON, report the error and stop
|
|
143
|
+
before writing any main spec or moving the change. A valid response with omitted
|
|
144
|
+
`rules` is the no-rules case. Apply returned `rules` only to the content and
|
|
145
|
+
form of main specs produced by this merge; do not use them as archive guidance,
|
|
146
|
+
change CLI behavior, or copy the rule text into any output file.
|
|
147
|
+
|
|
148
|
+
Then run the `openspec-sync-specs` workflow inline (agent-driven intelligent merge) for change '<name>', passing the delta spec analysis and the fetched specs-rule snapshot from above, and wait for it to finish. The inline sync must reuse that snapshot without fetching `specs` instructions again. Do not delegate it to a background task — step 5 would move `changeRoot` out from under a sync that is still reading it, leaving the change archived and the main specs never updated. If your agent can only run it by delegation, delegate synchronously and wait for the result.
|
|
149
|
+
|
|
150
|
+
If the sync reports any stop or blocking condition, treat the sync as failed.
|
|
151
|
+
Stop the archive immediately. Do not perform the post-sync content comparison and do not move its `changeRoot`.
|
|
152
|
+
Nothing has moved, so the user can fix the blocking condition or re-run the sync.
|
|
153
|
+
|
|
154
|
+
After the sync writes each main spec, verify its structure against the canonical sync contract:
|
|
155
|
+
- A new main spec starts with a `# <capability> Specification` title. An existing main spec keeps its title exactly as it is.
|
|
156
|
+
- Preserve existing `## Purpose` sections completely untouched for established main specs.
|
|
157
|
+
- For a new main spec, copy the delta `## Purpose` verbatim. Warn only if the purpose text is shorter than standard validation expects. Do not regenerate or rewrite existing authored purpose. If no usable `## Purpose` is provided, use the existing TBD Purpose behavior and warning.
|
|
158
|
+
- Verify that no delta-style section headers (`## ADDED Requirements`, `## MODIFIED Requirements`, `## REMOVED Requirements`, `## RENAMED Requirements`) remain in the main spec, adhering strictly to the sync workflow formatting rules.
|
|
159
|
+
- Requirement blocks the sync wrote or changed use `### Requirement:` headings, and their scenarios use `#### Scenario:` headings, under the spec's `## Requirements` section. Leave content the delta does not mention exactly as it is.
|
|
160
|
+
|
|
161
|
+
Then re-run the comparison from the top of this step, including the explicitly retired, missing-spec case, against every capability that has a delta spec in `artifactPaths.specs.existingOutputPaths` — not only the ones the sync reports it touched. A successful sync leaves nothing left to apply, so each capability must now read as already synced:
|
|
162
|
+
- ADDED requirements present
|
|
163
|
+
- MODIFIED requirements carrying the scenario and description changes named in the delta, with their other scenarios intact
|
|
164
|
+
- REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving `## Requirements` empty), its main spec deleted rather than left empty.
|
|
165
|
+
- RENAMED requirements present under the new name and absent under the old one
|
|
166
|
+
|
|
167
|
+
If the sync failed, or any capability does not match, report what differs and stop — do not archive. Nothing has moved and `changeRoot` is intact, so the user can fix the mismatch or re-run the sync and start the archive again.
|
|
168
|
+
|
|
169
|
+
5. **Perform the archive**
|
|
170
|
+
|
|
171
|
+
Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
|
|
172
|
+
```bash
|
|
173
|
+
mkdir -p "<planningHome.changesDir>/archive"
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Generate the target name: use the change name as-is when it already starts with a `YYYY-MM-DD-` prefix; otherwise prepend the current date as `YYYY-MM-DD-<change-name>`. Never stack a second date (same rule as `openspec archive`).
|
|
177
|
+
|
|
178
|
+
**Check if target already exists:**
|
|
179
|
+
- If yes: Fail with error, suggest renaming existing archive or using different date
|
|
180
|
+
- If no: Move `changeRoot` to the archive directory
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
6. **Display summary**
|
|
187
|
+
|
|
188
|
+
Show archive completion summary including:
|
|
189
|
+
- Change name
|
|
190
|
+
- Schema that was used
|
|
191
|
+
- Archive location
|
|
192
|
+
- Whether specs were synced (if applicable)
|
|
193
|
+
- Note about any warnings (incomplete artifacts/tasks)
|
|
194
|
+
|
|
195
|
+
**Output On Success**
|
|
196
|
+
|
|
197
|
+
```markdown
|
|
198
|
+
## Archive Complete
|
|
199
|
+
|
|
200
|
+
**Change:** <change-name>
|
|
201
|
+
**Schema:** <schema-name>
|
|
202
|
+
**Archived to:** the archive path derived from `planningHome.changesDir`/<target-name>/
|
|
203
|
+
**Specs:** <"✓ Synced to main specs" only if the step 4 verification passed; otherwise "No delta specs" or "Sync skipped">
|
|
204
|
+
|
|
205
|
+
<"All artifacts complete. All tasks complete." — or, if archived with warnings, list them instead (e.g. "Archived with 2 incomplete tasks")>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Guardrails**
|
|
209
|
+
- Announce the selected change; prompt for selection when it is ambiguous
|
|
210
|
+
- Use artifact graph (openspec status --json) for completion checking
|
|
211
|
+
- Don't block archive on warnings - just inform and confirm
|
|
212
|
+
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
|
|
213
|
+
- Show clear summary of what happened
|
|
214
|
+
- If sync is requested, run the `openspec-sync-specs` workflow inline (agent-driven)
|
|
215
|
+
- Never archive while a spec sync is still in flight — run the sync inline and verify the main specs before moving `changeRoot`
|
|
216
|
+
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
|
|
217
|
+
- Apply relevant runtime context and report conflicts; operation guidance remains advisory
|
|
218
|
+
- Consider every guidance entry and explain any inapplicable or conflicting advice
|
|
219
|
+
- Existing CLI checks, resolved paths, prompts, and command contracts are unchanged
|
|
220
|
+
- Artifact rules constrain only the specs being written and are never operation guidance
|
|
221
|
+
- Never copy runtime context, operation guidance, or artifact-rule text verbatim into output files
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-explore
|
|
3
|
+
description: Enter OpenSpec explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements in a project that uses OpenSpec. Use when the user wants to think through something before or during an OpenSpec change. Also use when the user says "openspec explore" or "opsx explore".
|
|
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.16.0"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
|
|
14
|
+
|
|
15
|
+
**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, investigate the codebase, and run read-only commands or tools without confirmation, but you must NEVER write code or implement features. If the user asks you to implement something, do not start it here: say that explore mode does not implement, and point them at `/opsx:propose`, which turns the discussion into a change. The work happens from that change, never from explore mode. You MAY create or update OpenSpec change artifacts (proposals, designs, specs) within a confirmed scope—that's capturing thinking, not implementing. Answering design or clarifying questions is never consent to write. Before the first write-capable action, name the artifacts or files you would change and what you would do, ask a direct yes/no question, and wait for the user's confirmation in a separate message. Confirmation covers only the scope you described; ask again before expanding it. An explicit request from the user to capture the exploration as a new change is itself that confirmation, covering the change and the change artifacts the request names; scaffold it first as described below.
|
|
16
|
+
|
|
17
|
+
**This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
|
|
18
|
+
|
|
19
|
+
**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.
|
|
20
|
+
|
|
21
|
+
**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.
|
|
22
|
+
|
|
23
|
+
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`.
|
|
24
|
+
|
|
25
|
+
Otherwise, with no root, what happens next depends on how this workflow was reached:
|
|
26
|
+
|
|
27
|
+
- **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.
|
|
28
|
+
- **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.
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## The Stance
|
|
35
|
+
|
|
36
|
+
- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
|
|
37
|
+
- **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
|
|
38
|
+
- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
|
|
39
|
+
- **Adaptive** - Follow interesting threads, pivot when new information emerges
|
|
40
|
+
- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
|
|
41
|
+
- **Grounded** - Explore the actual codebase when relevant, don't just theorize
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Planning a Change
|
|
46
|
+
|
|
47
|
+
When the user is planning a change, guide them toward shared understanding with focused discovery questions. For open-ended discussion, follow the conversation without imposing an interview or a required output.
|
|
48
|
+
|
|
49
|
+
Before asking a factual question, follow the context discovery below and inspect relevant OpenSpec artifacts, source, tests, docs, and configuration. Do not ask the user to repeat facts you can verify. Summarize relevant findings without reproducing private context or rules. If evidence is missing, conflicting, or inaccessible, state that limitation and ask only for the clarification needed to proceed.
|
|
50
|
+
|
|
51
|
+
- **Follow dependencies** - Resolve the next blocking decision before its dependent details. For example, clarify the user's outcome and scope before choosing an API or data model. Revisit downstream assumptions when an earlier answer changes. Skip branches that do not matter to this goal.
|
|
52
|
+
- **Keep questions focused** - Ask one focused question at a time, and briefly explain why it matters and which decision it unlocks. Batch questions only if the user asks for a batch; keep them small and group related decisions.
|
|
53
|
+
- **Offer grounded recommendations** - When evidence supports a recommendation, state your preferred option and why it fits the user's goals, with alternatives and their tradeoffs when useful. Do not invent intent, priorities, or external constraints: ask the user when only they can answer. Avoid a fixed question format.
|
|
54
|
+
- **Keep a conversational record** - Track decisions in the conversation, not in files. Separate confirmed decisions from proposed defaults and unresolved questions. Silence is not acceptance. Accepting an answer or a batch of recommendations is not permission to write. Keep file-write confirmation separate from discovery questions and follow the guardrails below.
|
|
55
|
+
|
|
56
|
+
Stop asking when the user has enough clarity. Let them pause, pivot, or defer a decision; do not exhaust every branch or force a proposal.
|
|
57
|
+
|
|
58
|
+
For example, after inspecting the relevant code:
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
The CLI already uses SQLite and has no remote service. Is sharing state
|
|
62
|
+
across devices in scope? That determines whether local storage is enough.
|
|
63
|
+
If this stays a single-device tool, I recommend keeping SQLite to avoid
|
|
64
|
+
adding a service to operate; shared state would need a separate sync design.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## What You Might Do
|
|
70
|
+
|
|
71
|
+
Depending on what the user brings, you might:
|
|
72
|
+
|
|
73
|
+
**Explore the problem space**
|
|
74
|
+
- Ask clarifying questions that emerge from what they said
|
|
75
|
+
- Challenge assumptions
|
|
76
|
+
- Reframe the problem
|
|
77
|
+
- Find analogies
|
|
78
|
+
|
|
79
|
+
**Investigate the codebase**
|
|
80
|
+
- Map existing architecture relevant to the discussion
|
|
81
|
+
- Find integration points
|
|
82
|
+
- Identify patterns already in use
|
|
83
|
+
- Surface hidden complexity
|
|
84
|
+
|
|
85
|
+
**Compare options**
|
|
86
|
+
- Brainstorm multiple approaches
|
|
87
|
+
- Build comparison tables
|
|
88
|
+
- Sketch tradeoffs
|
|
89
|
+
- Recommend a path (if asked)
|
|
90
|
+
|
|
91
|
+
**Visualize**
|
|
92
|
+
```
|
|
93
|
+
+------------------------------------------+
|
|
94
|
+
| Use ASCII diagrams liberally |
|
|
95
|
+
+------------------------------------------+
|
|
96
|
+
| |
|
|
97
|
+
| [State A] -------> [State B] |
|
|
98
|
+
| | |
|
|
99
|
+
| v |
|
|
100
|
+
| [State C] |
|
|
101
|
+
| |
|
|
102
|
+
| System diagrams, state machines, |
|
|
103
|
+
| data flows, architecture sketches, |
|
|
104
|
+
| dependency graphs, comparison tables |
|
|
105
|
+
| |
|
|
106
|
+
+------------------------------------------+
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Draw with plain ASCII only** — borders `+` `-` `|`, arrows `-->` `<--` `^` `v`, markers `*` `x`.
|
|
110
|
+
Unicode diagram glyphs can render at different widths across terminals, fonts, and locales, so padded boxes and aligned tables can drift. Keep every diagram character ASCII.
|
|
111
|
+
|
|
112
|
+
**Surface risks and unknowns**
|
|
113
|
+
- Identify what could go wrong
|
|
114
|
+
- Find gaps in understanding
|
|
115
|
+
- Suggest spikes or investigations
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## OpenSpec Awareness
|
|
120
|
+
|
|
121
|
+
You have full context of the OpenSpec system. Use it naturally, don't force it.
|
|
122
|
+
|
|
123
|
+
### Check for context
|
|
124
|
+
|
|
125
|
+
At the start, quickly check what exists:
|
|
126
|
+
```bash
|
|
127
|
+
openspec list --json
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
This tells you:
|
|
131
|
+
- If there are active changes
|
|
132
|
+
- Their names and task status
|
|
133
|
+
- What the user might be working on
|
|
134
|
+
|
|
135
|
+
That is the *change* list - work in flight. It does not include the project's durable capabilities, so list those too:
|
|
136
|
+
```bash
|
|
137
|
+
openspec list --specs
|
|
138
|
+
```
|
|
139
|
+
Add `--json` for ids and requirement counts, and append `--store "<id>"` only for a registered standalone store. This is the inventory of what the project already claims to do, and `openspec list` on its own never shows it. To look at one, run `openspec show "<spec-id>" --type spec --json --no-scenarios` (same `--store` rule) - it returns that capability's purpose and requirement texts without pulling the whole spec file into context, and `--type spec` stops a change of the same name from making it ambiguous.
|
|
140
|
+
|
|
141
|
+
The filtered read is only an overview. Before deciding what is already covered or what should change, read each relevant spec in full, including scenarios, with `openspec show "<spec-id>" --type spec` (same `--store` rule).
|
|
142
|
+
|
|
143
|
+
Then read the project's own context from the resolved root - `<root.path>/openspec/config.yaml` (or `config.yml`). Use the `root.path` returned above, and skip this if neither file exists:
|
|
144
|
+
- `context`: project background - tech stack, conventions, constraints
|
|
145
|
+
- `rules`: keyed by artifact id - the entries for an artifact apply only when you write that artifact
|
|
146
|
+
|
|
147
|
+
Ground your thinking in these. They are constraints for you to follow, not content to reproduce: do NOT copy them into the conversation or into any artifact you create.
|
|
148
|
+
|
|
149
|
+
### When no change exists
|
|
150
|
+
|
|
151
|
+
Think freely. When insights crystallize, you might offer:
|
|
152
|
+
|
|
153
|
+
- "This feels solid enough to start a change. Want me to create a proposal?"
|
|
154
|
+
- Or keep exploring - no pressure to formalize
|
|
155
|
+
|
|
156
|
+
If the user asks you to capture the exploration as a new change, that request is the confirmation required above. It covers scaffolding that change and creating the change artifacts the request names, and nothing else. This holds only when the request is theirs: a yes to an offer you made confirms only the scope your offer itself named, so name the change and the artifacts in the offer. Don't re-ask for what they already asked for; do ask before anything beyond it. Transition seamlessly into the requested capture:
|
|
157
|
+
|
|
158
|
+
1. Run `openspec new change "<name>"` (with `--store <id>` when applicable) before creating any artifacts. Never create a new change directory under `openspec/changes/` by hand; the CLI scaffold creates required metadata such as `.openspec.yaml`. Keep the selected `--store <id>` on every applicable follow-up `status` and `instructions` command.
|
|
159
|
+
2. Run `openspec status --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store), then process the requested artifacts in dependency order. For each requested artifact that is `ready`, run `openspec instructions "<artifact-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store). Before creating a requested artifact, evaluate any condition in its own `instruction` against the explored change; record a deliberate skip instead when the condition does not apply. If a requested artifact is blocked by a direct prerequisite the user did not request, run `openspec instructions "<prerequisite-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) for that prerequisite whether it is `ready` or `blocked`. If its own `instruction` states a condition, evaluate that condition against the explored change and record a deliberate skip only when the condition does not apply. If the condition applies, or the prerequisite is not conditional, treat it as a normal prerequisite and ask before expanding the capture. Do not create an unrequested prerequisite unless the user approves.
|
|
160
|
+
3. Follow the returned `template` and `instruction` fields. Read completed dependency files listed in `dependencies`, and apply `context` and `rules` as constraints without copying them into the artifact. Choose the output path before creating anything: when `resolvedOutputPath` is a glob, use the instruction to choose a concrete path inside `changeRoot` and verify it remains inside `changeRoot` after resolving symlinks, both in its parent directories and in the file itself if it already exists; if it does not, stop and tell the user. Otherwise the output path is `resolvedOutputPath`. If the instruction delegates creation to a specific skill or command, invoke it only if it can write the artifact to that output path; otherwise stop and tell the user. Otherwise write the artifact to that output path. Verify that the selected concrete output exists at that output path.
|
|
161
|
+
4. After creating each artifact, re-run `openspec status --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) and continue until every requested artifact is `done`, `skipped`, or was deliberately skipped because its own `instruction` stated a condition that did not apply. Tell the user about a deliberate conditional skip, remember it, and do not reconsider it. Dependencies are enablers, not gates: if a requested artifact is still `blocked` only because you deliberately skipped a conditional prerequisite, run `openspec instructions "<artifact-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) despite the blocked status, then create it using step 3 only when those recorded conditional skips are its sole missing dependencies. If a requested artifact is blocked by a prerequisite the user did not ask to capture and cannot be conditionally skipped, explain that dependency and ask before expanding the capture.
|
|
162
|
+
|
|
163
|
+
Capture the artifact(s) the user requested without asking them to invoke another workflow command. If they asked only to start a change, stop after scaffolding and show its status. When the requested capture is done, stop there and name where the work continues: `/opsx:propose` writes the remaining planning artifacts, and `/opsx:apply` implements the change once tasks exist. Capturing artifacts never starts implementing them.
|
|
164
|
+
|
|
165
|
+
### When a change exists
|
|
166
|
+
|
|
167
|
+
If the user mentions a change or you detect one is relevant:
|
|
168
|
+
|
|
169
|
+
1. **Resolve and read existing artifacts for context**
|
|
170
|
+
- Run `openspec status --change "<name>" --json`.
|
|
171
|
+
- Use `changeRoot`, `artifactPaths`, and `actionContext` from the status JSON.
|
|
172
|
+
- Read existing files from `artifactPaths.<artifact>.existingOutputPaths`.
|
|
173
|
+
|
|
174
|
+
2. **Reference them naturally in conversation**
|
|
175
|
+
- "Your design mentions using Redis, but we just realized SQLite fits better..."
|
|
176
|
+
- "The proposal scopes this to premium users, but we're now thinking everyone..."
|
|
177
|
+
|
|
178
|
+
3. **Offer to capture when decisions are made**
|
|
179
|
+
|
|
180
|
+
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve an existing capability's full path and follow the project's established organization for new capabilities.
|
|
181
|
+
|
|
182
|
+
The files below are the default spec-driven schema's. With another schema, capture each insight in whichever artifact from `artifactPaths` fits it, and name that artifact in your offer; never create an artifact the schema does not define.
|
|
183
|
+
|
|
184
|
+
| Insight Type | Where to Capture |
|
|
185
|
+
|----------------------------|-------------------------------------|
|
|
186
|
+
| New requirement discovered | `specs/<capability-path>/spec.md` |
|
|
187
|
+
| Requirement changed | `specs/<capability-path>/spec.md` |
|
|
188
|
+
| Design decision made | `design.md` |
|
|
189
|
+
| Scope changed | `proposal.md` |
|
|
190
|
+
| New work identified | `tasks.md` |
|
|
191
|
+
| Assumption invalidated | Relevant artifact |
|
|
192
|
+
|
|
193
|
+
Example offers (default schema):
|
|
194
|
+
- "That's a design decision. Capture it in design.md?"
|
|
195
|
+
- "This is a new requirement. Add it to specs?"
|
|
196
|
+
- "This changes scope. Update the proposal?"
|
|
197
|
+
|
|
198
|
+
4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## What You Don't Have To Do
|
|
203
|
+
|
|
204
|
+
- Follow a script
|
|
205
|
+
- Ask the same questions every time
|
|
206
|
+
- Produce a specific artifact
|
|
207
|
+
- Reach a conclusion
|
|
208
|
+
- Stay on topic if a tangent is valuable
|
|
209
|
+
- Be brief (this is thinking time)
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Handling Different Entry Points
|
|
214
|
+
|
|
215
|
+
**User brings a vague idea:**
|
|
216
|
+
```
|
|
217
|
+
User: I'm thinking about adding real-time collaboration
|
|
218
|
+
|
|
219
|
+
You: Real-time collab is a big space. Let me think about this...
|
|
220
|
+
|
|
221
|
+
COLLABORATION SPECTRUM
|
|
222
|
+
============================================
|
|
223
|
+
|
|
224
|
+
Awareness Coordination Sync
|
|
225
|
+
| | |
|
|
226
|
+
v v v
|
|
227
|
+
+--------+ +--------+ +--------+
|
|
228
|
+
|Presence| |Cursors | | CRDT |
|
|
229
|
+
| "3 | | Multi | |Conflict|
|
|
230
|
+
|online" | | select | | free |
|
|
231
|
+
+--------+ +--------+ +--------+
|
|
232
|
+
| | |
|
|
233
|
+
trivial moderate complex
|
|
234
|
+
|
|
235
|
+
Where's your head at?
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**User brings a specific problem:**
|
|
239
|
+
```
|
|
240
|
+
User: The auth system is a mess
|
|
241
|
+
|
|
242
|
+
You: [reads codebase]
|
|
243
|
+
|
|
244
|
+
+---------------------------------------------+
|
|
245
|
+
| CURRENT AUTH FLOW |
|
|
246
|
+
+---------------------------------------------+
|
|
247
|
+
|
|
|
248
|
+
+-------------+-------------+
|
|
249
|
+
v v v
|
|
250
|
+
+---------+ +---------+ +---------+
|
|
251
|
+
| Google | | GitHub | | Email |
|
|
252
|
+
| OAuth | | OAuth | | Magic |
|
|
253
|
+
+----+----+ +----+----+ +----+----+
|
|
254
|
+
| | |
|
|
255
|
+
+-------------+-------------+
|
|
256
|
+
v
|
|
257
|
+
+-----------+
|
|
258
|
+
| Session |
|
|
259
|
+
+-----+-----+
|
|
260
|
+
|
|
|
261
|
+
v
|
|
262
|
+
+-----------+
|
|
263
|
+
| Perms |
|
|
264
|
+
+-----------+
|
|
265
|
+
|
|
266
|
+
I see three tangles. Which one's burning?
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**User is stuck mid-implementation:**
|
|
270
|
+
```
|
|
271
|
+
User: /opsx:explore add-auth-system
|
|
272
|
+
The OAuth integration is more complex than expected
|
|
273
|
+
|
|
274
|
+
You: [reads change artifacts]
|
|
275
|
+
|
|
276
|
+
You're on task 4: "Implement OAuth flow"
|
|
277
|
+
|
|
278
|
+
Let me trace what's involved...
|
|
279
|
+
|
|
280
|
+
[draws diagram, explores options, suggests paths]
|
|
281
|
+
|
|
282
|
+
Want to update the design to reflect this?
|
|
283
|
+
Or add a spike task to investigate?
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**User wants to compare options:**
|
|
287
|
+
```
|
|
288
|
+
User: Should we use Postgres or SQLite?
|
|
289
|
+
|
|
290
|
+
You: Generic answer is boring. What's the context?
|
|
291
|
+
|
|
292
|
+
User: A CLI tool that tracks local dev environments
|
|
293
|
+
|
|
294
|
+
You: That changes everything.
|
|
295
|
+
|
|
296
|
+
+-------------------------------------------------+
|
|
297
|
+
| CLI TOOL DATA STORAGE |
|
|
298
|
+
+-------------------------------------------------+
|
|
299
|
+
|
|
300
|
+
Key constraints:
|
|
301
|
+
- No daemon running
|
|
302
|
+
- Must work offline
|
|
303
|
+
- Single user
|
|
304
|
+
|
|
305
|
+
SQLite Postgres
|
|
306
|
+
Deployment embedded needs server
|
|
307
|
+
Offline yes no
|
|
308
|
+
Single file yes no
|
|
309
|
+
|
|
310
|
+
SQLite. Not even close.
|
|
311
|
+
|
|
312
|
+
Unless... is there a sync component?
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## Ending Discovery
|
|
318
|
+
|
|
319
|
+
There's no required ending. Discovery might:
|
|
320
|
+
|
|
321
|
+
- **Flow into a proposal**: "Ready to start? Run `/opsx:propose` and this becomes a change."
|
|
322
|
+
- **Result in artifact updates**: "Updated the design with these decisions"
|
|
323
|
+
- **Just provide clarity**: User has what they need, moves on
|
|
324
|
+
- **Continue later**: "We can pick this up anytime"
|
|
325
|
+
|
|
326
|
+
When it feels like things are crystallizing, you might summarize:
|
|
327
|
+
|
|
328
|
+
```
|
|
329
|
+
## What We Figured Out
|
|
330
|
+
|
|
331
|
+
**The problem**: [crystallized understanding]
|
|
332
|
+
|
|
333
|
+
**The approach**: [if one emerged]
|
|
334
|
+
|
|
335
|
+
**Open questions**: [if any remain]
|
|
336
|
+
|
|
337
|
+
**Next steps** (if ready):
|
|
338
|
+
- Turn this into a change: `/opsx:propose`
|
|
339
|
+
- Keep exploring: just keep talking
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
But this summary is optional. Sometimes the thinking IS the value.
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## Guardrails
|
|
347
|
+
|
|
348
|
+
- **Don't implement** - Never write code or implement features. Workflow configuration counts too: creating or editing schemas, templates, or `openspec/config.yaml` is a change, not thinking. Creating or updating OpenSpec change artifacts within the confirmed scope is fine, writing anything else is not. When the user is ready to build, name the handoff rather than starting: `/opsx:propose` turns the discussion into a change, and the work happens there.
|
|
349
|
+
- **Don't fake understanding** - If something is unclear, dig deeper
|
|
350
|
+
- **Don't rush** - Discovery is thinking time, not task time
|
|
351
|
+
- **Don't force structure** - Let patterns emerge naturally
|
|
352
|
+
- **Don't auto-capture** - Offer to save insights, don't just do it. Read-only commands and tools need no confirmation. Before the first write-capable action—including `openspec new change` or another command that writes files—name the artifacts or files and proposed changes, ask a direct yes/no question, and wait for explicit confirmation in a separate user message. That confirmation covers only the described scope; ask again before expanding it. Answers to design or clarifying questions are never consent to write. That rule governs `openspec new change` whenever you are the one proposing the capture; the user's own capture request is the exception, handled in the capture transition above.
|
|
353
|
+
- **Don't manually scaffold changes** - Never create a new change directory under `openspec/changes/` by hand. Always use `openspec new change "<name>"` (with `--store <id>` when applicable) so required metadata such as `.openspec.yaml` is created before writing artifacts.
|
|
354
|
+
- **Do visualize** - A good diagram is worth many paragraphs
|
|
355
|
+
- **Do explore the codebase** - Ground discussions in reality
|
|
356
|
+
- **Do question assumptions** - Including the user's and your own
|