@liangxie/qf 0.0.1

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.
Files changed (56) hide show
  1. package/.claude/commands/opsx/apply.md +155 -0
  2. package/.claude/commands/opsx/archive.md +160 -0
  3. package/.claude/commands/opsx/explore.md +174 -0
  4. package/.claude/commands/opsx/propose.md +109 -0
  5. package/.claude/commands/opsx/sync.md +143 -0
  6. package/.claude/skills/openspec-apply-change/SKILL.md +159 -0
  7. package/.claude/skills/openspec-archive-change/SKILL.md +117 -0
  8. package/.claude/skills/openspec-explore/SKILL.md +289 -0
  9. package/.claude/skills/openspec-propose/SKILL.md +113 -0
  10. package/.claude/skills/openspec-sync-specs/SKILL.md +147 -0
  11. package/.codex/skills/openspec-apply-change/SKILL.md +159 -0
  12. package/.codex/skills/openspec-archive-change/SKILL.md +117 -0
  13. package/.codex/skills/openspec-explore/SKILL.md +289 -0
  14. package/.codex/skills/openspec-propose/SKILL.md +113 -0
  15. package/.codex/skills/openspec-sync-specs/SKILL.md +147 -0
  16. package/.cursor/commands/opsx-apply.md +155 -0
  17. package/.cursor/commands/opsx-archive.md +160 -0
  18. package/.cursor/commands/opsx-explore.md +174 -0
  19. package/.cursor/commands/opsx-propose.md +109 -0
  20. package/.cursor/commands/opsx-sync.md +143 -0
  21. package/.cursor/skills/openspec-apply-change/SKILL.md +159 -0
  22. package/.cursor/skills/openspec-archive-change/SKILL.md +117 -0
  23. package/.cursor/skills/openspec-explore/SKILL.md +289 -0
  24. package/.cursor/skills/openspec-propose/SKILL.md +113 -0
  25. package/.cursor/skills/openspec-sync-specs/SKILL.md +147 -0
  26. package/.github/prompts/opsx-apply.prompt.md +152 -0
  27. package/.github/prompts/opsx-archive.prompt.md +157 -0
  28. package/.github/prompts/opsx-explore.prompt.md +171 -0
  29. package/.github/prompts/opsx-propose.prompt.md +106 -0
  30. package/.github/prompts/opsx-sync.prompt.md +140 -0
  31. package/.github/skills/openspec-apply-change/SKILL.md +159 -0
  32. package/.github/skills/openspec-archive-change/SKILL.md +117 -0
  33. package/.github/skills/openspec-explore/SKILL.md +289 -0
  34. package/.github/skills/openspec-propose/SKILL.md +113 -0
  35. package/.github/skills/openspec-sync-specs/SKILL.md +147 -0
  36. package/.omo/run-continuation/ses_0d9f5cba6ffeW2r1NWuthiPI0F.json +10 -0
  37. package/.opencode/commands/opsx-apply.md +152 -0
  38. package/.opencode/commands/opsx-archive.md +157 -0
  39. package/.opencode/commands/opsx-explore.md +171 -0
  40. package/.opencode/commands/opsx-propose.md +106 -0
  41. package/.opencode/commands/opsx-sync.md +140 -0
  42. package/.opencode/skills/openspec-apply-change/SKILL.md +159 -0
  43. package/.opencode/skills/openspec-archive-change/SKILL.md +117 -0
  44. package/.opencode/skills/openspec-explore/SKILL.md +289 -0
  45. package/.opencode/skills/openspec-propose/SKILL.md +113 -0
  46. package/.opencode/skills/openspec-sync-specs/SKILL.md +147 -0
  47. package/LICENSE +21 -0
  48. package/index.js +17 -0
  49. package/openspec/changes/archive/2026-07-03-add-say-command/.openspec.yaml +2 -0
  50. package/openspec/changes/archive/2026-07-03-add-say-command/design.md +73 -0
  51. package/openspec/changes/archive/2026-07-03-add-say-command/proposal.md +28 -0
  52. package/openspec/changes/archive/2026-07-03-add-say-command/specs/cli-framework/spec.md +22 -0
  53. package/openspec/changes/archive/2026-07-03-add-say-command/specs/say-command/spec.md +22 -0
  54. package/openspec/changes/archive/2026-07-03-add-say-command/tasks.md +17 -0
  55. package/openspec/config.yaml +20 -0
  56. package/package.json +25 -0
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: openspec-sync-specs
3
+ description: Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.
4
+ license: MIT
5
+ compatibility: Requires openspec CLI.
6
+ metadata:
7
+ author: openspec
8
+ version: "1.0"
9
+ generatedBy: "1.5.0"
10
+ ---
11
+
12
+ Sync delta specs from a change to main specs.
13
+
14
+ This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
15
+
16
+ **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`). 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.
17
+
18
+ **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.
19
+
20
+ **Steps**
21
+
22
+ 1. **If no change name provided, prompt for selection**
23
+
24
+ Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
25
+
26
+ Show changes that have delta specs (under `specs/` directory).
27
+
28
+ **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
29
+
30
+ 2. **Resolve change context**
31
+
32
+ Run:
33
+ ```bash
34
+ openspec status --change "<name>" --json
35
+ ```
36
+
37
+ 3. **Find delta specs**
38
+
39
+ Use `artifactPaths.specs.existingOutputPaths` from the status JSON as the list of delta spec files.
40
+
41
+ Each delta spec file contains sections like:
42
+ - `## ADDED Requirements` - New requirements to add
43
+ - `## MODIFIED Requirements` - Changes to existing requirements
44
+ - `## REMOVED Requirements` - Requirements to remove
45
+ - `## RENAMED Requirements` - Requirements to rename (FROM:/TO: format)
46
+
47
+ If no delta specs found, inform user and stop.
48
+
49
+ 4. **For each delta spec, apply changes to main specs**
50
+
51
+ For each repo-local capability delta spec path returned by the CLI:
52
+
53
+ a. **Read the delta spec** to understand the intended changes
54
+
55
+ b. **Read the main spec** at `openspec/specs/<capability>/spec.md` (may not exist yet)
56
+
57
+ c. **Apply changes intelligently**:
58
+
59
+ **ADDED Requirements:**
60
+ - If requirement doesn't exist in main spec → add it
61
+ - If requirement already exists → update it to match (treat as implicit MODIFIED)
62
+
63
+ **MODIFIED Requirements:**
64
+ - Find the requirement in main spec
65
+ - Apply the changes - this can be:
66
+ - Adding new scenarios (don't need to copy existing ones)
67
+ - Modifying existing scenarios
68
+ - Changing the requirement description
69
+ - Preserve scenarios/content not mentioned in the delta
70
+
71
+ **REMOVED Requirements:**
72
+ - Remove the entire requirement block from main spec
73
+
74
+ **RENAMED Requirements:**
75
+ - Find the FROM requirement, rename to TO
76
+
77
+ d. **Create new main spec** if capability doesn't exist yet:
78
+ - Create `openspec/specs/<capability>/spec.md`
79
+ - Add Purpose section (can be brief, mark as TBD)
80
+ - Add Requirements section with the ADDED requirements
81
+
82
+ 5. **Show summary**
83
+
84
+ After applying all changes, summarize:
85
+ - Which capabilities were updated
86
+ - What changes were made (requirements added/modified/removed/renamed)
87
+
88
+ **Delta Spec Format Reference**
89
+
90
+ ```markdown
91
+ ## ADDED Requirements
92
+
93
+ ### Requirement: New Feature
94
+ The system SHALL do something new.
95
+
96
+ #### Scenario: Basic case
97
+ - **WHEN** user does X
98
+ - **THEN** system does Y
99
+
100
+ ## MODIFIED Requirements
101
+
102
+ ### Requirement: Existing Feature
103
+ #### Scenario: New scenario to add
104
+ - **WHEN** user does A
105
+ - **THEN** system does B
106
+
107
+ ## REMOVED Requirements
108
+
109
+ ### Requirement: Deprecated Feature
110
+
111
+ ## RENAMED Requirements
112
+
113
+ - FROM: `### Requirement: Old Name`
114
+ - TO: `### Requirement: New Name`
115
+ ```
116
+
117
+ **Key Principle: Intelligent Merging**
118
+
119
+ Unlike programmatic merging, you can apply **partial updates**:
120
+ - To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios
121
+ - The delta represents *intent*, not a wholesale replacement
122
+ - Use your judgment to merge changes sensibly
123
+
124
+ **Output On Success**
125
+
126
+ ```
127
+ ## Specs Synced: <change-name>
128
+
129
+ Updated main specs:
130
+
131
+ **<capability-1>**:
132
+ - Added requirement: "New Feature"
133
+ - Modified requirement: "Existing Feature" (added 1 scenario)
134
+
135
+ **<capability-2>**:
136
+ - Created new spec file
137
+ - Added requirement: "Another Feature"
138
+
139
+ Main specs are now updated. The change remains active - archive when implementation is complete.
140
+ ```
141
+
142
+ **Guardrails**
143
+ - Read both delta and main specs before making changes
144
+ - Preserve existing content not mentioned in delta
145
+ - If something is unclear, ask for clarification
146
+ - Show what you're changing as you go
147
+ - The operation should be idempotent - running twice should give same result
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: /opsx-apply
3
+ id: opsx-apply
4
+ category: Workflow
5
+ description: Implement tasks from an OpenSpec change (Experimental)
6
+ ---
7
+
8
+ Implement tasks from an OpenSpec change.
9
+
10
+ **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`). 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.
11
+
12
+ **Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
13
+
14
+ **Steps**
15
+
16
+ 1. **Select the change**
17
+
18
+ If a name is provided, use it. Otherwise:
19
+ - Infer from conversation context if the user mentioned a change
20
+ - Auto-select if only one active change exists
21
+ - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
22
+
23
+ Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
24
+
25
+ 2. **Check status to understand the schema**
26
+ ```bash
27
+ openspec status --change "<name>" --json
28
+ ```
29
+ Parse the JSON to understand:
30
+ - `schemaName`: The workflow being used (e.g., "spec-driven")
31
+ - `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
32
+ - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
33
+
34
+ 3. **Get apply instructions**
35
+
36
+ ```bash
37
+ openspec instructions apply --change "<name>" --json
38
+ ```
39
+
40
+ This returns:
41
+ - `contextFiles`: artifact ID -> array of concrete file paths (varies by schema)
42
+ - Progress (total, complete, remaining)
43
+ - Task list with status
44
+ - Dynamic instruction based on current state
45
+
46
+ **Handle states:**
47
+ - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue`
48
+ - If `state: "all_done"`: congratulate, suggest archive
49
+ - Otherwise: proceed to implementation
50
+
51
+ 4. **Read context files**
52
+
53
+ Read every file path listed under `contextFiles` from the apply instructions output.
54
+ The files depend on the schema being used:
55
+ - **spec-driven**: proposal, specs, design, tasks
56
+ - Other schemas: follow the contextFiles from CLI output
57
+
58
+ 5. **Show current progress**
59
+
60
+ Display:
61
+ - Schema being used
62
+ - Progress: "N/M tasks complete"
63
+ - Remaining tasks overview
64
+ - Dynamic instruction from CLI
65
+
66
+ 6. **Implement tasks (loop until done or blocked)**
67
+
68
+ For each pending task:
69
+ - Show which task is being worked on
70
+ - Make the code changes required
71
+ - Keep changes minimal and focused
72
+ - Mark task complete in the tasks file: `- [ ]` → `- [x]`
73
+ - Continue to next task
74
+
75
+ **Pause if:**
76
+ - Task is unclear → ask for clarification
77
+ - Implementation reveals a design issue → suggest updating artifacts
78
+ - Error or blocker encountered → report and wait for guidance
79
+ - User interrupts
80
+
81
+ 7. **On completion or pause, show status**
82
+
83
+ Display:
84
+ - Tasks completed this session
85
+ - Overall progress: "N/M tasks complete"
86
+ - If all done: suggest archive
87
+ - If paused: explain why and wait for guidance
88
+
89
+ **Output During Implementation**
90
+
91
+ ```
92
+ ## Implementing: <change-name> (schema: <schema-name>)
93
+
94
+ Working on task 3/7: <task description>
95
+ [...implementation happening...]
96
+ ✓ Task complete
97
+
98
+ Working on task 4/7: <task description>
99
+ [...implementation happening...]
100
+ ✓ Task complete
101
+ ```
102
+
103
+ **Output On Completion**
104
+
105
+ ```
106
+ ## Implementation Complete
107
+
108
+ **Change:** <change-name>
109
+ **Schema:** <schema-name>
110
+ **Progress:** 7/7 tasks complete ✓
111
+
112
+ ### Completed This Session
113
+ - [x] Task 1
114
+ - [x] Task 2
115
+ ...
116
+
117
+ All tasks complete! You can archive this change with `/opsx:archive`.
118
+ ```
119
+
120
+ **Output On Pause (Issue Encountered)**
121
+
122
+ ```
123
+ ## Implementation Paused
124
+
125
+ **Change:** <change-name>
126
+ **Schema:** <schema-name>
127
+ **Progress:** 4/7 tasks complete
128
+
129
+ ### Issue Encountered
130
+ <description of the issue>
131
+
132
+ **Options:**
133
+ 1. <option 1>
134
+ 2. <option 2>
135
+ 3. Other approach
136
+
137
+ What would you like to do?
138
+ ```
139
+
140
+ **Guardrails**
141
+ - Keep going through tasks until done or blocked
142
+ - Always read context files before starting (from the apply instructions output)
143
+ - If task is ambiguous, pause and ask before implementing
144
+ - If implementation reveals issues, pause and suggest artifact updates
145
+ - Keep code changes minimal and scoped to each task
146
+ - Update task checkbox immediately after completing each task
147
+ - Pause on errors, blockers, or unclear requirements - don't guess
148
+ - Use contextFiles from CLI output, don't assume specific file names
149
+
150
+ **Fluid Workflow Integration**
151
+
152
+ This skill supports the "actions on a change" model:
153
+
154
+ - **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
155
+ - **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: /opsx-archive
3
+ id: opsx-archive
4
+ category: Workflow
5
+ description: Archive a completed change in the experimental workflow
6
+ ---
7
+
8
+ Archive a completed change in the experimental workflow.
9
+
10
+ **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`). 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.
11
+
12
+ **Input**: Optionally specify a change name after `/opsx:archive` (e.g., `/opsx:archive add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
13
+
14
+ **Steps**
15
+
16
+ 1. **If no change name provided, prompt for selection**
17
+
18
+ Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
19
+
20
+ Show only active changes (not already archived).
21
+ Include the schema used for each change if available.
22
+
23
+ **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
24
+
25
+ 2. **Check artifact completion status**
26
+
27
+ Run `openspec status --change "<name>" --json` to check artifact completion.
28
+
29
+ Parse the JSON to understand:
30
+ - `schemaName`: The workflow being used
31
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
32
+ - `artifacts`: List of artifacts with their status (`done` or other)
33
+
34
+ **If any artifacts are not `done`:**
35
+ - Display warning listing incomplete artifacts
36
+ - Prompt user for confirmation to continue
37
+ - Proceed if user confirms
38
+
39
+ 3. **Check task completion status**
40
+
41
+ Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
42
+
43
+ Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
44
+
45
+ **If incomplete tasks found:**
46
+ - Display warning showing count of incomplete tasks
47
+ - Prompt user for confirmation to continue
48
+ - Proceed if user confirms
49
+
50
+ **If no tasks file exists:** Proceed without task-related warning.
51
+
52
+ 4. **Assess delta spec sync state**
53
+
54
+ Use `artifactPaths.specs.existingOutputPaths` from status JSON to check for delta specs. If none exist, proceed without sync prompt.
55
+
56
+ **If delta specs exist:**
57
+ - Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
58
+ - Determine what changes would be applied (adds, modifications, removals, renames)
59
+ - Show a combined summary before prompting
60
+
61
+ **Prompt options:**
62
+ - If changes needed: "Sync now (recommended)", "Archive without syncing"
63
+ - If already synced: "Archive now", "Sync anyway", "Cancel"
64
+
65
+ If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
66
+
67
+ 5. **Perform the archive**
68
+
69
+ Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
70
+ ```bash
71
+ mkdir -p "<planningHome.changesDir>/archive"
72
+ ```
73
+
74
+ Generate target name using current date: `YYYY-MM-DD-<change-name>`
75
+
76
+ **Check if target already exists:**
77
+ - If yes: Fail with error, suggest renaming existing archive or using different date
78
+ - If no: Move `changeRoot` to the archive directory
79
+
80
+ ```bash
81
+ mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
82
+ ```
83
+
84
+ 6. **Display summary**
85
+
86
+ Show archive completion summary including:
87
+ - Change name
88
+ - Schema that was used
89
+ - Archive location
90
+ - Spec sync status (synced / sync skipped / no delta specs)
91
+ - Note about any warnings (incomplete artifacts/tasks)
92
+
93
+ **Output On Success**
94
+
95
+ ```
96
+ ## Archive Complete
97
+
98
+ **Change:** <change-name>
99
+ **Schema:** <schema-name>
100
+ **Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
101
+ **Specs:** ✓ Synced to main specs
102
+
103
+ All artifacts complete. All tasks complete.
104
+ ```
105
+
106
+ **Output On Success (No Delta Specs)**
107
+
108
+ ```
109
+ ## Archive Complete
110
+
111
+ **Change:** <change-name>
112
+ **Schema:** <schema-name>
113
+ **Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
114
+ **Specs:** No delta specs
115
+
116
+ All artifacts complete. All tasks complete.
117
+ ```
118
+
119
+ **Output On Success With Warnings**
120
+
121
+ ```
122
+ ## Archive Complete (with warnings)
123
+
124
+ **Change:** <change-name>
125
+ **Schema:** <schema-name>
126
+ **Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
127
+ **Specs:** Sync skipped (user chose to skip)
128
+
129
+ **Warnings:**
130
+ - Archived with 2 incomplete artifacts
131
+ - Archived with 3 incomplete tasks
132
+ - Delta spec sync was skipped (user chose to skip)
133
+
134
+ Review the archive if this was not intentional.
135
+ ```
136
+
137
+ **Output On Error (Archive Exists)**
138
+
139
+ ```
140
+ ## Archive Failed
141
+
142
+ **Change:** <change-name>
143
+ **Target:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
144
+
145
+ Target archive directory already exists.
146
+
147
+ **Options:**
148
+ 1. Rename the existing archive
149
+ 2. Delete the existing archive if it's a duplicate
150
+ 3. Wait until a different date to archive
151
+ ```
152
+
153
+ **Guardrails**
154
+ - Always prompt for change selection if not provided
155
+ - Use artifact graph (openspec status --json) for completion checking
156
+ - Don't block archive on warnings - just inform and confirm
157
+ - Preserve .openspec.yaml when moving to archive (it moves with the directory)
158
+ - Show clear summary of what happened
159
+ - If sync is requested, use the Skill tool to invoke `openspec-sync-specs` (agent-driven)
160
+ - If delta specs exist, always run the sync assessment and show the combined summary before prompting
@@ -0,0 +1,174 @@
1
+ ---
2
+ name: /opsx-explore
3
+ id: opsx-explore
4
+ category: Workflow
5
+ description: "Enter explore mode - think through ideas, investigate problems, clarify requirements"
6
+ ---
7
+
8
+ Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
9
+
10
+ **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
11
+
12
+ **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.
13
+
14
+ **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`). 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.
15
+
16
+ **Input**: The argument after `/opsx:explore` is whatever the user wants to think about. Could be:
17
+ - A vague idea: "real-time collaboration"
18
+ - A specific problem: "the auth system is getting unwieldy"
19
+ - A change name: "add-dark-mode" (to explore in context of that change)
20
+ - A comparison: "postgres vs sqlite for this"
21
+ - Nothing (just enter explore mode)
22
+
23
+ ---
24
+
25
+ ## The Stance
26
+
27
+ - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
28
+ - **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.
29
+ - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
30
+ - **Adaptive** - Follow interesting threads, pivot when new information emerges
31
+ - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
32
+ - **Grounded** - Explore the actual codebase when relevant, don't just theorize
33
+
34
+ ---
35
+
36
+ ## What You Might Do
37
+
38
+ Depending on what the user brings, you might:
39
+
40
+ **Explore the problem space**
41
+ - Ask clarifying questions that emerge from what they said
42
+ - Challenge assumptions
43
+ - Reframe the problem
44
+ - Find analogies
45
+
46
+ **Investigate the codebase**
47
+ - Map existing architecture relevant to the discussion
48
+ - Find integration points
49
+ - Identify patterns already in use
50
+ - Surface hidden complexity
51
+
52
+ **Compare options**
53
+ - Brainstorm multiple approaches
54
+ - Build comparison tables
55
+ - Sketch tradeoffs
56
+ - Recommend a path (if asked)
57
+
58
+ **Visualize**
59
+ ```
60
+ ┌─────────────────────────────────────────┐
61
+ │ Use ASCII diagrams liberally │
62
+ ├─────────────────────────────────────────┤
63
+ │ │
64
+ │ ┌────────┐ ┌────────┐ │
65
+ │ │ State │────────▶│ State │ │
66
+ │ │ A │ │ B │ │
67
+ │ └────────┘ └────────┘ │
68
+ │ │
69
+ │ System diagrams, state machines, │
70
+ │ data flows, architecture sketches, │
71
+ │ dependency graphs, comparison tables │
72
+ │ │
73
+ └─────────────────────────────────────────┘
74
+ ```
75
+
76
+ **Surface risks and unknowns**
77
+ - Identify what could go wrong
78
+ - Find gaps in understanding
79
+ - Suggest spikes or investigations
80
+
81
+ ---
82
+
83
+ ## OpenSpec Awareness
84
+
85
+ You have full context of the OpenSpec system. Use it naturally, don't force it.
86
+
87
+ ### Check for context
88
+
89
+ At the start, quickly check what exists:
90
+ ```bash
91
+ openspec list --json
92
+ ```
93
+
94
+ This tells you:
95
+ - If there are active changes
96
+ - Their names, schemas, and status
97
+ - What the user might be working on
98
+
99
+ If the user mentioned a specific change name, read its artifacts for context.
100
+
101
+ ### When no change exists
102
+
103
+ Think freely. When insights crystallize, you might offer:
104
+
105
+ - "This feels solid enough to start a change. Want me to create a proposal?"
106
+ - Or keep exploring - no pressure to formalize
107
+
108
+ ### When a change exists
109
+
110
+ If the user mentions a change or you detect one is relevant:
111
+
112
+ 1. **Resolve and read existing artifacts for context**
113
+ - Run `openspec status --change "<name>" --json`.
114
+ - Use `changeRoot`, `artifactPaths`, and `actionContext` from the status JSON.
115
+ - Read existing files from `artifactPaths.<artifact>.existingOutputPaths`.
116
+
117
+ 2. **Reference them naturally in conversation**
118
+ - "Your design mentions using Redis, but we just realized SQLite fits better..."
119
+ - "The proposal scopes this to premium users, but we're now thinking everyone..."
120
+
121
+ 3. **Offer to capture when decisions are made**
122
+
123
+ | Insight Type | Where to Capture |
124
+ |----------------------------|--------------------------------|
125
+ | New requirement discovered | `specs/<capability>/spec.md` |
126
+ | Requirement changed | `specs/<capability>/spec.md` |
127
+ | Design decision made | `design.md` |
128
+ | Scope changed | `proposal.md` |
129
+ | New work identified | `tasks.md` |
130
+ | Assumption invalidated | Relevant artifact |
131
+
132
+ Example offers:
133
+ - "That's a design decision. Capture it in design.md?"
134
+ - "This is a new requirement. Add it to specs?"
135
+ - "This changes scope. Update the proposal?"
136
+
137
+ 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
138
+
139
+ ---
140
+
141
+ ## What You Don't Have To Do
142
+
143
+ - Follow a script
144
+ - Ask the same questions every time
145
+ - Produce a specific artifact
146
+ - Reach a conclusion
147
+ - Stay on topic if a tangent is valuable
148
+ - Be brief (this is thinking time)
149
+
150
+ ---
151
+
152
+ ## Ending Discovery
153
+
154
+ There's no required ending. Discovery might:
155
+
156
+ - **Flow into a proposal**: "Ready to start? I can create a change proposal."
157
+ - **Result in artifact updates**: "Updated design.md with these decisions"
158
+ - **Just provide clarity**: User has what they need, moves on
159
+ - **Continue later**: "We can pick this up anytime"
160
+
161
+ When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
162
+
163
+ ---
164
+
165
+ ## Guardrails
166
+
167
+ - **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
168
+ - **Don't fake understanding** - If something is unclear, dig deeper
169
+ - **Don't rush** - Discovery is thinking time, not task time
170
+ - **Don't force structure** - Let patterns emerge naturally
171
+ - **Don't auto-capture** - Offer to save insights, don't just do it
172
+ - **Do visualize** - A good diagram is worth many paragraphs
173
+ - **Do explore the codebase** - Ground discussions in reality
174
+ - **Do question assumptions** - Including the user's and your own