@fission-ai/openspec 1.9.0 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/cli/index.d.ts +17 -0
  2. package/dist/cli/index.js +60 -9
  3. package/dist/commands/change.d.ts +24 -0
  4. package/dist/commands/change.js +223 -0
  5. package/dist/commands/config.js +14 -3
  6. package/dist/commands/feedback.js +28 -7
  7. package/dist/commands/schema.d.ts +5 -0
  8. package/dist/commands/schema.js +201 -35
  9. package/dist/commands/show.js +1 -1
  10. package/dist/commands/workflow/index.d.ts +1 -1
  11. package/dist/commands/workflow/index.js +1 -1
  12. package/dist/commands/workflow/status.d.ts +2 -0
  13. package/dist/commands/workflow/status.js +76 -12
  14. package/dist/core/archive.js +64 -7
  15. package/dist/core/artifact-graph/instruction-loader.js +2 -7
  16. package/dist/core/artifact-graph/outputs.d.ts +4 -0
  17. package/dist/core/artifact-graph/outputs.js +7 -0
  18. package/dist/core/artifact-graph/resolver.js +15 -9
  19. package/dist/core/available-tools.js +16 -1
  20. package/dist/core/command-generation/adapters/antigravity.d.ts +1 -1
  21. package/dist/core/command-generation/adapters/antigravity.js +2 -2
  22. package/dist/core/command-generation/adapters/opencode.d.ts +2 -1
  23. package/dist/core/command-generation/adapters/opencode.js +13 -2
  24. package/dist/core/completion-tip.d.ts +15 -0
  25. package/dist/core/completion-tip.js +133 -0
  26. package/dist/core/completions/command-registry.js +20 -0
  27. package/dist/core/completions/factory.d.ts +11 -0
  28. package/dist/core/completions/generators/fish-generator.d.ts +12 -0
  29. package/dist/core/completions/generators/fish-generator.js +79 -47
  30. package/dist/core/completions/installers/bash-installer.d.ts +7 -0
  31. package/dist/core/completions/installers/bash-installer.js +15 -0
  32. package/dist/core/completions/installers/fish-installer.d.ts +7 -0
  33. package/dist/core/completions/installers/fish-installer.js +15 -0
  34. package/dist/core/completions/installers/powershell-installer.d.ts +7 -0
  35. package/dist/core/completions/installers/powershell-installer.js +15 -0
  36. package/dist/core/completions/templates/fish-templates.d.ts +1 -1
  37. package/dist/core/completions/templates/fish-templates.js +107 -10
  38. package/dist/core/completions/types.d.ts +4 -0
  39. package/dist/core/config-prompts.js +19 -10
  40. package/dist/core/config-schema.d.ts +1 -0
  41. package/dist/core/config-schema.js +2 -0
  42. package/dist/core/config.js +7 -1
  43. package/dist/core/global-config.d.ts +2 -0
  44. package/dist/core/init.d.ts +5 -0
  45. package/dist/core/init.js +117 -14
  46. package/dist/core/legacy-cleanup.js +6 -0
  47. package/dist/core/migration.js +42 -12
  48. package/dist/core/parsers/requirement-blocks.d.ts +1 -0
  49. package/dist/core/parsers/requirement-blocks.js +2 -0
  50. package/dist/core/profiles.d.ts +1 -1
  51. package/dist/core/profiles.js +11 -2
  52. package/dist/core/shared/tool-detection.js +9 -3
  53. package/dist/core/shared-skill-target.d.ts +13 -0
  54. package/dist/core/shared-skill-target.js +43 -1
  55. package/dist/core/specs-apply.js +16 -8
  56. package/dist/core/templates/workflows/explore.js +79 -73
  57. package/dist/core/templates/workflows/feedback.js +1 -0
  58. package/dist/core/templates/workflows/onboard.js +4 -4
  59. package/dist/core/update.js +39 -26
  60. package/dist/core/validation/constants.d.ts +3 -0
  61. package/dist/core/validation/constants.js +12 -0
  62. package/dist/core/validation/purpose-placeholder.d.ts +45 -0
  63. package/dist/core/validation/purpose-placeholder.js +117 -0
  64. package/dist/core/validation/validator.js +16 -1
  65. package/dist/telemetry/index.js +3 -2
  66. package/dist/utils/change-metadata.js +17 -13
  67. package/dist/utils/change-utils.js +5 -0
  68. package/dist/utils/requirement-diff.d.ts +42 -0
  69. package/dist/utils/requirement-diff.js +61 -0
  70. package/package.json +4 -6
  71. package/schemas/spec-driven/schema.yaml +17 -7
  72. package/scripts/postinstall.js +0 -83
@@ -91,10 +91,16 @@ artifacts:
91
91
  by hand. Do NOT add `## Purpose` to a delta for an existing capability -
92
92
  that spec already has one and the delta's is ignored. To change an
93
93
  existing capability's Purpose - including a leftover `TBD` placeholder -
94
- edit `openspec/specs/<capability-path>/spec.md` directly.
94
+ edit `<planningHome.root>/openspec/specs/<capability-path>/spec.md`
95
+ directly. `planningHome.root` comes from the `openspec instructions ...
96
+ --json` response. Always use it rather than a repo-relative path: it
97
+ resolves to the store whenever the change lives in one - whether that
98
+ came from `--store`, a project `store:` pointer, or a global default
99
+ store - and to the current repository otherwise. Do not try to work out
100
+ which case applies; the field already has.
95
101
 
96
102
  MODIFIED requirements workflow:
97
- 1. Locate the existing requirement in openspec/specs/<capability-path>/spec.md
103
+ 1. Locate the existing requirement in `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (the same store-aware root as above)
98
104
  2. Copy the ENTIRE requirement block (from `### Requirement:` through all scenarios)
99
105
  3. Paste under `## MODIFIED Requirements` and edit to reflect new behavior
100
106
  4. Ensure header text matches exactly (whitespace-insensitive)
@@ -182,22 +188,26 @@ artifacts:
182
188
  - Each task MUST be a checkbox: `- [ ] X.Y Task description`
183
189
  - Tasks should be small enough to complete in one session
184
190
  - Order tasks by dependency (what must be done first?)
191
+ - Each task MUST state how to verify completion (a test, command,
192
+ observable behavior, or delivered artifact). Put the verification in
193
+ that task's checkbox description. Use a separate verification task only
194
+ when it checks broader integration or system behavior that spans
195
+ multiple implementation tasks.
185
196
 
186
197
  Example:
187
198
  ```
188
199
  ## 1. Setup
189
200
 
190
- - [ ] 1.1 Create new module structure
191
- - [ ] 1.2 Add dependencies to package.json
201
+ - [ ] 1.1 Create new module structure and verify expected files are present
202
+ - [ ] 1.2 Add dependencies to package.json and verify package installation succeeds
192
203
 
193
204
  ## 2. Core Implementation
194
205
 
195
- - [ ] 2.1 Implement data export function
196
- - [ ] 2.2 Add CSV formatting utilities
206
+ - [ ] 2.1 Implement data export function and verify the export test passes
207
+ - [ ] 2.2 Add CSV formatting utilities and verify unit tests cover quoting and delimiters
197
208
  ```
198
209
 
199
210
  Reference specs for what needs to be built, design for how to build it.
200
- Each task should be verifiable - you know when it's done.
201
211
  requires:
202
212
  - specs
203
213
  - design
@@ -1,83 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Postinstall script that hints about shell completions
5
- *
6
- * Completion installation is opt-in: the user must run
7
- * `openspec completion install` explicitly. This script only
8
- * prints a one-line tip after npm install.
9
- *
10
- * The tip is suppressed when:
11
- * - CI=true environment variable is set
12
- * - OPENSPEC_NO_COMPLETIONS=1 environment variable is set
13
- * - dist/ directory doesn't exist (dev setup scenario)
14
- *
15
- * The script never fails npm install - all errors are caught and handled gracefully.
16
- */
17
-
18
- import { promises as fs } from 'fs';
19
- import path from 'path';
20
- import { fileURLToPath } from 'url';
21
-
22
- const __filename = fileURLToPath(import.meta.url);
23
- const __dirname = path.dirname(__filename);
24
-
25
- /**
26
- * Check if we should skip installation
27
- */
28
- function shouldSkipInstallation() {
29
- // Skip in CI environments
30
- if (process.env.CI === 'true' || process.env.CI === '1') {
31
- return { skip: true, reason: 'CI environment detected' };
32
- }
33
-
34
- // Skip if user opted out
35
- if (process.env.OPENSPEC_NO_COMPLETIONS === '1') {
36
- return { skip: true, reason: 'OPENSPEC_NO_COMPLETIONS=1 set' };
37
- }
38
-
39
- return { skip: false };
40
- }
41
-
42
- /**
43
- * Check if dist/ directory exists
44
- */
45
- async function distExists() {
46
- const distPath = path.join(__dirname, '..', 'dist');
47
- try {
48
- const stat = await fs.stat(distPath);
49
- return stat.isDirectory();
50
- } catch {
51
- return false;
52
- }
53
- }
54
-
55
- /**
56
- * Main function
57
- */
58
- async function main() {
59
- try {
60
- // Check if we should skip
61
- const skipCheck = shouldSkipInstallation();
62
- if (skipCheck.skip) {
63
- // Silent skip - no output
64
- return;
65
- }
66
-
67
- // Check if dist/ exists (skip silently if not - expected during dev setup)
68
- if (!(await distExists())) {
69
- return;
70
- }
71
-
72
- // Completions are opt-in — just print a hint
73
- console.log(`\nTip: Run 'openspec completion install' for shell completions`);
74
- } catch (error) {
75
- // Fail gracefully - never break npm install
76
- }
77
- }
78
-
79
- // Run main and handle any unhandled errors
80
- main().catch(() => {
81
- // Silent failure - never break npm install
82
- process.exit(0);
83
- });