@exodus/openspec 1.2.0

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 (272) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +203 -0
  3. package/bin/openspec.js +3 -0
  4. package/dist/cli/index.d.ts +2 -0
  5. package/dist/cli/index.js +482 -0
  6. package/dist/commands/change.d.ts +35 -0
  7. package/dist/commands/change.js +277 -0
  8. package/dist/commands/completion.d.ts +72 -0
  9. package/dist/commands/completion.js +257 -0
  10. package/dist/commands/config.d.ts +36 -0
  11. package/dist/commands/config.js +552 -0
  12. package/dist/commands/feedback.d.ts +9 -0
  13. package/dist/commands/feedback.js +183 -0
  14. package/dist/commands/schema.d.ts +6 -0
  15. package/dist/commands/schema.js +869 -0
  16. package/dist/commands/show.d.ts +14 -0
  17. package/dist/commands/show.js +132 -0
  18. package/dist/commands/spec.d.ts +15 -0
  19. package/dist/commands/spec.js +225 -0
  20. package/dist/commands/validate.d.ts +24 -0
  21. package/dist/commands/validate.js +294 -0
  22. package/dist/commands/workflow/index.d.ts +17 -0
  23. package/dist/commands/workflow/index.js +12 -0
  24. package/dist/commands/workflow/instructions.d.ts +29 -0
  25. package/dist/commands/workflow/instructions.js +381 -0
  26. package/dist/commands/workflow/new-change.d.ts +11 -0
  27. package/dist/commands/workflow/new-change.js +44 -0
  28. package/dist/commands/workflow/schemas.d.ts +10 -0
  29. package/dist/commands/workflow/schemas.js +34 -0
  30. package/dist/commands/workflow/shared.d.ts +57 -0
  31. package/dist/commands/workflow/shared.js +116 -0
  32. package/dist/commands/workflow/status.d.ts +14 -0
  33. package/dist/commands/workflow/status.js +75 -0
  34. package/dist/commands/workflow/templates.d.ts +16 -0
  35. package/dist/commands/workflow/templates.js +68 -0
  36. package/dist/core/archive.d.ts +11 -0
  37. package/dist/core/archive.js +318 -0
  38. package/dist/core/artifact-graph/graph.d.ts +56 -0
  39. package/dist/core/artifact-graph/graph.js +141 -0
  40. package/dist/core/artifact-graph/index.d.ts +7 -0
  41. package/dist/core/artifact-graph/index.js +13 -0
  42. package/dist/core/artifact-graph/instruction-loader.d.ts +143 -0
  43. package/dist/core/artifact-graph/instruction-loader.js +214 -0
  44. package/dist/core/artifact-graph/resolver.d.ts +81 -0
  45. package/dist/core/artifact-graph/resolver.js +257 -0
  46. package/dist/core/artifact-graph/schema.d.ts +13 -0
  47. package/dist/core/artifact-graph/schema.js +108 -0
  48. package/dist/core/artifact-graph/state.d.ts +12 -0
  49. package/dist/core/artifact-graph/state.js +54 -0
  50. package/dist/core/artifact-graph/types.d.ts +45 -0
  51. package/dist/core/artifact-graph/types.js +43 -0
  52. package/dist/core/available-tools.d.ts +16 -0
  53. package/dist/core/available-tools.js +30 -0
  54. package/dist/core/command-generation/adapters/amazon-q.d.ts +13 -0
  55. package/dist/core/command-generation/adapters/amazon-q.js +26 -0
  56. package/dist/core/command-generation/adapters/antigravity.d.ts +13 -0
  57. package/dist/core/command-generation/adapters/antigravity.js +26 -0
  58. package/dist/core/command-generation/adapters/auggie.d.ts +13 -0
  59. package/dist/core/command-generation/adapters/auggie.js +27 -0
  60. package/dist/core/command-generation/adapters/claude.d.ts +13 -0
  61. package/dist/core/command-generation/adapters/claude.js +50 -0
  62. package/dist/core/command-generation/adapters/cline.d.ts +14 -0
  63. package/dist/core/command-generation/adapters/cline.js +27 -0
  64. package/dist/core/command-generation/adapters/codebuddy.d.ts +13 -0
  65. package/dist/core/command-generation/adapters/codebuddy.js +28 -0
  66. package/dist/core/command-generation/adapters/codex.d.ts +16 -0
  67. package/dist/core/command-generation/adapters/codex.js +39 -0
  68. package/dist/core/command-generation/adapters/continue.d.ts +13 -0
  69. package/dist/core/command-generation/adapters/continue.js +28 -0
  70. package/dist/core/command-generation/adapters/costrict.d.ts +13 -0
  71. package/dist/core/command-generation/adapters/costrict.js +27 -0
  72. package/dist/core/command-generation/adapters/crush.d.ts +13 -0
  73. package/dist/core/command-generation/adapters/crush.js +30 -0
  74. package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
  75. package/dist/core/command-generation/adapters/cursor.js +44 -0
  76. package/dist/core/command-generation/adapters/factory.d.ts +13 -0
  77. package/dist/core/command-generation/adapters/factory.js +27 -0
  78. package/dist/core/command-generation/adapters/gemini.d.ts +13 -0
  79. package/dist/core/command-generation/adapters/gemini.js +26 -0
  80. package/dist/core/command-generation/adapters/github-copilot.d.ts +13 -0
  81. package/dist/core/command-generation/adapters/github-copilot.js +26 -0
  82. package/dist/core/command-generation/adapters/iflow.d.ts +13 -0
  83. package/dist/core/command-generation/adapters/iflow.js +29 -0
  84. package/dist/core/command-generation/adapters/index.d.ts +29 -0
  85. package/dist/core/command-generation/adapters/index.js +29 -0
  86. package/dist/core/command-generation/adapters/kilocode.d.ts +14 -0
  87. package/dist/core/command-generation/adapters/kilocode.js +23 -0
  88. package/dist/core/command-generation/adapters/kiro.d.ts +13 -0
  89. package/dist/core/command-generation/adapters/kiro.js +26 -0
  90. package/dist/core/command-generation/adapters/opencode.d.ts +13 -0
  91. package/dist/core/command-generation/adapters/opencode.js +29 -0
  92. package/dist/core/command-generation/adapters/pi.d.ts +14 -0
  93. package/dist/core/command-generation/adapters/pi.js +41 -0
  94. package/dist/core/command-generation/adapters/qoder.d.ts +13 -0
  95. package/dist/core/command-generation/adapters/qoder.js +30 -0
  96. package/dist/core/command-generation/adapters/qwen.d.ts +13 -0
  97. package/dist/core/command-generation/adapters/qwen.js +26 -0
  98. package/dist/core/command-generation/adapters/roocode.d.ts +14 -0
  99. package/dist/core/command-generation/adapters/roocode.js +27 -0
  100. package/dist/core/command-generation/adapters/windsurf.d.ts +14 -0
  101. package/dist/core/command-generation/adapters/windsurf.js +51 -0
  102. package/dist/core/command-generation/generator.d.ts +21 -0
  103. package/dist/core/command-generation/generator.js +27 -0
  104. package/dist/core/command-generation/index.d.ts +22 -0
  105. package/dist/core/command-generation/index.js +24 -0
  106. package/dist/core/command-generation/registry.d.ts +36 -0
  107. package/dist/core/command-generation/registry.js +92 -0
  108. package/dist/core/command-generation/types.d.ts +56 -0
  109. package/dist/core/command-generation/types.js +8 -0
  110. package/dist/core/completions/command-registry.d.ts +7 -0
  111. package/dist/core/completions/command-registry.js +461 -0
  112. package/dist/core/completions/completion-provider.d.ts +60 -0
  113. package/dist/core/completions/completion-provider.js +102 -0
  114. package/dist/core/completions/factory.d.ts +64 -0
  115. package/dist/core/completions/factory.js +75 -0
  116. package/dist/core/completions/generators/bash-generator.d.ts +32 -0
  117. package/dist/core/completions/generators/bash-generator.js +174 -0
  118. package/dist/core/completions/generators/fish-generator.d.ts +32 -0
  119. package/dist/core/completions/generators/fish-generator.js +157 -0
  120. package/dist/core/completions/generators/powershell-generator.d.ts +33 -0
  121. package/dist/core/completions/generators/powershell-generator.js +207 -0
  122. package/dist/core/completions/generators/zsh-generator.d.ts +44 -0
  123. package/dist/core/completions/generators/zsh-generator.js +250 -0
  124. package/dist/core/completions/installers/bash-installer.d.ts +87 -0
  125. package/dist/core/completions/installers/bash-installer.js +318 -0
  126. package/dist/core/completions/installers/fish-installer.d.ts +43 -0
  127. package/dist/core/completions/installers/fish-installer.js +143 -0
  128. package/dist/core/completions/installers/powershell-installer.d.ts +88 -0
  129. package/dist/core/completions/installers/powershell-installer.js +327 -0
  130. package/dist/core/completions/installers/zsh-installer.d.ts +125 -0
  131. package/dist/core/completions/installers/zsh-installer.js +449 -0
  132. package/dist/core/completions/templates/bash-templates.d.ts +6 -0
  133. package/dist/core/completions/templates/bash-templates.js +24 -0
  134. package/dist/core/completions/templates/fish-templates.d.ts +7 -0
  135. package/dist/core/completions/templates/fish-templates.js +39 -0
  136. package/dist/core/completions/templates/powershell-templates.d.ts +6 -0
  137. package/dist/core/completions/templates/powershell-templates.js +25 -0
  138. package/dist/core/completions/templates/zsh-templates.d.ts +6 -0
  139. package/dist/core/completions/templates/zsh-templates.js +36 -0
  140. package/dist/core/completions/types.d.ts +79 -0
  141. package/dist/core/completions/types.js +2 -0
  142. package/dist/core/config-prompts.d.ts +9 -0
  143. package/dist/core/config-prompts.js +34 -0
  144. package/dist/core/config-schema.d.ts +86 -0
  145. package/dist/core/config-schema.js +213 -0
  146. package/dist/core/config.d.ts +17 -0
  147. package/dist/core/config.js +33 -0
  148. package/dist/core/converters/json-converter.d.ts +6 -0
  149. package/dist/core/converters/json-converter.js +51 -0
  150. package/dist/core/global-config.d.ts +44 -0
  151. package/dist/core/global-config.js +125 -0
  152. package/dist/core/index.d.ts +2 -0
  153. package/dist/core/index.js +3 -0
  154. package/dist/core/init.d.ts +38 -0
  155. package/dist/core/init.js +625 -0
  156. package/dist/core/legacy-cleanup.d.ts +162 -0
  157. package/dist/core/legacy-cleanup.js +512 -0
  158. package/dist/core/list.d.ts +9 -0
  159. package/dist/core/list.js +171 -0
  160. package/dist/core/migration.d.ts +23 -0
  161. package/dist/core/migration.js +108 -0
  162. package/dist/core/parsers/change-parser.d.ts +13 -0
  163. package/dist/core/parsers/change-parser.js +193 -0
  164. package/dist/core/parsers/markdown-parser.d.ts +22 -0
  165. package/dist/core/parsers/markdown-parser.js +187 -0
  166. package/dist/core/parsers/requirement-blocks.d.ts +37 -0
  167. package/dist/core/parsers/requirement-blocks.js +201 -0
  168. package/dist/core/profile-sync-drift.d.ts +38 -0
  169. package/dist/core/profile-sync-drift.js +200 -0
  170. package/dist/core/profiles.d.ts +26 -0
  171. package/dist/core/profiles.js +40 -0
  172. package/dist/core/project-config.d.ts +64 -0
  173. package/dist/core/project-config.js +223 -0
  174. package/dist/core/schemas/base.schema.d.ts +13 -0
  175. package/dist/core/schemas/base.schema.js +13 -0
  176. package/dist/core/schemas/change.schema.d.ts +73 -0
  177. package/dist/core/schemas/change.schema.js +31 -0
  178. package/dist/core/schemas/index.d.ts +4 -0
  179. package/dist/core/schemas/index.js +4 -0
  180. package/dist/core/schemas/spec.schema.d.ts +18 -0
  181. package/dist/core/schemas/spec.schema.js +15 -0
  182. package/dist/core/shared/index.d.ts +8 -0
  183. package/dist/core/shared/index.js +8 -0
  184. package/dist/core/shared/skill-generation.d.ts +49 -0
  185. package/dist/core/shared/skill-generation.js +96 -0
  186. package/dist/core/shared/tool-detection.d.ts +71 -0
  187. package/dist/core/shared/tool-detection.js +158 -0
  188. package/dist/core/specs-apply.d.ts +73 -0
  189. package/dist/core/specs-apply.js +384 -0
  190. package/dist/core/styles/palette.d.ts +7 -0
  191. package/dist/core/styles/palette.js +8 -0
  192. package/dist/core/templates/index.d.ts +8 -0
  193. package/dist/core/templates/index.js +9 -0
  194. package/dist/core/templates/skill-templates.d.ts +19 -0
  195. package/dist/core/templates/skill-templates.js +18 -0
  196. package/dist/core/templates/types.d.ts +19 -0
  197. package/dist/core/templates/types.js +5 -0
  198. package/dist/core/templates/workflows/apply-change.d.ts +10 -0
  199. package/dist/core/templates/workflows/apply-change.js +362 -0
  200. package/dist/core/templates/workflows/archive-change.d.ts +10 -0
  201. package/dist/core/templates/workflows/archive-change.js +331 -0
  202. package/dist/core/templates/workflows/bulk-archive-change.d.ts +10 -0
  203. package/dist/core/templates/workflows/bulk-archive-change.js +488 -0
  204. package/dist/core/templates/workflows/continue-change.d.ts +10 -0
  205. package/dist/core/templates/workflows/continue-change.js +232 -0
  206. package/dist/core/templates/workflows/explore.d.ts +10 -0
  207. package/dist/core/templates/workflows/explore.js +527 -0
  208. package/dist/core/templates/workflows/feedback.d.ts +9 -0
  209. package/dist/core/templates/workflows/feedback.js +108 -0
  210. package/dist/core/templates/workflows/ff-change.d.ts +10 -0
  211. package/dist/core/templates/workflows/ff-change.js +198 -0
  212. package/dist/core/templates/workflows/new-change.d.ts +10 -0
  213. package/dist/core/templates/workflows/new-change.js +143 -0
  214. package/dist/core/templates/workflows/onboard.d.ts +10 -0
  215. package/dist/core/templates/workflows/onboard.js +565 -0
  216. package/dist/core/templates/workflows/propose.d.ts +10 -0
  217. package/dist/core/templates/workflows/propose.js +306 -0
  218. package/dist/core/templates/workflows/sync-specs.d.ts +10 -0
  219. package/dist/core/templates/workflows/sync-specs.js +272 -0
  220. package/dist/core/templates/workflows/verify-change.d.ts +10 -0
  221. package/dist/core/templates/workflows/verify-change.js +332 -0
  222. package/dist/core/update.d.ts +77 -0
  223. package/dist/core/update.js +537 -0
  224. package/dist/core/validation/constants.d.ts +34 -0
  225. package/dist/core/validation/constants.js +40 -0
  226. package/dist/core/validation/types.d.ts +18 -0
  227. package/dist/core/validation/types.js +2 -0
  228. package/dist/core/validation/validator.d.ts +33 -0
  229. package/dist/core/validation/validator.js +409 -0
  230. package/dist/core/view.d.ts +8 -0
  231. package/dist/core/view.js +168 -0
  232. package/dist/core/workspace.d.ts +18 -0
  233. package/dist/core/workspace.js +103 -0
  234. package/dist/index.d.ts +3 -0
  235. package/dist/index.js +3 -0
  236. package/dist/prompts/searchable-multi-select.d.ts +28 -0
  237. package/dist/prompts/searchable-multi-select.js +159 -0
  238. package/dist/telemetry/config.d.ts +32 -0
  239. package/dist/telemetry/config.js +68 -0
  240. package/dist/telemetry/index.d.ts +31 -0
  241. package/dist/telemetry/index.js +145 -0
  242. package/dist/ui/ascii-patterns.d.ts +16 -0
  243. package/dist/ui/ascii-patterns.js +133 -0
  244. package/dist/ui/welcome-screen.d.ts +10 -0
  245. package/dist/ui/welcome-screen.js +146 -0
  246. package/dist/utils/change-metadata.d.ts +51 -0
  247. package/dist/utils/change-metadata.js +147 -0
  248. package/dist/utils/change-utils.d.ts +62 -0
  249. package/dist/utils/change-utils.js +121 -0
  250. package/dist/utils/command-references.d.ts +18 -0
  251. package/dist/utils/command-references.js +20 -0
  252. package/dist/utils/file-system.d.ts +36 -0
  253. package/dist/utils/file-system.js +281 -0
  254. package/dist/utils/index.d.ts +6 -0
  255. package/dist/utils/index.js +9 -0
  256. package/dist/utils/interactive.d.ts +18 -0
  257. package/dist/utils/interactive.js +21 -0
  258. package/dist/utils/item-discovery.d.ts +4 -0
  259. package/dist/utils/item-discovery.js +72 -0
  260. package/dist/utils/match.d.ts +3 -0
  261. package/dist/utils/match.js +22 -0
  262. package/dist/utils/shell-detection.d.ts +20 -0
  263. package/dist/utils/shell-detection.js +41 -0
  264. package/dist/utils/task-progress.d.ts +8 -0
  265. package/dist/utils/task-progress.js +36 -0
  266. package/package.json +83 -0
  267. package/schemas/spec-driven/schema.yaml +153 -0
  268. package/schemas/spec-driven/templates/design.md +19 -0
  269. package/schemas/spec-driven/templates/proposal.md +23 -0
  270. package/schemas/spec-driven/templates/spec.md +8 -0
  271. package/schemas/spec-driven/templates/tasks.md +9 -0
  272. package/scripts/postinstall.js +147 -0
@@ -0,0 +1,306 @@
1
+ export function getOpsxProposeSkillTemplate() {
2
+ return {
3
+ name: 'openspec-propose',
4
+ description: 'Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.',
5
+ instructions: `Propose a new change - create the change and generate all artifacts in one step.
6
+
7
+ I'll create a change with artifacts:
8
+ - proposal.md (what & why)
9
+ - design.md (how)
10
+ - tasks.md (implementation steps)
11
+
12
+ When ready to implement, run /opsx:apply
13
+
14
+ ---
15
+
16
+ **Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
17
+
18
+ **Steps**
19
+
20
+ 1. **If no clear input provided, ask what they want to build**
21
+
22
+ Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
23
+ > "What change do you want to work on? Describe what you want to build or fix."
24
+
25
+ From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
26
+
27
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
28
+
29
+ 2. **Determine if this is a single-scope or cross-scope change**
30
+
31
+ Check for a workspace manifest:
32
+ \`\`\`bash
33
+ cat openspec/workspace.yaml 2>/dev/null
34
+ \`\`\`
35
+
36
+ If workspace.yaml exists:
37
+ - Based on the description, ask: "Does this change touch more than one scope?"
38
+ - If **single scope**: ask which scope (show list from workspace.yaml). Store as \`<workspace>\`. Continue to step 3.
39
+ - If **cross-scope (umbrella)**: jump to **Umbrella Flow** section below.
40
+
41
+ If no workspace.yaml (single-project):
42
+ - \`<workspace>\` is the current directory. Skip to step 3.
43
+
44
+ All \`openspec\` commands must be run as:
45
+ \`\`\`bash
46
+ (cd <workspace> && openspec ...)
47
+ \`\`\`
48
+
49
+ 3. **Create the change directory**
50
+ \`\`\`bash
51
+ (cd <workspace> && openspec new change "<name>")
52
+ \`\`\`
53
+ This creates a scaffolded change at \`<workspace>/openspec/changes/<name>/\` with \`.openspec.yaml\`.
54
+
55
+ 4. **Get the artifact build order**
56
+ \`\`\`bash
57
+ (cd <workspace> && openspec status --change "<name>" --json)
58
+ \`\`\`
59
+ Parse the JSON to get:
60
+ - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`)
61
+ - \`artifacts\`: list of all artifacts with their status and dependencies
62
+
63
+ 5. **Create artifacts in sequence until apply-ready**
64
+
65
+ Use the **TodoWrite tool** to track progress through the artifacts.
66
+
67
+ Loop through artifacts in dependency order (artifacts with no pending dependencies first):
68
+
69
+ a. **For each artifact that is \`ready\` (dependencies satisfied)**:
70
+ - Get instructions:
71
+ \`\`\`bash
72
+ (cd <workspace> && openspec instructions <artifact-id> --change "<name>" --json)
73
+ \`\`\`
74
+ - The instructions JSON includes:
75
+ - \`context\`: Project background (constraints for you - do NOT include in output)
76
+ - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
77
+ - \`template\`: The structure to use for your output file
78
+ - \`instruction\`: Schema-specific guidance for this artifact type
79
+ - \`outputPath\`: Where to write the artifact
80
+ - \`dependencies\`: Completed artifacts to read for context
81
+ - Read any completed dependency files for context
82
+ - Create the artifact file using \`template\` as the structure
83
+ - Apply \`context\` and \`rules\` as constraints - but do NOT copy them into the file
84
+ - Show brief progress: "Created <artifact-id>"
85
+
86
+ b. **Continue until all \`applyRequires\` artifacts are complete**
87
+ - After creating each artifact, re-run \`(cd <workspace> && openspec status --change "<name>" --json)\`
88
+ - Check if every artifact ID in \`applyRequires\` has \`status: "done"\` in the artifacts array
89
+ - Stop when all \`applyRequires\` artifacts are done
90
+
91
+ c. **If an artifact requires user input** (unclear context):
92
+ - Use **AskUserQuestion tool** to clarify
93
+ - Then continue with creation
94
+
95
+ 6. **Show final status**
96
+ \`\`\`bash
97
+ (cd <workspace> && openspec status --change "<name>")
98
+ \`\`\`
99
+
100
+ **Output**
101
+
102
+ After completing all artifacts, summarize:
103
+ - Change name and location
104
+ - List of artifacts created with brief descriptions
105
+ - What's ready: "All artifacts created! Ready for implementation."
106
+ - Prompt: "Run \`/opsx:apply\` or ask me to implement to start working on the tasks."
107
+
108
+ **Artifact Creation Guidelines**
109
+
110
+ - Follow the \`instruction\` field from \`openspec instructions\` for each artifact type
111
+ - The schema defines what each artifact should contain - follow it
112
+ - Read dependency artifacts for context before creating new ones
113
+ - Use \`template\` as the structure for your output file - fill in its sections
114
+ - **IMPORTANT**: \`context\` and \`rules\` are constraints for YOU, not content for the file
115
+ - Do NOT copy \`<context>\`, \`<rules>\`, \`<project_context>\` blocks into the artifact
116
+ - These guide what you write, but should never appear in the output
117
+
118
+ ## Umbrella Flow *(cross-scope changes only)*
119
+
120
+ 1. **Confirm which scopes are involved** using AskUserQuestion tool.
121
+
122
+ 2. **Create the umbrella directory**
123
+ \`\`\`bash
124
+ mkdir -p openspec/changes/<name>
125
+ \`\`\`
126
+
127
+ 3. **Write \`openspec/changes/<name>/links.yaml\`**
128
+ \`\`\`yaml
129
+ scopes:
130
+ - name: <scope-a>
131
+ path: <scope-a.path>
132
+ - name: <scope-b>
133
+ path: <scope-b.path>
134
+ \`\`\`
135
+
136
+ 4. **Write \`openspec/changes/<name>/proposal.md\`** — cross-cutting description covering what, why, which scopes, any shared contracts.
137
+
138
+ 5. **Create per-scope changes**: for each scope, run \`(cd <scope.path> && openspec new change "<name>")\` and generate all artifacts following steps 3-6 of the standard flow. Complete one scope before the next.
139
+
140
+ 6. **Show completion summary** with umbrella location and per-scope change locations.
141
+
142
+ **Guardrails**
143
+ - For umbrella changes, always create umbrella directory and links.yaml before per-scope changes
144
+ - Create ALL artifacts needed for implementation (as defined by schema's \`apply.requires\`)
145
+ - Always read dependency artifacts before creating a new one
146
+ - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
147
+ - If a change with that name already exists, ask if user wants to continue it or create a new one
148
+ - Verify each artifact file exists after writing before proceeding to next`,
149
+ license: 'MIT',
150
+ compatibility: 'Requires openspec CLI.',
151
+ metadata: { author: 'openspec', version: '1.0' },
152
+ };
153
+ }
154
+ export function getOpsxProposeCommandTemplate() {
155
+ return {
156
+ name: 'OPSX: Propose',
157
+ description: 'Propose a new change - create it and generate all artifacts in one step',
158
+ category: 'Workflow',
159
+ tags: ['workflow', 'artifacts', 'experimental'],
160
+ content: `Propose a new change - create the change and generate all artifacts in one step.
161
+
162
+ I'll create a change with artifacts:
163
+ - proposal.md (what & why)
164
+ - design.md (how)
165
+ - tasks.md (implementation steps)
166
+
167
+ When ready to implement, run /opsx:apply
168
+
169
+ ---
170
+
171
+ **Input**: The argument after \`/opsx:propose\` is the change name (kebab-case), OR a description of what the user wants to build.
172
+
173
+ **Steps**
174
+
175
+ 1. **If no input provided, ask what they want to build**
176
+
177
+ Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
178
+ > "What change do you want to work on? Describe what you want to build or fix."
179
+
180
+ From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
181
+
182
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
183
+
184
+ 2. **Determine if this is a single-scope or cross-scope change**
185
+
186
+ Check for a workspace manifest:
187
+ \`\`\`bash
188
+ cat openspec/workspace.yaml 2>/dev/null
189
+ \`\`\`
190
+
191
+ If workspace.yaml exists:
192
+ - Based on the description, ask: "Does this change touch more than one scope?"
193
+ - If **single scope**: ask which scope (show list from workspace.yaml). Store as \`<workspace>\`. Continue to step 3.
194
+ - If **cross-scope (umbrella)**: jump to **Umbrella Flow** section below.
195
+
196
+ If no workspace.yaml (single-project):
197
+ - \`<workspace>\` is the current directory. Skip to step 3.
198
+
199
+ All \`openspec\` commands must be run as:
200
+ \`\`\`bash
201
+ (cd <workspace> && openspec ...)
202
+ \`\`\`
203
+
204
+ 3. **Create the change directory**
205
+ \`\`\`bash
206
+ (cd <workspace> && openspec new change "<name>")
207
+ \`\`\`
208
+ This creates a scaffolded change at \`<workspace>/openspec/changes/<name>/\` with \`.openspec.yaml\`.
209
+
210
+ 4. **Get the artifact build order**
211
+ \`\`\`bash
212
+ (cd <workspace> && openspec status --change "<name>" --json)
213
+ \`\`\`
214
+ Parse the JSON to get:
215
+ - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`)
216
+ - \`artifacts\`: list of all artifacts with their status and dependencies
217
+
218
+ 5. **Create artifacts in sequence until apply-ready**
219
+
220
+ Use the **TodoWrite tool** to track progress through the artifacts.
221
+
222
+ Loop through artifacts in dependency order (artifacts with no pending dependencies first):
223
+
224
+ a. **For each artifact that is \`ready\` (dependencies satisfied)**:
225
+ - Get instructions:
226
+ \`\`\`bash
227
+ (cd <workspace> && openspec instructions <artifact-id> --change "<name>" --json)
228
+ \`\`\`
229
+ - The instructions JSON includes:
230
+ - \`context\`: Project background (constraints for you - do NOT include in output)
231
+ - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
232
+ - \`template\`: The structure to use for your output file
233
+ - \`instruction\`: Schema-specific guidance for this artifact type
234
+ - \`outputPath\`: Where to write the artifact
235
+ - \`dependencies\`: Completed artifacts to read for context
236
+ - Read any completed dependency files for context
237
+ - Create the artifact file using \`template\` as the structure
238
+ - Apply \`context\` and \`rules\` as constraints - but do NOT copy them into the file
239
+ - Show brief progress: "Created <artifact-id>"
240
+
241
+ b. **Continue until all \`applyRequires\` artifacts are complete**
242
+ - After creating each artifact, re-run \`(cd <workspace> && openspec status --change "<name>" --json)\`
243
+ - Check if every artifact ID in \`applyRequires\` has \`status: "done"\` in the artifacts array
244
+ - Stop when all \`applyRequires\` artifacts are done
245
+
246
+ c. **If an artifact requires user input** (unclear context):
247
+ - Use **AskUserQuestion tool** to clarify
248
+ - Then continue with creation
249
+
250
+ 6. **Show final status**
251
+ \`\`\`bash
252
+ (cd <workspace> && openspec status --change "<name>")
253
+ \`\`\`
254
+
255
+ **Output**
256
+
257
+ After completing all artifacts, summarize:
258
+ - Change name and location
259
+ - List of artifacts created with brief descriptions
260
+ - What's ready: "All artifacts created! Ready for implementation."
261
+ - Prompt: "Run \`/opsx:apply\` to start implementing."
262
+
263
+ **Artifact Creation Guidelines**
264
+
265
+ - Follow the \`instruction\` field from \`openspec instructions\` for each artifact type
266
+ - The schema defines what each artifact should contain - follow it
267
+ - Read dependency artifacts for context before creating new ones
268
+ - Use \`template\` as the structure for your output file - fill in its sections
269
+ - **IMPORTANT**: \`context\` and \`rules\` are constraints for YOU, not content for the file
270
+ - Do NOT copy \`<context>\`, \`<rules>\`, \`<project_context>\` blocks into the artifact
271
+ - These guide what you write, but should never appear in the output
272
+
273
+ ## Umbrella Flow *(cross-scope changes only)*
274
+
275
+ 1. **Confirm which scopes are involved** using AskUserQuestion tool.
276
+
277
+ 2. **Create the umbrella directory**
278
+ \`\`\`bash
279
+ mkdir -p openspec/changes/<name>
280
+ \`\`\`
281
+
282
+ 3. **Write \`openspec/changes/<name>/links.yaml\`**
283
+ \`\`\`yaml
284
+ scopes:
285
+ - name: <scope-a>
286
+ path: <scope-a.path>
287
+ - name: <scope-b>
288
+ path: <scope-b.path>
289
+ \`\`\`
290
+
291
+ 4. **Write \`openspec/changes/<name>/proposal.md\`** — cross-cutting description covering what, why, which scopes, any shared contracts.
292
+
293
+ 5. **Create per-scope changes**: for each scope, run \`(cd <scope.path> && openspec new change "<name>")\` and generate all artifacts following steps 3-6 of the standard flow. Complete one scope before the next.
294
+
295
+ 6. **Show completion summary** with umbrella location and per-scope change locations.
296
+
297
+ **Guardrails**
298
+ - For umbrella changes, always create umbrella directory and links.yaml before per-scope changes
299
+ - Create ALL artifacts needed for implementation (as defined by schema's \`apply.requires\`)
300
+ - Always read dependency artifacts before creating a new one
301
+ - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
302
+ - If a change with that name already exists, ask if user wants to continue it or create a new one
303
+ - Verify each artifact file exists after writing before proceeding to next`
304
+ };
305
+ }
306
+ //# sourceMappingURL=propose.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Skill Template Workflow Modules
3
+ *
4
+ * This file is generated by splitting the legacy monolithic
5
+ * templates file into workflow-focused modules.
6
+ */
7
+ import type { SkillTemplate, CommandTemplate } from '../types.js';
8
+ export declare function getSyncSpecsSkillTemplate(): SkillTemplate;
9
+ export declare function getOpsxSyncCommandTemplate(): CommandTemplate;
10
+ //# sourceMappingURL=sync-specs.d.ts.map
@@ -0,0 +1,272 @@
1
+ export function getSyncSpecsSkillTemplate() {
2
+ return {
3
+ name: 'openspec-sync-specs',
4
+ description: 'Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.',
5
+ instructions: `Sync delta specs from a change to main specs.
6
+
7
+ This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
8
+
9
+ **Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
10
+
11
+ **Steps**
12
+
13
+ 1. **If no change name provided, prompt for selection**
14
+
15
+ Run \`openspec list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
16
+
17
+ Show changes that have delta specs (under \`specs/\` directory).
18
+
19
+ **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
20
+
21
+ 2. **Find delta specs**
22
+
23
+ Look for delta spec files in \`openspec/changes/<name>/specs/*/spec.md\`.
24
+
25
+ Each delta spec file contains sections like:
26
+ - \`## ADDED Requirements\` - New requirements to add
27
+ - \`## MODIFIED Requirements\` - Changes to existing requirements
28
+ - \`## REMOVED Requirements\` - Requirements to remove
29
+ - \`## RENAMED Requirements\` - Requirements to rename (FROM:/TO: format)
30
+
31
+ If no delta specs found, inform user and stop.
32
+
33
+ 3. **For each delta spec, apply changes to main specs**
34
+
35
+ For each capability with a delta spec at \`openspec/changes/<name>/specs/<capability>/spec.md\`:
36
+
37
+ a. **Read the delta spec** to understand the intended changes
38
+
39
+ b. **Read the main spec** at \`openspec/specs/<capability>/spec.md\` (may not exist yet)
40
+
41
+ c. **Apply changes intelligently**:
42
+
43
+ **ADDED Requirements:**
44
+ - If requirement doesn't exist in main spec → add it
45
+ - If requirement already exists → update it to match (treat as implicit MODIFIED)
46
+
47
+ **MODIFIED Requirements:**
48
+ - Find the requirement in main spec
49
+ - Apply the changes - this can be:
50
+ - Adding new scenarios (don't need to copy existing ones)
51
+ - Modifying existing scenarios
52
+ - Changing the requirement description
53
+ - Preserve scenarios/content not mentioned in the delta
54
+
55
+ **REMOVED Requirements:**
56
+ - Remove the entire requirement block from main spec
57
+
58
+ **RENAMED Requirements:**
59
+ - Find the FROM requirement, rename to TO
60
+
61
+ d. **Create new main spec** if capability doesn't exist yet:
62
+ - Create \`openspec/specs/<capability>/spec.md\`
63
+ - Add Purpose section (can be brief, mark as TBD)
64
+ - Add Requirements section with the ADDED requirements
65
+
66
+ 4. **Show summary**
67
+
68
+ After applying all changes, summarize:
69
+ - Which capabilities were updated
70
+ - What changes were made (requirements added/modified/removed/renamed)
71
+
72
+ **Delta Spec Format Reference**
73
+
74
+ \`\`\`markdown
75
+ ## ADDED Requirements
76
+
77
+ ### Requirement: New Feature
78
+ The system SHALL do something new.
79
+
80
+ #### Scenario: Basic case
81
+ - **WHEN** user does X
82
+ - **THEN** system does Y
83
+
84
+ ## MODIFIED Requirements
85
+
86
+ ### Requirement: Existing Feature
87
+ #### Scenario: New scenario to add
88
+ - **WHEN** user does A
89
+ - **THEN** system does B
90
+
91
+ ## REMOVED Requirements
92
+
93
+ ### Requirement: Deprecated Feature
94
+
95
+ ## RENAMED Requirements
96
+
97
+ - FROM: \`### Requirement: Old Name\`
98
+ - TO: \`### Requirement: New Name\`
99
+ \`\`\`
100
+
101
+ **Key Principle: Intelligent Merging**
102
+
103
+ Unlike programmatic merging, you can apply **partial updates**:
104
+ - To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios
105
+ - The delta represents *intent*, not a wholesale replacement
106
+ - Use your judgment to merge changes sensibly
107
+
108
+ **Output On Success**
109
+
110
+ \`\`\`
111
+ ## Specs Synced: <change-name>
112
+
113
+ Updated main specs:
114
+
115
+ **<capability-1>**:
116
+ - Added requirement: "New Feature"
117
+ - Modified requirement: "Existing Feature" (added 1 scenario)
118
+
119
+ **<capability-2>**:
120
+ - Created new spec file
121
+ - Added requirement: "Another Feature"
122
+
123
+ Main specs are now updated. The change remains active - archive when implementation is complete.
124
+ \`\`\`
125
+
126
+ **Guardrails**
127
+ - Read both delta and main specs before making changes
128
+ - Preserve existing content not mentioned in delta
129
+ - If something is unclear, ask for clarification
130
+ - Show what you're changing as you go
131
+ - The operation should be idempotent - running twice should give same result`,
132
+ license: 'MIT',
133
+ compatibility: 'Requires openspec CLI.',
134
+ metadata: { author: 'openspec', version: '1.0' },
135
+ };
136
+ }
137
+ export function getOpsxSyncCommandTemplate() {
138
+ return {
139
+ name: 'OPSX: Sync',
140
+ description: 'Sync delta specs from a change to main specs',
141
+ category: 'Workflow',
142
+ tags: ['workflow', 'specs', 'experimental'],
143
+ content: `Sync delta specs from a change to main specs.
144
+
145
+ This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
146
+
147
+ **Input**: Optionally specify a change name after \`/opsx:sync\` (e.g., \`/opsx:sync add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
148
+
149
+ **Steps**
150
+
151
+ 1. **If no change name provided, prompt for selection**
152
+
153
+ Run \`openspec list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
154
+
155
+ Show changes that have delta specs (under \`specs/\` directory).
156
+
157
+ **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
158
+
159
+ 2. **Find delta specs**
160
+
161
+ Look for delta spec files in \`openspec/changes/<name>/specs/*/spec.md\`.
162
+
163
+ Each delta spec file contains sections like:
164
+ - \`## ADDED Requirements\` - New requirements to add
165
+ - \`## MODIFIED Requirements\` - Changes to existing requirements
166
+ - \`## REMOVED Requirements\` - Requirements to remove
167
+ - \`## RENAMED Requirements\` - Requirements to rename (FROM:/TO: format)
168
+
169
+ If no delta specs found, inform user and stop.
170
+
171
+ 3. **For each delta spec, apply changes to main specs**
172
+
173
+ For each capability with a delta spec at \`openspec/changes/<name>/specs/<capability>/spec.md\`:
174
+
175
+ a. **Read the delta spec** to understand the intended changes
176
+
177
+ b. **Read the main spec** at \`openspec/specs/<capability>/spec.md\` (may not exist yet)
178
+
179
+ c. **Apply changes intelligently**:
180
+
181
+ **ADDED Requirements:**
182
+ - If requirement doesn't exist in main spec → add it
183
+ - If requirement already exists → update it to match (treat as implicit MODIFIED)
184
+
185
+ **MODIFIED Requirements:**
186
+ - Find the requirement in main spec
187
+ - Apply the changes - this can be:
188
+ - Adding new scenarios (don't need to copy existing ones)
189
+ - Modifying existing scenarios
190
+ - Changing the requirement description
191
+ - Preserve scenarios/content not mentioned in the delta
192
+
193
+ **REMOVED Requirements:**
194
+ - Remove the entire requirement block from main spec
195
+
196
+ **RENAMED Requirements:**
197
+ - Find the FROM requirement, rename to TO
198
+
199
+ d. **Create new main spec** if capability doesn't exist yet:
200
+ - Create \`openspec/specs/<capability>/spec.md\`
201
+ - Add Purpose section (can be brief, mark as TBD)
202
+ - Add Requirements section with the ADDED requirements
203
+
204
+ 4. **Show summary**
205
+
206
+ After applying all changes, summarize:
207
+ - Which capabilities were updated
208
+ - What changes were made (requirements added/modified/removed/renamed)
209
+
210
+ **Delta Spec Format Reference**
211
+
212
+ \`\`\`markdown
213
+ ## ADDED Requirements
214
+
215
+ ### Requirement: New Feature
216
+ The system SHALL do something new.
217
+
218
+ #### Scenario: Basic case
219
+ - **WHEN** user does X
220
+ - **THEN** system does Y
221
+
222
+ ## MODIFIED Requirements
223
+
224
+ ### Requirement: Existing Feature
225
+ #### Scenario: New scenario to add
226
+ - **WHEN** user does A
227
+ - **THEN** system does B
228
+
229
+ ## REMOVED Requirements
230
+
231
+ ### Requirement: Deprecated Feature
232
+
233
+ ## RENAMED Requirements
234
+
235
+ - FROM: \`### Requirement: Old Name\`
236
+ - TO: \`### Requirement: New Name\`
237
+ \`\`\`
238
+
239
+ **Key Principle: Intelligent Merging**
240
+
241
+ Unlike programmatic merging, you can apply **partial updates**:
242
+ - To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios
243
+ - The delta represents *intent*, not a wholesale replacement
244
+ - Use your judgment to merge changes sensibly
245
+
246
+ **Output On Success**
247
+
248
+ \`\`\`
249
+ ## Specs Synced: <change-name>
250
+
251
+ Updated main specs:
252
+
253
+ **<capability-1>**:
254
+ - Added requirement: "New Feature"
255
+ - Modified requirement: "Existing Feature" (added 1 scenario)
256
+
257
+ **<capability-2>**:
258
+ - Created new spec file
259
+ - Added requirement: "Another Feature"
260
+
261
+ Main specs are now updated. The change remains active - archive when implementation is complete.
262
+ \`\`\`
263
+
264
+ **Guardrails**
265
+ - Read both delta and main specs before making changes
266
+ - Preserve existing content not mentioned in delta
267
+ - If something is unclear, ask for clarification
268
+ - Show what you're changing as you go
269
+ - The operation should be idempotent - running twice should give same result`
270
+ };
271
+ }
272
+ //# sourceMappingURL=sync-specs.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Skill Template Workflow Modules
3
+ *
4
+ * This file is generated by splitting the legacy monolithic
5
+ * templates file into workflow-focused modules.
6
+ */
7
+ import type { SkillTemplate, CommandTemplate } from '../types.js';
8
+ export declare function getVerifyChangeSkillTemplate(): SkillTemplate;
9
+ export declare function getOpsxVerifyCommandTemplate(): CommandTemplate;
10
+ //# sourceMappingURL=verify-change.d.ts.map