@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,155 @@
1
+ ---
2
+ name: "OPSX: Apply"
3
+ description: Implement tasks from an OpenSpec change (Experimental)
4
+ category: Workflow
5
+ tags: [workflow, artifacts, 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
+ description: Archive a completed change in the experimental workflow
4
+ category: Workflow
5
+ tags: [workflow, archive, experimental]
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
+ description: "Enter explore mode - think through ideas, investigate problems, clarify requirements"
4
+ category: Workflow
5
+ tags: [workflow, explore, experimental, thinking]
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
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: "OPSX: Propose"
3
+ description: Propose a new change - create it and generate all artifacts in one step
4
+ category: Workflow
5
+ tags: [workflow, artifacts, experimental]
6
+ ---
7
+
8
+ Propose a new change - create the change and generate all artifacts in one step.
9
+
10
+ I'll create a change with artifacts:
11
+ - proposal.md (what & why)
12
+ - design.md (how)
13
+ - tasks.md (implementation steps)
14
+
15
+ When ready to implement, run /opsx:apply
16
+
17
+ ---
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`). 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
+ **Input**: The argument after `/opsx:propose` is the change name (kebab-case), OR a description of what the user wants to build.
22
+
23
+ **Steps**
24
+
25
+ 1. **If no input provided, ask what they want to build**
26
+
27
+ Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
28
+ > "What change do you want to work on? Describe what you want to build or fix."
29
+
30
+ From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
31
+
32
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
33
+
34
+ 2. **Create the change directory**
35
+ ```bash
36
+ openspec new change "<name>"
37
+ ```
38
+ This creates a scaffolded change in the planning home resolved by the CLI with `.openspec.yaml`.
39
+
40
+ 3. **Get the artifact build order**
41
+ ```bash
42
+ openspec status --change "<name>" --json
43
+ ```
44
+ Parse the JSON to get:
45
+ - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
46
+ - `artifacts`: list of all artifacts with their status and dependencies
47
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
48
+
49
+ 4. **Create artifacts in sequence until apply-ready**
50
+
51
+ Use the **TodoWrite tool** to track progress through the artifacts.
52
+
53
+ Loop through artifacts in dependency order (artifacts with no pending dependencies first):
54
+
55
+ a. **For each artifact that is `ready` (dependencies satisfied)**:
56
+ - Get instructions:
57
+ ```bash
58
+ openspec instructions <artifact-id> --change "<name>" --json
59
+ ```
60
+ - The instructions JSON includes:
61
+ - `context`: Project background (constraints for you - do NOT include in output)
62
+ - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
63
+ - `template`: The structure to use for your output file
64
+ - `instruction`: Schema-specific guidance for this artifact type
65
+ - `resolvedOutputPath`: Resolved path or pattern to write the artifact
66
+ - `dependencies`: Completed artifacts to read for context
67
+ - Read any completed dependency files for context
68
+ - Create the artifact file using `template` as the structure and write it to `resolvedOutputPath`
69
+ - Apply `context` and `rules` as constraints - but do NOT copy them into the file
70
+ - Show brief progress: "Created <artifact-id>"
71
+
72
+ b. **Continue until all `applyRequires` artifacts are complete**
73
+ - After creating each artifact, re-run `openspec status --change "<name>" --json`
74
+ - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
75
+ - Stop when all `applyRequires` artifacts are done
76
+
77
+ c. **If an artifact requires user input** (unclear context):
78
+ - Use **AskUserQuestion tool** to clarify
79
+ - Then continue with creation
80
+
81
+ 5. **Show final status**
82
+ ```bash
83
+ openspec status --change "<name>"
84
+ ```
85
+
86
+ **Output**
87
+
88
+ After completing all artifacts, summarize:
89
+ - Change name and location
90
+ - List of artifacts created with brief descriptions
91
+ - What's ready: "All artifacts created! Ready for implementation."
92
+ - Prompt: "Run `/opsx:apply` to start implementing."
93
+
94
+ **Artifact Creation Guidelines**
95
+
96
+ - Follow the `instruction` field from `openspec instructions` for each artifact type
97
+ - The schema defines what each artifact should contain - follow it
98
+ - Read dependency artifacts for context before creating new ones
99
+ - Use `template` as the structure for your output file - fill in its sections
100
+ - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
101
+ - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
102
+ - These guide what you write, but should never appear in the output
103
+
104
+ **Guardrails**
105
+ - Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
106
+ - Always read dependency artifacts before creating a new one
107
+ - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
108
+ - If a change with that name already exists, ask if user wants to continue it or create a new one
109
+ - Verify each artifact file exists after writing before proceeding to next