create-quiver 0.10.0 → 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 (165) hide show
  1. package/BACKLOG.md +16 -17
  2. package/CHANGELOG.md +34 -0
  3. package/README.md +174 -39
  4. package/README_FOR_AI.md +48 -24
  5. package/ROADMAP.md +22 -11
  6. package/docs/AI_CONTEXT.md.template +2 -0
  7. package/docs/AI_ONBOARDING_PROMPT.md.template +25 -18
  8. package/docs/COMMANDS.md.template +59 -11
  9. package/docs/CONTEXTO.md.template +2 -0
  10. package/docs/DECISIONS.md.template +1 -0
  11. package/docs/INDEX.md.template +20 -18
  12. package/docs/STATUS.md.template +1 -0
  13. package/docs/SUPPORT_MATRIX.md.template +2 -2
  14. package/docs/TROUBLESHOOTING.md.template +50 -0
  15. package/docs/WORKFLOW.md.template +25 -17
  16. package/package.json +19 -2
  17. package/package.template.json +13 -1
  18. package/scripts/init-docs.sh +11 -4
  19. package/scripts/package-quiver.sh +18 -2
  20. package/specs/quiver-v22-guided-ai-workflow/EVIDENCE_REPORT.md +58 -0
  21. package/specs/quiver-v22-guided-ai-workflow/EXECUTION_PLAN.md +88 -0
  22. package/specs/quiver-v22-guided-ai-workflow/SPEC.md +228 -0
  23. package/specs/quiver-v22-guided-ai-workflow/STATUS.md +42 -0
  24. package/specs/quiver-v22-guided-ai-workflow/pr.md +104 -0
  25. package/specs/quiver-v22-guided-ai-workflow/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +35 -0
  26. package/specs/quiver-v22-guided-ai-workflow/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +61 -0
  27. package/specs/quiver-v22-guided-ai-workflow/slices/slice-00-spec-foundation/slice.json +51 -0
  28. package/specs/quiver-v22-guided-ai-workflow/slices/slice-01-docs-source-of-truth-sync/CLOSURE_BRIEF.md +31 -0
  29. package/specs/quiver-v22-guided-ai-workflow/slices/slice-01-docs-source-of-truth-sync/EXECUTION_BRIEF.md +58 -0
  30. package/specs/quiver-v22-guided-ai-workflow/slices/slice-01-docs-source-of-truth-sync/slice.json +55 -0
  31. package/specs/quiver-v22-guided-ai-workflow/slices/slice-02-prepare-command-diagnostics/CLOSURE_BRIEF.md +30 -0
  32. package/specs/quiver-v22-guided-ai-workflow/slices/slice-02-prepare-command-diagnostics/EXECUTION_BRIEF.md +57 -0
  33. package/specs/quiver-v22-guided-ai-workflow/slices/slice-02-prepare-command-diagnostics/slice.json +57 -0
  34. package/specs/quiver-v22-guided-ai-workflow/slices/slice-03-context-doc-refresh/CLOSURE_BRIEF.md +32 -0
  35. package/specs/quiver-v22-guided-ai-workflow/slices/slice-03-context-doc-refresh/EXECUTION_BRIEF.md +56 -0
  36. package/specs/quiver-v22-guided-ai-workflow/slices/slice-03-context-doc-refresh/slice.json +56 -0
  37. package/specs/quiver-v22-guided-ai-workflow/slices/slice-04-planner-approval-state/CLOSURE_BRIEF.md +33 -0
  38. package/specs/quiver-v22-guided-ai-workflow/slices/slice-04-planner-approval-state/EXECUTION_BRIEF.md +56 -0
  39. package/specs/quiver-v22-guided-ai-workflow/slices/slice-04-planner-approval-state/slice.json +58 -0
  40. package/specs/quiver-v22-guided-ai-workflow/slices/slice-05-spec-worktree-lifecycle/CLOSURE_BRIEF.md +32 -0
  41. package/specs/quiver-v22-guided-ai-workflow/slices/slice-05-spec-worktree-lifecycle/EXECUTION_BRIEF.md +56 -0
  42. package/specs/quiver-v22-guided-ai-workflow/slices/slice-05-spec-worktree-lifecycle/slice.json +54 -0
  43. package/specs/quiver-v22-guided-ai-workflow/slices/slice-06-executor-commit-recovery/CLOSURE_BRIEF.md +32 -0
  44. package/specs/quiver-v22-guided-ai-workflow/slices/slice-06-executor-commit-recovery/EXECUTION_BRIEF.md +58 -0
  45. package/specs/quiver-v22-guided-ai-workflow/slices/slice-06-executor-commit-recovery/slice.json +57 -0
  46. package/specs/quiver-v22-guided-ai-workflow/slices/slice-07-execution-waves-delegation/CLOSURE_BRIEF.md +32 -0
  47. package/specs/quiver-v22-guided-ai-workflow/slices/slice-07-execution-waves-delegation/EXECUTION_BRIEF.md +58 -0
  48. package/specs/quiver-v22-guided-ai-workflow/slices/slice-07-execution-waves-delegation/slice.json +55 -0
  49. package/specs/quiver-v22-guided-ai-workflow/slices/slice-08-pr-create-gh-ssh/CLOSURE_BRIEF.md +32 -0
  50. package/specs/quiver-v22-guided-ai-workflow/slices/slice-08-pr-create-gh-ssh/EXECUTION_BRIEF.md +58 -0
  51. package/specs/quiver-v22-guided-ai-workflow/slices/slice-08-pr-create-gh-ssh/slice.json +53 -0
  52. package/specs/quiver-v22-guided-ai-workflow/slices/slice-09-post-merge-cleanup-release-safety/CLOSURE_BRIEF.md +33 -0
  53. package/specs/quiver-v22-guided-ai-workflow/slices/slice-09-post-merge-cleanup-release-safety/EXECUTION_BRIEF.md +59 -0
  54. package/specs/quiver-v22-guided-ai-workflow/slices/slice-09-post-merge-cleanup-release-safety/slice.json +59 -0
  55. package/specs/quiver-v22-guided-ai-workflow/slices/slice-10-docs-smokes-release-readiness/CLOSURE_BRIEF.md +34 -0
  56. package/specs/quiver-v22-guided-ai-workflow/slices/slice-10-docs-smokes-release-readiness/EXECUTION_BRIEF.md +58 -0
  57. package/specs/quiver-v22-guided-ai-workflow/slices/slice-10-docs-smokes-release-readiness/slice.json +60 -0
  58. package/specs/quiver-v23-guided-flow-productization/EVIDENCE_REPORT.md +80 -0
  59. package/specs/quiver-v23-guided-flow-productization/EXECUTION_PLAN.md +80 -0
  60. package/specs/quiver-v23-guided-flow-productization/SPEC.md +203 -0
  61. package/specs/quiver-v23-guided-flow-productization/STATUS.md +39 -0
  62. package/specs/quiver-v23-guided-flow-productization/pr.md +119 -0
  63. package/specs/quiver-v23-guided-flow-productization/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +30 -0
  64. package/specs/quiver-v23-guided-flow-productization/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +61 -0
  65. package/specs/quiver-v23-guided-flow-productization/slices/slice-00-spec-foundation/slice.json +51 -0
  66. package/specs/quiver-v23-guided-flow-productization/slices/slice-01-short-command-and-flow-entrypoint/CLOSURE_BRIEF.md +33 -0
  67. package/specs/quiver-v23-guided-flow-productization/slices/slice-01-short-command-and-flow-entrypoint/EXECUTION_BRIEF.md +35 -0
  68. package/specs/quiver-v23-guided-flow-productization/slices/slice-01-short-command-and-flow-entrypoint/slice.json +56 -0
  69. package/specs/quiver-v23-guided-flow-productization/slices/slice-02-flow-status-wizard/CLOSURE_BRIEF.md +31 -0
  70. package/specs/quiver-v23-guided-flow-productization/slices/slice-02-flow-status-wizard/EXECUTION_BRIEF.md +29 -0
  71. package/specs/quiver-v23-guided-flow-productization/slices/slice-02-flow-status-wizard/slice.json +55 -0
  72. package/specs/quiver-v23-guided-flow-productization/slices/slice-03-agent-profiles/CLOSURE_BRIEF.md +33 -0
  73. package/specs/quiver-v23-guided-flow-productization/slices/slice-03-agent-profiles/EXECUTION_BRIEF.md +29 -0
  74. package/specs/quiver-v23-guided-flow-productization/slices/slice-03-agent-profiles/slice.json +54 -0
  75. package/specs/quiver-v23-guided-flow-productization/slices/slice-04-context-preparation-onboarding/CLOSURE_BRIEF.md +32 -0
  76. package/specs/quiver-v23-guided-flow-productization/slices/slice-04-context-preparation-onboarding/EXECUTION_BRIEF.md +30 -0
  77. package/specs/quiver-v23-guided-flow-productization/slices/slice-04-context-preparation-onboarding/slice.json +59 -0
  78. package/specs/quiver-v23-guided-flow-productization/slices/slice-05-planner-iteration-history/CLOSURE_BRIEF.md +31 -0
  79. package/specs/quiver-v23-guided-flow-productization/slices/slice-05-planner-iteration-history/EXECUTION_BRIEF.md +29 -0
  80. package/specs/quiver-v23-guided-flow-productization/slices/slice-05-planner-iteration-history/slice.json +53 -0
  81. package/specs/quiver-v23-guided-flow-productization/slices/slice-06-production-plan-review/CLOSURE_BRIEF.md +33 -0
  82. package/specs/quiver-v23-guided-flow-productization/slices/slice-06-production-plan-review/EXECUTION_BRIEF.md +30 -0
  83. package/specs/quiver-v23-guided-flow-productization/slices/slice-06-production-plan-review/slice.json +54 -0
  84. package/specs/quiver-v23-guided-flow-productization/slices/slice-07-spec-create-experience/CLOSURE_BRIEF.md +33 -0
  85. package/specs/quiver-v23-guided-flow-productization/slices/slice-07-spec-create-experience/EXECUTION_BRIEF.md +30 -0
  86. package/specs/quiver-v23-guided-flow-productization/slices/slice-07-spec-create-experience/slice.json +55 -0
  87. package/specs/quiver-v23-guided-flow-productization/slices/slice-08-executor-prompt-generation/CLOSURE_BRIEF.md +32 -0
  88. package/specs/quiver-v23-guided-flow-productization/slices/slice-08-executor-prompt-generation/EXECUTION_BRIEF.md +30 -0
  89. package/specs/quiver-v23-guided-flow-productization/slices/slice-08-executor-prompt-generation/slice.json +55 -0
  90. package/specs/quiver-v23-guided-flow-productization/slices/slice-09-delegated-slice-execution/CLOSURE_BRIEF.md +33 -0
  91. package/specs/quiver-v23-guided-flow-productization/slices/slice-09-delegated-slice-execution/EXECUTION_BRIEF.md +34 -0
  92. package/specs/quiver-v23-guided-flow-productization/slices/slice-09-delegated-slice-execution/slice.json +57 -0
  93. package/specs/quiver-v23-guided-flow-productization/slices/slice-10-docs-smokes-release-readiness/CLOSURE_BRIEF.md +33 -0
  94. package/specs/quiver-v23-guided-flow-productization/slices/slice-10-docs-smokes-release-readiness/EXECUTION_BRIEF.md +32 -0
  95. package/specs/quiver-v23-guided-flow-productization/slices/slice-10-docs-smokes-release-readiness/slice.json +63 -0
  96. package/specs/quiver-v24-dx-onboarding-hardening/EVIDENCE_REPORT.md +55 -0
  97. package/specs/quiver-v24-dx-onboarding-hardening/EXECUTION_PLAN.md +43 -0
  98. package/specs/quiver-v24-dx-onboarding-hardening/SPEC.md +149 -0
  99. package/specs/quiver-v24-dx-onboarding-hardening/STATUS.md +31 -0
  100. package/specs/quiver-v24-dx-onboarding-hardening/pr.md +76 -0
  101. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +31 -0
  102. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +52 -0
  103. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-00-spec-foundation/slice.json +51 -0
  104. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-01-init-template-hygiene/CLOSURE_BRIEF.md +38 -0
  105. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-01-init-template-hygiene/EXECUTION_BRIEF.md +53 -0
  106. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-01-init-template-hygiene/slice.json +55 -0
  107. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-02-cli-command-routing-version-errors/CLOSURE_BRIEF.md +33 -0
  108. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-02-cli-command-routing-version-errors/EXECUTION_BRIEF.md +50 -0
  109. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-02-cli-command-routing-version-errors/slice.json +52 -0
  110. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-03-doctor-fix-doc-link-checks/CLOSURE_BRIEF.md +33 -0
  111. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-03-doctor-fix-doc-link-checks/EXECUTION_BRIEF.md +50 -0
  112. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-03-doctor-fix-doc-link-checks/slice.json +53 -0
  113. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-04-prepare-output-ai-context-drafts/CLOSURE_BRIEF.md +33 -0
  114. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-04-prepare-output-ai-context-drafts/EXECUTION_BRIEF.md +50 -0
  115. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-04-prepare-output-ai-context-drafts/slice.json +70 -0
  116. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-05-local-slice-validation-base-guidance/CLOSURE_BRIEF.md +36 -0
  117. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-05-local-slice-validation-base-guidance/EXECUTION_BRIEF.md +49 -0
  118. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-05-local-slice-validation-base-guidance/slice.json +52 -0
  119. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-06-plan-graph-next-history-views/CLOSURE_BRIEF.md +43 -0
  120. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-06-plan-graph-next-history-views/EXECUTION_BRIEF.md +53 -0
  121. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-06-plan-graph-next-history-views/slice.json +60 -0
  122. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-07-analyzer-command-map-hardening/CLOSURE_BRIEF.md +32 -0
  123. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-07-analyzer-command-map-hardening/EXECUTION_BRIEF.md +50 -0
  124. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-07-analyzer-command-map-hardening/slice.json +51 -0
  125. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-08-evidence-run-command/CLOSURE_BRIEF.md +34 -0
  126. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-08-evidence-run-command/EXECUTION_BRIEF.md +52 -0
  127. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-08-evidence-run-command/slice.json +54 -0
  128. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-09-spec-viewer-demo-scaffolding/CLOSURE_BRIEF.md +34 -0
  129. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-09-spec-viewer-demo-scaffolding/EXECUTION_BRIEF.md +51 -0
  130. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-09-spec-viewer-demo-scaffolding/slice.json +59 -0
  131. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-10-docs-smokes-release-readiness/CLOSURE_BRIEF.md +33 -0
  132. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-10-docs-smokes-release-readiness/EXECUTION_BRIEF.md +54 -0
  133. package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-10-docs-smokes-release-readiness/slice.json +76 -0
  134. package/src/create-quiver/commands/ai.js +508 -35
  135. package/src/create-quiver/commands/demo.js +22 -0
  136. package/src/create-quiver/commands/evidence.js +37 -0
  137. package/src/create-quiver/commands/flow.js +561 -0
  138. package/src/create-quiver/commands/graph.js +14 -1
  139. package/src/create-quiver/commands/next.js +28 -0
  140. package/src/create-quiver/commands/plan.js +6 -3
  141. package/src/create-quiver/commands/prepare.js +236 -0
  142. package/src/create-quiver/commands/spec.js +133 -0
  143. package/src/create-quiver/index.js +688 -25
  144. package/src/create-quiver/lib/agent-profiles.js +148 -0
  145. package/src/create-quiver/lib/ai/context-packs.js +12 -0
  146. package/src/create-quiver/lib/ai/execution-plan.js +370 -10
  147. package/src/create-quiver/lib/ai/executor.js +376 -17
  148. package/src/create-quiver/lib/ai/github.js +196 -0
  149. package/src/create-quiver/lib/ai/onboarding-template.js +365 -0
  150. package/src/create-quiver/lib/ai/plan-review.js +283 -0
  151. package/src/create-quiver/lib/ai/providers.js +1 -0
  152. package/src/create-quiver/lib/ai/safety.js +5 -0
  153. package/src/create-quiver/lib/ai/spec-templates.js +2 -2
  154. package/src/create-quiver/lib/approvals.js +350 -0
  155. package/src/create-quiver/lib/demo.js +657 -0
  156. package/src/create-quiver/lib/doctor.js +234 -0
  157. package/src/create-quiver/lib/evidence.js +115 -0
  158. package/src/create-quiver/lib/init-docs.js +284 -17
  159. package/src/create-quiver/lib/init-layout.js +26 -1
  160. package/src/create-quiver/lib/lifecycle.js +6 -0
  161. package/src/create-quiver/lib/package-safety.js +117 -0
  162. package/src/create-quiver/lib/readiness.js +85 -18
  163. package/src/create-quiver/lib/slice-graph.js +1 -0
  164. package/src/create-quiver/lib/slice.js +8 -8
  165. package/src/create-quiver/lib/spec-worktrees.js +349 -0
@@ -9,7 +9,7 @@ This document is the canonical implementation workflow for the project.
9
9
  - Do not implement without a slice.
10
10
  - One slice maps to one commit.
11
11
  - One spec maps to one PR.
12
- - Slice numbering is local to each spec. Every spec starts at `slice-01`.
12
+ - Slice numbering is local to each spec. Every spec starts with mandatory `slice-00` as the documentary foundation; `slice-01` is the first implementation slice.
13
13
  - The spec defines the plan; the slice defines the execution.
14
14
  - No slice should enter execution until it is `ready`.
15
15
  - The documentation PR establishes the workflow files before the first slice executes.
@@ -32,29 +32,37 @@ Use maps, metadata, diffs, and summaries first. Open full files only when the sm
32
32
 
33
33
  ## Planning
34
34
 
35
- 1. Triage the request.
36
- 2. Decide whether to create a new spec or reuse an existing one.
37
- 3. Split the work into slices.
38
- 4. Mark each slice `ready` before execution.
39
- 5. Open and merge the documentation PR before running the first slice bootstrap.
40
- 6. Read the AI context pack, support matrix, and troubleshooting guide before the first slice if the environment is new or uncertain.
41
- 7. If the project already existed before this Quiver version, run `migrate` before `analyze`.
42
- 8. If the project was analyzed, read `AI_ONBOARDING_PROMPT.md` before making documentation updates.
43
- 9. Prefer the generated `quiver:*` npm scripts for repeatable project workflows once the package has been initialized or migrated.
35
+ 1. Run `npx create-quiver flow` when the next safe command is unclear.
36
+ 2. Triage the request.
37
+ 3. Save reusable planner/executor provider choices with `ai agent set` when the team has preferred local AI CLIs.
38
+ 4. Use `ai plan --phase acceptance` to draft criteria, then save the approved version with `ai approve --phase acceptance`.
39
+ 5. Use `ai plan --phase technical-plan` to draft the plan.
40
+ 6. Use `ai review-plan` to review the technical-plan draft for production readiness without changing product code.
41
+ 7. Save the reviewed plan version with `ai approve --phase technical-plan --version <n>`.
42
+ 8. Use `spec create` to generate the spec, mandatory `slice-00`, implementation slices, handoffs, execution plan, and `pr.md`.
43
+ 9. Open and merge the documentation PR or commit that establishes `slice-00` before running implementation slices.
44
+ 10. Read the AI context pack, support matrix, and troubleshooting guide before the first slice if the environment is new or uncertain.
45
+ 11. If the project already existed before this Quiver version, run `migrate` before `analyze`.
46
+ 12. If the project was analyzed, read `AI_ONBOARDING_PROMPT.md` before making documentation updates.
47
+ 13. Prefer the generated `quiver:*` npm scripts for repeatable project workflows once the package has been initialized or migrated.
44
48
 
45
49
  ## Execution
46
50
 
47
- 1. Bootstrap the slice with `npx create-quiver start-slice <slice.json>` or `npm run quiver:start-slice -- <slice.json>`.
51
+ 1. Create or reuse the spec worktree with `npx create-quiver spec start specs/<spec-slug>` or `npm run quiver:spec:start -- specs/<spec-slug>`.
52
+ 2. Inspect manual prompts with `npx create-quiver ai execute-plan --dry-run --commit --mode manual` or delegated waves with `npm run quiver:ai:execute-plan -- --dry-run --commit --mode delegated`.
53
+ 3. Print a minimal manual executor prompt with `npx create-quiver ai prompt-slice --slice <slice.json> --dry-run` when assigning the slice to another agent.
54
+ 4. Bootstrap a single slice with `npx create-quiver start-slice <slice.json>` or `npm run quiver:start-slice -- <slice.json>` when manual execution is preferred.
48
55
  - The bootstrap step should work with canonical paths and a local base branch when `origin` is absent.
49
56
  - Draft slices require `--allow-draft`; otherwise `npx create-quiver start-slice` exits before execution.
50
57
  - Legacy Bash wrappers remain available for compatibility, but generated projects should prefer the Node CLI and `quiver:*` npm scripts.
51
58
  - `start-slice` generates `docs/ai/ACTIVE_SLICE.md` and `WORKTREE_CONTEXT.md`; use the active slice brief as the source of truth for execution.
52
- 2. Implement only what the slice declares.
53
- 3. Make one commit for that slice.
54
- 4. Validate with `npx create-quiver check-slice <slice.json>` or `npm run quiver:check-slice -- <slice.json>`.
55
- 5. Write evidence.
56
- 6. Repeat for the next slice until the spec is complete.
57
- 7. Open one PR for the spec and use `npx create-quiver check-pr <slice.json>` or `npm run quiver:check-pr -- <slice.json>` as the pre-merge gate.
59
+ 5. Implement only what the slice declares.
60
+ 6. Make one commit for that slice, or let `ai execute-slice --commit` / `ai execute-plan --execute --commit --mode delegated` create it after provider, scope, and validation pass.
61
+ 7. Validate with `npx create-quiver check-slice <slice.json>` or `npm run quiver:check-slice -- <slice.json>`.
62
+ 8. Write evidence. Prefer `npx create-quiver evidence run -- <command>` when you need a compact local Markdown record of validation output.
63
+ 9. Repeat for the next slice until the spec is complete.
64
+ 10. Open one PR for the spec. Use `npx create-quiver ai pr --dry-run --input specs/<spec-slug>/pr.md ...` first, then add `--create` only after review.
65
+ 11. After the PR is merged and the spec worktree is clean, close it with `npx create-quiver spec close specs/<spec-slug>`.
58
66
 
59
67
  ## Support Contract
60
68
 
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "create-quiver",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "private": false,
5
5
  "description": "Quiver CLI for scaffolding projects from the packaged template",
6
6
  "license": "MIT",
7
7
  "bin": {
8
- "create-quiver": "bin/create-quiver.js"
8
+ "create-quiver": "bin/create-quiver.js",
9
+ "quiver": "bin/create-quiver.js"
9
10
  },
10
11
  "scripts": {
11
12
  "check:slice": "bash tools/scripts/check-slice-readiness.sh",
@@ -13,17 +14,33 @@
13
14
  "start:slice": "bash tools/scripts/start-slice.sh",
14
15
  "cleanup:slice": "bash tools/scripts/cleanup-slice.sh",
15
16
  "migrate": "bash tools/scripts/migrate-project.sh",
17
+ "quiver:analyze": "npx create-quiver analyze",
18
+ "quiver:flow": "npx create-quiver flow",
19
+ "quiver:prepare": "npx create-quiver prepare",
16
20
  "quiver:plan": "npx create-quiver plan",
17
21
  "quiver:graph": "npx create-quiver graph",
18
22
  "quiver:next": "npx create-quiver next",
23
+ "quiver:doctor": "npx create-quiver doctor",
24
+ "quiver:evidence": "npx create-quiver evidence",
25
+ "quiver:ai:agent": "npx create-quiver ai agent",
19
26
  "quiver:ai:onboard": "npx create-quiver ai onboard",
27
+ "quiver:ai:prepare-context": "npx create-quiver ai prepare-context",
20
28
  "quiver:ai:plan": "npx create-quiver ai plan",
29
+ "quiver:ai:review-plan": "npx create-quiver ai review-plan",
30
+ "quiver:ai:approve": "npx create-quiver ai approve",
31
+ "quiver:ai:prompt-slice": "npx create-quiver ai prompt-slice",
21
32
  "quiver:ai:execute-slice": "npx create-quiver ai execute-slice",
33
+ "quiver:ai:execute-plan": "npx create-quiver ai execute-plan",
22
34
  "quiver:ai:pr": "npx create-quiver ai pr",
23
35
  "quiver:ai:doctor": "npx create-quiver ai doctor",
36
+ "quiver:spec:create": "npx create-quiver spec create",
37
+ "quiver:spec:start": "npx create-quiver spec start",
38
+ "quiver:spec:status": "npx create-quiver spec status",
39
+ "quiver:spec:close": "npx create-quiver spec close",
24
40
  "package:quiver": "bash scripts/package-quiver.sh",
25
41
  "smoke:create-quiver": "bash scripts/ci/smoke-create-quiver.sh",
26
42
  "smoke:tiered-pack": "bash scripts/ci/smoke-tiered-pack.sh",
43
+ "smoke:guided-workflow": "bash scripts/ci/smoke-guided-workflow.sh",
27
44
  "release:quiver": "bash scripts/release-quiver.sh"
28
45
  }
29
46
  }
@@ -1,18 +1,30 @@
1
1
  {
2
- "name": "quiver-docs-template",
2
+ "name": "quiver-project",
3
3
  "private": true,
4
4
  "scripts": {
5
5
  "quiver:migrate": "npx create-quiver migrate",
6
6
  "quiver:analyze": "npx create-quiver analyze",
7
+ "quiver:flow": "npx create-quiver flow",
7
8
  "quiver:plan": "npx create-quiver plan",
8
9
  "quiver:graph": "npx create-quiver graph",
9
10
  "quiver:next": "npx create-quiver next",
10
11
  "quiver:doctor": "npx create-quiver doctor",
12
+ "quiver:evidence": "npx create-quiver evidence",
13
+ "quiver:ai:agent": "npx create-quiver ai agent",
11
14
  "quiver:ai:onboard": "npx create-quiver ai onboard",
15
+ "quiver:ai:prepare-context": "npx create-quiver ai prepare-context",
12
16
  "quiver:ai:plan": "npx create-quiver ai plan",
17
+ "quiver:ai:review-plan": "npx create-quiver ai review-plan",
18
+ "quiver:ai:approve": "npx create-quiver ai approve",
19
+ "quiver:ai:prompt-slice": "npx create-quiver ai prompt-slice",
13
20
  "quiver:ai:execute-slice": "npx create-quiver ai execute-slice",
21
+ "quiver:ai:execute-plan": "npx create-quiver ai execute-plan",
14
22
  "quiver:ai:pr": "npx create-quiver ai pr",
15
23
  "quiver:ai:doctor": "npx create-quiver ai doctor",
24
+ "quiver:spec:create": "npx create-quiver spec create",
25
+ "quiver:spec:start": "npx create-quiver spec start",
26
+ "quiver:spec:status": "npx create-quiver spec status",
27
+ "quiver:spec:close": "npx create-quiver spec close",
16
28
  "quiver:start-slice": "npx create-quiver start-slice",
17
29
  "quiver:check-slice": "npx create-quiver check-slice",
18
30
  "quiver:check-pr": "npx create-quiver check-pr",
@@ -522,8 +522,12 @@ Start with dry-runs so you can inspect the provider, role, context pack, and inv
522
522
  \`\`\`bash
523
523
  npm run quiver:ai:onboard -- --dry-run
524
524
  npm run quiver:ai:plan -- --phase acceptance --input requirements.md --dry-run
525
- npm run quiver:ai:plan -- --phase technical-plan --input acceptance-approved.md --dry-run
526
- npm run quiver:ai:plan -- --phase spec --input technical-plan-approved.md --dry-run
525
+ npm run quiver:ai:approve -- --phase acceptance --input acceptance-approved.md
526
+ npm run quiver:ai:plan -- --phase technical-plan --dry-run
527
+ npm run quiver:ai:review-plan -- --dry-run
528
+ npm run quiver:ai:approve -- --phase technical-plan --version <n>
529
+ npm run quiver:spec:create -- --dry-run
530
+ npm run quiver:ai:prompt-slice -- --slice specs/<spec-slug>/slices/<slice-id>/slice.json --dry-run
527
531
  npm run quiver:ai:pr -- --dry-run --ssh-host-alias github-work --identity-file ~/.ssh/github-work
528
532
  \`\`\`
529
533
 
@@ -532,7 +536,9 @@ Remove \`--dry-run\` only after the phase output is approved and the local provi
532
536
  When a real spec exists, execute one approved slice at a time:
533
537
 
534
538
  \`\`\`bash
539
+ npm run quiver:ai:prompt-slice -- --slice specs/<spec-slug>/slices/<slice-id>/slice.json --dry-run
535
540
  npm run quiver:ai:execute-slice -- --slice specs/<spec-slug>/slices/<slice-id>/slice.json --dry-run
541
+ npm run quiver:ai:execute-plan -- --dry-run --commit --mode delegated
536
542
  \`\`\`
537
543
 
538
544
  ## Project NPM Scripts
@@ -547,6 +553,7 @@ npm run quiver:next
547
553
  npm run quiver:doctor
548
554
  npm run quiver:ai:onboard -- --dry-run
549
555
  npm run quiver:ai:plan -- --phase acceptance --input requirements.md --dry-run
556
+ npm run quiver:ai:prompt-slice -- --slice specs/<spec-slug>/slices/<slice-id>/slice.json --dry-run
550
557
  npm run quiver:ai:execute-slice -- --slice specs/<spec-slug>/slices/<slice-id>/slice.json --dry-run
551
558
  npm run quiver:ai:doctor -- --dry-run --ssh-host-alias github-work --identity-file ~/.ssh/github-work
552
559
  npm run quiver:ai:pr -- --dry-run --ssh-host-alias github-work --identity-file ~/.ssh/github-work
@@ -645,7 +652,7 @@ Record durable decisions in \`docs/DECISIONS.md\` so future AI agents do not re-
645
652
 
646
653
  ## First Slice Workflow
647
654
 
648
- Use this section only for the legacy/full scaffold that includes a placeholder spec. In the default AI-first layout, create real specs and slices with \`npx create-quiver ai plan --phase spec\` after acceptance criteria and the technical plan are approved.
655
+ Use this section only for the legacy/full scaffold that includes a placeholder spec. 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.
649
656
 
650
657
  1. Review or refine specs/$PROJECT_SLUG/SPEC.md.
651
658
  2. Create the first slice from specs/$PROJECT_SLUG/slices/slice-template/slice.json.
@@ -700,7 +707,7 @@ echo "📝 Próximos pasos:"
700
707
  echo " 1. Editar docs/AI_CONTEXT.md con el contexto resumido para IA"
701
708
  echo " 2. Editar docs/CONTEXTO.md con la información de tu proyecto"
702
709
  echo " 3. Editar docs/STATUS.md con el estado actual"
703
- echo " 4. Para el flujo recomendado, crear specs reales con: npx create-quiver ai plan --phase spec"
710
+ echo " 4. Para el flujo recomendado, crear specs reales con: npx create-quiver spec create"
704
711
  echo " 5. Usar tools/scripts solo si necesitás compatibilidad legacy"
705
712
  echo ""
706
713
  echo "📖 Más información:"
@@ -34,10 +34,26 @@ contents="$(
34
34
  tar -tzf "$tarball_path"
35
35
  )"
36
36
 
37
+ cd "$repo_root"
38
+ # shellcheck disable=SC2016
39
+ printf '%s\n' "$contents" | node -e '
40
+ const fs = require("node:fs");
41
+ const { assertPackageSafety } = require("./src/create-quiver/lib/package-safety");
42
+
43
+ const paths = fs.readFileSync(0, "utf8").split(/\r?\n/).filter(Boolean);
44
+
45
+ try {
46
+ assertPackageSafety(paths);
47
+ } catch (error) {
48
+ process.stderr.write(`${error.message}\n`);
49
+ process.exit(1);
50
+ }
51
+ '
52
+
37
53
  require_present() {
38
54
  local path="$1"
39
55
 
40
- if ! printf '%s\n' "$contents" | grep -Fxq "$path"; then
56
+ if ! grep -Fxq "$path" <<<"$contents"; then
41
57
  echo "FAIL: falta '$path' en el paquete" >&2
42
58
  exit 1
43
59
  fi
@@ -46,7 +62,7 @@ require_present() {
46
62
  require_absent() {
47
63
  local path="$1"
48
64
 
49
- if printf '%s\n' "$contents" | grep -Fxq "$path"; then
65
+ if grep -Fxq "$path" <<<"$contents"; then
50
66
  echo "FAIL: '$path' no debería publicarse en el paquete" >&2
51
67
  exit 1
52
68
  fi
@@ -0,0 +1,58 @@
1
+ # Evidence Report - Quiver v22 Guided AI Workflow
2
+
3
+ ## Status
4
+
5
+ Implementation is completed. Slices `slice-00` through `slice-10` are completed.
6
+
7
+ ## Slice Evidence
8
+
9
+ | Slice | Evidence |
10
+ |-------|----------|
11
+ | slice-00 | Spec foundation files created. All `slice.json` files parse successfully and `git diff --check` passed. |
12
+ | slice-01 | Documentation source-of-truth sync completed. README no longer claims `package.json`/CHANGELOG are at 0.9.0, CHANGELOG includes 0.10.0, ROADMAP/BACKLOG distinguish shipped v20/v21 work from the then-active v22 implementation line, and targeted tests passed. |
13
+ | slice-02 | Prepare command implemented with dry-run diagnostics, GitHub CLI guidance, provider CLI guidance, SSH identity/auth recovery steps, and next safe command output. Targeted tests passed. |
14
+ | slice-03 | Analyze now refreshes `docs/AI_CONTEXT.md`, keeps `docs/PROJECT_MAP.md` visible, keeps raw scan under `.quiver/scans/PROJECT_SCAN.json`, summarizes missing/assumed context, and excludes secret/noisy paths from AI-facing context. Targeted tests passed. |
15
+ | slice-04 | Planner approval state implemented under `.quiver/approvals`, with draft persistence, explicit approvals, default use of approved acceptance/technical-plan inputs, `ai approvals` status, and blocking of unapproved/stale inputs. Targeted tests passed. |
16
+ | slice-05 | Spec-level worktree lifecycle implemented with `spec start/status`, safe main/develop base selection, dirty worktree protection, and `slice-00` completion guard for later `start-slice` executions. Targeted tests passed. |
17
+ | slice-06 | `ai execute-slice` now keeps executor context bounded, validates scope, runs declared validation commands, reports retry/abort guidance on failure, and creates exactly one commit when `--commit` is enabled after successful provider, scope, and validation stages. Targeted tests passed. |
18
+ | slice-07 | Execution waves now distinguish parallel-ready groups from sequential fallback, block parallel suggestions on unknown or overlapping file scopes, print dry-run executor commands without provider calls, and support explicit `ai execute-plan --execute --commit` with stop-on-failure behavior. Targeted tests passed. |
19
+ | slice-08 | `ai pr` now validates setup, reads generated `pr.md`, prints a dry-run `gh pr create` plan, and creates the PR only with explicit `--create`. Missing gh/auth/guide/identity/body/dirty state still blocks with guidance. Tests mock gh and real PR creation is not required. |
20
+ | slice-09 | `spec close` now blocks unmerged or dirty spec worktrees, removes merged clean worktrees, and pulls the main checkout when a remote base exists. Package safety now checks npm tarball contents for env files, npm credentials, AI local state, worktree state, and local worktree context before package smoke passes. Targeted tests and package smoke passed. |
21
+ | slice-10 | Final docs and generated templates now present the guided AI workflow as available behavior. Smokes cover prepare, approvals, execution waves, PR dry-run/create mocks, cleanup, package safety, generated project scripts, post-analyze AI context front matter, and mandatory `slice-00` fixtures. Full tests, smokes, JSON validation, diff check, and npm pack dry-run passed. |
22
+
23
+ ## Validation Log
24
+
25
+ - 2026-05-21: `find specs/quiver-v22-guided-ai-workflow -name "slice.json" -print -exec node -e "JSON.parse(require('fs').readFileSync(process.argv[1], 'utf8'))" {} \;`
26
+ - 2026-05-21: `git diff --check`
27
+ - 2026-05-21: `node --test tests/commands/analyze.test.js tests/commands/ai-plan.test.js tests/commands/ai-pr.test.js`
28
+ - 2026-05-21: `node --test tests/commands/prepare.test.js tests/lib/ai-github.test.js tests/lib/ai-providers.test.js tests/lib/doctor.test.js`
29
+ - 2026-05-21: `node --test tests/commands/analyze.test.js tests/lib/ai-context-packs.test.js tests/lib/ai-safety.test.js`
30
+ - 2026-05-21: `node --test tests/commands/ai-plan.test.js tests/commands/ai-plan-spec-phase.test.js tests/lib/approvals.test.js`
31
+ - 2026-05-21: `node --test tests/lib/lifecycle.test.js tests/commands/spec-worktree.test.js`
32
+ - 2026-05-21: `node --test tests/lib/check-slice.test.js tests/commands/next.test.js`
33
+ - 2026-05-21: `git diff --check`
34
+ - 2026-05-21: `node --test tests/commands/ai-execute-slice.test.js tests/lib/ai-executor.test.js tests/lib/scope.test.js`
35
+ - 2026-05-21: `git diff --check`
36
+ - 2026-05-21: `node --test tests/lib/ai-execution-plan.test.js tests/commands/ai-execute-plan.test.js`
37
+ - 2026-05-21: `node --test tests/commands/ai-execute-slice.test.js tests/lib/ai-executor.test.js`
38
+ - 2026-05-21: `git diff --check`
39
+ - 2026-05-21: `node --test tests/commands/ai-pr.test.js tests/lib/ai-github.test.js`
40
+ - 2026-05-21: `git diff --check`
41
+ - 2026-05-21: `node --test tests/commands/spec-close.test.js tests/lib/package-safety.test.js`
42
+ - 2026-05-21: `bash scripts/package-quiver.sh`
43
+ - 2026-05-21: `node --test tests/commands/spec-worktree.test.js tests/lib/lifecycle.test.js tests/commands/spec-close.test.js tests/lib/package-safety.test.js`
44
+ - 2026-05-21: `git diff --check`
45
+ - 2026-05-21: `node --test tests/lib/init-layout.test.js tests/lib/init-docs.test.js tests/commands/init-profiles.test.js`
46
+ - 2026-05-21: `node --test tests/commands/analyze.test.js tests/lib/init-docs.test.js`
47
+ - 2026-05-21: `npm run smoke:guided-workflow`
48
+ - 2026-05-21: `node --test tests/**/*.test.js`
49
+ - 2026-05-21: `npm run smoke:create-quiver`
50
+ - 2026-05-21: `npm run smoke:tiered-pack`
51
+ - 2026-05-21: `npm --cache /private/tmp/quiver-npm-cache pack --dry-run`
52
+ - 2026-05-21: `git diff --check`
53
+ - 2026-05-21: `find specs/quiver-v22-guided-ai-workflow -name slice.json -print -exec node -e "JSON.parse(require('fs').readFileSync(process.argv[1], 'utf8'))" {} \;`
54
+
55
+ ## Notes
56
+
57
+ - `npm pack --dry-run` failed once against the global npm cache because `~/.npm` contains root-owned files. Re-running with `npm --cache /private/tmp/quiver-npm-cache pack --dry-run` passed.
58
+ - No npm publish was performed by this slice.
@@ -0,0 +1,88 @@
1
+ # Execution Plan - Quiver v22 Guided AI Workflow
2
+
3
+ ## Rule
4
+
5
+ `slice-00` is mandatory and must be committed first. It establishes the spec foundation in the repo.
6
+
7
+ ## Recommended Wave Plan
8
+
9
+ This is the safe default plan. It optimizes for low merge risk and production-readiness over speed.
10
+
11
+ | Wave | Mode | Slices | Why |
12
+ |------|------|--------|-----|
13
+ | 0 | Sequential | `slice-00-spec-foundation` | Publishes the spec foundation, handoffs, execution plan, and PR body. Nothing else should start before this commit exists. |
14
+ | 1 | Sequential | `slice-01-docs-source-of-truth-sync` | Fixes current documentation drift so later agents read reliable guidance. |
15
+ | 2 | Sequential | `slice-02-prepare-command-diagnostics` | Adds the safe project preparation entrypoint used by later workflow steps. |
16
+ | 3 | Sequential | `slice-03-context-doc-refresh` | Improves AI context generation after the preparation command exists. |
17
+ | 4 | Sequential | `slice-04-planner-approval-state` | Adds persisted approvals; spec/worktree automation should not run before approved inputs are traceable. |
18
+ | 5 | Sequential | `slice-05-spec-worktree-lifecycle` | Establishes one spec per worktree before executor, PR, and cleanup automation. |
19
+ | 6 | Sequential | `slice-06-executor-commit-recovery` | Makes single-slice execution safe and recoverable before multi-slice execution. |
20
+ | 7 | Sequential | `slice-07-execution-waves-delegation` | Builds on the executor to coordinate waves and delegation. |
21
+ | 8 | Sequential | `slice-08-pr-create-gh-ssh` | Adds PR creation after command-router changes from execution slices are stable. |
22
+ | 9 | Sequential | `slice-09-post-merge-cleanup-release-safety` | Requires execution-wave and PR behavior to be known. |
23
+ | 10 | Sequential | `slice-10-docs-smokes-release-readiness` | Final docs and smokes must run last. |
24
+
25
+ ## Parallelization Assessment
26
+
27
+ No slice should run in parallel before `slice-05`.
28
+
29
+ After `slice-05`, `slice-06-executor-commit-recovery` and `slice-08-pr-create-gh-ssh` are conceptually independent, but the declared file scopes overlap in command-router files such as `src/create-quiver/commands/ai.js`. Because of that, the default recommendation is sequential execution.
30
+
31
+ Parallel execution is allowed only if the executor changes are split so file ownership is disjoint:
32
+
33
+ | Optional Wave | Mode | Slices | Condition |
34
+ |---------------|------|--------|-----------|
35
+ | 6A | Parallel | `slice-06-executor-commit-recovery` + `slice-08-pr-create-gh-ssh` | Only if one slice owns executor internals and the other owns PR internals without both editing the same command-router files. |
36
+ | 6B | Sequential integration | Router wiring or conflict resolution | Required if 6A was used and both features need command registration. |
37
+ | 7 | Sequential | `slice-07-execution-waves-delegation` | Starts only after executor behavior from `slice-06` is integrated. |
38
+
39
+ If the file scopes are not split before execution, do not use the optional parallel wave.
40
+
41
+ ## Dependency Graph
42
+
43
+ ```mermaid
44
+ flowchart TD
45
+ S00[slice-00 spec foundation] --> S01[slice-01 docs sync]
46
+ S01 --> S02[slice-02 prepare diagnostics]
47
+ S02 --> S03[slice-03 context doc refresh]
48
+ S03 --> S04[slice-04 planner approvals]
49
+ S04 --> S05[slice-05 spec worktree lifecycle]
50
+ S05 --> S06[slice-06 executor commit recovery]
51
+ S06 --> S07[slice-07 execution waves]
52
+ S05 --> S08[slice-08 PR creation]
53
+ S07 --> S09[slice-09 cleanup and release safety]
54
+ S08 --> S09
55
+ S09 --> S10[slice-10 docs smokes release readiness]
56
+ ```
57
+
58
+ ## Suggested Commit Order
59
+
60
+ 1. `docs(spec): add guided ai workflow spec foundation`
61
+ 2. `docs(ai): sync source of truth for guided workflow`
62
+ 3. `feat(cli): add guided prepare diagnostics`
63
+ 4. `feat(analyze): refresh ai context docs safely`
64
+ 5. `feat(ai): persist planner approvals`
65
+ 6. `feat(spec): manage spec worktree lifecycle`
66
+ 7. `feat(ai): commit validated executor slices`
67
+ 8. `feat(ai): execute slices by safe waves`
68
+ 9. `feat(ai): create prs with gh and ssh guidance`
69
+ 10. `feat(spec): close merged specs and guard releases`
70
+ 11. `docs(ai): document guided workflow and add smokes`
71
+
72
+ ## Executor Assignment
73
+
74
+ Recommended executor model:
75
+
76
+ - Use the planner agent for `slice-00`, high-level review, and final integration checks.
77
+ - Use cheaper executor agents for `slice-01` through `slice-08` only after the owning slice and file scope are clear.
78
+ - Keep `slice-09` with a stronger reviewer because it includes cleanup and release-safety behavior.
79
+ - Keep `slice-10` with the planner or a docs/test-focused executor because it validates the full user-facing story.
80
+
81
+ ## Integration Notes
82
+
83
+ - Do not start implementation slices before `slice-00` is committed.
84
+ - Do not enable parallel execution before file-scope conflict checks exist.
85
+ - If two slices declare the same source file, execute them sequentially or split ownership before delegation.
86
+ - Keep provider and `gh` tests mocked.
87
+ - Treat real provider CLIs as optional manual checks.
88
+ - Keep one spec PR branch/worktree for final integration.
@@ -0,0 +1,228 @@
1
+ # Quiver v22 - Guided AI Workflow
2
+
3
+ **Date:** 2026-05-21
4
+ **Status:** Completed
5
+
6
+ Slice numbering resets here. This spec intentionally starts at `slice-00`.
7
+
8
+ ## Problem
9
+
10
+ Quiver already has an AI-first foundation: it can initialize a project, analyze it, generate context artifacts, run planner phases, generate specs/slices/handoffs, execute one slice with reduced context, and run GitHub PR preflight checks.
11
+
12
+ The current experience still requires too much manual coordination. A user must remember which command comes next, manually preserve approved criteria and plans, decide when a worktree is safe, decide when parallel execution is safe, create slice commits by hand, and open or close the PR outside the guided flow.
13
+
14
+ The desired workflow is a guided AI delivery line:
15
+
16
+ 1. Install or run Quiver.
17
+ 2. Prepare the project for AI onboarding.
18
+ 3. Choose a planner agent.
19
+ 4. Run planner onboarding with generated context.
20
+ 5. Turn requirements into acceptance criteria.
21
+ 6. Iterate criteria until approved.
22
+ 7. Turn approved criteria into a development plan.
23
+ 8. Iterate the plan until approved.
24
+ 9. Generate spec, slices, handoffs, and `pr.md`.
25
+ 10. Build an execution plan with sequential and parallel slices.
26
+ 11. Execute slices through cheaper executor agents, one slice per commit.
27
+ 12. Open the PR from the generated body.
28
+ 13. Let the human review and merge.
29
+ 14. Close the worktree and pull merged changes back into the main local checkout.
30
+
31
+ ## Objective
32
+
33
+ Make Quiver guide the full AI-assisted workflow from project preparation to post-merge cleanup while preserving human approvals, one spec per worktree, one slice per commit, token-efficient executor context, and safe defaults.
34
+
35
+ ## Core Decisions
36
+
37
+ - `README_FOR_AI.md` remains the source of truth for Quiver workflow guidance in this repo.
38
+ - This repo uses `specs/quiver-vNN-*` as the real spec location, even though some reusable skills mention `docs/specs/`.
39
+ - `slice-00` is mandatory and only establishes the spec foundation.
40
+ - One spec maps to one dedicated worktree and one PR.
41
+ - One slice maps to one commit.
42
+ - Planner agents use broad context and do not modify product code while creating criteria or plans.
43
+ - Executor agents may modify product code only inside the approved slice scope.
44
+ - AI outputs that influence implementation must be saved and explicitly approved before they become inputs for the next phase.
45
+ - Parallel slice execution is allowed only when dependencies and touched files make it safe.
46
+ - Quiver validates or guides setup for `gh`, SSH aliases, provider CLIs, and auth. It must not silently rewrite credentials.
47
+ - PR creation is allowed after checks pass, but PR merge remains a human decision.
48
+ - Worktree cleanup is allowed only after the PR merge is confirmed and no local changes would be lost.
49
+
50
+ ## Scope
51
+
52
+ ### Included
53
+
54
+ - Sync documentation that drifted after `0.10.0`.
55
+ - Define the official command experience for guided workflows, including whether a short `quiver` command exists or commands remain under `npx create-quiver`.
56
+ - Add a safe project preparation command that combines analysis, diagnostics, context refresh, and setup guidance.
57
+ - Improve project analysis so it produces useful AI onboarding context without exposing secrets or noisy generated files.
58
+ - Persist planner outputs and approvals for acceptance criteria and technical plans.
59
+ - Generate specs, slices, handoffs, execution plans, and `pr.md` only from approved inputs.
60
+ - Formalize one spec per worktree.
61
+ - Add status, retry, abort, and recovery surfaces for slices.
62
+ - Add optional commit automation after slice validation.
63
+ - Add execution waves for sequential and parallel slices.
64
+ - Add safe delegation guidance for cheap executor agents.
65
+ - Create PRs with `gh` from generated `pr.md` after preflight passes.
66
+ - Add post-merge cleanup that removes the spec worktree and pulls the main local checkout.
67
+ - Add release/package safety checks so local settings or secrets are not published.
68
+ - Cover macOS, Linux, and Windows guidance for `gh`, SSH, providers, and paths.
69
+
70
+ ### Excluded
71
+
72
+ - Fully autonomous PR merge.
73
+ - Silent installation of tools without explicit user approval.
74
+ - Silent SSH config rewriting.
75
+ - Direct provider API integrations.
76
+ - Guaranteeing identical behavior across Codex, Claude, and Gemini CLIs.
77
+ - Running real paid AI providers in CI.
78
+ - Replacing human approval for acceptance criteria, plans, or PR review.
79
+
80
+ ## Acceptance Criteria
81
+
82
+ 1. Given the root docs drift from the published package version, when the docs-sync slice runs, then README, CHANGELOG, ROADMAP, BACKLOG, and AI guidance no longer contradict the current package state.
83
+ 2. Given a user wants to start safely, when the preparation command runs in dry-run mode, then it reports planned checks and writes nothing.
84
+ 3. Given a user runs preparation for real, when the repo is valid, then Quiver refreshes project context docs and reports assumptions, risks, missing tools, and next commands.
85
+ 4. Given a project has secrets, env files, generated files, large artifacts, or dependency folders, when context is prepared, then those files are excluded from AI-facing context.
86
+ 5. Given `gh`, provider CLIs, auth, or SSH aliases are missing, when diagnostics run, then Quiver gives OS-specific guidance for macOS, Linux, and Windows.
87
+ 6. Given a planner produces acceptance criteria, when the user does not approve them, then Quiver keeps them as draft and does not create a technical plan or spec.
88
+ 7. Given acceptance criteria are approved, when the next phase starts, then Quiver uses the approved criteria as the source input.
89
+ 8. Given a planner produces a technical plan, when the user does not approve it, then Quiver keeps it as draft and does not create spec artifacts.
90
+ 9. Given a technical plan is approved, when the spec phase runs, then Quiver creates `SPEC.md`, `STATUS.md`, `EVIDENCE_REPORT.md`, `EXECUTION_PLAN.md`, `pr.md`, mandatory `slice-00`, and per-slice handoffs.
91
+ 10. Given generated slices, when the execution plan is built, then `slice-00` is first and every later slice is blocked until `slice-00` is committed.
92
+ 11. Given a spec starts, when Quiver creates or selects its worktree, then it uses one dedicated worktree/branch for that spec.
93
+ 12. Given a slice executor runs, when it receives context, then it receives only the slice, handoff, allowed files, criteria, and validation commands.
94
+ 13. Given a slice executor modifies files outside scope, when validation runs, then Quiver stops and reports the scope violation.
95
+ 14. Given a slice passes validation and commit automation is enabled, when the slice completes, then Quiver creates exactly one commit for that slice.
96
+ 15. Given a slice fails validation, when the command exits, then Quiver leaves a clear report and supports retry or abort without hiding local changes.
97
+ 16. Given multiple slices are ready, when execution waves are requested, then Quiver only runs slices in parallel if dependencies and file scopes do not conflict.
98
+ 17. Given execution waves include conflicts or unknown file scopes, when Quiver plans execution, then it falls back to sequential execution.
99
+ 18. Given all required slices are complete, when PR creation runs, then Quiver validates `gh`, auth, remote, branch, worktree, identity file, SSH alias, clean state, and generated `pr.md`.
100
+ 19. Given PR checks pass, when the user confirms PR creation, then Quiver creates the PR with `gh` using `pr.md`.
101
+ 20. Given a PR is not merged, when cleanup is requested, then Quiver refuses normal cleanup and explains the safe options.
102
+ 21. Given a PR is merged and the worktree is clean, when cleanup runs, then Quiver removes the spec worktree and pulls the merged changes into the main local checkout.
103
+ 22. Given package release validation runs, when local settings, env files, npm credentials, or AI tool local state would be included, then Quiver fails before packaging or publishing.
104
+
105
+ ## Approved Technical Plan
106
+
107
+ ### Objective
108
+
109
+ Turn Quiver's current AI commands into a guided workflow that is safer, more recoverable, and easier to use end to end.
110
+
111
+ ### Architecture
112
+
113
+ Add a lightweight workflow state layer under `.quiver/` and keep versioned project contracts under visible docs and `specs/`.
114
+
115
+ Recommended areas:
116
+
117
+ ```text
118
+ src/create-quiver/commands/prepare.js
119
+ src/create-quiver/commands/ai.js
120
+ src/create-quiver/commands/spec.js
121
+ src/create-quiver/lib/workflow-state.js
122
+ src/create-quiver/lib/context-writer.js
123
+ src/create-quiver/lib/approvals.js
124
+ src/create-quiver/lib/spec-worktrees.js
125
+ src/create-quiver/lib/slice-runner.js
126
+ src/create-quiver/lib/pr-create.js
127
+ src/create-quiver/lib/package-safety.js
128
+ ```
129
+
130
+ The exact file names can change during implementation if the existing codebase points to a better local pattern.
131
+
132
+ ### Workflow State
133
+
134
+ Persist workflow progress in `.quiver/`:
135
+
136
+ - selected provider and role;
137
+ - current spec;
138
+ - current worktree;
139
+ - draft and approved acceptance criteria;
140
+ - draft and approved technical plan;
141
+ - generated spec path;
142
+ - slice statuses;
143
+ - execution wave status;
144
+ - PR status;
145
+ - cleanup status.
146
+
147
+ Only durable team contracts belong in visible docs or `specs/`.
148
+
149
+ ### Command Experience
150
+
151
+ The command surface should be simple for humans:
152
+
153
+ ```bash
154
+ npx create-quiver prepare
155
+ npx create-quiver ai planner onboard
156
+ npx create-quiver ai planner acceptance
157
+ npx create-quiver ai approve acceptance
158
+ npx create-quiver ai planner technical-plan
159
+ npx create-quiver ai approve technical-plan
160
+ npx create-quiver ai planner spec
161
+ npx create-quiver spec start
162
+ npx create-quiver ai execute-plan
163
+ npx create-quiver ai pr create
164
+ npx create-quiver spec close
165
+ ```
166
+
167
+ If a short `quiver` binary is introduced, it must be documented as an alias or project-local script and must not contradict the canonical `npx create-quiver` entrypoint until that decision is made.
168
+
169
+ ### Safety Rules
170
+
171
+ - Dry-run support comes before write support.
172
+ - No product code changes before an approved slice.
173
+ - No commit before validation.
174
+ - No parallel execution when files or dependencies are unclear.
175
+ - No PR creation with dirty worktree or missing generated PR body.
176
+ - No cleanup before merge confirmation.
177
+ - No publishing if local settings or secrets enter the package tarball.
178
+
179
+ ### Validation Strategy
180
+
181
+ - Unit tests for state persistence and approval transitions.
182
+ - Unit tests for context exclusion and secret/path filters.
183
+ - Unit tests for missing tools and cross-platform install guidance.
184
+ - Unit tests for spec worktree lifecycle and cleanup guardrails.
185
+ - Unit tests for slice commit success/failure behavior.
186
+ - Unit tests for execution wave grouping and conflict fallback.
187
+ - Unit tests for PR creation command construction with mocked `gh`.
188
+ - Smoke tests for `prepare`, planner approval flow, executor dry-run, PR dry-run, and release/package safety.
189
+ - Existing tests for `ai plan`, `ai execute-slice`, `plan`, `graph`, and `next` must remain green.
190
+
191
+ ## Slicing Strategy
192
+
193
+ `slice-00` lands first and only publishes this spec foundation. The rest of the work is split so Quiver becomes useful earlier while high-risk automation, such as parallel execution and cleanup, is introduced after state, approvals, and single-slice execution are reliable.
194
+
195
+ ## Slice Roadmap
196
+
197
+ | Slice | Title | Status | Dependencies |
198
+ |-------|-------|--------|--------------|
199
+ | slice-00 | Spec foundation and guided workflow planning artifacts | Completed | none |
200
+ | slice-01 | Documentation source-of-truth sync | Completed | slice-00 |
201
+ | slice-02 | Prepare command and setup diagnostics | Completed | slice-01 |
202
+ | slice-03 | Context documentation refresh and safe analyzer output | Completed | slice-02 |
203
+ | slice-04 | Planner approval state for criteria and technical plans | Completed | slice-03 |
204
+ | slice-05 | Spec worktree lifecycle | Completed | slice-04 |
205
+ | slice-06 | Executor validation, recovery, and commit per slice | Completed | slice-05 |
206
+ | slice-07 | Execution waves and safe delegation | Completed | slice-06 |
207
+ | slice-08 | PR creation with gh and SSH guidance | Completed | slice-05 |
208
+ | slice-09 | Post-merge cleanup and release safety | Completed | slice-07, slice-08 |
209
+ | slice-10 | Final docs, smokes, and release readiness | Completed | slice-09 |
210
+
211
+ ## Risks
212
+
213
+ - A short `quiver` command can confuse users if it is introduced before the canonical command decision is documented.
214
+ - Persisted approval state can drift from visible spec artifacts if not validated.
215
+ - More automation increases the cost of recovering from failed provider runs.
216
+ - Parallel executor runs can create conflicts or overlapping edits.
217
+ - Cross-platform setup guidance can become stale if it is duplicated in several files.
218
+ - PR creation can target the wrong account if `gh` auth and SSH alias point to different identities.
219
+ - Cleanup can delete useful local work if merge and cleanliness checks are incomplete.
220
+ - Packaging can leak local tool state unless tarball checks are enforced.
221
+
222
+ ## Open Questions
223
+
224
+ - Should the short command be `quiver`, a project-local npm script, or only documented as future sugar over `npx create-quiver`?
225
+ - Should approval artifacts be versioned in `specs/` or stored internally in `.quiver/` until the spec is generated?
226
+ - Should commit automation default to confirmation prompts or require an explicit `--commit` flag?
227
+ - Should execution waves initially print commands for manual execution before running multiple providers automatically?
228
+ - Should `gh` installation remain guidance-only or include optional installer helpers behind explicit approval?