create-quiver 0.12.0 → 0.13.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 (158) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +65 -25
  3. package/README_FOR_AI.md +36 -29
  4. package/ROADMAP.md +22 -3
  5. package/docs/AI_ONBOARDING_PROMPT.md.template +7 -1
  6. package/docs/COMMANDS.md.template +53 -20
  7. package/docs/STATUS.md.template +5 -1
  8. package/docs/WORKFLOW.md.template +13 -11
  9. package/package.json +10 -3
  10. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/EVIDENCE_REPORT.md +293 -0
  11. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/EXECUTION_PLAN.md +58 -0
  12. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/SPEC.md +242 -0
  13. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/STATUS.md +35 -0
  14. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/pr.md +77 -0
  15. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +34 -0
  16. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +52 -0
  17. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-00-spec-foundation/slice.json +52 -0
  18. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-01-cli-contract-compatibility/CLOSURE_BRIEF.md +36 -0
  19. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-01-cli-contract-compatibility/EXECUTION_BRIEF.md +52 -0
  20. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-01-cli-contract-compatibility/slice.json +56 -0
  21. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-02-run-state-phase-locks/CLOSURE_BRIEF.md +43 -0
  22. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-02-run-state-phase-locks/EXECUTION_BRIEF.md +54 -0
  23. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-02-run-state-phase-locks/slice.json +52 -0
  24. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-03-safe-ai-onboarding-docs/CLOSURE_BRIEF.md +35 -0
  25. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-03-safe-ai-onboarding-docs/EXECUTION_BRIEF.md +53 -0
  26. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-03-safe-ai-onboarding-docs/slice.json +54 -0
  27. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-04-agent-profiles-adapters/CLOSURE_BRIEF.md +34 -0
  28. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-04-agent-profiles-adapters/EXECUTION_BRIEF.md +54 -0
  29. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-04-agent-profiles-adapters/slice.json +52 -0
  30. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-05-approval-gates/CLOSURE_BRIEF.md +34 -0
  31. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-05-approval-gates/EXECUTION_BRIEF.md +54 -0
  32. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-05-approval-gates/slice.json +53 -0
  33. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-06-spec-slice-generator/CLOSURE_BRIEF.md +33 -0
  34. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-06-spec-slice-generator/EXECUTION_BRIEF.md +56 -0
  35. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-06-spec-slice-generator/slice.json +55 -0
  36. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-07-slice-execution-planner/CLOSURE_BRIEF.md +33 -0
  37. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-07-slice-execution-planner/EXECUTION_BRIEF.md +54 -0
  38. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-07-slice-execution-planner/slice.json +52 -0
  39. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-08-controlled-slice-execution/CLOSURE_BRIEF.md +39 -0
  40. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-08-controlled-slice-execution/EXECUTION_BRIEF.md +56 -0
  41. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-08-controlled-slice-execution/slice.json +53 -0
  42. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-09-git-worktree-pr-lifecycle/CLOSURE_BRIEF.md +38 -0
  43. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-09-git-worktree-pr-lifecycle/EXECUTION_BRIEF.md +57 -0
  44. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-09-git-worktree-pr-lifecycle/slice.json +52 -0
  45. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-10-validation-errors-fixtures/CLOSURE_BRIEF.md +39 -0
  46. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-10-validation-errors-fixtures/EXECUTION_BRIEF.md +55 -0
  47. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-10-validation-errors-fixtures/slice.json +56 -0
  48. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-11-export-dashboard-migration/CLOSURE_BRIEF.md +36 -0
  49. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-11-export-dashboard-migration/EXECUTION_BRIEF.md +54 -0
  50. package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-11-export-dashboard-migration/slice.json +53 -0
  51. package/specs/quiver-v26-0121-smoke-hardening/EVIDENCE_REPORT.md +208 -0
  52. package/specs/quiver-v26-0121-smoke-hardening/EXECUTION_PLAN.md +57 -0
  53. package/specs/quiver-v26-0121-smoke-hardening/SPEC.md +137 -0
  54. package/specs/quiver-v26-0121-smoke-hardening/STATUS.md +32 -0
  55. package/specs/quiver-v26-0121-smoke-hardening/pr.md +96 -0
  56. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-00-docs-foundation/CLOSURE_BRIEF.md +35 -0
  57. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-00-docs-foundation/EXECUTION_BRIEF.md +55 -0
  58. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-00-docs-foundation/slice.json +73 -0
  59. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-01-cli-help-version-contract/CLOSURE_BRIEF.md +38 -0
  60. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-01-cli-help-version-contract/EXECUTION_BRIEF.md +51 -0
  61. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-01-cli-help-version-contract/slice.json +76 -0
  62. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-02-init-doc-links-and-flow-guidance/CLOSURE_BRIEF.md +37 -0
  63. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-02-init-doc-links-and-flow-guidance/EXECUTION_BRIEF.md +52 -0
  64. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-02-init-doc-links-and-flow-guidance/slice.json +75 -0
  65. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-03-ai-approval-review-consistency/CLOSURE_BRIEF.md +37 -0
  66. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-03-ai-approval-review-consistency/EXECUTION_BRIEF.md +53 -0
  67. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-03-ai-approval-review-consistency/slice.json +77 -0
  68. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-04-local-validation-brief-contracts/CLOSURE_BRIEF.md +35 -0
  69. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-04-local-validation-brief-contracts/EXECUTION_BRIEF.md +52 -0
  70. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-04-local-validation-brief-contracts/slice.json +77 -0
  71. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-05-demo-scaffold-readiness/CLOSURE_BRIEF.md +34 -0
  72. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-05-demo-scaffold-readiness/EXECUTION_BRIEF.md +54 -0
  73. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-05-demo-scaffold-readiness/slice.json +84 -0
  74. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-06-plan-graph-scope-performance/CLOSURE_BRIEF.md +35 -0
  75. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-06-plan-graph-scope-performance/EXECUTION_BRIEF.md +53 -0
  76. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-06-plan-graph-scope-performance/slice.json +82 -0
  77. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-07-smoke-release-readiness/CLOSURE_BRIEF.md +35 -0
  78. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-07-smoke-release-readiness/EXECUTION_BRIEF.md +55 -0
  79. package/specs/quiver-v26-0121-smoke-hardening/slices/slice-07-smoke-release-readiness/slice.json +92 -0
  80. package/specs/quiver-v27-reliability-ai-workflow-hardening/AUDIT_V24_V25_V26.md +67 -0
  81. package/specs/quiver-v27-reliability-ai-workflow-hardening/COMMAND_CONTRACTS.md +125 -0
  82. package/specs/quiver-v27-reliability-ai-workflow-hardening/COVERAGE_MATRIX.md +74 -0
  83. package/specs/quiver-v27-reliability-ai-workflow-hardening/EVIDENCE_REPORT.md +179 -0
  84. package/specs/quiver-v27-reliability-ai-workflow-hardening/EXECUTION_PLAN.md +71 -0
  85. package/specs/quiver-v27-reliability-ai-workflow-hardening/SPEC.md +176 -0
  86. package/specs/quiver-v27-reliability-ai-workflow-hardening/STATUS.md +37 -0
  87. package/specs/quiver-v27-reliability-ai-workflow-hardening/pr.md +132 -0
  88. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-00-docs-audit-coverage-and-contracts/CLOSURE_BRIEF.md +36 -0
  89. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-00-docs-audit-coverage-and-contracts/EXECUTION_BRIEF.md +56 -0
  90. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-00-docs-audit-coverage-and-contracts/slice.json +75 -0
  91. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-01-core-state-resolver-and-canonical-statuses/CLOSURE_BRIEF.md +37 -0
  92. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-01-core-state-resolver-and-canonical-statuses/EXECUTION_BRIEF.md +54 -0
  93. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-01-core-state-resolver-and-canonical-statuses/slice.json +79 -0
  94. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-02-json-export-contract-and-machine-output/CLOSURE_BRIEF.md +34 -0
  95. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-02-json-export-contract-and-machine-output/EXECUTION_BRIEF.md +54 -0
  96. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-02-json-export-contract-and-machine-output/slice.json +75 -0
  97. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-03-approved-plan-to-spec-create/CLOSURE_BRIEF.md +36 -0
  98. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-03-approved-plan-to-spec-create/EXECUTION_BRIEF.md +55 -0
  99. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-03-approved-plan-to-spec-create/slice.json +78 -0
  100. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-04-ai-artifact-storage-redaction-and-token-compaction/CLOSURE_BRIEF.md +31 -0
  101. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-04-ai-artifact-storage-redaction-and-token-compaction/EXECUTION_BRIEF.md +55 -0
  102. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-04-ai-artifact-storage-redaction-and-token-compaction/slice.json +77 -0
  103. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-05-worktree-lifecycle-locks-and-recovery/CLOSURE_BRIEF.md +31 -0
  104. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-05-worktree-lifecycle-locks-and-recovery/EXECUTION_BRIEF.md +55 -0
  105. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-05-worktree-lifecycle-locks-and-recovery/slice.json +84 -0
  106. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-06-validation-gates-and-scope-safety/CLOSURE_BRIEF.md +32 -0
  107. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-06-validation-gates-and-scope-safety/EXECUTION_BRIEF.md +57 -0
  108. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-06-validation-gates-and-scope-safety/slice.json +99 -0
  109. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-07-context-analysis-and-doctor-flow/CLOSURE_BRIEF.md +31 -0
  110. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-07-context-analysis-and-doctor-flow/EXECUTION_BRIEF.md +57 -0
  111. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-07-context-analysis-and-doctor-flow/slice.json +88 -0
  112. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-08-cross-platform-help-auth-and-dx/CLOSURE_BRIEF.md +31 -0
  113. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-08-cross-platform-help-auth-and-dx/EXECUTION_BRIEF.md +56 -0
  114. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-08-cross-platform-help-auth-and-dx/slice.json +85 -0
  115. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-09-fixtures-smoke-docs-and-release-readiness/CLOSURE_BRIEF.md +32 -0
  116. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-09-fixtures-smoke-docs-and-release-readiness/EXECUTION_BRIEF.md +56 -0
  117. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-09-fixtures-smoke-docs-and-release-readiness/slice.json +91 -0
  118. package/src/create-quiver/commands/ai.js +652 -27
  119. package/src/create-quiver/commands/flow.js +58 -9
  120. package/src/create-quiver/commands/graph.js +11 -9
  121. package/src/create-quiver/commands/plan.js +7 -16
  122. package/src/create-quiver/commands/spec.js +282 -0
  123. package/src/create-quiver/index.js +409 -31
  124. package/src/create-quiver/lib/actionable-error.js +27 -0
  125. package/src/create-quiver/lib/agent-profiles.js +16 -4
  126. package/src/create-quiver/lib/ai/artifacts.js +318 -0
  127. package/src/create-quiver/lib/ai/context-packs.js +4 -0
  128. package/src/create-quiver/lib/ai/execution-plan.js +16 -1
  129. package/src/create-quiver/lib/ai/executor.js +272 -21
  130. package/src/create-quiver/lib/ai/export-state.js +679 -0
  131. package/src/create-quiver/lib/ai/github.js +162 -2
  132. package/src/create-quiver/lib/ai/onboarding-template.js +215 -2
  133. package/src/create-quiver/lib/ai/plan-review.js +7 -2
  134. package/src/create-quiver/lib/ai/providers.js +4 -3
  135. package/src/create-quiver/lib/ai/run-state.js +414 -0
  136. package/src/create-quiver/lib/ai/spec-generator.js +84 -13
  137. package/src/create-quiver/lib/ai/spec-templates.js +150 -21
  138. package/src/create-quiver/lib/analyze.js +2 -2
  139. package/src/create-quiver/lib/approvals.js +36 -5
  140. package/src/create-quiver/lib/demo.js +189 -14
  141. package/src/create-quiver/lib/doctor.js +154 -0
  142. package/src/create-quiver/lib/git.js +40 -1
  143. package/src/create-quiver/lib/handoff.js +123 -12
  144. package/src/create-quiver/lib/init-docs.js +35 -13
  145. package/src/create-quiver/lib/init-layout.js +9 -0
  146. package/src/create-quiver/lib/json.js +53 -3
  147. package/src/create-quiver/lib/lifecycle.js +52 -3
  148. package/src/create-quiver/lib/locks.js +134 -0
  149. package/src/create-quiver/lib/package-safety.js +7 -0
  150. package/src/create-quiver/lib/paths.js +74 -0
  151. package/src/create-quiver/lib/project-scan.js +74 -0
  152. package/src/create-quiver/lib/project-state-resolver.js +236 -0
  153. package/src/create-quiver/lib/readiness.js +66 -10
  154. package/src/create-quiver/lib/scope.js +52 -8
  155. package/src/create-quiver/lib/slice-graph.js +138 -38
  156. package/src/create-quiver/lib/slice.js +14 -5
  157. package/src/create-quiver/lib/spec-worktrees.js +129 -32
  158. package/src/create-quiver/lib/statuses.js +115 -0
@@ -9,7 +9,29 @@ const {
9
9
  collectDoctorReport,
10
10
  formatDoctorFixPlan,
11
11
  } = require('./lib/doctor');
12
- const { runAgent: runAiAgent, runApprovalStatus: runAiApprovalStatus, runApprove: runAiApprove, runDoctor: runAiDoctor, runExecutePlan: runAiExecutePlan, runExecuteSlice: runAiExecuteSlice, runOnboard, runPlan: runAiPlan, runPrepareContext: runAiPrepareContext, runPr: runAiPr, runPromptSlice: runAiPromptSlice, runReviewPlan: runAiReviewPlan } = require('./commands/ai');
12
+ const {
13
+ runAgent: runAiAgent,
14
+ runApprovalStatus: runAiApprovalStatus,
15
+ runApprove: runAiApprove,
16
+ runDoctor: runAiDoctor,
17
+ runExecutePlan: runAiExecutePlan,
18
+ runExecuteSlice: runAiExecuteSlice,
19
+ runExport: runAiExport,
20
+ runInspect: runAiInspect,
21
+ runLifecycleResume: runAiLifecycleResume,
22
+ runLifecycleRun: runAiLifecycleRun,
23
+ runLifecycleStatus: runAiLifecycleStatus,
24
+ runOnboard,
25
+ runPlan: runAiPlan,
26
+ runPrepareContext: runAiPrepareContext,
27
+ runPr: runAiPr,
28
+ runPromptSlice: runAiPromptSlice,
29
+ runReviewPlan: runAiReviewPlan,
30
+ runRevise: runAiRevise,
31
+ runSlicesList: runAiSlicesList,
32
+ runSpecsList: runAiSpecsList,
33
+ runTraceReport: runAiTraceReport,
34
+ } = require('./commands/ai');
13
35
  const { runDemo } = require('./commands/demo');
14
36
  const { runPrepare } = require('./commands/prepare');
15
37
  const { runEvidence } = require('./commands/evidence');
@@ -17,9 +39,14 @@ const { runFlow } = require('./commands/flow');
17
39
  const { runGraph } = require('./commands/graph');
18
40
  const { runNext } = require('./commands/next');
19
41
  const { runPlan } = require('./commands/plan');
20
- const { runCreateSpec } = require('./commands/spec');
42
+ const { runCreateSpec, runValidateSpec } = require('./commands/spec');
21
43
  const { buildInitLayout, formatInitLayoutPlan } = require('./lib/init-layout');
22
- const { initializeProjectDocs, installSelfAsDevDep, refreshAiContextDoc } = require('./lib/init-docs');
44
+ const {
45
+ formatInstallSelfCommand,
46
+ initializeProjectDocs,
47
+ installSelfAsDevDep,
48
+ refreshAiContextDoc,
49
+ } = require('./lib/init-docs');
23
50
  const { checkPrReadiness, checkScope, checkSliceReadiness } = require('./lib/readiness');
24
51
  const { cleanupSlice, refreshActiveSlicesBoard, startSlice } = require('./lib/lifecycle');
25
52
  const { buildSpecStatus, closeSpecWorktree, formatSpecCloseResult, formatSpecStartResult, formatSpecStatus, startSpecWorktree } = require('./lib/spec-worktrees');
@@ -80,15 +107,24 @@ const SUPPORTED_AI_COMMANDS = new Set([
80
107
  'execute-plan',
81
108
  'execute-slice',
82
109
  'executor-prompt',
110
+ 'export',
111
+ 'inspect',
83
112
  'onboard',
84
113
  'plan',
85
114
  'prepare-context',
86
115
  'pr',
87
116
  'prompt-slice',
88
117
  'review-plan',
118
+ 'revise',
119
+ 'resume',
120
+ 'run',
121
+ 'slices',
122
+ 'specs',
123
+ 'status',
124
+ 'trace',
89
125
  ]);
90
126
 
91
- const SUPPORTED_SPEC_COMMANDS = new Set(['close', 'create', 'start', 'status']);
127
+ const SUPPORTED_SPEC_COMMANDS = new Set(['close', 'create', 'start', 'status', 'validate']);
92
128
  const SUPPORTED_DEMO_COMMANDS = new Set(['create']);
93
129
 
94
130
  function unsupportedCommandMessage(commandName) {
@@ -100,6 +136,104 @@ function unsupportedCommandMessage(commandName) {
100
136
  ].join('\n');
101
137
  }
102
138
 
139
+ const COMMAND_HELP_GROUPS = [
140
+ {
141
+ title: 'Bootstrap and project context',
142
+ commands: [
143
+ ['init', 'Create the default AI-first Quiver contract in the current project.'],
144
+ ['analyze', 'Scan the project and write docs/PROJECT_MAP.md plus .quiver scan data.'],
145
+ ['doctor', 'Validate the Quiver layout, generated docs, environment, and next safe steps.'],
146
+ ['flow', 'Show the read-only guided workflow stage, blockers, and next safe command.'],
147
+ ['prepare', 'Run setup diagnostics for providers, GitHub, SSH, and project readiness.'],
148
+ ['migrate', 'Upgrade an already initialized Quiver project to the current contract.'],
149
+ ],
150
+ },
151
+ {
152
+ title: 'Planning and slice navigation',
153
+ commands: [
154
+ ['plan', 'List slices in execution order with critical path and optional JSON output.'],
155
+ ['graph', 'Render slice dependencies as tree, Mermaid, DOT, or JSON-ready graph output.'],
156
+ ['next', 'Print the next ready slice or every ready slice with --all-ready.'],
157
+ ],
158
+ },
159
+ {
160
+ title: 'AI lifecycle',
161
+ commands: [
162
+ ['ai run create', 'Create a durable AI lifecycle run from a requirements file.'],
163
+ ['ai status', 'Show current AI lifecycle phase, approved versions, blockers, and next command.'],
164
+ ['ai resume', 'Resume guidance from the last valid lifecycle phase without chat memory.'],
165
+ ['ai onboard', 'Run or print the planner onboarding prompt with a token-aware context pack.'],
166
+ ['ai prepare-context', 'Preview or write docs-only AI context updates with assumptions and risks.'],
167
+ ['ai agent set|list|show', 'Manage planner, executor, reviewer, and doctor provider profiles without secrets; use set --dry-run to preview.'],
168
+ ['ai plan', 'Generate versioned planner drafts for acceptance criteria, technical plan, or spec phase.'],
169
+ ['ai revise', 'Create a new planner draft from human feedback without approving it.'],
170
+ ['ai review-plan', 'Review the technical-plan draft for production readiness before approval.'],
171
+ ['ai approve', 'Approve a concrete saved draft version for the next planner phase.'],
172
+ ['ai approvals', 'Inspect approval status and saved planner drafts.'],
173
+ ['ai prompt-slice', 'Print a minimal executor prompt for one slice without provider execution.'],
174
+ ['ai execute-slice', 'Execute one slice with scope checks, redacted evidence, closure updates, and optional commit.'],
175
+ ['ai execute-plan', 'Print or execute dependency-safe waves in manual or delegated mode.'],
176
+ ['ai doctor', 'Run GitHub, SSH, and PR readiness preflight checks.'],
177
+ ['ai pr', 'Validate and optionally create a GitHub PR from the generated PR body.'],
178
+ ],
179
+ },
180
+ {
181
+ title: 'Inspection and export',
182
+ commands: [
183
+ ['ai inspect', 'Show dashboard-friendly lifecycle state for specs, slices, runs, agents, and blockers.'],
184
+ ['ai export', 'Export lifecycle state as JSON or Markdown for dashboards, PRs, or other agents.'],
185
+ ['ai specs list', 'List specs with status, progress, slice counts, and paths.'],
186
+ ['ai slices list', 'List slices with status, dependencies, blockers, and optional JSON.'],
187
+ ['ai trace report', 'Report AI runs, execution waves, and migration guidance.'],
188
+ ],
189
+ },
190
+ {
191
+ title: 'Specs, slices, and validation',
192
+ commands: [
193
+ ['spec create', 'Create the real spec tree from a reviewed approved technical plan.'],
194
+ ['spec start', 'Create or reuse the dedicated worktree and branch for one spec.'],
195
+ ['spec status', 'Show spec worktree, branch, slice-00 state, and pending slices.'],
196
+ ['spec validate', 'Validate spec docs, slices, briefs, evidence, status, dependencies, and safe paths.'],
197
+ ['spec close', 'Close a merged clean spec worktree and guide local sync.'],
198
+ ['start-slice', 'Start work on one slice and mark it active.'],
199
+ ['check-slice', 'Validate slice structure, dependencies, scope, and readiness.'],
200
+ ['check-pr', 'Validate PR readiness for a slice/spec workflow.'],
201
+ ['check-scope', 'Compare changed files against a slice scope.'],
202
+ ['cleanup-slice', 'Clean active-slice state after a slice finishes or is discarded.'],
203
+ ['refresh-active-slices', 'Refresh generated active-slice boards.'],
204
+ ['check-handoff', 'Validate a transfer handoff or per-slice execution/closure brief.'],
205
+ ['new-handoff', 'Create a handoff scaffold for exceptional context transfer.'],
206
+ ],
207
+ },
208
+ {
209
+ title: 'Evidence and demos',
210
+ commands: [
211
+ ['evidence run', 'Run a command and record exit code, duration, redacted output, and Markdown evidence.'],
212
+ ['demo create spec-viewer', 'Create or preview the optional static Quiver Spec Viewer demo scaffold.'],
213
+ ],
214
+ },
215
+ {
216
+ title: 'Shortcuts and compatibility',
217
+ commands: [
218
+ ['--name "<project>"', 'Compatibility alias for init when bootstrapping a project.'],
219
+ ['--version / -V', 'Print the installed create-quiver package version.'],
220
+ ['--help / help', 'Show this command reference.'],
221
+ ['quiver', 'Local installed alias to the same CLI; use npx create-quiver for bootstrap.'],
222
+ ],
223
+ },
224
+ ];
225
+
226
+ function formatCommandHelpGroups() {
227
+ const lines = ['Commands:'];
228
+ for (const group of COMMAND_HELP_GROUPS) {
229
+ lines.push('', `${group.title}:`);
230
+ for (const [command, description] of group.commands) {
231
+ lines.push(` ${command.padEnd(24)} ${description}`);
232
+ }
233
+ }
234
+ return lines.join('\n');
235
+ }
236
+
103
237
  function printUsage() {
104
238
  console.log(`Usage:
105
239
  npx create-quiver [options]
@@ -108,8 +242,17 @@ function printUsage() {
108
242
  npx create-quiver flow [options]
109
243
  npx create-quiver plan [options]
110
244
  npx create-quiver ai <task> [options]
245
+ npx create-quiver ai run create --input <requirements.md>
246
+ npx create-quiver ai status [options]
247
+ npx create-quiver ai resume [options]
248
+ npx create-quiver ai inspect [options]
249
+ npx create-quiver ai export [--format json|markdown]
250
+ npx create-quiver ai specs list [--json]
251
+ npx create-quiver ai slices list [--json]
252
+ npx create-quiver ai trace report [options]
111
253
  npx create-quiver ai agent <set|list|show> [role] [options]
112
254
  npx create-quiver ai prepare-context [options]
255
+ npx create-quiver ai revise [options]
113
256
  npx create-quiver graph [options]
114
257
  npx create-quiver next [options]
115
258
  npx create-quiver migrate [options]
@@ -118,7 +261,7 @@ function printUsage() {
118
261
  npx create-quiver start-slice [options] <slice.json>
119
262
  npx create-quiver check-slice [options] <slice.json>
120
263
  npx create-quiver check-pr <slice.json>
121
- npx create-quiver check-handoff <handoff.md>
264
+ npx create-quiver check-handoff <handoff-or-brief.md>
122
265
  npx create-quiver new-handoff <spec-slug>
123
266
  npx create-quiver cleanup-slice [options] <slice.json>
124
267
  npx create-quiver check-scope [options] <slice.json>
@@ -126,15 +269,18 @@ function printUsage() {
126
269
  npx create-quiver spec create [options]
127
270
  npx create-quiver spec start <spec-dir>
128
271
  npx create-quiver spec status <spec-dir>
272
+ npx create-quiver spec validate <spec-dir>
129
273
  npx create-quiver spec close <spec-dir>
130
274
  npx create-quiver evidence run [options] -- <command>
131
275
  npx create-quiver demo create spec-viewer [options]
132
276
 
277
+ ${formatCommandHelpGroups()}
278
+
133
279
  Options:
134
280
  -n, --name <project-name> Project name to generate
135
281
  -d, --dir <target-dir> Target directory to scaffold into or inspect
136
282
  --spec <slug> Restrict plan output to one spec
137
- --format <name> Graph output format (tree, mermaid, dot)
283
+ --format <name> Graph or AI export output format (tree, mermaid, dot, json, markdown)
138
284
  --show-conflicts Show shared file paths in graph output
139
285
  --level <n> Restrict graph output to one level
140
286
  --json Emit machine-readable JSON
@@ -143,12 +289,14 @@ Options:
143
289
  --all-ready List every ready slice returned by next
144
290
  --auto-start Prompt for confirmation and run start-slice on next
145
291
  --local For check-slice, run structural validation without remote/base checks
292
+ --strict Treat supported validation warnings as failures
146
293
  --unicode Prefer Unicode output when supported
147
294
  --minimal Plan or run the minimal init profile
148
295
  --full Plan or run the full compatibility init profile
149
296
  --legacy-scripts Include legacy Bash wrappers in init profile
150
297
  --include-templates Export packaged templates in init profile
151
- --dry-run Preview init, prepare, spec create, demo, or AI work without executing writes/providers
298
+ --dry-run Preview init, analyze, migrate, prepare, spec create/start/close, demo, ai agent set, or AI work without executing writes/providers
299
+ --print-prompt Print the exact AI prompt and exit without executing provider CLIs
152
300
  --fix For doctor, apply safe non-destructive repairs
153
301
  --execute For ai execute-plan, run the planned slices instead of printing commands
154
302
  --create For ai pr, create the PR after preflight instead of printing the plan only
@@ -158,14 +306,16 @@ Options:
158
306
  --provider <name> Provider CLI to preflight for prepare or AI commands
159
307
  --model <label> Free-form model label for AI agent profiles
160
308
  --version <n> Draft version to approve for AI planner phases
309
+ --run <id> AI lifecycle run id
161
310
  --ssh-host-alias <name> SSH host alias to validate for prepare or AI commands
162
311
  --identity-file <path> SSH identity file to validate for prepare or AI commands
163
312
  --remote <name> Git remote name for check-slice or AI PR checks
164
- --base <branch> Base branch for check-slice, ai pr, or spec close (default: main)
313
+ --base <branch> Base branch for check-slice, check-scope, ai pr, or spec close (default: main)
165
314
  --output <file> Output file for evidence run
166
315
  --max-output <n> Maximum stdout/stderr chars per evidence section
167
316
  --title <text> Override PR title for ai pr create
168
317
  -y, --yes Skip prompts and use the provided inputs
318
+ -V, --version Show the installed create-quiver version
169
319
  -h, --help Show this help message
170
320
 
171
321
  Examples:
@@ -177,15 +327,28 @@ Examples:
177
327
  cd ./my-project && npx create-quiver analyze
178
328
  cd ./my-project && npx create-quiver plan --json
179
329
  cd ./my-project && npx create-quiver ai onboard --dry-run
330
+ cd ./my-project && npx create-quiver ai onboard --print-prompt
180
331
  cd ./my-project && npx create-quiver ai prepare-context --dry-run
332
+ cd ./my-project && npx create-quiver ai run create --input requirements.md
333
+ cd ./my-project && npx create-quiver ai status
334
+ cd ./my-project && npx create-quiver ai resume
335
+ cd ./my-project && npx create-quiver ai inspect
336
+ cd ./my-project && npx create-quiver ai export --format json
337
+ cd ./my-project && npx create-quiver ai export --format markdown
338
+ cd ./my-project && npx create-quiver ai specs list
339
+ cd ./my-project && npx create-quiver ai slices list --json
340
+ cd ./my-project && npx create-quiver ai trace report
341
+ cd ./my-project && npx create-quiver ai agent set planner --provider codex --model gpt-5.5 --dry-run
181
342
  cd ./my-project && npx create-quiver ai agent set planner --provider codex --model gpt-5.5
182
343
  cd ./my-project && npx create-quiver ai agent list
183
344
  cd ./my-project && npx create-quiver ai plan --phase acceptance --input requirements.md --dry-run
184
- cd ./my-project && npx create-quiver ai approve --phase acceptance --input acceptance.md
345
+ cd ./my-project && npx create-quiver ai revise --phase acceptance --input feedback.md --dry-run
346
+ cd ./my-project && npx create-quiver ai approve --phase acceptance --version 1
185
347
  cd ./my-project && npx create-quiver ai plan --phase technical-plan --dry-run
186
348
  cd ./my-project && npx create-quiver ai review-plan --dry-run
187
349
  cd ./my-project && npx create-quiver ai approve --phase technical-plan --version 1
188
350
  cd ./my-project && npx create-quiver spec create --dry-run
351
+ cd ./my-project && npx create-quiver spec start specs/my-project --dry-run
189
352
  cd ./my-project && npx create-quiver ai approvals
190
353
  cd ./my-project && npx create-quiver ai prompt-slice --slice specs/my-project/slices/slice-01/slice.json --dry-run
191
354
  cd ./my-project && npx create-quiver ai execute-slice --slice specs/my-project/slices/slice-01/slice.json --dry-run
@@ -207,12 +370,14 @@ Examples:
207
370
  cd ./my-project && npx create-quiver check-slice specs/my-project/slices/slice-01/slice.json
208
371
  cd ./my-project && npx create-quiver check-pr specs/my-project/slices/slice-01/slice.json
209
372
  cd ./my-project && npx create-quiver check-handoff specs/my-project/HANDOFF.md
373
+ cd ./my-project && npx create-quiver check-handoff specs/my-project/slices/slice-01/EXECUTION_BRIEF.md
210
374
  cd ./my-project && npx create-quiver new-handoff my-spec
211
375
  cd ./my-project && npx create-quiver cleanup-slice specs/my-project/slices/slice-01/slice.json
212
376
  cd ./my-project && npx create-quiver check-scope specs/my-project/slices/slice-01/slice.json
213
377
  cd ./my-project && npx create-quiver refresh-active-slices
214
378
  cd ./my-project && npx create-quiver spec start specs/my-project
215
379
  cd ./my-project && npx create-quiver spec status specs/my-project
380
+ cd ./my-project && npx create-quiver spec validate specs/my-project
216
381
  cd ./my-project && npx create-quiver spec close specs/my-project --dry-run
217
382
  cd ./my-project && npx create-quiver evidence run -- npm test
218
383
  cd ./my-project && npx create-quiver demo create spec-viewer --dry-run
@@ -232,6 +397,7 @@ function parseArgs(argv) {
232
397
  discard: false,
233
398
  doctorFix: false,
234
399
  dryRun: false,
400
+ aiPrintPrompt: false,
235
401
  gate: 'execution',
236
402
  projectName: '',
237
403
  targetDir: '.',
@@ -245,12 +411,16 @@ function parseArgs(argv) {
245
411
  autoStart: false,
246
412
  specSlug: '',
247
413
  format: 'tree',
414
+ formatExplicit: false,
248
415
  showConflicts: false,
249
416
  level: null,
250
417
  unicode: false,
251
418
  aiCommand: '',
419
+ aiSecondaryCommand: '',
252
420
  aiAgentCommand: '',
253
421
  aiAgentRole: '',
422
+ aiRunCommand: '',
423
+ aiRunId: '',
254
424
  aiPhase: 'acceptance',
255
425
  aiProvider: 'codex',
256
426
  aiProviderExplicit: false,
@@ -396,6 +566,11 @@ function parseArgs(argv) {
396
566
  continue;
397
567
  }
398
568
 
569
+ if (arg === '--print-prompt') {
570
+ result.aiPrintPrompt = true;
571
+ continue;
572
+ }
573
+
399
574
  if (arg === '--commit') {
400
575
  result.aiCommit = true;
401
576
  continue;
@@ -476,6 +651,7 @@ function parseArgs(argv) {
476
651
  throw new Error(formatError('missing value for --format'));
477
652
  }
478
653
  result.format = value;
654
+ result.formatExplicit = true;
479
655
  continue;
480
656
  }
481
657
 
@@ -550,6 +726,15 @@ function parseArgs(argv) {
550
726
  continue;
551
727
  }
552
728
 
729
+ if (arg === '--run') {
730
+ const value = args[++index];
731
+ if (!value) {
732
+ throw new Error(formatError('missing value for --run'));
733
+ }
734
+ result.aiRunId = value;
735
+ continue;
736
+ }
737
+
553
738
  if (arg === '--role') {
554
739
  const value = args[++index];
555
740
  if (!value) {
@@ -748,6 +933,18 @@ function parseArgs(argv) {
748
933
  result.aiAgentRole = positional.shift();
749
934
  }
750
935
  }
936
+ if (result.aiCommand === 'run' && !result.aiRunCommand && positional.length > 0) {
937
+ result.aiRunCommand = positional.shift();
938
+ }
939
+ if ((result.aiCommand === 'specs' || result.aiCommand === 'slices' || result.aiCommand === 'trace') && !result.aiSecondaryCommand && positional.length > 0) {
940
+ result.aiSecondaryCommand = positional.shift();
941
+ }
942
+ if ((result.aiCommand === 'specs' || result.aiCommand === 'slices') && result.aiSecondaryCommand && result.aiSecondaryCommand !== 'list') {
943
+ throw new Error(formatError(`unsupported ai ${result.aiCommand} subcommand: ${result.aiSecondaryCommand}. Supported tasks: list`));
944
+ }
945
+ if (result.aiCommand === 'trace' && result.aiSecondaryCommand && result.aiSecondaryCommand !== 'report') {
946
+ throw new Error(formatError(`unsupported ai trace subcommand: ${result.aiSecondaryCommand}. Supported tasks: report`));
947
+ }
751
948
  if (positional.length > 0) {
752
949
  throw new Error(formatError('ai does not accept extra positional arguments'));
753
950
  }
@@ -764,7 +961,7 @@ function parseArgs(argv) {
764
961
  result.specCommand = positional.shift();
765
962
  }
766
963
  if (!result.specCommand) {
767
- throw new Error(formatError('missing spec subcommand. Use: npx create-quiver spec <create|start|status|close>'));
964
+ throw new Error(formatError('missing spec subcommand. Use: npx create-quiver spec <create|start|status|validate|close>'));
768
965
  }
769
966
  if (result.specCommand !== 'create' && positional.length > 0) {
770
967
  result.targetDir = positional.shift();
@@ -1387,8 +1584,8 @@ function detectFrameworks(projectRoot, files, rootEntries, packageJson) {
1387
1584
  },
1388
1585
  {
1389
1586
  name: 'vue',
1390
- matches: () => dependencies.has('vue') || rootFileSet.has('vue.config.js') || rootFileSet.has('vite.config.js') || rootFileSet.has('vite.config.ts'),
1391
- signals: ['vue', 'vue.config.*', 'vite.config.*'],
1587
+ matches: () => dependencies.has('vue') || rootFileSet.has('vue.config.js'),
1588
+ signals: ['vue', 'vue.config.*'],
1392
1589
  },
1393
1590
  {
1394
1591
  name: 'react',
@@ -1811,7 +2008,7 @@ function writeProjectScanArtifacts(projectRoot, scan) {
1811
2008
  return { jsonPath, mdPath: scanPaths.projectMapPath };
1812
2009
  }
1813
2010
 
1814
- function runAnalyze(targetDir) {
2011
+ function runAnalyze(targetDir, options = {}) {
1815
2012
  const projectRoot = resolveTargetRoot(process.cwd(), targetDir);
1816
2013
 
1817
2014
  if (!fs.existsSync(projectRoot)) {
@@ -1819,6 +2016,26 @@ function runAnalyze(targetDir) {
1819
2016
  }
1820
2017
 
1821
2018
  const scan = buildProjectScan(projectRoot);
2019
+
2020
+ if (options.dryRun) {
2021
+ console.log(`Project analysis dry-run for ${projectRoot}`);
2022
+ console.log('Writes: none');
2023
+ console.log(`Would write ${CURRENT_SCAN_RELATIVE_PATH}`);
2024
+ console.log(`Would write ${PROJECT_MAP_RELATIVE_PATH}`);
2025
+ console.log('Would refresh docs/AI_CONTEXT.md');
2026
+ console.log(`Detected primary stack: ${scan.stack.primary}`);
2027
+ console.log(`Detected frameworks: ${scan.stack.frameworks.length > 0 ? scan.stack.frameworks.join(', ') : 'none detected'}`);
2028
+ console.log(`Detected package manager: ${scan.project.package_manager}`);
2029
+ return {
2030
+ artifacts: {
2031
+ jsonPath: path.join(projectRoot, CURRENT_SCAN_RELATIVE_PATH),
2032
+ mdPath: path.join(projectRoot, PROJECT_MAP_RELATIVE_PATH),
2033
+ },
2034
+ dryRun: true,
2035
+ scan,
2036
+ };
2037
+ }
2038
+
1822
2039
  const artifacts = writeProjectScanArtifacts(projectRoot, scan);
1823
2040
  const aiContextPath = refreshAiContextDoc(projectRoot, scan);
1824
2041
  updateStateForAnalyze(projectRoot, CLI_VERSION);
@@ -1829,6 +2046,13 @@ function runAnalyze(targetDir) {
1829
2046
  console.log(`Wrote ${relativePosixPath(projectRoot, aiContextPath)}`);
1830
2047
  console.log(`Detected primary stack: ${scan.stack.primary}`);
1831
2048
  console.log(`Detected package manager: ${scan.project.package_manager}`);
2049
+
2050
+ return {
2051
+ artifacts,
2052
+ aiContextPath,
2053
+ dryRun: false,
2054
+ scan,
2055
+ };
1832
2056
  }
1833
2057
 
1834
2058
  function runMigrate(targetDir, options = {}) {
@@ -1845,9 +2069,34 @@ function runMigrate(targetDir, options = {}) {
1845
2069
  const packageJson = loadPackageJson(projectRoot);
1846
2070
  const projectName = packageJson.name || path.basename(projectRoot) || 'Quiver Project';
1847
2071
  const packageRoot = path.resolve(__dirname, '../..');
1848
- const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'quiver-migrate-'));
1849
2072
  const legacyLayout = inspectLegacyMigrationLayout(projectRoot);
1850
2073
 
2074
+ if (options.dryRun) {
2075
+ const migrationPlan = buildInitLayout(projectRoot, {
2076
+ dryRun: true,
2077
+ full: true,
2078
+ legacyScripts: true,
2079
+ projectName,
2080
+ skipInstall: options.skipInstall === true,
2081
+ });
2082
+ console.log('Quiver migration dry-run');
2083
+ console.log(`- Project: ${projectName}`);
2084
+ console.log(`- Target: ${projectRoot}`);
2085
+ console.log('- Writes: none');
2086
+ console.log(`- Planned create: ${migrationPlan.summary.create}`);
2087
+ console.log(`- Planned update: ${migrationPlan.summary.update}`);
2088
+ console.log(`- Planned preserve: ${migrationPlan.summary.preserve}`);
2089
+ if (legacyLayout.hasLegacyLayout) {
2090
+ console.log(`- Legacy layout detected and preserved: ${legacyLayout.legacyPaths.join(', ')}`);
2091
+ }
2092
+ console.log('- Next command: npx create-quiver migrate --skip-install');
2093
+ console.log('');
2094
+ console.log(formatInitLayoutPlan(migrationPlan));
2095
+ return;
2096
+ }
2097
+
2098
+ const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'quiver-migrate-'));
2099
+
1851
2100
  try {
1852
2101
  const templateRoot = packTemplate(packageRoot, tempRoot);
1853
2102
  mergeDirectoryTree(templateRoot, path.join(projectRoot, 'docs-template'));
@@ -1867,7 +2116,7 @@ function runMigrate(targetDir, options = {}) {
1867
2116
  if (installResult === 'installed') {
1868
2117
  console.log(`Added create-quiver@${CLI_VERSION} as dev dependency`);
1869
2118
  } else if (installResult === 'failed') {
1870
- console.warn(`Warning: could not install create-quiver automatically. Run: npm install -D create-quiver@${CLI_VERSION}`);
2119
+ console.warn(`Warning: could not install create-quiver automatically. Run: ${formatInstallSelfCommand(projectRoot, CLI_VERSION)}`);
1871
2120
  }
1872
2121
  }
1873
2122
 
@@ -1905,6 +2154,11 @@ function runDoctor(targetDir, options = {}) {
1905
2154
 
1906
2155
  const doctorReport = collectDoctorReport(projectRoot);
1907
2156
  const specSlugs = doctorReport.specSlugs;
2157
+ const doctorExampleTarget = doctorReport.exampleTarget || {
2158
+ sliceId: '<slice-id>',
2159
+ source: 'generic',
2160
+ specSlug: '<spec-slug>',
2161
+ };
1908
2162
  const specRequiredFiles = specSlugs.flatMap((projectSlug) => [
1909
2163
  `specs/${projectSlug}/SPEC.md`,
1910
2164
  `specs/${projectSlug}/STATUS.md`,
@@ -1958,6 +2212,11 @@ function runDoctor(targetDir, options = {}) {
1958
2212
  .filter((name) => typeof pkg.scripts?.[name] !== 'string');
1959
2213
  const missingAiScripts = [
1960
2214
  'quiver:ai:agent',
2215
+ 'quiver:ai:inspect',
2216
+ 'quiver:ai:export',
2217
+ 'quiver:ai:specs',
2218
+ 'quiver:ai:slices',
2219
+ 'quiver:ai:trace',
1961
2220
  'quiver:ai:onboard',
1962
2221
  'quiver:ai:plan',
1963
2222
  'quiver:ai:review-plan',
@@ -2020,16 +2279,22 @@ function runDoctor(targetDir, options = {}) {
2020
2279
  if (!hasQuiverState) {
2021
2280
  console.log('- Run migration first: npx create-quiver migrate');
2022
2281
  } else if (!hasScanArtifacts) {
2023
- console.log('- Analyze the project first: npx create-quiver analyze');
2282
+ console.log('- Analyze the project first: npx create-quiver analyze');
2024
2283
  } else {
2025
2284
  console.log('- Ask your AI agent: Read AGENTS.md, then docs/AI_ONBOARDING_PROMPT.md and execute it.');
2026
2285
  }
2027
2286
  console.log('- Check the next ready slice: npx create-quiver next');
2028
2287
  if (specSlugs.length > 0) {
2029
- const projectSlug = specSlugs[0];
2030
- console.log(`- Start a slice: npx create-quiver start-slice specs/${projectSlug}/slices/<slice-id>/slice.json`);
2031
- console.log(`- Validate a slice: npx create-quiver check-slice specs/${projectSlug}/slices/<slice-id>/slice.json`);
2032
- console.log(`- Validate the PR gate: npx create-quiver check-pr specs/${projectSlug}/slices/<slice-id>/slice.json`);
2288
+ const projectSlug = doctorExampleTarget.specSlug;
2289
+ const sliceId = doctorExampleTarget.sliceId || '<slice-id>';
2290
+ if (doctorExampleTarget.source === 'active-slice') {
2291
+ console.log(`- Example target: ${projectSlug}/${sliceId} (${doctorExampleTarget.status})`);
2292
+ } else if (doctorExampleTarget.source === 'generic-multiple-specs') {
2293
+ console.log('- Example target: specs/<spec-slug>/slices/<slice-id>/slice.json (generic because no active slice is obvious)');
2294
+ }
2295
+ console.log(`- Start a slice: npx create-quiver start-slice specs/${projectSlug}/slices/${sliceId}/slice.json`);
2296
+ console.log(`- Validate a slice: npx create-quiver check-slice specs/${projectSlug}/slices/${sliceId}/slice.json`);
2297
+ console.log(`- Validate the PR gate: npx create-quiver check-pr specs/${projectSlug}/slices/${sliceId}/slice.json`);
2033
2298
  } else {
2034
2299
  console.log('- Create real specs and slices only after acceptance criteria are approved and the technical plan is reviewed and approved.');
2035
2300
  }
@@ -2045,6 +2310,16 @@ function printInitNextSteps(targetDir, projectName) {
2045
2310
  }
2046
2311
 
2047
2312
  async function run(argv) {
2313
+ if (argv.length === 1 && argv[0] === 'help') {
2314
+ printUsage();
2315
+ return;
2316
+ }
2317
+
2318
+ if (argv.length === 1 && (argv[0] === '-V' || argv[0] === '--version')) {
2319
+ console.log(CLI_VERSION);
2320
+ return;
2321
+ }
2322
+
2048
2323
  const args = parseArgs(argv);
2049
2324
 
2050
2325
  if (args.help) {
@@ -2053,7 +2328,9 @@ async function run(argv) {
2053
2328
  }
2054
2329
 
2055
2330
  if (args.mode === 'analyze') {
2056
- runAnalyze(args.targetDir);
2331
+ runAnalyze(args.targetDir, {
2332
+ dryRun: args.dryRun,
2333
+ });
2057
2334
  return;
2058
2335
  }
2059
2336
 
@@ -2087,7 +2364,69 @@ async function run(argv) {
2087
2364
 
2088
2365
  if (args.mode === 'ai') {
2089
2366
  if (!args.aiCommand) {
2090
- throw new Error(formatError('missing ai subcommand. Use: npx create-quiver ai onboard | prepare-context | plan | review-plan | approve | approvals | agent | prompt-slice | execute-slice | execute-plan | doctor | pr'));
2367
+ throw new Error(formatError('missing ai subcommand. Use: npx create-quiver ai onboard | prepare-context | run | status | resume | inspect | export | specs | slices | trace | plan | revise | review-plan | approve | approvals | agent | prompt-slice | execute-slice | execute-plan | doctor | pr'));
2368
+ }
2369
+
2370
+ if (args.aiCommand === 'run') {
2371
+ runAiLifecycleRun(process.cwd(), {
2372
+ command: args.aiRunCommand,
2373
+ input: args.aiInput || undefined,
2374
+ runId: args.aiRunId || undefined,
2375
+ specSlug: args.specSlug || undefined,
2376
+ });
2377
+ return;
2378
+ }
2379
+
2380
+ if (args.aiCommand === 'status') {
2381
+ runAiLifecycleStatus(process.cwd(), {
2382
+ runId: args.aiRunId || undefined,
2383
+ });
2384
+ return;
2385
+ }
2386
+
2387
+ if (args.aiCommand === 'resume') {
2388
+ runAiLifecycleResume(process.cwd(), {
2389
+ runId: args.aiRunId || undefined,
2390
+ });
2391
+ return;
2392
+ }
2393
+
2394
+ if (args.aiCommand === 'inspect') {
2395
+ runAiInspect(process.cwd(), {
2396
+ includeCompleted: args.includeCompleted,
2397
+ });
2398
+ return;
2399
+ }
2400
+
2401
+ if (args.aiCommand === 'export') {
2402
+ runAiExport(process.cwd(), {
2403
+ format: args.formatExplicit ? args.format : 'json',
2404
+ includeCompleted: args.includeCompleted,
2405
+ });
2406
+ return;
2407
+ }
2408
+
2409
+ if (args.aiCommand === 'specs') {
2410
+ runAiSpecsList(process.cwd(), {
2411
+ includeCompleted: args.includeCompleted,
2412
+ json: args.json,
2413
+ });
2414
+ return;
2415
+ }
2416
+
2417
+ if (args.aiCommand === 'slices') {
2418
+ runAiSlicesList(process.cwd(), {
2419
+ includeCompleted: args.includeCompleted,
2420
+ json: args.json,
2421
+ });
2422
+ return;
2423
+ }
2424
+
2425
+ if (args.aiCommand === 'trace') {
2426
+ runAiTraceReport(process.cwd(), {
2427
+ includeCompleted: args.includeCompleted,
2428
+ });
2429
+ return;
2091
2430
  }
2092
2431
 
2093
2432
  if (args.aiCommand === 'agent') {
@@ -2098,6 +2437,7 @@ async function run(argv) {
2098
2437
  model: args.aiModel || undefined,
2099
2438
  provider: args.aiProviderExplicit ? args.aiProvider : undefined,
2100
2439
  role: args.aiAgentRole || undefined,
2440
+ dryRun: args.dryRun,
2101
2441
  });
2102
2442
  return;
2103
2443
  }
@@ -2107,6 +2447,7 @@ async function run(argv) {
2107
2447
  context: args.aiContext || undefined,
2108
2448
  dryRun: args.dryRun,
2109
2449
  input: args.aiInput || undefined,
2450
+ printPrompt: args.aiPrintPrompt,
2110
2451
  provider: args.aiProvider,
2111
2452
  providerExplicit: args.aiProviderExplicit,
2112
2453
  role: args.aiRole,
@@ -2118,6 +2459,7 @@ async function run(argv) {
2118
2459
  if (args.aiCommand === 'prepare-context') {
2119
2460
  await runAiPrepareContext(process.cwd(), {
2120
2461
  dryRun: args.dryRun,
2462
+ runId: args.aiRunId || undefined,
2121
2463
  });
2122
2464
  return;
2123
2465
  }
@@ -2128,9 +2470,11 @@ async function run(argv) {
2128
2470
  dryRun: args.dryRun,
2129
2471
  input: args.aiInput || undefined,
2130
2472
  phase: args.aiPhase,
2473
+ printPrompt: args.aiPrintPrompt,
2131
2474
  provider: args.aiProvider,
2132
2475
  providerExplicit: args.aiProviderExplicit,
2133
2476
  role: args.aiRole,
2477
+ runId: args.aiRunId || undefined,
2134
2478
  specSlug: args.specSlug || undefined,
2135
2479
  timeout: args.aiTimeout,
2136
2480
  });
@@ -2142,6 +2486,7 @@ async function run(argv) {
2142
2486
  context: args.aiContext || undefined,
2143
2487
  dryRun: args.dryRun,
2144
2488
  input: args.aiInput || undefined,
2489
+ printPrompt: args.aiPrintPrompt,
2145
2490
  provider: args.aiProvider,
2146
2491
  providerExplicit: args.aiProviderExplicit,
2147
2492
  timeout: args.aiTimeout,
@@ -2149,11 +2494,28 @@ async function run(argv) {
2149
2494
  return;
2150
2495
  }
2151
2496
 
2497
+ if (args.aiCommand === 'revise') {
2498
+ await runAiRevise(process.cwd(), {
2499
+ context: args.aiContext || undefined,
2500
+ dryRun: args.dryRun,
2501
+ input: args.aiInput || undefined,
2502
+ phase: args.aiPhase,
2503
+ printPrompt: args.aiPrintPrompt,
2504
+ provider: args.aiProvider,
2505
+ providerExplicit: args.aiProviderExplicit,
2506
+ role: args.aiRole,
2507
+ runId: args.aiRunId || undefined,
2508
+ timeout: args.aiTimeout,
2509
+ });
2510
+ return;
2511
+ }
2512
+
2152
2513
  if (args.aiCommand === 'approve') {
2153
2514
  await runAiApprove(process.cwd(), {
2154
2515
  dryRun: args.dryRun,
2155
2516
  input: args.aiInput || undefined,
2156
2517
  phase: args.aiPhase,
2518
+ runId: args.aiRunId || undefined,
2157
2519
  version: args.aiVersion || undefined,
2158
2520
  });
2159
2521
  return;
@@ -2228,7 +2590,7 @@ async function run(argv) {
2228
2590
  return;
2229
2591
  }
2230
2592
 
2231
- throw new Error(formatError(`unsupported ai subcommand: ${args.aiCommand}. Supported tasks: onboard, plan, review-plan, approve, approvals, agent, prompt-slice, execute-slice, execute-plan, doctor, pr`));
2593
+ throw new Error(formatError(`unsupported ai subcommand: ${args.aiCommand}. Supported tasks: onboard, prepare-context, run, status, resume, inspect, export, specs, slices, trace, plan, revise, review-plan, approve, approvals, agent, prompt-slice, execute-slice, execute-plan, doctor, pr`));
2232
2594
  }
2233
2595
 
2234
2596
  if (args.mode === 'graph') {
@@ -2278,7 +2640,10 @@ async function run(argv) {
2278
2640
  }
2279
2641
 
2280
2642
  if (args.mode === 'migrate') {
2281
- runMigrate(args.targetDir, { skipInstall: args.skipInstall });
2643
+ runMigrate(args.targetDir, {
2644
+ dryRun: args.dryRun,
2645
+ skipInstall: args.skipInstall,
2646
+ });
2282
2647
  return;
2283
2648
  }
2284
2649
 
@@ -2315,10 +2680,10 @@ async function run(argv) {
2315
2680
  const repoRoot = process.cwd();
2316
2681
  const handoffInput = args.targetDir;
2317
2682
  if (!handoffInput || handoffInput === '.') {
2318
- throw new Error(formatError('missing handoff path. Use: npx create-quiver check-handoff specs/<spec-slug>/HANDOFF.md'));
2683
+ throw new Error(formatError('missing handoff or brief path. Use: npx create-quiver check-handoff specs/<spec-slug>/HANDOFF.md or specs/<spec-slug>/slices/<slice-id>/EXECUTION_BRIEF.md'));
2319
2684
  }
2320
2685
  const resolved = checkHandoff(handoffInput, repoRoot);
2321
- console.log(`PASS: Handoff validated at ${resolved.relativePath}`);
2686
+ console.log(`PASS: ${resolved.label} validated at ${resolved.relativePath}`);
2322
2687
  return;
2323
2688
  }
2324
2689
 
@@ -2341,7 +2706,11 @@ async function run(argv) {
2341
2706
  }
2342
2707
 
2343
2708
  if (args.mode === 'check-scope') {
2344
- checkScope(args.targetDir, { strict: args.strict });
2709
+ checkScope(args.targetDir, {
2710
+ baseBranch: args.baseBranchExplicit ? args.aiBaseBranch : '',
2711
+ remote: args.aiRemote,
2712
+ strict: args.strict,
2713
+ });
2345
2714
  return;
2346
2715
  }
2347
2716
 
@@ -2362,11 +2731,13 @@ async function run(argv) {
2362
2731
  }
2363
2732
 
2364
2733
  if (!args.targetDir || args.targetDir === '.') {
2365
- throw new Error(formatError('missing spec directory. Use: npx create-quiver spec <start|status|close> <spec-dir>'));
2734
+ throw new Error(formatError('missing spec directory. Use: npx create-quiver spec <start|status|validate|close> <spec-dir>'));
2366
2735
  }
2367
2736
 
2368
2737
  if (args.specCommand === 'start') {
2369
- const report = startSpecWorktree(process.cwd(), args.targetDir);
2738
+ const report = startSpecWorktree(process.cwd(), args.targetDir, {
2739
+ dryRun: args.dryRun,
2740
+ });
2370
2741
  process.stdout.write(formatSpecStartResult(report));
2371
2742
  return;
2372
2743
  }
@@ -2377,6 +2748,13 @@ async function run(argv) {
2377
2748
  return;
2378
2749
  }
2379
2750
 
2751
+ if (args.specCommand === 'validate') {
2752
+ runValidateSpec(process.cwd(), args.targetDir, {
2753
+ strict: args.strict,
2754
+ });
2755
+ return;
2756
+ }
2757
+
2380
2758
  if (args.specCommand === 'close') {
2381
2759
  const report = closeSpecWorktree(process.cwd(), args.targetDir, {
2382
2760
  baseBranch: args.aiBaseBranch,
@@ -2389,7 +2767,7 @@ async function run(argv) {
2389
2767
  return;
2390
2768
  }
2391
2769
 
2392
- throw new Error(formatError(`unsupported spec subcommand: ${args.specCommand}. Supported tasks: create, start, status, close`));
2770
+ throw new Error(formatError(`unsupported spec subcommand: ${args.specCommand}. Supported tasks: create, start, status, validate, close`));
2393
2771
  }
2394
2772
 
2395
2773
  const packageRoot = path.resolve(__dirname, '../..');
@@ -2432,7 +2810,7 @@ async function run(argv) {
2432
2810
  if (installResult === 'installed') {
2433
2811
  console.log(`Added create-quiver@${CLI_VERSION} as dev dependency`);
2434
2812
  } else if (installResult === 'failed') {
2435
- console.warn(`Warning: could not install create-quiver automatically. Run: npm install -D create-quiver@${CLI_VERSION}`);
2813
+ console.warn(`Warning: could not install create-quiver automatically. Run: ${formatInstallSelfCommand(targetDir, CLI_VERSION)}`);
2436
2814
  }
2437
2815
  }
2438
2816