create-quiver 0.6.0 → 0.7.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.
- package/.github/workflows/ci.yml +7 -30
- package/AGENTS.md.template +41 -0
- package/CHANGELOG.md +5 -0
- package/README.md +37 -13
- package/README_FOR_AI.md +27 -7
- package/ROADMAP.md +78 -0
- package/docs/AI_CONTEXT.md.template +19 -26
- package/docs/AI_ONBOARDING_PROMPT.md.template +12 -0
- package/docs/CONTEXTO.md.template +4 -17
- package/docs/DECISIONS.md.template +18 -0
- package/docs/DEEP.md.template +34 -0
- package/docs/DOCUMENTATION_GUIDE.md.template +9 -7
- package/docs/GITFLOW_PR_GUIDE.md.template +7 -0
- package/docs/INDEX.md.template +9 -0
- package/docs/QUICK.md.template +27 -0
- package/docs/STANDARD.md.template +49 -0
- package/docs/STATUS.md.template +2 -2
- package/docs/SUPPORT_MATRIX.md.template +7 -4
- package/docs/TESTING_GUIDE_FOR_AI.md.template +4 -3
- package/docs/TROUBLESHOOTING.md.template +14 -0
- package/docs/WORKFLOW.md.template +17 -4
- package/package.json +2 -1
- package/package.template.json +11 -0
- package/scripts/cleanup-slice.sh +2 -172
- package/scripts/init-docs.sh +97 -24
- package/scripts/package-quiver.sh +5 -0
- package/scripts/start-slice.sh +3 -425
- package/specs/[project-name]/EVIDENCE_REPORT.md.template +3 -1
- package/specs/[project-name]/slices/slice-template/slice.json +2 -2
- package/specs/quiver-v12-cross-platform-native-runtime/EVIDENCE_REPORT.md +30 -0
- package/specs/quiver-v12-cross-platform-native-runtime/SPEC.md +86 -0
- package/specs/quiver-v12-cross-platform-native-runtime/STATUS.md +29 -0
- package/specs/quiver-v12-cross-platform-native-runtime/slices/slice-01-cross-platform-support-contract/slice.json +69 -0
- package/specs/quiver-v12-cross-platform-native-runtime/slices/slice-02-node-init-docs-runtime/slice.json +76 -0
- package/specs/quiver-v12-cross-platform-native-runtime/slices/slice-03-node-migrate-analyze-doctor-flow/slice.json +74 -0
- package/specs/quiver-v12-cross-platform-native-runtime/slices/slice-04-node-slice-lifecycle-commands/slice.json +81 -0
- package/specs/quiver-v12-cross-platform-native-runtime/slices/slice-05-generated-project-scripts-and-migration/slice.json +78 -0
- package/specs/quiver-v12-cross-platform-native-runtime/slices/slice-06-cross-platform-ci-release-readiness/slice.json +74 -0
- package/specs/quiver-v13-token-efficient-ai-context/EVIDENCE_REPORT.md +28 -0
- package/specs/quiver-v13-token-efficient-ai-context/SPEC.md +68 -0
- package/specs/quiver-v13-token-efficient-ai-context/STATUS.md +26 -0
- package/specs/quiver-v13-token-efficient-ai-context/slices/slice-01-token-efficient-ai-modes-guidance/slice.json +65 -0
- package/specs/quiver-v13-token-efficient-ai-context/slices/slice-02-decision-log-context-checkpoint/slice.json +64 -0
- package/specs/quiver-v13-token-efficient-ai-context/slices/slice-03-project-map-reading-order/slice.json +66 -0
- package/specs/quiver-v14-tiered-context-pack/EVIDENCE_REPORT.md +42 -0
- package/specs/quiver-v14-tiered-context-pack/SPEC.md +116 -0
- package/specs/quiver-v14-tiered-context-pack/STATUS.md +35 -0
- package/specs/quiver-v14-tiered-context-pack/slices/slice-01-tiered-context-pack/slice.json +77 -0
- package/specs/quiver-v14-tiered-context-pack/slices/slice-02-agents-md-router/slice.json +74 -0
- package/specs/quiver-v14-tiered-context-pack/slices/slice-03-active-slice-lifecycle/slice.json +74 -0
- package/specs/quiver-v14-tiered-context-pack/slices/slice-04-dedup-frontmatter/slice.json +83 -0
- package/specs/quiver-v14-tiered-context-pack/slices/slice-05-doctor-smokes-tiered-pack/slice.json +84 -0
- package/src/create-quiver/index.js +299 -123
- package/src/create-quiver/lib/analyze.js +9 -0
- package/src/create-quiver/lib/doctor.js +212 -0
- package/src/create-quiver/lib/git.js +154 -0
- package/src/create-quiver/lib/init-docs.js +616 -0
- package/src/create-quiver/lib/lifecycle.js +478 -0
- package/src/create-quiver/lib/paths.js +19 -0
- package/src/create-quiver/lib/readiness.js +300 -0
- package/src/create-quiver/lib/scope.js +5 -0
- package/src/create-quiver/lib/slice.js +194 -0
- package/src/create-quiver/lib/state.js +89 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# {{PROJECT_NAME}} Standard Context
|
|
2
|
+
|
|
3
|
+
**Date:** {{FECHA}}
|
|
4
|
+
**Status:** {{ESTADO}}
|
|
5
|
+
|
|
6
|
+
This is the default context pack for everyday AI work.
|
|
7
|
+
|
|
8
|
+
## Reading Order
|
|
9
|
+
|
|
10
|
+
1. `./QUICK.md`
|
|
11
|
+
2. `docs/PROJECT_MAP.md`
|
|
12
|
+
3. `docs/AI_CONTEXT.md`
|
|
13
|
+
4. `docs/DECISIONS.md`
|
|
14
|
+
5. `docs/CONTEXTO.md`
|
|
15
|
+
6. `docs/WORKFLOW.md`
|
|
16
|
+
|
|
17
|
+
## Conventions
|
|
18
|
+
|
|
19
|
+
- Use maps, metadata, and diffs before opening full source files.
|
|
20
|
+
- Keep scope inside the active slice.
|
|
21
|
+
- Make one commit per slice.
|
|
22
|
+
- Open one PR per spec.
|
|
23
|
+
- Record durable decisions in `docs/DECISIONS.md`.
|
|
24
|
+
- Treat `docs/PROJECT_MAP.md` as the single source of truth for stack, package manager, and command references.
|
|
25
|
+
|
|
26
|
+
## Workflow Overview
|
|
27
|
+
|
|
28
|
+
- Onboarding starts from `docs/PROJECT_SCAN.json` and `docs/PROJECT_MAP.md`.
|
|
29
|
+
- Implementation starts from `specs/{{PROJECT_SLUG}}/slices/<slice-id>/slice.json`.
|
|
30
|
+
- Review starts from `git diff` and the slice scope.
|
|
31
|
+
- Debugging starts from the command, exit code, first relevant error, and stacktrace.
|
|
32
|
+
|
|
33
|
+
## Testing Expectations
|
|
34
|
+
|
|
35
|
+
- Validate the active slice before merging.
|
|
36
|
+
- Prefer focused smoke tests over large manual walkthroughs.
|
|
37
|
+
- Preserve existing user-authored content during migration.
|
|
38
|
+
- Keep secret-safe paths and generated heavy folders out of the read path.
|
|
39
|
+
|
|
40
|
+
## V13 Mode Guidance
|
|
41
|
+
|
|
42
|
+
- Onboarding: read maps and metadata first.
|
|
43
|
+
- Implementation: read `slice.json` and declared files first.
|
|
44
|
+
- Review: inspect `git diff` before full files.
|
|
45
|
+
- Debug: inspect the error signal before long logs.
|
|
46
|
+
|
|
47
|
+
## Read Next
|
|
48
|
+
|
|
49
|
+
- `./DEEP.md`
|
package/docs/STATUS.md.template
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# {{PROJECT_NAME}} Status
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
**Next update:** {{FECHA_PROXIMA}}
|
|
3
|
+
This page tracks progress, blockers, and the current slice. Stack and command details live in `docs/PROJECT_MAP.md`.
|
|
5
4
|
|
|
6
5
|
## Overall Status
|
|
7
6
|
|
|
@@ -24,3 +23,4 @@
|
|
|
24
23
|
## Notes
|
|
25
24
|
|
|
26
25
|
- Update this file after each completed slice.
|
|
26
|
+
- Keep stack and command changes in `docs/PROJECT_MAP.md`, not here.
|
|
@@ -9,9 +9,10 @@ Quiver is intentionally opinionated about the first-run environment. If your set
|
|
|
9
9
|
|
|
10
10
|
| Area | Supported | Notes |
|
|
11
11
|
|------|-----------|-------|
|
|
12
|
-
| Operating systems | macOS and
|
|
13
|
-
|
|
|
14
|
-
|
|
|
12
|
+
| Operating systems | macOS, Linux, and Windows | Windows native support is verified only when the cross-platform CI matrix is green. |
|
|
13
|
+
| Shells | Terminal, bash-compatible shells, PowerShell, and CMD | Bash is a legacy compatibility path, not a required runtime dependency. |
|
|
14
|
+
| Git | Git 2.40+ | Must support worktrees and standard branch refs on every supported OS. |
|
|
15
|
+
| Node.js | Node 22.x LTS | Required on every supported OS. |
|
|
15
16
|
| Base branches | `develop` or `main` | Local base branches are preferred; `origin` is optional. |
|
|
16
17
|
| Worktree state | Clean worktree | Slice execution and PR checks expect no unrelated local changes. |
|
|
17
18
|
| Path handling | Canonical filesystem paths | Use the physical path to the repo and slice files, not a symlinked alias. |
|
|
@@ -26,6 +27,8 @@ Quiver is intentionally opinionated about the first-run environment. If your set
|
|
|
26
27
|
|
|
27
28
|
## What This Means
|
|
28
29
|
|
|
29
|
-
- You can bootstrap
|
|
30
|
+
- You can bootstrap and run Quiver on macOS, Linux, and Windows native shells once the runtime slices land and the CI matrix is green.
|
|
31
|
+
- Windows native usage should target PowerShell or CMD instead of Bash.
|
|
32
|
+
- Quiver should not auto-install Bash, Git Bash, MSYS2, or WSL.
|
|
30
33
|
- You do not need a remote to begin work if a local base branch already exists.
|
|
31
34
|
- If the environment is outside the matrix, fix the machine first instead of working around the scripts.
|
|
@@ -31,9 +31,10 @@
|
|
|
31
31
|
|
|
32
32
|
## Evidence
|
|
33
33
|
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
34
|
+
- Prefer summarized command evidence over pasted long logs.
|
|
35
|
+
- Capture the command, exit code, first relevant error, and stacktrace when available.
|
|
36
|
+
- Record the log path or artifact path instead of dumping full logs inline.
|
|
37
|
+
- Use screenshots or diff output only when they are the smallest useful proof.
|
|
37
38
|
|
|
38
39
|
## If Something Fails
|
|
39
40
|
|
|
@@ -68,3 +68,17 @@ Use this guide when a first-run bootstrap or gate check fails. The recovery path
|
|
|
68
68
|
1. Commit or stash unrelated changes first.
|
|
69
69
|
2. Re-run the gate from the slice branch.
|
|
70
70
|
3. Make sure the PR body lives in `pr.md` beside the slice.
|
|
71
|
+
|
|
72
|
+
## Windows Shell Fallback
|
|
73
|
+
|
|
74
|
+
### Symptom
|
|
75
|
+
|
|
76
|
+
- You are on Windows and the cross-platform runtime is not yet verified by CI
|
|
77
|
+
- A command expects a Bash-compatible shell before the cross-platform port is complete
|
|
78
|
+
|
|
79
|
+
### Recovery
|
|
80
|
+
|
|
81
|
+
1. Prefer PowerShell or CMD once the native runtime slices and CI matrix are complete.
|
|
82
|
+
2. If you are using an intermediate build and need a temporary bridge, use WSL2 or Git Bash manually.
|
|
83
|
+
3. Do not expect Quiver to install Bash, WSL, or MSYS2 for you.
|
|
84
|
+
4. Re-run the command after the cross-platform support slices are merged and the CI matrix is green.
|
|
@@ -17,6 +17,15 @@ This document is the canonical implementation workflow for the project.
|
|
|
17
17
|
- The troubleshooting guide explains the first-run recovery paths for common bootstrap failures.
|
|
18
18
|
- The AI onboarding prompt generated after analysis is the handoff for agents that need project context before editing.
|
|
19
19
|
|
|
20
|
+
## Mode-Aware Context Selection
|
|
21
|
+
|
|
22
|
+
- **Onboarding:** read `PROJECT_SCAN.json`, `PROJECT_MAP.md`, `AI_CONTEXT.md`, and `AI_ONBOARDING_PROMPT.md` before source files.
|
|
23
|
+
- **Implementation:** read `docs/ai/ACTIVE_SLICE.md` first when it exists; otherwise read `slice.json`, declared files, nearby tests, and only then adjacent source.
|
|
24
|
+
- **Review:** read `git diff` and the slice scope before opening full files.
|
|
25
|
+
- **Debug:** read the command, exit code, first relevant error, stacktrace, and nearest changed code before long logs.
|
|
26
|
+
|
|
27
|
+
Use maps, metadata, diffs, and summaries first. Open full files only when the smaller context is not enough.
|
|
28
|
+
|
|
20
29
|
## Planning
|
|
21
30
|
|
|
22
31
|
1. Triage the request.
|
|
@@ -27,21 +36,25 @@ This document is the canonical implementation workflow for the project.
|
|
|
27
36
|
6. Read the AI context pack, support matrix, and troubleshooting guide before the first slice if the environment is new or uncertain.
|
|
28
37
|
7. If the project already existed before this Quiver version, run `migrate` before `analyze`.
|
|
29
38
|
8. If the project was analyzed, read `AI_ONBOARDING_PROMPT.md` before making documentation updates.
|
|
39
|
+
9. Prefer the generated `quiver:*` npm scripts for repeatable project workflows once the package has been initialized or migrated.
|
|
30
40
|
|
|
31
41
|
## Execution
|
|
32
42
|
|
|
33
|
-
1. Bootstrap the slice with `start-slice.
|
|
43
|
+
1. Bootstrap the slice with `npx create-quiver start-slice <slice.json>` or `npm run quiver:start-slice -- <slice.json>`.
|
|
34
44
|
- The bootstrap step should work with canonical paths and a local base branch when `origin` is absent.
|
|
35
|
-
- Draft slices require `--allow-draft`; otherwise `start-slice
|
|
45
|
+
- Draft slices require `--allow-draft`; otherwise `npx create-quiver start-slice` exits before execution.
|
|
46
|
+
- Legacy Bash wrappers remain available for compatibility, but generated projects should prefer the Node CLI and `quiver:*` npm scripts.
|
|
47
|
+
- `start-slice` generates `docs/ai/ACTIVE_SLICE.md` and `WORKTREE_CONTEXT.md`; use the active slice brief as the source of truth for execution.
|
|
36
48
|
2. Implement only what the slice declares.
|
|
37
49
|
3. Make one commit for that slice.
|
|
38
|
-
4. Validate with `check-slice-
|
|
50
|
+
4. Validate with `npx create-quiver check-slice <slice.json>` or `npm run quiver:check-slice -- <slice.json>`.
|
|
39
51
|
5. Write evidence.
|
|
40
52
|
6. Repeat for the next slice until the spec is complete.
|
|
41
|
-
7. Open one PR for the spec and use `check-pr
|
|
53
|
+
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.
|
|
42
54
|
|
|
43
55
|
## Support Contract
|
|
44
56
|
|
|
57
|
+
- `docs/PROJECT_MAP.md` is the source of truth for stack, package manager, and commands.
|
|
45
58
|
- Support Matrix (`SUPPORT_MATRIX.md`) documents what is supported.
|
|
46
59
|
- AI Context Pack (`AI_CONTEXT.md`) gives the agent-first project snapshot.
|
|
47
60
|
- Troubleshooting (`TROUBLESHOOTING.md`) documents how to recover when the first run fails.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-quiver",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Quiver CLI for scaffolding projects from the packaged template",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"migrate": "bash tools/scripts/migrate-project.sh",
|
|
16
16
|
"package:quiver": "bash scripts/package-quiver.sh",
|
|
17
17
|
"smoke:create-quiver": "bash scripts/ci/smoke-create-quiver.sh",
|
|
18
|
+
"smoke:tiered-pack": "bash scripts/ci/smoke-tiered-pack.sh",
|
|
18
19
|
"release:quiver": "bash scripts/release-quiver.sh"
|
|
19
20
|
}
|
|
20
21
|
}
|
package/package.template.json
CHANGED
|
@@ -2,10 +2,21 @@
|
|
|
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:doctor": "npx create-quiver doctor",
|
|
8
|
+
"quiver:start-slice": "npx create-quiver start-slice",
|
|
9
|
+
"quiver:check-slice": "npx create-quiver check-slice",
|
|
10
|
+
"quiver:check-pr": "npx create-quiver check-pr",
|
|
11
|
+
"quiver:cleanup-slice": "npx create-quiver cleanup-slice",
|
|
12
|
+
"quiver:check-scope": "npx create-quiver check-scope",
|
|
13
|
+
"quiver:refresh-active-slices": "npx create-quiver refresh-active-slices",
|
|
5
14
|
"check:slice": "bash tools/scripts/check-slice-readiness.sh",
|
|
6
15
|
"check:pr": "bash tools/scripts/check-pr-readiness.sh",
|
|
7
16
|
"start:slice": "bash tools/scripts/start-slice.sh",
|
|
8
17
|
"cleanup:slice": "bash tools/scripts/cleanup-slice.sh",
|
|
18
|
+
"check:scope": "bash tools/scripts/check-scope.sh",
|
|
19
|
+
"refresh:active-slices": "bash tools/scripts/refresh-active-slices.sh",
|
|
9
20
|
"migrate": "bash tools/scripts/migrate-project.sh"
|
|
10
21
|
}
|
|
11
22
|
}
|
package/scripts/cleanup-slice.sh
CHANGED
|
@@ -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
|
-
|
|
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 "$@"
|
package/scripts/init-docs.sh
CHANGED
|
@@ -44,6 +44,19 @@ 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
|
+
DOCTOR_COMMAND="npx create-quiver doctor"
|
|
54
|
+
START_SLICE_COMMAND="npx create-quiver start-slice <slice.json>"
|
|
55
|
+
CHECK_SLICE_COMMAND="npx create-quiver check-slice <slice.json>"
|
|
56
|
+
CHECK_PR_COMMAND="npx create-quiver check-pr <slice.json>"
|
|
57
|
+
CLEANUP_SLICE_COMMAND="npx create-quiver cleanup-slice <slice.json>"
|
|
58
|
+
CHECK_SCOPE_COMMAND="npx create-quiver check-scope <slice.json>"
|
|
59
|
+
REFRESH_ACTIVE_SLICES_COMMAND="npx create-quiver refresh-active-slices"
|
|
47
60
|
|
|
48
61
|
print_info "Inicializando documentación para: $PROJECT_NAME"
|
|
49
62
|
print_info "Project slug: $PROJECT_SLUG"
|
|
@@ -92,11 +105,24 @@ copy_template() {
|
|
|
92
105
|
-e "s/{{FECHA}}/$CURRENT_DATE/g" \
|
|
93
106
|
-e "s/{{FECHA_PROXIMA}}/$DATE_PLUS_7/g" \
|
|
94
107
|
-e "s/{{FECHA_PROXIMA_MES}}/$DATE_PLUS_30/g" \
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
108
|
+
-e "s/{{FECHA_LAUNCH}}/$DATE_PLUS_35/g" \
|
|
109
|
+
-e "s/{{ESTADO}}/En planificación/g" \
|
|
110
|
+
-e "s/{{FASE}}/Fase 1/g" \
|
|
111
|
+
-e "s/{{X}}%/0%/g" \
|
|
112
|
+
-e "s/{{PACKAGE_MANAGER}}/$PACKAGE_MANAGER/g" \
|
|
113
|
+
-e "s/{{STACK_SUMMARY}}/$STACK_SUMMARY/g" \
|
|
114
|
+
-e "s/{{PRIMARY_INSTALL}}/$PRIMARY_INSTALL/g" \
|
|
115
|
+
-e "s/{{PRIMARY_DEV}}/$PRIMARY_DEV/g" \
|
|
116
|
+
-e "s/{{PRIMARY_TEST}}/$PRIMARY_TEST/g" \
|
|
117
|
+
-e "s/{{ANALYZE_COMMAND}}/$ANALYZE_COMMAND/g" \
|
|
118
|
+
-e "s/{{DOCTOR_COMMAND}}/$DOCTOR_COMMAND/g" \
|
|
119
|
+
-e "s/{{START_SLICE_COMMAND}}/$START_SLICE_COMMAND/g" \
|
|
120
|
+
-e "s/{{CHECK_SLICE_COMMAND}}/$CHECK_SLICE_COMMAND/g" \
|
|
121
|
+
-e "s/{{CHECK_PR_COMMAND}}/$CHECK_PR_COMMAND/g" \
|
|
122
|
+
-e "s/{{CLEANUP_SLICE_COMMAND}}/$CLEANUP_SLICE_COMMAND/g" \
|
|
123
|
+
-e "s/{{CHECK_SCOPE_COMMAND}}/$CHECK_SCOPE_COMMAND/g" \
|
|
124
|
+
-e "s/{{REFRESH_ACTIVE_SLICES_COMMAND}}/$REFRESH_ACTIVE_SLICES_COMMAND/g" \
|
|
125
|
+
"$src" > "$dest"
|
|
100
126
|
|
|
101
127
|
print_success "Creado: $dest"
|
|
102
128
|
fi
|
|
@@ -107,7 +133,7 @@ copy_template_keep_name() {
|
|
|
107
133
|
local dest="$2"
|
|
108
134
|
|
|
109
135
|
if [ -f "$src" ]; then
|
|
110
|
-
if [
|
|
136
|
+
if [ -f "$dest" ]; then
|
|
111
137
|
print_info "Saltado: $dest ya existe"
|
|
112
138
|
return 0
|
|
113
139
|
fi
|
|
@@ -120,11 +146,24 @@ copy_template_keep_name() {
|
|
|
120
146
|
-e "s/{{FECHA}}/$CURRENT_DATE/g" \
|
|
121
147
|
-e "s/{{FECHA_PROXIMA}}/$DATE_PLUS_7/g" \
|
|
122
148
|
-e "s/{{FECHA_PROXIMA_MES}}/$DATE_PLUS_30/g" \
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
149
|
+
-e "s/{{FECHA_LAUNCH}}/$DATE_PLUS_35/g" \
|
|
150
|
+
-e "s/{{ESTADO}}/En planificación/g" \
|
|
151
|
+
-e "s/{{FASE}}/Fase 1/g" \
|
|
152
|
+
-e "s/{{X}}%/0%/g" \
|
|
153
|
+
-e "s/{{PACKAGE_MANAGER}}/$PACKAGE_MANAGER/g" \
|
|
154
|
+
-e "s/{{STACK_SUMMARY}}/$STACK_SUMMARY/g" \
|
|
155
|
+
-e "s/{{PRIMARY_INSTALL}}/$PRIMARY_INSTALL/g" \
|
|
156
|
+
-e "s/{{PRIMARY_DEV}}/$PRIMARY_DEV/g" \
|
|
157
|
+
-e "s/{{PRIMARY_TEST}}/$PRIMARY_TEST/g" \
|
|
158
|
+
-e "s/{{ANALYZE_COMMAND}}/$ANALYZE_COMMAND/g" \
|
|
159
|
+
-e "s/{{DOCTOR_COMMAND}}/$DOCTOR_COMMAND/g" \
|
|
160
|
+
-e "s/{{START_SLICE_COMMAND}}/$START_SLICE_COMMAND/g" \
|
|
161
|
+
-e "s/{{CHECK_SLICE_COMMAND}}/$CHECK_SLICE_COMMAND/g" \
|
|
162
|
+
-e "s/{{CHECK_PR_COMMAND}}/$CHECK_PR_COMMAND/g" \
|
|
163
|
+
-e "s/{{CLEANUP_SLICE_COMMAND}}/$CLEANUP_SLICE_COMMAND/g" \
|
|
164
|
+
-e "s/{{CHECK_SCOPE_COMMAND}}/$CHECK_SCOPE_COMMAND/g" \
|
|
165
|
+
-e "s/{{REFRESH_ACTIVE_SLICES_COMMAND}}/$REFRESH_ACTIVE_SLICES_COMMAND/g" \
|
|
166
|
+
"$src" > "$dest"
|
|
128
167
|
|
|
129
168
|
print_success "Creado: $dest"
|
|
130
169
|
fi
|
|
@@ -151,7 +190,12 @@ copy_file_if_missing() {
|
|
|
151
190
|
}
|
|
152
191
|
|
|
153
192
|
# Copiar templates de docs/
|
|
193
|
+
copy_template_keep_name "docs-template/AGENTS.md.template" "AGENTS.md"
|
|
154
194
|
copy_template "docs-template/docs/INDEX.md.template" "docs/INDEX.md"
|
|
195
|
+
copy_template "docs-template/docs/QUICK.md.template" "docs/ai/QUICK.md"
|
|
196
|
+
copy_template "docs-template/docs/STANDARD.md.template" "docs/ai/STANDARD.md"
|
|
197
|
+
copy_template "docs-template/docs/DEEP.md.template" "docs/ai/DEEP.md"
|
|
198
|
+
copy_template "docs-template/docs/DECISIONS.md.template" "docs/DECISIONS.md"
|
|
155
199
|
copy_template "docs-template/docs/AI_CONTEXT.md.template" "docs/AI_CONTEXT.md"
|
|
156
200
|
copy_template "docs-template/docs/AI_ONBOARDING_PROMPT.md.template" "docs/AI_ONBOARDING_PROMPT.md"
|
|
157
201
|
copy_template "docs-template/docs/CONTEXTO.md.template" "docs/CONTEXTO.md"
|
|
@@ -403,7 +447,7 @@ cat > "docs/SEARCH.md" << EOF
|
|
|
403
447
|
|
|
404
448
|
- **Spec:** \`../specs/$PROJECT_SLUG/slices/slice-01/slice.json\`
|
|
405
449
|
- **PR del slice:** \`../specs/$PROJECT_SLUG/slices/slice-01/pr.md\`
|
|
406
|
-
- **Bootstrap del slice:**
|
|
450
|
+
- **Bootstrap del slice:** \`npx create-quiver start-slice ../specs/$PROJECT_SLUG/slices/slice-01/slice.json\`
|
|
407
451
|
- **Hook:** \`hooks/useAuth.ts\`
|
|
408
452
|
- **API:** \`docs/api/auth/README.md\`
|
|
409
453
|
- **Componentes:** \`app/(auth)/\`
|
|
@@ -444,8 +488,8 @@ Run Quiver from this project root. Do not install it globally.
|
|
|
444
488
|
|
|
445
489
|
\`\`\`bash
|
|
446
490
|
npm install
|
|
447
|
-
npx create-quiver analyze
|
|
448
|
-
npx create-quiver doctor
|
|
491
|
+
npx create-quiver analyze
|
|
492
|
+
npx create-quiver doctor
|
|
449
493
|
\`\`\`
|
|
450
494
|
|
|
451
495
|
If this project needs a pinned Quiver version, install it as a devDependency:
|
|
@@ -454,7 +498,29 @@ If this project needs a pinned Quiver version, install it as a devDependency:
|
|
|
454
498
|
npm install --save-dev create-quiver
|
|
455
499
|
\`\`\`
|
|
456
500
|
|
|
457
|
-
If
|
|
501
|
+
If you need to target another directory from outside the project, pass \`--dir\` explicitly. Quote paths that contain spaces.
|
|
502
|
+
|
|
503
|
+
## Project NPM Scripts
|
|
504
|
+
|
|
505
|
+
The generated project includes \`quiver:*\` npm scripts that call the Node CLI and are the preferred repeatable workflow:
|
|
506
|
+
|
|
507
|
+
\`\`\`bash
|
|
508
|
+
npm run quiver:analyze
|
|
509
|
+
npm run quiver:doctor
|
|
510
|
+
npm run quiver:migrate
|
|
511
|
+
npm run quiver:start-slice -- specs/$PROJECT_SLUG/slices/slice-01/slice.json
|
|
512
|
+
npm run quiver:check-slice -- specs/$PROJECT_SLUG/slices/slice-01/slice.json
|
|
513
|
+
npm run quiver:check-pr -- specs/$PROJECT_SLUG/slices/slice-01/slice.json
|
|
514
|
+
npm run quiver:cleanup-slice -- specs/$PROJECT_SLUG/slices/slice-01/slice.json
|
|
515
|
+
npm run quiver:check-scope -- specs/$PROJECT_SLUG/slices/slice-01/slice.json
|
|
516
|
+
npm run quiver:refresh-active-slices
|
|
517
|
+
\`\`\`
|
|
518
|
+
|
|
519
|
+
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.
|
|
520
|
+
|
|
521
|
+
## Cross-Platform Support
|
|
522
|
+
|
|
523
|
+
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
524
|
|
|
459
525
|
## Upgrading Existing Projects
|
|
460
526
|
|
|
@@ -462,22 +528,24 @@ If the project already existed before this Quiver version, upgrade it from the p
|
|
|
462
528
|
|
|
463
529
|
\`\`\`bash
|
|
464
530
|
cd /path/to/your-project
|
|
465
|
-
npx create-quiver migrate
|
|
466
|
-
npx create-quiver analyze
|
|
467
|
-
npx create-quiver doctor
|
|
531
|
+
npx create-quiver migrate
|
|
532
|
+
npx create-quiver analyze
|
|
533
|
+
npx create-quiver doctor
|
|
468
534
|
\`\`\`
|
|
469
535
|
|
|
470
536
|
If your team prefers a pinned local dependency, update the package first and then run the same flow:
|
|
471
537
|
|
|
472
538
|
\`\`\`bash
|
|
473
539
|
npm install --save-dev create-quiver@latest
|
|
474
|
-
npx create-quiver migrate
|
|
475
|
-
npx create-quiver analyze
|
|
476
|
-
npx create-quiver doctor
|
|
540
|
+
npx create-quiver migrate
|
|
541
|
+
npx create-quiver analyze
|
|
542
|
+
npx create-quiver doctor
|
|
477
543
|
\`\`\`
|
|
478
544
|
|
|
479
545
|
## AI Context Onboarding
|
|
480
546
|
|
|
547
|
+
Lee \`AGENTS.md\` primero y después \`docs/AI_ONBOARDING_PROMPT.md\` tras el análisis.
|
|
548
|
+
|
|
481
549
|
After analysis and doctor validation, open your AI agent in this project and run:
|
|
482
550
|
|
|
483
551
|
\`\`\`text
|
|
@@ -488,25 +556,30 @@ Prepare the project context docs and report assumptions, risks, and files change
|
|
|
488
556
|
|
|
489
557
|
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.
|
|
490
558
|
|
|
559
|
+
## Decision Log
|
|
560
|
+
|
|
561
|
+
Record durable decisions in \`docs/DECISIONS.md\` so future AI agents do not re-litigate the same choices.
|
|
562
|
+
|
|
491
563
|
## First Slice Workflow
|
|
492
564
|
|
|
493
565
|
1. Review or refine specs/$PROJECT_SLUG/SPEC.md.
|
|
494
566
|
2. Create the first slice from specs/$PROJECT_SLUG/slices/slice-template/slice.json.
|
|
495
|
-
3. Start work with
|
|
567
|
+
3. Start work with \`npx create-quiver start-slice <slice.json>\` or \`npm run quiver:start-slice -- <slice.json>\`.
|
|
496
568
|
4. Make one commit per slice.
|
|
497
569
|
5. Open one PR per spec.
|
|
498
570
|
|
|
499
571
|
## Verification Checklist
|
|
500
572
|
|
|
501
573
|
- [ ] npm install completes
|
|
502
|
-
- [ ] npx create-quiver analyze
|
|
503
|
-
- [ ] npx create-quiver doctor
|
|
574
|
+
- [ ] npx create-quiver analyze completes
|
|
575
|
+
- [ ] npx create-quiver doctor completes
|
|
504
576
|
- [ ] AI agent executed docs/AI_ONBOARDING_PROMPT.md
|
|
505
577
|
- [ ] Context docs were reviewed before the first slice
|
|
506
578
|
|
|
507
579
|
## Documentation
|
|
508
580
|
|
|
509
581
|
- [AI Context](./docs/AI_CONTEXT.md) - Contexto resumido para IA
|
|
582
|
+
- [Decision Log](./docs/DECISIONS.md) - Decisiones durables del proyecto
|
|
510
583
|
- [AI Onboarding Prompt](./docs/AI_ONBOARDING_PROMPT.md) - Handoff exacto para agentes después del análisis
|
|
511
584
|
- [Contexto](./docs/CONTEXTO.md) - Qué es $PROJECT_NAME
|
|
512
585
|
- [Workflow](./docs/WORKFLOW.md) - Cómo implementar
|
|
@@ -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"
|