ff-privaterag 0.1.0__tar.gz

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 (52) hide show
  1. ff_privaterag-0.1.0/.claude/commands/opsx/apply.md +155 -0
  2. ff_privaterag-0.1.0/.claude/commands/opsx/archive.md +160 -0
  3. ff_privaterag-0.1.0/.claude/commands/opsx/bulk-archive.md +244 -0
  4. ff_privaterag-0.1.0/.claude/commands/opsx/continue.md +115 -0
  5. ff_privaterag-0.1.0/.claude/commands/opsx/explore.md +172 -0
  6. ff_privaterag-0.1.0/.claude/commands/opsx/ff.md +98 -0
  7. ff_privaterag-0.1.0/.claude/commands/opsx/new.md +69 -0
  8. ff_privaterag-0.1.0/.claude/commands/opsx/onboard.md +548 -0
  9. ff_privaterag-0.1.0/.claude/commands/opsx/propose.md +107 -0
  10. ff_privaterag-0.1.0/.claude/commands/opsx/sync.md +143 -0
  11. ff_privaterag-0.1.0/.claude/commands/opsx/verify.md +167 -0
  12. ff_privaterag-0.1.0/.claude/skills/openspec-apply-change/SKILL.md +159 -0
  13. ff_privaterag-0.1.0/.claude/skills/openspec-archive-change/SKILL.md +117 -0
  14. ff_privaterag-0.1.0/.claude/skills/openspec-bulk-archive-change/SKILL.md +248 -0
  15. ff_privaterag-0.1.0/.claude/skills/openspec-continue-change/SKILL.md +119 -0
  16. ff_privaterag-0.1.0/.claude/skills/openspec-explore/SKILL.md +287 -0
  17. ff_privaterag-0.1.0/.claude/skills/openspec-ff-change/SKILL.md +102 -0
  18. ff_privaterag-0.1.0/.claude/skills/openspec-new-change/SKILL.md +74 -0
  19. ff_privaterag-0.1.0/.claude/skills/openspec-onboard/SKILL.md +552 -0
  20. ff_privaterag-0.1.0/.claude/skills/openspec-propose/SKILL.md +111 -0
  21. ff_privaterag-0.1.0/.claude/skills/openspec-sync-specs/SKILL.md +147 -0
  22. ff_privaterag-0.1.0/.claude/skills/openspec-verify-change/SKILL.md +171 -0
  23. ff_privaterag-0.1.0/.gitattributes +5 -0
  24. ff_privaterag-0.1.0/.gitignore +35 -0
  25. ff_privaterag-0.1.0/LICENSE +21 -0
  26. ff_privaterag-0.1.0/PKG-INFO +151 -0
  27. ff_privaterag-0.1.0/PUBLISHING.md +113 -0
  28. ff_privaterag-0.1.0/README.en.md +36 -0
  29. ff_privaterag-0.1.0/README.md +116 -0
  30. ff_privaterag-0.1.0/ff_PrivateRag.md +282 -0
  31. ff_privaterag-0.1.0/openspec/changes/bootstrap-privaterag/.openspec.yaml +2 -0
  32. ff_privaterag-0.1.0/openspec/changes/bootstrap-privaterag/design.md +98 -0
  33. ff_privaterag-0.1.0/openspec/changes/bootstrap-privaterag/proposal.md +34 -0
  34. ff_privaterag-0.1.0/openspec/changes/bootstrap-privaterag/specs/document-ingestion/spec.md +75 -0
  35. ff_privaterag-0.1.0/openspec/changes/bootstrap-privaterag/specs/knowledge-retrieval/spec.md +55 -0
  36. ff_privaterag-0.1.0/openspec/changes/bootstrap-privaterag/specs/packaging-and-distribution/spec.md +51 -0
  37. ff_privaterag-0.1.0/openspec/changes/bootstrap-privaterag/specs/provenance-tracking/spec.md +33 -0
  38. ff_privaterag-0.1.0/openspec/changes/bootstrap-privaterag/tasks.md +59 -0
  39. ff_privaterag-0.1.0/openspec/config.yaml +33 -0
  40. ff_privaterag-0.1.0/pyproject.toml +60 -0
  41. ff_privaterag-0.1.0/scripts/release.sh +61 -0
  42. ff_privaterag-0.1.0/src/ff_privaterag/__init__.py +6 -0
  43. ff_privaterag-0.1.0/src/ff_privaterag/embedder.py +54 -0
  44. ff_privaterag-0.1.0/src/ff_privaterag/file_processor.py +143 -0
  45. ff_privaterag-0.1.0/src/ff_privaterag/server.py +167 -0
  46. ff_privaterag-0.1.0/src/ff_privaterag/utils.py +136 -0
  47. ff_privaterag-0.1.0/src/ff_privaterag/vector_store.py +89 -0
  48. ff_privaterag-0.1.0/tests/conftest.py +48 -0
  49. ff_privaterag-0.1.0/tests/test_file_processor.py +55 -0
  50. ff_privaterag-0.1.0/tests/test_hf_endpoint.py +48 -0
  51. ff_privaterag-0.1.0/tests/test_integration.py +85 -0
  52. ff_privaterag-0.1.0/tests/test_utils.py +43 -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
+ **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.
11
+
12
+ **Steps**
13
+
14
+ 1. **Select the change**
15
+
16
+ If a name is provided, use it. Otherwise:
17
+ - Infer from conversation context if the user mentioned a change
18
+ - Auto-select if only one active change exists
19
+ - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
20
+
21
+ Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
22
+
23
+ 2. **Check status to understand the schema**
24
+ ```bash
25
+ openspec status --change "<name>" --json
26
+ ```
27
+ Parse the JSON to understand:
28
+ - `schemaName`: The workflow being used (e.g., "spec-driven")
29
+ - `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
30
+ - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
31
+
32
+ 3. **Get apply instructions**
33
+
34
+ ```bash
35
+ openspec instructions apply --change "<name>" --json
36
+ ```
37
+
38
+ This returns:
39
+ - `contextFiles`: artifact ID -> array of concrete file paths (varies by schema)
40
+ - Progress (total, complete, remaining)
41
+ - Task list with status
42
+ - Dynamic instruction based on current state
43
+
44
+ **Handle states:**
45
+ - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue`
46
+ - If `state: "all_done"`: congratulate, suggest archive
47
+ - Otherwise: proceed to implementation
48
+
49
+ **Workspace guard:** If status JSON reports `actionContext.mode: "workspace-planning"` and `allowedEditRoots` is empty, explain that full workspace apply is not supported in this slice. Treat linked repos and folders as read-only context, ask the user to select an affected area through an explicit implementation workflow, and STOP before editing files.
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
+ **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.
11
+
12
+ **Steps**
13
+
14
+ 1. **If no change name provided, prompt for selection**
15
+
16
+ Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
17
+
18
+ Show only active changes (not already archived).
19
+ Include the schema used for each change if available.
20
+
21
+ **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
22
+
23
+ 2. **Check artifact completion status**
24
+
25
+ Run `openspec status --change "<name>" --json` to check artifact completion.
26
+
27
+ Parse the JSON to understand:
28
+ - `schemaName`: The workflow being used
29
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
30
+ - `artifacts`: List of artifacts with their status (`done` or other)
31
+
32
+ If status reports `actionContext.mode: "workspace-planning"`, explain that workspace archive is not supported in this slice and STOP. Do not move workspace changes into repo-local archives or edit linked repos.
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,244 @@
1
+ ---
2
+ name: "OPSX: Bulk Archive"
3
+ description: Archive multiple completed changes at once
4
+ category: Workflow
5
+ tags: [workflow, archive, experimental, bulk]
6
+ ---
7
+
8
+ Archive multiple completed changes in a single operation.
9
+
10
+ This skill allows you to batch-archive changes, handling spec conflicts intelligently by checking the codebase to determine what's actually implemented.
11
+
12
+ **Input**: None required (prompts for selection)
13
+
14
+ **Steps**
15
+
16
+ 1. **Get active changes**
17
+
18
+ Run `openspec list --json` to get all active changes.
19
+
20
+ If no active changes exist, inform user and stop.
21
+
22
+ 2. **Prompt for change selection**
23
+
24
+ Use **AskUserQuestion tool** with multi-select to let user choose changes:
25
+ - Show each change with its schema
26
+ - Include an option for "All changes"
27
+ - Allow any number of selections (1+ works, 2+ is the typical use case)
28
+
29
+ **IMPORTANT**: Do NOT auto-select. Always let the user choose.
30
+
31
+ 3. **Batch validation - gather status for all selected changes**
32
+
33
+ For each selected change, collect:
34
+
35
+ a. **Artifact status** - Run `openspec status --change "<name>" --json`
36
+ - Parse `schemaName`, `artifacts`, `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`
37
+ - Note which artifacts are `done` vs other states
38
+
39
+ If any selected change reports `actionContext.mode: "workspace-planning"`, explain that workspace bulk archive is not supported in this slice and STOP before syncing specs or moving changes. Do not fall back to repo-local paths or edit linked repos.
40
+
41
+ b. **Task completion** - Read `artifactPaths.tasks.existingOutputPaths` from status JSON
42
+ - Count `- [ ]` (incomplete) vs `- [x]` (complete)
43
+ - If no tasks file exists, note as "No tasks"
44
+
45
+ c. **Delta specs** - Check `artifactPaths.specs.existingOutputPaths` from status JSON
46
+ - List which capability specs exist
47
+ - For each, extract requirement names (lines matching `### Requirement: <name>`)
48
+
49
+ 4. **Detect spec conflicts**
50
+
51
+ Build a map of `capability -> [changes that touch it]`:
52
+
53
+ ```
54
+ auth -> [change-a, change-b] <- CONFLICT (2+ changes)
55
+ api -> [change-c] <- OK (only 1 change)
56
+ ```
57
+
58
+ A conflict exists when 2+ selected changes have delta specs for the same capability.
59
+
60
+ 5. **Resolve conflicts agentically**
61
+
62
+ **For each conflict**, investigate the codebase:
63
+
64
+ a. **Read the delta specs** from each conflicting change to understand what each claims to add/modify
65
+
66
+ b. **Search the codebase** for implementation evidence:
67
+ - Look for code implementing requirements from each delta spec
68
+ - Check for related files, functions, or tests
69
+
70
+ c. **Determine resolution**:
71
+ - If only one change is actually implemented -> sync that one's specs
72
+ - If both implemented -> apply in chronological order (older first, newer overwrites)
73
+ - If neither implemented -> skip spec sync, warn user
74
+
75
+ d. **Record resolution** for each conflict:
76
+ - Which change's specs to apply
77
+ - In what order (if both)
78
+ - Rationale (what was found in codebase)
79
+
80
+ 6. **Show consolidated status table**
81
+
82
+ Display a table summarizing all changes:
83
+
84
+ ```
85
+ | Change | Artifacts | Tasks | Specs | Conflicts | Status |
86
+ |---------------------|-----------|-------|---------|-----------|--------|
87
+ | schema-management | Done | 5/5 | 2 delta | None | Ready |
88
+ | project-config | Done | 3/3 | 1 delta | None | Ready |
89
+ | add-oauth | Done | 4/4 | 1 delta | auth (!) | Ready* |
90
+ | add-verify-skill | 1 left | 2/5 | None | None | Warn |
91
+ ```
92
+
93
+ For conflicts, show the resolution:
94
+ ```
95
+ * Conflict resolution:
96
+ - auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
97
+ ```
98
+
99
+ For incomplete changes, show warnings:
100
+ ```
101
+ Warnings:
102
+ - add-verify-skill: 1 incomplete artifact, 3 incomplete tasks
103
+ ```
104
+
105
+ 7. **Confirm batch operation**
106
+
107
+ Use **AskUserQuestion tool** with a single confirmation:
108
+
109
+ - "Archive N changes?" with options based on status
110
+ - Options might include:
111
+ - "Archive all N changes"
112
+ - "Archive only N ready changes (skip incomplete)"
113
+ - "Cancel"
114
+
115
+ If there are incomplete changes, make clear they'll be archived with warnings.
116
+
117
+ 8. **Execute archive for each confirmed change**
118
+
119
+ Process changes in the determined order (respecting conflict resolution):
120
+
121
+ a. **Sync specs** if delta specs exist:
122
+ - Use the openspec-sync-specs approach (agent-driven intelligent merge)
123
+ - For conflicts, apply in resolved order
124
+ - Track if sync was done
125
+
126
+ b. **Perform the archive**:
127
+ ```bash
128
+ mkdir -p "<planningHome.changesDir>/archive"
129
+ mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
130
+ ```
131
+
132
+ c. **Track outcome** for each change:
133
+ - Success: archived successfully
134
+ - Failed: error during archive (record error)
135
+ - Skipped: user chose not to archive (if applicable)
136
+
137
+ 9. **Display summary**
138
+
139
+ Show final results:
140
+
141
+ ```
142
+ ## Bulk Archive Complete
143
+
144
+ Archived 3 changes:
145
+ - schema-management-cli -> archive/2026-01-19-schema-management-cli/
146
+ - project-config -> archive/2026-01-19-project-config/
147
+ - add-oauth -> archive/2026-01-19-add-oauth/
148
+
149
+ Skipped 1 change:
150
+ - add-verify-skill (user chose not to archive incomplete)
151
+
152
+ Spec sync summary:
153
+ - 4 delta specs synced to main specs
154
+ - 1 conflict resolved (auth: applied both in chronological order)
155
+ ```
156
+
157
+ If any failures:
158
+ ```
159
+ Failed 1 change:
160
+ - some-change: Archive directory already exists
161
+ ```
162
+
163
+ **Conflict Resolution Examples**
164
+
165
+ Example 1: Only one implemented
166
+ ```
167
+ Conflict: specs/auth/spec.md touched by [add-oauth, add-jwt]
168
+
169
+ Checking add-oauth:
170
+ - Delta adds "OAuth Provider Integration" requirement
171
+ - Searching codebase... found src/auth/oauth.ts implementing OAuth flow
172
+
173
+ Checking add-jwt:
174
+ - Delta adds "JWT Token Handling" requirement
175
+ - Searching codebase... no JWT implementation found
176
+
177
+ Resolution: Only add-oauth is implemented. Will sync add-oauth specs only.
178
+ ```
179
+
180
+ Example 2: Both implemented
181
+ ```
182
+ Conflict: specs/api/spec.md touched by [add-rest-api, add-graphql]
183
+
184
+ Checking add-rest-api (created 2026-01-10):
185
+ - Delta adds "REST Endpoints" requirement
186
+ - Searching codebase... found src/api/rest.ts
187
+
188
+ Checking add-graphql (created 2026-01-15):
189
+ - Delta adds "GraphQL Schema" requirement
190
+ - Searching codebase... found src/api/graphql.ts
191
+
192
+ Resolution: Both implemented. Will apply add-rest-api specs first,
193
+ then add-graphql specs (chronological order, newer takes precedence).
194
+ ```
195
+
196
+ **Output On Success**
197
+
198
+ ```
199
+ ## Bulk Archive Complete
200
+
201
+ Archived N changes:
202
+ - <change-1> -> archive/YYYY-MM-DD-<change-1>/
203
+ - <change-2> -> archive/YYYY-MM-DD-<change-2>/
204
+
205
+ Spec sync summary:
206
+ - N delta specs synced to main specs
207
+ - No conflicts (or: M conflicts resolved)
208
+ ```
209
+
210
+ **Output On Partial Success**
211
+
212
+ ```
213
+ ## Bulk Archive Complete (partial)
214
+
215
+ Archived N changes:
216
+ - <change-1> -> archive/YYYY-MM-DD-<change-1>/
217
+
218
+ Skipped M changes:
219
+ - <change-2> (user chose not to archive incomplete)
220
+
221
+ Failed K changes:
222
+ - <change-3>: Archive directory already exists
223
+ ```
224
+
225
+ **Output When No Changes**
226
+
227
+ ```
228
+ ## No Changes to Archive
229
+
230
+ No active changes found. Create a new change to get started.
231
+ ```
232
+
233
+ **Guardrails**
234
+ - Allow any number of changes (1+ is fine, 2+ is the typical use case)
235
+ - Always prompt for selection, never auto-select
236
+ - Detect spec conflicts early and resolve by checking codebase
237
+ - When both changes are implemented, apply specs in chronological order
238
+ - Skip spec sync only when implementation is missing (warn user)
239
+ - Show clear per-change status before confirming
240
+ - Use single confirmation for entire batch
241
+ - Track and report all outcomes (success/skip/fail)
242
+ - Preserve .openspec.yaml when moving to archive
243
+ - Archive directory target uses current date: YYYY-MM-DD-<name>
244
+ - If archive target exists, fail that change but continue with others
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: "OPSX: Continue"
3
+ description: Continue working on a change - create the next artifact (Experimental)
4
+ category: Workflow
5
+ tags: [workflow, artifacts, experimental]
6
+ ---
7
+
8
+ Continue working on a change by creating the next artifact.
9
+
10
+ **Input**: Optionally specify a change name after `/opsx:continue` (e.g., `/opsx:continue add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
11
+
12
+ **Steps**
13
+
14
+ 1. **If no change name provided, prompt for selection**
15
+
16
+ Run `openspec list --json` to get available changes sorted by most recently modified. Then use the **AskUserQuestion tool** to let the user select which change to work on.
17
+
18
+ Present the top 3-4 most recently modified changes as options, showing:
19
+ - Change name
20
+ - Schema (from `schema` field if present, otherwise "spec-driven")
21
+ - Status (e.g., "0/5 tasks", "complete", "no tasks")
22
+ - How recently it was modified (from `lastModified` field)
23
+
24
+ Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to continue.
25
+
26
+ **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
27
+
28
+ 2. **Check current status**
29
+ ```bash
30
+ openspec status --change "<name>" --json
31
+ ```
32
+ Parse the JSON to understand current state. The response includes:
33
+ - `schemaName`: The workflow schema being used (e.g., "spec-driven")
34
+ - `artifacts`: Array of artifacts with their status ("done", "ready", "blocked")
35
+ - `isComplete`: Boolean indicating if all artifacts are complete
36
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
37
+
38
+ 3. **Act based on status**:
39
+
40
+ ---
41
+
42
+ **If all artifacts are complete (`isComplete: true`)**:
43
+ - Congratulate the user
44
+ - Show final status including the schema used
45
+ - Suggest: "All artifacts created! You can now implement this change with `/opsx:apply` or archive it with `/opsx:archive`."
46
+ - STOP
47
+
48
+ ---
49
+
50
+ **If artifacts are ready to create** (status shows artifacts with `status: "ready"`):
51
+ - Pick the FIRST artifact with `status: "ready"` from the status output
52
+ - Get its instructions:
53
+ ```bash
54
+ openspec instructions <artifact-id> --change "<name>" --json
55
+ ```
56
+ - Parse the JSON. The key fields are:
57
+ - `context`: Project background (constraints for you - do NOT include in output)
58
+ - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
59
+ - `template`: The structure to use for your output file
60
+ - `instruction`: Schema-specific guidance
61
+ - `resolvedOutputPath`: Resolved path or pattern to write the artifact
62
+ - `dependencies`: Completed artifacts to read for context
63
+ - **Create the artifact file**:
64
+ - Read any completed dependency files for context
65
+ - Use `template` as the structure - fill in its sections
66
+ - Apply `context` and `rules` as constraints when writing - but do NOT copy them into the file
67
+ - Write to the `resolvedOutputPath` specified in instructions. If it is a glob pattern, choose the concrete file path using the schema instruction and workspace planning context
68
+ - Show what was created and what's now unlocked
69
+ - STOP after creating ONE artifact
70
+
71
+ ---
72
+
73
+ **If no artifacts are ready (all blocked)**:
74
+ - This shouldn't happen with a valid schema
75
+ - Show status and suggest checking for issues
76
+
77
+ 4. **After creating an artifact, show progress**
78
+ ```bash
79
+ openspec status --change "<name>"
80
+ ```
81
+
82
+ **Output**
83
+
84
+ After each invocation, show:
85
+ - Which artifact was created
86
+ - Schema workflow being used
87
+ - Current progress (N/M complete)
88
+ - What artifacts are now unlocked
89
+ - Prompt: "Run `/opsx:continue` to create the next artifact"
90
+
91
+ **Artifact Creation Guidelines**
92
+
93
+ The artifact types and their purpose depend on the schema. Use the `instruction` field from the instructions output to understand what to create.
94
+
95
+ Common artifact patterns:
96
+
97
+ **spec-driven schema** (proposal → specs → design → tasks):
98
+ - **proposal.md**: Ask user about the change if not clear. Fill in Why, What Changes, Capabilities, Impact.
99
+ - The Capabilities section is critical - each capability listed will need a spec file.
100
+ - **specs/<capability>/spec.md**: Create one spec per capability listed in the proposal's Capabilities section (use the capability name, not the change name).
101
+ - **design.md**: Document technical decisions, architecture, and implementation approach.
102
+ - **tasks.md**: Break down implementation into checkboxed tasks.
103
+
104
+ For other schemas, follow the `instruction` field from the CLI output.
105
+
106
+ **Guardrails**
107
+ - Create ONE artifact per invocation
108
+ - Always read dependency artifacts before creating a new one
109
+ - Never skip artifacts or create out of order
110
+ - If context is unclear, ask the user before creating
111
+ - Verify the artifact file exists after writing before marking progress
112
+ - Use the schema's artifact sequence, don't assume specific artifact names
113
+ - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
114
+ - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
115
+ - These guide what you write, but should never appear in the output