celltype-cli 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 (187) hide show
  1. celltype_cli-0.1.0/.claude/commands/opsx/apply.md +152 -0
  2. celltype_cli-0.1.0/.claude/commands/opsx/archive.md +157 -0
  3. celltype_cli-0.1.0/.claude/commands/opsx/bulk-archive.md +242 -0
  4. celltype_cli-0.1.0/.claude/commands/opsx/continue.md +114 -0
  5. celltype_cli-0.1.0/.claude/commands/opsx/explore.md +174 -0
  6. celltype_cli-0.1.0/.claude/commands/opsx/ff.md +94 -0
  7. celltype_cli-0.1.0/.claude/commands/opsx/new.md +69 -0
  8. celltype_cli-0.1.0/.claude/commands/opsx/onboard.md +525 -0
  9. celltype_cli-0.1.0/.claude/commands/opsx/sync.md +134 -0
  10. celltype_cli-0.1.0/.claude/commands/opsx/verify.md +164 -0
  11. celltype_cli-0.1.0/.claude/settings.local.json +95 -0
  12. celltype_cli-0.1.0/.claude/skills/openspec-apply-change/SKILL.md +156 -0
  13. celltype_cli-0.1.0/.claude/skills/openspec-archive-change/SKILL.md +114 -0
  14. celltype_cli-0.1.0/.claude/skills/openspec-bulk-archive-change/SKILL.md +246 -0
  15. celltype_cli-0.1.0/.claude/skills/openspec-continue-change/SKILL.md +118 -0
  16. celltype_cli-0.1.0/.claude/skills/openspec-explore/SKILL.md +290 -0
  17. celltype_cli-0.1.0/.claude/skills/openspec-ff-change/SKILL.md +101 -0
  18. celltype_cli-0.1.0/.claude/skills/openspec-new-change/SKILL.md +74 -0
  19. celltype_cli-0.1.0/.claude/skills/openspec-onboard/SKILL.md +529 -0
  20. celltype_cli-0.1.0/.claude/skills/openspec-sync-specs/SKILL.md +138 -0
  21. celltype_cli-0.1.0/.claude/skills/openspec-verify-change/SKILL.md +168 -0
  22. celltype_cli-0.1.0/.dockerignore +6 -0
  23. celltype_cli-0.1.0/.github/workflows/ci.yml +67 -0
  24. celltype_cli-0.1.0/.gitignore +54 -0
  25. celltype_cli-0.1.0/CLAUDE.md +69 -0
  26. celltype_cli-0.1.0/Dockerfile +22 -0
  27. celltype_cli-0.1.0/Dockerfile.api +16 -0
  28. celltype_cli-0.1.0/LICENSE +21 -0
  29. celltype_cli-0.1.0/PKG-INFO +267 -0
  30. celltype_cli-0.1.0/README.md +204 -0
  31. celltype_cli-0.1.0/assets/bixbench_benchmark.png +0 -0
  32. celltype_cli-0.1.0/assets/ct2.gif +0 -0
  33. celltype_cli-0.1.0/docker-compose.yml +28 -0
  34. celltype_cli-0.1.0/install.sh +86 -0
  35. celltype_cli-0.1.0/openspec/config.yaml +20 -0
  36. celltype_cli-0.1.0/pyproject.toml +100 -0
  37. celltype_cli-0.1.0/scripts/prepare_datasets.py +147 -0
  38. celltype_cli-0.1.0/scripts/prepare_l1000.py +137 -0
  39. celltype_cli-0.1.0/settings.json +5 -0
  40. celltype_cli-0.1.0/src/ct/__init__.py +3 -0
  41. celltype_cli-0.1.0/src/ct/agent/__init__.py +0 -0
  42. celltype_cli-0.1.0/src/ct/agent/case_studies.py +426 -0
  43. celltype_cli-0.1.0/src/ct/agent/config.py +523 -0
  44. celltype_cli-0.1.0/src/ct/agent/doctor.py +544 -0
  45. celltype_cli-0.1.0/src/ct/agent/knowledge.py +523 -0
  46. celltype_cli-0.1.0/src/ct/agent/loop.py +99 -0
  47. celltype_cli-0.1.0/src/ct/agent/mcp_server.py +478 -0
  48. celltype_cli-0.1.0/src/ct/agent/orchestrator.py +733 -0
  49. celltype_cli-0.1.0/src/ct/agent/runner.py +656 -0
  50. celltype_cli-0.1.0/src/ct/agent/sandbox.py +481 -0
  51. celltype_cli-0.1.0/src/ct/agent/session.py +145 -0
  52. celltype_cli-0.1.0/src/ct/agent/system_prompt.py +186 -0
  53. celltype_cli-0.1.0/src/ct/agent/trace_store.py +228 -0
  54. celltype_cli-0.1.0/src/ct/agent/trajectory.py +169 -0
  55. celltype_cli-0.1.0/src/ct/agent/types.py +182 -0
  56. celltype_cli-0.1.0/src/ct/agent/workflows.py +462 -0
  57. celltype_cli-0.1.0/src/ct/api/__init__.py +1 -0
  58. celltype_cli-0.1.0/src/ct/api/app.py +211 -0
  59. celltype_cli-0.1.0/src/ct/api/config.py +120 -0
  60. celltype_cli-0.1.0/src/ct/api/engine.py +124 -0
  61. celltype_cli-0.1.0/src/ct/cli.py +1448 -0
  62. celltype_cli-0.1.0/src/ct/data/__init__.py +0 -0
  63. celltype_cli-0.1.0/src/ct/data/compute_providers.json +59 -0
  64. celltype_cli-0.1.0/src/ct/data/cro_database.json +395 -0
  65. celltype_cli-0.1.0/src/ct/data/downloader.py +238 -0
  66. celltype_cli-0.1.0/src/ct/data/loaders.py +252 -0
  67. celltype_cli-0.1.0/src/ct/kb/__init__.py +5 -0
  68. celltype_cli-0.1.0/src/ct/kb/benchmarks.py +147 -0
  69. celltype_cli-0.1.0/src/ct/kb/governance.py +106 -0
  70. celltype_cli-0.1.0/src/ct/kb/ingest.py +415 -0
  71. celltype_cli-0.1.0/src/ct/kb/reasoning.py +129 -0
  72. celltype_cli-0.1.0/src/ct/kb/schema_monitor.py +162 -0
  73. celltype_cli-0.1.0/src/ct/kb/substrate.py +387 -0
  74. celltype_cli-0.1.0/src/ct/models/__init__.py +0 -0
  75. celltype_cli-0.1.0/src/ct/models/llm.py +370 -0
  76. celltype_cli-0.1.0/src/ct/tools/__init__.py +195 -0
  77. celltype_cli-0.1.0/src/ct/tools/_compound_resolver.py +297 -0
  78. celltype_cli-0.1.0/src/ct/tools/biomarker.py +368 -0
  79. celltype_cli-0.1.0/src/ct/tools/cellxgene.py +282 -0
  80. celltype_cli-0.1.0/src/ct/tools/chemistry.py +1371 -0
  81. celltype_cli-0.1.0/src/ct/tools/claude.py +390 -0
  82. celltype_cli-0.1.0/src/ct/tools/clinical.py +1153 -0
  83. celltype_cli-0.1.0/src/ct/tools/clue.py +249 -0
  84. celltype_cli-0.1.0/src/ct/tools/code.py +1069 -0
  85. celltype_cli-0.1.0/src/ct/tools/combination.py +397 -0
  86. celltype_cli-0.1.0/src/ct/tools/compute.py +402 -0
  87. celltype_cli-0.1.0/src/ct/tools/cro.py +413 -0
  88. celltype_cli-0.1.0/src/ct/tools/data_api.py +2114 -0
  89. celltype_cli-0.1.0/src/ct/tools/design.py +295 -0
  90. celltype_cli-0.1.0/src/ct/tools/dna.py +575 -0
  91. celltype_cli-0.1.0/src/ct/tools/experiment.py +604 -0
  92. celltype_cli-0.1.0/src/ct/tools/expression.py +655 -0
  93. celltype_cli-0.1.0/src/ct/tools/files.py +957 -0
  94. celltype_cli-0.1.0/src/ct/tools/genomics.py +1387 -0
  95. celltype_cli-0.1.0/src/ct/tools/http_client.py +146 -0
  96. celltype_cli-0.1.0/src/ct/tools/imaging.py +319 -0
  97. celltype_cli-0.1.0/src/ct/tools/intel.py +223 -0
  98. celltype_cli-0.1.0/src/ct/tools/literature.py +743 -0
  99. celltype_cli-0.1.0/src/ct/tools/network.py +422 -0
  100. celltype_cli-0.1.0/src/ct/tools/notification.py +111 -0
  101. celltype_cli-0.1.0/src/ct/tools/omics.py +3330 -0
  102. celltype_cli-0.1.0/src/ct/tools/ops.py +1230 -0
  103. celltype_cli-0.1.0/src/ct/tools/parity.py +649 -0
  104. celltype_cli-0.1.0/src/ct/tools/pk.py +245 -0
  105. celltype_cli-0.1.0/src/ct/tools/protein.py +678 -0
  106. celltype_cli-0.1.0/src/ct/tools/regulatory.py +643 -0
  107. celltype_cli-0.1.0/src/ct/tools/remote_data.py +179 -0
  108. celltype_cli-0.1.0/src/ct/tools/report.py +181 -0
  109. celltype_cli-0.1.0/src/ct/tools/repurposing.py +376 -0
  110. celltype_cli-0.1.0/src/ct/tools/safety.py +1280 -0
  111. celltype_cli-0.1.0/src/ct/tools/shell.py +178 -0
  112. celltype_cli-0.1.0/src/ct/tools/singlecell.py +533 -0
  113. celltype_cli-0.1.0/src/ct/tools/statistics.py +552 -0
  114. celltype_cli-0.1.0/src/ct/tools/structure.py +882 -0
  115. celltype_cli-0.1.0/src/ct/tools/target.py +901 -0
  116. celltype_cli-0.1.0/src/ct/tools/translational.py +123 -0
  117. celltype_cli-0.1.0/src/ct/tools/viability.py +218 -0
  118. celltype_cli-0.1.0/src/ct/ui/__init__.py +0 -0
  119. celltype_cli-0.1.0/src/ct/ui/markdown.py +31 -0
  120. celltype_cli-0.1.0/src/ct/ui/status.py +258 -0
  121. celltype_cli-0.1.0/src/ct/ui/suggestions.py +567 -0
  122. celltype_cli-0.1.0/src/ct/ui/terminal.py +1456 -0
  123. celltype_cli-0.1.0/src/ct/ui/traces.py +112 -0
  124. celltype_cli-0.1.0/tests/__init__.py +0 -0
  125. celltype_cli-0.1.0/tests/conftest.py +54 -0
  126. celltype_cli-0.1.0/tests/fixtures/plan_snapshot.txt +13 -0
  127. celltype_cli-0.1.0/tests/fixtures/trace_snapshot.txt +6 -0
  128. celltype_cli-0.1.0/tests/test_api_smoke.py +183 -0
  129. celltype_cli-0.1.0/tests/test_cellxgene.py +155 -0
  130. celltype_cli-0.1.0/tests/test_chemistry_new.py +323 -0
  131. celltype_cli-0.1.0/tests/test_claude.py +219 -0
  132. celltype_cli-0.1.0/tests/test_cli.py +398 -0
  133. celltype_cli-0.1.0/tests/test_clue.py +69 -0
  134. celltype_cli-0.1.0/tests/test_code.py +177 -0
  135. celltype_cli-0.1.0/tests/test_compute.py +243 -0
  136. celltype_cli-0.1.0/tests/test_config.py +232 -0
  137. celltype_cli-0.1.0/tests/test_cro.py +208 -0
  138. celltype_cli-0.1.0/tests/test_data_api.py +994 -0
  139. celltype_cli-0.1.0/tests/test_data_api_service.py +268 -0
  140. celltype_cli-0.1.0/tests/test_design.py +204 -0
  141. celltype_cli-0.1.0/tests/test_dna.py +75 -0
  142. celltype_cli-0.1.0/tests/test_doctor.py +236 -0
  143. celltype_cli-0.1.0/tests/test_downloader.py +235 -0
  144. celltype_cli-0.1.0/tests/test_engine.py +130 -0
  145. celltype_cli-0.1.0/tests/test_experiment.py +126 -0
  146. celltype_cli-0.1.0/tests/test_files.py +584 -0
  147. celltype_cli-0.1.0/tests/test_future_backends_todo.py +21 -0
  148. celltype_cli-0.1.0/tests/test_html_report.py +144 -0
  149. celltype_cli-0.1.0/tests/test_http_client.py +104 -0
  150. celltype_cli-0.1.0/tests/test_imaging.py +212 -0
  151. celltype_cli-0.1.0/tests/test_kb_benchmarks.py +40 -0
  152. celltype_cli-0.1.0/tests/test_kb_governance.py +69 -0
  153. celltype_cli-0.1.0/tests/test_kb_ingest.py +86 -0
  154. celltype_cli-0.1.0/tests/test_kb_reasoning.py +66 -0
  155. celltype_cli-0.1.0/tests/test_kb_schema_monitor.py +27 -0
  156. celltype_cli-0.1.0/tests/test_kb_substrate.py +53 -0
  157. celltype_cli-0.1.0/tests/test_knowledge.py +42 -0
  158. celltype_cli-0.1.0/tests/test_llm.py +125 -0
  159. celltype_cli-0.1.0/tests/test_mention_completer.py +216 -0
  160. celltype_cli-0.1.0/tests/test_network.py +178 -0
  161. celltype_cli-0.1.0/tests/test_notebook.py +187 -0
  162. celltype_cli-0.1.0/tests/test_notification.py +117 -0
  163. celltype_cli-0.1.0/tests/test_omics.py +1270 -0
  164. celltype_cli-0.1.0/tests/test_ops.py +209 -0
  165. celltype_cli-0.1.0/tests/test_parity_tools.py +170 -0
  166. celltype_cli-0.1.0/tests/test_parkinsons_toolchain_smoke.py +209 -0
  167. celltype_cli-0.1.0/tests/test_patent_search.py +306 -0
  168. celltype_cli-0.1.0/tests/test_plan_display.py +123 -0
  169. celltype_cli-0.1.0/tests/test_protein.py +457 -0
  170. celltype_cli-0.1.0/tests/test_registry.py +350 -0
  171. celltype_cli-0.1.0/tests/test_remote_data.py +118 -0
  172. celltype_cli-0.1.0/tests/test_repurposing.py +92 -0
  173. celltype_cli-0.1.0/tests/test_sandbox.py +187 -0
  174. celltype_cli-0.1.0/tests/test_sdk_streaming.py +301 -0
  175. celltype_cli-0.1.0/tests/test_session.py +143 -0
  176. celltype_cli-0.1.0/tests/test_shell.py +73 -0
  177. celltype_cli-0.1.0/tests/test_singlecell.py +379 -0
  178. celltype_cli-0.1.0/tests/test_status.py +108 -0
  179. celltype_cli-0.1.0/tests/test_structure.py +541 -0
  180. celltype_cli-0.1.0/tests/test_target.py +401 -0
  181. celltype_cli-0.1.0/tests/test_terminal.py +367 -0
  182. celltype_cli-0.1.0/tests/test_terminal_integration.py +90 -0
  183. celltype_cli-0.1.0/tests/test_tools.py +1820 -0
  184. celltype_cli-0.1.0/tests/test_trace_store.py +186 -0
  185. celltype_cli-0.1.0/tests/test_traces.py +207 -0
  186. celltype_cli-0.1.0/tests/test_trajectory.py +180 -0
  187. celltype_cli-0.1.0/tests/test_workflows.py +103 -0
@@ -0,0 +1,152 @@
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
+ - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
30
+
31
+ 3. **Get apply instructions**
32
+
33
+ ```bash
34
+ openspec instructions apply --change "<name>" --json
35
+ ```
36
+
37
+ This returns:
38
+ - Context file paths (varies by schema)
39
+ - Progress (total, complete, remaining)
40
+ - Task list with status
41
+ - Dynamic instruction based on current state
42
+
43
+ **Handle states:**
44
+ - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue`
45
+ - If `state: "all_done"`: congratulate, suggest archive
46
+ - Otherwise: proceed to implementation
47
+
48
+ 4. **Read context files**
49
+
50
+ Read the files listed in `contextFiles` from the apply instructions output.
51
+ The files depend on the schema being used:
52
+ - **spec-driven**: proposal, specs, design, tasks
53
+ - Other schemas: follow the contextFiles from CLI output
54
+
55
+ 5. **Show current progress**
56
+
57
+ Display:
58
+ - Schema being used
59
+ - Progress: "N/M tasks complete"
60
+ - Remaining tasks overview
61
+ - Dynamic instruction from CLI
62
+
63
+ 6. **Implement tasks (loop until done or blocked)**
64
+
65
+ For each pending task:
66
+ - Show which task is being worked on
67
+ - Make the code changes required
68
+ - Keep changes minimal and focused
69
+ - Mark task complete in the tasks file: `- [ ]` → `- [x]`
70
+ - Continue to next task
71
+
72
+ **Pause if:**
73
+ - Task is unclear → ask for clarification
74
+ - Implementation reveals a design issue → suggest updating artifacts
75
+ - Error or blocker encountered → report and wait for guidance
76
+ - User interrupts
77
+
78
+ 7. **On completion or pause, show status**
79
+
80
+ Display:
81
+ - Tasks completed this session
82
+ - Overall progress: "N/M tasks complete"
83
+ - If all done: suggest archive
84
+ - If paused: explain why and wait for guidance
85
+
86
+ **Output During Implementation**
87
+
88
+ ```
89
+ ## Implementing: <change-name> (schema: <schema-name>)
90
+
91
+ Working on task 3/7: <task description>
92
+ [...implementation happening...]
93
+ ✓ Task complete
94
+
95
+ Working on task 4/7: <task description>
96
+ [...implementation happening...]
97
+ ✓ Task complete
98
+ ```
99
+
100
+ **Output On Completion**
101
+
102
+ ```
103
+ ## Implementation Complete
104
+
105
+ **Change:** <change-name>
106
+ **Schema:** <schema-name>
107
+ **Progress:** 7/7 tasks complete ✓
108
+
109
+ ### Completed This Session
110
+ - [x] Task 1
111
+ - [x] Task 2
112
+ ...
113
+
114
+ All tasks complete! You can archive this change with `/opsx:archive`.
115
+ ```
116
+
117
+ **Output On Pause (Issue Encountered)**
118
+
119
+ ```
120
+ ## Implementation Paused
121
+
122
+ **Change:** <change-name>
123
+ **Schema:** <schema-name>
124
+ **Progress:** 4/7 tasks complete
125
+
126
+ ### Issue Encountered
127
+ <description of the issue>
128
+
129
+ **Options:**
130
+ 1. <option 1>
131
+ 2. <option 2>
132
+ 3. Other approach
133
+
134
+ What would you like to do?
135
+ ```
136
+
137
+ **Guardrails**
138
+ - Keep going through tasks until done or blocked
139
+ - Always read context files before starting (from the apply instructions output)
140
+ - If task is ambiguous, pause and ask before implementing
141
+ - If implementation reveals issues, pause and suggest artifact updates
142
+ - Keep code changes minimal and scoped to each task
143
+ - Update task checkbox immediately after completing each task
144
+ - Pause on errors, blockers, or unclear requirements - don't guess
145
+ - Use contextFiles from CLI output, don't assume specific file names
146
+
147
+ **Fluid Workflow Integration**
148
+
149
+ This skill supports the "actions on a change" model:
150
+
151
+ - **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
152
+ - **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
@@ -0,0 +1,157 @@
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
+ - `artifacts`: List of artifacts with their status (`done` or other)
30
+
31
+ **If any artifacts are not `done`:**
32
+ - Display warning listing incomplete artifacts
33
+ - Prompt user for confirmation to continue
34
+ - Proceed if user confirms
35
+
36
+ 3. **Check task completion status**
37
+
38
+ Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
39
+
40
+ Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
41
+
42
+ **If incomplete tasks found:**
43
+ - Display warning showing count of incomplete tasks
44
+ - Prompt user for confirmation to continue
45
+ - Proceed if user confirms
46
+
47
+ **If no tasks file exists:** Proceed without task-related warning.
48
+
49
+ 4. **Assess delta spec sync state**
50
+
51
+ Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.
52
+
53
+ **If delta specs exist:**
54
+ - Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
55
+ - Determine what changes would be applied (adds, modifications, removals, renames)
56
+ - Show a combined summary before prompting
57
+
58
+ **Prompt options:**
59
+ - If changes needed: "Sync now (recommended)", "Archive without syncing"
60
+ - If already synced: "Archive now", "Sync anyway", "Cancel"
61
+
62
+ If user chooses sync, execute `/opsx:sync` logic. Proceed to archive regardless of choice.
63
+
64
+ 5. **Perform the archive**
65
+
66
+ Create the archive directory if it doesn't exist:
67
+ ```bash
68
+ mkdir -p openspec/changes/archive
69
+ ```
70
+
71
+ Generate target name using current date: `YYYY-MM-DD-<change-name>`
72
+
73
+ **Check if target already exists:**
74
+ - If yes: Fail with error, suggest renaming existing archive or using different date
75
+ - If no: Move the change directory to archive
76
+
77
+ ```bash
78
+ mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
79
+ ```
80
+
81
+ 6. **Display summary**
82
+
83
+ Show archive completion summary including:
84
+ - Change name
85
+ - Schema that was used
86
+ - Archive location
87
+ - Spec sync status (synced / sync skipped / no delta specs)
88
+ - Note about any warnings (incomplete artifacts/tasks)
89
+
90
+ **Output On Success**
91
+
92
+ ```
93
+ ## Archive Complete
94
+
95
+ **Change:** <change-name>
96
+ **Schema:** <schema-name>
97
+ **Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
98
+ **Specs:** ✓ Synced to main specs
99
+
100
+ All artifacts complete. All tasks complete.
101
+ ```
102
+
103
+ **Output On Success (No Delta Specs)**
104
+
105
+ ```
106
+ ## Archive Complete
107
+
108
+ **Change:** <change-name>
109
+ **Schema:** <schema-name>
110
+ **Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
111
+ **Specs:** No delta specs
112
+
113
+ All artifacts complete. All tasks complete.
114
+ ```
115
+
116
+ **Output On Success With Warnings**
117
+
118
+ ```
119
+ ## Archive Complete (with warnings)
120
+
121
+ **Change:** <change-name>
122
+ **Schema:** <schema-name>
123
+ **Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
124
+ **Specs:** Sync skipped (user chose to skip)
125
+
126
+ **Warnings:**
127
+ - Archived with 2 incomplete artifacts
128
+ - Archived with 3 incomplete tasks
129
+ - Delta spec sync was skipped (user chose to skip)
130
+
131
+ Review the archive if this was not intentional.
132
+ ```
133
+
134
+ **Output On Error (Archive Exists)**
135
+
136
+ ```
137
+ ## Archive Failed
138
+
139
+ **Change:** <change-name>
140
+ **Target:** openspec/changes/archive/YYYY-MM-DD-<name>/
141
+
142
+ Target archive directory already exists.
143
+
144
+ **Options:**
145
+ 1. Rename the existing archive
146
+ 2. Delete the existing archive if it's a duplicate
147
+ 3. Wait until a different date to archive
148
+ ```
149
+
150
+ **Guardrails**
151
+ - Always prompt for change selection if not provided
152
+ - Use artifact graph (openspec status --json) for completion checking
153
+ - Don't block archive on warnings - just inform and confirm
154
+ - Preserve .openspec.yaml when moving to archive (it moves with the directory)
155
+ - Show clear summary of what happened
156
+ - If sync is requested, use /opsx:sync approach (agent-driven)
157
+ - If delta specs exist, always run the sync assessment and show the combined summary before prompting
@@ -0,0 +1,242 @@
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` and `artifacts` list
37
+ - Note which artifacts are `done` vs other states
38
+
39
+ b. **Task completion** - Read `openspec/changes/<name>/tasks.md`
40
+ - Count `- [ ]` (incomplete) vs `- [x]` (complete)
41
+ - If no tasks file exists, note as "No tasks"
42
+
43
+ c. **Delta specs** - Check `openspec/changes/<name>/specs/` directory
44
+ - List which capability specs exist
45
+ - For each, extract requirement names (lines matching `### Requirement: <name>`)
46
+
47
+ 4. **Detect spec conflicts**
48
+
49
+ Build a map of `capability -> [changes that touch it]`:
50
+
51
+ ```
52
+ auth -> [change-a, change-b] <- CONFLICT (2+ changes)
53
+ api -> [change-c] <- OK (only 1 change)
54
+ ```
55
+
56
+ A conflict exists when 2+ selected changes have delta specs for the same capability.
57
+
58
+ 5. **Resolve conflicts agentically**
59
+
60
+ **For each conflict**, investigate the codebase:
61
+
62
+ a. **Read the delta specs** from each conflicting change to understand what each claims to add/modify
63
+
64
+ b. **Search the codebase** for implementation evidence:
65
+ - Look for code implementing requirements from each delta spec
66
+ - Check for related files, functions, or tests
67
+
68
+ c. **Determine resolution**:
69
+ - If only one change is actually implemented -> sync that one's specs
70
+ - If both implemented -> apply in chronological order (older first, newer overwrites)
71
+ - If neither implemented -> skip spec sync, warn user
72
+
73
+ d. **Record resolution** for each conflict:
74
+ - Which change's specs to apply
75
+ - In what order (if both)
76
+ - Rationale (what was found in codebase)
77
+
78
+ 6. **Show consolidated status table**
79
+
80
+ Display a table summarizing all changes:
81
+
82
+ ```
83
+ | Change | Artifacts | Tasks | Specs | Conflicts | Status |
84
+ |---------------------|-----------|-------|---------|-----------|--------|
85
+ | schema-management | Done | 5/5 | 2 delta | None | Ready |
86
+ | project-config | Done | 3/3 | 1 delta | None | Ready |
87
+ | add-oauth | Done | 4/4 | 1 delta | auth (!) | Ready* |
88
+ | add-verify-skill | 1 left | 2/5 | None | None | Warn |
89
+ ```
90
+
91
+ For conflicts, show the resolution:
92
+ ```
93
+ * Conflict resolution:
94
+ - auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
95
+ ```
96
+
97
+ For incomplete changes, show warnings:
98
+ ```
99
+ Warnings:
100
+ - add-verify-skill: 1 incomplete artifact, 3 incomplete tasks
101
+ ```
102
+
103
+ 7. **Confirm batch operation**
104
+
105
+ Use **AskUserQuestion tool** with a single confirmation:
106
+
107
+ - "Archive N changes?" with options based on status
108
+ - Options might include:
109
+ - "Archive all N changes"
110
+ - "Archive only N ready changes (skip incomplete)"
111
+ - "Cancel"
112
+
113
+ If there are incomplete changes, make clear they'll be archived with warnings.
114
+
115
+ 8. **Execute archive for each confirmed change**
116
+
117
+ Process changes in the determined order (respecting conflict resolution):
118
+
119
+ a. **Sync specs** if delta specs exist:
120
+ - Use the openspec-sync-specs approach (agent-driven intelligent merge)
121
+ - For conflicts, apply in resolved order
122
+ - Track if sync was done
123
+
124
+ b. **Perform the archive**:
125
+ ```bash
126
+ mkdir -p openspec/changes/archive
127
+ mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
128
+ ```
129
+
130
+ c. **Track outcome** for each change:
131
+ - Success: archived successfully
132
+ - Failed: error during archive (record error)
133
+ - Skipped: user chose not to archive (if applicable)
134
+
135
+ 9. **Display summary**
136
+
137
+ Show final results:
138
+
139
+ ```
140
+ ## Bulk Archive Complete
141
+
142
+ Archived 3 changes:
143
+ - schema-management-cli -> archive/2026-01-19-schema-management-cli/
144
+ - project-config -> archive/2026-01-19-project-config/
145
+ - add-oauth -> archive/2026-01-19-add-oauth/
146
+
147
+ Skipped 1 change:
148
+ - add-verify-skill (user chose not to archive incomplete)
149
+
150
+ Spec sync summary:
151
+ - 4 delta specs synced to main specs
152
+ - 1 conflict resolved (auth: applied both in chronological order)
153
+ ```
154
+
155
+ If any failures:
156
+ ```
157
+ Failed 1 change:
158
+ - some-change: Archive directory already exists
159
+ ```
160
+
161
+ **Conflict Resolution Examples**
162
+
163
+ Example 1: Only one implemented
164
+ ```
165
+ Conflict: specs/auth/spec.md touched by [add-oauth, add-jwt]
166
+
167
+ Checking add-oauth:
168
+ - Delta adds "OAuth Provider Integration" requirement
169
+ - Searching codebase... found src/auth/oauth.ts implementing OAuth flow
170
+
171
+ Checking add-jwt:
172
+ - Delta adds "JWT Token Handling" requirement
173
+ - Searching codebase... no JWT implementation found
174
+
175
+ Resolution: Only add-oauth is implemented. Will sync add-oauth specs only.
176
+ ```
177
+
178
+ Example 2: Both implemented
179
+ ```
180
+ Conflict: specs/api/spec.md touched by [add-rest-api, add-graphql]
181
+
182
+ Checking add-rest-api (created 2026-01-10):
183
+ - Delta adds "REST Endpoints" requirement
184
+ - Searching codebase... found src/api/rest.ts
185
+
186
+ Checking add-graphql (created 2026-01-15):
187
+ - Delta adds "GraphQL Schema" requirement
188
+ - Searching codebase... found src/api/graphql.ts
189
+
190
+ Resolution: Both implemented. Will apply add-rest-api specs first,
191
+ then add-graphql specs (chronological order, newer takes precedence).
192
+ ```
193
+
194
+ **Output On Success**
195
+
196
+ ```
197
+ ## Bulk Archive Complete
198
+
199
+ Archived N changes:
200
+ - <change-1> -> archive/YYYY-MM-DD-<change-1>/
201
+ - <change-2> -> archive/YYYY-MM-DD-<change-2>/
202
+
203
+ Spec sync summary:
204
+ - N delta specs synced to main specs
205
+ - No conflicts (or: M conflicts resolved)
206
+ ```
207
+
208
+ **Output On Partial Success**
209
+
210
+ ```
211
+ ## Bulk Archive Complete (partial)
212
+
213
+ Archived N changes:
214
+ - <change-1> -> archive/YYYY-MM-DD-<change-1>/
215
+
216
+ Skipped M changes:
217
+ - <change-2> (user chose not to archive incomplete)
218
+
219
+ Failed K changes:
220
+ - <change-3>: Archive directory already exists
221
+ ```
222
+
223
+ **Output When No Changes**
224
+
225
+ ```
226
+ ## No Changes to Archive
227
+
228
+ No active changes found. Use `/opsx:new` to create a new change.
229
+ ```
230
+
231
+ **Guardrails**
232
+ - Allow any number of changes (1+ is fine, 2+ is the typical use case)
233
+ - Always prompt for selection, never auto-select
234
+ - Detect spec conflicts early and resolve by checking codebase
235
+ - When both changes are implemented, apply specs in chronological order
236
+ - Skip spec sync only when implementation is missing (warn user)
237
+ - Show clear per-change status before confirming
238
+ - Use single confirmation for entire batch
239
+ - Track and report all outcomes (success/skip/fail)
240
+ - Preserve .openspec.yaml when moving to archive
241
+ - Archive directory target uses current date: YYYY-MM-DD-<name>
242
+ - If archive target exists, fail that change but continue with others
@@ -0,0 +1,114 @@
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
+
37
+ 3. **Act based on status**:
38
+
39
+ ---
40
+
41
+ **If all artifacts are complete (`isComplete: true`)**:
42
+ - Congratulate the user
43
+ - Show final status including the schema used
44
+ - Suggest: "All artifacts created! You can now implement this change with `/opsx:apply` or archive it with `/opsx:archive`."
45
+ - STOP
46
+
47
+ ---
48
+
49
+ **If artifacts are ready to create** (status shows artifacts with `status: "ready"`):
50
+ - Pick the FIRST artifact with `status: "ready"` from the status output
51
+ - Get its instructions:
52
+ ```bash
53
+ openspec instructions <artifact-id> --change "<name>" --json
54
+ ```
55
+ - Parse the JSON. The key fields are:
56
+ - `context`: Project background (constraints for you - do NOT include in output)
57
+ - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
58
+ - `template`: The structure to use for your output file
59
+ - `instruction`: Schema-specific guidance
60
+ - `outputPath`: Where to write the artifact
61
+ - `dependencies`: Completed artifacts to read for context
62
+ - **Create the artifact file**:
63
+ - Read any completed dependency files for context
64
+ - Use `template` as the structure - fill in its sections
65
+ - Apply `context` and `rules` as constraints when writing - but do NOT copy them into the file
66
+ - Write to the output path specified in instructions
67
+ - Show what was created and what's now unlocked
68
+ - STOP after creating ONE artifact
69
+
70
+ ---
71
+
72
+ **If no artifacts are ready (all blocked)**:
73
+ - This shouldn't happen with a valid schema
74
+ - Show status and suggest checking for issues
75
+
76
+ 4. **After creating an artifact, show progress**
77
+ ```bash
78
+ openspec status --change "<name>"
79
+ ```
80
+
81
+ **Output**
82
+
83
+ After each invocation, show:
84
+ - Which artifact was created
85
+ - Schema workflow being used
86
+ - Current progress (N/M complete)
87
+ - What artifacts are now unlocked
88
+ - Prompt: "Run `/opsx:continue` to create the next artifact"
89
+
90
+ **Artifact Creation Guidelines**
91
+
92
+ The artifact types and their purpose depend on the schema. Use the `instruction` field from the instructions output to understand what to create.
93
+
94
+ Common artifact patterns:
95
+
96
+ **spec-driven schema** (proposal → specs → design → tasks):
97
+ - **proposal.md**: Ask user about the change if not clear. Fill in Why, What Changes, Capabilities, Impact.
98
+ - The Capabilities section is critical - each capability listed will need a spec file.
99
+ - **specs/<capability>/spec.md**: Create one spec per capability listed in the proposal's Capabilities section (use the capability name, not the change name).
100
+ - **design.md**: Document technical decisions, architecture, and implementation approach.
101
+ - **tasks.md**: Break down implementation into checkboxed tasks.
102
+
103
+ For other schemas, follow the `instruction` field from the CLI output.
104
+
105
+ **Guardrails**
106
+ - Create ONE artifact per invocation
107
+ - Always read dependency artifacts before creating a new one
108
+ - Never skip artifacts or create out of order
109
+ - If context is unclear, ask the user before creating
110
+ - Verify the artifact file exists after writing before marking progress
111
+ - Use the schema's artifact sequence, don't assume specific artifact names
112
+ - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
113
+ - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
114
+ - These guide what you write, but should never appear in the output