@codewalla_india/openspec 1.3.1 → 1.3.3
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 +214 -133
- 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 +35 -0
- package/dist/comprehension-quiz/providers/anthropic.js +69 -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 +98 -0
- package/dist/comprehension-quiz/providers/interface.js +150 -0
- package/dist/comprehension-quiz/providers/local.d.ts +35 -0
- package/dist/comprehension-quiz/providers/local.js +69 -0
- package/dist/comprehension-quiz/providers/ollama.d.ts +35 -0
- package/dist/comprehension-quiz/providers/ollama.js +69 -0
- package/dist/comprehension-quiz/providers/openai.d.ts +35 -0
- package/dist/comprehension-quiz/providers/openai.js +72 -0
- package/dist/comprehension-quiz/question-generator.d.ts +117 -0
- package/dist/comprehension-quiz/question-generator.js +203 -0
- package/dist/comprehension-quiz/quiz-executor.d.ts +75 -0
- package/dist/comprehension-quiz/quiz-executor.js +181 -0
- package/dist/comprehension-quiz/types.d.ts +137 -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 +193 -71
- 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
package/dist/core/store/git.d.ts
CHANGED
|
@@ -19,5 +19,18 @@ export declare function gitHasRemote(storeRoot: string): Promise<boolean | null>
|
|
|
19
19
|
* network touch. Null when there is no repository or no origin.
|
|
20
20
|
*/
|
|
21
21
|
export declare function gitOriginUrl(storeRoot: string): Promise<string | null>;
|
|
22
|
+
export interface GitTrackingDrift {
|
|
23
|
+
ahead: number;
|
|
24
|
+
behind: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Ahead/behind counts of HEAD against its configured upstream tracking
|
|
28
|
+
* ref, read from local refs only — no fetch, no network. The comparison
|
|
29
|
+
* is therefore against the current local upstream ref (typically last
|
|
30
|
+
* updated by fetch, but it may be a local branch), not the live remote.
|
|
31
|
+
* Null when there is no repository, no upstream, a detached HEAD, or Git
|
|
32
|
+
* is unavailable: the absence of a comparison is not drift.
|
|
33
|
+
*/
|
|
34
|
+
export declare function gitTrackingDrift(storeRoot: string): Promise<GitTrackingDrift | null>;
|
|
22
35
|
export declare function gitDirectoryHasTrackedFiles(storeRoot: string, relativeDir: string): Promise<boolean | null>;
|
|
23
36
|
//# sourceMappingURL=git.d.ts.map
|
package/dist/core/store/git.js
CHANGED
|
@@ -130,6 +130,30 @@ export async function gitOriginUrl(storeRoot) {
|
|
|
130
130
|
const url = stdout?.trim();
|
|
131
131
|
return url ? url : null;
|
|
132
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Ahead/behind counts of HEAD against its configured upstream tracking
|
|
135
|
+
* ref, read from local refs only — no fetch, no network. The comparison
|
|
136
|
+
* is therefore against the current local upstream ref (typically last
|
|
137
|
+
* updated by fetch, but it may be a local branch), not the live remote.
|
|
138
|
+
* Null when there is no repository, no upstream, a detached HEAD, or Git
|
|
139
|
+
* is unavailable: the absence of a comparison is not drift.
|
|
140
|
+
*/
|
|
141
|
+
export async function gitTrackingDrift(storeRoot) {
|
|
142
|
+
const stdout = await gitProbe(storeRoot, [
|
|
143
|
+
'rev-list',
|
|
144
|
+
'--left-right',
|
|
145
|
+
'--count',
|
|
146
|
+
'@{upstream}...HEAD',
|
|
147
|
+
]);
|
|
148
|
+
if (stdout === null)
|
|
149
|
+
return null;
|
|
150
|
+
const match = stdout.trim().match(/^(\d+)\s+(\d+)$/);
|
|
151
|
+
if (!match)
|
|
152
|
+
return null;
|
|
153
|
+
// `--left-right` orders the counts by side of the `...`: left is @{upstream}
|
|
154
|
+
// (commits we lack = behind), right is HEAD (commits upstream lacks = ahead).
|
|
155
|
+
return { behind: Number(match[1]), ahead: Number(match[2]) };
|
|
156
|
+
}
|
|
133
157
|
export async function gitDirectoryHasTrackedFiles(storeRoot, relativeDir) {
|
|
134
158
|
const stdout = await gitProbe(storeRoot, ['ls-files', '--', relativeDir]);
|
|
135
159
|
return stdout === null ? null : stdout.trim().length > 0;
|
|
@@ -4,6 +4,7 @@ import * as os from 'node:os';
|
|
|
4
4
|
import * as path from 'node:path';
|
|
5
5
|
import { promisify } from 'node:util';
|
|
6
6
|
import { FileSystemUtils } from '../../utils/file-system.js';
|
|
7
|
+
import { classifyOpenSpecDir, storePointerProblem, } from '../project-config.js';
|
|
7
8
|
import { ANCHORED_OPENSPEC_DIRS, DIRECTORY_ANCHOR_FILE_NAME, OPENSPEC_ROOT_DIR, ensureOpenSpecRoot, inspectOpenSpecRoot, rollbackCreatedPaths, } from '../openspec-root.js';
|
|
8
9
|
import { STORE_METADATA_DIR_NAME, getStoreMetadataDir, getStoreMetadataPath, getStoreRegistryPath, listStoreRegistryEntries, readStoreRegistryState, readOptionalStoreMetadataState, resolveGitStoreBackendConfig, validateStoreId, writeStoreMetadataState, } from './foundation.js';
|
|
9
10
|
import { StoreError, makeStoreDiagnostic } from './errors.js';
|
|
@@ -53,6 +54,23 @@ function alreadyRegisteredDiagnostic(id) {
|
|
|
53
54
|
target: 'store.registry',
|
|
54
55
|
});
|
|
55
56
|
}
|
|
57
|
+
function assertNotConfigOnlyPointerRoot(storeRoot) {
|
|
58
|
+
const { hasPlanningShape, pointer } = classifyOpenSpecDir(storeRoot);
|
|
59
|
+
if (hasPlanningShape || pointer.filePath === null)
|
|
60
|
+
return;
|
|
61
|
+
if (pointer.malformed) {
|
|
62
|
+
throw new StoreError(`The store declaration in ${pointer.filePath} is invalid (${storePointerProblem(pointer.malformed)}).`, 'invalid_store_pointer', {
|
|
63
|
+
target: 'store.pointer',
|
|
64
|
+
fix: `Fix or remove the store: line in ${pointer.filePath} before registering this path as a store.`,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (pointer.value !== undefined) {
|
|
68
|
+
throw new StoreError(`This repo's planning is externalized to store '${pointer.value}' (${pointer.filePath}); it is not itself a store root.`, 'store_root_pointer_declared', {
|
|
69
|
+
target: 'store.pointer',
|
|
70
|
+
fix: 'Register the checkout for the declared store, or remove the store: line first to convert this repo into a local store root.',
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
56
74
|
function createdPath(relativePath, absolutePath, kind) {
|
|
57
75
|
return {
|
|
58
76
|
relativePath,
|
|
@@ -233,6 +251,7 @@ async function prepareSetupPlan(input) {
|
|
|
233
251
|
let metadata = null;
|
|
234
252
|
let backend;
|
|
235
253
|
if (kind === 'directory') {
|
|
254
|
+
assertNotConfigOnlyPointerRoot(storeRoot);
|
|
236
255
|
metadata = await readStoreMetadataForOperation(storeRoot);
|
|
237
256
|
if (metadata) {
|
|
238
257
|
if (metadata.id !== id) {
|
|
@@ -442,6 +461,7 @@ export async function registerExistingStore(input) {
|
|
|
442
461
|
fix: 'Pass an existing store directory.',
|
|
443
462
|
});
|
|
444
463
|
}
|
|
464
|
+
assertNotConfigOnlyPointerRoot(storeRoot);
|
|
445
465
|
const openspecRoot = await inspectOpenSpecRoot(storeRoot);
|
|
446
466
|
if (!openspecRoot.healthy) {
|
|
447
467
|
const problems = openspecRoot.diagnostics.map((diagnostic) => diagnostic.message).join(' ') ||
|
|
@@ -7,7 +7,9 @@ export type { SkillTemplate, CommandTemplate } from './types.js';
|
|
|
7
7
|
export { getExploreSkillTemplate, getOpsxExploreCommandTemplate } from './workflows/explore.js';
|
|
8
8
|
export { getNewChangeSkillTemplate, getOpsxNewCommandTemplate } from './workflows/new-change.js';
|
|
9
9
|
export { getContinueChangeSkillTemplate, getOpsxContinueCommandTemplate } from './workflows/continue-change.js';
|
|
10
|
-
export { getApplyChangeSkillTemplate, getOpsxApplyCommandTemplate } from './workflows/apply-change.js';
|
|
10
|
+
export { getApplyInstructions, getApplyChangeSkillTemplate, getOpsxApplyCommandTemplate } from './workflows/apply-change.js';
|
|
11
|
+
export { getUpdateChangeSkillTemplate, getOpsxUpdateCommandTemplate } from './workflows/update-change.js';
|
|
12
|
+
export { getModifyChangeSkillTemplate, getOpsxModifyCommandTemplate } from './workflows/modify-change.js';
|
|
11
13
|
export { getFfChangeSkillTemplate, getOpsxFfCommandTemplate } from './workflows/ff-change.js';
|
|
12
14
|
export { getSyncSpecsSkillTemplate, getOpsxSyncCommandTemplate } from './workflows/sync-specs.js';
|
|
13
15
|
export { getArchiveChangeSkillTemplate, getOpsxArchiveCommandTemplate } from './workflows/archive-change.js';
|
|
@@ -15,6 +17,5 @@ export { getBulkArchiveChangeSkillTemplate, getOpsxBulkArchiveCommandTemplate }
|
|
|
15
17
|
export { getVerifyChangeSkillTemplate, getOpsxVerifyCommandTemplate } from './workflows/verify-change.js';
|
|
16
18
|
export { getOnboardSkillTemplate, getOpsxOnboardCommandTemplate } from './workflows/onboard.js';
|
|
17
19
|
export { getOpsxProposeSkillTemplate, getOpsxProposeCommandTemplate } from './workflows/propose.js';
|
|
18
|
-
export { getModifyChangeSkillTemplate, getOpsxModifyCommandTemplate } from './workflows/modify-change.js';
|
|
19
20
|
export { getFeedbackSkillTemplate } from './workflows/feedback.js';
|
|
20
21
|
//# sourceMappingURL=skill-templates.d.ts.map
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
export { getExploreSkillTemplate, getOpsxExploreCommandTemplate } from './workflows/explore.js';
|
|
7
7
|
export { getNewChangeSkillTemplate, getOpsxNewCommandTemplate } from './workflows/new-change.js';
|
|
8
8
|
export { getContinueChangeSkillTemplate, getOpsxContinueCommandTemplate } from './workflows/continue-change.js';
|
|
9
|
-
export { getApplyChangeSkillTemplate, getOpsxApplyCommandTemplate } from './workflows/apply-change.js';
|
|
9
|
+
export { getApplyInstructions, getApplyChangeSkillTemplate, getOpsxApplyCommandTemplate } from './workflows/apply-change.js';
|
|
10
|
+
export { getUpdateChangeSkillTemplate, getOpsxUpdateCommandTemplate } from './workflows/update-change.js';
|
|
11
|
+
export { getModifyChangeSkillTemplate, getOpsxModifyCommandTemplate } from './workflows/modify-change.js';
|
|
10
12
|
export { getFfChangeSkillTemplate, getOpsxFfCommandTemplate } from './workflows/ff-change.js';
|
|
11
13
|
export { getSyncSpecsSkillTemplate, getOpsxSyncCommandTemplate } from './workflows/sync-specs.js';
|
|
12
14
|
export { getArchiveChangeSkillTemplate, getOpsxArchiveCommandTemplate } from './workflows/archive-change.js';
|
|
@@ -14,6 +16,5 @@ export { getBulkArchiveChangeSkillTemplate, getOpsxBulkArchiveCommandTemplate }
|
|
|
14
16
|
export { getVerifyChangeSkillTemplate, getOpsxVerifyCommandTemplate } from './workflows/verify-change.js';
|
|
15
17
|
export { getOnboardSkillTemplate, getOpsxOnboardCommandTemplate } from './workflows/onboard.js';
|
|
16
18
|
export { getOpsxProposeSkillTemplate, getOpsxProposeCommandTemplate } from './workflows/propose.js';
|
|
17
|
-
export { getModifyChangeSkillTemplate, getOpsxModifyCommandTemplate } from './workflows/modify-change.js';
|
|
18
19
|
export { getFeedbackSkillTemplate } from './workflows/feedback.js';
|
|
19
20
|
//# sourceMappingURL=skill-templates.js.map
|
|
@@ -5,6 +5,16 @@
|
|
|
5
5
|
* templates file into workflow-focused modules.
|
|
6
6
|
*/
|
|
7
7
|
import type { SkillTemplate, CommandTemplate } from '../types.js';
|
|
8
|
+
/**
|
|
9
|
+
* The apply workflow instructions, authored once and rendered by both the
|
|
10
|
+
* skill and command surfaces. The surfaces are intentionally distinct, but
|
|
11
|
+
* they differ only in how they are invoked — the generation transformers
|
|
12
|
+
* rewrite the canonical `/opsx:<id>` tokens per surface downstream (see
|
|
13
|
+
* command-references.ts). The instruction text itself is shared, so the two
|
|
14
|
+
* cannot silently drift. Should a surface ever need genuinely different
|
|
15
|
+
* wording, add a parameter here and pass it from that surface's template.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getApplyInstructions(): string;
|
|
8
18
|
export declare function getApplyChangeSkillTemplate(): SkillTemplate;
|
|
9
19
|
export declare function getOpsxApplyCommandTemplate(): CommandTemplate;
|
|
10
20
|
//# sourceMappingURL=apply-change.d.ts.map
|
|
@@ -1,171 +1,193 @@
|
|
|
1
|
-
import { ATLASSIAN_ENRICHMENT_GUIDANCE, CONTEXT7_LOOKUP_GUIDANCE, PLAYWRIGHT_APPLY_GUARDRAIL, } from './mcp-guidance.js';
|
|
2
|
-
import { COMPREHENSION_APPLY_GUARDRAIL, COMPREHENSION_QUIZ_GUIDANCE, } from './comprehension-guidance.js';
|
|
3
1
|
import { STORE_SELECTION_GUIDANCE } from './store-selection.js';
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The apply workflow instructions, authored once and rendered by both the
|
|
4
|
+
* skill and command surfaces. The surfaces are intentionally distinct, but
|
|
5
|
+
* they differ only in how they are invoked — the generation transformers
|
|
6
|
+
* rewrite the canonical `/opsx:<id>` tokens per surface downstream (see
|
|
7
|
+
* command-references.ts). The instruction text itself is shared, so the two
|
|
8
|
+
* cannot silently drift. Should a surface ever need genuinely different
|
|
9
|
+
* wording, add a parameter here and pass it from that surface's template.
|
|
10
|
+
*/
|
|
11
|
+
export function getApplyInstructions() {
|
|
12
|
+
return `Implement tasks from an OpenSpec change.
|
|
13
|
+
|
|
14
|
+
${STORE_SELECTION_GUIDANCE}
|
|
15
|
+
|
|
16
|
+
**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.
|
|
17
|
+
|
|
18
|
+
**Steps**
|
|
19
|
+
|
|
20
|
+
1. **Select the change**
|
|
21
|
+
|
|
22
|
+
If a name is provided, use it. Otherwise:
|
|
23
|
+
- Infer from conversation context if the user mentioned a change
|
|
24
|
+
- Auto-select if only one active change exists
|
|
25
|
+
- If ambiguous, run \`openspec list --json\` to get available changes and ask the user to select one
|
|
26
|
+
|
|
27
|
+
Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:apply <other>\`).
|
|
28
|
+
|
|
29
|
+
2. **Check status to understand the schema**
|
|
30
|
+
\`\`\`bash
|
|
31
|
+
openspec status --change "<name>" --json
|
|
32
|
+
\`\`\`
|
|
33
|
+
Parse the JSON to understand:
|
|
34
|
+
- \`schemaName\`: The workflow being used (e.g., "spec-driven")
|
|
35
|
+
- \`planningHome\`, \`changeRoot\`, and \`actionContext\`: planning scope and edit constraints
|
|
36
|
+
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
|
|
37
|
+
|
|
38
|
+
3. **Get apply instructions**
|
|
39
|
+
|
|
40
|
+
\`\`\`bash
|
|
41
|
+
openspec instructions apply --change "<name>" --json
|
|
42
|
+
\`\`\`
|
|
43
|
+
|
|
44
|
+
This returns:
|
|
45
|
+
- \`contextFiles\`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
|
|
46
|
+
- Progress (total, complete, remaining)
|
|
47
|
+
- Task list with status
|
|
48
|
+
- Dynamic instruction based on current state
|
|
49
|
+
- Optional \`context\`: current required project instruction input from the selected root
|
|
50
|
+
- Optional \`operationGuidance\`: current advisory guidance for apply
|
|
51
|
+
|
|
52
|
+
**Handle states:**
|
|
53
|
+
- If \`state: "blocked"\` (missing artifacts): show message, suggest using \`/opsx:continue\` (if it is not installed, run \`openspec status --change "<name>" --json\` to see the next artifact and \`openspec instructions <artifact-id> --change "<name>" --json\` for how to create it)
|
|
54
|
+
- If \`state: "all_done"\`: congratulate, suggest archive
|
|
55
|
+
- Otherwise: proceed to implementation
|
|
56
|
+
|
|
57
|
+
Treat \`context\` as a required prompt-level input. Read and consider it, and
|
|
58
|
+
apply relevant project facts, conventions, and constraints while implementing.
|
|
59
|
+
Treat \`operationGuidance\` as optional additive advice. Read and consider every
|
|
60
|
+
entry, and follow entries that are applicable and compatible with the built-in
|
|
61
|
+
workflow.
|
|
62
|
+
|
|
63
|
+
Keep both fields separate from CLI-returned state, missing artifacts, tasks,
|
|
64
|
+
progress, \`contextFiles\`, and the built-in \`instruction\`. They are not
|
|
65
|
+
evidence of task completion, do not replace the built-in instruction, and do
|
|
66
|
+
not permit bypassing a blocked state. If context conflicts with the built-in
|
|
67
|
+
instruction, an explicit user choice, or a CLI-controlled value, report the
|
|
68
|
+
conflict and preserve the controlling value. If guidance is inapplicable or
|
|
69
|
+
conflicts with those controlling inputs, do not follow it and explain why.
|
|
70
|
+
These are prompt-level behavior contracts, not enforceable checks.
|
|
71
|
+
|
|
72
|
+
4. **Read context files**
|
|
73
|
+
|
|
74
|
+
Read every file path listed under \`contextFiles\` from the apply instructions output.
|
|
75
|
+
The files depend on the schema being used:
|
|
76
|
+
- **spec-driven**: proposal, specs, design, tasks
|
|
77
|
+
- Other schemas: follow the contextFiles from CLI output
|
|
78
|
+
|
|
79
|
+
Do not copy \`context\` or \`operationGuidance\` verbatim into implementation
|
|
80
|
+
files or planning artifacts unless the user separately asks for that content.
|
|
81
|
+
|
|
82
|
+
5. **Show current progress**
|
|
83
|
+
|
|
84
|
+
Display:
|
|
85
|
+
- Schema being used
|
|
86
|
+
- Progress: "N/M tasks complete"
|
|
87
|
+
- Remaining tasks overview
|
|
88
|
+
- Dynamic instruction from CLI
|
|
89
|
+
|
|
90
|
+
6. **Implement tasks (loop until done or blocked)**
|
|
91
|
+
|
|
92
|
+
For each pending task:
|
|
93
|
+
- Show which task is being worked on
|
|
94
|
+
- Make the code changes required
|
|
95
|
+
- Keep changes minimal and focused
|
|
96
|
+
- Mark task complete in the tasks file: \`- [ ]\` → \`- [x]\`
|
|
97
|
+
- Continue to next task
|
|
98
|
+
|
|
99
|
+
**Pause if:**
|
|
100
|
+
- Task is unclear → ask for clarification
|
|
101
|
+
- Implementation reveals a design issue → suggest updating artifacts
|
|
102
|
+
- Error or blocker encountered → report and wait for guidance
|
|
103
|
+
- User interrupts
|
|
104
|
+
|
|
105
|
+
7. **On completion or pause, show status**
|
|
106
|
+
|
|
107
|
+
Display:
|
|
108
|
+
- Tasks completed this session
|
|
109
|
+
- Overall progress: "N/M tasks complete"
|
|
110
|
+
- If all done: suggest archive
|
|
111
|
+
- If paused: explain why and wait for guidance
|
|
112
|
+
|
|
113
|
+
**Output During Implementation**
|
|
114
|
+
|
|
115
|
+
\`\`\`
|
|
116
|
+
## Implementing: <change-name> (schema: <schema-name>)
|
|
117
|
+
|
|
118
|
+
Working on task 3/7: <task description>
|
|
119
|
+
[...implementation happening...]
|
|
120
|
+
✓ Task complete
|
|
121
|
+
|
|
122
|
+
Working on task 4/7: <task description>
|
|
123
|
+
[...implementation happening...]
|
|
124
|
+
✓ Task complete
|
|
125
|
+
\`\`\`
|
|
126
|
+
|
|
127
|
+
**Output On Completion**
|
|
128
|
+
|
|
129
|
+
\`\`\`
|
|
130
|
+
## Implementation Complete
|
|
131
|
+
|
|
132
|
+
**Change:** <change-name>
|
|
133
|
+
**Schema:** <schema-name>
|
|
134
|
+
**Progress:** 7/7 tasks complete ✓
|
|
135
|
+
|
|
136
|
+
### Completed This Session
|
|
137
|
+
- [x] Task 1
|
|
138
|
+
- [x] Task 2
|
|
139
|
+
...
|
|
140
|
+
|
|
141
|
+
All tasks complete! You can archive this change with \`/opsx:archive\`.
|
|
142
|
+
\`\`\`
|
|
143
|
+
|
|
144
|
+
**Output On Pause (Issue Encountered)**
|
|
145
|
+
|
|
146
|
+
\`\`\`
|
|
147
|
+
## Implementation Paused
|
|
148
|
+
|
|
149
|
+
**Change:** <change-name>
|
|
150
|
+
**Schema:** <schema-name>
|
|
151
|
+
**Progress:** 4/7 tasks complete
|
|
152
|
+
|
|
153
|
+
### Issue Encountered
|
|
154
|
+
<description of the issue>
|
|
155
|
+
|
|
156
|
+
**Options:**
|
|
157
|
+
1. <option 1>
|
|
158
|
+
2. <option 2>
|
|
159
|
+
3. Other approach
|
|
160
|
+
|
|
161
|
+
What would you like to do?
|
|
162
|
+
\`\`\`
|
|
163
|
+
|
|
164
|
+
**Guardrails**
|
|
165
|
+
- Keep going through tasks until done or blocked
|
|
166
|
+
- Always read context files before starting (from the apply instructions output)
|
|
167
|
+
- If task is ambiguous, pause and ask before implementing
|
|
168
|
+
- If implementation reveals issues, pause and suggest artifact updates
|
|
169
|
+
- Keep code changes minimal and scoped to each task
|
|
170
|
+
- Update task checkbox immediately after completing each task
|
|
171
|
+
- Pause on errors, blockers, or unclear requirements - don't guess
|
|
172
|
+
- Use contextFiles from CLI output, don't assume specific file names
|
|
173
|
+
- Do not use context or operation guidance as proof that a task is complete
|
|
174
|
+
- Apply relevant project context; report conflicts with controlling workflow inputs
|
|
175
|
+
- Consider every guidance entry; explain any inapplicable or conflicting advice
|
|
176
|
+
- Do not copy runtime context or operation guidance into implementation files or planning artifacts
|
|
177
|
+
- Preserve CLI-controlled blocked/ready/all-done behavior and completion criteria
|
|
178
|
+
|
|
179
|
+
**Fluid Workflow Integration**
|
|
180
|
+
|
|
181
|
+
This skill supports the "actions on a change" model:
|
|
182
|
+
|
|
183
|
+
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
|
|
184
|
+
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly`;
|
|
185
|
+
}
|
|
5
186
|
export function getApplyChangeSkillTemplate() {
|
|
6
187
|
return {
|
|
7
188
|
name: 'openspec-apply-change',
|
|
8
189
|
description: 'Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.',
|
|
9
|
-
instructions:
|
|
10
|
-
|
|
11
|
-
${STORE_SELECTION_GUIDANCE}
|
|
12
|
-
|
|
13
|
-
**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.
|
|
14
|
-
|
|
15
|
-
**Steps**
|
|
16
|
-
|
|
17
|
-
1. **Select the change**
|
|
18
|
-
|
|
19
|
-
If a name is provided, use it. Otherwise:
|
|
20
|
-
- Infer from conversation context if the user mentioned a change
|
|
21
|
-
- Auto-select if only one active change exists
|
|
22
|
-
- If ambiguous, ${PROMPT_SELECT_CHANGE}
|
|
23
|
-
|
|
24
|
-
Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:apply <other>\`).
|
|
25
|
-
|
|
26
|
-
2. **Check status to understand the schema**
|
|
27
|
-
\`\`\`bash
|
|
28
|
-
openspec status --change "<name>" --json
|
|
29
|
-
\`\`\`
|
|
30
|
-
Parse the JSON to understand:
|
|
31
|
-
- \`schemaName\`: The workflow being used (e.g., "spec-driven")
|
|
32
|
-
- \`planningHome\`, \`changeRoot\`, and \`actionContext\`: planning scope and edit constraints
|
|
33
|
-
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
|
|
34
|
-
|
|
35
|
-
3. **Get apply instructions**
|
|
36
|
-
|
|
37
|
-
\`\`\`bash
|
|
38
|
-
openspec instructions apply --change "<name>" --json
|
|
39
|
-
\`\`\`
|
|
40
|
-
|
|
41
|
-
This returns:
|
|
42
|
-
- \`contextFiles\`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
|
|
43
|
-
- Progress (total, complete, remaining)
|
|
44
|
-
- Task list with status
|
|
45
|
-
- Dynamic instruction based on current state
|
|
46
|
-
|
|
47
|
-
**Handle states:**
|
|
48
|
-
- If \`state: "blocked"\` and \`missingArtifacts\`: show message, suggest using openspec-continue-change
|
|
49
|
-
- If \`state: "blocked"\` and \`missingComprehension\`: proceed to step 4 (comprehension quiz) — do NOT implement
|
|
50
|
-
- If \`state: "all_done"\`: congratulate, suggest archive
|
|
51
|
-
- If \`state: "ready"\`: proceed to step 5
|
|
52
|
-
|
|
53
|
-
${ATLASSIAN_ENRICHMENT_GUIDANCE}
|
|
54
|
-
|
|
55
|
-
${COMPREHENSION_QUIZ_GUIDANCE}
|
|
56
|
-
|
|
57
|
-
5. **Read context files**
|
|
58
|
-
|
|
59
|
-
After comprehension is passed (or not required), read every file path listed under \`contextFiles\` from the apply instructions output.
|
|
60
|
-
The files depend on the schema being used:
|
|
61
|
-
- **spec-driven**: proposal, specs, design, plan, tasks
|
|
62
|
-
- Other schemas: follow the contextFiles from CLI output
|
|
63
|
-
|
|
64
|
-
6. **Show current progress**
|
|
65
|
-
|
|
66
|
-
Display:
|
|
67
|
-
- Schema being used
|
|
68
|
-
- Progress: "N/M tasks complete"
|
|
69
|
-
- Remaining tasks overview
|
|
70
|
-
- Dynamic instruction from CLI
|
|
71
|
-
|
|
72
|
-
7. **Implement tasks (loop until done or blocked)**
|
|
73
|
-
|
|
74
|
-
For each pending task:
|
|
75
|
-
- Show which task is being worked on
|
|
76
|
-
|
|
77
|
-
${CONTEXT7_LOOKUP_GUIDANCE}
|
|
78
|
-
|
|
79
|
-
- Make the code changes required
|
|
80
|
-
- Keep changes minimal and focused
|
|
81
|
-
- Mark task complete in the tasks file: \`- [ ]\` → \`- [x]\`
|
|
82
|
-
- Continue to next task
|
|
83
|
-
|
|
84
|
-
**After editing artifacts:** run \`openspec status --change "<name>" --json\` so revision tracking records content changes.
|
|
85
|
-
|
|
86
|
-
**Pause if:**
|
|
87
|
-
- Task is unclear → ask for clarification
|
|
88
|
-
- Implementation reveals a design issue → suggest updating artifacts
|
|
89
|
-
- Error or blocker encountered → report and wait for guidance
|
|
90
|
-
- User interrupts
|
|
91
|
-
|
|
92
|
-
8. **On completion or pause, show status**
|
|
93
|
-
|
|
94
|
-
Display:
|
|
95
|
-
- Tasks completed this session
|
|
96
|
-
- Overall progress: "N/M tasks complete"
|
|
97
|
-
- If all done: suggest archive
|
|
98
|
-
- If paused: explain why and wait for guidance
|
|
99
|
-
|
|
100
|
-
**Output During Implementation**
|
|
101
|
-
|
|
102
|
-
\`\`\`
|
|
103
|
-
## Implementing: <change-name> (schema: <schema-name>)
|
|
104
|
-
|
|
105
|
-
Working on task 3/7: <task description>
|
|
106
|
-
[...implementation happening...]
|
|
107
|
-
✓ Task complete
|
|
108
|
-
|
|
109
|
-
Working on task 4/7: <task description>
|
|
110
|
-
[...implementation happening...]
|
|
111
|
-
✓ Task complete
|
|
112
|
-
\`\`\`
|
|
113
|
-
|
|
114
|
-
**Output On Completion**
|
|
115
|
-
|
|
116
|
-
\`\`\`
|
|
117
|
-
## Implementation Complete
|
|
118
|
-
|
|
119
|
-
**Change:** <change-name>
|
|
120
|
-
**Schema:** <schema-name>
|
|
121
|
-
**Progress:** 7/7 tasks complete ✓
|
|
122
|
-
|
|
123
|
-
### Completed This Session
|
|
124
|
-
- [x] Task 1
|
|
125
|
-
- [x] Task 2
|
|
126
|
-
...
|
|
127
|
-
|
|
128
|
-
All tasks complete! Ready to archive this change.
|
|
129
|
-
\`\`\`
|
|
130
|
-
|
|
131
|
-
**Output On Pause (Issue Encountered)**
|
|
132
|
-
|
|
133
|
-
\`\`\`
|
|
134
|
-
## Implementation Paused
|
|
135
|
-
|
|
136
|
-
**Change:** <change-name>
|
|
137
|
-
**Schema:** <schema-name>
|
|
138
|
-
**Progress:** 4/7 tasks complete
|
|
139
|
-
|
|
140
|
-
### Issue Encountered
|
|
141
|
-
<description of the issue>
|
|
142
|
-
|
|
143
|
-
**Options:**
|
|
144
|
-
1. <option 1>
|
|
145
|
-
2. <option 2>
|
|
146
|
-
3. Other approach
|
|
147
|
-
|
|
148
|
-
What would you like to do?
|
|
149
|
-
\`\`\`
|
|
150
|
-
|
|
151
|
-
**Guardrails**
|
|
152
|
-
- Keep going through tasks until done or blocked
|
|
153
|
-
- Always read context files before starting (from the apply instructions output)
|
|
154
|
-
- If task is ambiguous, pause and ask before implementing
|
|
155
|
-
- If implementation reveals issues, pause and suggest artifact updates
|
|
156
|
-
- Keep code changes minimal and scoped to each task
|
|
157
|
-
- Update task checkbox immediately after completing each task
|
|
158
|
-
- Pause on errors, blockers, or unclear requirements - don't guess
|
|
159
|
-
- Use contextFiles from CLI output, don't assume specific file names
|
|
160
|
-
${COMPREHENSION_APPLY_GUARDRAIL}
|
|
161
|
-
${PLAYWRIGHT_APPLY_GUARDRAIL}
|
|
162
|
-
|
|
163
|
-
**Fluid Workflow Integration**
|
|
164
|
-
|
|
165
|
-
This skill supports the "actions on a change" model:
|
|
166
|
-
|
|
167
|
-
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
|
|
168
|
-
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly`,
|
|
190
|
+
instructions: getApplyInstructions(),
|
|
169
191
|
license: 'MIT',
|
|
170
192
|
compatibility: 'Requires openspec CLI.',
|
|
171
193
|
metadata: { author: 'openspec', version: '1.0' },
|
|
@@ -177,67 +199,7 @@ export function getOpsxApplyCommandTemplate() {
|
|
|
177
199
|
description: 'Implement tasks from an OpenSpec change (Experimental)',
|
|
178
200
|
category: 'Workflow',
|
|
179
201
|
tags: ['workflow', 'artifacts', 'experimental'],
|
|
180
|
-
content:
|
|
181
|
-
|
|
182
|
-
${STORE_SELECTION_GUIDANCE}
|
|
183
|
-
|
|
184
|
-
**Input**: Optionally specify a change name (e.g., \`/opsx:apply add-auth\`). If omitted, infer from conversation context; if ambiguous you MUST prompt for available changes.
|
|
185
|
-
|
|
186
|
-
**Steps**
|
|
187
|
-
|
|
188
|
-
1. **Select the change**
|
|
189
|
-
|
|
190
|
-
If a name is provided, use it. Otherwise infer from conversation context, auto-select if only one active change exists, or if ambiguous, ${PROMPT_SELECT_CHANGE}
|
|
191
|
-
|
|
192
|
-
Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:apply <other>\`).
|
|
193
|
-
|
|
194
|
-
2. **Check status to understand the schema**
|
|
195
|
-
\`\`\`bash
|
|
196
|
-
openspec status --change "<name>" --json
|
|
197
|
-
\`\`\`
|
|
198
|
-
Parse \`schemaName\`, \`planningHome\`/\`changeRoot\`/\`actionContext\` (planning scope and edit constraints), and which artifact holds the tasks (typically "tasks" for spec-driven).
|
|
199
|
-
|
|
200
|
-
3. **Get apply instructions**
|
|
201
|
-
\`\`\`bash
|
|
202
|
-
openspec instructions apply --change "<name>" --json
|
|
203
|
-
\`\`\`
|
|
204
|
-
Returns \`contextFiles\` (artifact ID -> file paths, varies by schema), progress, task list, and a dynamic instruction.
|
|
205
|
-
|
|
206
|
-
**Handle states:**
|
|
207
|
-
- \`blocked\` + \`missingArtifacts\`: show message, suggest \`/opsx:continue\`
|
|
208
|
-
- \`blocked\` + \`missingComprehension\`: proceed to step 4 (comprehension quiz) — do NOT implement
|
|
209
|
-
- \`all_done\`: congratulate, suggest archive
|
|
210
|
-
- \`ready\`: proceed to step 5
|
|
211
|
-
|
|
212
|
-
${ATLASSIAN_ENRICHMENT_GUIDANCE}
|
|
213
|
-
|
|
214
|
-
${COMPREHENSION_QUIZ_GUIDANCE}
|
|
215
|
-
|
|
216
|
-
5. **Read context files**
|
|
217
|
-
|
|
218
|
-
After comprehension passes (or isn't required), read every path under \`contextFiles\` from the apply instructions output (varies by schema; spec-driven: proposal, specs, design, plan, tasks).
|
|
219
|
-
|
|
220
|
-
6. **Show current progress** — schema, progress ("N/M tasks complete"), remaining tasks, and the dynamic instruction from the CLI.
|
|
221
|
-
|
|
222
|
-
7. **Implement tasks (loop until done or blocked)**
|
|
223
|
-
|
|
224
|
-
For each pending task, announce which task is being worked on.
|
|
225
|
-
|
|
226
|
-
${CONTEXT7_LOOKUP_GUIDANCE}
|
|
227
|
-
|
|
228
|
-
- Make the required code changes (minimal and focused), mark the task \`- [ ]\` → \`- [x]\`, and continue.
|
|
229
|
-
- **After editing artifacts:** run \`openspec status --change "<name>" --json\` so revision tracking records content changes.
|
|
230
|
-
- **Pause if** a task is unclear, implementation reveals a design issue, you hit an error/blocker, or the user interrupts.
|
|
231
|
-
|
|
232
|
-
8. **On completion or pause, show status** — announce each task as you start it, mark it \`✓\` when done, and report progress ("N/M tasks complete"). On completion suggest \`/opsx:archive\`; on pause state the issue and options and ask how to proceed.
|
|
233
|
-
|
|
234
|
-
**Guardrails**
|
|
235
|
-
- Keep going until done or blocked; pause on ambiguity, errors, or design issues and ask before guessing
|
|
236
|
-
- Read context files before starting (don't assume file names); keep changes minimal and scoped; update each checkbox immediately
|
|
237
|
-
${COMPREHENSION_APPLY_GUARDRAIL}
|
|
238
|
-
${PLAYWRIGHT_APPLY_GUARDRAIL}
|
|
239
|
-
|
|
240
|
-
**Fluid Workflow Integration** — invoke anytime (before all artifacts are done if tasks exist, after partial implementation, or interleaved). If implementation reveals design issues, suggest updating artifacts; not phase-locked.`
|
|
202
|
+
content: getApplyInstructions(),
|
|
241
203
|
};
|
|
242
204
|
}
|
|
243
205
|
//# sourceMappingURL=apply-change.js.map
|