@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,155 +1,155 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Archive a completed change in the experimental workflow
|
|
3
|
-
argument-hint: command arguments
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Archive a completed change in the experimental workflow.
|
|
7
|
-
|
|
8
|
-
**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.
|
|
9
|
-
|
|
10
|
-
**Steps**
|
|
11
|
-
|
|
12
|
-
1. **If no change name provided, prompt for selection**
|
|
13
|
-
|
|
14
|
-
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
15
|
-
|
|
16
|
-
Show only active changes (not already archived).
|
|
17
|
-
Include the schema used for each change if available.
|
|
18
|
-
|
|
19
|
-
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
20
|
-
|
|
21
|
-
2. **Check artifact completion status**
|
|
22
|
-
|
|
23
|
-
Run `openspec status --change "<name>" --json` to check artifact completion.
|
|
24
|
-
|
|
25
|
-
Parse the JSON to understand:
|
|
26
|
-
- `schemaName`: The workflow being used
|
|
27
|
-
- `artifacts`: List of artifacts with their status (`done` or other)
|
|
28
|
-
|
|
29
|
-
**If any artifacts are not `done`:**
|
|
30
|
-
- Display warning listing incomplete artifacts
|
|
31
|
-
- Prompt user for confirmation to continue
|
|
32
|
-
- Proceed if user confirms
|
|
33
|
-
|
|
34
|
-
3. **Check task completion status**
|
|
35
|
-
|
|
36
|
-
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
|
|
37
|
-
|
|
38
|
-
Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
|
|
39
|
-
|
|
40
|
-
**If incomplete tasks found:**
|
|
41
|
-
- Display warning showing count of incomplete tasks
|
|
42
|
-
- Prompt user for confirmation to continue
|
|
43
|
-
- Proceed if user confirms
|
|
44
|
-
|
|
45
|
-
**If no tasks file exists:** Proceed without task-related warning.
|
|
46
|
-
|
|
47
|
-
4. **Assess delta spec sync state**
|
|
48
|
-
|
|
49
|
-
Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.
|
|
50
|
-
|
|
51
|
-
**If delta specs exist:**
|
|
52
|
-
- Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
|
|
53
|
-
- Determine what changes would be applied (adds, modifications, removals, renames)
|
|
54
|
-
- Show a combined summary before prompting
|
|
55
|
-
|
|
56
|
-
**Prompt options:**
|
|
57
|
-
- If changes needed: "Sync now (recommended)", "Archive without syncing"
|
|
58
|
-
- If already synced: "Archive now", "Sync anyway", "Cancel"
|
|
59
|
-
|
|
60
|
-
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.
|
|
61
|
-
|
|
62
|
-
5. **Perform the archive**
|
|
63
|
-
|
|
64
|
-
Create the archive directory if it doesn't exist:
|
|
65
|
-
```bash
|
|
66
|
-
mkdir -p openspec/changes/archive
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Generate target name using current date: `YYYY-MM-DD-<change-name>`
|
|
70
|
-
|
|
71
|
-
**Check if target already exists:**
|
|
72
|
-
- If yes: Fail with error, suggest renaming existing archive or using different date
|
|
73
|
-
- If no: Move the change directory to archive
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
6. **Display summary**
|
|
80
|
-
|
|
81
|
-
Show archive completion summary including:
|
|
82
|
-
- Change name
|
|
83
|
-
- Schema that was used
|
|
84
|
-
- Archive location
|
|
85
|
-
- Spec sync status (synced / sync skipped / no delta specs)
|
|
86
|
-
- Note about any warnings (incomplete artifacts/tasks)
|
|
87
|
-
|
|
88
|
-
**Output On Success**
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
## Archive Complete
|
|
92
|
-
|
|
93
|
-
**Change:** <change-name>
|
|
94
|
-
**Schema:** <schema-name>
|
|
95
|
-
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
|
|
96
|
-
**Specs:** ✓ Synced to main specs
|
|
97
|
-
|
|
98
|
-
All artifacts complete. All tasks complete.
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
**Output On Success (No Delta Specs)**
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
## Archive Complete
|
|
105
|
-
|
|
106
|
-
**Change:** <change-name>
|
|
107
|
-
**Schema:** <schema-name>
|
|
108
|
-
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
|
|
109
|
-
**Specs:** No delta specs
|
|
110
|
-
|
|
111
|
-
All artifacts complete. All tasks complete.
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
**Output On Success With Warnings**
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
## Archive Complete (with warnings)
|
|
118
|
-
|
|
119
|
-
**Change:** <change-name>
|
|
120
|
-
**Schema:** <schema-name>
|
|
121
|
-
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
|
|
122
|
-
**Specs:** Sync skipped (user chose to skip)
|
|
123
|
-
|
|
124
|
-
**Warnings:**
|
|
125
|
-
- Archived with 2 incomplete artifacts
|
|
126
|
-
- Archived with 3 incomplete tasks
|
|
127
|
-
- Delta spec sync was skipped (user chose to skip)
|
|
128
|
-
|
|
129
|
-
Review the archive if this was not intentional.
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
**Output On Error (Archive Exists)**
|
|
133
|
-
|
|
134
|
-
```
|
|
135
|
-
## Archive Failed
|
|
136
|
-
|
|
137
|
-
**Change:** <change-name>
|
|
138
|
-
**Target:** openspec/changes/archive/YYYY-MM-DD-<name>/
|
|
139
|
-
|
|
140
|
-
Target archive directory already exists.
|
|
141
|
-
|
|
142
|
-
**Options:**
|
|
143
|
-
1. Rename the existing archive
|
|
144
|
-
2. Delete the existing archive if it's a duplicate
|
|
145
|
-
3. Wait until a different date to archive
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
**Guardrails**
|
|
149
|
-
- Always prompt for change selection if not provided
|
|
150
|
-
- Use artifact graph (openspec status --json) for completion checking
|
|
151
|
-
- Don't block archive on warnings - just inform and confirm
|
|
152
|
-
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
|
|
153
|
-
- Show clear summary of what happened
|
|
154
|
-
- If sync is requested, use the Skill tool to invoke `openspec-sync-specs` (agent-driven)
|
|
155
|
-
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
|
|
1
|
+
---
|
|
2
|
+
description: Archive a completed change in the experimental workflow
|
|
3
|
+
argument-hint: command arguments
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Archive a completed change in the experimental workflow.
|
|
7
|
+
|
|
8
|
+
**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.
|
|
9
|
+
|
|
10
|
+
**Steps**
|
|
11
|
+
|
|
12
|
+
1. **If no change name provided, prompt for selection**
|
|
13
|
+
|
|
14
|
+
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
15
|
+
|
|
16
|
+
Show only active changes (not already archived).
|
|
17
|
+
Include the schema used for each change if available.
|
|
18
|
+
|
|
19
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
20
|
+
|
|
21
|
+
2. **Check artifact completion status**
|
|
22
|
+
|
|
23
|
+
Run `openspec status --change "<name>" --json` to check artifact completion.
|
|
24
|
+
|
|
25
|
+
Parse the JSON to understand:
|
|
26
|
+
- `schemaName`: The workflow being used
|
|
27
|
+
- `artifacts`: List of artifacts with their status (`done` or other)
|
|
28
|
+
|
|
29
|
+
**If any artifacts are not `done`:**
|
|
30
|
+
- Display warning listing incomplete artifacts
|
|
31
|
+
- Prompt user for confirmation to continue
|
|
32
|
+
- Proceed if user confirms
|
|
33
|
+
|
|
34
|
+
3. **Check task completion status**
|
|
35
|
+
|
|
36
|
+
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
|
|
37
|
+
|
|
38
|
+
Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
|
|
39
|
+
|
|
40
|
+
**If incomplete tasks found:**
|
|
41
|
+
- Display warning showing count of incomplete tasks
|
|
42
|
+
- Prompt user for confirmation to continue
|
|
43
|
+
- Proceed if user confirms
|
|
44
|
+
|
|
45
|
+
**If no tasks file exists:** Proceed without task-related warning.
|
|
46
|
+
|
|
47
|
+
4. **Assess delta spec sync state**
|
|
48
|
+
|
|
49
|
+
Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.
|
|
50
|
+
|
|
51
|
+
**If delta specs exist:**
|
|
52
|
+
- Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
|
|
53
|
+
- Determine what changes would be applied (adds, modifications, removals, renames)
|
|
54
|
+
- Show a combined summary before prompting
|
|
55
|
+
|
|
56
|
+
**Prompt options:**
|
|
57
|
+
- If changes needed: "Sync now (recommended)", "Archive without syncing"
|
|
58
|
+
- If already synced: "Archive now", "Sync anyway", "Cancel"
|
|
59
|
+
|
|
60
|
+
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.
|
|
61
|
+
|
|
62
|
+
5. **Perform the archive**
|
|
63
|
+
|
|
64
|
+
Create the archive directory if it doesn't exist:
|
|
65
|
+
```bash
|
|
66
|
+
mkdir -p openspec/changes/archive
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Generate target name using current date: `YYYY-MM-DD-<change-name>`
|
|
70
|
+
|
|
71
|
+
**Check if target already exists:**
|
|
72
|
+
- If yes: Fail with error, suggest renaming existing archive or using different date
|
|
73
|
+
- If no: Move the change directory to archive
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
6. **Display summary**
|
|
80
|
+
|
|
81
|
+
Show archive completion summary including:
|
|
82
|
+
- Change name
|
|
83
|
+
- Schema that was used
|
|
84
|
+
- Archive location
|
|
85
|
+
- Spec sync status (synced / sync skipped / no delta specs)
|
|
86
|
+
- Note about any warnings (incomplete artifacts/tasks)
|
|
87
|
+
|
|
88
|
+
**Output On Success**
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
## Archive Complete
|
|
92
|
+
|
|
93
|
+
**Change:** <change-name>
|
|
94
|
+
**Schema:** <schema-name>
|
|
95
|
+
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
|
|
96
|
+
**Specs:** ✓ Synced to main specs
|
|
97
|
+
|
|
98
|
+
All artifacts complete. All tasks complete.
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Output On Success (No Delta Specs)**
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
## Archive Complete
|
|
105
|
+
|
|
106
|
+
**Change:** <change-name>
|
|
107
|
+
**Schema:** <schema-name>
|
|
108
|
+
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
|
|
109
|
+
**Specs:** No delta specs
|
|
110
|
+
|
|
111
|
+
All artifacts complete. All tasks complete.
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Output On Success With Warnings**
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
## Archive Complete (with warnings)
|
|
118
|
+
|
|
119
|
+
**Change:** <change-name>
|
|
120
|
+
**Schema:** <schema-name>
|
|
121
|
+
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
|
|
122
|
+
**Specs:** Sync skipped (user chose to skip)
|
|
123
|
+
|
|
124
|
+
**Warnings:**
|
|
125
|
+
- Archived with 2 incomplete artifacts
|
|
126
|
+
- Archived with 3 incomplete tasks
|
|
127
|
+
- Delta spec sync was skipped (user chose to skip)
|
|
128
|
+
|
|
129
|
+
Review the archive if this was not intentional.
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Output On Error (Archive Exists)**
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
## Archive Failed
|
|
136
|
+
|
|
137
|
+
**Change:** <change-name>
|
|
138
|
+
**Target:** openspec/changes/archive/YYYY-MM-DD-<name>/
|
|
139
|
+
|
|
140
|
+
Target archive directory already exists.
|
|
141
|
+
|
|
142
|
+
**Options:**
|
|
143
|
+
1. Rename the existing archive
|
|
144
|
+
2. Delete the existing archive if it's a duplicate
|
|
145
|
+
3. Wait until a different date to archive
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Guardrails**
|
|
149
|
+
- Always prompt for change selection if not provided
|
|
150
|
+
- Use artifact graph (openspec status --json) for completion checking
|
|
151
|
+
- Don't block archive on warnings - just inform and confirm
|
|
152
|
+
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
|
|
153
|
+
- Show clear summary of what happened
|
|
154
|
+
- If sync is requested, use the Skill tool to invoke `openspec-sync-specs` (agent-driven)
|
|
155
|
+
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
|
|
@@ -1,171 +1,171 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Enter explore mode - think through ideas, investigate problems, clarify requirements
|
|
3
|
-
argument-hint: command arguments
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
|
|
7
|
-
|
|
8
|
-
**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.
|
|
9
|
-
|
|
10
|
-
**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.
|
|
11
|
-
|
|
12
|
-
**Input**: The argument after `/opsx:explore` is whatever the user wants to think about. Could be:
|
|
13
|
-
- A vague idea: "real-time collaboration"
|
|
14
|
-
- A specific problem: "the auth system is getting unwieldy"
|
|
15
|
-
- A change name: "add-dark-mode" (to explore in context of that change)
|
|
16
|
-
- A comparison: "postgres vs sqlite for this"
|
|
17
|
-
- Nothing (just enter explore mode)
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## The Stance
|
|
22
|
-
|
|
23
|
-
- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
|
|
24
|
-
- **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.
|
|
25
|
-
- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
|
|
26
|
-
- **Adaptive** - Follow interesting threads, pivot when new information emerges
|
|
27
|
-
- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
|
|
28
|
-
- **Grounded** - Explore the actual codebase when relevant, don't just theorize
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## What You Might Do
|
|
33
|
-
|
|
34
|
-
Depending on what the user brings, you might:
|
|
35
|
-
|
|
36
|
-
**Explore the problem space**
|
|
37
|
-
- Ask clarifying questions that emerge from what they said
|
|
38
|
-
- Challenge assumptions
|
|
39
|
-
- Reframe the problem
|
|
40
|
-
- Find analogies
|
|
41
|
-
|
|
42
|
-
**Investigate the codebase**
|
|
43
|
-
- Map existing architecture relevant to the discussion
|
|
44
|
-
- Find integration points
|
|
45
|
-
- Identify patterns already in use
|
|
46
|
-
- Surface hidden complexity
|
|
47
|
-
|
|
48
|
-
**Compare options**
|
|
49
|
-
- Brainstorm multiple approaches
|
|
50
|
-
- Build comparison tables
|
|
51
|
-
- Sketch tradeoffs
|
|
52
|
-
- Recommend a path (if asked)
|
|
53
|
-
|
|
54
|
-
**Visualize**
|
|
55
|
-
```
|
|
56
|
-
┌─────────────────────────────────────────┐
|
|
57
|
-
│ Use ASCII diagrams liberally │
|
|
58
|
-
├─────────────────────────────────────────┤
|
|
59
|
-
│ │
|
|
60
|
-
│ ┌────────┐ ┌────────┐ │
|
|
61
|
-
│ │ State │────────▶│ State │ │
|
|
62
|
-
│ │ A │ │ B │ │
|
|
63
|
-
│ └────────┘ └────────┘ │
|
|
64
|
-
│ │
|
|
65
|
-
│ System diagrams, state machines, │
|
|
66
|
-
│ data flows, architecture sketches, │
|
|
67
|
-
│ dependency graphs, comparison tables │
|
|
68
|
-
│ │
|
|
69
|
-
└─────────────────────────────────────────┘
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
**Surface risks and unknowns**
|
|
73
|
-
- Identify what could go wrong
|
|
74
|
-
- Find gaps in understanding
|
|
75
|
-
- Suggest spikes or investigations
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## OpenSpec Awareness
|
|
80
|
-
|
|
81
|
-
You have full context of the OpenSpec system. Use it naturally, don't force it.
|
|
82
|
-
|
|
83
|
-
### Check for context
|
|
84
|
-
|
|
85
|
-
At the start, quickly check what exists:
|
|
86
|
-
```bash
|
|
87
|
-
openspec list --json
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
This tells you:
|
|
91
|
-
- If there are active changes
|
|
92
|
-
- Their names, schemas, and status
|
|
93
|
-
- What the user might be working on
|
|
94
|
-
|
|
95
|
-
If the user mentioned a specific change name, read its artifacts for context.
|
|
96
|
-
|
|
97
|
-
### When no change exists
|
|
98
|
-
|
|
99
|
-
Think freely. When insights crystallize, you might offer:
|
|
100
|
-
|
|
101
|
-
- "This feels solid enough to start a change. Want me to create a proposal?"
|
|
102
|
-
- Or keep exploring - no pressure to formalize
|
|
103
|
-
|
|
104
|
-
### When a change exists
|
|
105
|
-
|
|
106
|
-
If the user mentions a change or you detect one is relevant:
|
|
107
|
-
|
|
108
|
-
1. **Read existing artifacts for context**
|
|
109
|
-
- `openspec/changes/<name>/proposal.md`
|
|
110
|
-
- `openspec/changes/<name>/design.md`
|
|
111
|
-
- `openspec/changes/<name>/tasks.md`
|
|
112
|
-
- etc.
|
|
113
|
-
|
|
114
|
-
2. **Reference them naturally in conversation**
|
|
115
|
-
- "Your design mentions using Redis, but we just realized SQLite fits better..."
|
|
116
|
-
- "The proposal scopes this to premium users, but we're now thinking everyone..."
|
|
117
|
-
|
|
118
|
-
3. **Offer to capture when decisions are made**
|
|
119
|
-
|
|
120
|
-
| Insight Type | Where to Capture |
|
|
121
|
-
|--------------|------------------|
|
|
122
|
-
| New requirement discovered | `specs/<capability>/spec.md` |
|
|
123
|
-
| Requirement changed | `specs/<capability>/spec.md` |
|
|
124
|
-
| Design decision made | `design.md` |
|
|
125
|
-
| Scope changed | `proposal.md` |
|
|
126
|
-
| New work identified | `tasks.md` |
|
|
127
|
-
| Assumption invalidated | Relevant artifact |
|
|
128
|
-
|
|
129
|
-
Example offers:
|
|
130
|
-
- "That's a design decision. Capture it in design.md?"
|
|
131
|
-
- "This is a new requirement. Add it to specs?"
|
|
132
|
-
- "This changes scope. Update the proposal?"
|
|
133
|
-
|
|
134
|
-
4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## What You Don't Have To Do
|
|
139
|
-
|
|
140
|
-
- Follow a script
|
|
141
|
-
- Ask the same questions every time
|
|
142
|
-
- Produce a specific artifact
|
|
143
|
-
- Reach a conclusion
|
|
144
|
-
- Stay on topic if a tangent is valuable
|
|
145
|
-
- Be brief (this is thinking time)
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
## Ending Discovery
|
|
150
|
-
|
|
151
|
-
There's no required ending. Discovery might:
|
|
152
|
-
|
|
153
|
-
- **Flow into a proposal**: "Ready to start? I can create a change proposal."
|
|
154
|
-
- **Result in artifact updates**: "Updated design.md with these decisions"
|
|
155
|
-
- **Just provide clarity**: User has what they need, moves on
|
|
156
|
-
- **Continue later**: "We can pick this up anytime"
|
|
157
|
-
|
|
158
|
-
When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
## Guardrails
|
|
163
|
-
|
|
164
|
-
- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
|
|
165
|
-
- **Don't fake understanding** - If something is unclear, dig deeper
|
|
166
|
-
- **Don't rush** - Discovery is thinking time, not task time
|
|
167
|
-
- **Don't force structure** - Let patterns emerge naturally
|
|
168
|
-
- **Don't auto-capture** - Offer to save insights, don't just do it
|
|
169
|
-
- **Do visualize** - A good diagram is worth many paragraphs
|
|
170
|
-
- **Do explore the codebase** - Ground discussions in reality
|
|
171
|
-
- **Do question assumptions** - Including the user's and your own
|
|
1
|
+
---
|
|
2
|
+
description: Enter explore mode - think through ideas, investigate problems, clarify requirements
|
|
3
|
+
argument-hint: command arguments
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
|
|
7
|
+
|
|
8
|
+
**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.
|
|
9
|
+
|
|
10
|
+
**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.
|
|
11
|
+
|
|
12
|
+
**Input**: The argument after `/opsx:explore` is whatever the user wants to think about. Could be:
|
|
13
|
+
- A vague idea: "real-time collaboration"
|
|
14
|
+
- A specific problem: "the auth system is getting unwieldy"
|
|
15
|
+
- A change name: "add-dark-mode" (to explore in context of that change)
|
|
16
|
+
- A comparison: "postgres vs sqlite for this"
|
|
17
|
+
- Nothing (just enter explore mode)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## The Stance
|
|
22
|
+
|
|
23
|
+
- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
|
|
24
|
+
- **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.
|
|
25
|
+
- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
|
|
26
|
+
- **Adaptive** - Follow interesting threads, pivot when new information emerges
|
|
27
|
+
- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
|
|
28
|
+
- **Grounded** - Explore the actual codebase when relevant, don't just theorize
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## What You Might Do
|
|
33
|
+
|
|
34
|
+
Depending on what the user brings, you might:
|
|
35
|
+
|
|
36
|
+
**Explore the problem space**
|
|
37
|
+
- Ask clarifying questions that emerge from what they said
|
|
38
|
+
- Challenge assumptions
|
|
39
|
+
- Reframe the problem
|
|
40
|
+
- Find analogies
|
|
41
|
+
|
|
42
|
+
**Investigate the codebase**
|
|
43
|
+
- Map existing architecture relevant to the discussion
|
|
44
|
+
- Find integration points
|
|
45
|
+
- Identify patterns already in use
|
|
46
|
+
- Surface hidden complexity
|
|
47
|
+
|
|
48
|
+
**Compare options**
|
|
49
|
+
- Brainstorm multiple approaches
|
|
50
|
+
- Build comparison tables
|
|
51
|
+
- Sketch tradeoffs
|
|
52
|
+
- Recommend a path (if asked)
|
|
53
|
+
|
|
54
|
+
**Visualize**
|
|
55
|
+
```
|
|
56
|
+
┌─────────────────────────────────────────┐
|
|
57
|
+
│ Use ASCII diagrams liberally │
|
|
58
|
+
├─────────────────────────────────────────┤
|
|
59
|
+
│ │
|
|
60
|
+
│ ┌────────┐ ┌────────┐ │
|
|
61
|
+
│ │ State │────────▶│ State │ │
|
|
62
|
+
│ │ A │ │ B │ │
|
|
63
|
+
│ └────────┘ └────────┘ │
|
|
64
|
+
│ │
|
|
65
|
+
│ System diagrams, state machines, │
|
|
66
|
+
│ data flows, architecture sketches, │
|
|
67
|
+
│ dependency graphs, comparison tables │
|
|
68
|
+
│ │
|
|
69
|
+
└─────────────────────────────────────────┘
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Surface risks and unknowns**
|
|
73
|
+
- Identify what could go wrong
|
|
74
|
+
- Find gaps in understanding
|
|
75
|
+
- Suggest spikes or investigations
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## OpenSpec Awareness
|
|
80
|
+
|
|
81
|
+
You have full context of the OpenSpec system. Use it naturally, don't force it.
|
|
82
|
+
|
|
83
|
+
### Check for context
|
|
84
|
+
|
|
85
|
+
At the start, quickly check what exists:
|
|
86
|
+
```bash
|
|
87
|
+
openspec list --json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
This tells you:
|
|
91
|
+
- If there are active changes
|
|
92
|
+
- Their names, schemas, and status
|
|
93
|
+
- What the user might be working on
|
|
94
|
+
|
|
95
|
+
If the user mentioned a specific change name, read its artifacts for context.
|
|
96
|
+
|
|
97
|
+
### When no change exists
|
|
98
|
+
|
|
99
|
+
Think freely. When insights crystallize, you might offer:
|
|
100
|
+
|
|
101
|
+
- "This feels solid enough to start a change. Want me to create a proposal?"
|
|
102
|
+
- Or keep exploring - no pressure to formalize
|
|
103
|
+
|
|
104
|
+
### When a change exists
|
|
105
|
+
|
|
106
|
+
If the user mentions a change or you detect one is relevant:
|
|
107
|
+
|
|
108
|
+
1. **Read existing artifacts for context**
|
|
109
|
+
- `openspec/changes/<name>/proposal.md`
|
|
110
|
+
- `openspec/changes/<name>/design.md`
|
|
111
|
+
- `openspec/changes/<name>/tasks.md`
|
|
112
|
+
- etc.
|
|
113
|
+
|
|
114
|
+
2. **Reference them naturally in conversation**
|
|
115
|
+
- "Your design mentions using Redis, but we just realized SQLite fits better..."
|
|
116
|
+
- "The proposal scopes this to premium users, but we're now thinking everyone..."
|
|
117
|
+
|
|
118
|
+
3. **Offer to capture when decisions are made**
|
|
119
|
+
|
|
120
|
+
| Insight Type | Where to Capture |
|
|
121
|
+
|--------------|------------------|
|
|
122
|
+
| New requirement discovered | `specs/<capability>/spec.md` |
|
|
123
|
+
| Requirement changed | `specs/<capability>/spec.md` |
|
|
124
|
+
| Design decision made | `design.md` |
|
|
125
|
+
| Scope changed | `proposal.md` |
|
|
126
|
+
| New work identified | `tasks.md` |
|
|
127
|
+
| Assumption invalidated | Relevant artifact |
|
|
128
|
+
|
|
129
|
+
Example offers:
|
|
130
|
+
- "That's a design decision. Capture it in design.md?"
|
|
131
|
+
- "This is a new requirement. Add it to specs?"
|
|
132
|
+
- "This changes scope. Update the proposal?"
|
|
133
|
+
|
|
134
|
+
4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## What You Don't Have To Do
|
|
139
|
+
|
|
140
|
+
- Follow a script
|
|
141
|
+
- Ask the same questions every time
|
|
142
|
+
- Produce a specific artifact
|
|
143
|
+
- Reach a conclusion
|
|
144
|
+
- Stay on topic if a tangent is valuable
|
|
145
|
+
- Be brief (this is thinking time)
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Ending Discovery
|
|
150
|
+
|
|
151
|
+
There's no required ending. Discovery might:
|
|
152
|
+
|
|
153
|
+
- **Flow into a proposal**: "Ready to start? I can create a change proposal."
|
|
154
|
+
- **Result in artifact updates**: "Updated design.md with these decisions"
|
|
155
|
+
- **Just provide clarity**: User has what they need, moves on
|
|
156
|
+
- **Continue later**: "We can pick this up anytime"
|
|
157
|
+
|
|
158
|
+
When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Guardrails
|
|
163
|
+
|
|
164
|
+
- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
|
|
165
|
+
- **Don't fake understanding** - If something is unclear, dig deeper
|
|
166
|
+
- **Don't rush** - Discovery is thinking time, not task time
|
|
167
|
+
- **Don't force structure** - Let patterns emerge naturally
|
|
168
|
+
- **Don't auto-capture** - Offer to save insights, don't just do it
|
|
169
|
+
- **Do visualize** - A good diagram is worth many paragraphs
|
|
170
|
+
- **Do explore the codebase** - Ground discussions in reality
|
|
171
|
+
- **Do question assumptions** - Including the user's and your own
|