create-quiver 0.9.0 → 0.10.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 (111) hide show
  1. package/README.md +312 -124
  2. package/README_FOR_AI.md +59 -45
  3. package/ROADMAP.md +12 -11
  4. package/docs/AI_ONBOARDING_PROMPT.md.template +120 -52
  5. package/docs/COMMANDS.md.template +41 -6
  6. package/docs/GITFLOW_PR_GUIDE.md.template +11 -0
  7. package/docs/STANDARD.md.template +1 -1
  8. package/docs/SUPPORT_MATRIX.md.template +4 -0
  9. package/docs/TROUBLESHOOTING.md.template +29 -1
  10. package/docs/WORKFLOW.md.template +1 -1
  11. package/package.json +6 -1
  12. package/package.template.json +11 -6
  13. package/scripts/check-pr-readiness.sh +1 -1
  14. package/scripts/check-scope.sh +0 -1
  15. package/scripts/check-slice-readiness.sh +3 -4
  16. package/scripts/init-docs.sh +55 -9
  17. package/specs/quiver-v19-self-install-dev-dep/EVIDENCE_REPORT.md +2 -2
  18. package/specs/quiver-v19-self-install-dev-dep/STATUS.md +4 -4
  19. package/specs/quiver-v19-self-install-dev-dep/slices/slice-01-auto-install-dev-dep/slice.json +4 -4
  20. package/specs/quiver-v20-ai-cli-orchestration/EVIDENCE_REPORT.md +23 -0
  21. package/specs/quiver-v20-ai-cli-orchestration/EXECUTION_PLAN.md +57 -0
  22. package/specs/quiver-v20-ai-cli-orchestration/SPEC.md +202 -0
  23. package/specs/quiver-v20-ai-cli-orchestration/STATUS.md +35 -0
  24. package/specs/quiver-v20-ai-cli-orchestration/pr.md +100 -0
  25. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +30 -0
  26. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +61 -0
  27. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-00-spec-foundation/slice.json +54 -0
  28. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-01-ai-provider-runner/CLOSURE_BRIEF.md +39 -0
  29. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-01-ai-provider-runner/EXECUTION_BRIEF.md +63 -0
  30. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-01-ai-provider-runner/slice.json +55 -0
  31. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-02-context-packs-token-budget/CLOSURE_BRIEF.md +40 -0
  32. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-02-context-packs-token-budget/EXECUTION_BRIEF.md +60 -0
  33. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-02-context-packs-token-budget/slice.json +54 -0
  34. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-03-ai-phase-gated-planner/CLOSURE_BRIEF.md +43 -0
  35. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-03-ai-phase-gated-planner/EXECUTION_BRIEF.md +62 -0
  36. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-03-ai-phase-gated-planner/slice.json +62 -0
  37. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-04-spec-slice-handoff-pr-generation/CLOSURE_BRIEF.md +36 -0
  38. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-04-spec-slice-handoff-pr-generation/EXECUTION_BRIEF.md +63 -0
  39. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-04-spec-slice-handoff-pr-generation/slice.json +59 -0
  40. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-05-execution-plan-parallel-worktrees/CLOSURE_BRIEF.md +32 -0
  41. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-05-execution-plan-parallel-worktrees/EXECUTION_BRIEF.md +61 -0
  42. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-05-execution-plan-parallel-worktrees/slice.json +59 -0
  43. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-06-ai-execute-slice-scope-enforcement/CLOSURE_BRIEF.md +36 -0
  44. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-06-ai-execute-slice-scope-enforcement/EXECUTION_BRIEF.md +64 -0
  45. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-06-ai-execute-slice-scope-enforcement/slice.json +65 -0
  46. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-07-github-pr-preflight/CLOSURE_BRIEF.md +36 -0
  47. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-07-github-pr-preflight/EXECUTION_BRIEF.md +66 -0
  48. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-07-github-pr-preflight/slice.json +63 -0
  49. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-08-docs-smokes-release-readiness/CLOSURE_BRIEF.md +35 -0
  50. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-08-docs-smokes-release-readiness/EXECUTION_BRIEF.md +64 -0
  51. package/specs/quiver-v20-ai-cli-orchestration/slices/slice-08-docs-smokes-release-readiness/slice.json +77 -0
  52. package/specs/quiver-v21-ai-first-layout/EVIDENCE_REPORT.md +31 -0
  53. package/specs/quiver-v21-ai-first-layout/EXECUTION_PLAN.md +185 -0
  54. package/specs/quiver-v21-ai-first-layout/SPEC.md +212 -0
  55. package/specs/quiver-v21-ai-first-layout/STATUS.md +37 -0
  56. package/specs/quiver-v21-ai-first-layout/pr.md +110 -0
  57. package/specs/quiver-v21-ai-first-layout/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +30 -0
  58. package/specs/quiver-v21-ai-first-layout/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +63 -0
  59. package/specs/quiver-v21-ai-first-layout/slices/slice-00-spec-foundation/slice.json +45 -0
  60. package/specs/quiver-v21-ai-first-layout/slices/slice-01-init-profiles-dry-run/CLOSURE_BRIEF.md +31 -0
  61. package/specs/quiver-v21-ai-first-layout/slices/slice-01-init-profiles-dry-run/EXECUTION_BRIEF.md +59 -0
  62. package/specs/quiver-v21-ai-first-layout/slices/slice-01-init-profiles-dry-run/slice.json +57 -0
  63. package/specs/quiver-v21-ai-first-layout/slices/slice-02-internal-layout-template-resolver/CLOSURE_BRIEF.md +32 -0
  64. package/specs/quiver-v21-ai-first-layout/slices/slice-02-internal-layout-template-resolver/EXECUTION_BRIEF.md +60 -0
  65. package/specs/quiver-v21-ai-first-layout/slices/slice-02-internal-layout-template-resolver/slice.json +58 -0
  66. package/specs/quiver-v21-ai-first-layout/slices/slice-03-generation-profiles-visible-contract/CLOSURE_BRIEF.md +34 -0
  67. package/specs/quiver-v21-ai-first-layout/slices/slice-03-generation-profiles-visible-contract/EXECUTION_BRIEF.md +61 -0
  68. package/specs/quiver-v21-ai-first-layout/slices/slice-03-generation-profiles-visible-contract/slice.json +64 -0
  69. package/specs/quiver-v21-ai-first-layout/slices/slice-04-analyze-scan-relocation/CLOSURE_BRIEF.md +32 -0
  70. package/specs/quiver-v21-ai-first-layout/slices/slice-04-analyze-scan-relocation/EXECUTION_BRIEF.md +58 -0
  71. package/specs/quiver-v21-ai-first-layout/slices/slice-04-analyze-scan-relocation/slice.json +64 -0
  72. package/specs/quiver-v21-ai-first-layout/slices/slice-05-empty-specs-layout-doctor/CLOSURE_BRIEF.md +32 -0
  73. package/specs/quiver-v21-ai-first-layout/slices/slice-05-empty-specs-layout-doctor/EXECUTION_BRIEF.md +60 -0
  74. package/specs/quiver-v21-ai-first-layout/slices/slice-05-empty-specs-layout-doctor/slice.json +65 -0
  75. package/specs/quiver-v21-ai-first-layout/slices/slice-06-legacy-migration-optional-assets/CLOSURE_BRIEF.md +31 -0
  76. package/specs/quiver-v21-ai-first-layout/slices/slice-06-legacy-migration-optional-assets/EXECUTION_BRIEF.md +62 -0
  77. package/specs/quiver-v21-ai-first-layout/slices/slice-06-legacy-migration-optional-assets/slice.json +66 -0
  78. package/specs/quiver-v21-ai-first-layout/slices/slice-07-docs-guidance-alignment/CLOSURE_BRIEF.md +33 -0
  79. package/specs/quiver-v21-ai-first-layout/slices/slice-07-docs-guidance-alignment/EXECUTION_BRIEF.md +61 -0
  80. package/specs/quiver-v21-ai-first-layout/slices/slice-07-docs-guidance-alignment/slice.json +67 -0
  81. package/specs/quiver-v21-ai-first-layout/slices/slice-08-smokes-release-readiness/CLOSURE_BRIEF.md +35 -0
  82. package/specs/quiver-v21-ai-first-layout/slices/slice-08-smokes-release-readiness/EXECUTION_BRIEF.md +66 -0
  83. package/specs/quiver-v21-ai-first-layout/slices/slice-08-smokes-release-readiness/slice.json +62 -0
  84. package/src/create-quiver/commands/ai.js +442 -0
  85. package/src/create-quiver/index.js +421 -84
  86. package/src/create-quiver/lib/ai/context-packs.js +158 -0
  87. package/src/create-quiver/lib/ai/execution-plan.js +254 -0
  88. package/src/create-quiver/lib/ai/executor.js +323 -0
  89. package/src/create-quiver/lib/ai/github.js +329 -0
  90. package/src/create-quiver/lib/ai/phase-gates.js +72 -0
  91. package/src/create-quiver/lib/ai/preflight.js +58 -0
  92. package/src/create-quiver/lib/ai/prompt-transport.js +81 -0
  93. package/src/create-quiver/lib/ai/prompts.js +39 -0
  94. package/src/create-quiver/lib/ai/providers.js +314 -0
  95. package/src/create-quiver/lib/ai/safety.js +151 -0
  96. package/src/create-quiver/lib/ai/spec-generator.js +314 -0
  97. package/src/create-quiver/lib/ai/spec-templates.js +715 -0
  98. package/src/create-quiver/lib/doctor.js +114 -0
  99. package/src/create-quiver/lib/git.js +21 -0
  100. package/src/create-quiver/lib/init-docs.js +286 -25
  101. package/src/create-quiver/lib/init-layout.js +426 -0
  102. package/src/create-quiver/lib/lifecycle.js +2 -2
  103. package/src/create-quiver/lib/paths.js +63 -2
  104. package/src/create-quiver/lib/project-scan.js +66 -0
  105. package/src/create-quiver/lib/readiness.js +4 -2
  106. package/src/create-quiver/lib/scope.js +125 -0
  107. package/src/create-quiver/lib/slice-graph.js +6 -0
  108. package/src/create-quiver/lib/slice.js +51 -8
  109. package/src/create-quiver/lib/state.js +18 -1
  110. package/src/create-quiver/lib/template-resolver.js +74 -0
  111. package/.claude/settings.local.json +0 -52
@@ -2,12 +2,17 @@
2
2
  "name": "quiver-docs-template",
3
3
  "private": true,
4
4
  "scripts": {
5
- "quiver:migrate": "npx create-quiver migrate",
6
- "quiver:analyze": "npx create-quiver analyze",
7
- "quiver:plan": "npx create-quiver plan",
8
- "quiver:graph": "npx create-quiver graph",
9
- "quiver:next": "npx create-quiver next",
10
- "quiver:doctor": "npx create-quiver doctor",
5
+ "quiver:migrate": "npx create-quiver migrate",
6
+ "quiver:analyze": "npx create-quiver analyze",
7
+ "quiver:plan": "npx create-quiver plan",
8
+ "quiver:graph": "npx create-quiver graph",
9
+ "quiver:next": "npx create-quiver next",
10
+ "quiver:doctor": "npx create-quiver doctor",
11
+ "quiver:ai:onboard": "npx create-quiver ai onboard",
12
+ "quiver:ai:plan": "npx create-quiver ai plan",
13
+ "quiver:ai:execute-slice": "npx create-quiver ai execute-slice",
14
+ "quiver:ai:pr": "npx create-quiver ai pr",
15
+ "quiver:ai:doctor": "npx create-quiver ai doctor",
11
16
  "quiver:start-slice": "npx create-quiver start-slice",
12
17
  "quiver:check-slice": "npx create-quiver check-slice",
13
18
  "quiver:check-pr": "npx create-quiver check-pr",
@@ -39,7 +39,6 @@ slice_input="$1"
39
39
  command -v git >/dev/null 2>&1 || fail "git no esta disponible en PATH."
40
40
  command -v node >/dev/null 2>&1 || fail "node no esta disponible en PATH."
41
41
 
42
- repo_root="$(git rev-parse --show-toplevel)"
43
42
  script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
44
43
 
45
44
  [[ -f "$slice_input" ]] || fail "No existe el slice '$slice_input'."
@@ -127,6 +126,7 @@ pass "Al menos un caso de uso documentado."
127
126
  grep -Eq 'git revert ' "$pr_abs" || fail "Rollback debe incluir al menos un comando git revert."
128
127
  pass "Rollback incluye comando git revert."
129
128
 
129
+ # shellcheck disable=SC2016
130
130
  grep -Eiq '^\s*-\s*`manual review`$|^\s*-\s*`visual check`$|^\s*-\s*`screen test`$|^\s*-\s*`visual validation`$' "$pr_abs" && fail "How to Test cannot rely only on generic phrases."
131
131
 
132
132
  node -e "JSON.parse(require('fs').readFileSync(process.argv[1], 'utf8'))" "$slice_abs" >/dev/null
@@ -59,7 +59,6 @@ done
59
59
  command -v git >/dev/null 2>&1 || fail "git no esta disponible en PATH."
60
60
  command -v node >/dev/null 2>&1 || fail "node no esta disponible en PATH."
61
61
 
62
- repo_root="$(git rev-parse --show-toplevel)"
63
62
  [[ -f "$slice_input" ]] || fail "No existe el slice '$slice_input'."
64
63
  slice_abs="$(cd "$(dirname "$slice_input")" && pwd)/$(basename "$slice_input")"
65
64
 
@@ -77,7 +77,7 @@ repo_root="$(git rev-parse --show-toplevel)"
77
77
  [[ -f "$slice_input" ]] || fail "No existe el slice '$slice_input'."
78
78
 
79
79
  slice_abs="$(cd "$(dirname "$slice_input")" && pwd)/$(basename "$slice_input")"
80
- slice_rel="${slice_abs#$repo_root/}"
80
+ slice_rel="${slice_abs#"$repo_root"/}"
81
81
 
82
82
  slice_meta=()
83
83
  while IFS= read -r line; do
@@ -143,11 +143,8 @@ NODE
143
143
 
144
144
  [[ ${#slice_meta[@]} -eq 10 ]] || fail "No se pudo leer la metadata del slice."
145
145
 
146
- slice_id="${slice_meta[0]}"
147
- ticket="${slice_meta[1]}"
148
146
  branch_name="${slice_meta[2]}"
149
147
  slice_status="${slice_meta[3]}"
150
- is_baseline="${slice_meta[4]}"
151
148
  spec_dir_rel="${slice_meta[5]}"
152
149
  files_b64="${slice_meta[6]}"
153
150
  actual_hours="${slice_meta[7]}"
@@ -161,6 +158,8 @@ pass "El spec local tiene SPEC.md, STATUS.md y EVIDENCE_REPORT.md."
161
158
 
162
159
  if git cat-file -e "origin/develop:$slice_rel" 2>/dev/null; then
163
160
  pass "El slice ya existe en origin/develop (PR base documental mergeado)."
161
+ elif git cat-file -e "develop:$slice_rel" 2>/dev/null; then
162
+ pass "El slice ya existe en develop local (modo sin origin)."
164
163
  else
165
164
  if [[ "$gate" == "validation" ]]; then
166
165
  warn "El slice no existe todavia en origin/develop. El PR base documental sigue pendiente de merge. Podes abrir el PR del slice igual — el humano mergea en orden."
@@ -3,6 +3,7 @@
3
3
  # Script de Inicialización de Documentación
4
4
  # Uso: ./init-docs.sh "Nombre del Proyecto"
5
5
 
6
+ # shellcheck disable=SC2016
6
7
  set -e
7
8
 
8
9
  # Colores para output
@@ -62,6 +63,7 @@ CHECK_SCOPE_COMMAND="npx create-quiver check-scope <slice.json>"
62
63
  REFRESH_ACTIVE_SLICES_COMMAND="npx create-quiver refresh-active-slices"
63
64
 
64
65
  print_info "Inicializando documentación para: $PROJECT_NAME"
66
+ print_warning "Este script es compatibilidad legacy. Para el flujo AI-first default usá: npx create-quiver init --name \"$PROJECT_NAME\""
65
67
  print_info "Project slug: $PROJECT_SLUG"
66
68
  print_info "Fecha: $CURRENT_DATE"
67
69
 
@@ -92,7 +94,7 @@ copy_template() {
92
94
 
93
95
  if [ -f "$src" ]; then
94
96
  # Remover .template del nombre si existe
95
- dest=$(echo "$dest" | sed 's/\.template$//')
97
+ dest="${dest%.template}"
96
98
 
97
99
  if [ "$MIGRATE_MODE" = "1" ] && [ -f "$dest" ]; then
98
100
  print_info "Saltado: $dest ya existe"
@@ -511,6 +513,28 @@ npm install --save-dev create-quiver
511
513
 
512
514
  If you need to target another directory from outside the project, pass \`--dir\` explicitly. Quote paths that contain spaces.
513
515
 
516
+ ## AI-First Workflow
517
+
518
+ 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.
519
+
520
+ Start with dry-runs so you can inspect the provider, role, context pack, and invocation before spending model tokens:
521
+
522
+ \`\`\`bash
523
+ npm run quiver:ai:onboard -- --dry-run
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
527
+ npm run quiver:ai:pr -- --dry-run --ssh-host-alias github-work --identity-file ~/.ssh/github-work
528
+ \`\`\`
529
+
530
+ Remove \`--dry-run\` only after the phase output is approved and the local provider CLI is ready.
531
+
532
+ When a real spec exists, execute one approved slice at a time:
533
+
534
+ \`\`\`bash
535
+ npm run quiver:ai:execute-slice -- --slice specs/<spec-slug>/slices/<slice-id>/slice.json --dry-run
536
+ \`\`\`
537
+
514
538
  ## Project NPM Scripts
515
539
 
516
540
  The generated project includes \`quiver:*\` npm scripts that call the Node CLI and are the preferred repeatable workflow:
@@ -521,6 +545,11 @@ npm run quiver:plan
521
545
  npm run quiver:graph
522
546
  npm run quiver:next
523
547
  npm run quiver:doctor
548
+ npm run quiver:ai:onboard -- --dry-run
549
+ npm run quiver:ai:plan -- --phase acceptance --input requirements.md --dry-run
550
+ npm run quiver:ai:execute-slice -- --slice specs/<spec-slug>/slices/<slice-id>/slice.json --dry-run
551
+ npm run quiver:ai:doctor -- --dry-run --ssh-host-alias github-work --identity-file ~/.ssh/github-work
552
+ npm run quiver:ai:pr -- --dry-run --ssh-host-alias github-work --identity-file ~/.ssh/github-work
524
553
  npm run quiver:migrate
525
554
  npm run quiver:start-slice -- specs/$PROJECT_SLUG/slices/slice-01/slice.json
526
555
  npm run quiver:check-slice -- specs/$PROJECT_SLUG/slices/slice-01/slice.json
@@ -533,6 +562,7 @@ npm run quiver:refresh-active-slices
533
562
 
534
563
  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.
535
564
  The \`quiver:next\` script points to the next ready slice and can auto-start it behind a confirmation prompt.
565
+ The \`quiver:ai:*\` scripts standardize planner/executor AI flows. Use dry-run first: onboarding and planning dry-runs do not require provider auth, while \`quiver:ai:pr -- --dry-run\` validates \`gh\`, GitFlow docs, branch/worktree state, and SSH inputs without creating a PR.
536
566
  Use \`npx create-quiver next --all-ready\` when you want the full ready level instead of a single suggestion.
537
567
  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.
538
568
  \`npm run check-handoff -- specs/$PROJECT_SLUG/HANDOFF.md\` is available as a legacy-friendly alias for the handoff validator.
@@ -566,6 +596,12 @@ $GRAPH_COMMAND --format mermaid
566
596
  $GRAPH_COMMAND --format dot
567
597
  \`\`\`
568
598
 
599
+ If the project never ran Quiver initialization before, do not use \`migrate\` as bootstrap. Run:
600
+
601
+ \`\`\`bash
602
+ npx create-quiver init --name "Project Name"
603
+ \`\`\`
604
+
569
605
  If your team prefers a pinned local dependency, update the package first and then run the same flow:
570
606
 
571
607
  \`\`\`bash
@@ -587,9 +623,17 @@ Lee \`AGENTS.md\` primero y después \`docs/AI_ONBOARDING_PROMPT.md\` tras el an
587
623
  After analysis and doctor validation, open your AI agent in this project and run:
588
624
 
589
625
  \`\`\`text
590
- Read docs/AI_ONBOARDING_PROMPT.md and execute it.
591
- Do not modify product code unless I explicitly authorize it.
592
- Prepare the project context docs and report assumptions, risks, and files changed.
626
+ Lee \`docs/AI_ONBOARDING_PROMPT.md\` y ejecútalo como fuente principal de verdad para incorporarte a este repositorio.
627
+
628
+ 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.
629
+
630
+ 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.
631
+
632
+ No modifiques código de producto salvo autorización explícita. Puedes crear o actualizar documentación de contexto si el onboarding lo requiere.
633
+
634
+ 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.
635
+
636
+ Responde en español y finaliza con un reporte breve de archivos leídos, archivos modificados, estado del código de producto, supuestos, riesgos y próximos pasos.
593
637
  \`\`\`
594
638
 
595
639
  Review the AI changes to docs/AI_CONTEXT.md, docs/CONTEXTO.md, docs/STATUS.md, and specs/$PROJECT_SLUG/SPEC.md before starting implementation work.
@@ -601,6 +645,8 @@ Record durable decisions in \`docs/DECISIONS.md\` so future AI agents do not re-
601
645
 
602
646
  ## First Slice Workflow
603
647
 
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.
649
+
604
650
  1. Review or refine specs/$PROJECT_SLUG/SPEC.md.
605
651
  2. Create the first slice from specs/$PROJECT_SLUG/slices/slice-template/slice.json.
606
652
  3. Review the plan with \`$PLAN_COMMAND\` or \`npm run quiver:plan\`.
@@ -643,7 +689,7 @@ fi
643
689
  echo ""
644
690
  print_success "¡Inicialización completada!"
645
691
  echo ""
646
- echo "📁 Estructura creada:"
692
+ echo "📁 Estructura legacy/full creada:"
647
693
  echo " docs/ ← Documentación core"
648
694
  echo " docs/ai/ ← Configuración de IA"
649
695
  echo " docs/tools/ ← Herramientas (vacío)"
@@ -654,10 +700,10 @@ echo "📝 Próximos pasos:"
654
700
  echo " 1. Editar docs/AI_CONTEXT.md con el contexto resumido para IA"
655
701
  echo " 2. Editar docs/CONTEXTO.md con la información de tu proyecto"
656
702
  echo " 3. Editar docs/STATUS.md con el estado actual"
657
- echo " 4. Crear el primer directorio de slice en specs/$PROJECT_SLUG/slices/[slice-id]/"
658
- echo " 5. Actualizar docs/SEARCH.md con temas específicos"
703
+ echo " 4. Para el flujo recomendado, crear specs reales con: npx create-quiver ai plan --phase spec"
704
+ echo " 5. Usar tools/scripts solo si necesitás compatibilidad legacy"
659
705
  echo ""
660
706
  echo "📖 Más información:"
661
- echo " - Ver docs-template/TEMPLATE.md para guía de personalización"
662
- echo " - Ver docs-template/README.md para documentación del template"
707
+ echo " - Ver README.md y README_FOR_AI.md para el flujo AI-first actual"
708
+ echo " - docs-template/ aplica solo a compatibilidad legacy o templates exportados"
663
709
  echo ""
@@ -2,13 +2,13 @@
2
2
 
3
3
  **Spec:** quiver-v19-self-install-dev-dep
4
4
  **Date:** 2026-05-14
5
- **Status:** In Progress
5
+ **Status:** Completed
6
6
 
7
7
  ## Slice Evidence
8
8
 
9
9
  | Slice | Status | Evidence |
10
10
  |-------|--------|----------|
11
- | slice-01 | Ready | |
11
+ | slice-01 | Completed | PR #60 merged 2026-05-14. 40/40 tests pass. Smoke: `--skip-install` no instala, sin flag instala `create-quiver@0.9.0` + `devDependencies: {"create-quiver":"^0.9.0"}`. `npx create-quiver plan` exit 0 sin `@version`. Published as `create-quiver@0.9.0`. |
12
12
 
13
13
  ## Required Final Evidence
14
14
 
@@ -7,14 +7,14 @@
7
7
 
8
8
  | Slice | Title | Status | PR | Estimated hours | Actual hours |
9
9
  |-------|-------|--------|----|-----------------|--------------|
10
- | slice-01 | Auto-install create-quiver as dev dependency | Ready | | 1.5 | |
10
+ | slice-01 | Auto-install create-quiver as dev dependency | Completed | #60 | 1.5 | 1.0 |
11
11
 
12
12
  ## Progress
13
13
 
14
- - Completed slices: 0 / 1
14
+ - Completed slices: 1 / 1
15
15
  - Estimated hours: 1.5
16
- - Actual hours:
16
+ - Actual hours: 1.0
17
17
 
18
18
  ## Blockers
19
19
 
20
- None.
20
+ None — spec complete.
@@ -47,10 +47,10 @@
47
47
  "npx create-quiver --skip-install --name test --dir /tmp/quiver-test-skip && ls /tmp/quiver-test-skip/node_modules/create-quiver 2>/dev/null && echo FAIL || echo OK"
48
48
  ],
49
49
  "estimated_hours": 1.5,
50
- "actual_hours": null,
51
- "status": "ready",
50
+ "actual_hours": 1,
51
+ "status": "completed",
52
52
  "blocked_reason": null,
53
53
  "ready_at": "2026-05-14T00:00:00Z",
54
- "started_at": null,
55
- "completed_at": null
54
+ "started_at": "2026-05-14T00:00:00Z",
55
+ "completed_at": "2026-05-14T00:00:00Z"
56
56
  }
@@ -0,0 +1,23 @@
1
+ # Evidence Report - Quiver v20 AI CLI Orchestration
2
+
3
+ ## Status
4
+
5
+ Slice 08 implemented.
6
+
7
+ ## Slice Evidence
8
+
9
+ | Slice | Evidence |
10
+ |-------|----------|
11
+ | slice-00 | Spec foundation files created and JSON validation completed. |
12
+ | slice-01 | Implemented provider runner, prompt transport, provider preflight, dry-run, timeout handling, and provider tests. |
13
+ | slice-02 | Implemented AI roles, context packs, token-budget hints, safety exclusions, prompt-injection guard text, and tests. |
14
+ | slice-03 | Implemented phase-gated planner commands, dry-run display, phase blocking for spec, and command tests. |
15
+ | slice-04 | Implemented spec-phase generation, safe collision handling, JSON validation, and command/tests coverage. |
16
+ | slice-05 | Implemented execution plan graphing, slice-00 foundation barriers, ready levels, temporary worktree strategy, and cycle/missing dependency diagnostics. |
17
+ | slice-06 | Implemented `ai execute-slice`, executor prompts, dry-run, provider failure handling, pre/post diff capture, clean-worktree guard, and scope enforcement tests. |
18
+ | slice-07 | Implemented GitHub PR preflight, gh auth checks, worktree/branch validation, GitFlow guide checks, SSH identity handling, and CLI/tests coverage. |
19
+ | slice-08 | Updated README, AI onboarding/commands/support/troubleshooting/GitFlow templates, generated npm scripts, init docs, doctor script warnings, and dry-run smoke coverage. |
20
+
21
+ ## Final Validation
22
+
23
+ Validated for slice-08 with `node --test tests/**/*.test.js`, `npm run smoke:create-quiver`, `node scripts/ci/smoke-cross-platform.js`, package JSON parsing, shell/Node syntax checks, and `git diff --check`.
@@ -0,0 +1,57 @@
1
+ # Execution Plan - Quiver v20 AI CLI Orchestration
2
+
3
+ ## Rule
4
+
5
+ `slice-00` is mandatory and must be committed first. It establishes the spec foundation in the repo.
6
+
7
+ ## Sequential Foundation
8
+
9
+ 1. `slice-00-spec-foundation`
10
+ - Commit the spec, slice definitions, handoffs, execution plan, and PR body.
11
+
12
+ 2. `slice-01-ai-provider-runner`
13
+ - Build the provider abstraction and safe prompt transport.
14
+
15
+ 3. `slice-02-context-packs-token-budget`
16
+ - Can run after `slice-00`.
17
+ - Can run in parallel with `slice-01` only if it does not modify provider-runner files.
18
+
19
+ 4. `slice-03-ai-phase-gated-planner`
20
+ - Requires `slice-01` and `slice-02`.
21
+
22
+ 5. `slice-04-spec-slice-handoff-pr-generation`
23
+ - Requires `slice-03`.
24
+
25
+ ## Parallelizable Work
26
+
27
+ After `slice-04`, these can be developed in parallel if each uses a separate worktree and respects declared files:
28
+
29
+ - `slice-05-execution-plan-parallel-worktrees`
30
+ - `slice-07-github-pr-preflight`
31
+
32
+ After `slice-05`, this can start:
33
+
34
+ - `slice-06-ai-execute-slice-scope-enforcement`
35
+
36
+ ## Final Integration
37
+
38
+ `slice-08-docs-smokes-release-readiness` must run last because it updates docs, generated scripts, templates, and smoke coverage across the completed feature.
39
+
40
+ ## Suggested Commit Order
41
+
42
+ 1. `docs(spec): add ai cli orchestration spec foundation`
43
+ 2. `feat(ai): add provider runner and safe prompt transport`
44
+ 3. `feat(ai): add context packs and token budgets`
45
+ 4. `feat(ai): add phase gated planner commands`
46
+ 5. `feat(ai): generate spec slices handoffs and pr body`
47
+ 6. `feat(ai): add slice execution plan and parallel worktree support`
48
+ 7. `feat(ai): execute slices with scope enforcement`
49
+ 8. `feat(ai): add github pr preflight`
50
+ 9. `docs(ai): document orchestration workflow and add smokes`
51
+
52
+ ## Integration Notes
53
+
54
+ - Do not merge parallel slice outputs before their dependencies are committed.
55
+ - If two slices touch the same template, integrate the earlier dependency first and rebase the later worktree.
56
+ - Keep provider tests mocked. Real provider CLIs are optional local checks only.
57
+
@@ -0,0 +1,202 @@
1
+ # Quiver v20 - AI CLI Orchestration
2
+
3
+ **Date:** 2026-05-19
4
+ **Status:** Active
5
+
6
+ Slice numbering resets here. This spec intentionally starts at `slice-00`.
7
+
8
+ ## Problem
9
+
10
+ Quiver already creates workflow documentation and can analyze a project with `npx create-quiver analyze`, but the AI-assisted workflow still depends on manual copy/paste prompts and ad hoc model usage.
11
+
12
+ Teams using Quiver need a repeatable way to:
13
+
14
+ - Run AI tasks through local CLIs such as Codex, Claude, or Gemini.
15
+ - Separate expensive planner work from cheaper executor work.
16
+ - Optimize token usage by giving each agent only the context it needs.
17
+ - Move from requirements to acceptance criteria, technical plan, specs, slices, handoffs, and PR body with explicit human approvals.
18
+ - Execute slices safely, including parallel slice execution when dependencies allow it.
19
+ - Open PRs with `gh` and SSH configuration in a cross-platform way.
20
+
21
+ ## Objective
22
+
23
+ Add an AI orchestration layer to Quiver that standardizes planner/executor workflows through `quiver ai ...` commands, provider adapters, context packs, phase gates, slice handoffs, execution plans, and GitHub PR preflight checks.
24
+
25
+ The goal is not to replace the AI agent. Quiver should define how to invoke it, what context to provide, when to require approval, what artifacts to generate, and how to validate that execution stayed inside scope.
26
+
27
+ ## Core Decisions
28
+
29
+ - `slice-00` is mandatory for every generated spec and is reserved for committing the spec foundation to the repo.
30
+ - One spec maps to one worktree and one PR.
31
+ - One slice maps to one commit.
32
+ - Planner agents use broader context and do not modify product code in acceptance-criteria or technical-plan phases.
33
+ - Executor agents can modify code directly, but only within the slice handoff scope.
34
+ - Prompt execution must support macOS, Linux, and Windows.
35
+ - Prompts must not rely on shell string concatenation for long content.
36
+ - `gh` and SSH setup must be validated, not silently modified.
37
+ - AI execution output is printed to console; no global run logs are created automatically.
38
+ - Final evidence belongs in the relevant slice closure brief.
39
+
40
+ ## Scope
41
+
42
+ ### Included
43
+
44
+ - Add `quiver ai ...` command family.
45
+ - Add provider runner adapters for Codex, Claude, and Gemini CLIs.
46
+ - Add provider preflight validation and `--dry-run`.
47
+ - Add safe prompt transport for long prompts through stdin or temporary files where supported.
48
+ - Add planner/executor roles.
49
+ - Add context packs and token-budget guidance.
50
+ - Add phase-gated planner flow:
51
+ - acceptance criteria
52
+ - technical plan
53
+ - spec/slices/handoffs/PR body
54
+ - Generate mandatory `slice-00`.
55
+ - Generate `SPEC.md`, slice definitions, execution handoffs, closure handoffs, `EXECUTION_PLAN.md`, and `pr.md`.
56
+ - Track implementation evidence in `EVIDENCE_REPORT.md`.
57
+ - Generate an execution plan with sequential and parallel slices.
58
+ - Support executor slice execution with context minimization.
59
+ - Enforce scope before and after executor runs.
60
+ - Add GitHub PR preflight for `gh`, auth, remote, worktree, GitFlow guide, SSH host alias, and identity file.
61
+ - Update generated docs, README guidance, templates, npm scripts, and smoke tests.
62
+
63
+ ### Excluded
64
+
65
+ - Direct provider API integrations.
66
+ - Automatic model cost estimation.
67
+ - Automatic installation of `gh`.
68
+ - Automatic SSH credential modification without explicit user approval.
69
+ - Global AI run logs.
70
+ - Fully autonomous PR merge.
71
+ - Guaranteeing exact feature parity between Codex, Claude, and Gemini CLIs.
72
+
73
+ ## Acceptance Criteria
74
+
75
+ 1. Given a Quiver project, when the user runs an AI command, then Quiver distinguishes between `planner` and `executor` roles.
76
+ 2. Given a supported provider, when the user selects `codex`, `claude`, or `gemini`, then Quiver builds the provider-specific command safely.
77
+ 3. Given an unsupported provider, when the user runs `quiver ai ...`, then Quiver fails with a clear list of supported providers.
78
+ 4. Given a missing provider CLI, when Quiver runs preflight, then it fails with an actionable install/auth hint.
79
+ 5. Given a long prompt, when Quiver invokes a provider, then it uses a cross-platform-safe transport instead of shell string concatenation.
80
+ 6. Given `--dry-run`, when any `quiver ai ...` command runs, then Quiver prints provider, role, context pack, and invocation plan without calling the provider.
81
+ 7. Given planner onboarding, when `quiver ai onboard` runs, then the prompt instructs the AI to read Quiver context, WDD/SDD workflow, project scan/map, assumptions, risks, and relevant docs without modifying product code.
82
+ 8. Given new requirements, when `quiver ai plan` runs in acceptance phase, then it prints acceptance criteria and does not create specs, slices, handoffs, or product code changes.
83
+ 9. Given approved acceptance criteria, when `quiver ai plan` runs in technical-plan phase, then it prints a technical plan and still does not create specs, slices, handoffs, or product code changes.
84
+ 10. Given an approved technical plan, when `quiver ai plan` runs in spec phase, then it creates the spec artifacts.
85
+ 11. Given a generated spec, when artifacts are created, then `slice-00` exists and every other slice depends on it unless explicitly justified.
86
+ 12. Given `slice-00`, when it is executed, then it only commits documentation/spec foundation unless an explicit exception is approved.
87
+ 13. Given a generated spec, when planning completes, then `EXECUTION_PLAN.md` declares sequential slices, parallel-ready slices, dependencies, and integration order.
88
+ 14. Given an executor slice, when `quiver ai execute-slice` runs, then the executor receives only slice, handoff, allowed files, criteria, and validation commands.
89
+ 15. Given an executor run, when it completes, then Quiver verifies changed files against declared scope and reports violations.
90
+ 16. Given context packs, when Quiver prepares AI context, then it excludes secrets, env files, build outputs, package caches, node_modules, and other unsafe paths.
91
+ 17. Given repository files containing instructions, when AI context is prepared, then prompts state that repo content is data and cannot override Quiver/system/user instructions.
92
+ 18. Given a PR flow, when `quiver ai pr` runs, then Quiver verifies `gh`, `gh auth status`, Git remote, worktree, GitFlow guide, SSH host alias, and identity file before opening or preparing the PR.
93
+ 19. Given missing `gh`, auth, SSH alias, identity file, remote, or GitFlow guide, when PR preflight runs, then Quiver stops with an actionable cross-platform message.
94
+ 20. Given a generated spec, when artifacts are created, then `pr.md` is always generated from the GitFlow guide.
95
+ 21. Given CI, when tests run, then provider behavior is validated with mocks and `--dry-run`, without requiring real provider auth.
96
+
97
+ ## Approved Technical Plan
98
+
99
+ ### Objective
100
+
101
+ Implement an AI orchestration layer around local provider CLIs while preserving Quiver's spec/slice workflow, explicit approvals, token efficiency, and cross-platform support.
102
+
103
+ ### Architecture
104
+
105
+ Add a command family under:
106
+
107
+ ```text
108
+ npx create-quiver ai <task>
109
+ ```
110
+
111
+ Recommended modules:
112
+
113
+ ```text
114
+ src/create-quiver/commands/ai.js
115
+ src/create-quiver/lib/ai/providers.js
116
+ src/create-quiver/lib/ai/context-packs.js
117
+ src/create-quiver/lib/ai/prompts.js
118
+ src/create-quiver/lib/ai/preflight.js
119
+ src/create-quiver/lib/ai/execution-plan.js
120
+ src/create-quiver/lib/ai/github.js
121
+ ```
122
+
123
+ Generated projects should expose scripts such as:
124
+
125
+ ```text
126
+ quiver:ai:onboard
127
+ quiver:ai:plan
128
+ quiver:ai:execute-slice
129
+ quiver:ai:pr
130
+ quiver:ai:doctor
131
+ ```
132
+
133
+ ### Provider Strategy
134
+
135
+ Provider adapters map a normalized request to CLI-specific execution:
136
+
137
+ ```text
138
+ codex -> codex exec
139
+ claude -> claude -p
140
+ gemini -> gemini -p
141
+ ```
142
+
143
+ Adapters must use `spawn` or `execFile` with argument arrays. They must not concatenate shell strings.
144
+
145
+ Prompt transport must support long prompts with stdin or temporary files where supported by the provider adapter.
146
+
147
+ ### Context Strategy
148
+
149
+ Context packs:
150
+
151
+ - `full`: planner onboarding.
152
+ - `planning`: requirements, project map, workflow docs, related specs.
153
+ - `slice`: spec, slice, handoff, allowed files, validation commands.
154
+ - `minimal`: executor-focused task context only.
155
+
156
+ Executors must not receive full onboarding context.
157
+
158
+ ### GitHub Strategy
159
+
160
+ Separate:
161
+
162
+ - `sshHostAlias`, for example `github-work`.
163
+ - `identityFile`, for example `~/ssh/github-work`.
164
+ - `gh` account/auth state.
165
+ - Git remote URL.
166
+
167
+ Quiver validates these and guides the user. It does not edit credentials automatically.
168
+
169
+ ## Slices
170
+
171
+ | Slice | Title | Status | Dependencies |
172
+ |-------|-------|--------|--------------|
173
+ | slice-00 | Spec foundation and PR planning artifacts | Ready | none |
174
+ | slice-01 | AI provider runner and safe prompt transport | Draft | slice-00 |
175
+ | slice-02 | Context packs, roles, token budgets, and safety exclusions | Draft | slice-00 |
176
+ | slice-03 | Phase-gated planner commands | Draft | slice-01, slice-02 |
177
+ | slice-04 | Spec, slice, handoff, and PR body generation | Draft | slice-03 |
178
+ | slice-05 | Execution plan, dependencies, and parallel worktrees | Draft | slice-04 |
179
+ | slice-06 | Executor command and scope enforcement | Draft | slice-01, slice-02, slice-05 |
180
+ | slice-07 | GitHub PR preflight with gh and SSH | Draft | slice-01, slice-04 |
181
+ | slice-08 | Documentation, generated scripts, smokes, and release readiness | Draft | slice-01, slice-02, slice-03, slice-04, slice-05, slice-06, slice-07 |
182
+
183
+ ## Risks
184
+
185
+ - Provider CLIs may have incompatible flags or prompt input behavior.
186
+ - Long prompts can break if transported as shell strings.
187
+ - Windows quoting and path behavior can regress if not tested with argument arrays.
188
+ - Parallel slice execution can create merge conflicts if integration order is unclear.
189
+ - Executor context can be too small to be safe or too large to save tokens.
190
+ - `gh` authentication and SSH remotes can point to different accounts.
191
+ - Prompt injection can occur through repo content if not explicitly guarded.
192
+
193
+ ## Validation Strategy
194
+
195
+ - Unit tests for provider command construction.
196
+ - Unit tests for provider preflight and unsupported providers.
197
+ - Unit tests for context pack file inclusion/exclusion.
198
+ - Unit tests for phase gate state and artifact creation boundaries.
199
+ - Unit tests for scope enforcement after executor runs.
200
+ - Dry-run smoke tests for all `quiver ai` commands.
201
+ - Cross-platform smoke for paths with spaces.
202
+ - CI tests must not require real provider CLIs or auth.
@@ -0,0 +1,35 @@
1
+ # Quiver v20 - AI CLI Orchestration Status
2
+
3
+ **Status:** Active
4
+ **Created:** 2026-05-19
5
+
6
+ ## Summary
7
+
8
+ This spec defines Quiver's AI CLI orchestration layer: provider runners, planner/executor roles, token-efficient context packs, phase-gated planning, spec/slice generation, executor scope enforcement, parallel slice planning, and GitHub PR preflight.
9
+
10
+ ## Current State
11
+
12
+ - Requirements and acceptance criteria: approved.
13
+ - Technical plan: approved.
14
+ - Spec and slice handoffs: created in this documentation pass.
15
+ - `slice-00`: completed.
16
+ - `slice-01`: completed.
17
+ - `slice-02`: completed.
18
+ - `slice-03`: completed.
19
+ - `slice-04`: completed.
20
+ - `slice-05`: completed.
21
+ - `slice-06`: completed.
22
+ - `slice-07`: completed.
23
+ - `slice-08`: completed.
24
+
25
+ ## Execution Rules
26
+
27
+ - `slice-00` must be executed and committed first.
28
+ - Every later slice depends on `slice-00` unless explicitly stated otherwise.
29
+ - One slice equals one commit.
30
+ - One spec equals one worktree and one PR.
31
+ - Parallel slices may use temporary worktrees, but their commits must be integrated into the spec PR branch in dependency order.
32
+
33
+ ## Open Items
34
+
35
+ - Generated projects materialize `docs/GITFLOW_PR_GUIDE.md`; `ai pr` preflight validates it before PR work.