@codewalla_india/openspec 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -22
- package/README.md +272 -191
- package/bin/openspec.js +5 -5
- package/dist/cli/index.js +99 -62
- package/dist/commands/change.d.ts +0 -2
- package/dist/commands/change.js +107 -86
- package/dist/commands/config.js +14 -16
- package/dist/commands/doctor.js +9 -4
- package/dist/commands/feedback.js +79 -30
- package/dist/commands/modify.d.ts +26 -0
- package/dist/commands/modify.js +147 -0
- package/dist/commands/schema.js +170 -91
- package/dist/commands/show.js +5 -2
- package/dist/commands/spec.js +49 -29
- package/dist/commands/store.js +15 -21
- package/dist/commands/validate.d.ts +8 -0
- package/dist/commands/validate.js +43 -20
- package/dist/commands/workflow/index.d.ts +2 -2
- package/dist/commands/workflow/index.js +1 -1
- package/dist/commands/workflow/instructions.d.ts +6 -26
- package/dist/commands/workflow/instructions.js +183 -376
- package/dist/commands/workflow/new-change.d.ts +0 -4
- package/dist/commands/workflow/new-change.js +10 -28
- package/dist/commands/workflow/shared.d.ts +34 -19
- package/dist/commands/workflow/shared.js +34 -4
- package/dist/commands/workflow/status.js +10 -32
- package/dist/commands/workflow/templates.js +15 -5
- package/dist/commands/workset.d.ts +2 -2
- package/dist/commands/workset.js +19 -22
- package/dist/comprehension-quiz/fingerprint.d.ts +39 -0
- package/dist/comprehension-quiz/fingerprint.js +84 -0
- package/dist/comprehension-quiz/index.d.ts +42 -0
- package/dist/comprehension-quiz/index.js +47 -0
- package/dist/comprehension-quiz/pass-record.d.ts +44 -0
- package/dist/comprehension-quiz/pass-record.js +98 -0
- package/dist/comprehension-quiz/providers/anthropic.d.ts +34 -0
- package/dist/comprehension-quiz/providers/anthropic.js +53 -0
- package/dist/comprehension-quiz/providers/factory.d.ts +44 -0
- package/dist/comprehension-quiz/providers/factory.js +174 -0
- package/dist/comprehension-quiz/providers/interface.d.ts +59 -0
- package/dist/comprehension-quiz/providers/interface.js +63 -0
- package/dist/comprehension-quiz/providers/local.d.ts +34 -0
- package/dist/comprehension-quiz/providers/local.js +53 -0
- package/dist/comprehension-quiz/providers/ollama.d.ts +34 -0
- package/dist/comprehension-quiz/providers/ollama.js +53 -0
- package/dist/comprehension-quiz/providers/openai.d.ts +34 -0
- package/dist/comprehension-quiz/providers/openai.js +53 -0
- package/dist/comprehension-quiz/question-generator.d.ts +69 -0
- package/dist/comprehension-quiz/question-generator.js +141 -0
- package/dist/comprehension-quiz/quiz-executor.d.ts +70 -0
- package/dist/comprehension-quiz/quiz-executor.js +165 -0
- package/dist/comprehension-quiz/types.d.ts +115 -0
- package/dist/comprehension-quiz/types.js +11 -0
- package/dist/core/archive.d.ts +14 -1
- package/dist/core/archive.js +1350 -190
- package/dist/core/artifact-graph/graph.d.ts +28 -9
- package/dist/core/artifact-graph/graph.js +94 -43
- package/dist/core/artifact-graph/index.d.ts +1 -1
- package/dist/core/artifact-graph/index.js +1 -1
- package/dist/core/artifact-graph/instruction-loader.d.ts +30 -3
- package/dist/core/artifact-graph/instruction-loader.js +70 -12
- package/dist/core/artifact-graph/outputs.d.ts +1 -0
- package/dist/core/artifact-graph/outputs.js +67 -5
- package/dist/core/artifact-graph/resolver.d.ts +14 -0
- package/dist/core/artifact-graph/resolver.js +69 -15
- package/dist/core/artifact-graph/types.js +21 -3
- package/dist/core/available-tools.d.ts +2 -2
- package/dist/core/available-tools.js +14 -3
- package/dist/core/change-metadata/schema.d.ts +2 -0
- package/dist/core/change-metadata/schema.js +13 -0
- package/dist/core/change-status-policy.d.ts +10 -1
- package/dist/core/change-status-policy.js +30 -2
- package/dist/core/command-generation/adapters/amazon-q.d.ts +4 -0
- package/dist/core/command-generation/adapters/amazon-q.js +11 -5
- package/dist/core/command-generation/adapters/antigravity.js +6 -5
- package/dist/core/command-generation/adapters/auggie.js +7 -6
- package/dist/core/command-generation/adapters/bob.d.ts +5 -1
- package/dist/core/command-generation/adapters/bob.js +11 -10
- package/dist/core/command-generation/adapters/claude.d.ts +1 -1
- package/dist/core/command-generation/adapters/claude.js +12 -17
- package/dist/core/command-generation/adapters/cline.js +5 -5
- package/dist/core/command-generation/adapters/codebuddy.js +8 -7
- package/dist/core/command-generation/adapters/continue.js +8 -7
- package/dist/core/command-generation/adapters/costrict.js +7 -6
- package/dist/core/command-generation/adapters/crush.js +9 -9
- package/dist/core/command-generation/adapters/cursor.js +8 -8
- package/dist/core/command-generation/adapters/devin.d.ts +19 -0
- package/dist/core/command-generation/adapters/devin.js +36 -0
- package/dist/core/command-generation/adapters/factory.js +7 -6
- package/dist/core/command-generation/adapters/gemini.js +40 -5
- package/dist/core/command-generation/adapters/github-copilot.js +6 -5
- package/dist/core/command-generation/adapters/iflow.js +9 -8
- package/dist/core/command-generation/adapters/index.d.ts +4 -2
- package/dist/core/command-generation/adapters/index.js +4 -2
- package/dist/core/command-generation/adapters/junie.js +6 -5
- package/dist/core/command-generation/adapters/kilocode.js +1 -1
- package/dist/core/command-generation/adapters/kiro.js +6 -5
- package/dist/core/command-generation/adapters/lingma.js +9 -9
- package/dist/core/command-generation/adapters/oh-my-pi.d.ts +21 -0
- package/dist/core/command-generation/adapters/oh-my-pi.js +42 -0
- package/dist/core/command-generation/adapters/opencode.js +6 -8
- package/dist/core/command-generation/adapters/pi.d.ts +2 -2
- package/dist/core/command-generation/adapters/pi.js +7 -10
- package/dist/core/command-generation/adapters/qoder.js +9 -9
- package/dist/core/command-generation/adapters/qwen.d.ts +7 -3
- package/dist/core/command-generation/adapters/qwen.js +14 -9
- package/dist/core/command-generation/adapters/roocode.d.ts +4 -4
- package/dist/core/command-generation/adapters/roocode.js +9 -9
- package/dist/core/command-generation/adapters/trae.d.ts +13 -0
- package/dist/core/command-generation/adapters/trae.js +28 -0
- package/dist/core/command-generation/adapters/zcode.d.ts +16 -0
- package/dist/core/command-generation/adapters/zcode.js +33 -0
- package/dist/core/command-generation/generator.d.ts +8 -0
- package/dist/core/command-generation/generator.js +15 -1
- package/dist/core/command-generation/index.d.ts +1 -1
- package/dist/core/command-generation/index.js +1 -1
- package/dist/core/command-generation/invocation.d.ts +73 -0
- package/dist/core/command-generation/invocation.js +77 -0
- package/dist/core/command-generation/registry.js +8 -4
- package/dist/core/command-generation/types.d.ts +9 -2
- package/dist/core/command-generation/yaml.d.ts +20 -6
- package/dist/core/command-generation/yaml.js +31 -21
- package/dist/core/command-surface.d.ts +15 -0
- package/dist/core/command-surface.js +33 -0
- package/dist/core/completions/command-registry.js +16 -61
- package/dist/core/completions/generators/bash-generator.js +41 -41
- package/dist/core/completions/generators/fish-generator.js +7 -7
- package/dist/core/completions/generators/powershell-generator.js +44 -37
- package/dist/core/completions/generators/zsh-generator.js +33 -33
- package/dist/core/completions/installers/zsh-installer.d.ts +9 -0
- package/dist/core/completions/installers/zsh-installer.js +20 -4
- package/dist/core/completions/templates/bash-templates.js +24 -24
- package/dist/core/completions/templates/fish-templates.js +38 -38
- package/dist/core/completions/templates/powershell-templates.js +28 -28
- package/dist/core/completions/templates/zsh-templates.js +39 -39
- package/dist/core/config-prompts.d.ts +1 -1
- package/dist/core/config-prompts.js +14 -1
- package/dist/core/config-schema.d.ts +10 -1
- package/dist/core/config-schema.js +67 -1
- package/dist/core/config.d.ts +15 -0
- package/dist/core/config.js +46 -5
- package/dist/core/file-state.js +56 -24
- package/dist/core/github-copilot/cloud-agent.d.ts +95 -0
- package/dist/core/github-copilot/cloud-agent.js +497 -0
- package/dist/core/global-config.d.ts +16 -0
- package/dist/core/init.d.ts +58 -0
- package/dist/core/init.js +474 -73
- package/dist/core/legacy-cleanup.d.ts +59 -0
- package/dist/core/legacy-cleanup.js +253 -24
- package/dist/core/list.js +23 -16
- package/dist/core/migration.d.ts +73 -1
- package/dist/core/migration.js +360 -11
- package/dist/core/modify/conflict-detector.d.ts +26 -0
- package/dist/core/modify/conflict-detector.js +62 -0
- package/dist/core/modify/dependency-propagator.d.ts +38 -0
- package/dist/core/modify/dependency-propagator.js +103 -0
- package/dist/core/modify/history-tracker.d.ts +34 -0
- package/dist/core/modify/history-tracker.js +114 -0
- package/dist/core/modify/index.d.ts +7 -0
- package/dist/core/modify/index.js +7 -0
- package/dist/core/onboarding-commands.d.ts +30 -0
- package/dist/core/onboarding-commands.js +38 -0
- package/dist/core/openspec-root.js +18 -15
- package/dist/core/parsers/change-parser.d.ts +17 -2
- package/dist/core/parsers/change-parser.js +35 -21
- package/dist/core/parsers/code-fence.d.ts +15 -0
- package/dist/core/parsers/code-fence.js +49 -0
- package/dist/core/parsers/markdown-parser.d.ts +0 -3
- package/dist/core/parsers/markdown-parser.js +7 -60
- package/dist/core/parsers/requirement-blocks.d.ts +29 -0
- package/dist/core/parsers/requirement-blocks.js +150 -31
- package/dist/core/parsers/requirement-text.d.ts +48 -0
- package/dist/core/parsers/requirement-text.js +98 -0
- package/dist/core/parsers/spec-structure.d.ts +1 -1
- package/dist/core/parsers/spec-structure.js +20 -30
- package/dist/core/profile-sync-drift.d.ts +0 -8
- package/dist/core/profile-sync-drift.js +49 -50
- package/dist/core/profiles.d.ts +2 -2
- package/dist/core/profiles.js +2 -2
- package/dist/core/project-config.d.ts +27 -18
- package/dist/core/project-config.js +101 -34
- package/dist/core/references.js +42 -4
- package/dist/core/relationship-health.d.ts +8 -0
- package/dist/core/relationship-health.js +13 -0
- package/dist/core/root-selection.d.ts +9 -6
- package/dist/core/root-selection.js +42 -5
- package/dist/core/schemas/base.schema.js +7 -2
- package/dist/core/shared/allowed-tools.d.ts +12 -0
- package/dist/core/shared/allowed-tools.js +12 -0
- package/dist/core/shared/index.d.ts +1 -0
- package/dist/core/shared/index.js +1 -0
- package/dist/core/shared/skill-content-equivalence.d.ts +7 -0
- package/dist/core/shared/skill-content-equivalence.js +41 -0
- package/dist/core/shared/skill-generation.js +17 -13
- package/dist/core/shared/skill-paths.d.ts +13 -0
- package/dist/core/shared/skill-paths.js +23 -0
- package/dist/core/shared/tool-detection.d.ts +27 -7
- package/dist/core/shared/tool-detection.js +167 -37
- package/dist/core/shared-skill-target.d.ts +16 -0
- package/dist/core/shared-skill-target.js +156 -0
- package/dist/core/specs-apply.d.ts +80 -33
- package/dist/core/specs-apply.js +667 -145
- package/dist/core/store/git.d.ts +13 -0
- package/dist/core/store/git.js +24 -0
- package/dist/core/store/operations.js +20 -0
- package/dist/core/templates/skill-templates.d.ts +3 -2
- package/dist/core/templates/skill-templates.js +3 -2
- package/dist/core/templates/workflows/apply-change.d.ts +10 -0
- package/dist/core/templates/workflows/apply-change.js +186 -224
- package/dist/core/templates/workflows/archive-change.js +387 -260
- package/dist/core/templates/workflows/bulk-archive-change.js +655 -475
- package/dist/core/templates/workflows/continue-change.js +210 -219
- package/dist/core/templates/workflows/explore.js +479 -443
- package/dist/core/templates/workflows/feedback.js +97 -97
- package/dist/core/templates/workflows/ff-change.js +200 -191
- package/dist/core/templates/workflows/modify-change.d.ts +4 -1
- package/dist/core/templates/workflows/modify-change.js +237 -115
- package/dist/core/templates/workflows/new-change.js +127 -134
- package/dist/core/templates/workflows/onboard.js +548 -542
- package/dist/core/templates/workflows/propose.js +273 -217
- package/dist/core/templates/workflows/store-selection.d.ts +1 -1
- package/dist/core/templates/workflows/store-selection.js +1 -1
- package/dist/core/templates/workflows/sync-specs.js +500 -273
- package/dist/core/templates/workflows/update-change.d.ts +10 -0
- package/dist/core/templates/workflows/update-change.js +177 -0
- package/dist/core/templates/workflows/verify-change.js +324 -326
- package/dist/core/update.d.ts +40 -5
- package/dist/core/update.js +411 -96
- package/dist/core/validation/constants.d.ts +4 -1
- package/dist/core/validation/constants.js +4 -1
- package/dist/core/validation/plan-validator.d.ts +8 -0
- package/dist/core/validation/plan-validator.js +45 -0
- package/dist/core/validation/task-numbering.d.ts +16 -0
- package/dist/core/validation/task-numbering.js +57 -0
- package/dist/core/validation/validator.d.ts +27 -3
- package/dist/core/validation/validator.js +337 -48
- package/dist/core/version-check.d.ts +152 -0
- package/dist/core/version-check.js +731 -0
- package/dist/core/view.js +13 -18
- package/dist/prompts/searchable-multi-select.js +1 -1
- package/dist/telemetry/caller-detection.d.ts +27 -0
- package/dist/telemetry/caller-detection.js +85 -0
- package/dist/telemetry/caller-detection.test.d.ts +5 -0
- package/dist/telemetry/config.d.ts +48 -2
- package/dist/telemetry/config.js +113 -11
- package/dist/telemetry/config.test.d.ts +5 -0
- package/dist/telemetry/deduplication.d.ts +35 -0
- package/dist/telemetry/deduplication.js +82 -0
- package/dist/telemetry/deduplication.test.d.ts +5 -0
- package/dist/telemetry/identity.d.ts +62 -22
- package/dist/telemetry/identity.js +147 -102
- package/dist/telemetry/index.d.ts +126 -15
- package/dist/telemetry/index.js +569 -37
- package/dist/telemetry/sanitization.d.ts +40 -0
- package/dist/telemetry/sanitization.js +114 -0
- package/dist/telemetry/sanitization.test.d.ts +5 -0
- package/dist/telemetry/throttling.d.ts +20 -0
- package/dist/telemetry/throttling.js +70 -0
- package/dist/ui/welcome-screen.d.ts +9 -1
- package/dist/ui/welcome-screen.js +91 -38
- package/dist/utils/change-metadata.d.ts +43 -0
- package/dist/utils/change-metadata.js +123 -7
- package/dist/utils/change-utils.d.ts +10 -4
- package/dist/utils/change-utils.js +20 -13
- package/dist/utils/ci.d.ts +12 -0
- package/dist/utils/ci.js +16 -0
- package/dist/utils/command-references.d.ts +92 -6
- package/dist/utils/command-references.js +180 -7
- package/dist/utils/date.d.ts +8 -0
- package/dist/utils/date.js +13 -0
- package/dist/utils/file-system.d.ts +10 -0
- package/dist/utils/file-system.js +70 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/interactive.d.ts +23 -0
- package/dist/utils/interactive.js +32 -0
- package/dist/utils/item-discovery.d.ts +19 -0
- package/dist/utils/item-discovery.js +30 -48
- package/dist/utils/shell-detection.d.ts +1 -1
- package/dist/utils/shell-detection.js +64 -11
- package/dist/utils/spec-discovery.d.ts +40 -0
- package/dist/utils/spec-discovery.js +115 -0
- package/dist/utils/task-progress.d.ts +29 -1
- package/dist/utils/task-progress.js +109 -15
- package/package.json +96 -84
- package/schemas/spec-driven/schema.yaml +252 -184
- package/schemas/spec-driven/templates/design.md +19 -19
- package/schemas/spec-driven/templates/plan-template.md +91 -0
- package/schemas/spec-driven/templates/proposal.md +29 -24
- package/schemas/spec-driven/templates/spec.md +11 -8
- package/schemas/spec-driven/templates/tasks.md +9 -9
- package/scripts/postinstall.js +83 -83
- package/dist/core/command-generation/adapters/codex.d.ts +0 -16
- package/dist/core/command-generation/adapters/codex.js +0 -39
- package/dist/core/command-generation/adapters/windsurf.d.ts +0 -14
- package/dist/core/command-generation/adapters/windsurf.js +0 -38
- package/dist/core/comprehension/config.d.ts +0 -20
- package/dist/core/comprehension/config.js +0 -23
- package/dist/core/comprehension/fingerprint.d.ts +0 -14
- package/dist/core/comprehension/fingerprint.js +0 -33
- package/dist/core/comprehension/index.d.ts +0 -57
- package/dist/core/comprehension/index.js +0 -87
- package/dist/core/comprehension/pass-record.d.ts +0 -29
- package/dist/core/comprehension/pass-record.js +0 -64
- package/dist/core/comprehension/stats.d.ts +0 -35
- package/dist/core/comprehension/stats.js +0 -133
- package/dist/core/templates/workflows/comprehension-guidance.d.ts +0 -9
- package/dist/core/templates/workflows/comprehension-guidance.js +0 -73
- package/dist/core/templates/workflows/mcp-guidance.d.ts +0 -13
- package/dist/core/templates/workflows/mcp-guidance.js +0 -131
- package/dist/core/templates/workflows/user-prompt-guidance.d.ts +0 -16
- package/dist/core/templates/workflows/user-prompt-guidance.js +0 -48
- package/dist/telemetry/caller.d.ts +0 -5
- package/dist/telemetry/caller.js +0 -29
- package/dist/telemetry/client.d.ts +0 -27
- package/dist/telemetry/client.js +0 -127
- package/dist/telemetry/command-context.d.ts +0 -13
- package/dist/telemetry/command-context.js +0 -59
- package/dist/telemetry/comprehension.d.ts +0 -44
- package/dist/telemetry/comprehension.js +0 -105
- package/dist/telemetry/content.d.ts +0 -10
- package/dist/telemetry/content.js +0 -56
- package/dist/telemetry/git-stats.d.ts +0 -12
- package/dist/telemetry/git-stats.js +0 -69
- package/dist/telemetry/identify-cache.d.ts +0 -7
- package/dist/telemetry/identify-cache.js +0 -47
- package/dist/telemetry/input.d.ts +0 -17
- package/dist/telemetry/input.js +0 -68
- package/dist/telemetry/marker.d.ts +0 -37
- package/dist/telemetry/marker.js +0 -67
- package/dist/telemetry/workflow.d.ts +0 -85
- package/dist/telemetry/workflow.js +0 -318
- package/schemas/spec-driven/templates/plan.md +0 -19
|
@@ -1,67 +1,166 @@
|
|
|
1
1
|
import { STORE_SELECTION_GUIDANCE } from './store-selection.js';
|
|
2
|
-
import { PROMPT_CLARIFY, PROMPT_SELECT_CHANGE_RECENT, TELEMETRY_MODIFY_GUIDANCE, } from './user-prompt-guidance.js';
|
|
3
2
|
export function getModifyChangeSkillTemplate() {
|
|
4
3
|
return {
|
|
5
4
|
name: 'openspec-modify-change',
|
|
6
|
-
description:
|
|
7
|
-
instructions: `
|
|
8
|
-
|
|
9
|
-
${STORE_SELECTION_GUIDANCE}
|
|
10
|
-
|
|
11
|
-
**Input**:
|
|
12
|
-
|
|
13
|
-
**
|
|
14
|
-
|
|
15
|
-
**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
2. **
|
|
25
|
-
\`\`\`bash
|
|
26
|
-
openspec
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
3. **
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
5
|
+
description: "Modify planning artifacts before implementation starts. Use when the user wants to revise artifacts after they've been created but before implementation begins.",
|
|
6
|
+
instructions: `Modify planning artifacts before implementation starts.
|
|
7
|
+
|
|
8
|
+
${STORE_SELECTION_GUIDANCE}
|
|
9
|
+
|
|
10
|
+
**Input**: Specify a change name and the artifact to modify (e.g., \`/openspec-modify-change modify-command proposal\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes and artifacts.
|
|
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 ask the user to select one
|
|
20
|
+
|
|
21
|
+
Always announce: "Using change: <name>" and how to override (e.g., \`/openspec-modify-change <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 artifacts exist and their completion status
|
|
31
|
+
|
|
32
|
+
3. **Validate pre-apply conditions**
|
|
33
|
+
|
|
34
|
+
Check if implementation has started by examining the tasks file:
|
|
35
|
+
- If any tasks are marked as complete (\`- [x]\`), modification is blocked
|
|
36
|
+
- Explain that modification is only allowed before \`/opsx:apply\` begins
|
|
37
|
+
- If blocked, suggest creating a new change or using \`/opsx:continue-change\` for artifact updates
|
|
38
|
+
|
|
39
|
+
4. **Select the artifact to modify**
|
|
40
|
+
|
|
41
|
+
If the user specified an artifact, use it. Otherwise:
|
|
42
|
+
- Show available artifacts from the status output
|
|
43
|
+
- Ask the user which artifact to modify
|
|
44
|
+
- Explain that modifying an artifact will also update its dependents
|
|
45
|
+
|
|
46
|
+
5. **Get modify instructions**
|
|
47
|
+
|
|
48
|
+
\`\`\`bash
|
|
49
|
+
openspec instructions modify --change "<name>" --artifact "<artifact-id>" --json
|
|
50
|
+
\`\`\`
|
|
51
|
+
|
|
52
|
+
This returns:
|
|
53
|
+
- \`artifactsToUpdate\`: list of artifacts that will be updated (direct and propagated)
|
|
54
|
+
- \`conflicts\`: any conflicts with manual edits (if present, modification is blocked)
|
|
55
|
+
- Success/failure status
|
|
56
|
+
|
|
57
|
+
**Handle states:**
|
|
58
|
+
- If \`success: false\` with conflicts: show conflicts, explain resolution options
|
|
59
|
+
- If \`success: false\` with pre-apply error: explain why modification is blocked
|
|
60
|
+
- If \`success: true\`: proceed with modification
|
|
61
|
+
|
|
62
|
+
6. **Make the requested changes**
|
|
63
|
+
|
|
64
|
+
- Open the artifact file in the editor (if \`--editor\` flag is used)
|
|
65
|
+
- Make the requested modifications
|
|
66
|
+
- Save the file
|
|
67
|
+
|
|
68
|
+
**Important:** The modify command calculates which artifacts need updating based on the artifact graph. The system will handle:
|
|
69
|
+
- Direct modification of the specified artifact
|
|
70
|
+
- Propagation to dependent artifacts (in reverse topological order)
|
|
71
|
+
- Conflict detection with manual edits
|
|
72
|
+
- History tracking in the change marker
|
|
73
|
+
|
|
74
|
+
7. **Verify the changes**
|
|
75
|
+
|
|
76
|
+
- Review the modified artifact
|
|
77
|
+
- If dependents were updated, review those as well
|
|
78
|
+
- Ensure changes align with the intended modification
|
|
79
|
+
|
|
80
|
+
8. **Show summary**
|
|
81
|
+
|
|
82
|
+
Display:
|
|
83
|
+
- Artifact modified
|
|
84
|
+
- Dependent artifacts updated (if any)
|
|
85
|
+
- Modification history recorded
|
|
86
|
+
- Next steps (e.g., continue with other artifacts or proceed to apply)
|
|
87
|
+
|
|
88
|
+
**Output During Modification**
|
|
89
|
+
|
|
90
|
+
\`\`\`
|
|
91
|
+
## Modifying: <change-name>
|
|
92
|
+
|
|
93
|
+
**Artifact:** <artifact-id>
|
|
94
|
+
**Dependents to update:** <list of dependent artifacts>
|
|
95
|
+
|
|
96
|
+
[...modification happening...]
|
|
97
|
+
✓ Modification complete
|
|
98
|
+
\`\`\`
|
|
99
|
+
|
|
100
|
+
**Output On Success**
|
|
101
|
+
|
|
102
|
+
\`\`\`
|
|
103
|
+
## Modification Complete
|
|
104
|
+
|
|
105
|
+
**Change:** <change-name>
|
|
106
|
+
**Artifact modified:** <artifact-id>
|
|
107
|
+
**Dependents updated:** <list>
|
|
108
|
+
|
|
109
|
+
### History Recorded
|
|
110
|
+
- Timestamp: <timestamp>
|
|
111
|
+
- Modified artifacts: <list>
|
|
112
|
+
- Intent: <user's intent>
|
|
113
|
+
|
|
114
|
+
**Next steps:**
|
|
115
|
+
- Modify additional artifacts, or
|
|
116
|
+
- Proceed with implementation: \`/opsx:apply-change\`
|
|
117
|
+
\`\`\`
|
|
118
|
+
|
|
119
|
+
**Output On Block (Pre-apply Validation Failed)**
|
|
120
|
+
|
|
121
|
+
\`\`\`
|
|
122
|
+
## Modification Blocked
|
|
123
|
+
|
|
124
|
+
**Change:** <change-name>
|
|
125
|
+
**Reason:** Implementation has started (tasks have been completed)
|
|
126
|
+
|
|
127
|
+
**Options:**
|
|
128
|
+
1. Use \`/opsx:continue-change\` to update artifacts during implementation
|
|
129
|
+
2. Create a new change for the revision
|
|
130
|
+
3. Proceed with current implementation and address changes in a follow-up
|
|
131
|
+
|
|
132
|
+
What would you like to do?
|
|
133
|
+
\`\`\`
|
|
134
|
+
|
|
135
|
+
**Output On Block (Conflicts Detected)**
|
|
136
|
+
|
|
137
|
+
\`\`\`
|
|
138
|
+
## Modification Blocked
|
|
139
|
+
|
|
140
|
+
**Change:** <change-name>
|
|
141
|
+
**Artifact:** <artifact-id>
|
|
142
|
+
**Reason:** Conflicts with manual edits
|
|
143
|
+
|
|
144
|
+
### Conflicts
|
|
145
|
+
- <artifact-id>: <affected sections>
|
|
146
|
+
|
|
147
|
+
**Options:**
|
|
148
|
+
1. Resolve conflicts manually and retry
|
|
149
|
+
2. Accept manual edits and skip propagation
|
|
150
|
+
3. Revert manual edits and allow propagation
|
|
151
|
+
|
|
152
|
+
What would you like to do?
|
|
153
|
+
\`\`\`
|
|
154
|
+
|
|
155
|
+
**Guardrails**
|
|
156
|
+
- Only allow modification before implementation starts (no completed tasks)
|
|
157
|
+
- Always check for conflicts before modifying
|
|
158
|
+
- Show which dependents will be updated
|
|
159
|
+
- Record modification history in the change marker
|
|
160
|
+
- Preserve manual edits when possible (conflict detection)
|
|
161
|
+
- Explain blocking conditions clearly
|
|
162
|
+
- Do not modify artifacts after implementation has begun
|
|
163
|
+
`,
|
|
65
164
|
license: 'MIT',
|
|
66
165
|
compatibility: 'Requires openspec CLI.',
|
|
67
166
|
metadata: { author: 'openspec', version: '1.0' },
|
|
@@ -70,63 +169,86 @@ Summarize what changed, which artifacts were updated, and prompt: "Run \`/opsx:a
|
|
|
70
169
|
export function getOpsxModifyCommandTemplate() {
|
|
71
170
|
return {
|
|
72
171
|
name: 'OPSX: Modify',
|
|
73
|
-
description:
|
|
172
|
+
description: "Modify a planning artifact before implementation starts - with dependency propagation and conflict detection (Experimental)",
|
|
74
173
|
category: 'Workflow',
|
|
75
174
|
tags: ['workflow', 'artifacts', 'experimental'],
|
|
76
|
-
content: `
|
|
77
|
-
|
|
78
|
-
${STORE_SELECTION_GUIDANCE}
|
|
79
|
-
|
|
80
|
-
**Input**: \`/opsx:modify
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
**
|
|
85
|
-
|
|
86
|
-
**
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
- Propagate to
|
|
128
|
-
-
|
|
129
|
-
-
|
|
175
|
+
content: `Modify a planning artifact before implementation starts. Only works before implementation begins.
|
|
176
|
+
|
|
177
|
+
${STORE_SELECTION_GUIDANCE}
|
|
178
|
+
|
|
179
|
+
**Input**: Specify a change name and artifact to modify (e.g., \`/opsx:modify <change-name> --artifact <artifact-id>\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes and artifacts.
|
|
180
|
+
|
|
181
|
+
\`/opsx:continue\` is an expanded-profile workflow and may not be installed. Before suggesting it anywhere below, verify that it is available. If it is unavailable, \`openspec status --change "<name>" --json\` shows the next artifact and \`openspec instructions "<artifact-id>" --change "<name>" --json\` explains how to create it.
|
|
182
|
+
|
|
183
|
+
**Steps**
|
|
184
|
+
|
|
185
|
+
1. **Select the change**
|
|
186
|
+
|
|
187
|
+
If a name is provided, use it. Otherwise:
|
|
188
|
+
- Infer from conversation context if the user mentioned a change
|
|
189
|
+
- Auto-select if only one active change exists
|
|
190
|
+
- If ambiguous, run \`openspec list --json\` to get available changes sorted by most recently modified, and ask the user to select one
|
|
191
|
+
|
|
192
|
+
When prompting, present the top 3-4 most recently modified changes as options, showing:
|
|
193
|
+
- Change name
|
|
194
|
+
- Schema (from \`schema\` field if present, otherwise "spec-driven")
|
|
195
|
+
- Status (e.g., "0/5 tasks", "complete", "no tasks")
|
|
196
|
+
- How recently it was modified (from \`lastModified\` field)
|
|
197
|
+
|
|
198
|
+
Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to modify.
|
|
199
|
+
|
|
200
|
+
Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:modify <other>\`).
|
|
201
|
+
|
|
202
|
+
2. **Check pre-apply conditions**
|
|
203
|
+
|
|
204
|
+
\`\`\`bash
|
|
205
|
+
openspec instructions modify --change "<name>" --artifact "<artifact-id>" --json
|
|
206
|
+
\`\`\`
|
|
207
|
+
|
|
208
|
+
This validates that implementation hasn't started by checking tasks.md for completed tasks. If blocked, the command returns an error with the reason.
|
|
209
|
+
|
|
210
|
+
3. **Review update scope**
|
|
211
|
+
|
|
212
|
+
The command returns a list of artifacts that will be updated in reverse topological order (deepest dependents first). Review this list to understand the impact.
|
|
213
|
+
|
|
214
|
+
4. **Check for conflicts**
|
|
215
|
+
|
|
216
|
+
The command returns any conflicts with manual edits in downstream artifacts. If conflicts exist, modification is blocked and you must resolve them first.
|
|
217
|
+
|
|
218
|
+
5. **Make the modification**
|
|
219
|
+
|
|
220
|
+
- Open the artifact file for editing
|
|
221
|
+
- Make the requested changes
|
|
222
|
+
- Save the file
|
|
223
|
+
|
|
224
|
+
The modify command will:
|
|
225
|
+
- Calculate affected artifacts using the artifact graph
|
|
226
|
+
- Propagate changes to dependents automatically
|
|
227
|
+
- Record modification history in the change marker
|
|
228
|
+
- Emit telemetry events
|
|
229
|
+
|
|
230
|
+
6. **Verify the changes**
|
|
231
|
+
|
|
232
|
+
- Review the modified artifact
|
|
233
|
+
- Review any propagated changes to dependents
|
|
234
|
+
- Ensure changes align with the intended modification
|
|
235
|
+
|
|
236
|
+
**Output**
|
|
237
|
+
|
|
238
|
+
After modification, show:
|
|
239
|
+
- Artifact modified
|
|
240
|
+
- Dependent artifacts updated (if any)
|
|
241
|
+
- Modification history recorded
|
|
242
|
+
- Next steps (e.g., modify additional artifacts or proceed to apply)
|
|
243
|
+
|
|
244
|
+
**Guardrails**
|
|
245
|
+
- Modification is blocked if implementation has started (any completed tasks)
|
|
246
|
+
- Modification is blocked if conflicts with manual edits exist
|
|
247
|
+
- Do not modify artifacts after implementation begins
|
|
248
|
+
- Always check for conflicts before modifying
|
|
249
|
+
- Use the artifact ids and paths reported by \`openspec status\`; never branch on hardcoded artifact names
|
|
250
|
+
- The modify command handles dependency propagation automatically - do not manually update dependents
|
|
251
|
+
`,
|
|
130
252
|
};
|
|
131
253
|
}
|
|
132
254
|
//# sourceMappingURL=modify-change.js.map
|
|
@@ -1,76 +1,72 @@
|
|
|
1
1
|
import { STORE_SELECTION_GUIDANCE } from './store-selection.js';
|
|
2
|
-
import { PROMPT_OPEN_ENDED, TELEMETRY_WORKFLOW_INPUT_GUIDANCE } from './user-prompt-guidance.js';
|
|
3
2
|
export function getNewChangeSkillTemplate() {
|
|
4
3
|
return {
|
|
5
4
|
name: 'openspec-new-change',
|
|
6
5
|
description: 'Start a new OpenSpec change using the experimental artifact workflow. Use when the user wants to create a new feature, fix, or modification with a structured step-by-step approach.',
|
|
7
|
-
instructions: `Start a new change using the experimental artifact-driven approach.
|
|
8
|
-
|
|
9
|
-
${STORE_SELECTION_GUIDANCE}
|
|
10
|
-
|
|
11
|
-
**Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
|
|
12
|
-
|
|
13
|
-
**Steps**
|
|
14
|
-
|
|
15
|
-
1. **If no clear input provided, ask what they want to build**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
> "What change do you want to work on? Describe what you want to build or fix."
|
|
19
|
-
|
|
20
|
-
From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
|
|
21
|
-
|
|
22
|
-
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
|
|
23
|
-
|
|
24
|
-
2. **Determine the workflow schema**
|
|
25
|
-
|
|
26
|
-
Use the default schema (omit \`--schema\`) unless the user explicitly requests a different workflow.
|
|
27
|
-
|
|
28
|
-
**Use a different schema only if the user mentions:**
|
|
29
|
-
- A specific schema name → use \`--schema <name>\`
|
|
30
|
-
- "show workflows" or "what workflows" → run \`openspec schemas --json\` and let them choose
|
|
31
|
-
|
|
32
|
-
**Otherwise**: Omit \`--schema\` to use the default.
|
|
33
|
-
|
|
34
|
-
3. **Create the change directory**
|
|
35
|
-
\`\`\`bash
|
|
36
|
-
openspec new change "<name>"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
- Do NOT advance beyond showing the first artifact template
|
|
72
|
-
- If the name is invalid (not kebab-case), ask for a valid name
|
|
73
|
-
- If a change with that name already exists, suggest continuing that change instead
|
|
6
|
+
instructions: `Start a new change using the experimental artifact-driven approach.
|
|
7
|
+
|
|
8
|
+
${STORE_SELECTION_GUIDANCE}
|
|
9
|
+
|
|
10
|
+
**Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
|
|
11
|
+
|
|
12
|
+
**Steps**
|
|
13
|
+
|
|
14
|
+
1. **If no clear input provided, ask what they want to build**
|
|
15
|
+
|
|
16
|
+
Ask the user (open-ended, no preset options):
|
|
17
|
+
> "What change do you want to work on? Describe what you want to build or fix."
|
|
18
|
+
|
|
19
|
+
From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
|
|
20
|
+
|
|
21
|
+
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
|
|
22
|
+
|
|
23
|
+
2. **Determine the workflow schema**
|
|
24
|
+
|
|
25
|
+
Use the default schema (omit \`--schema\`) unless the user explicitly requests a different workflow.
|
|
26
|
+
|
|
27
|
+
**Use a different schema only if the user mentions:**
|
|
28
|
+
- A specific schema name → use \`--schema <name>\`
|
|
29
|
+
- "show workflows" or "what workflows" → run \`openspec schemas --json\` and let them choose
|
|
30
|
+
|
|
31
|
+
**Otherwise**: Omit \`--schema\` to use the default.
|
|
32
|
+
|
|
33
|
+
3. **Create the change directory**
|
|
34
|
+
\`\`\`bash
|
|
35
|
+
openspec new change "<name>"
|
|
36
|
+
\`\`\`
|
|
37
|
+
Add \`--schema <name>\` only if the user requested a specific workflow.
|
|
38
|
+
This creates a scaffolded change in the planning home resolved by the CLI.
|
|
39
|
+
|
|
40
|
+
4. **Show the artifact status**
|
|
41
|
+
\`\`\`bash
|
|
42
|
+
openspec status --change "<name>" --json
|
|
43
|
+
\`\`\`
|
|
44
|
+
Use the returned \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`nextSteps\` instead of assuming repo-local paths.
|
|
45
|
+
|
|
46
|
+
5. **Get instructions for the first artifact**
|
|
47
|
+
The first artifact depends on the schema (e.g., \`proposal\` for spec-driven).
|
|
48
|
+
Check the status output to find the first artifact with status "ready".
|
|
49
|
+
\`\`\`bash
|
|
50
|
+
openspec instructions <first-artifact-id> --change "<name>"
|
|
51
|
+
\`\`\`
|
|
52
|
+
This outputs the template and context for creating the first artifact.
|
|
53
|
+
|
|
54
|
+
6. **STOP and wait for user direction**
|
|
55
|
+
|
|
56
|
+
**Output**
|
|
57
|
+
|
|
58
|
+
After completing the steps, summarize:
|
|
59
|
+
- Change name and location
|
|
60
|
+
- Schema/workflow being used and its artifact sequence
|
|
61
|
+
- Current status (0/N artifacts complete)
|
|
62
|
+
- The template for the first artifact
|
|
63
|
+
- Prompt: "Ready to create the first artifact? Just describe what this change is about and I'll draft it, or ask me to continue."
|
|
64
|
+
|
|
65
|
+
**Guardrails**
|
|
66
|
+
- Do NOT create any artifacts yet - just show the instructions
|
|
67
|
+
- Do NOT advance beyond showing the first artifact template
|
|
68
|
+
- If the name is invalid (not kebab-case), ask for a valid name
|
|
69
|
+
- If a change with that name already exists, suggest continuing that change instead
|
|
74
70
|
- Pass --schema if using a non-default workflow`,
|
|
75
71
|
license: 'MIT',
|
|
76
72
|
compatibility: 'Requires openspec CLI.',
|
|
@@ -83,72 +79,69 @@ export function getOpsxNewCommandTemplate() {
|
|
|
83
79
|
description: 'Start a new change using the experimental artifact workflow (OPSX)',
|
|
84
80
|
category: 'Workflow',
|
|
85
81
|
tags: ['workflow', 'artifacts', 'experimental'],
|
|
86
|
-
content: `Start a new change using the experimental artifact-driven approach.
|
|
87
|
-
|
|
88
|
-
${STORE_SELECTION_GUIDANCE}
|
|
89
|
-
|
|
90
|
-
**Input**: The argument after \`/opsx:new\` is the change name (kebab-case), OR a description of what the user wants to build.
|
|
91
|
-
|
|
92
|
-
**Steps**
|
|
93
|
-
|
|
94
|
-
1. **If no input provided, ask what they want to build**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
> "What change do you want to work on? Describe what you want to build or fix."
|
|
98
|
-
|
|
99
|
-
From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
|
|
100
|
-
|
|
101
|
-
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
|
|
102
|
-
|
|
103
|
-
2. **Determine the workflow schema**
|
|
104
|
-
|
|
105
|
-
Use the default schema (omit \`--schema\`) unless the user explicitly requests a different workflow.
|
|
106
|
-
|
|
107
|
-
**Use a different schema only if the user mentions:**
|
|
108
|
-
- A specific schema name → use \`--schema <name>\`
|
|
109
|
-
- "show workflows" or "what workflows" → run \`openspec schemas --json\` and let them choose
|
|
110
|
-
|
|
111
|
-
**Otherwise**: Omit \`--schema\` to use the default.
|
|
112
|
-
|
|
113
|
-
3. **Create the change directory**
|
|
114
|
-
\`\`\`bash
|
|
115
|
-
openspec new change "<name>"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
-
|
|
149
|
-
- Do NOT advance beyond showing the first artifact template
|
|
150
|
-
- If the name is invalid (not kebab-case), ask for a valid name
|
|
151
|
-
- If a change with that name already exists, suggest using \`/opsx:continue\` instead
|
|
82
|
+
content: `Start a new change using the experimental artifact-driven approach.
|
|
83
|
+
|
|
84
|
+
${STORE_SELECTION_GUIDANCE}
|
|
85
|
+
|
|
86
|
+
**Input**: The argument after \`/opsx:new\` is the change name (kebab-case), OR a description of what the user wants to build.
|
|
87
|
+
|
|
88
|
+
**Steps**
|
|
89
|
+
|
|
90
|
+
1. **If no input provided, ask what they want to build**
|
|
91
|
+
|
|
92
|
+
Ask the user (open-ended, no preset options):
|
|
93
|
+
> "What change do you want to work on? Describe what you want to build or fix."
|
|
94
|
+
|
|
95
|
+
From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
|
|
96
|
+
|
|
97
|
+
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
|
|
98
|
+
|
|
99
|
+
2. **Determine the workflow schema**
|
|
100
|
+
|
|
101
|
+
Use the default schema (omit \`--schema\`) unless the user explicitly requests a different workflow.
|
|
102
|
+
|
|
103
|
+
**Use a different schema only if the user mentions:**
|
|
104
|
+
- A specific schema name → use \`--schema <name>\`
|
|
105
|
+
- "show workflows" or "what workflows" → run \`openspec schemas --json\` and let them choose
|
|
106
|
+
|
|
107
|
+
**Otherwise**: Omit \`--schema\` to use the default.
|
|
108
|
+
|
|
109
|
+
3. **Create the change directory**
|
|
110
|
+
\`\`\`bash
|
|
111
|
+
openspec new change "<name>"
|
|
112
|
+
\`\`\`
|
|
113
|
+
Add \`--schema <name>\` only if the user requested a specific workflow.
|
|
114
|
+
This creates a scaffolded change in the planning home resolved by the CLI.
|
|
115
|
+
|
|
116
|
+
4. **Show the artifact status**
|
|
117
|
+
\`\`\`bash
|
|
118
|
+
openspec status --change "<name>" --json
|
|
119
|
+
\`\`\`
|
|
120
|
+
Use the returned \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`nextSteps\` instead of assuming repo-local paths.
|
|
121
|
+
|
|
122
|
+
5. **Get instructions for the first artifact**
|
|
123
|
+
The first artifact depends on the schema. Check the status output to find the first artifact with status "ready".
|
|
124
|
+
\`\`\`bash
|
|
125
|
+
openspec instructions <first-artifact-id> --change "<name>"
|
|
126
|
+
\`\`\`
|
|
127
|
+
This outputs the template and context for creating the first artifact.
|
|
128
|
+
|
|
129
|
+
6. **STOP and wait for user direction**
|
|
130
|
+
|
|
131
|
+
**Output**
|
|
132
|
+
|
|
133
|
+
After completing the steps, summarize:
|
|
134
|
+
- Change name and location
|
|
135
|
+
- Schema/workflow being used and its artifact sequence
|
|
136
|
+
- Current status (0/N artifacts complete)
|
|
137
|
+
- The template for the first artifact
|
|
138
|
+
- Prompt: "Ready to create the first artifact? Run \`/opsx:continue\` or just describe what this change is about and I'll draft it."
|
|
139
|
+
|
|
140
|
+
**Guardrails**
|
|
141
|
+
- Do NOT create any artifacts yet - just show the instructions
|
|
142
|
+
- Do NOT advance beyond showing the first artifact template
|
|
143
|
+
- If the name is invalid (not kebab-case), ask for a valid name
|
|
144
|
+
- If a change with that name already exists, suggest using \`/opsx:continue\` instead
|
|
152
145
|
- Pass --schema if using a non-default workflow`
|
|
153
146
|
};
|
|
154
147
|
}
|