@synth-coder/memhub 0.2.3 → 0.2.4
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/.eslintrc.cjs +45 -45
- package/.factory/commands/opsx-apply.md +150 -150
- package/.factory/commands/opsx-archive.md +155 -155
- package/.factory/commands/opsx-explore.md +171 -171
- package/.factory/commands/opsx-propose.md +104 -104
- package/.factory/skills/openspec-apply-change/SKILL.md +156 -156
- package/.factory/skills/openspec-archive-change/SKILL.md +114 -114
- package/.factory/skills/openspec-explore/SKILL.md +288 -288
- package/.factory/skills/openspec-propose/SKILL.md +110 -110
- package/.github/workflows/ci.yml +110 -74
- package/.github/workflows/release.yml +67 -0
- package/.iflow/commands/opsx-apply.md +152 -152
- package/.iflow/commands/opsx-archive.md +157 -157
- package/.iflow/commands/opsx-explore.md +173 -173
- package/.iflow/commands/opsx-propose.md +106 -106
- package/.iflow/skills/openspec-apply-change/SKILL.md +156 -156
- package/.iflow/skills/openspec-archive-change/SKILL.md +114 -114
- package/.iflow/skills/openspec-explore/SKILL.md +288 -288
- package/.iflow/skills/openspec-propose/SKILL.md +110 -110
- package/.prettierrc +11 -11
- package/AGENTS.md +167 -169
- package/README.md +276 -195
- package/README.zh-CN.md +245 -193
- package/dist/src/cli/agents/claude-code.d.ts +5 -0
- package/dist/src/cli/agents/claude-code.d.ts.map +1 -0
- package/dist/src/cli/agents/claude-code.js +14 -0
- package/dist/src/cli/agents/claude-code.js.map +1 -0
- package/dist/src/cli/agents/cline.d.ts +5 -0
- package/dist/src/cli/agents/cline.d.ts.map +1 -0
- package/dist/src/cli/agents/cline.js +14 -0
- package/dist/src/cli/agents/cline.js.map +1 -0
- package/dist/src/cli/agents/codex.d.ts +5 -0
- package/dist/src/cli/agents/codex.d.ts.map +1 -0
- package/dist/src/cli/agents/codex.js +14 -0
- package/dist/src/cli/agents/codex.js.map +1 -0
- package/dist/src/cli/agents/cursor.d.ts +5 -0
- package/dist/src/cli/agents/cursor.d.ts.map +1 -0
- package/dist/src/cli/agents/cursor.js +14 -0
- package/dist/src/cli/agents/cursor.js.map +1 -0
- package/dist/src/cli/agents/factory-droid.d.ts +5 -0
- package/dist/src/cli/agents/factory-droid.d.ts.map +1 -0
- package/dist/src/cli/agents/factory-droid.js +14 -0
- package/dist/src/cli/agents/factory-droid.js.map +1 -0
- package/dist/src/cli/agents/gemini-cli.d.ts +5 -0
- package/dist/src/cli/agents/gemini-cli.d.ts.map +1 -0
- package/dist/src/cli/agents/gemini-cli.js +14 -0
- package/dist/src/cli/agents/gemini-cli.js.map +1 -0
- package/dist/src/cli/agents/index.d.ts +14 -0
- package/dist/src/cli/agents/index.d.ts.map +1 -0
- package/dist/src/cli/agents/index.js +30 -0
- package/dist/src/cli/agents/index.js.map +1 -0
- package/dist/src/cli/agents/windsurf.d.ts +5 -0
- package/dist/src/cli/agents/windsurf.d.ts.map +1 -0
- package/dist/src/cli/agents/windsurf.js +14 -0
- package/dist/src/cli/agents/windsurf.js.map +1 -0
- package/dist/src/cli/index.d.ts +8 -0
- package/dist/src/cli/index.d.ts.map +1 -0
- package/dist/src/cli/index.js +168 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/init.d.ts +34 -0
- package/dist/src/cli/init.d.ts.map +1 -0
- package/dist/src/cli/init.js +160 -0
- package/dist/src/cli/init.js.map +1 -0
- package/dist/src/cli/instructions.d.ts +29 -0
- package/dist/src/cli/instructions.d.ts.map +1 -0
- package/dist/src/cli/instructions.js +141 -0
- package/dist/src/cli/instructions.js.map +1 -0
- package/dist/src/cli/types.d.ts +22 -0
- package/dist/src/cli/types.d.ts.map +1 -0
- package/dist/src/cli/types.js +86 -0
- package/dist/src/cli/types.js.map +1 -0
- package/dist/src/contracts/mcp.js +34 -34
- package/dist/src/contracts/schemas.js.map +1 -1
- package/dist/src/server/mcp-server.d.ts.map +1 -1
- package/dist/src/server/mcp-server.js +7 -14
- package/dist/src/server/mcp-server.js.map +1 -1
- package/dist/src/services/embedding-service.d.ts.map +1 -1
- package/dist/src/services/embedding-service.js +1 -1
- package/dist/src/services/embedding-service.js.map +1 -1
- package/dist/src/services/memory-service.d.ts.map +1 -1
- package/dist/src/services/memory-service.js.map +1 -1
- package/dist/src/storage/markdown-storage.d.ts.map +1 -1
- package/dist/src/storage/markdown-storage.js +1 -1
- package/dist/src/storage/markdown-storage.js.map +1 -1
- package/dist/src/storage/vector-index.d.ts.map +1 -1
- package/dist/src/storage/vector-index.js +4 -5
- package/dist/src/storage/vector-index.js.map +1 -1
- package/docs/README.md +21 -0
- package/docs/mcp-tools.md +136 -0
- package/docs/user-guide.md +182 -0
- package/package.json +61 -59
- package/src/cli/agents/claude-code.ts +14 -0
- package/src/cli/agents/cline.ts +14 -0
- package/src/cli/agents/codex.ts +14 -0
- package/src/cli/agents/cursor.ts +14 -0
- package/src/cli/agents/factory-droid.ts +14 -0
- package/src/cli/agents/gemini-cli.ts +14 -0
- package/src/cli/agents/index.ts +36 -0
- package/src/cli/agents/windsurf.ts +14 -0
- package/src/cli/index.ts +192 -0
- package/src/cli/init.ts +218 -0
- package/src/cli/instructions.ts +156 -0
- package/src/cli/types.ts +112 -0
- package/src/contracts/index.ts +12 -12
- package/src/contracts/mcp.ts +223 -223
- package/src/contracts/schemas.ts +307 -307
- package/src/contracts/types.ts +410 -410
- package/src/index.ts +8 -8
- package/src/server/index.ts +5 -5
- package/src/server/mcp-server.ts +169 -186
- package/src/services/embedding-service.ts +114 -114
- package/src/services/index.ts +5 -5
- package/src/services/memory-service.ts +656 -663
- package/src/storage/frontmatter-parser.ts +243 -243
- package/src/storage/index.ts +6 -6
- package/src/storage/markdown-storage.ts +228 -236
- package/src/storage/vector-index.ts +159 -160
- package/src/utils/index.ts +5 -5
- package/src/utils/slugify.ts +63 -63
- package/test/cli/init.test.ts +380 -0
- package/test/contracts/schemas.test.ts +313 -313
- package/test/contracts/types.test.ts +21 -21
- package/test/frontmatter-parser-more.test.ts +94 -94
- package/test/server/mcp-server.test.ts +211 -210
- package/test/services/memory-service-edge.test.ts +248 -248
- package/test/services/memory-service.test.ts +291 -279
- package/test/storage/frontmatter-parser.test.ts +223 -223
- package/test/storage/markdown-storage.test.ts +226 -217
- package/test/storage/storage-edge.test.ts +238 -238
- package/test/storage/vector-index.test.ts +149 -153
- package/test/utils/slugify-edge.test.ts +94 -94
- package/test/utils/slugify.test.ts +72 -68
- package/tsconfig.json +25 -25
- package/tsconfig.test.json +8 -8
- package/vitest.config.ts +29 -29
- package/docs/architecture-diagrams.md +0 -368
- package/docs/architecture.md +0 -381
- package/docs/contracts.md +0 -190
- package/docs/prompt-template.md +0 -33
- package/docs/proposals/mcp-typescript-sdk-refactor.md +0 -568
- package/docs/proposals/proposal-close-gates.md +0 -58
- package/docs/tool-calling-policy.md +0 -101
- package/docs/vector-search.md +0 -306
|
@@ -1,173 +1,173 @@
|
|
|
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
|
-
**Input**: The argument after `/opsx:explore` is whatever the user wants to think about. Could be:
|
|
15
|
-
- A vague idea: "real-time collaboration"
|
|
16
|
-
- A specific problem: "the auth system is getting unwieldy"
|
|
17
|
-
- A change name: "add-dark-mode" (to explore in context of that change)
|
|
18
|
-
- A comparison: "postgres vs sqlite for this"
|
|
19
|
-
- Nothing (just enter explore mode)
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## The Stance
|
|
24
|
-
|
|
25
|
-
- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
|
|
26
|
-
- **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.
|
|
27
|
-
- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
|
|
28
|
-
- **Adaptive** - Follow interesting threads, pivot when new information emerges
|
|
29
|
-
- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
|
|
30
|
-
- **Grounded** - Explore the actual codebase when relevant, don't just theorize
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## What You Might Do
|
|
35
|
-
|
|
36
|
-
Depending on what the user brings, you might:
|
|
37
|
-
|
|
38
|
-
**Explore the problem space**
|
|
39
|
-
- Ask clarifying questions that emerge from what they said
|
|
40
|
-
- Challenge assumptions
|
|
41
|
-
- Reframe the problem
|
|
42
|
-
- Find analogies
|
|
43
|
-
|
|
44
|
-
**Investigate the codebase**
|
|
45
|
-
- Map existing architecture relevant to the discussion
|
|
46
|
-
- Find integration points
|
|
47
|
-
- Identify patterns already in use
|
|
48
|
-
- Surface hidden complexity
|
|
49
|
-
|
|
50
|
-
**Compare options**
|
|
51
|
-
- Brainstorm multiple approaches
|
|
52
|
-
- Build comparison tables
|
|
53
|
-
- Sketch tradeoffs
|
|
54
|
-
- Recommend a path (if asked)
|
|
55
|
-
|
|
56
|
-
**Visualize**
|
|
57
|
-
```
|
|
58
|
-
┌─────────────────────────────────────────┐
|
|
59
|
-
│ Use ASCII diagrams liberally │
|
|
60
|
-
├─────────────────────────────────────────┤
|
|
61
|
-
│ │
|
|
62
|
-
│ ┌────────┐ ┌────────┐ │
|
|
63
|
-
│ │ State │────────▶│ State │ │
|
|
64
|
-
│ │ A │ │ B │ │
|
|
65
|
-
│ └────────┘ └────────┘ │
|
|
66
|
-
│ │
|
|
67
|
-
│ System diagrams, state machines, │
|
|
68
|
-
│ data flows, architecture sketches, │
|
|
69
|
-
│ dependency graphs, comparison tables │
|
|
70
|
-
│ │
|
|
71
|
-
└─────────────────────────────────────────┘
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
**Surface risks and unknowns**
|
|
75
|
-
- Identify what could go wrong
|
|
76
|
-
- Find gaps in understanding
|
|
77
|
-
- Suggest spikes or investigations
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## OpenSpec Awareness
|
|
82
|
-
|
|
83
|
-
You have full context of the OpenSpec system. Use it naturally, don't force it.
|
|
84
|
-
|
|
85
|
-
### Check for context
|
|
86
|
-
|
|
87
|
-
At the start, quickly check what exists:
|
|
88
|
-
```bash
|
|
89
|
-
openspec list --json
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
This tells you:
|
|
93
|
-
- If there are active changes
|
|
94
|
-
- Their names, schemas, and status
|
|
95
|
-
- What the user might be working on
|
|
96
|
-
|
|
97
|
-
If the user mentioned a specific change name, read its artifacts for context.
|
|
98
|
-
|
|
99
|
-
### When no change exists
|
|
100
|
-
|
|
101
|
-
Think freely. When insights crystallize, you might offer:
|
|
102
|
-
|
|
103
|
-
- "This feels solid enough to start a change. Want me to create a proposal?"
|
|
104
|
-
- Or keep exploring - no pressure to formalize
|
|
105
|
-
|
|
106
|
-
### When a change exists
|
|
107
|
-
|
|
108
|
-
If the user mentions a change or you detect one is relevant:
|
|
109
|
-
|
|
110
|
-
1. **Read existing artifacts for context**
|
|
111
|
-
- `openspec/changes/<name>/proposal.md`
|
|
112
|
-
- `openspec/changes/<name>/design.md`
|
|
113
|
-
- `openspec/changes/<name>/tasks.md`
|
|
114
|
-
- etc.
|
|
115
|
-
|
|
116
|
-
2. **Reference them naturally in conversation**
|
|
117
|
-
- "Your design mentions using Redis, but we just realized SQLite fits better..."
|
|
118
|
-
- "The proposal scopes this to premium users, but we're now thinking everyone..."
|
|
119
|
-
|
|
120
|
-
3. **Offer to capture when decisions are made**
|
|
121
|
-
|
|
122
|
-
| Insight Type | Where to Capture |
|
|
123
|
-
|--------------|------------------|
|
|
124
|
-
| New requirement discovered | `specs/<capability>/spec.md` |
|
|
125
|
-
| Requirement changed | `specs/<capability>/spec.md` |
|
|
126
|
-
| Design decision made | `design.md` |
|
|
127
|
-
| Scope changed | `proposal.md` |
|
|
128
|
-
| New work identified | `tasks.md` |
|
|
129
|
-
| Assumption invalidated | Relevant artifact |
|
|
130
|
-
|
|
131
|
-
Example offers:
|
|
132
|
-
- "That's a design decision. Capture it in design.md?"
|
|
133
|
-
- "This is a new requirement. Add it to specs?"
|
|
134
|
-
- "This changes scope. Update the proposal?"
|
|
135
|
-
|
|
136
|
-
4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## What You Don't Have To Do
|
|
141
|
-
|
|
142
|
-
- Follow a script
|
|
143
|
-
- Ask the same questions every time
|
|
144
|
-
- Produce a specific artifact
|
|
145
|
-
- Reach a conclusion
|
|
146
|
-
- Stay on topic if a tangent is valuable
|
|
147
|
-
- Be brief (this is thinking time)
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## Ending Discovery
|
|
152
|
-
|
|
153
|
-
There's no required ending. Discovery might:
|
|
154
|
-
|
|
155
|
-
- **Flow into a proposal**: "Ready to start? I can create a change proposal."
|
|
156
|
-
- **Result in artifact updates**: "Updated design.md with these decisions"
|
|
157
|
-
- **Just provide clarity**: User has what they need, moves on
|
|
158
|
-
- **Continue later**: "We can pick this up anytime"
|
|
159
|
-
|
|
160
|
-
When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
## Guardrails
|
|
165
|
-
|
|
166
|
-
- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
|
|
167
|
-
- **Don't fake understanding** - If something is unclear, dig deeper
|
|
168
|
-
- **Don't rush** - Discovery is thinking time, not task time
|
|
169
|
-
- **Don't force structure** - Let patterns emerge naturally
|
|
170
|
-
- **Don't auto-capture** - Offer to save insights, don't just do it
|
|
171
|
-
- **Do visualize** - A good diagram is worth many paragraphs
|
|
172
|
-
- **Do explore the codebase** - Ground discussions in reality
|
|
173
|
-
- **Do question assumptions** - Including the user's and your own
|
|
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
|
+
**Input**: The argument after `/opsx:explore` is whatever the user wants to think about. Could be:
|
|
15
|
+
- A vague idea: "real-time collaboration"
|
|
16
|
+
- A specific problem: "the auth system is getting unwieldy"
|
|
17
|
+
- A change name: "add-dark-mode" (to explore in context of that change)
|
|
18
|
+
- A comparison: "postgres vs sqlite for this"
|
|
19
|
+
- Nothing (just enter explore mode)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## The Stance
|
|
24
|
+
|
|
25
|
+
- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
|
|
26
|
+
- **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.
|
|
27
|
+
- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
|
|
28
|
+
- **Adaptive** - Follow interesting threads, pivot when new information emerges
|
|
29
|
+
- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
|
|
30
|
+
- **Grounded** - Explore the actual codebase when relevant, don't just theorize
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## What You Might Do
|
|
35
|
+
|
|
36
|
+
Depending on what the user brings, you might:
|
|
37
|
+
|
|
38
|
+
**Explore the problem space**
|
|
39
|
+
- Ask clarifying questions that emerge from what they said
|
|
40
|
+
- Challenge assumptions
|
|
41
|
+
- Reframe the problem
|
|
42
|
+
- Find analogies
|
|
43
|
+
|
|
44
|
+
**Investigate the codebase**
|
|
45
|
+
- Map existing architecture relevant to the discussion
|
|
46
|
+
- Find integration points
|
|
47
|
+
- Identify patterns already in use
|
|
48
|
+
- Surface hidden complexity
|
|
49
|
+
|
|
50
|
+
**Compare options**
|
|
51
|
+
- Brainstorm multiple approaches
|
|
52
|
+
- Build comparison tables
|
|
53
|
+
- Sketch tradeoffs
|
|
54
|
+
- Recommend a path (if asked)
|
|
55
|
+
|
|
56
|
+
**Visualize**
|
|
57
|
+
```
|
|
58
|
+
┌─────────────────────────────────────────┐
|
|
59
|
+
│ Use ASCII diagrams liberally │
|
|
60
|
+
├─────────────────────────────────────────┤
|
|
61
|
+
│ │
|
|
62
|
+
│ ┌────────┐ ┌────────┐ │
|
|
63
|
+
│ │ State │────────▶│ State │ │
|
|
64
|
+
│ │ A │ │ B │ │
|
|
65
|
+
│ └────────┘ └────────┘ │
|
|
66
|
+
│ │
|
|
67
|
+
│ System diagrams, state machines, │
|
|
68
|
+
│ data flows, architecture sketches, │
|
|
69
|
+
│ dependency graphs, comparison tables │
|
|
70
|
+
│ │
|
|
71
|
+
└─────────────────────────────────────────┘
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Surface risks and unknowns**
|
|
75
|
+
- Identify what could go wrong
|
|
76
|
+
- Find gaps in understanding
|
|
77
|
+
- Suggest spikes or investigations
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## OpenSpec Awareness
|
|
82
|
+
|
|
83
|
+
You have full context of the OpenSpec system. Use it naturally, don't force it.
|
|
84
|
+
|
|
85
|
+
### Check for context
|
|
86
|
+
|
|
87
|
+
At the start, quickly check what exists:
|
|
88
|
+
```bash
|
|
89
|
+
openspec list --json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
This tells you:
|
|
93
|
+
- If there are active changes
|
|
94
|
+
- Their names, schemas, and status
|
|
95
|
+
- What the user might be working on
|
|
96
|
+
|
|
97
|
+
If the user mentioned a specific change name, read its artifacts for context.
|
|
98
|
+
|
|
99
|
+
### When no change exists
|
|
100
|
+
|
|
101
|
+
Think freely. When insights crystallize, you might offer:
|
|
102
|
+
|
|
103
|
+
- "This feels solid enough to start a change. Want me to create a proposal?"
|
|
104
|
+
- Or keep exploring - no pressure to formalize
|
|
105
|
+
|
|
106
|
+
### When a change exists
|
|
107
|
+
|
|
108
|
+
If the user mentions a change or you detect one is relevant:
|
|
109
|
+
|
|
110
|
+
1. **Read existing artifacts for context**
|
|
111
|
+
- `openspec/changes/<name>/proposal.md`
|
|
112
|
+
- `openspec/changes/<name>/design.md`
|
|
113
|
+
- `openspec/changes/<name>/tasks.md`
|
|
114
|
+
- etc.
|
|
115
|
+
|
|
116
|
+
2. **Reference them naturally in conversation**
|
|
117
|
+
- "Your design mentions using Redis, but we just realized SQLite fits better..."
|
|
118
|
+
- "The proposal scopes this to premium users, but we're now thinking everyone..."
|
|
119
|
+
|
|
120
|
+
3. **Offer to capture when decisions are made**
|
|
121
|
+
|
|
122
|
+
| Insight Type | Where to Capture |
|
|
123
|
+
|--------------|------------------|
|
|
124
|
+
| New requirement discovered | `specs/<capability>/spec.md` |
|
|
125
|
+
| Requirement changed | `specs/<capability>/spec.md` |
|
|
126
|
+
| Design decision made | `design.md` |
|
|
127
|
+
| Scope changed | `proposal.md` |
|
|
128
|
+
| New work identified | `tasks.md` |
|
|
129
|
+
| Assumption invalidated | Relevant artifact |
|
|
130
|
+
|
|
131
|
+
Example offers:
|
|
132
|
+
- "That's a design decision. Capture it in design.md?"
|
|
133
|
+
- "This is a new requirement. Add it to specs?"
|
|
134
|
+
- "This changes scope. Update the proposal?"
|
|
135
|
+
|
|
136
|
+
4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## What You Don't Have To Do
|
|
141
|
+
|
|
142
|
+
- Follow a script
|
|
143
|
+
- Ask the same questions every time
|
|
144
|
+
- Produce a specific artifact
|
|
145
|
+
- Reach a conclusion
|
|
146
|
+
- Stay on topic if a tangent is valuable
|
|
147
|
+
- Be brief (this is thinking time)
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Ending Discovery
|
|
152
|
+
|
|
153
|
+
There's no required ending. Discovery might:
|
|
154
|
+
|
|
155
|
+
- **Flow into a proposal**: "Ready to start? I can create a change proposal."
|
|
156
|
+
- **Result in artifact updates**: "Updated design.md with these decisions"
|
|
157
|
+
- **Just provide clarity**: User has what they need, moves on
|
|
158
|
+
- **Continue later**: "We can pick this up anytime"
|
|
159
|
+
|
|
160
|
+
When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Guardrails
|
|
165
|
+
|
|
166
|
+
- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
|
|
167
|
+
- **Don't fake understanding** - If something is unclear, dig deeper
|
|
168
|
+
- **Don't rush** - Discovery is thinking time, not task time
|
|
169
|
+
- **Don't force structure** - Let patterns emerge naturally
|
|
170
|
+
- **Don't auto-capture** - Offer to save insights, don't just do it
|
|
171
|
+
- **Do visualize** - A good diagram is worth many paragraphs
|
|
172
|
+
- **Do explore the codebase** - Ground discussions in reality
|
|
173
|
+
- **Do question assumptions** - Including the user's and your own
|
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: /opsx-propose
|
|
3
|
-
id: opsx-propose
|
|
4
|
-
category: Workflow
|
|
5
|
-
description: Propose a new change - create it and generate all artifacts in one step
|
|
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
|
-
**Input**: The argument after `/opsx:propose` is the change name (kebab-case), OR a description of what the user wants to build.
|
|
20
|
-
|
|
21
|
-
**Steps**
|
|
22
|
-
|
|
23
|
-
1. **If no input provided, ask what they want to build**
|
|
24
|
-
|
|
25
|
-
Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
|
|
26
|
-
> "What change do you want to work on? Describe what you want to build or fix."
|
|
27
|
-
|
|
28
|
-
From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
|
|
29
|
-
|
|
30
|
-
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
|
|
31
|
-
|
|
32
|
-
2. **Create the change directory**
|
|
33
|
-
```bash
|
|
34
|
-
openspec new change "<name>"
|
|
35
|
-
```
|
|
36
|
-
This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.
|
|
37
|
-
|
|
38
|
-
3. **Get the artifact build order**
|
|
39
|
-
```bash
|
|
40
|
-
openspec status --change "<name>" --json
|
|
41
|
-
```
|
|
42
|
-
Parse the JSON to get:
|
|
43
|
-
- `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
|
|
44
|
-
- `artifacts`: list of all artifacts with their status and dependencies
|
|
45
|
-
|
|
46
|
-
4. **Create artifacts in sequence until apply-ready**
|
|
47
|
-
|
|
48
|
-
Use the **TodoWrite tool** to track progress through the artifacts.
|
|
49
|
-
|
|
50
|
-
Loop through artifacts in dependency order (artifacts with no pending dependencies first):
|
|
51
|
-
|
|
52
|
-
a. **For each artifact that is `ready` (dependencies satisfied)**:
|
|
53
|
-
- Get instructions:
|
|
54
|
-
```bash
|
|
55
|
-
openspec instructions <artifact-id> --change "<name>" --json
|
|
56
|
-
```
|
|
57
|
-
- The instructions JSON includes:
|
|
58
|
-
- `context`: Project background (constraints for you - do NOT include in output)
|
|
59
|
-
- `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
|
|
60
|
-
- `template`: The structure to use for your output file
|
|
61
|
-
- `instruction`: Schema-specific guidance for this artifact type
|
|
62
|
-
- `outputPath`: Where to write the artifact
|
|
63
|
-
- `dependencies`: Completed artifacts to read for context
|
|
64
|
-
- Read any completed dependency files for context
|
|
65
|
-
- Create the artifact file using `template` as the structure
|
|
66
|
-
- Apply `context` and `rules` as constraints - but do NOT copy them into the file
|
|
67
|
-
- Show brief progress: "Created <artifact-id>"
|
|
68
|
-
|
|
69
|
-
b. **Continue until all `applyRequires` artifacts are complete**
|
|
70
|
-
- After creating each artifact, re-run `openspec status --change "<name>" --json`
|
|
71
|
-
- Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
|
|
72
|
-
- Stop when all `applyRequires` artifacts are done
|
|
73
|
-
|
|
74
|
-
c. **If an artifact requires user input** (unclear context):
|
|
75
|
-
- Use **AskUserQuestion tool** to clarify
|
|
76
|
-
- Then continue with creation
|
|
77
|
-
|
|
78
|
-
5. **Show final status**
|
|
79
|
-
```bash
|
|
80
|
-
openspec status --change "<name>"
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
**Output**
|
|
84
|
-
|
|
85
|
-
After completing all artifacts, summarize:
|
|
86
|
-
- Change name and location
|
|
87
|
-
- List of artifacts created with brief descriptions
|
|
88
|
-
- What's ready: "All artifacts created! Ready for implementation."
|
|
89
|
-
- Prompt: "Run `/opsx:apply` to start implementing."
|
|
90
|
-
|
|
91
|
-
**Artifact Creation Guidelines**
|
|
92
|
-
|
|
93
|
-
- Follow the `instruction` field from `openspec instructions` for each artifact type
|
|
94
|
-
- The schema defines what each artifact should contain - follow it
|
|
95
|
-
- Read dependency artifacts for context before creating new ones
|
|
96
|
-
- Use `template` as the structure for your output file - fill in its sections
|
|
97
|
-
- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
|
|
98
|
-
- Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
|
|
99
|
-
- These guide what you write, but should never appear in the output
|
|
100
|
-
|
|
101
|
-
**Guardrails**
|
|
102
|
-
- Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
|
|
103
|
-
- Always read dependency artifacts before creating a new one
|
|
104
|
-
- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
|
|
105
|
-
- If a change with that name already exists, ask if user wants to continue it or create a new one
|
|
106
|
-
- Verify each artifact file exists after writing before proceeding to next
|
|
1
|
+
---
|
|
2
|
+
name: /opsx-propose
|
|
3
|
+
id: opsx-propose
|
|
4
|
+
category: Workflow
|
|
5
|
+
description: Propose a new change - create it and generate all artifacts in one step
|
|
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
|
+
**Input**: The argument after `/opsx:propose` is the change name (kebab-case), OR a description of what the user wants to build.
|
|
20
|
+
|
|
21
|
+
**Steps**
|
|
22
|
+
|
|
23
|
+
1. **If no input provided, ask what they want to build**
|
|
24
|
+
|
|
25
|
+
Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
|
|
26
|
+
> "What change do you want to work on? Describe what you want to build or fix."
|
|
27
|
+
|
|
28
|
+
From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
|
|
29
|
+
|
|
30
|
+
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
|
|
31
|
+
|
|
32
|
+
2. **Create the change directory**
|
|
33
|
+
```bash
|
|
34
|
+
openspec new change "<name>"
|
|
35
|
+
```
|
|
36
|
+
This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.
|
|
37
|
+
|
|
38
|
+
3. **Get the artifact build order**
|
|
39
|
+
```bash
|
|
40
|
+
openspec status --change "<name>" --json
|
|
41
|
+
```
|
|
42
|
+
Parse the JSON to get:
|
|
43
|
+
- `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
|
|
44
|
+
- `artifacts`: list of all artifacts with their status and dependencies
|
|
45
|
+
|
|
46
|
+
4. **Create artifacts in sequence until apply-ready**
|
|
47
|
+
|
|
48
|
+
Use the **TodoWrite tool** to track progress through the artifacts.
|
|
49
|
+
|
|
50
|
+
Loop through artifacts in dependency order (artifacts with no pending dependencies first):
|
|
51
|
+
|
|
52
|
+
a. **For each artifact that is `ready` (dependencies satisfied)**:
|
|
53
|
+
- Get instructions:
|
|
54
|
+
```bash
|
|
55
|
+
openspec instructions <artifact-id> --change "<name>" --json
|
|
56
|
+
```
|
|
57
|
+
- The instructions JSON includes:
|
|
58
|
+
- `context`: Project background (constraints for you - do NOT include in output)
|
|
59
|
+
- `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
|
|
60
|
+
- `template`: The structure to use for your output file
|
|
61
|
+
- `instruction`: Schema-specific guidance for this artifact type
|
|
62
|
+
- `outputPath`: Where to write the artifact
|
|
63
|
+
- `dependencies`: Completed artifacts to read for context
|
|
64
|
+
- Read any completed dependency files for context
|
|
65
|
+
- Create the artifact file using `template` as the structure
|
|
66
|
+
- Apply `context` and `rules` as constraints - but do NOT copy them into the file
|
|
67
|
+
- Show brief progress: "Created <artifact-id>"
|
|
68
|
+
|
|
69
|
+
b. **Continue until all `applyRequires` artifacts are complete**
|
|
70
|
+
- After creating each artifact, re-run `openspec status --change "<name>" --json`
|
|
71
|
+
- Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
|
|
72
|
+
- Stop when all `applyRequires` artifacts are done
|
|
73
|
+
|
|
74
|
+
c. **If an artifact requires user input** (unclear context):
|
|
75
|
+
- Use **AskUserQuestion tool** to clarify
|
|
76
|
+
- Then continue with creation
|
|
77
|
+
|
|
78
|
+
5. **Show final status**
|
|
79
|
+
```bash
|
|
80
|
+
openspec status --change "<name>"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Output**
|
|
84
|
+
|
|
85
|
+
After completing all artifacts, summarize:
|
|
86
|
+
- Change name and location
|
|
87
|
+
- List of artifacts created with brief descriptions
|
|
88
|
+
- What's ready: "All artifacts created! Ready for implementation."
|
|
89
|
+
- Prompt: "Run `/opsx:apply` to start implementing."
|
|
90
|
+
|
|
91
|
+
**Artifact Creation Guidelines**
|
|
92
|
+
|
|
93
|
+
- Follow the `instruction` field from `openspec instructions` for each artifact type
|
|
94
|
+
- The schema defines what each artifact should contain - follow it
|
|
95
|
+
- Read dependency artifacts for context before creating new ones
|
|
96
|
+
- Use `template` as the structure for your output file - fill in its sections
|
|
97
|
+
- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
|
|
98
|
+
- Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
|
|
99
|
+
- These guide what you write, but should never appear in the output
|
|
100
|
+
|
|
101
|
+
**Guardrails**
|
|
102
|
+
- Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
|
|
103
|
+
- Always read dependency artifacts before creating a new one
|
|
104
|
+
- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
|
|
105
|
+
- If a change with that name already exists, ask if user wants to continue it or create a new one
|
|
106
|
+
- Verify each artifact file exists after writing before proceeding to next
|