gmc-openspec 1.0.0 → 1.4.1

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 (110) hide show
  1. package/README.md +2 -2
  2. package/bin/openspec.js +3 -1
  3. package/dist/cli/index.d.ts +4 -1
  4. package/dist/cli/index.js +36 -2
  5. package/dist/commands/config.js +4 -4
  6. package/dist/commands/context-store.d.ts +3 -0
  7. package/dist/commands/context-store.js +475 -0
  8. package/dist/commands/initiative.d.ts +13 -0
  9. package/dist/commands/initiative.js +318 -0
  10. package/dist/commands/workflow/index.d.ts +2 -0
  11. package/dist/commands/workflow/index.js +1 -0
  12. package/dist/commands/workflow/initiative-link.d.ts +24 -0
  13. package/dist/commands/workflow/initiative-link.js +47 -0
  14. package/dist/commands/workflow/instructions.js +10 -2
  15. package/dist/commands/workflow/new-change.d.ts +4 -0
  16. package/dist/commands/workflow/new-change.js +72 -23
  17. package/dist/commands/workflow/set-change.d.ts +13 -0
  18. package/dist/commands/workflow/set-change.js +87 -0
  19. package/dist/commands/workflow/shared.d.ts +2 -0
  20. package/dist/commands/workflow/status.js +3 -0
  21. package/dist/commands/workspace/context-status.d.ts +4 -0
  22. package/dist/commands/workspace/context-status.js +59 -0
  23. package/dist/commands/workspace/open-target-selection.d.ts +13 -0
  24. package/dist/commands/workspace/open-target-selection.js +146 -0
  25. package/dist/commands/workspace/open-view.d.ts +62 -0
  26. package/dist/commands/workspace/open-view.js +249 -0
  27. package/dist/commands/workspace/open.d.ts +16 -8
  28. package/dist/commands/workspace/open.js +40 -14
  29. package/dist/commands/workspace/opener-selection.d.ts +11 -0
  30. package/dist/commands/workspace/opener-selection.js +98 -0
  31. package/dist/commands/workspace/operations.d.ts +14 -8
  32. package/dist/commands/workspace/operations.js +228 -160
  33. package/dist/commands/workspace/prompt-theme.d.ts +29 -0
  34. package/dist/commands/workspace/prompt-theme.js +24 -0
  35. package/dist/commands/workspace/registration.d.ts +13 -0
  36. package/dist/commands/workspace/registration.js +84 -0
  37. package/dist/commands/workspace/selection.d.ts +3 -0
  38. package/dist/commands/workspace/selection.js +42 -40
  39. package/dist/commands/workspace/setup-prompts.d.ts +13 -0
  40. package/dist/commands/workspace/setup-prompts.js +121 -0
  41. package/dist/commands/workspace/types.d.ts +15 -0
  42. package/dist/commands/workspace.js +59 -340
  43. package/dist/core/artifact-graph/index.d.ts +2 -1
  44. package/dist/core/artifact-graph/instruction-loader.d.ts +10 -23
  45. package/dist/core/artifact-graph/instruction-loader.js +28 -89
  46. package/dist/core/artifact-graph/types.d.ts +0 -7
  47. package/dist/core/artifact-graph/types.js +0 -19
  48. package/dist/core/change-metadata/index.d.ts +2 -0
  49. package/dist/core/change-metadata/index.js +2 -0
  50. package/dist/core/change-metadata/schema.d.ts +18 -0
  51. package/dist/core/change-metadata/schema.js +28 -0
  52. package/dist/core/change-status-policy.d.ts +50 -0
  53. package/dist/core/change-status-policy.js +70 -0
  54. package/dist/core/collections/index.d.ts +3 -0
  55. package/dist/core/collections/index.js +3 -0
  56. package/dist/core/collections/initiatives/collection.d.ts +4 -0
  57. package/dist/core/collections/initiatives/collection.js +17 -0
  58. package/dist/core/collections/initiatives/index.d.ts +6 -0
  59. package/dist/core/collections/initiatives/index.js +6 -0
  60. package/dist/core/collections/initiatives/operations.d.ts +49 -0
  61. package/dist/core/collections/initiatives/operations.js +175 -0
  62. package/dist/core/collections/initiatives/resolution.d.ts +87 -0
  63. package/dist/core/collections/initiatives/resolution.js +374 -0
  64. package/dist/core/collections/initiatives/schema.d.ts +41 -0
  65. package/dist/core/collections/initiatives/schema.js +134 -0
  66. package/dist/core/collections/initiatives/templates.d.ts +12 -0
  67. package/dist/core/collections/initiatives/templates.js +90 -0
  68. package/dist/core/collections/runtime.d.ts +46 -0
  69. package/dist/core/collections/runtime.js +194 -0
  70. package/dist/core/completions/command-registry.d.ts +1 -5
  71. package/dist/core/completions/command-registry.js +475 -70
  72. package/dist/core/completions/shared-flags.d.ts +12 -0
  73. package/dist/core/completions/shared-flags.js +28 -0
  74. package/dist/core/config.js +2 -1
  75. package/dist/core/context-store/binding.d.ts +53 -0
  76. package/dist/core/context-store/binding.js +197 -0
  77. package/dist/core/context-store/errors.d.ts +20 -0
  78. package/dist/core/context-store/errors.js +22 -0
  79. package/dist/core/context-store/foundation.d.ts +55 -0
  80. package/dist/core/context-store/foundation.js +321 -0
  81. package/dist/core/context-store/index.d.ts +6 -0
  82. package/dist/core/context-store/index.js +6 -0
  83. package/dist/core/context-store/operations.d.ts +85 -0
  84. package/dist/core/context-store/operations.js +528 -0
  85. package/dist/core/context-store/registry.d.ts +45 -0
  86. package/dist/core/context-store/registry.js +229 -0
  87. package/dist/core/index.d.ts +2 -0
  88. package/dist/core/index.js +2 -0
  89. package/dist/core/planning-home.js +5 -21
  90. package/dist/core/validation/validator.d.ts +11 -0
  91. package/dist/core/validation/validator.js +19 -2
  92. package/dist/core/workspace/foundation.d.ts +28 -48
  93. package/dist/core/workspace/foundation.js +130 -214
  94. package/dist/core/workspace/index.d.ts +2 -0
  95. package/dist/core/workspace/index.js +2 -0
  96. package/dist/core/workspace/legacy-state.d.ts +28 -0
  97. package/dist/core/workspace/legacy-state.js +200 -0
  98. package/dist/core/workspace/open-surface.d.ts +29 -8
  99. package/dist/core/workspace/open-surface.js +122 -44
  100. package/dist/core/workspace/openers.js +11 -6
  101. package/dist/core/workspace/registry.d.ts +24 -0
  102. package/dist/core/workspace/registry.js +146 -0
  103. package/dist/core/workspace/skills.d.ts +4 -2
  104. package/dist/core/workspace/skills.js +2 -2
  105. package/dist/core/workspace/state-io.d.ts +10 -0
  106. package/dist/core/workspace/state-io.js +119 -0
  107. package/dist/utils/change-metadata.d.ts +5 -2
  108. package/dist/utils/change-metadata.js +6 -12
  109. package/dist/utils/change-utils.d.ts +2 -2
  110. package/package.json +17 -19
@@ -1,46 +1,27 @@
1
- /**
2
- * Common flags used across multiple commands
3
- */
4
- const COMMON_FLAGS = {
5
- json: {
6
- name: 'json',
7
- description: 'Output as JSON',
8
- },
9
- jsonValidation: {
10
- name: 'json',
11
- description: 'Output validation results as JSON',
12
- },
13
- strict: {
14
- name: 'strict',
15
- description: 'Enable strict validation mode',
16
- },
17
- noInteractive: {
18
- name: 'no-interactive',
19
- description: 'Disable interactive prompts',
20
- },
21
- type: {
22
- name: 'type',
23
- description: 'Specify item type when ambiguous',
24
- takesValue: true,
25
- values: ['change', 'spec'],
26
- },
27
- };
28
- /**
29
- * Registry of all OpenSpec CLI commands with their flags and metadata.
30
- * This registry is used to generate shell completion scripts.
31
- */
1
+ import { COMMON_FLAGS } from './shared-flags.js';
32
2
  export const COMMAND_REGISTRY = [
33
3
  {
34
4
  name: 'init',
35
5
  description: 'Initialize OpenSpec in your project',
36
6
  acceptsPositional: true,
37
7
  positionalType: 'path',
8
+ positionals: [{ name: 'path', type: 'path', optional: true }],
38
9
  flags: [
39
10
  {
40
11
  name: 'tools',
41
12
  description: 'Configure AI tools non-interactively (e.g., "all", "none", or comma-separated tool IDs)',
42
13
  takesValue: true,
43
14
  },
15
+ {
16
+ name: 'force',
17
+ description: 'Auto-cleanup legacy files without prompting',
18
+ },
19
+ {
20
+ name: 'profile',
21
+ description: 'Override global config profile (core or custom)',
22
+ takesValue: true,
23
+ values: ['core', 'custom'],
24
+ },
44
25
  ],
45
26
  },
46
27
  {
@@ -48,7 +29,13 @@ export const COMMAND_REGISTRY = [
48
29
  description: 'Update OpenSpec instruction files',
49
30
  acceptsPositional: true,
50
31
  positionalType: 'path',
51
- flags: [],
32
+ positionals: [{ name: 'path', type: 'path', optional: true }],
33
+ flags: [
34
+ {
35
+ name: 'force',
36
+ description: 'Force update even when tools are up to date',
37
+ },
38
+ ],
52
39
  },
53
40
  {
54
41
  name: 'list',
@@ -62,6 +49,13 @@ export const COMMAND_REGISTRY = [
62
49
  name: 'changes',
63
50
  description: 'List changes explicitly (default)',
64
51
  },
52
+ {
53
+ name: 'sort',
54
+ description: 'Sort order: "recent" (default) or "name"',
55
+ takesValue: true,
56
+ values: ['recent', 'name'],
57
+ },
58
+ COMMON_FLAGS.json,
65
59
  ],
66
60
  },
67
61
  {
@@ -74,6 +68,7 @@ export const COMMAND_REGISTRY = [
74
68
  description: 'Validate changes and specs',
75
69
  acceptsPositional: true,
76
70
  positionalType: 'change-or-spec-id',
71
+ positionals: [{ name: 'item-name', type: 'change-or-spec-id', optional: true }],
77
72
  flags: [
78
73
  {
79
74
  name: 'all',
@@ -103,6 +98,7 @@ export const COMMAND_REGISTRY = [
103
98
  description: 'Show a change or spec',
104
99
  acceptsPositional: true,
105
100
  positionalType: 'change-or-spec-id',
101
+ positionals: [{ name: 'item-name', type: 'change-or-spec-id', optional: true }],
106
102
  flags: [
107
103
  COMMON_FLAGS.json,
108
104
  COMMON_FLAGS.type,
@@ -136,6 +132,7 @@ export const COMMAND_REGISTRY = [
136
132
  description: 'Archive a completed change and update main specs',
137
133
  acceptsPositional: true,
138
134
  positionalType: 'change-id',
135
+ positionals: [{ name: 'change-name', type: 'change-id', optional: true }],
139
136
  flags: [
140
137
  {
141
138
  name: 'yes',
@@ -152,6 +149,144 @@ export const COMMAND_REGISTRY = [
152
149
  },
153
150
  ],
154
151
  },
152
+ {
153
+ name: 'status',
154
+ description: 'Display artifact completion status for a change',
155
+ flags: [
156
+ {
157
+ name: 'change',
158
+ description: 'Change name to show status for',
159
+ takesValue: true,
160
+ },
161
+ {
162
+ name: 'schema',
163
+ description: 'Schema override',
164
+ takesValue: true,
165
+ },
166
+ COMMON_FLAGS.json,
167
+ ],
168
+ },
169
+ {
170
+ name: 'instructions',
171
+ description: 'Output enriched instructions for creating an artifact or applying tasks',
172
+ acceptsPositional: true,
173
+ positionals: [{ name: 'artifact', optional: true }],
174
+ flags: [
175
+ {
176
+ name: 'change',
177
+ description: 'Change name',
178
+ takesValue: true,
179
+ },
180
+ {
181
+ name: 'schema',
182
+ description: 'Schema override',
183
+ takesValue: true,
184
+ },
185
+ COMMON_FLAGS.json,
186
+ ],
187
+ },
188
+ {
189
+ name: 'templates',
190
+ description: 'Show resolved template paths for all artifacts in a schema',
191
+ flags: [
192
+ {
193
+ name: 'schema',
194
+ description: 'Schema to use',
195
+ takesValue: true,
196
+ },
197
+ COMMON_FLAGS.json,
198
+ ],
199
+ },
200
+ {
201
+ name: 'schemas',
202
+ description: 'List available workflow schemas with descriptions',
203
+ flags: [
204
+ COMMON_FLAGS.json,
205
+ ],
206
+ },
207
+ {
208
+ name: 'new',
209
+ description: 'Create new items',
210
+ flags: [],
211
+ subcommands: [
212
+ {
213
+ name: 'change',
214
+ description: 'Create a new change directory',
215
+ acceptsPositional: true,
216
+ positionals: [{ name: 'name' }],
217
+ flags: [
218
+ {
219
+ name: 'description',
220
+ description: 'Description to add to README.md',
221
+ takesValue: true,
222
+ },
223
+ {
224
+ name: 'goal',
225
+ description: 'Workspace product goal to store with the change',
226
+ takesValue: true,
227
+ },
228
+ {
229
+ name: 'areas',
230
+ description: 'Comma-separated affected workspace link names',
231
+ takesValue: true,
232
+ },
233
+ {
234
+ name: 'initiative',
235
+ description: 'Link the repo-local change to an initiative',
236
+ takesValue: true,
237
+ },
238
+ {
239
+ name: 'store',
240
+ description: 'Context store id for --initiative',
241
+ takesValue: true,
242
+ },
243
+ {
244
+ name: 'store-path',
245
+ description: 'Existing local context store root for --initiative',
246
+ takesValue: true,
247
+ },
248
+ {
249
+ name: 'schema',
250
+ description: 'Workflow schema to use',
251
+ takesValue: true,
252
+ },
253
+ COMMON_FLAGS.json,
254
+ ],
255
+ },
256
+ ],
257
+ },
258
+ {
259
+ name: 'set',
260
+ description: 'Set checked-in OpenSpec metadata',
261
+ flags: [],
262
+ subcommands: [
263
+ {
264
+ name: 'change',
265
+ description: 'Set repo-local change metadata',
266
+ acceptsPositional: true,
267
+ positionalType: 'change-id',
268
+ positionals: [{ name: 'name', type: 'change-id' }],
269
+ flags: [
270
+ {
271
+ name: 'initiative',
272
+ description: 'Link the repo-local change to an initiative',
273
+ takesValue: true,
274
+ },
275
+ {
276
+ name: 'store',
277
+ description: 'Context store id for --initiative',
278
+ takesValue: true,
279
+ },
280
+ {
281
+ name: 'store-path',
282
+ description: 'Existing local context store root for --initiative',
283
+ takesValue: true,
284
+ },
285
+ COMMON_FLAGS.json,
286
+ ],
287
+ },
288
+ ],
289
+ },
155
290
  {
156
291
  name: 'workspace',
157
292
  description: 'Set up and inspect coordination workspaces',
@@ -173,9 +308,9 @@ export const COMMAND_REGISTRY = [
173
308
  },
174
309
  {
175
310
  name: 'opener',
176
- description: 'Preferred opener: codex, claude, github-copilot, or editor',
311
+ description: 'Preferred opener: codex-cli, claude, github-copilot, or editor',
177
312
  takesValue: true,
178
- values: ['codex', 'claude', 'github-copilot', 'editor'],
313
+ values: ['codex-cli', 'claude', 'github-copilot', 'editor'],
179
314
  },
180
315
  {
181
316
  name: 'tools',
@@ -205,20 +340,13 @@ export const COMMAND_REGISTRY = [
205
340
  description: 'Link an existing repo or folder to a workspace',
206
341
  acceptsPositional: true,
207
342
  positionals: [
208
- {
209
- name: 'name-or-path',
210
- type: 'path',
211
- optional: true,
212
- },
213
- {
214
- name: 'path',
215
- type: 'path',
216
- },
343
+ { name: 'name-or-path', type: 'path', optional: true },
344
+ { name: 'path', type: 'path', optional: true },
217
345
  ],
218
346
  flags: [
219
347
  {
220
348
  name: 'workspace',
221
- description: 'Workspace name from the local workspace registry',
349
+ description: 'Workspace name from local workspace views',
222
350
  takesValue: true,
223
351
  },
224
352
  COMMON_FLAGS.json,
@@ -230,18 +358,13 @@ export const COMMAND_REGISTRY = [
230
358
  description: 'Update the local path for an existing workspace link',
231
359
  acceptsPositional: true,
232
360
  positionals: [
233
- {
234
- name: 'name',
235
- },
236
- {
237
- name: 'path',
238
- type: 'path',
239
- },
361
+ { name: 'name' },
362
+ { name: 'path', type: 'path' },
240
363
  ],
241
364
  flags: [
242
365
  {
243
366
  name: 'workspace',
244
- description: 'Workspace name from the local workspace registry',
367
+ description: 'Workspace name from local workspace views',
245
368
  takesValue: true,
246
369
  },
247
370
  COMMON_FLAGS.json,
@@ -254,7 +377,7 @@ export const COMMAND_REGISTRY = [
254
377
  flags: [
255
378
  {
256
379
  name: 'workspace',
257
- description: 'Workspace name from the local workspace registry',
380
+ description: 'Workspace name from local workspace views',
258
381
  takesValue: true,
259
382
  },
260
383
  COMMON_FLAGS.json,
@@ -263,18 +386,13 @@ export const COMMAND_REGISTRY = [
263
386
  },
264
387
  {
265
388
  name: 'update',
266
- description: 'Refresh workspace-local OpenSpec agent skills from the active global profile',
389
+ description: 'Refresh workspace-local OpenSpec guidance and agent skills',
267
390
  acceptsPositional: true,
268
- positionals: [
269
- {
270
- name: 'name',
271
- optional: true,
272
- },
273
- ],
391
+ positionals: [{ name: 'name', optional: true }],
274
392
  flags: [
275
393
  {
276
394
  name: 'workspace',
277
- description: 'Workspace name from the local workspace registry',
395
+ description: 'Workspace name from local workspace views',
278
396
  takesValue: true,
279
397
  },
280
398
  {
@@ -290,37 +408,305 @@ export const COMMAND_REGISTRY = [
290
408
  name: 'open',
291
409
  description: 'Open a workspace in an agent or VS Code editor',
292
410
  acceptsPositional: true,
293
- positionals: [
294
- {
295
- name: 'name',
296
- optional: true,
297
- },
298
- ],
411
+ positionals: [{ name: 'name', optional: true }],
299
412
  flags: [
300
413
  {
301
414
  name: 'workspace',
302
- description: 'Workspace name from the local workspace registry',
415
+ description: 'Workspace name from local workspace views',
416
+ takesValue: true,
417
+ },
418
+ {
419
+ name: 'initiative',
420
+ description: 'Open an initiative as a local workspace view',
421
+ takesValue: true,
422
+ },
423
+ {
424
+ name: 'store',
425
+ description: 'Context store id for --initiative',
426
+ takesValue: true,
427
+ },
428
+ {
429
+ name: 'store-path',
430
+ description: 'Existing local context store root for --initiative',
303
431
  takesValue: true,
304
432
  },
305
433
  {
306
434
  name: 'agent',
307
- description: 'Use an agent for this session: codex, claude, or github-copilot',
435
+ description: 'Use an agent for this session: codex-cli, claude, or github-copilot',
308
436
  takesValue: true,
309
- values: ['codex', 'claude', 'github-copilot'],
437
+ values: ['codex-cli', 'claude', 'github-copilot'],
310
438
  },
311
439
  {
312
440
  name: 'editor',
313
441
  description: 'Open the workspace in VS Code editor mode',
314
442
  },
443
+ {
444
+ name: 'prepare-only',
445
+ description: 'Unsupported: preview surfaces belong to a future context/query command',
446
+ },
447
+ COMMON_FLAGS.json,
448
+ {
449
+ name: 'change',
450
+ description: 'Unsupported: change-scoped open belongs to future workspace change planning',
451
+ takesValue: true,
452
+ },
315
453
  COMMON_FLAGS.noInteractive,
316
454
  ],
317
455
  },
318
456
  ],
319
457
  },
458
+ {
459
+ name: 'jira',
460
+ description: 'Manage Jira intake setup, validation, and status',
461
+ flags: [],
462
+ subcommands: [
463
+ {
464
+ name: 'setup',
465
+ description: 'Set up Jira intake configuration and AI workflow artifacts',
466
+ acceptsPositional: true,
467
+ positionalType: 'path',
468
+ positionals: [{ name: 'path', type: 'path', optional: true }],
469
+ flags: [
470
+ {
471
+ name: 'tools',
472
+ description: 'AI tools to configure: all, none, detected, or comma-separated tool IDs',
473
+ takesValue: true,
474
+ },
475
+ {
476
+ name: 'provider',
477
+ description: 'Jira provider',
478
+ takesValue: true,
479
+ },
480
+ {
481
+ name: 'endpoint',
482
+ description: 'Atlassian MCP endpoint',
483
+ takesValue: true,
484
+ },
485
+ {
486
+ name: 'force',
487
+ description: 'Overwrite existing Jira setup files when needed',
488
+ },
489
+ COMMON_FLAGS.json,
490
+ ],
491
+ },
492
+ {
493
+ name: 'doctor',
494
+ description: 'Check Jira intake configuration and local MCP prerequisites',
495
+ acceptsPositional: true,
496
+ positionalType: 'path',
497
+ positionals: [{ name: 'path', type: 'path', optional: true }],
498
+ flags: [
499
+ COMMON_FLAGS.json,
500
+ ],
501
+ },
502
+ {
503
+ name: 'validate',
504
+ description: 'Validate a Jira intake folder before moving to the next stage',
505
+ acceptsPositional: true,
506
+ positionals: [{ name: 'jira-id' }],
507
+ flags: [
508
+ {
509
+ name: 'stage',
510
+ description: 'Validation stage',
511
+ takesValue: true,
512
+ values: ['source', 'requirement', 'stories', 'propose'],
513
+ },
514
+ COMMON_FLAGS.json,
515
+ ],
516
+ },
517
+ {
518
+ name: 'status',
519
+ description: 'Show Jira intake status and allowed next states',
520
+ acceptsPositional: true,
521
+ positionals: [{ name: 'jira-id' }],
522
+ flags: [
523
+ COMMON_FLAGS.json,
524
+ ],
525
+ },
526
+ ],
527
+ },
528
+ {
529
+ name: 'context-store',
530
+ description: 'Set up and inspect context stores',
531
+ flags: [],
532
+ subcommands: [
533
+ {
534
+ name: 'setup',
535
+ description: 'Create or register a local context store',
536
+ acceptsPositional: true,
537
+ positionals: [{ name: 'id', optional: true }],
538
+ flags: [
539
+ {
540
+ name: 'path',
541
+ description: 'Directory to use for the context store',
542
+ takesValue: true,
543
+ },
544
+ {
545
+ name: 'init-git',
546
+ description: 'Initialize a Git repository in the context store',
547
+ },
548
+ {
549
+ name: 'no-init-git',
550
+ description: 'Skip Git repository initialization',
551
+ },
552
+ COMMON_FLAGS.json,
553
+ ],
554
+ },
555
+ {
556
+ name: 'register',
557
+ description: 'Register an existing context store directory',
558
+ acceptsPositional: true,
559
+ positionals: [{ name: 'path', type: 'path', optional: true }],
560
+ flags: [
561
+ {
562
+ name: 'id',
563
+ description: 'Context store id',
564
+ takesValue: true,
565
+ },
566
+ COMMON_FLAGS.json,
567
+ ],
568
+ },
569
+ {
570
+ name: 'unregister',
571
+ description: 'Forget a local context-store registration without deleting files',
572
+ acceptsPositional: true,
573
+ positionals: [{ name: 'id' }],
574
+ flags: [
575
+ COMMON_FLAGS.json,
576
+ ],
577
+ },
578
+ {
579
+ name: 'remove',
580
+ description: 'Forget a local context-store registration and delete its local folder',
581
+ acceptsPositional: true,
582
+ positionals: [{ name: 'id' }],
583
+ flags: [
584
+ {
585
+ name: 'yes',
586
+ description: 'Confirm local context-store folder deletion',
587
+ },
588
+ COMMON_FLAGS.json,
589
+ ],
590
+ },
591
+ {
592
+ name: 'list',
593
+ description: 'List registered context stores',
594
+ flags: [
595
+ COMMON_FLAGS.json,
596
+ ],
597
+ },
598
+ {
599
+ name: 'ls',
600
+ description: 'List registered context stores',
601
+ flags: [
602
+ COMMON_FLAGS.json,
603
+ ],
604
+ },
605
+ {
606
+ name: 'doctor',
607
+ description: 'Check local context-store registration and metadata',
608
+ acceptsPositional: true,
609
+ positionals: [{ name: 'id', optional: true }],
610
+ flags: [
611
+ COMMON_FLAGS.json,
612
+ ],
613
+ },
614
+ ],
615
+ },
616
+ {
617
+ name: 'initiative',
618
+ description: 'Create and list coordinated initiatives',
619
+ flags: [],
620
+ subcommands: [
621
+ {
622
+ name: 'create',
623
+ description: 'Create an initiative in a context store',
624
+ acceptsPositional: true,
625
+ positionals: [{ name: 'id', optional: true }],
626
+ flags: [
627
+ {
628
+ name: 'store',
629
+ description: 'Context store id from the local context-store registry',
630
+ takesValue: true,
631
+ },
632
+ {
633
+ name: 'store-path',
634
+ description: 'Existing local context store root',
635
+ takesValue: true,
636
+ },
637
+ {
638
+ name: 'title',
639
+ description: 'Initiative title',
640
+ takesValue: true,
641
+ },
642
+ {
643
+ name: 'summary',
644
+ description: 'Initiative summary',
645
+ takesValue: true,
646
+ },
647
+ COMMON_FLAGS.json,
648
+ ],
649
+ },
650
+ {
651
+ name: 'show',
652
+ description: 'Show where an initiative lives and how to read it',
653
+ acceptsPositional: true,
654
+ positionals: [{ name: 'id' }],
655
+ flags: [
656
+ {
657
+ name: 'store',
658
+ description: 'Context store id from the local context-store registry',
659
+ takesValue: true,
660
+ },
661
+ {
662
+ name: 'store-path',
663
+ description: 'Existing local context store root',
664
+ takesValue: true,
665
+ },
666
+ COMMON_FLAGS.json,
667
+ ],
668
+ },
669
+ {
670
+ name: 'list',
671
+ description: 'List initiatives across registered context stores',
672
+ flags: [
673
+ {
674
+ name: 'store',
675
+ description: 'Context store id from the local context-store registry',
676
+ takesValue: true,
677
+ },
678
+ {
679
+ name: 'store-path',
680
+ description: 'Existing local context store root',
681
+ takesValue: true,
682
+ },
683
+ COMMON_FLAGS.json,
684
+ ],
685
+ },
686
+ {
687
+ name: 'ls',
688
+ description: 'List initiatives across registered context stores',
689
+ flags: [
690
+ {
691
+ name: 'store',
692
+ description: 'Context store id from the local context-store registry',
693
+ takesValue: true,
694
+ },
695
+ {
696
+ name: 'store-path',
697
+ description: 'Existing local context store root',
698
+ takesValue: true,
699
+ },
700
+ COMMON_FLAGS.json,
701
+ ],
702
+ },
703
+ ],
704
+ },
320
705
  {
321
706
  name: 'feedback',
322
707
  description: 'Submit feedback about OpenSpec',
323
708
  acceptsPositional: true,
709
+ positionals: [{ name: 'message' }],
324
710
  flags: [
325
711
  {
326
712
  name: 'body',
@@ -339,6 +725,7 @@ export const COMMAND_REGISTRY = [
339
725
  description: 'Show a change proposal',
340
726
  acceptsPositional: true,
341
727
  positionalType: 'change-id',
728
+ positionals: [{ name: 'change-name', type: 'change-id', optional: true }],
342
729
  flags: [
343
730
  COMMON_FLAGS.json,
344
731
  {
@@ -368,6 +755,7 @@ export const COMMAND_REGISTRY = [
368
755
  description: 'Validate a change proposal',
369
756
  acceptsPositional: true,
370
757
  positionalType: 'change-id',
758
+ positionals: [{ name: 'change-name', type: 'change-id', optional: true }],
371
759
  flags: [
372
760
  COMMON_FLAGS.strict,
373
761
  COMMON_FLAGS.jsonValidation,
@@ -386,6 +774,7 @@ export const COMMAND_REGISTRY = [
386
774
  description: 'Show a specification',
387
775
  acceptsPositional: true,
388
776
  positionalType: 'spec-id',
777
+ positionals: [{ name: 'spec-id', type: 'spec-id', optional: true }],
389
778
  flags: [
390
779
  COMMON_FLAGS.json,
391
780
  {
@@ -421,6 +810,7 @@ export const COMMAND_REGISTRY = [
421
810
  description: 'Validate a specification',
422
811
  acceptsPositional: true,
423
812
  positionalType: 'spec-id',
813
+ positionals: [{ name: 'spec-id', type: 'spec-id', optional: true }],
424
814
  flags: [
425
815
  COMMON_FLAGS.strict,
426
816
  COMMON_FLAGS.jsonValidation,
@@ -439,6 +829,7 @@ export const COMMAND_REGISTRY = [
439
829
  description: 'Generate completion script for a shell (outputs to stdout)',
440
830
  acceptsPositional: true,
441
831
  positionalType: 'shell',
832
+ positionals: [{ name: 'shell', type: 'shell', optional: true }],
442
833
  flags: [],
443
834
  },
444
835
  {
@@ -446,6 +837,7 @@ export const COMMAND_REGISTRY = [
446
837
  description: 'Install completion script for a shell',
447
838
  acceptsPositional: true,
448
839
  positionalType: 'shell',
840
+ positionals: [{ name: 'shell', type: 'shell', optional: true }],
449
841
  flags: [
450
842
  {
451
843
  name: 'verbose',
@@ -458,6 +850,7 @@ export const COMMAND_REGISTRY = [
458
850
  description: 'Uninstall completion script for a shell',
459
851
  acceptsPositional: true,
460
852
  positionalType: 'shell',
853
+ positionals: [{ name: 'shell', type: 'shell', optional: true }],
461
854
  flags: [
462
855
  {
463
856
  name: 'yes',
@@ -496,12 +889,14 @@ export const COMMAND_REGISTRY = [
496
889
  name: 'get',
497
890
  description: 'Get a specific value (raw, scriptable)',
498
891
  acceptsPositional: true,
892
+ positionals: [{ name: 'key' }],
499
893
  flags: [],
500
894
  },
501
895
  {
502
896
  name: 'set',
503
897
  description: 'Set a value (auto-coerce types)',
504
898
  acceptsPositional: true,
899
+ positionals: [{ name: 'key' }, { name: 'value' }],
505
900
  flags: [
506
901
  {
507
902
  name: 'string',
@@ -517,6 +912,7 @@ export const COMMAND_REGISTRY = [
517
912
  name: 'unset',
518
913
  description: 'Remove a key (revert to default)',
519
914
  acceptsPositional: true,
915
+ positionals: [{ name: 'key' }],
520
916
  flags: [],
521
917
  },
522
918
  {
@@ -542,6 +938,8 @@ export const COMMAND_REGISTRY = [
542
938
  {
543
939
  name: 'profile',
544
940
  description: 'Configure workflow profile (interactive picker or preset shortcut)',
941
+ acceptsPositional: true,
942
+ positionals: [{ name: 'preset', optional: true }],
545
943
  flags: [],
546
944
  },
547
945
  ],
@@ -556,6 +954,7 @@ export const COMMAND_REGISTRY = [
556
954
  description: 'Show where a schema resolves from',
557
955
  acceptsPositional: true,
558
956
  positionalType: 'schema-name',
957
+ positionals: [{ name: 'name', type: 'schema-name', optional: true }],
559
958
  flags: [
560
959
  COMMON_FLAGS.json,
561
960
  {
@@ -569,6 +968,7 @@ export const COMMAND_REGISTRY = [
569
968
  description: 'Validate a schema structure and templates',
570
969
  acceptsPositional: true,
571
970
  positionalType: 'schema-name',
971
+ positionals: [{ name: 'name', type: 'schema-name', optional: true }],
572
972
  flags: [
573
973
  COMMON_FLAGS.json,
574
974
  {
@@ -582,6 +982,10 @@ export const COMMAND_REGISTRY = [
582
982
  description: 'Copy an existing schema to project for customization',
583
983
  acceptsPositional: true,
584
984
  positionalType: 'schema-name',
985
+ positionals: [
986
+ { name: 'source', type: 'schema-name' },
987
+ { name: 'name', optional: true },
988
+ ],
585
989
  flags: [
586
990
  COMMON_FLAGS.json,
587
991
  {
@@ -594,6 +998,7 @@ export const COMMAND_REGISTRY = [
594
998
  name: 'init',
595
999
  description: 'Create a new project-local schema',
596
1000
  acceptsPositional: true,
1001
+ positionals: [{ name: 'name' }],
597
1002
  flags: [
598
1003
  COMMON_FLAGS.json,
599
1004
  {