@wangjibins/openspec 1.2.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 -0
- package/README.md +203 -0
- package/bin/openspec.js +3 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +482 -0
- package/dist/commands/change.d.ts +35 -0
- package/dist/commands/change.js +277 -0
- package/dist/commands/completion.d.ts +72 -0
- package/dist/commands/completion.js +257 -0
- package/dist/commands/config.d.ts +36 -0
- package/dist/commands/config.js +552 -0
- package/dist/commands/feedback.d.ts +9 -0
- package/dist/commands/feedback.js +183 -0
- package/dist/commands/schema.d.ts +6 -0
- package/dist/commands/schema.js +869 -0
- package/dist/commands/show.d.ts +14 -0
- package/dist/commands/show.js +132 -0
- package/dist/commands/spec.d.ts +15 -0
- package/dist/commands/spec.js +225 -0
- package/dist/commands/validate.d.ts +24 -0
- package/dist/commands/validate.js +294 -0
- package/dist/commands/workflow/index.d.ts +17 -0
- package/dist/commands/workflow/index.js +12 -0
- package/dist/commands/workflow/instructions.d.ts +29 -0
- package/dist/commands/workflow/instructions.js +381 -0
- package/dist/commands/workflow/new-change.d.ts +11 -0
- package/dist/commands/workflow/new-change.js +44 -0
- package/dist/commands/workflow/schemas.d.ts +10 -0
- package/dist/commands/workflow/schemas.js +34 -0
- package/dist/commands/workflow/shared.d.ts +57 -0
- package/dist/commands/workflow/shared.js +116 -0
- package/dist/commands/workflow/status.d.ts +14 -0
- package/dist/commands/workflow/status.js +75 -0
- package/dist/commands/workflow/templates.d.ts +16 -0
- package/dist/commands/workflow/templates.js +68 -0
- package/dist/core/archive.d.ts +11 -0
- package/dist/core/archive.js +318 -0
- package/dist/core/artifact-graph/graph.d.ts +56 -0
- package/dist/core/artifact-graph/graph.js +141 -0
- package/dist/core/artifact-graph/index.d.ts +7 -0
- package/dist/core/artifact-graph/index.js +13 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +143 -0
- package/dist/core/artifact-graph/instruction-loader.js +214 -0
- package/dist/core/artifact-graph/resolver.d.ts +81 -0
- package/dist/core/artifact-graph/resolver.js +257 -0
- package/dist/core/artifact-graph/schema.d.ts +13 -0
- package/dist/core/artifact-graph/schema.js +108 -0
- package/dist/core/artifact-graph/state.d.ts +12 -0
- package/dist/core/artifact-graph/state.js +54 -0
- package/dist/core/artifact-graph/types.d.ts +45 -0
- package/dist/core/artifact-graph/types.js +43 -0
- package/dist/core/available-tools.d.ts +16 -0
- package/dist/core/available-tools.js +30 -0
- package/dist/core/command-generation/adapters/amazon-q.d.ts +13 -0
- package/dist/core/command-generation/adapters/amazon-q.js +26 -0
- package/dist/core/command-generation/adapters/antigravity.d.ts +13 -0
- package/dist/core/command-generation/adapters/antigravity.js +26 -0
- package/dist/core/command-generation/adapters/auggie.d.ts +13 -0
- package/dist/core/command-generation/adapters/auggie.js +27 -0
- package/dist/core/command-generation/adapters/claude.d.ts +13 -0
- package/dist/core/command-generation/adapters/claude.js +50 -0
- package/dist/core/command-generation/adapters/cline.d.ts +14 -0
- package/dist/core/command-generation/adapters/cline.js +27 -0
- package/dist/core/command-generation/adapters/codebuddy.d.ts +13 -0
- package/dist/core/command-generation/adapters/codebuddy.js +28 -0
- package/dist/core/command-generation/adapters/codeflicker.d.ts +14 -0
- package/dist/core/command-generation/adapters/codeflicker.js +44 -0
- package/dist/core/command-generation/adapters/codex.d.ts +16 -0
- package/dist/core/command-generation/adapters/codex.js +39 -0
- package/dist/core/command-generation/adapters/continue.d.ts +13 -0
- package/dist/core/command-generation/adapters/continue.js +28 -0
- package/dist/core/command-generation/adapters/costrict.d.ts +13 -0
- package/dist/core/command-generation/adapters/costrict.js +27 -0
- package/dist/core/command-generation/adapters/crush.d.ts +13 -0
- package/dist/core/command-generation/adapters/crush.js +30 -0
- package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
- package/dist/core/command-generation/adapters/cursor.js +44 -0
- package/dist/core/command-generation/adapters/factory.d.ts +13 -0
- package/dist/core/command-generation/adapters/factory.js +27 -0
- package/dist/core/command-generation/adapters/gemini.d.ts +13 -0
- package/dist/core/command-generation/adapters/gemini.js +26 -0
- package/dist/core/command-generation/adapters/github-copilot.d.ts +13 -0
- package/dist/core/command-generation/adapters/github-copilot.js +26 -0
- package/dist/core/command-generation/adapters/iflow.d.ts +13 -0
- package/dist/core/command-generation/adapters/iflow.js +29 -0
- package/dist/core/command-generation/adapters/index.d.ts +30 -0
- package/dist/core/command-generation/adapters/index.js +30 -0
- package/dist/core/command-generation/adapters/kilocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/kilocode.js +23 -0
- package/dist/core/command-generation/adapters/kiro.d.ts +13 -0
- package/dist/core/command-generation/adapters/kiro.js +26 -0
- package/dist/core/command-generation/adapters/opencode.d.ts +13 -0
- package/dist/core/command-generation/adapters/opencode.js +29 -0
- package/dist/core/command-generation/adapters/pi.d.ts +14 -0
- package/dist/core/command-generation/adapters/pi.js +41 -0
- package/dist/core/command-generation/adapters/qoder.d.ts +13 -0
- package/dist/core/command-generation/adapters/qoder.js +30 -0
- package/dist/core/command-generation/adapters/qwen.d.ts +13 -0
- package/dist/core/command-generation/adapters/qwen.js +26 -0
- package/dist/core/command-generation/adapters/roocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/roocode.js +27 -0
- package/dist/core/command-generation/adapters/windsurf.d.ts +14 -0
- package/dist/core/command-generation/adapters/windsurf.js +51 -0
- package/dist/core/command-generation/generator.d.ts +21 -0
- package/dist/core/command-generation/generator.js +27 -0
- package/dist/core/command-generation/index.d.ts +22 -0
- package/dist/core/command-generation/index.js +24 -0
- package/dist/core/command-generation/registry.d.ts +36 -0
- package/dist/core/command-generation/registry.js +94 -0
- package/dist/core/command-generation/types.d.ts +56 -0
- package/dist/core/command-generation/types.js +8 -0
- package/dist/core/completions/command-registry.d.ts +7 -0
- package/dist/core/completions/command-registry.js +461 -0
- package/dist/core/completions/completion-provider.d.ts +60 -0
- package/dist/core/completions/completion-provider.js +102 -0
- package/dist/core/completions/factory.d.ts +64 -0
- package/dist/core/completions/factory.js +75 -0
- package/dist/core/completions/generators/bash-generator.d.ts +32 -0
- package/dist/core/completions/generators/bash-generator.js +174 -0
- package/dist/core/completions/generators/fish-generator.d.ts +32 -0
- package/dist/core/completions/generators/fish-generator.js +157 -0
- package/dist/core/completions/generators/powershell-generator.d.ts +33 -0
- package/dist/core/completions/generators/powershell-generator.js +207 -0
- package/dist/core/completions/generators/zsh-generator.d.ts +44 -0
- package/dist/core/completions/generators/zsh-generator.js +250 -0
- package/dist/core/completions/installers/bash-installer.d.ts +87 -0
- package/dist/core/completions/installers/bash-installer.js +318 -0
- package/dist/core/completions/installers/fish-installer.d.ts +43 -0
- package/dist/core/completions/installers/fish-installer.js +143 -0
- package/dist/core/completions/installers/powershell-installer.d.ts +88 -0
- package/dist/core/completions/installers/powershell-installer.js +327 -0
- package/dist/core/completions/installers/zsh-installer.d.ts +125 -0
- package/dist/core/completions/installers/zsh-installer.js +449 -0
- package/dist/core/completions/templates/bash-templates.d.ts +6 -0
- package/dist/core/completions/templates/bash-templates.js +24 -0
- package/dist/core/completions/templates/fish-templates.d.ts +7 -0
- package/dist/core/completions/templates/fish-templates.js +39 -0
- package/dist/core/completions/templates/powershell-templates.d.ts +6 -0
- package/dist/core/completions/templates/powershell-templates.js +25 -0
- package/dist/core/completions/templates/zsh-templates.d.ts +6 -0
- package/dist/core/completions/templates/zsh-templates.js +36 -0
- package/dist/core/completions/types.d.ts +79 -0
- package/dist/core/completions/types.js +2 -0
- package/dist/core/config-prompts.d.ts +9 -0
- package/dist/core/config-prompts.js +34 -0
- package/dist/core/config-schema.d.ts +86 -0
- package/dist/core/config-schema.js +213 -0
- package/dist/core/config.d.ts +17 -0
- package/dist/core/config.js +34 -0
- package/dist/core/converters/json-converter.d.ts +6 -0
- package/dist/core/converters/json-converter.js +51 -0
- package/dist/core/global-config.d.ts +44 -0
- package/dist/core/global-config.js +125 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +3 -0
- package/dist/core/init.d.ts +37 -0
- package/dist/core/init.js +593 -0
- package/dist/core/legacy-cleanup.d.ts +162 -0
- package/dist/core/legacy-cleanup.js +512 -0
- package/dist/core/list.d.ts +9 -0
- package/dist/core/list.js +171 -0
- package/dist/core/migration.d.ts +23 -0
- package/dist/core/migration.js +108 -0
- package/dist/core/parsers/change-parser.d.ts +13 -0
- package/dist/core/parsers/change-parser.js +193 -0
- package/dist/core/parsers/markdown-parser.d.ts +22 -0
- package/dist/core/parsers/markdown-parser.js +187 -0
- package/dist/core/parsers/requirement-blocks.d.ts +37 -0
- package/dist/core/parsers/requirement-blocks.js +201 -0
- package/dist/core/profile-sync-drift.d.ts +38 -0
- package/dist/core/profile-sync-drift.js +200 -0
- package/dist/core/profiles.d.ts +26 -0
- package/dist/core/profiles.js +40 -0
- package/dist/core/project-config.d.ts +64 -0
- package/dist/core/project-config.js +223 -0
- package/dist/core/schemas/base.schema.d.ts +13 -0
- package/dist/core/schemas/base.schema.js +13 -0
- package/dist/core/schemas/change.schema.d.ts +73 -0
- package/dist/core/schemas/change.schema.js +31 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/spec.schema.d.ts +18 -0
- package/dist/core/schemas/spec.schema.js +15 -0
- package/dist/core/shared/index.d.ts +8 -0
- package/dist/core/shared/index.js +8 -0
- package/dist/core/shared/skill-generation.d.ts +49 -0
- package/dist/core/shared/skill-generation.js +96 -0
- package/dist/core/shared/tool-detection.d.ts +71 -0
- package/dist/core/shared/tool-detection.js +158 -0
- package/dist/core/specs-apply.d.ts +73 -0
- package/dist/core/specs-apply.js +384 -0
- package/dist/core/styles/palette.d.ts +7 -0
- package/dist/core/styles/palette.js +8 -0
- package/dist/core/templates/index.d.ts +8 -0
- package/dist/core/templates/index.js +9 -0
- package/dist/core/templates/skill-templates.d.ts +19 -0
- package/dist/core/templates/skill-templates.js +18 -0
- package/dist/core/templates/types.d.ts +19 -0
- package/dist/core/templates/types.js +5 -0
- package/dist/core/templates/workflows/apply-change.d.ts +10 -0
- package/dist/core/templates/workflows/apply-change.js +308 -0
- package/dist/core/templates/workflows/archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/archive-change.js +271 -0
- package/dist/core/templates/workflows/bulk-archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/bulk-archive-change.js +488 -0
- package/dist/core/templates/workflows/continue-change.d.ts +10 -0
- package/dist/core/templates/workflows/continue-change.js +232 -0
- package/dist/core/templates/workflows/explore.d.ts +10 -0
- package/dist/core/templates/workflows/explore.js +461 -0
- package/dist/core/templates/workflows/feedback.d.ts +9 -0
- package/dist/core/templates/workflows/feedback.js +108 -0
- package/dist/core/templates/workflows/ff-change.d.ts +10 -0
- package/dist/core/templates/workflows/ff-change.js +198 -0
- package/dist/core/templates/workflows/new-change.d.ts +10 -0
- package/dist/core/templates/workflows/new-change.js +143 -0
- package/dist/core/templates/workflows/onboard.d.ts +10 -0
- package/dist/core/templates/workflows/onboard.js +565 -0
- package/dist/core/templates/workflows/propose.d.ts +10 -0
- package/dist/core/templates/workflows/propose.js +216 -0
- package/dist/core/templates/workflows/sync-specs.d.ts +10 -0
- package/dist/core/templates/workflows/sync-specs.js +272 -0
- package/dist/core/templates/workflows/verify-change.d.ts +10 -0
- package/dist/core/templates/workflows/verify-change.js +332 -0
- package/dist/core/update.d.ts +77 -0
- package/dist/core/update.js +537 -0
- package/dist/core/validation/constants.d.ts +34 -0
- package/dist/core/validation/constants.js +40 -0
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.js +2 -0
- package/dist/core/validation/validator.d.ts +33 -0
- package/dist/core/validation/validator.js +409 -0
- package/dist/core/view.d.ts +8 -0
- package/dist/core/view.js +168 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/prompts/searchable-multi-select.d.ts +28 -0
- package/dist/prompts/searchable-multi-select.js +159 -0
- package/dist/telemetry/config.d.ts +32 -0
- package/dist/telemetry/config.js +68 -0
- package/dist/telemetry/index.d.ts +31 -0
- package/dist/telemetry/index.js +145 -0
- package/dist/ui/ascii-patterns.d.ts +16 -0
- package/dist/ui/ascii-patterns.js +133 -0
- package/dist/ui/welcome-screen.d.ts +10 -0
- package/dist/ui/welcome-screen.js +146 -0
- package/dist/utils/change-metadata.d.ts +51 -0
- package/dist/utils/change-metadata.js +147 -0
- package/dist/utils/change-utils.d.ts +62 -0
- package/dist/utils/change-utils.js +121 -0
- package/dist/utils/command-references.d.ts +18 -0
- package/dist/utils/command-references.js +20 -0
- package/dist/utils/file-system.d.ts +36 -0
- package/dist/utils/file-system.js +281 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/interactive.d.ts +18 -0
- package/dist/utils/interactive.js +21 -0
- package/dist/utils/item-discovery.d.ts +4 -0
- package/dist/utils/item-discovery.js +72 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/shell-detection.d.ts +20 -0
- package/dist/utils/shell-detection.js +41 -0
- package/dist/utils/task-progress.d.ts +8 -0
- package/dist/utils/task-progress.js +36 -0
- package/package.json +83 -0
- package/schemas/spec-driven/schema.yaml +153 -0
- package/schemas/spec-driven/templates/design.md +19 -0
- package/schemas/spec-driven/templates/proposal.md +23 -0
- package/schemas/spec-driven/templates/spec.md +8 -0
- package/schemas/spec-driven/templates/tasks.md +9 -0
- package/scripts/postinstall.js +147 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
export function getVerifyChangeSkillTemplate() {
|
|
2
|
+
return {
|
|
3
|
+
name: 'openspec-verify-change',
|
|
4
|
+
description: 'Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.',
|
|
5
|
+
instructions: `Verify that an implementation matches the change artifacts (specs, tasks, design).
|
|
6
|
+
|
|
7
|
+
**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.
|
|
8
|
+
|
|
9
|
+
**Steps**
|
|
10
|
+
|
|
11
|
+
1. **If no change name provided, prompt for selection**
|
|
12
|
+
|
|
13
|
+
Run \`openspec list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
14
|
+
|
|
15
|
+
Show changes that have implementation tasks (tasks artifact exists).
|
|
16
|
+
Include the schema used for each change if available.
|
|
17
|
+
Mark changes with incomplete tasks as "(In Progress)".
|
|
18
|
+
|
|
19
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
20
|
+
|
|
21
|
+
2. **Check status to understand the schema**
|
|
22
|
+
\`\`\`bash
|
|
23
|
+
openspec status --change "<name>" --json
|
|
24
|
+
\`\`\`
|
|
25
|
+
Parse the JSON to understand:
|
|
26
|
+
- \`schemaName\`: The workflow being used (e.g., "spec-driven")
|
|
27
|
+
- Which artifacts exist for this change
|
|
28
|
+
|
|
29
|
+
3. **Get the change directory and load artifacts**
|
|
30
|
+
|
|
31
|
+
\`\`\`bash
|
|
32
|
+
openspec instructions apply --change "<name>" --json
|
|
33
|
+
\`\`\`
|
|
34
|
+
|
|
35
|
+
This returns the change directory and context files. Read all available artifacts from \`contextFiles\`.
|
|
36
|
+
|
|
37
|
+
4. **Initialize verification report structure**
|
|
38
|
+
|
|
39
|
+
Create a report structure with three dimensions:
|
|
40
|
+
- **Completeness**: Track tasks and spec coverage
|
|
41
|
+
- **Correctness**: Track requirement implementation and scenario coverage
|
|
42
|
+
- **Coherence**: Track design adherence and pattern consistency
|
|
43
|
+
|
|
44
|
+
Each dimension can have CRITICAL, WARNING, or SUGGESTION issues.
|
|
45
|
+
|
|
46
|
+
5. **Verify Completeness**
|
|
47
|
+
|
|
48
|
+
**Task Completion**:
|
|
49
|
+
- If tasks.md exists in contextFiles, read it
|
|
50
|
+
- Parse checkboxes: \`- [ ]\` (incomplete) vs \`- [x]\` (complete)
|
|
51
|
+
- Count complete vs total tasks
|
|
52
|
+
- If incomplete tasks exist:
|
|
53
|
+
- Add CRITICAL issue for each incomplete task
|
|
54
|
+
- Recommendation: "Complete task: <description>" or "Mark as done if already implemented"
|
|
55
|
+
|
|
56
|
+
**Spec Coverage**:
|
|
57
|
+
- If delta specs exist in \`openspec/changes/<name>/specs/\`:
|
|
58
|
+
- Extract all requirements (marked with "### Requirement:")
|
|
59
|
+
- For each requirement:
|
|
60
|
+
- Search codebase for keywords related to the requirement
|
|
61
|
+
- Assess if implementation likely exists
|
|
62
|
+
- If requirements appear unimplemented:
|
|
63
|
+
- Add CRITICAL issue: "Requirement not found: <requirement name>"
|
|
64
|
+
- Recommendation: "Implement requirement X: <description>"
|
|
65
|
+
|
|
66
|
+
6. **Verify Correctness**
|
|
67
|
+
|
|
68
|
+
**Requirement Implementation Mapping**:
|
|
69
|
+
- For each requirement from delta specs:
|
|
70
|
+
- Search codebase for implementation evidence
|
|
71
|
+
- If found, note file paths and line ranges
|
|
72
|
+
- Assess if implementation matches requirement intent
|
|
73
|
+
- If divergence detected:
|
|
74
|
+
- Add WARNING: "Implementation may diverge from spec: <details>"
|
|
75
|
+
- Recommendation: "Review <file>:<lines> against requirement X"
|
|
76
|
+
|
|
77
|
+
**Scenario Coverage**:
|
|
78
|
+
- For each scenario in delta specs (marked with "#### Scenario:"):
|
|
79
|
+
- Check if conditions are handled in code
|
|
80
|
+
- Check if tests exist covering the scenario
|
|
81
|
+
- If scenario appears uncovered:
|
|
82
|
+
- Add WARNING: "Scenario not covered: <scenario name>"
|
|
83
|
+
- Recommendation: "Add test or implementation for scenario: <description>"
|
|
84
|
+
|
|
85
|
+
7. **Verify Coherence**
|
|
86
|
+
|
|
87
|
+
**Design Adherence**:
|
|
88
|
+
- If design.md exists in contextFiles:
|
|
89
|
+
- Extract key decisions (look for sections like "Decision:", "Approach:", "Architecture:")
|
|
90
|
+
- Verify implementation follows those decisions
|
|
91
|
+
- If contradiction detected:
|
|
92
|
+
- Add WARNING: "Design decision not followed: <decision>"
|
|
93
|
+
- Recommendation: "Update implementation or revise design.md to match reality"
|
|
94
|
+
- If no design.md: Skip design adherence check, note "No design.md to verify against"
|
|
95
|
+
|
|
96
|
+
**Code Pattern Consistency**:
|
|
97
|
+
- Review new code for consistency with project patterns
|
|
98
|
+
- Check file naming, directory structure, coding style
|
|
99
|
+
- If significant deviations found:
|
|
100
|
+
- Add SUGGESTION: "Code pattern deviation: <details>"
|
|
101
|
+
- Recommendation: "Consider following project pattern: <example>"
|
|
102
|
+
|
|
103
|
+
8. **Generate Verification Report**
|
|
104
|
+
|
|
105
|
+
**Summary Scorecard**:
|
|
106
|
+
\`\`\`
|
|
107
|
+
## Verification Report: <change-name>
|
|
108
|
+
|
|
109
|
+
### Summary
|
|
110
|
+
| Dimension | Status |
|
|
111
|
+
|--------------|------------------|
|
|
112
|
+
| Completeness | X/Y tasks, N reqs|
|
|
113
|
+
| Correctness | M/N reqs covered |
|
|
114
|
+
| Coherence | Followed/Issues |
|
|
115
|
+
\`\`\`
|
|
116
|
+
|
|
117
|
+
**Issues by Priority**:
|
|
118
|
+
|
|
119
|
+
1. **CRITICAL** (Must fix before archive):
|
|
120
|
+
- Incomplete tasks
|
|
121
|
+
- Missing requirement implementations
|
|
122
|
+
- Each with specific, actionable recommendation
|
|
123
|
+
|
|
124
|
+
2. **WARNING** (Should fix):
|
|
125
|
+
- Spec/design divergences
|
|
126
|
+
- Missing scenario coverage
|
|
127
|
+
- Each with specific recommendation
|
|
128
|
+
|
|
129
|
+
3. **SUGGESTION** (Nice to fix):
|
|
130
|
+
- Pattern inconsistencies
|
|
131
|
+
- Minor improvements
|
|
132
|
+
- Each with specific recommendation
|
|
133
|
+
|
|
134
|
+
**Final Assessment**:
|
|
135
|
+
- If CRITICAL issues: "X critical issue(s) found. Fix before archiving."
|
|
136
|
+
- If only warnings: "No critical issues. Y warning(s) to consider. Ready for archive (with noted improvements)."
|
|
137
|
+
- If all clear: "All checks passed. Ready for archive."
|
|
138
|
+
|
|
139
|
+
**Verification Heuristics**
|
|
140
|
+
|
|
141
|
+
- **Completeness**: Focus on objective checklist items (checkboxes, requirements list)
|
|
142
|
+
- **Correctness**: Use keyword search, file path analysis, reasonable inference - don't require perfect certainty
|
|
143
|
+
- **Coherence**: Look for glaring inconsistencies, don't nitpick style
|
|
144
|
+
- **False Positives**: When uncertain, prefer SUGGESTION over WARNING, WARNING over CRITICAL
|
|
145
|
+
- **Actionability**: Every issue must have a specific recommendation with file/line references where applicable
|
|
146
|
+
|
|
147
|
+
**Graceful Degradation**
|
|
148
|
+
|
|
149
|
+
- If only tasks.md exists: verify task completion only, skip spec/design checks
|
|
150
|
+
- If tasks + specs exist: verify completeness and correctness, skip design
|
|
151
|
+
- If full artifacts: verify all three dimensions
|
|
152
|
+
- Always note which checks were skipped and why
|
|
153
|
+
|
|
154
|
+
**Output Format**
|
|
155
|
+
|
|
156
|
+
Use clear markdown with:
|
|
157
|
+
- Table for summary scorecard
|
|
158
|
+
- Grouped lists for issues (CRITICAL/WARNING/SUGGESTION)
|
|
159
|
+
- Code references in format: \`file.ts:123\`
|
|
160
|
+
- Specific, actionable recommendations
|
|
161
|
+
- No vague suggestions like "consider reviewing"`,
|
|
162
|
+
license: 'MIT',
|
|
163
|
+
compatibility: 'Requires openspec CLI.',
|
|
164
|
+
metadata: { author: 'openspec', version: '1.0' },
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
export function getOpsxVerifyCommandTemplate() {
|
|
168
|
+
return {
|
|
169
|
+
name: 'OPSX: Verify',
|
|
170
|
+
description: 'Verify implementation matches change artifacts before archiving',
|
|
171
|
+
category: 'Workflow',
|
|
172
|
+
tags: ['workflow', 'verify', 'experimental'],
|
|
173
|
+
content: `Verify that an implementation matches the change artifacts (specs, tasks, design).
|
|
174
|
+
|
|
175
|
+
**Input**: Optionally specify a change name after \`/opsx:verify\` (e.g., \`/opsx:verify add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
176
|
+
|
|
177
|
+
**Steps**
|
|
178
|
+
|
|
179
|
+
1. **If no change name provided, prompt for selection**
|
|
180
|
+
|
|
181
|
+
Run \`openspec list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
182
|
+
|
|
183
|
+
Show changes that have implementation tasks (tasks artifact exists).
|
|
184
|
+
Include the schema used for each change if available.
|
|
185
|
+
Mark changes with incomplete tasks as "(In Progress)".
|
|
186
|
+
|
|
187
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
188
|
+
|
|
189
|
+
2. **Check status to understand the schema**
|
|
190
|
+
\`\`\`bash
|
|
191
|
+
openspec status --change "<name>" --json
|
|
192
|
+
\`\`\`
|
|
193
|
+
Parse the JSON to understand:
|
|
194
|
+
- \`schemaName\`: The workflow being used (e.g., "spec-driven")
|
|
195
|
+
- Which artifacts exist for this change
|
|
196
|
+
|
|
197
|
+
3. **Get the change directory and load artifacts**
|
|
198
|
+
|
|
199
|
+
\`\`\`bash
|
|
200
|
+
openspec instructions apply --change "<name>" --json
|
|
201
|
+
\`\`\`
|
|
202
|
+
|
|
203
|
+
This returns the change directory and context files. Read all available artifacts from \`contextFiles\`.
|
|
204
|
+
|
|
205
|
+
4. **Initialize verification report structure**
|
|
206
|
+
|
|
207
|
+
Create a report structure with three dimensions:
|
|
208
|
+
- **Completeness**: Track tasks and spec coverage
|
|
209
|
+
- **Correctness**: Track requirement implementation and scenario coverage
|
|
210
|
+
- **Coherence**: Track design adherence and pattern consistency
|
|
211
|
+
|
|
212
|
+
Each dimension can have CRITICAL, WARNING, or SUGGESTION issues.
|
|
213
|
+
|
|
214
|
+
5. **Verify Completeness**
|
|
215
|
+
|
|
216
|
+
**Task Completion**:
|
|
217
|
+
- If tasks.md exists in contextFiles, read it
|
|
218
|
+
- Parse checkboxes: \`- [ ]\` (incomplete) vs \`- [x]\` (complete)
|
|
219
|
+
- Count complete vs total tasks
|
|
220
|
+
- If incomplete tasks exist:
|
|
221
|
+
- Add CRITICAL issue for each incomplete task
|
|
222
|
+
- Recommendation: "Complete task: <description>" or "Mark as done if already implemented"
|
|
223
|
+
|
|
224
|
+
**Spec Coverage**:
|
|
225
|
+
- If delta specs exist in \`openspec/changes/<name>/specs/\`:
|
|
226
|
+
- Extract all requirements (marked with "### Requirement:")
|
|
227
|
+
- For each requirement:
|
|
228
|
+
- Search codebase for keywords related to the requirement
|
|
229
|
+
- Assess if implementation likely exists
|
|
230
|
+
- If requirements appear unimplemented:
|
|
231
|
+
- Add CRITICAL issue: "Requirement not found: <requirement name>"
|
|
232
|
+
- Recommendation: "Implement requirement X: <description>"
|
|
233
|
+
|
|
234
|
+
6. **Verify Correctness**
|
|
235
|
+
|
|
236
|
+
**Requirement Implementation Mapping**:
|
|
237
|
+
- For each requirement from delta specs:
|
|
238
|
+
- Search codebase for implementation evidence
|
|
239
|
+
- If found, note file paths and line ranges
|
|
240
|
+
- Assess if implementation matches requirement intent
|
|
241
|
+
- If divergence detected:
|
|
242
|
+
- Add WARNING: "Implementation may diverge from spec: <details>"
|
|
243
|
+
- Recommendation: "Review <file>:<lines> against requirement X"
|
|
244
|
+
|
|
245
|
+
**Scenario Coverage**:
|
|
246
|
+
- For each scenario in delta specs (marked with "#### Scenario:"):
|
|
247
|
+
- Check if conditions are handled in code
|
|
248
|
+
- Check if tests exist covering the scenario
|
|
249
|
+
- If scenario appears uncovered:
|
|
250
|
+
- Add WARNING: "Scenario not covered: <scenario name>"
|
|
251
|
+
- Recommendation: "Add test or implementation for scenario: <description>"
|
|
252
|
+
|
|
253
|
+
7. **Verify Coherence**
|
|
254
|
+
|
|
255
|
+
**Design Adherence**:
|
|
256
|
+
- If design.md exists in contextFiles:
|
|
257
|
+
- Extract key decisions (look for sections like "Decision:", "Approach:", "Architecture:")
|
|
258
|
+
- Verify implementation follows those decisions
|
|
259
|
+
- If contradiction detected:
|
|
260
|
+
- Add WARNING: "Design decision not followed: <decision>"
|
|
261
|
+
- Recommendation: "Update implementation or revise design.md to match reality"
|
|
262
|
+
- If no design.md: Skip design adherence check, note "No design.md to verify against"
|
|
263
|
+
|
|
264
|
+
**Code Pattern Consistency**:
|
|
265
|
+
- Review new code for consistency with project patterns
|
|
266
|
+
- Check file naming, directory structure, coding style
|
|
267
|
+
- If significant deviations found:
|
|
268
|
+
- Add SUGGESTION: "Code pattern deviation: <details>"
|
|
269
|
+
- Recommendation: "Consider following project pattern: <example>"
|
|
270
|
+
|
|
271
|
+
8. **Generate Verification Report**
|
|
272
|
+
|
|
273
|
+
**Summary Scorecard**:
|
|
274
|
+
\`\`\`
|
|
275
|
+
## Verification Report: <change-name>
|
|
276
|
+
|
|
277
|
+
### Summary
|
|
278
|
+
| Dimension | Status |
|
|
279
|
+
|--------------|------------------|
|
|
280
|
+
| Completeness | X/Y tasks, N reqs|
|
|
281
|
+
| Correctness | M/N reqs covered |
|
|
282
|
+
| Coherence | Followed/Issues |
|
|
283
|
+
\`\`\`
|
|
284
|
+
|
|
285
|
+
**Issues by Priority**:
|
|
286
|
+
|
|
287
|
+
1. **CRITICAL** (Must fix before archive):
|
|
288
|
+
- Incomplete tasks
|
|
289
|
+
- Missing requirement implementations
|
|
290
|
+
- Each with specific, actionable recommendation
|
|
291
|
+
|
|
292
|
+
2. **WARNING** (Should fix):
|
|
293
|
+
- Spec/design divergences
|
|
294
|
+
- Missing scenario coverage
|
|
295
|
+
- Each with specific recommendation
|
|
296
|
+
|
|
297
|
+
3. **SUGGESTION** (Nice to fix):
|
|
298
|
+
- Pattern inconsistencies
|
|
299
|
+
- Minor improvements
|
|
300
|
+
- Each with specific recommendation
|
|
301
|
+
|
|
302
|
+
**Final Assessment**:
|
|
303
|
+
- If CRITICAL issues: "X critical issue(s) found. Fix before archiving."
|
|
304
|
+
- If only warnings: "No critical issues. Y warning(s) to consider. Ready for archive (with noted improvements)."
|
|
305
|
+
- If all clear: "All checks passed. Ready for archive."
|
|
306
|
+
|
|
307
|
+
**Verification Heuristics**
|
|
308
|
+
|
|
309
|
+
- **Completeness**: Focus on objective checklist items (checkboxes, requirements list)
|
|
310
|
+
- **Correctness**: Use keyword search, file path analysis, reasonable inference - don't require perfect certainty
|
|
311
|
+
- **Coherence**: Look for glaring inconsistencies, don't nitpick style
|
|
312
|
+
- **False Positives**: When uncertain, prefer SUGGESTION over WARNING, WARNING over CRITICAL
|
|
313
|
+
- **Actionability**: Every issue must have a specific recommendation with file/line references where applicable
|
|
314
|
+
|
|
315
|
+
**Graceful Degradation**
|
|
316
|
+
|
|
317
|
+
- If only tasks.md exists: verify task completion only, skip spec/design checks
|
|
318
|
+
- If tasks + specs exist: verify completeness and correctness, skip design
|
|
319
|
+
- If full artifacts: verify all three dimensions
|
|
320
|
+
- Always note which checks were skipped and why
|
|
321
|
+
|
|
322
|
+
**Output Format**
|
|
323
|
+
|
|
324
|
+
Use clear markdown with:
|
|
325
|
+
- Table for summary scorecard
|
|
326
|
+
- Grouped lists for issues (CRITICAL/WARNING/SUGGESTION)
|
|
327
|
+
- Code references in format: \`file.ts:123\`
|
|
328
|
+
- Specific, actionable recommendations
|
|
329
|
+
- No vague suggestions like "consider reviewing"`
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
//# sourceMappingURL=verify-change.js.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update Command
|
|
3
|
+
*
|
|
4
|
+
* Refreshes OpenSpec skills and commands for configured tools.
|
|
5
|
+
* Supports profile-aware updates, delivery changes, migration, and smart update detection.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Options for the update command.
|
|
9
|
+
*/
|
|
10
|
+
export interface UpdateCommandOptions {
|
|
11
|
+
/** Force update even when tools are up to date */
|
|
12
|
+
force?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Scans installed workflow artifacts (skills and managed commands) across all configured tools.
|
|
16
|
+
* Returns the union of detected workflow IDs that match ALL_WORKFLOWS.
|
|
17
|
+
*
|
|
18
|
+
* Wrapper around the shared migration module's scanInstalledWorkflows that accepts tool IDs.
|
|
19
|
+
*/
|
|
20
|
+
export declare function scanInstalledWorkflows(projectPath: string, toolIds: string[]): string[];
|
|
21
|
+
export declare class UpdateCommand {
|
|
22
|
+
private readonly force;
|
|
23
|
+
constructor(options?: UpdateCommandOptions);
|
|
24
|
+
execute(projectPath: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Display message when all tools are up to date.
|
|
27
|
+
*/
|
|
28
|
+
private displayUpToDateMessage;
|
|
29
|
+
/**
|
|
30
|
+
* Display the update plan showing which tools need updating.
|
|
31
|
+
*/
|
|
32
|
+
private displayUpdatePlan;
|
|
33
|
+
/**
|
|
34
|
+
* Detects new tool directories that aren't currently configured and displays a hint.
|
|
35
|
+
*/
|
|
36
|
+
private detectNewTools;
|
|
37
|
+
/**
|
|
38
|
+
* Displays a note about extra workflows installed that aren't in the current profile.
|
|
39
|
+
*/
|
|
40
|
+
private displayExtraWorkflowsNote;
|
|
41
|
+
/**
|
|
42
|
+
* Removes skill directories for workflows when delivery changed to commands-only.
|
|
43
|
+
* Returns the number of directories removed.
|
|
44
|
+
*/
|
|
45
|
+
private removeSkillDirs;
|
|
46
|
+
/**
|
|
47
|
+
* Removes skill directories for workflows that are no longer selected in the active profile.
|
|
48
|
+
* Returns the number of directories removed.
|
|
49
|
+
*/
|
|
50
|
+
private removeUnselectedSkillDirs;
|
|
51
|
+
/**
|
|
52
|
+
* Removes command files for workflows when delivery changed to skills-only.
|
|
53
|
+
* Returns the number of files removed.
|
|
54
|
+
*/
|
|
55
|
+
private removeCommandFiles;
|
|
56
|
+
/**
|
|
57
|
+
* Removes command files for workflows that are no longer selected in the active profile.
|
|
58
|
+
* Returns the number of files removed.
|
|
59
|
+
*/
|
|
60
|
+
private removeUnselectedCommandFiles;
|
|
61
|
+
/**
|
|
62
|
+
* Detect and handle legacy OpenSpec artifacts.
|
|
63
|
+
* Unlike init, update warns but continues if legacy files found in non-interactive mode.
|
|
64
|
+
* Returns array of tool IDs that were newly configured during legacy upgrade.
|
|
65
|
+
*/
|
|
66
|
+
private handleLegacyCleanup;
|
|
67
|
+
/**
|
|
68
|
+
* Perform cleanup of legacy artifacts.
|
|
69
|
+
*/
|
|
70
|
+
private performLegacyCleanup;
|
|
71
|
+
/**
|
|
72
|
+
* Upgrade legacy tools to new skills system.
|
|
73
|
+
* Returns array of tool IDs that were newly configured.
|
|
74
|
+
*/
|
|
75
|
+
private upgradeLegacyTools;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=update.d.ts.map
|