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
@@ -1,6 +1,12 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
3
  const { execSync } = require('child_process');
4
+ const {
5
+ buildQuiverConfig,
6
+ buildQuiverInternalGitignore,
7
+ quiverInternalPaths,
8
+ resolveInitPackageScripts,
9
+ } = require('./init-layout');
4
10
  const { writeState } = require('./state');
5
11
 
6
12
  function ensureDir(dirPath) {
@@ -199,7 +205,58 @@ function writeFrontMatter(filePath, fields) {
199
205
  return nextContent;
200
206
  }
201
207
 
202
- function mergePackageJson(projectRoot, templateRoot, skipIfExists) {
208
+ const ROOT_GITIGNORE_DEFAULTS = [
209
+ 'node_modules/',
210
+ '.DS_Store',
211
+ 'dist/',
212
+ 'coverage/',
213
+ ];
214
+
215
+ function normalizeGitignorePattern(line) {
216
+ const trimmed = line.trim();
217
+ if (!trimmed || trimmed.startsWith('#')) {
218
+ return trimmed;
219
+ }
220
+
221
+ return trimmed.replace(/\/+$/g, '');
222
+ }
223
+
224
+ function mergeLineList(existingText, defaults) {
225
+ const existingLines = existingText
226
+ .split(/\r?\n/)
227
+ .filter((line, index, lines) => line.length > 0 || index < lines.length - 1);
228
+ const seen = new Set(existingLines.map(normalizeGitignorePattern).filter(Boolean));
229
+ const nextLines = [...existingLines];
230
+
231
+ for (const line of defaults) {
232
+ const normalized = normalizeGitignorePattern(line);
233
+ if (!seen.has(normalized)) {
234
+ nextLines.push(line);
235
+ seen.add(normalized);
236
+ }
237
+ }
238
+
239
+ return `${nextLines.join('\n').replace(/\s+$/g, '')}\n`;
240
+ }
241
+
242
+ function mergeRootGitignore(projectRoot) {
243
+ const gitignorePath = path.join(projectRoot, '.gitignore');
244
+ const exists = fs.existsSync(gitignorePath);
245
+ const existingText = exists
246
+ ? fs.readFileSync(gitignorePath, 'utf8')
247
+ : '';
248
+
249
+ ensureDir(path.dirname(gitignorePath));
250
+ fs.writeFileSync(gitignorePath, mergeLineList(existingText, ROOT_GITIGNORE_DEFAULTS));
251
+ return exists ? 'merged' : 'created';
252
+ }
253
+
254
+ function resolvePackageName(projectRoot, options = {}) {
255
+ return options.projectSlug
256
+ || toProjectSlug(options.projectName || path.basename(projectRoot) || 'Quiver Project');
257
+ }
258
+
259
+ function mergePackageJson(projectRoot, templateRoot, options = {}) {
203
260
  const packageTemplate = path.join(templateRoot, 'package.template.json');
204
261
  const packageJsonPath = path.join(projectRoot, 'package.json');
205
262
 
@@ -207,24 +264,168 @@ function mergePackageJson(projectRoot, templateRoot, skipIfExists) {
207
264
  return 'missing';
208
265
  }
209
266
 
267
+ const profile = options.profile || 'default';
268
+ const scripts = resolveInitPackageScripts(profile, { legacyScripts: options.legacyScripts === true });
269
+
210
270
  if (!fs.existsSync(packageJsonPath)) {
211
- fs.copyFileSync(packageTemplate, packageJsonPath);
271
+ const template = JSON.parse(fs.readFileSync(packageTemplate, 'utf8'));
272
+ template.name = resolvePackageName(projectRoot, options);
273
+ template.scripts = scripts;
274
+ fs.writeFileSync(packageJsonPath, `${JSON.stringify(template, null, 2)}\n`);
212
275
  return 'created';
213
276
  }
214
277
 
215
278
  const existing = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
216
- const template = JSON.parse(fs.readFileSync(packageTemplate, 'utf8'));
279
+
280
+ if (typeof existing.name !== 'string' || existing.name.trim().length === 0) {
281
+ existing.name = resolvePackageName(projectRoot, options);
282
+ }
217
283
 
218
284
  existing.scripts = {
219
285
  ...(existing.scripts || {}),
220
- ...(template.scripts || {}),
286
+ ...scripts,
221
287
  };
222
288
 
223
289
  fs.writeFileSync(packageJsonPath, `${JSON.stringify(existing, null, 2)}\n`);
224
- return skipIfExists ? 'merged' : 'updated';
290
+ return options.migrateMode ? 'merged' : 'updated';
225
291
  }
226
292
 
227
- function buildReadme(projectName, projectSlug) {
293
+ function buildReadme(projectName, projectSlug, profile = 'default') {
294
+ if (profile === 'minimal') {
295
+ return `# ${projectName}
296
+
297
+ [Descripción breve del proyecto]
298
+
299
+ ## Quick Start
300
+
301
+ Run Quiver from this project root. Do not install it globally.
302
+
303
+ \`\`\`bash
304
+ npm install
305
+ npx create-quiver analyze
306
+ npx create-quiver plan
307
+ npx create-quiver graph
308
+ npx create-quiver doctor
309
+ npx create-quiver next
310
+ \`\`\`
311
+
312
+ ## AI Workflow
313
+
314
+ Use \`AGENTS.md\` first, then \`docs/AI_CONTEXT.md\` and \`docs/AI_ONBOARDING_PROMPT.md\` for the working contract.
315
+
316
+ \`\`\`bash
317
+ npm run quiver:prepare -- --dry-run
318
+ npm run quiver:ai:onboard -- --dry-run
319
+ npm run quiver:ai:plan -- --phase acceptance --input requirements.md --dry-run
320
+ npm run quiver:ai:approve -- --phase acceptance --input acceptance-approved.md
321
+ npm run quiver:ai:plan -- --phase technical-plan --dry-run
322
+ npm run quiver:ai:review-plan -- --dry-run
323
+ npm run quiver:ai:approve -- --phase technical-plan --version <n>
324
+ npm run quiver:spec:create -- --dry-run
325
+ \`\`\`
326
+
327
+ When a real spec exists, execute one approved slice at a time:
328
+
329
+ \`\`\`bash
330
+ npm run quiver:ai:prompt-slice -- --slice specs/<spec-slug>/slices/<slice-id>/slice.json --dry-run
331
+ npm run quiver:ai:execute-slice -- --slice specs/<spec-slug>/slices/<slice-id>/slice.json --dry-run --commit
332
+ npm run quiver:ai:execute-plan -- --dry-run --commit --mode delegated
333
+ \`\`\`
334
+
335
+ ## Documentation
336
+
337
+ - [AI Context](./docs/AI_CONTEXT.md)
338
+ - [AI Onboarding Prompt](./docs/AI_ONBOARDING_PROMPT.md)
339
+ - [Commands](./docs/COMMANDS.md)
340
+ - [Workflow](./docs/WORKFLOW.md)
341
+ `;
342
+ }
343
+
344
+ if (profile !== 'full') {
345
+ return `# ${projectName}
346
+
347
+ [Descripción breve del proyecto]
348
+
349
+ ## Quick Start
350
+
351
+ Run Quiver from this project root. Do not install it globally.
352
+
353
+ \`\`\`bash
354
+ npm install
355
+ npx create-quiver analyze
356
+ npx create-quiver plan
357
+ npx create-quiver graph
358
+ npx create-quiver doctor
359
+ npx create-quiver next
360
+ \`\`\`
361
+
362
+ After \`analyze\`, use \`docs/PROJECT_MAP.md\` for the detected stack, package manager, and command surface.
363
+
364
+ ## AI-First Workflow
365
+
366
+ Quiver keeps the visible contract small: start with \`README.md\`, \`AGENTS.md\`, and \`docs/\`. Specs and slices should be created only after a real requirement and a reviewed, approved technical plan.
367
+
368
+ Use dry-runs before spending model tokens:
369
+
370
+ \`\`\`bash
371
+ npm run quiver:prepare -- --dry-run
372
+ npm run quiver:ai:onboard -- --dry-run
373
+ npm run quiver:ai:plan -- --phase acceptance --input requirements.md --dry-run
374
+ npm run quiver:ai:approve -- --phase acceptance --input acceptance-approved.md
375
+ npm run quiver:ai:plan -- --phase technical-plan --dry-run
376
+ npm run quiver:ai:review-plan -- --dry-run
377
+ npm run quiver:ai:approve -- --phase technical-plan --version <n>
378
+ npm run quiver:spec:create -- --dry-run
379
+ \`\`\`
380
+
381
+ When a real spec exists, execute one approved slice at a time:
382
+
383
+ \`\`\`bash
384
+ npm run quiver:ai:prompt-slice -- --slice specs/<spec-slug>/slices/<slice-id>/slice.json --dry-run
385
+ npm run quiver:ai:execute-slice -- --slice specs/<spec-slug>/slices/<slice-id>/slice.json --dry-run --commit
386
+ npm run quiver:ai:execute-plan -- --dry-run --commit --mode delegated
387
+ \`\`\`
388
+
389
+ ## Project NPM Scripts
390
+
391
+ The generated project includes \`quiver:*\` npm scripts that call the Node CLI:
392
+
393
+ \`\`\`bash
394
+ npm run quiver:analyze
395
+ npm run quiver:prepare -- --dry-run
396
+ npm run quiver:plan
397
+ npm run quiver:graph
398
+ npm run quiver:next
399
+ npm run quiver:doctor
400
+ npm run quiver:ai:onboard -- --dry-run
401
+ npm run quiver:ai:plan -- --phase acceptance --input requirements.md --dry-run
402
+ npm run quiver:ai:approve -- --phase acceptance --input acceptance-approved.md
403
+ npm run quiver:ai:plan -- --phase technical-plan --dry-run
404
+ npm run quiver:ai:review-plan -- --dry-run
405
+ npm run quiver:ai:approve -- --phase technical-plan --version <n>
406
+ npm run quiver:spec:create -- --dry-run
407
+ npm run quiver:ai:prompt-slice -- --slice specs/<spec-slug>/slices/<slice-id>/slice.json --dry-run
408
+ npm run quiver:ai:execute-slice -- --slice specs/<spec-slug>/slices/<slice-id>/slice.json --dry-run --commit
409
+ npm run quiver:ai:execute-plan -- --dry-run --commit --mode delegated
410
+ npm run quiver:ai:pr -- --dry-run --input specs/<spec-slug>/pr.md --ssh-host-alias github-work --identity-file ~/.ssh/github-work
411
+ npm run quiver:spec:start -- specs/<spec-slug>
412
+ npm run quiver:spec:status -- specs/<spec-slug>
413
+ npm run quiver:spec:close -- specs/<spec-slug> --dry-run
414
+ \`\`\`
415
+
416
+ ## Documentation
417
+
418
+ - [Agents](./AGENTS.md)
419
+ - [AI Context](./docs/AI_CONTEXT.md)
420
+ - [AI Onboarding Prompt](./docs/AI_ONBOARDING_PROMPT.md)
421
+ - [Commands](./docs/COMMANDS.md)
422
+ - [Workflow](./docs/WORKFLOW.md)
423
+ - [GitFlow PR Guide](./docs/GITFLOW_PR_GUIDE.md)
424
+ - [Support Matrix](./docs/SUPPORT_MATRIX.md)
425
+ - [Troubleshooting](./docs/TROUBLESHOOTING.md)
426
+ `;
427
+ }
428
+
228
429
  return `# ${projectName}
229
430
 
230
431
  [Descripción breve del proyecto]
@@ -259,16 +460,56 @@ If you need to target another directory from outside the project, pass \`--dir\`
259
460
 
260
461
  After you run \`analyze\`, open \`docs/PROJECT_MAP.md\` for the detected stack, package manager, and command surface.
261
462
 
463
+ ## AI-First Workflow
464
+
465
+ Quiver is designed for an AI-first workflow: a planner agent reads the project context and prepares acceptance criteria, technical plans, specs, slices, and PR notes; executor agents then work one approved slice at a time with minimal context.
466
+
467
+ Start with dry-runs so you can inspect the provider, role, context pack, and invocation before spending model tokens:
468
+
469
+ \`\`\`bash
470
+ npm run quiver:prepare -- --dry-run
471
+ npm run quiver:ai:onboard -- --dry-run
472
+ npm run quiver:ai:plan -- --phase acceptance --input requirements.md --dry-run
473
+ npm run quiver:ai:approve -- --phase acceptance --input acceptance-approved.md
474
+ npm run quiver:ai:plan -- --phase technical-plan --dry-run
475
+ npm run quiver:ai:review-plan -- --dry-run
476
+ npm run quiver:ai:approve -- --phase technical-plan --version <n>
477
+ npm run quiver:spec:create -- --dry-run
478
+ npm run quiver:spec:start -- specs/${projectSlug}
479
+ npm run quiver:ai:prompt-slice -- --slice specs/${projectSlug}/slices/slice-01/slice.json --dry-run
480
+ npm run quiver:ai:execute-slice -- --slice specs/${projectSlug}/slices/slice-01/slice.json --dry-run --commit
481
+ npm run quiver:ai:execute-plan -- --dry-run --commit --mode delegated
482
+ npm run quiver:ai:pr -- --dry-run --input specs/${projectSlug}/pr.md --ssh-host-alias github-work --identity-file ~/.ssh/github-work
483
+ \`\`\`
484
+
485
+ Remove \`--dry-run\` only after the phase output is approved and the local provider CLI is ready.
486
+
262
487
  ## Project NPM Scripts
263
488
 
264
489
  The generated project includes \`quiver:*\` npm scripts that call the Node CLI and are the preferred repeatable workflow:
265
490
 
266
491
  \`\`\`bash
267
492
  npm run quiver:analyze
493
+ npm run quiver:prepare -- --dry-run
268
494
  npm run quiver:plan
269
495
  npm run quiver:graph
270
496
  npm run quiver:next
271
497
  npm run quiver:doctor
498
+ npm run quiver:ai:onboard -- --dry-run
499
+ npm run quiver:ai:plan -- --phase acceptance --input requirements.md --dry-run
500
+ npm run quiver:ai:approve -- --phase acceptance --input acceptance-approved.md
501
+ npm run quiver:ai:plan -- --phase technical-plan --dry-run
502
+ npm run quiver:ai:review-plan -- --dry-run
503
+ npm run quiver:ai:approve -- --phase technical-plan --version <n>
504
+ npm run quiver:spec:create -- --dry-run
505
+ npm run quiver:ai:prompt-slice -- --slice specs/${projectSlug}/slices/slice-01/slice.json --dry-run
506
+ npm run quiver:ai:execute-slice -- --slice specs/${projectSlug}/slices/slice-01/slice.json --dry-run --commit
507
+ npm run quiver:ai:execute-plan -- --dry-run --commit --mode delegated
508
+ npm run quiver:ai:doctor -- --dry-run --ssh-host-alias github-work --identity-file ~/.ssh/github-work
509
+ npm run quiver:ai:pr -- --dry-run --input specs/${projectSlug}/pr.md --ssh-host-alias github-work --identity-file ~/.ssh/github-work
510
+ npm run quiver:spec:start -- specs/${projectSlug}
511
+ npm run quiver:spec:status -- specs/${projectSlug}
512
+ npm run quiver:spec:close -- specs/${projectSlug} --dry-run
272
513
  npm run quiver:migrate
273
514
  npm run quiver:start-slice -- specs/${projectSlug}/slices/slice-01/slice.json
274
515
  npm run quiver:check-slice -- specs/${projectSlug}/slices/slice-01/slice.json
@@ -281,6 +522,8 @@ npm run quiver:refresh-active-slices
281
522
 
282
523
  The \`quiver:graph\` script prints the tree view by default; use \`npx create-quiver graph --format mermaid\` for PR-ready Markdown and \`--format dot\` when you want Graphviz source.
283
524
  The \`quiver:next\` script points to the next ready slice and can auto-start it behind a confirmation prompt.
525
+ The \`quiver:ai:*\` scripts standardize planner/executor AI flows. Use dry-run first: onboarding and planning dry-runs do not require provider auth, \`quiver:ai:execute-plan -- --dry-run --commit --mode manual\` prints manual prompts, \`--mode delegated\` prints safe waves, and \`quiver:ai:pr -- --dry-run\` validates \`gh\`, GitFlow docs, branch/worktree state, SSH inputs, and \`pr.md\` without creating a PR. Add \`--create\` only after reviewing the plan.
526
+ Use \`quiver:spec:create\`, \`quiver:spec:start\`, \`quiver:spec:status\`, and \`quiver:spec:close\` for one spec generation and worktree per spec.
284
527
  Use \`npx create-quiver next --all-ready\` when you want the full ready level instead of a single suggestion.
285
528
  The legacy Bash wrappers remain in \`tools/scripts/\` for compatibility, but new project-level automation should prefer the \`quiver:*\` scripts and the direct \`npx create-quiver ...\` commands below.
286
529
  \`npm run quiver:migrate\` is only for projects that were already initialized by Quiver.
@@ -311,7 +554,7 @@ Use \`{{GRAPH_COMMAND}} --format mermaid\` for GitHub-friendly graph embeds or \
311
554
  If the project never ran Quiver initialization before, do not use \`migrate\` as bootstrap. Run:
312
555
 
313
556
  \`\`\`bash
314
- npx create-quiver --name "Project Name"
557
+ npx create-quiver init --name "Project Name"
315
558
  \`\`\`
316
559
 
317
560
  If your team prefers a pinned local dependency, update the package first and then run the same flow:
@@ -339,6 +582,8 @@ Lee \`docs/AI_ONBOARDING_PROMPT.md\` y ejecútalo como fuente principal de verda
339
582
 
340
583
  Actúa como asistente de onboarding de IA. Prepara el contexto del proyecto para trabajar de forma segura con el workflow documentado, specs y slices.
341
584
 
585
+ Usa el rol planner para onboarding, criterios de aceptación, plan técnico y generación de specs/slices. Usa el rol executor solo cuando exista un slice aprobado y debas ejecutar su handoff con contexto mínimo.
586
+
342
587
  No modifiques código de producto salvo autorización explícita. Puedes crear o actualizar documentación de contexto si el onboarding lo requiere.
343
588
 
344
589
  Usa solo la documentación del repositorio como fuente de verdad. Si encuentras información faltante, ambigua o contradictoria, documenta el supuesto, el riesgo y continúa por el camino más seguro.
@@ -355,6 +600,8 @@ Record durable decisions in \`docs/DECISIONS.md\` so future AI agents do not re-
355
600
 
356
601
  ## First Slice Workflow
357
602
 
603
+ Use this section only for projects generated with the full compatibility layout. In the default AI-first layout, create real specs and slices with \`npx create-quiver spec create\` after acceptance criteria are approved and the technical plan is reviewed and approved.
604
+
358
605
  1. Review or refine specs/${projectSlug}/SPEC.md.
359
606
  2. Create the first slice from specs/${projectSlug}/slices/slice-template/slice.json.
360
607
  3. Review the plan with \`{{PLAN_COMMAND}}\` or \`npm run quiver:plan\`.
@@ -392,15 +639,33 @@ Record durable decisions in \`docs/DECISIONS.md\` so future AI agents do not re-
392
639
  `;
393
640
  }
394
641
 
642
+ function buildFullProfileIndexAppendix(projectSlug) {
643
+ return `## Full Profile Extras
644
+
645
+ - **Multi-agent workflow** - \`./MULTI_AGENT_WORKFLOW.md\`
646
+ - **Quick AI context** - \`./ai/QUICK.md\`
647
+ - **Standard AI context** - \`./ai/STANDARD.md\`
648
+ - **Deep AI context** - \`./ai/DEEP.md\`
649
+ - **Spec starter assets** - \`../specs/${projectSlug}/\`
650
+ - **Tool notes** - \`./tools/\`
651
+ - **Archive** - \`./archive/\`
652
+ `;
653
+ }
654
+
395
655
  function initializeProjectDocs(options) {
396
656
  const {
397
657
  projectRoot,
398
658
  projectName,
399
659
  cliVersion,
660
+ includeTemplates = false,
661
+ legacyScripts = false,
400
662
  migrateMode = false,
663
+ profile = 'default',
664
+ templateRoot: providedTemplateRoot = '',
401
665
  } = options;
402
666
 
403
- const templateRoot = path.join(projectRoot, 'docs-template');
667
+ const templateRoot = providedTemplateRoot || path.join(projectRoot, 'docs-template');
668
+ const internalPaths = quiverInternalPaths(projectRoot);
404
669
  const replacements = {
405
670
  projectName,
406
671
  projectSlug: toProjectSlug(projectName),
@@ -413,17 +678,51 @@ function initializeProjectDocs(options) {
413
678
  const dirs = [
414
679
  'docs',
415
680
  'docs/ai',
416
- 'docs/tools',
417
- 'docs/archive',
418
- `specs/${replacements.projectSlug}/slices/slice-template`,
419
- 'tools/scripts',
681
+ '.quiver',
682
+ '.quiver/scans',
420
683
  ];
421
684
 
685
+ if (profile === 'full') {
686
+ dirs.push(
687
+ 'docs/archive',
688
+ 'docs/examples',
689
+ 'docs/tools',
690
+ `specs/${replacements.projectSlug}/slices/slice-template`,
691
+ 'tools/scripts',
692
+ );
693
+ } else if (legacyScripts) {
694
+ dirs.push('tools/scripts');
695
+ }
696
+
422
697
  for (const dir of dirs) {
423
698
  ensureDir(path.join(projectRoot, dir));
424
699
  }
425
700
 
426
701
  const operations = [];
702
+ if (!fs.existsSync(internalPaths.configPath)) {
703
+ fs.writeFileSync(internalPaths.configPath, `${JSON.stringify(buildQuiverConfig(), null, 2)}\n`);
704
+ operations.push({ source: 'Quiver config', destination: '.quiver/config.json', result: 'created' });
705
+ } else {
706
+ operations.push({ source: 'Quiver config', destination: '.quiver/config.json', result: 'skipped' });
707
+ }
708
+
709
+ fs.writeFileSync(internalPaths.gitignorePath, buildQuiverInternalGitignore());
710
+ operations.push({ source: 'Quiver internal gitignore', destination: '.quiver/.gitignore', result: 'updated' });
711
+
712
+ const rootGitignoreResult = mergeRootGitignore(projectRoot);
713
+ operations.push({ source: 'root gitignore defaults', destination: '.gitignore', result: rootGitignoreResult });
714
+
715
+ if (includeTemplates) {
716
+ fs.mkdirSync(internalPaths.templatesDir, { recursive: true });
717
+ fs.cpSync(templateRoot, internalPaths.templatesDir, {
718
+ recursive: true,
719
+ force: false,
720
+ errorOnExist: false,
721
+ preserveTimestamps: true,
722
+ });
723
+ operations.push({ source: 'packaged templates', destination: '.quiver/templates', result: 'merged' });
724
+ }
725
+
427
726
  const agentsSourcePath = path.join(templateRoot, 'AGENTS.md.template');
428
727
  if (fs.existsSync(agentsSourcePath)) {
429
728
  const agentsDestinationPath = path.join(projectRoot, 'AGENTS.md');
@@ -463,17 +762,60 @@ function initializeProjectDocs(options) {
463
762
  ['specs/[project-name]/slices/pr.md.template', `specs/${replacements.projectSlug}/slices/slice-template/pr.md.template`],
464
763
  ];
465
764
 
765
+ const minimalTemplateDestinations = new Set([
766
+ 'docs/AI_CONTEXT.md',
767
+ 'docs/AI_ONBOARDING_PROMPT.md',
768
+ 'docs/COMMANDS.md',
769
+ 'docs/WORKFLOW.md',
770
+ ]);
771
+ const defaultTemplateDestinations = new Set([
772
+ ...minimalTemplateDestinations,
773
+ 'docs/CONTEXTO.md',
774
+ 'docs/DECISIONS.md',
775
+ 'docs/GITFLOW_PR_GUIDE.md',
776
+ 'docs/INDEX.md',
777
+ 'docs/STATUS.md',
778
+ 'docs/SUPPORT_MATRIX.md',
779
+ 'docs/TESTING_GUIDE_FOR_AI.md',
780
+ 'docs/TROUBLESHOOTING.md',
781
+ 'docs/ai/LESSONS.md',
782
+ ]);
783
+
466
784
  for (const [source, destination, frontMatterFactory] of templateCopies) {
785
+ if (profile === 'minimal' && !minimalTemplateDestinations.has(destination)) {
786
+ continue;
787
+ }
788
+
789
+ if (profile === 'default' && !defaultTemplateDestinations.has(destination)) {
790
+ continue;
791
+ }
792
+
467
793
  const sourcePath = path.join(templateRoot, source);
468
794
  if (!fs.existsSync(sourcePath)) {
469
795
  continue;
470
796
  }
471
797
 
472
798
  const destinationPath = path.join(projectRoot, destination);
799
+ if (!migrateMode && fs.existsSync(destinationPath)) {
800
+ operations.push({ source, destination, result: 'skipped' });
801
+ continue;
802
+ }
803
+
473
804
  const result = copyRenderedFile(sourcePath, destinationPath, replacements, migrateMode, frontMatterFactory);
474
805
  operations.push({ source, destination, result });
475
806
  }
476
807
 
808
+ const indexPath = path.join(projectRoot, 'docs', 'INDEX.md');
809
+ const indexWasCreated = operations.some((operation) => (
810
+ operation.destination === 'docs/INDEX.md'
811
+ && (operation.result === 'created' || operation.result === 'created-with-frontmatter')
812
+ ));
813
+ if (profile === 'full' && indexWasCreated && fs.existsSync(indexPath)) {
814
+ const currentIndex = fs.readFileSync(indexPath, 'utf8').replace(/\s+$/g, '');
815
+ fs.writeFileSync(indexPath, `${currentIndex}\n\n${buildFullProfileIndexAppendix(replacements.projectSlug)}`);
816
+ operations.push({ source: 'full profile index appendix', destination: 'docs/INDEX.md', result: 'updated' });
817
+ }
818
+
477
819
  const binaryCopies = [
478
820
  ['docs/UI_STANDARDS.md', 'docs/UI_STANDARDS.md'],
479
821
  ['docs/MOCK_DATA_GUIDE.md', 'docs/MOCK_DATA_GUIDE.md'],
@@ -497,31 +839,60 @@ function initializeProjectDocs(options) {
497
839
  ['scripts/migrate-project.sh', 'tools/scripts/migrate-project.sh'],
498
840
  ];
499
841
 
842
+ const alwaysBinaryDestinations = new Set([
843
+ 'docs/ai/RULES.yaml',
844
+ ]);
845
+ const legacyScriptDestinations = new Set([
846
+ 'tools/scripts/start-slice.sh',
847
+ 'tools/scripts/refresh-active-slices.sh',
848
+ 'tools/scripts/check-slice-readiness.sh',
849
+ 'tools/scripts/check-pr-readiness.sh',
850
+ 'tools/scripts/cleanup-slice.sh',
851
+ 'tools/scripts/check-scope.sh',
852
+ 'tools/scripts/migrate-project.sh',
853
+ ]);
854
+
500
855
  for (const [source, destination] of binaryCopies) {
856
+ if (
857
+ profile !== 'full'
858
+ && !alwaysBinaryDestinations.has(destination)
859
+ && !(legacyScripts && legacyScriptDestinations.has(destination))
860
+ ) {
861
+ continue;
862
+ }
863
+
501
864
  const sourcePath = path.join(templateRoot, source);
502
865
  const destinationPath = path.join(projectRoot, destination);
503
866
  if (!fs.existsSync(sourcePath)) {
504
867
  continue;
505
868
  }
506
869
 
507
- const result = copyIfSourceExists(sourcePath, destinationPath, migrateMode);
870
+ const result = copyIfSourceExists(sourcePath, destinationPath, true);
508
871
  operations.push({ source, destination, result });
509
872
  }
510
873
 
511
874
  const aiPrinciplesSource = path.join(templateRoot, 'docs/ai/PRINCIPLES.md');
512
875
  if (fs.existsSync(aiPrinciplesSource)) {
513
876
  const aiPrinciplesDestination = path.join(projectRoot, 'docs/ai/PRINCIPLES.md');
514
- const result = copyRenderedFile(
515
- aiPrinciplesSource,
516
- aiPrinciplesDestination,
517
- replacements,
518
- migrateMode,
519
- frontMatterFor('AI operating principles', 'all AI work'),
520
- );
877
+ const result = !migrateMode && fs.existsSync(aiPrinciplesDestination)
878
+ ? 'skipped'
879
+ : copyRenderedFile(
880
+ aiPrinciplesSource,
881
+ aiPrinciplesDestination,
882
+ replacements,
883
+ migrateMode,
884
+ frontMatterFor('AI operating principles', 'all AI work'),
885
+ );
521
886
  operations.push({ source: 'docs/ai/PRINCIPLES.md', destination: 'docs/ai/PRINCIPLES.md', result });
522
887
  }
523
888
 
524
- const packageResult = mergePackageJson(projectRoot, templateRoot, migrateMode);
889
+ const packageResult = mergePackageJson(projectRoot, templateRoot, {
890
+ legacyScripts,
891
+ migrateMode,
892
+ profile,
893
+ projectName,
894
+ projectSlug: replacements.projectSlug,
895
+ });
525
896
  operations.push({ source: 'package.template.json', destination: 'package.json', result: packageResult });
526
897
 
527
898
  const mergedPackageJsonPath = path.join(projectRoot, 'package.json');
@@ -560,12 +931,21 @@ function initializeProjectDocs(options) {
560
931
  ];
561
932
 
562
933
  for (const [source, destination] of tierCopies) {
934
+ if (profile !== 'full') {
935
+ continue;
936
+ }
937
+
563
938
  const sourcePath = path.join(templateRoot, source);
564
939
  if (!fs.existsSync(sourcePath)) {
565
940
  continue;
566
941
  }
567
942
 
568
943
  const destinationPath = path.join(projectRoot, destination);
944
+ if (!migrateMode && fs.existsSync(destinationPath)) {
945
+ operations.push({ source, destination, result: 'skipped' });
946
+ continue;
947
+ }
948
+
569
949
  const result = copyRenderedFile(sourcePath, destinationPath, tierReplacements, migrateMode, ({
570
950
  body,
571
951
  }) => buildFrontMatterFields({
@@ -613,7 +993,9 @@ function initializeProjectDocs(options) {
613
993
  writeState(projectRoot, nextState);
614
994
 
615
995
  const searchPath = path.join(projectRoot, 'docs', 'SEARCH.md');
616
- if (!(migrateMode && fs.existsSync(searchPath))) {
996
+ if (profile !== 'full') {
997
+ operations.push({ source: 'docs/SEARCH.md', destination: 'docs/SEARCH.md', result: 'skipped-profile' });
998
+ } else if (!fs.existsSync(searchPath)) {
617
999
  const searchContent = `# Búsqueda por Tema
618
1000
 
619
1001
  **Última actualización:** ${replacements.currentDate}
@@ -662,7 +1044,7 @@ function initializeProjectDocs(options) {
662
1044
 
663
1045
  const readmePath = path.join(projectRoot, 'README.md');
664
1046
  if (!fs.existsSync(readmePath)) {
665
- fs.writeFileSync(readmePath, `${renderTemplate(buildReadme(projectName, replacements.projectSlug), replacements)}\n`);
1047
+ fs.writeFileSync(readmePath, `${renderTemplate(buildReadme(projectName, replacements.projectSlug, profile), replacements)}\n`);
666
1048
  operations.push({ source: 'README.md template', destination: 'README.md', result: 'created' });
667
1049
  } else {
668
1050
  operations.push({ source: 'README.md template', destination: 'README.md', result: 'skipped' });
@@ -708,8 +1090,148 @@ function installSelfAsDevDep(projectRoot, version) {
708
1090
  }
709
1091
  }
710
1092
 
1093
+ function normalizeSkippedReason(reason) {
1094
+ if (!reason) {
1095
+ return 'excluded path';
1096
+ }
1097
+
1098
+ if (reason === 'env-file') {
1099
+ return 'env files';
1100
+ }
1101
+
1102
+ if (reason === 'git-metadata') {
1103
+ return '.git metadata';
1104
+ }
1105
+
1106
+ if (reason === 'hidden-directory') {
1107
+ return 'hidden directories';
1108
+ }
1109
+
1110
+ if (reason.startsWith('secret-file:')) {
1111
+ return 'secret files';
1112
+ }
1113
+
1114
+ if (reason.startsWith('unsafe-segment:')) {
1115
+ const segment = reason.slice('unsafe-segment:'.length);
1116
+ const dependencySegments = new Set(['node_modules', '.pnpm-store', '.npm', '.yarn']);
1117
+ const outputSegments = new Set(['dist', 'build', 'coverage', 'out', 'tmp', 'temp', 'cache', '.cache', '.turbo', '.next', '.nuxt', '.parcel-cache', 'generated', 'gen', 'artifacts', 'reports', 'vendor', 'target']);
1118
+
1119
+ if (segment === '.quiver') {
1120
+ return 'local AI state';
1121
+ }
1122
+
1123
+ if (dependencySegments.has(segment)) {
1124
+ return 'dependency folders';
1125
+ }
1126
+
1127
+ if (outputSegments.has(segment)) {
1128
+ return 'generated/output/cache folders';
1129
+ }
1130
+
1131
+ return segment;
1132
+ }
1133
+
1134
+ return reason;
1135
+ }
1136
+
1137
+ function summarizeSkippedPaths(skippedPathDetails = [], skippedPaths = []) {
1138
+ const counts = new Map();
1139
+
1140
+ const items = Array.isArray(skippedPathDetails) && skippedPathDetails.length > 0
1141
+ ? skippedPathDetails
1142
+ : skippedPaths.map((item) => ({ path: item, reason: 'excluded path' }));
1143
+
1144
+ for (const item of items) {
1145
+ const label = normalizeSkippedReason(item.reason);
1146
+ counts.set(label, (counts.get(label) || 0) + 1);
1147
+ }
1148
+
1149
+ return Array.from(counts.entries()).map(([label, count]) => ({ label, count }));
1150
+ }
1151
+
1152
+ function renderAiContextDoc(scan, options = {}) {
1153
+ const projectName = scan?.project?.name || 'Quiver Project';
1154
+ const projectSlug = options.projectSlug || toProjectSlug(projectName);
1155
+ const stack = scan?.stack || {};
1156
+ const commands = scan?.commands || {};
1157
+ const common = commands.common || {};
1158
+ const summaries = summarizeSkippedPaths(scan?.skipped_path_details, scan?.skipped_paths);
1159
+ const risks = Array.isArray(scan?.risks) ? scan.risks : [];
1160
+ const hasReadme = scan?.docs?.has_readme ? 'yes' : 'no';
1161
+ const hasWorkflow = scan?.ci?.has_ci ? 'yes' : 'no';
1162
+ const sourceDirs = Array.isArray(scan?.structure?.source_directories) ? scan.structure.source_directories : [];
1163
+
1164
+ const lines = [];
1165
+ lines.push(`# ${projectName} AI Context`);
1166
+ lines.push('');
1167
+ lines.push('This file is refreshed by `npx create-quiver analyze`.');
1168
+ lines.push('Use `docs/PROJECT_MAP.md` for stack and command details, and `.quiver/scans/PROJECT_SCAN.json` only when raw analyzer data is needed.');
1169
+ lines.push('');
1170
+ lines.push('## Snapshot');
1171
+ lines.push(`- Primary stack: ${stack.primary || 'unknown'}`);
1172
+ lines.push('- Package manager source: `docs/PROJECT_MAP.md`');
1173
+ lines.push(`- Install: ${commands.install || 'not defined'}`);
1174
+ lines.push(`- Dev: ${common.dev || 'not defined'}`);
1175
+ lines.push(`- Build: ${common.build || 'not defined'}`);
1176
+ lines.push(`- Test: ${common.test || 'not defined'}`);
1177
+ lines.push(`- README present: ${hasReadme}`);
1178
+ lines.push(`- GitHub Actions workflows: ${hasWorkflow}`);
1179
+ lines.push(`- Source directories: ${sourceDirs.length > 0 ? sourceDirs.join(', ') : 'none detected'}`);
1180
+ lines.push('');
1181
+ lines.push('## Read First');
1182
+ lines.push('- `docs/PROJECT_MAP.md`');
1183
+ lines.push('- `docs/WORKFLOW.md`');
1184
+ lines.push('- `docs/AI_ONBOARDING_PROMPT.md`');
1185
+ lines.push('- `docs/CONTEXTO.md`');
1186
+ lines.push('- `docs/DECISIONS.md`');
1187
+ lines.push(`- specs/${projectSlug}/SPEC.md`);
1188
+ lines.push('');
1189
+ lines.push('## Assumptions and Missing Info');
1190
+ if (risks.length > 0) {
1191
+ for (const risk of risks) {
1192
+ lines.push(`- ${risk}`);
1193
+ }
1194
+ } else {
1195
+ lines.push('- No major repository signals are missing.');
1196
+ }
1197
+ lines.push('- Do not infer product or business rules that are not present in the repository.');
1198
+ lines.push('');
1199
+ lines.push('## Exclusions');
1200
+ if (summaries.length > 0) {
1201
+ for (const item of summaries) {
1202
+ lines.push(`- ${item.label}: ${item.count}`);
1203
+ }
1204
+ } else {
1205
+ lines.push('- No exclusions were needed.');
1206
+ }
1207
+ lines.push('');
1208
+ lines.push('## Internal Artifacts');
1209
+ lines.push('- Visible source: `docs/PROJECT_MAP.md`');
1210
+ lines.push('- Internal raw scan: `.quiver/scans/PROJECT_SCAN.json`');
1211
+ lines.push('');
1212
+ const body = lines.join('\n');
1213
+ const frontMatter = serializeFrontMatter(buildFrontMatterFields({
1214
+ purpose: 'Agent-facing project context pack',
1215
+ appliesWhen: 'after analyze, onboarding, implementation, review',
1216
+ body,
1217
+ currentDate: options.currentDate || new Date().toISOString().slice(0, 10),
1218
+ }));
1219
+
1220
+ return `${frontMatter}\n\n${body}`;
1221
+ }
1222
+
1223
+ function refreshAiContextDoc(projectRoot, scan, options = {}) {
1224
+ const destinationPath = path.join(projectRoot, 'docs', 'AI_CONTEXT.md');
1225
+ fs.mkdirSync(path.dirname(destinationPath), { recursive: true });
1226
+ fs.writeFileSync(destinationPath, `${renderAiContextDoc(scan, options)}\n`);
1227
+ return destinationPath;
1228
+ }
1229
+
711
1230
  module.exports = {
712
1231
  initializeProjectDocs,
1232
+ refreshAiContextDoc,
1233
+ renderAiContextDoc,
1234
+ summarizeSkippedPaths,
713
1235
  writeFrontMatter,
714
1236
  toProjectSlug,
715
1237
  detectPackageManager,