create-quiver 0.9.1 → 0.12.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 (245) hide show
  1. package/BACKLOG.md +16 -17
  2. package/CHANGELOG.md +34 -0
  3. package/README.md +419 -330
  4. package/README_FOR_AI.md +93 -56
  5. package/ROADMAP.md +22 -11
  6. package/docs/AI_CONTEXT.md.template +2 -0
  7. package/docs/AI_ONBOARDING_PROMPT.md.template +36 -19
  8. package/docs/COMMANDS.md.template +73 -1
  9. package/docs/CONTEXTO.md.template +2 -0
  10. package/docs/DECISIONS.md.template +1 -0
  11. package/docs/GITFLOW_PR_GUIDE.md.template +11 -0
  12. package/docs/INDEX.md.template +20 -18
  13. package/docs/STANDARD.md.template +1 -1
  14. package/docs/STATUS.md.template +1 -0
  15. package/docs/SUPPORT_MATRIX.md.template +6 -2
  16. package/docs/TROUBLESHOOTING.md.template +79 -1
  17. package/docs/WORKFLOW.md.template +26 -18
  18. package/package.json +24 -2
  19. package/package.template.json +24 -7
  20. package/scripts/check-pr-readiness.sh +1 -1
  21. package/scripts/check-scope.sh +0 -1
  22. package/scripts/check-slice-readiness.sh +3 -4
  23. package/scripts/init-docs.sh +53 -6
  24. package/scripts/package-quiver.sh +18 -2
  25. package/specs/quiver-v20-ai-cli-orchestration/EVIDENCE_REPORT.md +23 -0
  26. package/specs/quiver-v20-ai-cli-orchestration/EXECUTION_PLAN.md +57 -0
  27. package/specs/quiver-v20-ai-cli-orchestration/SPEC.md +202 -0
  28. package/specs/quiver-v20-ai-cli-orchestration/STATUS.md +35 -0
  29. package/specs/quiver-v20-ai-cli-orchestration/pr.md +100 -0
  30. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +30 -0
  31. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +61 -0
  32. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-00-spec-foundation/slice.json +54 -0
  33. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-01-ai-provider-runner/CLOSURE_BRIEF.md +39 -0
  34. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-01-ai-provider-runner/EXECUTION_BRIEF.md +63 -0
  35. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-01-ai-provider-runner/slice.json +55 -0
  36. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-02-context-packs-token-budget/CLOSURE_BRIEF.md +40 -0
  37. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-02-context-packs-token-budget/EXECUTION_BRIEF.md +60 -0
  38. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-02-context-packs-token-budget/slice.json +54 -0
  39. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-03-ai-phase-gated-planner/CLOSURE_BRIEF.md +43 -0
  40. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-03-ai-phase-gated-planner/EXECUTION_BRIEF.md +62 -0
  41. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-03-ai-phase-gated-planner/slice.json +62 -0
  42. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-04-spec-slice-handoff-pr-generation/CLOSURE_BRIEF.md +36 -0
  43. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-04-spec-slice-handoff-pr-generation/EXECUTION_BRIEF.md +63 -0
  44. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-04-spec-slice-handoff-pr-generation/slice.json +59 -0
  45. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-05-execution-plan-parallel-worktrees/CLOSURE_BRIEF.md +32 -0
  46. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-05-execution-plan-parallel-worktrees/EXECUTION_BRIEF.md +61 -0
  47. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-05-execution-plan-parallel-worktrees/slice.json +59 -0
  48. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-06-ai-execute-slice-scope-enforcement/CLOSURE_BRIEF.md +36 -0
  49. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-06-ai-execute-slice-scope-enforcement/EXECUTION_BRIEF.md +64 -0
  50. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-06-ai-execute-slice-scope-enforcement/slice.json +65 -0
  51. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-07-github-pr-preflight/CLOSURE_BRIEF.md +36 -0
  52. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-07-github-pr-preflight/EXECUTION_BRIEF.md +66 -0
  53. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-07-github-pr-preflight/slice.json +63 -0
  54. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-08-docs-smokes-release-readiness/CLOSURE_BRIEF.md +35 -0
  55. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-08-docs-smokes-release-readiness/EXECUTION_BRIEF.md +64 -0
  56. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-08-docs-smokes-release-readiness/slice.json +77 -0
  57. package/specs/quiver-v21-ai-first-layout/EVIDENCE_REPORT.md +31 -0
  58. package/specs/quiver-v21-ai-first-layout/EXECUTION_PLAN.md +185 -0
  59. package/specs/quiver-v21-ai-first-layout/SPEC.md +212 -0
  60. package/specs/quiver-v21-ai-first-layout/STATUS.md +37 -0
  61. package/specs/quiver-v21-ai-first-layout/pr.md +110 -0
  62. package/specs/quiver-v21-ai-first-layout/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +30 -0
  63. package/specs/quiver-v21-ai-first-layout/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +63 -0
  64. package/specs/quiver-v21-ai-first-layout/slices/slice-00-spec-foundation/slice.json +45 -0
  65. package/specs/quiver-v21-ai-first-layout/slices/slice-01-init-profiles-dry-run/CLOSURE_BRIEF.md +31 -0
  66. package/specs/quiver-v21-ai-first-layout/slices/slice-01-init-profiles-dry-run/EXECUTION_BRIEF.md +59 -0
  67. package/specs/quiver-v21-ai-first-layout/slices/slice-01-init-profiles-dry-run/slice.json +57 -0
  68. package/specs/quiver-v21-ai-first-layout/slices/slice-02-internal-layout-template-resolver/CLOSURE_BRIEF.md +32 -0
  69. package/specs/quiver-v21-ai-first-layout/slices/slice-02-internal-layout-template-resolver/EXECUTION_BRIEF.md +60 -0
  70. package/specs/quiver-v21-ai-first-layout/slices/slice-02-internal-layout-template-resolver/slice.json +58 -0
  71. package/specs/quiver-v21-ai-first-layout/slices/slice-03-generation-profiles-visible-contract/CLOSURE_BRIEF.md +34 -0
  72. package/specs/quiver-v21-ai-first-layout/slices/slice-03-generation-profiles-visible-contract/EXECUTION_BRIEF.md +61 -0
  73. package/specs/quiver-v21-ai-first-layout/slices/slice-03-generation-profiles-visible-contract/slice.json +64 -0
  74. package/specs/quiver-v21-ai-first-layout/slices/slice-04-analyze-scan-relocation/CLOSURE_BRIEF.md +32 -0
  75. package/specs/quiver-v21-ai-first-layout/slices/slice-04-analyze-scan-relocation/EXECUTION_BRIEF.md +58 -0
  76. package/specs/quiver-v21-ai-first-layout/slices/slice-04-analyze-scan-relocation/slice.json +64 -0
  77. package/specs/quiver-v21-ai-first-layout/slices/slice-05-empty-specs-layout-doctor/CLOSURE_BRIEF.md +32 -0
  78. package/specs/quiver-v21-ai-first-layout/slices/slice-05-empty-specs-layout-doctor/EXECUTION_BRIEF.md +60 -0
  79. package/specs/quiver-v21-ai-first-layout/slices/slice-05-empty-specs-layout-doctor/slice.json +65 -0
  80. package/specs/quiver-v21-ai-first-layout/slices/slice-06-legacy-migration-optional-assets/CLOSURE_BRIEF.md +31 -0
  81. package/specs/quiver-v21-ai-first-layout/slices/slice-06-legacy-migration-optional-assets/EXECUTION_BRIEF.md +62 -0
  82. package/specs/quiver-v21-ai-first-layout/slices/slice-06-legacy-migration-optional-assets/slice.json +66 -0
  83. package/specs/quiver-v21-ai-first-layout/slices/slice-07-docs-guidance-alignment/CLOSURE_BRIEF.md +33 -0
  84. package/specs/quiver-v21-ai-first-layout/slices/slice-07-docs-guidance-alignment/EXECUTION_BRIEF.md +61 -0
  85. package/specs/quiver-v21-ai-first-layout/slices/slice-07-docs-guidance-alignment/slice.json +67 -0
  86. package/specs/quiver-v21-ai-first-layout/slices/slice-08-smokes-release-readiness/CLOSURE_BRIEF.md +35 -0
  87. package/specs/quiver-v21-ai-first-layout/slices/slice-08-smokes-release-readiness/EXECUTION_BRIEF.md +66 -0
  88. package/specs/quiver-v21-ai-first-layout/slices/slice-08-smokes-release-readiness/slice.json +62 -0
  89. package/specs/quiver-v22-guided-ai-workflow/EVIDENCE_REPORT.md +58 -0
  90. package/specs/quiver-v22-guided-ai-workflow/EXECUTION_PLAN.md +88 -0
  91. package/specs/quiver-v22-guided-ai-workflow/SPEC.md +228 -0
  92. package/specs/quiver-v22-guided-ai-workflow/STATUS.md +42 -0
  93. package/specs/quiver-v22-guided-ai-workflow/pr.md +104 -0
  94. package/specs/quiver-v22-guided-ai-workflow/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +35 -0
  95. package/specs/quiver-v22-guided-ai-workflow/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +61 -0
  96. package/specs/quiver-v22-guided-ai-workflow/slices/slice-00-spec-foundation/slice.json +51 -0
  97. package/specs/quiver-v22-guided-ai-workflow/slices/slice-01-docs-source-of-truth-sync/CLOSURE_BRIEF.md +31 -0
  98. package/specs/quiver-v22-guided-ai-workflow/slices/slice-01-docs-source-of-truth-sync/EXECUTION_BRIEF.md +58 -0
  99. package/specs/quiver-v22-guided-ai-workflow/slices/slice-01-docs-source-of-truth-sync/slice.json +55 -0
  100. package/specs/quiver-v22-guided-ai-workflow/slices/slice-02-prepare-command-diagnostics/CLOSURE_BRIEF.md +30 -0
  101. package/specs/quiver-v22-guided-ai-workflow/slices/slice-02-prepare-command-diagnostics/EXECUTION_BRIEF.md +57 -0
  102. package/specs/quiver-v22-guided-ai-workflow/slices/slice-02-prepare-command-diagnostics/slice.json +57 -0
  103. package/specs/quiver-v22-guided-ai-workflow/slices/slice-03-context-doc-refresh/CLOSURE_BRIEF.md +32 -0
  104. package/specs/quiver-v22-guided-ai-workflow/slices/slice-03-context-doc-refresh/EXECUTION_BRIEF.md +56 -0
  105. package/specs/quiver-v22-guided-ai-workflow/slices/slice-03-context-doc-refresh/slice.json +56 -0
  106. package/specs/quiver-v22-guided-ai-workflow/slices/slice-04-planner-approval-state/CLOSURE_BRIEF.md +33 -0
  107. package/specs/quiver-v22-guided-ai-workflow/slices/slice-04-planner-approval-state/EXECUTION_BRIEF.md +56 -0
  108. package/specs/quiver-v22-guided-ai-workflow/slices/slice-04-planner-approval-state/slice.json +58 -0
  109. package/specs/quiver-v22-guided-ai-workflow/slices/slice-05-spec-worktree-lifecycle/CLOSURE_BRIEF.md +32 -0
  110. package/specs/quiver-v22-guided-ai-workflow/slices/slice-05-spec-worktree-lifecycle/EXECUTION_BRIEF.md +56 -0
  111. package/specs/quiver-v22-guided-ai-workflow/slices/slice-05-spec-worktree-lifecycle/slice.json +54 -0
  112. package/specs/quiver-v22-guided-ai-workflow/slices/slice-06-executor-commit-recovery/CLOSURE_BRIEF.md +32 -0
  113. package/specs/quiver-v22-guided-ai-workflow/slices/slice-06-executor-commit-recovery/EXECUTION_BRIEF.md +58 -0
  114. package/specs/quiver-v22-guided-ai-workflow/slices/slice-06-executor-commit-recovery/slice.json +57 -0
  115. package/specs/quiver-v22-guided-ai-workflow/slices/slice-07-execution-waves-delegation/CLOSURE_BRIEF.md +32 -0
  116. package/specs/quiver-v22-guided-ai-workflow/slices/slice-07-execution-waves-delegation/EXECUTION_BRIEF.md +58 -0
  117. package/specs/quiver-v22-guided-ai-workflow/slices/slice-07-execution-waves-delegation/slice.json +55 -0
  118. package/specs/quiver-v22-guided-ai-workflow/slices/slice-08-pr-create-gh-ssh/CLOSURE_BRIEF.md +32 -0
  119. package/specs/quiver-v22-guided-ai-workflow/slices/slice-08-pr-create-gh-ssh/EXECUTION_BRIEF.md +58 -0
  120. package/specs/quiver-v22-guided-ai-workflow/slices/slice-08-pr-create-gh-ssh/slice.json +53 -0
  121. package/specs/quiver-v22-guided-ai-workflow/slices/slice-09-post-merge-cleanup-release-safety/CLOSURE_BRIEF.md +33 -0
  122. package/specs/quiver-v22-guided-ai-workflow/slices/slice-09-post-merge-cleanup-release-safety/EXECUTION_BRIEF.md +59 -0
  123. package/specs/quiver-v22-guided-ai-workflow/slices/slice-09-post-merge-cleanup-release-safety/slice.json +59 -0
  124. package/specs/quiver-v22-guided-ai-workflow/slices/slice-10-docs-smokes-release-readiness/CLOSURE_BRIEF.md +34 -0
  125. package/specs/quiver-v22-guided-ai-workflow/slices/slice-10-docs-smokes-release-readiness/EXECUTION_BRIEF.md +58 -0
  126. package/specs/quiver-v22-guided-ai-workflow/slices/slice-10-docs-smokes-release-readiness/slice.json +60 -0
  127. package/specs/quiver-v23-guided-flow-productization/EVIDENCE_REPORT.md +80 -0
  128. package/specs/quiver-v23-guided-flow-productization/EXECUTION_PLAN.md +80 -0
  129. package/specs/quiver-v23-guided-flow-productization/SPEC.md +203 -0
  130. package/specs/quiver-v23-guided-flow-productization/STATUS.md +39 -0
  131. package/specs/quiver-v23-guided-flow-productization/pr.md +119 -0
  132. package/specs/quiver-v23-guided-flow-productization/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +30 -0
  133. package/specs/quiver-v23-guided-flow-productization/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +61 -0
  134. package/specs/quiver-v23-guided-flow-productization/slices/slice-00-spec-foundation/slice.json +51 -0
  135. package/specs/quiver-v23-guided-flow-productization/slices/slice-01-short-command-and-flow-entrypoint/CLOSURE_BRIEF.md +33 -0
  136. package/specs/quiver-v23-guided-flow-productization/slices/slice-01-short-command-and-flow-entrypoint/EXECUTION_BRIEF.md +35 -0
  137. package/specs/quiver-v23-guided-flow-productization/slices/slice-01-short-command-and-flow-entrypoint/slice.json +56 -0
  138. package/specs/quiver-v23-guided-flow-productization/slices/slice-02-flow-status-wizard/CLOSURE_BRIEF.md +31 -0
  139. package/specs/quiver-v23-guided-flow-productization/slices/slice-02-flow-status-wizard/EXECUTION_BRIEF.md +29 -0
  140. package/specs/quiver-v23-guided-flow-productization/slices/slice-02-flow-status-wizard/slice.json +55 -0
  141. package/specs/quiver-v23-guided-flow-productization/slices/slice-03-agent-profiles/CLOSURE_BRIEF.md +33 -0
  142. package/specs/quiver-v23-guided-flow-productization/slices/slice-03-agent-profiles/EXECUTION_BRIEF.md +29 -0
  143. package/specs/quiver-v23-guided-flow-productization/slices/slice-03-agent-profiles/slice.json +54 -0
  144. package/specs/quiver-v23-guided-flow-productization/slices/slice-04-context-preparation-onboarding/CLOSURE_BRIEF.md +32 -0
  145. package/specs/quiver-v23-guided-flow-productization/slices/slice-04-context-preparation-onboarding/EXECUTION_BRIEF.md +30 -0
  146. package/specs/quiver-v23-guided-flow-productization/slices/slice-04-context-preparation-onboarding/slice.json +59 -0
  147. package/specs/quiver-v23-guided-flow-productization/slices/slice-05-planner-iteration-history/CLOSURE_BRIEF.md +31 -0
  148. package/specs/quiver-v23-guided-flow-productization/slices/slice-05-planner-iteration-history/EXECUTION_BRIEF.md +29 -0
  149. package/specs/quiver-v23-guided-flow-productization/slices/slice-05-planner-iteration-history/slice.json +53 -0
  150. package/specs/quiver-v23-guided-flow-productization/slices/slice-06-production-plan-review/CLOSURE_BRIEF.md +33 -0
  151. package/specs/quiver-v23-guided-flow-productization/slices/slice-06-production-plan-review/EXECUTION_BRIEF.md +30 -0
  152. package/specs/quiver-v23-guided-flow-productization/slices/slice-06-production-plan-review/slice.json +54 -0
  153. package/specs/quiver-v23-guided-flow-productization/slices/slice-07-spec-create-experience/CLOSURE_BRIEF.md +33 -0
  154. package/specs/quiver-v23-guided-flow-productization/slices/slice-07-spec-create-experience/EXECUTION_BRIEF.md +30 -0
  155. package/specs/quiver-v23-guided-flow-productization/slices/slice-07-spec-create-experience/slice.json +55 -0
  156. package/specs/quiver-v23-guided-flow-productization/slices/slice-08-executor-prompt-generation/CLOSURE_BRIEF.md +32 -0
  157. package/specs/quiver-v23-guided-flow-productization/slices/slice-08-executor-prompt-generation/EXECUTION_BRIEF.md +30 -0
  158. package/specs/quiver-v23-guided-flow-productization/slices/slice-08-executor-prompt-generation/slice.json +55 -0
  159. package/specs/quiver-v23-guided-flow-productization/slices/slice-09-delegated-slice-execution/CLOSURE_BRIEF.md +33 -0
  160. package/specs/quiver-v23-guided-flow-productization/slices/slice-09-delegated-slice-execution/EXECUTION_BRIEF.md +34 -0
  161. package/specs/quiver-v23-guided-flow-productization/slices/slice-09-delegated-slice-execution/slice.json +57 -0
  162. package/specs/quiver-v23-guided-flow-productization/slices/slice-10-docs-smokes-release-readiness/CLOSURE_BRIEF.md +33 -0
  163. package/specs/quiver-v23-guided-flow-productization/slices/slice-10-docs-smokes-release-readiness/EXECUTION_BRIEF.md +32 -0
  164. package/specs/quiver-v23-guided-flow-productization/slices/slice-10-docs-smokes-release-readiness/slice.json +63 -0
  165. package/specs/quiver-v24-dx-onboarding-hardening/EVIDENCE_REPORT.md +55 -0
  166. package/specs/quiver-v24-dx-onboarding-hardening/EXECUTION_PLAN.md +43 -0
  167. package/specs/quiver-v24-dx-onboarding-hardening/SPEC.md +149 -0
  168. package/specs/quiver-v24-dx-onboarding-hardening/STATUS.md +31 -0
  169. package/specs/quiver-v24-dx-onboarding-hardening/pr.md +76 -0
  170. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +31 -0
  171. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +52 -0
  172. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-00-spec-foundation/slice.json +51 -0
  173. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-01-init-template-hygiene/CLOSURE_BRIEF.md +38 -0
  174. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-01-init-template-hygiene/EXECUTION_BRIEF.md +53 -0
  175. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-01-init-template-hygiene/slice.json +55 -0
  176. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-02-cli-command-routing-version-errors/CLOSURE_BRIEF.md +33 -0
  177. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-02-cli-command-routing-version-errors/EXECUTION_BRIEF.md +50 -0
  178. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-02-cli-command-routing-version-errors/slice.json +52 -0
  179. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-03-doctor-fix-doc-link-checks/CLOSURE_BRIEF.md +33 -0
  180. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-03-doctor-fix-doc-link-checks/EXECUTION_BRIEF.md +50 -0
  181. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-03-doctor-fix-doc-link-checks/slice.json +53 -0
  182. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-04-prepare-output-ai-context-drafts/CLOSURE_BRIEF.md +33 -0
  183. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-04-prepare-output-ai-context-drafts/EXECUTION_BRIEF.md +50 -0
  184. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-04-prepare-output-ai-context-drafts/slice.json +70 -0
  185. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-05-local-slice-validation-base-guidance/CLOSURE_BRIEF.md +36 -0
  186. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-05-local-slice-validation-base-guidance/EXECUTION_BRIEF.md +49 -0
  187. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-05-local-slice-validation-base-guidance/slice.json +52 -0
  188. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-06-plan-graph-next-history-views/CLOSURE_BRIEF.md +43 -0
  189. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-06-plan-graph-next-history-views/EXECUTION_BRIEF.md +53 -0
  190. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-06-plan-graph-next-history-views/slice.json +60 -0
  191. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-07-analyzer-command-map-hardening/CLOSURE_BRIEF.md +32 -0
  192. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-07-analyzer-command-map-hardening/EXECUTION_BRIEF.md +50 -0
  193. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-07-analyzer-command-map-hardening/slice.json +51 -0
  194. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-08-evidence-run-command/CLOSURE_BRIEF.md +34 -0
  195. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-08-evidence-run-command/EXECUTION_BRIEF.md +52 -0
  196. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-08-evidence-run-command/slice.json +54 -0
  197. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-09-spec-viewer-demo-scaffolding/CLOSURE_BRIEF.md +34 -0
  198. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-09-spec-viewer-demo-scaffolding/EXECUTION_BRIEF.md +51 -0
  199. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-09-spec-viewer-demo-scaffolding/slice.json +59 -0
  200. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-10-docs-smokes-release-readiness/CLOSURE_BRIEF.md +33 -0
  201. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-10-docs-smokes-release-readiness/EXECUTION_BRIEF.md +54 -0
  202. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-10-docs-smokes-release-readiness/slice.json +76 -0
  203. package/src/create-quiver/commands/ai.js +915 -0
  204. package/src/create-quiver/commands/demo.js +22 -0
  205. package/src/create-quiver/commands/evidence.js +37 -0
  206. package/src/create-quiver/commands/flow.js +561 -0
  207. package/src/create-quiver/commands/graph.js +14 -1
  208. package/src/create-quiver/commands/next.js +28 -0
  209. package/src/create-quiver/commands/plan.js +6 -3
  210. package/src/create-quiver/commands/prepare.js +236 -0
  211. package/src/create-quiver/commands/spec.js +133 -0
  212. package/src/create-quiver/index.js +1096 -96
  213. package/src/create-quiver/lib/agent-profiles.js +148 -0
  214. package/src/create-quiver/lib/ai/context-packs.js +170 -0
  215. package/src/create-quiver/lib/ai/execution-plan.js +614 -0
  216. package/src/create-quiver/lib/ai/executor.js +682 -0
  217. package/src/create-quiver/lib/ai/github.js +525 -0
  218. package/src/create-quiver/lib/ai/onboarding-template.js +365 -0
  219. package/src/create-quiver/lib/ai/phase-gates.js +72 -0
  220. package/src/create-quiver/lib/ai/plan-review.js +283 -0
  221. package/src/create-quiver/lib/ai/preflight.js +58 -0
  222. package/src/create-quiver/lib/ai/prompt-transport.js +81 -0
  223. package/src/create-quiver/lib/ai/prompts.js +39 -0
  224. package/src/create-quiver/lib/ai/providers.js +315 -0
  225. package/src/create-quiver/lib/ai/safety.js +156 -0
  226. package/src/create-quiver/lib/ai/spec-generator.js +314 -0
  227. package/src/create-quiver/lib/ai/spec-templates.js +715 -0
  228. package/src/create-quiver/lib/approvals.js +350 -0
  229. package/src/create-quiver/lib/demo.js +657 -0
  230. package/src/create-quiver/lib/doctor.js +348 -0
  231. package/src/create-quiver/lib/evidence.js +115 -0
  232. package/src/create-quiver/lib/git.js +21 -0
  233. package/src/create-quiver/lib/init-docs.js +545 -23
  234. package/src/create-quiver/lib/init-layout.js +451 -0
  235. package/src/create-quiver/lib/lifecycle.js +8 -2
  236. package/src/create-quiver/lib/package-safety.js +117 -0
  237. package/src/create-quiver/lib/paths.js +63 -2
  238. package/src/create-quiver/lib/project-scan.js +66 -0
  239. package/src/create-quiver/lib/readiness.js +87 -18
  240. package/src/create-quiver/lib/scope.js +125 -0
  241. package/src/create-quiver/lib/slice-graph.js +7 -0
  242. package/src/create-quiver/lib/slice.js +59 -16
  243. package/src/create-quiver/lib/spec-worktrees.js +349 -0
  244. package/src/create-quiver/lib/state.js +18 -1
  245. package/src/create-quiver/lib/template-resolver.js +74 -0
@@ -0,0 +1,657 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const { toProjectSlug } = require('./init-layout');
4
+
5
+ const SPEC_VIEWER_DEMO = 'spec-viewer';
6
+ const SPEC_VIEWER_PROJECT_NAME = 'Quiver Spec Viewer';
7
+ const SPEC_VIEWER_SLUG = toProjectSlug(SPEC_VIEWER_PROJECT_NAME);
8
+
9
+ function createJson(data) {
10
+ return `${JSON.stringify(data, null, 2)}\n`;
11
+ }
12
+
13
+ function createSpecViewerFiles() {
14
+ return [
15
+ {
16
+ path: 'package.json',
17
+ content: createJson({
18
+ name: SPEC_VIEWER_SLUG,
19
+ private: true,
20
+ version: '0.1.0',
21
+ description: 'Small static demo app for viewing Quiver specs and slices.',
22
+ scripts: {
23
+ start: 'node server.js',
24
+ validate: 'node scripts/validate-demo.js',
25
+ 'quiver:plan': 'npx create-quiver plan --spec quiver-spec-viewer',
26
+ 'quiver:graph': 'npx create-quiver graph --spec quiver-spec-viewer',
27
+ 'quiver:next': 'npx create-quiver next --spec quiver-spec-viewer',
28
+ 'quiver:evidence': 'npx create-quiver evidence',
29
+ },
30
+ }),
31
+ },
32
+ {
33
+ path: 'README.md',
34
+ content: `# ${SPEC_VIEWER_PROJECT_NAME}
35
+
36
+ ${SPEC_VIEWER_PROJECT_NAME} is a small static demo app for testing Quiver with a real spec/slice workflow.
37
+
38
+ ## Run
39
+
40
+ \`\`\`bash
41
+ npm run validate
42
+ npm start
43
+ \`\`\`
44
+
45
+ Open http://127.0.0.1:4173 after starting the server.
46
+
47
+ ## Quiver workflow
48
+
49
+ - The example spec lives in \`specs/quiver-spec-viewer/SPEC.md\`.
50
+ - The mandatory documentary slice is \`slice-00-docs-foundation\`.
51
+ - The first implementation slice is \`slice-01-static-spec-viewer\`.
52
+ - Use \`npm run quiver:plan\`, \`npm run quiver:graph\`, and \`npm run quiver:next\` to inspect execution order.
53
+ - Use \`npm run quiver:evidence -- run -- npm run validate\` to capture validation evidence.
54
+ `,
55
+ },
56
+ {
57
+ path: 'server.js',
58
+ content: `const fs = require('node:fs');
59
+ const http = require('node:http');
60
+ const path = require('node:path');
61
+
62
+ const root = path.join(__dirname, 'src');
63
+ const port = Number(process.env.PORT || 4173);
64
+ const types = {
65
+ '.css': 'text/css; charset=utf-8',
66
+ '.html': 'text/html; charset=utf-8',
67
+ '.js': 'text/javascript; charset=utf-8',
68
+ };
69
+
70
+ const server = http.createServer((request, response) => {
71
+ const requestedPath = request.url === '/' ? '/index.html' : request.url;
72
+ const filePath = path.normalize(path.join(root, requestedPath));
73
+
74
+ if (!filePath.startsWith(root)) {
75
+ response.writeHead(403);
76
+ response.end('Forbidden');
77
+ return;
78
+ }
79
+
80
+ fs.readFile(filePath, (error, content) => {
81
+ if (error) {
82
+ response.writeHead(404);
83
+ response.end('Not found');
84
+ return;
85
+ }
86
+
87
+ response.writeHead(200, { 'Content-Type': types[path.extname(filePath)] || 'text/plain; charset=utf-8' });
88
+ response.end(content);
89
+ });
90
+ });
91
+
92
+ server.listen(port, '127.0.0.1', () => {
93
+ console.log(\`Quiver Spec Viewer running at http://127.0.0.1:\${port}\`);
94
+ });
95
+ `,
96
+ },
97
+ {
98
+ path: 'src/index.html',
99
+ content: `<!doctype html>
100
+ <html lang="en">
101
+ <head>
102
+ <meta charset="utf-8">
103
+ <meta name="viewport" content="width=device-width, initial-scale=1">
104
+ <title>${SPEC_VIEWER_PROJECT_NAME}</title>
105
+ <link rel="stylesheet" href="./styles.css">
106
+ </head>
107
+ <body>
108
+ <main class="app-shell">
109
+ <section class="toolbar" aria-label="Viewer controls">
110
+ <div>
111
+ <p class="eyebrow">Quiver demo</p>
112
+ <h1>${SPEC_VIEWER_PROJECT_NAME}</h1>
113
+ </div>
114
+ <div class="actions">
115
+ <button data-state="content">Content</button>
116
+ <button data-state="empty">Empty</button>
117
+ <button data-state="loading">Loading</button>
118
+ <button data-state="error">Error</button>
119
+ </div>
120
+ </section>
121
+ <section id="viewer" class="viewer" aria-live="polite"></section>
122
+ </main>
123
+ <script src="./app.js"></script>
124
+ </body>
125
+ </html>
126
+ `,
127
+ },
128
+ {
129
+ path: 'src/styles.css',
130
+ content: `:root {
131
+ color-scheme: light;
132
+ font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
133
+ background: #f6f7f9;
134
+ color: #1f2933;
135
+ }
136
+
137
+ * {
138
+ box-sizing: border-box;
139
+ }
140
+
141
+ body {
142
+ margin: 0;
143
+ }
144
+
145
+ button {
146
+ border: 1px solid #c8d0d9;
147
+ border-radius: 6px;
148
+ background: #ffffff;
149
+ color: #243447;
150
+ cursor: pointer;
151
+ font: inherit;
152
+ padding: 8px 12px;
153
+ }
154
+
155
+ button:hover,
156
+ button:focus-visible {
157
+ border-color: #5b8def;
158
+ outline: 2px solid #cfe0ff;
159
+ outline-offset: 1px;
160
+ }
161
+
162
+ .app-shell {
163
+ max-width: 1120px;
164
+ margin: 0 auto;
165
+ padding: 32px 20px;
166
+ }
167
+
168
+ .toolbar {
169
+ align-items: center;
170
+ display: flex;
171
+ gap: 20px;
172
+ justify-content: space-between;
173
+ margin-bottom: 20px;
174
+ }
175
+
176
+ .eyebrow {
177
+ color: #5a6b7d;
178
+ font-size: 13px;
179
+ font-weight: 700;
180
+ letter-spacing: 0;
181
+ margin: 0 0 6px;
182
+ text-transform: uppercase;
183
+ }
184
+
185
+ h1 {
186
+ font-size: 34px;
187
+ line-height: 1.1;
188
+ margin: 0;
189
+ }
190
+
191
+ .actions {
192
+ display: flex;
193
+ flex-wrap: wrap;
194
+ gap: 8px;
195
+ justify-content: flex-end;
196
+ }
197
+
198
+ .viewer {
199
+ display: grid;
200
+ gap: 16px;
201
+ }
202
+
203
+ .grid {
204
+ display: grid;
205
+ gap: 16px;
206
+ grid-template-columns: minmax(240px, 320px) 1fr;
207
+ }
208
+
209
+ .panel,
210
+ .state {
211
+ background: #ffffff;
212
+ border: 1px solid #d9e0e7;
213
+ border-radius: 8px;
214
+ padding: 18px;
215
+ }
216
+
217
+ .list {
218
+ display: grid;
219
+ gap: 10px;
220
+ }
221
+
222
+ .item {
223
+ border: 1px solid #d9e0e7;
224
+ border-radius: 6px;
225
+ padding: 12px;
226
+ }
227
+
228
+ .item strong,
229
+ .detail h2 {
230
+ overflow-wrap: anywhere;
231
+ }
232
+
233
+ .meta {
234
+ color: #65758b;
235
+ font-size: 14px;
236
+ margin: 4px 0 0;
237
+ }
238
+
239
+ .badge {
240
+ background: #e9f2ff;
241
+ border-radius: 999px;
242
+ color: #1f5fbf;
243
+ display: inline-block;
244
+ font-size: 12px;
245
+ font-weight: 700;
246
+ padding: 4px 8px;
247
+ }
248
+
249
+ .slice-list {
250
+ display: grid;
251
+ gap: 8px;
252
+ margin-top: 14px;
253
+ }
254
+
255
+ .slice-row {
256
+ align-items: center;
257
+ border-top: 1px solid #e6ebf0;
258
+ display: flex;
259
+ gap: 10px;
260
+ justify-content: space-between;
261
+ padding-top: 10px;
262
+ }
263
+
264
+ .state {
265
+ min-height: 180px;
266
+ }
267
+
268
+ @media (max-width: 760px) {
269
+ .toolbar,
270
+ .grid {
271
+ grid-template-columns: 1fr;
272
+ }
273
+
274
+ .toolbar {
275
+ align-items: stretch;
276
+ flex-direction: column;
277
+ }
278
+
279
+ .actions {
280
+ justify-content: flex-start;
281
+ }
282
+ }
283
+ `,
284
+ },
285
+ {
286
+ path: 'src/app.js',
287
+ content: `const specs = [
288
+ {
289
+ id: 'quiver-spec-viewer',
290
+ title: 'Quiver Spec Viewer',
291
+ status: 'planned',
292
+ objective: 'Show a tiny but useful viewer for Quiver specs and slices.',
293
+ slices: [
294
+ { id: 'slice-00-docs-foundation', title: 'Docs foundation', status: 'completed' },
295
+ { id: 'slice-01-static-spec-viewer', title: 'Static spec viewer', status: 'planned' },
296
+ ],
297
+ },
298
+ ];
299
+
300
+ const viewer = document.querySelector('#viewer');
301
+
302
+ function renderContent() {
303
+ const selected = specs[0];
304
+ viewer.innerHTML = \`
305
+ <div class="grid">
306
+ <section class="panel" aria-label="Specs">
307
+ <span class="badge">\${specs.length} spec</span>
308
+ <div class="list">
309
+ \${specs.map((spec) => \`
310
+ <article class="item">
311
+ <strong>\${spec.title}</strong>
312
+ <p class="meta">\${spec.id} · \${spec.status}</p>
313
+ </article>
314
+ \`).join('')}
315
+ </div>
316
+ </section>
317
+ <section class="panel detail" aria-label="Spec detail">
318
+ <span class="badge">\${selected.status}</span>
319
+ <h2>\${selected.title}</h2>
320
+ <p>\${selected.objective}</p>
321
+ <div class="slice-list">
322
+ \${selected.slices.map((slice) => \`
323
+ <div class="slice-row">
324
+ <span>\${slice.id}</span>
325
+ <strong>\${slice.status}</strong>
326
+ </div>
327
+ \`).join('')}
328
+ </div>
329
+ </section>
330
+ </div>
331
+ \`;
332
+ }
333
+
334
+ function renderState(state) {
335
+ if (state === 'loading') {
336
+ viewer.innerHTML = '<section class="state"><h2>Loading</h2><p>Reading spec metadata...</p></section>';
337
+ return;
338
+ }
339
+
340
+ if (state === 'empty') {
341
+ viewer.innerHTML = '<section class="state"><h2>No specs yet</h2><p>Create a spec with Quiver and it will appear here.</p></section>';
342
+ return;
343
+ }
344
+
345
+ if (state === 'error') {
346
+ viewer.innerHTML = '<section class="state"><h2>Could not load specs</h2><p>Check the generated spec files and validation output.</p></section>';
347
+ return;
348
+ }
349
+
350
+ renderContent();
351
+ }
352
+
353
+ document.querySelectorAll('button[data-state]').forEach((button) => {
354
+ button.addEventListener('click', () => renderState(button.dataset.state));
355
+ });
356
+
357
+ renderContent();
358
+ `,
359
+ },
360
+ {
361
+ path: 'scripts/validate-demo.js',
362
+ content: `const fs = require('node:fs');
363
+ const path = require('node:path');
364
+
365
+ const required = [
366
+ 'README.md',
367
+ 'server.js',
368
+ 'src/index.html',
369
+ 'src/styles.css',
370
+ 'src/app.js',
371
+ 'specs/quiver-spec-viewer/SPEC.md',
372
+ 'specs/quiver-spec-viewer/slices/slice-00-docs-foundation/slice.json',
373
+ 'specs/quiver-spec-viewer/slices/slice-01-static-spec-viewer/slice.json',
374
+ ];
375
+
376
+ const missing = required.filter((relativePath) => !fs.existsSync(path.join(__dirname, '..', relativePath)));
377
+
378
+ if (missing.length > 0) {
379
+ console.error(\`Missing demo files: \${missing.join(', ')}\`);
380
+ process.exit(1);
381
+ }
382
+
383
+ console.log('Quiver Spec Viewer demo validated');
384
+ `,
385
+ },
386
+ {
387
+ path: 'specs/quiver-spec-viewer/SPEC.md',
388
+ content: `# Quiver Spec Viewer Spec
389
+
390
+ ## Objective
391
+
392
+ Build a small static viewer that demonstrates how Quiver specs and slices can be represented in a simple UI.
393
+
394
+ ## Scope
395
+
396
+ - Static HTML/CSS/JS app.
397
+ - Mock spec and slice data.
398
+ - Basic loading, empty, error, and content states.
399
+ - Demo documentation and validation script.
400
+
401
+ ## Non-Scope
402
+
403
+ - Real browser filesystem parsing.
404
+ - Backend API.
405
+ - Heavy frontend framework.
406
+
407
+ ## Slices
408
+
409
+ | Slice | Title | Status |
410
+ |---|---|---|
411
+ | slice-00-docs-foundation | Docs foundation | completed |
412
+ | slice-01-static-spec-viewer | Static spec viewer | planned |
413
+ `,
414
+ },
415
+ {
416
+ path: 'specs/quiver-spec-viewer/STATUS.md',
417
+ content: `# Quiver Spec Viewer Status
418
+
419
+ | Slice | Status |
420
+ |---|---|
421
+ | slice-00-docs-foundation | completed |
422
+ | slice-01-static-spec-viewer | planned |
423
+ `,
424
+ },
425
+ {
426
+ path: 'specs/quiver-spec-viewer/EVIDENCE_REPORT.md',
427
+ content: `# Evidence Report
428
+
429
+ | Check | Result | Notes |
430
+ |---|---|---|
431
+ | npm run validate | pending | Run after generating the demo. |
432
+ `,
433
+ },
434
+ {
435
+ path: 'specs/quiver-spec-viewer/pr.md',
436
+ content: `## Title
437
+
438
+ Quiver Spec Viewer demo
439
+
440
+ ## Summary
441
+
442
+ - Adds a static Quiver spec/slice viewer demo.
443
+ - Includes mock states and validation script.
444
+ `,
445
+ },
446
+ {
447
+ path: 'specs/quiver-spec-viewer/slices/slice-00-docs-foundation/slice.json',
448
+ content: createJson({
449
+ slice_id: 'slice-00-docs-foundation',
450
+ ticket: 'DEMO-00',
451
+ type: 'docs',
452
+ title: 'Docs foundation',
453
+ objective: 'Publish demo spec, slices, handoffs, and PR body.',
454
+ files: [
455
+ 'specs/quiver-spec-viewer/SPEC.md',
456
+ 'specs/quiver-spec-viewer/STATUS.md',
457
+ 'specs/quiver-spec-viewer/EVIDENCE_REPORT.md',
458
+ 'specs/quiver-spec-viewer/pr.md',
459
+ ],
460
+ depends_on: [],
461
+ parallel_safe: 'yes',
462
+ parallel_safe_reason: 'Documentation-only foundation slice.',
463
+ acceptance: ['Demo documentation artifacts exist.'],
464
+ tests: ['npm run validate'],
465
+ status: 'completed',
466
+ }),
467
+ },
468
+ {
469
+ path: 'specs/quiver-spec-viewer/slices/slice-00-docs-foundation/EXECUTION_BRIEF.md',
470
+ content: `# EXECUTION_BRIEF - slice-00-docs-foundation
471
+
472
+ ## Context
473
+
474
+ This slice publishes the demo planning artifacts.
475
+
476
+ ## Objective
477
+
478
+ Keep the Quiver Spec Viewer spec, status, evidence, and PR body available in the repo.
479
+
480
+ ## Checklist
481
+
482
+ - [ ] Verify spec docs exist.
483
+ - [ ] Run \`npm run validate\`.
484
+ `,
485
+ },
486
+ {
487
+ path: 'specs/quiver-spec-viewer/slices/slice-00-docs-foundation/CLOSURE_BRIEF.md',
488
+ content: `# CLOSURE_BRIEF - slice-00-docs-foundation
489
+
490
+ ## Summary
491
+
492
+ Pending execution notes.
493
+
494
+ ## Validation
495
+
496
+ - [ ] npm run validate
497
+ `,
498
+ },
499
+ {
500
+ path: 'specs/quiver-spec-viewer/slices/slice-01-static-spec-viewer/slice.json',
501
+ content: createJson({
502
+ slice_id: 'slice-01-static-spec-viewer',
503
+ ticket: 'DEMO-01',
504
+ type: 'feature',
505
+ title: 'Static spec viewer',
506
+ objective: 'Render mocked Quiver spec and slice data in a small static app.',
507
+ files: [
508
+ 'src/index.html',
509
+ 'src/styles.css',
510
+ 'src/app.js',
511
+ 'server.js',
512
+ 'scripts/validate-demo.js',
513
+ ],
514
+ depends_on: ['slice-00-docs-foundation'],
515
+ parallel_safe: 'yes',
516
+ parallel_safe_reason: 'Owns only demo app files after docs foundation exists.',
517
+ acceptance: [
518
+ 'Viewer shows title, spec list, and detail.',
519
+ 'Viewer supports loading, empty, error, and content states.',
520
+ 'Demo validates with npm run validate.',
521
+ ],
522
+ tests: ['npm run validate'],
523
+ status: 'planned',
524
+ }),
525
+ },
526
+ {
527
+ path: 'specs/quiver-spec-viewer/slices/slice-01-static-spec-viewer/EXECUTION_BRIEF.md',
528
+ content: `# EXECUTION_BRIEF - slice-01-static-spec-viewer
529
+
530
+ ## Context
531
+
532
+ The demo is intentionally static and dependency-free.
533
+
534
+ ## Objective
535
+
536
+ Implement a small viewer for mocked Quiver specs and slices.
537
+
538
+ ## Checklist
539
+
540
+ - [ ] Keep the UI simple and readable.
541
+ - [ ] Do not add heavy dependencies.
542
+ - [ ] Run \`npm run validate\`.
543
+ `,
544
+ },
545
+ {
546
+ path: 'specs/quiver-spec-viewer/slices/slice-01-static-spec-viewer/CLOSURE_BRIEF.md',
547
+ content: `# CLOSURE_BRIEF - slice-01-static-spec-viewer
548
+
549
+ ## Summary
550
+
551
+ Pending execution notes.
552
+
553
+ ## Validation
554
+
555
+ - [ ] npm run validate
556
+ `,
557
+ },
558
+ ];
559
+ }
560
+
561
+ function buildDemoPlan(targetRoot, options = {}) {
562
+ if (options.demo !== SPEC_VIEWER_DEMO) {
563
+ throw new Error(`create-quiver: unsupported demo: ${options.demo || '(missing)'}. Supported demos: ${SPEC_VIEWER_DEMO}`);
564
+ }
565
+
566
+ if (fs.existsSync(targetRoot) && !fs.statSync(targetRoot).isDirectory()) {
567
+ throw new Error(`create-quiver: demo target is not a directory: ${targetRoot}`);
568
+ }
569
+
570
+ const files = createSpecViewerFiles();
571
+ const operations = files.map((file) => {
572
+ const absolutePath = path.join(targetRoot, file.path);
573
+ return {
574
+ action: fs.existsSync(absolutePath) ? 'preserve' : 'create',
575
+ path: file.path,
576
+ absolutePath,
577
+ content: file.content,
578
+ };
579
+ });
580
+
581
+ const createCount = operations.filter((operation) => operation.action === 'create').length;
582
+ const preserveCount = operations.length - createCount;
583
+
584
+ return {
585
+ demo: SPEC_VIEWER_DEMO,
586
+ projectName: SPEC_VIEWER_PROJECT_NAME,
587
+ targetRoot,
588
+ operations,
589
+ summary: {
590
+ create: createCount,
591
+ preserve: preserveCount,
592
+ total: operations.length,
593
+ },
594
+ };
595
+ }
596
+
597
+ function formatDemoPlan(plan, options = {}) {
598
+ const lines = [];
599
+ const title = options.dryRun ? 'Quiver demo dry-run' : 'Quiver demo created';
600
+
601
+ lines.push(title);
602
+ lines.push(`- Demo: ${plan.demo}`);
603
+ lines.push(`- Project: ${plan.projectName}`);
604
+ lines.push(`- Target: ${plan.targetRoot}`);
605
+ lines.push(`- Files to create: ${plan.summary.create}`);
606
+ lines.push(`- Files to preserve: ${plan.summary.preserve}`);
607
+ lines.push('');
608
+ lines.push('Files to create');
609
+ for (const operation of plan.operations.filter((item) => item.action === 'create')) {
610
+ lines.push(`- ${operation.path}`);
611
+ }
612
+ if (plan.summary.create === 0) {
613
+ lines.push('- none');
614
+ }
615
+ lines.push('');
616
+ lines.push('Files to preserve');
617
+ for (const operation of plan.operations.filter((item) => item.action === 'preserve')) {
618
+ lines.push(`- ${operation.path}`);
619
+ }
620
+ if (plan.summary.preserve === 0) {
621
+ lines.push('- none');
622
+ }
623
+
624
+ if (options.dryRun) {
625
+ lines.push('');
626
+ lines.push('No files were written.');
627
+ } else {
628
+ lines.push('');
629
+ lines.push('Next commands');
630
+ lines.push(`- cd ${plan.targetRoot}`);
631
+ lines.push('- npm run validate');
632
+ lines.push('- npm start');
633
+ }
634
+
635
+ lines.push('');
636
+ return lines.join('\n');
637
+ }
638
+
639
+ function writeDemoPlan(plan) {
640
+ fs.mkdirSync(plan.targetRoot, { recursive: true });
641
+
642
+ for (const operation of plan.operations) {
643
+ if (operation.action !== 'create') {
644
+ continue;
645
+ }
646
+
647
+ fs.mkdirSync(path.dirname(operation.absolutePath), { recursive: true });
648
+ fs.writeFileSync(operation.absolutePath, operation.content);
649
+ }
650
+ }
651
+
652
+ module.exports = {
653
+ SPEC_VIEWER_DEMO,
654
+ buildDemoPlan,
655
+ formatDemoPlan,
656
+ writeDemoPlan,
657
+ };