create-quiver 0.6.0 → 0.8.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 (120) hide show
  1. package/.claude/settings.local.json +45 -0
  2. package/.github/workflows/ci.yml +9 -32
  3. package/AGENTS.md.template +41 -0
  4. package/BACKLOG.md +139 -0
  5. package/CHANGELOG.md +17 -0
  6. package/README.md +68 -14
  7. package/README_FOR_AI.md +48 -16
  8. package/ROADMAP.md +100 -0
  9. package/docs/AI_CONTEXT.md.template +19 -26
  10. package/docs/AI_ONBOARDING_PROMPT.md.template +16 -0
  11. package/docs/COMMANDS.md.template +25 -0
  12. package/docs/CONTEXTO.md.template +4 -17
  13. package/docs/DECISIONS.md.template +18 -0
  14. package/docs/DEEP.md.template +34 -0
  15. package/docs/DOCUMENTATION_GUIDE.md.template +9 -7
  16. package/docs/GITFLOW_PR_GUIDE.md.template +7 -0
  17. package/docs/INDEX.md.template +11 -0
  18. package/docs/QUICK.md.template +27 -0
  19. package/docs/STANDARD.md.template +49 -0
  20. package/docs/STATUS.md.template +2 -2
  21. package/docs/SUPPORT_MATRIX.md.template +16 -4
  22. package/docs/TESTING_GUIDE_FOR_AI.md.template +4 -3
  23. package/docs/TROUBLESHOOTING.md.template +14 -0
  24. package/docs/WORKFLOW.md.template +21 -4
  25. package/docs/examples/graph.md.template +62 -0
  26. package/docs/examples/next.md.template +27 -0
  27. package/docs/examples/plan.md.template +28 -0
  28. package/package.json +6 -2
  29. package/package.template.json +16 -0
  30. package/scripts/check-slice-readiness.sh +6 -4
  31. package/scripts/cleanup-slice.sh +2 -172
  32. package/scripts/init-docs.sh +147 -26
  33. package/scripts/package-quiver.sh +5 -0
  34. package/scripts/start-slice.sh +3 -425
  35. package/specs/[project-name]/EVIDENCE_REPORT.md.template +3 -1
  36. package/specs/[project-name]/HANDOFF.md.template +37 -0
  37. package/specs/[project-name]/slices/slice-template/slice.json +7 -2
  38. package/specs/quiver-v08-agent-onboarding-analysis/slices/slice-01-project-scan-command/slice.json +1 -1
  39. package/specs/quiver-v08-agent-onboarding-analysis/slices/slice-02-ai-onboarding-prompt/slice.json +1 -1
  40. package/specs/quiver-v08-agent-onboarding-analysis/slices/slice-03-doctor-readme-adoption-flow/slice.json +1 -1
  41. package/specs/quiver-v12-cross-platform-native-runtime/EVIDENCE_REPORT.md +30 -0
  42. package/specs/quiver-v12-cross-platform-native-runtime/SPEC.md +86 -0
  43. package/specs/quiver-v12-cross-platform-native-runtime/STATUS.md +29 -0
  44. package/specs/quiver-v12-cross-platform-native-runtime/slices/slice-01-cross-platform-support-contract/slice.json +69 -0
  45. package/specs/quiver-v12-cross-platform-native-runtime/slices/slice-02-node-init-docs-runtime/slice.json +76 -0
  46. package/specs/quiver-v12-cross-platform-native-runtime/slices/slice-03-node-migrate-analyze-doctor-flow/slice.json +74 -0
  47. package/specs/quiver-v12-cross-platform-native-runtime/slices/slice-04-node-slice-lifecycle-commands/slice.json +81 -0
  48. package/specs/quiver-v12-cross-platform-native-runtime/slices/slice-05-generated-project-scripts-and-migration/slice.json +78 -0
  49. package/specs/quiver-v12-cross-platform-native-runtime/slices/slice-06-cross-platform-ci-release-readiness/slice.json +74 -0
  50. package/specs/quiver-v13-token-efficient-ai-context/EVIDENCE_REPORT.md +28 -0
  51. package/specs/quiver-v13-token-efficient-ai-context/SPEC.md +68 -0
  52. package/specs/quiver-v13-token-efficient-ai-context/STATUS.md +26 -0
  53. package/specs/quiver-v13-token-efficient-ai-context/slices/slice-01-token-efficient-ai-modes-guidance/slice.json +65 -0
  54. package/specs/quiver-v13-token-efficient-ai-context/slices/slice-02-decision-log-context-checkpoint/slice.json +64 -0
  55. package/specs/quiver-v13-token-efficient-ai-context/slices/slice-03-project-map-reading-order/slice.json +66 -0
  56. package/specs/quiver-v14-tiered-context-pack/EVIDENCE_REPORT.md +42 -0
  57. package/specs/quiver-v14-tiered-context-pack/SPEC.md +116 -0
  58. package/specs/quiver-v14-tiered-context-pack/STATUS.md +35 -0
  59. package/specs/quiver-v14-tiered-context-pack/slices/slice-01-tiered-context-pack/slice.json +77 -0
  60. package/specs/quiver-v14-tiered-context-pack/slices/slice-02-agents-md-router/slice.json +74 -0
  61. package/specs/quiver-v14-tiered-context-pack/slices/slice-03-active-slice-lifecycle/slice.json +74 -0
  62. package/specs/quiver-v14-tiered-context-pack/slices/slice-04-dedup-frontmatter/slice.json +83 -0
  63. package/specs/quiver-v14-tiered-context-pack/slices/slice-05-doctor-smokes-tiered-pack/slice.json +84 -0
  64. package/specs/quiver-v15-init-required-before-migrate/EVIDENCE_REPORT.md +26 -0
  65. package/specs/quiver-v15-init-required-before-migrate/SPEC.md +66 -0
  66. package/specs/quiver-v15-init-required-before-migrate/STATUS.md +26 -0
  67. package/specs/quiver-v15-init-required-before-migrate/slices/slice-01-migrate-initialization-precondition/slice.json +65 -0
  68. package/specs/quiver-v15-init-required-before-migrate/slices/slice-02-doctor-not-initialized-guidance/slice.json +61 -0
  69. package/specs/quiver-v15-init-required-before-migrate/slices/slice-03-docs-smokes-init-before-migrate/slice.json +64 -0
  70. package/specs/quiver-v16-handoff-contract/EVIDENCE_REPORT.md +26 -0
  71. package/specs/quiver-v16-handoff-contract/SPEC.md +68 -0
  72. package/specs/quiver-v16-handoff-contract/STATUS.md +26 -0
  73. package/specs/quiver-v16-handoff-contract/slices/slice-01-handoff-template-and-contract/slice.json +66 -0
  74. package/specs/quiver-v16-handoff-contract/slices/slice-02-check-handoff-command/slice.json +70 -0
  75. package/specs/quiver-v16-handoff-contract/slices/slice-03-handoff-scaffold-optional/slice.json +67 -0
  76. package/specs/quiver-v17-orchestration-foundation/EVIDENCE_REPORT.md +32 -0
  77. package/specs/quiver-v17-orchestration-foundation/SPEC.md +79 -0
  78. package/specs/quiver-v17-orchestration-foundation/STATUS.md +31 -0
  79. package/specs/quiver-v17-orchestration-foundation/slices/slice-01-ci-matrix-verified/slice.json +68 -0
  80. package/specs/quiver-v17-orchestration-foundation/slices/slice-02-slice-graph-library/slice.json +65 -0
  81. package/specs/quiver-v17-orchestration-foundation/slices/slice-03-depends-on-validation/slice.json +72 -0
  82. package/specs/quiver-v18-slice-orchestration/EVIDENCE_REPORT.md +38 -0
  83. package/specs/quiver-v18-slice-orchestration/SPEC.md +91 -0
  84. package/specs/quiver-v18-slice-orchestration/STATUS.md +33 -0
  85. package/specs/quiver-v18-slice-orchestration/slices/slice-01-plan-command/slice.json +79 -0
  86. package/specs/quiver-v18-slice-orchestration/slices/slice-02-graph-mvp-tree/slice.json +75 -0
  87. package/specs/quiver-v18-slice-orchestration/slices/slice-03-graph-extended-formats/slice.json +70 -0
  88. package/specs/quiver-v18-slice-orchestration/slices/slice-04-next-command/slice.json +73 -0
  89. package/specs/quiver-v18-stabilization/EVIDENCE_REPORT.md +26 -0
  90. package/specs/quiver-v18-stabilization/SPEC.md +62 -0
  91. package/specs/quiver-v18-stabilization/STATUS.md +30 -0
  92. package/specs/quiver-v18-stabilization/slices/slice-01-fix-legacy-dependency-resolution/CLOSURE_BRIEF.md +29 -0
  93. package/specs/quiver-v18-stabilization/slices/slice-01-fix-legacy-dependency-resolution/EXECUTION_BRIEF.md +134 -0
  94. package/specs/quiver-v18-stabilization/slices/slice-01-fix-legacy-dependency-resolution/slice.json +56 -0
  95. package/specs/quiver-v18-stabilization/slices/slice-02-roadmap-and-branch-cleanup/CLOSURE_BRIEF.md +29 -0
  96. package/specs/quiver-v18-stabilization/slices/slice-02-roadmap-and-branch-cleanup/EXECUTION_BRIEF.md +118 -0
  97. package/specs/quiver-v18-stabilization/slices/slice-02-roadmap-and-branch-cleanup/slice.json +57 -0
  98. package/specs/quiver-v18-stabilization/slices/slice-03-publish-drafts-branch/CLOSURE_BRIEF.md +23 -0
  99. package/specs/quiver-v18-stabilization/slices/slice-03-publish-drafts-branch/EXECUTION_BRIEF.md +73 -0
  100. package/specs/quiver-v18-stabilization/slices/slice-03-publish-drafts-branch/slice.json +49 -0
  101. package/src/create-quiver/commands/graph.js +97 -0
  102. package/src/create-quiver/commands/next.js +134 -0
  103. package/src/create-quiver/commands/plan.js +205 -0
  104. package/src/create-quiver/index.js +476 -123
  105. package/src/create-quiver/lib/analyze.js +9 -0
  106. package/src/create-quiver/lib/doctor.js +212 -0
  107. package/src/create-quiver/lib/git.js +154 -0
  108. package/src/create-quiver/lib/handoff.js +104 -0
  109. package/src/create-quiver/lib/init-docs.js +674 -0
  110. package/src/create-quiver/lib/json.js +14 -0
  111. package/src/create-quiver/lib/lifecycle.js +479 -0
  112. package/src/create-quiver/lib/paths.js +19 -0
  113. package/src/create-quiver/lib/readiness.js +354 -0
  114. package/src/create-quiver/lib/renderers/dot.js +129 -0
  115. package/src/create-quiver/lib/renderers/mermaid.js +119 -0
  116. package/src/create-quiver/lib/renderers/tree.js +116 -0
  117. package/src/create-quiver/lib/scope.js +5 -0
  118. package/src/create-quiver/lib/slice-graph.js +453 -0
  119. package/src/create-quiver/lib/slice.js +195 -0
  120. package/src/create-quiver/lib/state.js +139 -0
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "create-quiver",
3
- "version": "0.6.0",
3
+ "version": "0.8.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
9
  },
10
10
  "scripts": {
11
11
  "check:slice": "bash tools/scripts/check-slice-readiness.sh",
@@ -13,8 +13,12 @@
13
13
  "start:slice": "bash tools/scripts/start-slice.sh",
14
14
  "cleanup:slice": "bash tools/scripts/cleanup-slice.sh",
15
15
  "migrate": "bash tools/scripts/migrate-project.sh",
16
+ "quiver:plan": "npx create-quiver plan",
17
+ "quiver:graph": "npx create-quiver graph",
18
+ "quiver:next": "npx create-quiver next",
16
19
  "package:quiver": "bash scripts/package-quiver.sh",
17
20
  "smoke:create-quiver": "bash scripts/ci/smoke-create-quiver.sh",
21
+ "smoke:tiered-pack": "bash scripts/ci/smoke-tiered-pack.sh",
18
22
  "release:quiver": "bash scripts/release-quiver.sh"
19
23
  }
20
24
  }
@@ -2,10 +2,26 @@
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",
11
+ "quiver:start-slice": "npx create-quiver start-slice",
12
+ "quiver:check-slice": "npx create-quiver check-slice",
13
+ "quiver:check-pr": "npx create-quiver check-pr",
14
+ "quiver:check-handoff": "npx create-quiver check-handoff",
15
+ "quiver:cleanup-slice": "npx create-quiver cleanup-slice",
16
+ "quiver:check-scope": "npx create-quiver check-scope",
17
+ "quiver:refresh-active-slices": "npx create-quiver refresh-active-slices",
5
18
  "check:slice": "bash tools/scripts/check-slice-readiness.sh",
6
19
  "check:pr": "bash tools/scripts/check-pr-readiness.sh",
20
+ "check-handoff": "npx create-quiver check-handoff",
7
21
  "start:slice": "bash tools/scripts/start-slice.sh",
8
22
  "cleanup:slice": "bash tools/scripts/cleanup-slice.sh",
23
+ "check:scope": "bash tools/scripts/check-scope.sh",
24
+ "refresh:active-slices": "bash tools/scripts/refresh-active-slices.sh",
9
25
  "migrate": "bash tools/scripts/migrate-project.sh"
10
26
  }
11
27
  }
@@ -82,11 +82,12 @@ slice_rel="${slice_abs#$repo_root/}"
82
82
  slice_meta=()
83
83
  while IFS= read -r line; do
84
84
  slice_meta+=("$line")
85
- done < <(node - "$slice_abs" "$slice_rel" <<'NODE'
85
+ done < <(node - "$slice_abs" "$slice_rel" "$repo_root" <<'NODE'
86
86
  const fs = require('fs');
87
87
  const path = require('path');
88
88
 
89
- const [slicePath, sliceRel] = process.argv.slice(2);
89
+ const [slicePath, sliceRel, repoRoot] = process.argv.slice(2);
90
+ const { parseJsonWithComments } = require(path.join(repoRoot, 'src', 'create-quiver', 'lib', 'json'));
90
91
 
91
92
  function fail(message) {
92
93
  console.error(`Error: ${message}`);
@@ -95,7 +96,7 @@ function fail(message) {
95
96
 
96
97
  let json;
97
98
  try {
98
- json = JSON.parse(fs.readFileSync(slicePath, 'utf8'));
99
+ json = parseJsonWithComments(fs.readFileSync(slicePath, 'utf8'));
99
100
  } catch (error) {
100
101
  fail(`No se pudo parsear '${slicePath}' como JSON: ${error.message}`);
101
102
  }
@@ -175,6 +176,7 @@ const cp = require('child_process');
175
176
 
176
177
  const [repoRoot, currentBranch, currentFilesB64] = process.argv.slice(2);
177
178
  const currentFiles = JSON.parse(Buffer.from(currentFilesB64, 'base64').toString('utf8'));
179
+ const { parseJsonWithComments } = require(path.join(repoRoot, 'src', 'create-quiver', 'lib', 'json'));
178
180
 
179
181
  function run(cmd, cwd = repoRoot) {
180
182
  try {
@@ -201,7 +203,7 @@ function walkSlices(rootDir, acc) {
201
203
  }
202
204
 
203
205
  if (entry.isFile() && entry.name === 'slice.json' && fullPath.includes(`${path.sep}slices${path.sep}`)) {
204
- const json = JSON.parse(fs.readFileSync(fullPath, 'utf8'));
206
+ const json = parseJsonWithComments(fs.readFileSync(fullPath, 'utf8'));
205
207
  const branchName = json.git?.branch_name;
206
208
  if (!branchName) {
207
209
  continue;
@@ -2,176 +2,6 @@
2
2
 
3
3
  set -euo pipefail
4
4
 
5
- usage() {
6
- cat <<'EOF'
7
- Uso:
8
- bash tools/scripts/cleanup-slice.sh <ruta-al-slice.json> [--close-baseline] [--discard] [--force] [--dry-run]
9
-
10
- Politica:
11
- - slice-00: queda congelado por default; no se elimina salvo --close-baseline
12
- - slice-01+: se elimina despues de merge/rechazo/reemplazo segun la politica del repo
13
-
14
- Opciones:
15
- --close-baseline Permite cerrar y eliminar un slice-00 congelado
16
- --discard Permite cerrar un slice no mergeado (descartado/reemplazado)
17
- --force Fuerza git worktree remove --force y git branch -D
18
- --dry-run Solo informa que haria, no ejecuta cambios
19
- EOF
20
- }
21
-
22
- fail() {
23
- echo "FAIL: $1" >&2
24
- exit 1
25
- }
26
-
27
- pass() {
28
- echo "PASS: $1"
29
- }
30
-
31
- close_baseline="false"
32
- discard="false"
33
- force_delete="false"
34
- dry_run="false"
35
- slice_input=""
36
-
37
- while [[ $# -gt 0 ]]; do
38
- case "$1" in
39
- -h|--help)
40
- usage
41
- exit 0
42
- ;;
43
- --close-baseline)
44
- close_baseline="true"
45
- ;;
46
- --discard)
47
- discard="true"
48
- ;;
49
- --force)
50
- force_delete="true"
51
- ;;
52
- --dry-run)
53
- dry_run="true"
54
- ;;
55
- -*)
56
- fail "Opcion desconocida: $1"
57
- ;;
58
- *)
59
- if [[ -n "$slice_input" ]]; then
60
- fail "Solo se acepta un slice por ejecucion."
61
- fi
62
- slice_input="$1"
63
- ;;
64
- esac
65
- shift
66
- done
67
-
68
- [[ -n "$slice_input" ]] || {
69
- usage
70
- exit 1
71
- }
72
-
73
- command -v git >/dev/null 2>&1 || fail "git no esta disponible en PATH."
74
- command -v node >/dev/null 2>&1 || fail "node no esta disponible en PATH."
75
-
76
5
  repo_root="$(git rev-parse --show-toplevel)"
77
-
78
- [[ -f "$slice_input" ]] || fail "No existe el slice '$slice_input'."
79
-
80
- slice_abs="$(cd "$(dirname "$slice_input")" && pwd)/$(basename "$slice_input")"
81
-
82
- slice_meta=()
83
- while IFS= read -r line; do
84
- slice_meta+=("$line")
85
- done < <(node - "$slice_abs" "$repo_root" <<'NODE'
86
- const fs = require('fs');
87
- const path = require('path');
88
-
89
- const [slicePath, repoRoot] = process.argv.slice(2);
90
- const json = JSON.parse(fs.readFileSync(slicePath, 'utf8'));
91
-
92
- const branchName = String(json.git?.branch_name || '').trim();
93
- const sliceId = String(json.slice_id || '').trim();
94
- const isBaseline = sliceId.startsWith('slice-00');
95
- const repoName = path.basename(repoRoot);
96
- const repoParent = path.dirname(repoRoot);
97
- const worktreesRoot = process.env.SLICE_WORKTREES_DIR || path.join(repoParent, '.worktrees', repoName);
98
- const safeBranchName = branchName.replace(/[^A-Za-z0-9._-]/g, '-');
99
- const worktreePath = path.join(worktreesRoot, safeBranchName);
100
-
101
- console.log(branchName);
102
- console.log(sliceId);
103
- console.log(isBaseline ? 'true' : 'false');
104
- console.log(worktreePath);
105
- NODE
106
- )
107
-
108
- [[ ${#slice_meta[@]} -eq 4 ]] || fail "No se pudo leer la metadata de cleanup del slice."
109
-
110
- branch_name="${slice_meta[0]}"
111
- slice_id="${slice_meta[1]}"
112
- is_baseline="${slice_meta[2]}"
113
- worktree_path="${slice_meta[3]}"
114
-
115
- [[ -n "$branch_name" ]] || fail "Falta git.branch_name en el slice."
116
-
117
- if [[ "$is_baseline" == "true" && "$close_baseline" != "true" ]]; then
118
- echo "INFO: '$slice_id' es baseline. El worktree queda congelado por default."
119
- echo "INFO: Usa --close-baseline solo cuando la primera ola del spec ya este estable o mergeada."
120
- exit 0
121
- fi
122
-
123
- current_branch="$(git branch --show-current)"
124
-
125
- if [[ "$discard" != "true" ]]; then
126
- [[ "$current_branch" == "develop" ]] || fail "El cleanup normal debe correrse desde develop. Rama actual: $current_branch"
127
- [[ -z "$(git status --porcelain)" ]] || fail "El checkout actual no esta limpio. Limpialo antes del cleanup."
128
-
129
- git fetch origin develop >/dev/null 2>&1 || true
130
-
131
- local_develop_sha="$(git rev-parse HEAD)"
132
- remote_develop_sha="$(git rev-parse origin/develop)"
133
- [[ "$local_develop_sha" == "$remote_develop_sha" ]] || fail "develop local no esta actualizado. Ejecuta git pull --ff-only antes del cleanup."
134
-
135
- if git show-ref --verify --quiet "refs/heads/$branch_name"; then
136
- git merge-base --is-ancestor "$branch_name" "origin/develop" || fail "La rama '$branch_name' no esta mergeada en origin/develop. Usa --discard si el slice se descarta."
137
- fi
138
- fi
139
-
140
- worktree_exists="false"
141
- branch_exists="false"
142
-
143
- [[ -d "$worktree_path" ]] && worktree_exists="true"
144
- git show-ref --verify --quiet "refs/heads/$branch_name" && branch_exists="true"
145
-
146
- [[ "$worktree_exists" == "true" || "$branch_exists" == "true" ]] || fail "No existe worktree ni rama local para '$slice_id'."
147
-
148
- remove_worktree_cmd=(git worktree remove "$worktree_path")
149
- remove_branch_cmd=(git branch -d "$branch_name")
150
-
151
- if [[ "$force_delete" == "true" || "$discard" == "true" ]]; then
152
- remove_worktree_cmd=(git worktree remove --force "$worktree_path")
153
- remove_branch_cmd=(git branch -D "$branch_name")
154
- fi
155
-
156
- if [[ "$dry_run" == "true" ]]; then
157
- echo "DRY RUN: slice=$slice_id branch=$branch_name"
158
- [[ "$worktree_exists" == "true" ]] && echo "DRY RUN: ${remove_worktree_cmd[*]}"
159
- [[ "$branch_exists" == "true" ]] && echo "DRY RUN: ${remove_branch_cmd[*]}"
160
- exit 0
161
- fi
162
-
163
- if [[ "$worktree_exists" == "true" ]]; then
164
- "${remove_worktree_cmd[@]}"
165
- pass "Worktree eliminado: $worktree_path"
166
- fi
167
-
168
- if [[ "$branch_exists" == "true" ]]; then
169
- "${remove_branch_cmd[@]}"
170
- pass "Rama local eliminada: $branch_name"
171
- fi
172
-
173
- if [[ -x "$repo_root/tools/scripts/refresh-active-slices.sh" ]]; then
174
- "$repo_root/tools/scripts/refresh-active-slices.sh" >/dev/null 2>&1 || true
175
- fi
176
-
177
- pass "Cleanup finalizado para '$slice_id'."
6
+ cd "$repo_root"
7
+ exec npx create-quiver cleanup-slice "$@"
@@ -44,6 +44,22 @@ MIGRATE_MODE="${QUIVER_MIGRATE:-0}"
44
44
  DATE_PLUS_7=$(node -e 'const d = new Date(); d.setDate(d.getDate() + 7); const p = (n) => String(n).padStart(2, "0"); console.log(`${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())}`);')
45
45
  DATE_PLUS_30=$(node -e 'const d = new Date(); d.setDate(d.getDate() + 30); const p = (n) => String(n).padStart(2, "0"); console.log(`${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())}`);')
46
46
  DATE_PLUS_35=$(node -e 'const d = new Date(); d.setDate(d.getDate() + 35); const p = (n) => String(n).padStart(2, "0"); console.log(`${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())}`);')
47
+ PACKAGE_MANAGER="npm"
48
+ STACK_SUMMARY="unknown until analyze"
49
+ PRIMARY_INSTALL="npm install"
50
+ PRIMARY_DEV="npm run quiver:analyze"
51
+ PRIMARY_TEST="npm test"
52
+ ANALYZE_COMMAND="npx create-quiver analyze"
53
+ PLAN_COMMAND="npx create-quiver plan"
54
+ GRAPH_COMMAND="npx create-quiver graph"
55
+ NEXT_COMMAND="npx create-quiver next"
56
+ DOCTOR_COMMAND="npx create-quiver doctor"
57
+ START_SLICE_COMMAND="npx create-quiver start-slice <slice.json>"
58
+ CHECK_SLICE_COMMAND="npx create-quiver check-slice <slice.json>"
59
+ CHECK_PR_COMMAND="npx create-quiver check-pr <slice.json>"
60
+ CLEANUP_SLICE_COMMAND="npx create-quiver cleanup-slice <slice.json>"
61
+ CHECK_SCOPE_COMMAND="npx create-quiver check-scope <slice.json>"
62
+ REFRESH_ACTIVE_SLICES_COMMAND="npx create-quiver refresh-active-slices"
47
63
 
48
64
  print_info "Inicializando documentación para: $PROJECT_NAME"
49
65
  print_info "Project slug: $PROJECT_SLUG"
@@ -92,11 +108,24 @@ copy_template() {
92
108
  -e "s/{{FECHA}}/$CURRENT_DATE/g" \
93
109
  -e "s/{{FECHA_PROXIMA}}/$DATE_PLUS_7/g" \
94
110
  -e "s/{{FECHA_PROXIMA_MES}}/$DATE_PLUS_30/g" \
95
- -e "s/{{FECHA_LAUNCH}}/$DATE_PLUS_35/g" \
96
- -e "s/{{ESTADO}}/En planificación/g" \
97
- -e "s/{{FASE}}/Fase 1/g" \
98
- -e "s/{{X}}%/0%/g" \
99
- "$src" > "$dest"
111
+ -e "s/{{FECHA_LAUNCH}}/$DATE_PLUS_35/g" \
112
+ -e "s/{{ESTADO}}/En planificación/g" \
113
+ -e "s/{{FASE}}/Fase 1/g" \
114
+ -e "s/{{X}}%/0%/g" \
115
+ -e "s/{{PACKAGE_MANAGER}}/$PACKAGE_MANAGER/g" \
116
+ -e "s/{{STACK_SUMMARY}}/$STACK_SUMMARY/g" \
117
+ -e "s/{{PRIMARY_INSTALL}}/$PRIMARY_INSTALL/g" \
118
+ -e "s/{{PRIMARY_DEV}}/$PRIMARY_DEV/g" \
119
+ -e "s/{{PRIMARY_TEST}}/$PRIMARY_TEST/g" \
120
+ -e "s/{{ANALYZE_COMMAND}}/$ANALYZE_COMMAND/g" \
121
+ -e "s/{{DOCTOR_COMMAND}}/$DOCTOR_COMMAND/g" \
122
+ -e "s/{{START_SLICE_COMMAND}}/$START_SLICE_COMMAND/g" \
123
+ -e "s/{{CHECK_SLICE_COMMAND}}/$CHECK_SLICE_COMMAND/g" \
124
+ -e "s/{{CHECK_PR_COMMAND}}/$CHECK_PR_COMMAND/g" \
125
+ -e "s/{{CLEANUP_SLICE_COMMAND}}/$CLEANUP_SLICE_COMMAND/g" \
126
+ -e "s/{{CHECK_SCOPE_COMMAND}}/$CHECK_SCOPE_COMMAND/g" \
127
+ -e "s/{{REFRESH_ACTIVE_SLICES_COMMAND}}/$REFRESH_ACTIVE_SLICES_COMMAND/g" \
128
+ "$src" > "$dest"
100
129
 
101
130
  print_success "Creado: $dest"
102
131
  fi
@@ -107,7 +136,7 @@ copy_template_keep_name() {
107
136
  local dest="$2"
108
137
 
109
138
  if [ -f "$src" ]; then
110
- if [ "$MIGRATE_MODE" = "1" ] && [ -f "$dest" ]; then
139
+ if [ -f "$dest" ]; then
111
140
  print_info "Saltado: $dest ya existe"
112
141
  return 0
113
142
  fi
@@ -120,11 +149,24 @@ copy_template_keep_name() {
120
149
  -e "s/{{FECHA}}/$CURRENT_DATE/g" \
121
150
  -e "s/{{FECHA_PROXIMA}}/$DATE_PLUS_7/g" \
122
151
  -e "s/{{FECHA_PROXIMA_MES}}/$DATE_PLUS_30/g" \
123
- -e "s/{{FECHA_LAUNCH}}/$DATE_PLUS_35/g" \
124
- -e "s/{{ESTADO}}/En planificación/g" \
125
- -e "s/{{FASE}}/Fase 1/g" \
126
- -e "s/{{X}}%/0%/g" \
127
- "$src" > "$dest"
152
+ -e "s/{{FECHA_LAUNCH}}/$DATE_PLUS_35/g" \
153
+ -e "s/{{ESTADO}}/En planificación/g" \
154
+ -e "s/{{FASE}}/Fase 1/g" \
155
+ -e "s/{{X}}%/0%/g" \
156
+ -e "s/{{PACKAGE_MANAGER}}/$PACKAGE_MANAGER/g" \
157
+ -e "s/{{STACK_SUMMARY}}/$STACK_SUMMARY/g" \
158
+ -e "s/{{PRIMARY_INSTALL}}/$PRIMARY_INSTALL/g" \
159
+ -e "s/{{PRIMARY_DEV}}/$PRIMARY_DEV/g" \
160
+ -e "s/{{PRIMARY_TEST}}/$PRIMARY_TEST/g" \
161
+ -e "s/{{ANALYZE_COMMAND}}/$ANALYZE_COMMAND/g" \
162
+ -e "s/{{DOCTOR_COMMAND}}/$DOCTOR_COMMAND/g" \
163
+ -e "s/{{START_SLICE_COMMAND}}/$START_SLICE_COMMAND/g" \
164
+ -e "s/{{CHECK_SLICE_COMMAND}}/$CHECK_SLICE_COMMAND/g" \
165
+ -e "s/{{CHECK_PR_COMMAND}}/$CHECK_PR_COMMAND/g" \
166
+ -e "s/{{CLEANUP_SLICE_COMMAND}}/$CLEANUP_SLICE_COMMAND/g" \
167
+ -e "s/{{CHECK_SCOPE_COMMAND}}/$CHECK_SCOPE_COMMAND/g" \
168
+ -e "s/{{REFRESH_ACTIVE_SLICES_COMMAND}}/$REFRESH_ACTIVE_SLICES_COMMAND/g" \
169
+ "$src" > "$dest"
128
170
 
129
171
  print_success "Creado: $dest"
130
172
  fi
@@ -151,9 +193,19 @@ copy_file_if_missing() {
151
193
  }
152
194
 
153
195
  # Copiar templates de docs/
196
+ copy_template_keep_name "docs-template/AGENTS.md.template" "AGENTS.md"
154
197
  copy_template "docs-template/docs/INDEX.md.template" "docs/INDEX.md"
198
+ copy_template "docs-template/docs/COMMANDS.md.template" "docs/COMMANDS.md"
199
+ copy_template "docs-template/docs/QUICK.md.template" "docs/ai/QUICK.md"
200
+ copy_template "docs-template/docs/STANDARD.md.template" "docs/ai/STANDARD.md"
201
+ copy_template "docs-template/docs/DEEP.md.template" "docs/ai/DEEP.md"
202
+ copy_template "docs-template/docs/examples/plan.md.template" "docs/examples/plan.md"
203
+ copy_template "docs-template/docs/examples/graph.md.template" "docs/examples/graph.md"
204
+ copy_template "docs-template/docs/examples/next.md.template" "docs/examples/next.md"
205
+ copy_template "docs-template/docs/DECISIONS.md.template" "docs/DECISIONS.md"
155
206
  copy_template "docs-template/docs/AI_CONTEXT.md.template" "docs/AI_CONTEXT.md"
156
207
  copy_template "docs-template/docs/AI_ONBOARDING_PROMPT.md.template" "docs/AI_ONBOARDING_PROMPT.md"
208
+ copy_template "docs-template/specs/[project-name]/HANDOFF.md.template" "specs/$PROJECT_SLUG/HANDOFF.md"
157
209
  copy_template "docs-template/docs/CONTEXTO.md.template" "docs/CONTEXTO.md"
158
210
  copy_template "docs-template/docs/STATUS.md.template" "docs/STATUS.md"
159
211
  copy_template "docs-template/docs/WORKFLOW.md.template" "docs/WORKFLOW.md"
@@ -403,7 +455,7 @@ cat > "docs/SEARCH.md" << EOF
403
455
 
404
456
  - **Spec:** \`../specs/$PROJECT_SLUG/slices/slice-01/slice.json\`
405
457
  - **PR del slice:** \`../specs/$PROJECT_SLUG/slices/slice-01/pr.md\`
406
- - **Bootstrap del slice:** \`../tools/scripts/start-slice.sh ../specs/$PROJECT_SLUG/slices/slice-01/slice.json\`
458
+ - **Bootstrap del slice:** \`npx create-quiver start-slice ../specs/$PROJECT_SLUG/slices/slice-01/slice.json\`
407
459
  - **Hook:** \`hooks/useAuth.ts\`
408
460
  - **API:** \`docs/api/auth/README.md\`
409
461
  - **Componentes:** \`app/(auth)/\`
@@ -444,8 +496,11 @@ Run Quiver from this project root. Do not install it globally.
444
496
 
445
497
  \`\`\`bash
446
498
  npm install
447
- npx create-quiver analyze --dir .
448
- npx create-quiver doctor --dir .
499
+ $ANALYZE_COMMAND
500
+ $PLAN_COMMAND
501
+ $GRAPH_COMMAND
502
+ $DOCTOR_COMMAND
503
+ $NEXT_COMMAND
449
504
  \`\`\`
450
505
 
451
506
  If this project needs a pinned Quiver version, install it as a devDependency:
@@ -454,7 +509,39 @@ If this project needs a pinned Quiver version, install it as a devDependency:
454
509
  npm install --save-dev create-quiver
455
510
  \`\`\`
456
511
 
457
- If your project path contains spaces, quote it explicitly when using \`--dir\`.
512
+ If you need to target another directory from outside the project, pass \`--dir\` explicitly. Quote paths that contain spaces.
513
+
514
+ ## Project NPM Scripts
515
+
516
+ The generated project includes \`quiver:*\` npm scripts that call the Node CLI and are the preferred repeatable workflow:
517
+
518
+ \`\`\`bash
519
+ npm run quiver:analyze
520
+ npm run quiver:plan
521
+ npm run quiver:graph
522
+ npm run quiver:next
523
+ npm run quiver:doctor
524
+ npm run quiver:migrate
525
+ npm run quiver:start-slice -- specs/$PROJECT_SLUG/slices/slice-01/slice.json
526
+ npm run quiver:check-slice -- specs/$PROJECT_SLUG/slices/slice-01/slice.json
527
+ npm run quiver:check-pr -- specs/$PROJECT_SLUG/slices/slice-01/slice.json
528
+ npm run quiver:check-handoff -- specs/$PROJECT_SLUG/HANDOFF.md
529
+ npm run quiver:cleanup-slice -- specs/$PROJECT_SLUG/slices/slice-01/slice.json
530
+ npm run quiver:check-scope -- specs/$PROJECT_SLUG/slices/slice-01/slice.json
531
+ npm run quiver:refresh-active-slices
532
+ \`\`\`
533
+
534
+ 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
+ The \`quiver:next\` script points to the next ready slice and can auto-start it behind a confirmation prompt.
536
+ Use \`npx create-quiver next --all-ready\` when you want the full ready level instead of a single suggestion.
537
+ 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
+ \`npm run check-handoff -- specs/$PROJECT_SLUG/HANDOFF.md\` is available as a legacy-friendly alias for the handoff validator.
539
+ If a new bounded transfer is needed, scaffold \`specs/$PROJECT_SLUG/HANDOFF.md\` with \`npx create-quiver new-handoff $PROJECT_SLUG\` and validate it with \`npx create-quiver check-handoff specs/$PROJECT_SLUG/HANDOFF.md\`.
540
+ For exceptional context transfers between agents or phases, a dedicated \`HANDOFF.md\` can live alongside the usual spec and docs files.
541
+
542
+ ## Cross-Platform Support
543
+
544
+ Quiver is targeting native support on macOS, Linux, and Windows PowerShell/CMD. Bash is a legacy compatibility path until the runtime slices land, so the generated workflow should be read as a native Node-first contract rather than a Bash-first one. Windows support is only considered verified once the CI matrix is green.
458
545
 
459
546
  ## Upgrading Existing Projects
460
547
 
@@ -462,22 +549,41 @@ If the project already existed before this Quiver version, upgrade it from the p
462
549
 
463
550
  \`\`\`bash
464
551
  cd /path/to/your-project
465
- npx create-quiver migrate --dir .
466
- npx create-quiver analyze --dir .
467
- npx create-quiver doctor --dir .
552
+ npx create-quiver migrate
553
+ $ANALYZE_COMMAND
554
+ $PLAN_COMMAND
555
+ $GRAPH_COMMAND
556
+ $NEXT_COMMAND
557
+ $DOCTOR_COMMAND
558
+ \`\`\`
559
+
560
+ Use \`$GRAPH_COMMAND --format mermaid\` for GitHub-friendly graph embeds or \`$GRAPH_COMMAND --format dot\` for Graphviz pipelines.
561
+
562
+ Exportable graph formats are available when you need a PR-ready Mermaid block or Graphviz source:
563
+
564
+ \`\`\`bash
565
+ $GRAPH_COMMAND --format mermaid
566
+ $GRAPH_COMMAND --format dot
468
567
  \`\`\`
469
568
 
470
569
  If your team prefers a pinned local dependency, update the package first and then run the same flow:
471
570
 
472
571
  \`\`\`bash
473
572
  npm install --save-dev create-quiver@latest
474
- npx create-quiver migrate --dir .
475
- npx create-quiver analyze --dir .
476
- npx create-quiver doctor --dir .
573
+ npx create-quiver migrate
574
+ npx create-quiver analyze
575
+ npx create-quiver plan
576
+ npx create-quiver graph
577
+ npx create-quiver next
578
+ npx create-quiver doctor
477
579
  \`\`\`
478
580
 
581
+ The tree output remains the default, but Mermaid and DOT are available on demand for exported docs and slide decks.
582
+
479
583
  ## AI Context Onboarding
480
584
 
585
+ Lee \`AGENTS.md\` primero y después \`docs/AI_ONBOARDING_PROMPT.md\` tras el análisis.
586
+
481
587
  After analysis and doctor validation, open your AI agent in this project and run:
482
588
 
483
589
  \`\`\`text
@@ -487,27 +593,42 @@ Prepare the project context docs and report assumptions, risks, and files change
487
593
  \`\`\`
488
594
 
489
595
  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.
596
+ If the work was explicitly transferred through a handoff artifact, read \`specs/$PROJECT_SLUG/HANDOFF.md\` before implementation.
597
+
598
+ ## Decision Log
599
+
600
+ Record durable decisions in \`docs/DECISIONS.md\` so future AI agents do not re-litigate the same choices.
490
601
 
491
602
  ## First Slice Workflow
492
603
 
493
604
  1. Review or refine specs/$PROJECT_SLUG/SPEC.md.
494
605
  2. Create the first slice from specs/$PROJECT_SLUG/slices/slice-template/slice.json.
495
- 3. Start work with tools/scripts/start-slice.sh <slice.json>.
496
- 4. Make one commit per slice.
497
- 5. Open one PR per spec.
606
+ 3. Review the plan with \`$PLAN_COMMAND\` or \`npm run quiver:plan\`.
607
+ 4. Inspect the graph with \`$GRAPH_COMMAND\` or \`npm run quiver:graph\`.
608
+ 5. Check the next ready slice with \`$NEXT_COMMAND\` or \`npm run quiver:next\`.
609
+ 6. Start work with \`$START_SLICE_COMMAND\` or \`npm run quiver:start-slice -- <slice.json>\`.
610
+ 7. Make one commit per slice.
611
+ 8. Open one PR per spec.
498
612
 
499
613
  ## Verification Checklist
500
614
 
501
615
  - [ ] npm install completes
502
- - [ ] npx create-quiver analyze --dir . completes
503
- - [ ] npx create-quiver doctor --dir . completes
616
+ - [ ] $ANALYZE_COMMAND completes
617
+ - [ ] $PLAN_COMMAND completes
618
+ - [ ] $GRAPH_COMMAND completes
619
+ - [ ] $NEXT_COMMAND completes
620
+ - [ ] $DOCTOR_COMMAND completes
504
621
  - [ ] AI agent executed docs/AI_ONBOARDING_PROMPT.md
505
622
  - [ ] Context docs were reviewed before the first slice
506
623
 
507
624
  ## Documentation
508
625
 
509
626
  - [AI Context](./docs/AI_CONTEXT.md) - Contexto resumido para IA
627
+ - [Decision Log](./docs/DECISIONS.md) - Decisiones durables del proyecto
510
628
  - [AI Onboarding Prompt](./docs/AI_ONBOARDING_PROMPT.md) - Handoff exacto para agentes después del análisis
629
+ - [Handoff](./specs/$PROJECT_SLUG/HANDOFF.md) - Transferencia excepcional entre agentes o fases
630
+ - [Check Handoff](./docs/WORKFLOW.md) - Valida el handoff con \`npx create-quiver check-handoff\`
631
+ - [Commands](./docs/COMMANDS.md) - Tabla canónica de comandos de orquestación
511
632
  - [Contexto](./docs/CONTEXTO.md) - Qué es $PROJECT_NAME
512
633
  - [Workflow](./docs/WORKFLOW.md) - Cómo implementar
513
634
  - [Support Matrix](./docs/SUPPORT_MATRIX.md) - Qué entornos están soportados
@@ -58,6 +58,11 @@ required_paths=(
58
58
  "package/src/create-quiver/index.js"
59
59
  "package/README.md"
60
60
  "package/README_FOR_AI.md"
61
+ "package/AGENTS.md.template"
62
+ "package/docs/QUICK.md.template"
63
+ "package/docs/STANDARD.md.template"
64
+ "package/docs/DEEP.md.template"
65
+ "package/docs/DECISIONS.md.template"
61
66
  "package/docs/AI_CONTEXT.md.template"
62
67
  "package/docs/AI_ONBOARDING_PROMPT.md.template"
63
68
  "package/TEMPLATE.md"