create-quiver 0.14.0 → 0.14.1

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 (55) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +183 -518
  3. package/README_FOR_AI.md +32 -26
  4. package/ROADMAP.md +5 -0
  5. package/assets/quiver-wordmark.svg +22 -0
  6. package/docs/AI_CONTEXT.md.template +2 -0
  7. package/docs/AI_ONBOARDING_PROMPT.md.template +9 -1
  8. package/docs/CLI_UX_GUIDE.md +125 -0
  9. package/docs/COMMANDS.md.template +16 -3
  10. package/docs/GITFLOW_PR_GUIDE.md +70 -0
  11. package/docs/getting-started/linux.md +84 -0
  12. package/docs/getting-started/macos.md +85 -0
  13. package/docs/getting-started/windows-git-bash-wsl.md +78 -0
  14. package/docs/getting-started/windows-powershell.md +96 -0
  15. package/docs/reference/commands.md +94 -0
  16. package/docs/workflows/existing-project.md +131 -0
  17. package/docs/workflows/full-ai-spec-to-pr.md +311 -0
  18. package/docs/workflows/legacy-quiver-project.md +102 -0
  19. package/docs/workflows/new-project.md +76 -0
  20. package/package.json +5 -1
  21. package/specs/quiver-v29-planner-prepare-context-cli-ux/EVIDENCE_REPORT.md +163 -0
  22. package/specs/quiver-v29-planner-prepare-context-cli-ux/EXECUTION_PLAN.md +72 -0
  23. package/specs/quiver-v29-planner-prepare-context-cli-ux/SPEC.md +173 -0
  24. package/specs/quiver-v29-planner-prepare-context-cli-ux/STATUS.md +34 -0
  25. package/specs/quiver-v29-planner-prepare-context-cli-ux/pr.md +95 -0
  26. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-00-cli-ux-spec-foundation/CLOSURE_BRIEF.md +32 -0
  27. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-00-cli-ux-spec-foundation/EXECUTION_BRIEF.md +45 -0
  28. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-00-cli-ux-spec-foundation/slice.json +58 -0
  29. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-01-cli-ux-primitives-theme/CLOSURE_BRIEF.md +33 -0
  30. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-01-cli-ux-primitives-theme/EXECUTION_BRIEF.md +49 -0
  31. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-01-cli-ux-primitives-theme/slice.json +75 -0
  32. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-02-planner-context-proposal-contract/CLOSURE_BRIEF.md +32 -0
  33. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-02-planner-context-proposal-contract/EXECUTION_BRIEF.md +47 -0
  34. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-02-planner-context-proposal-contract/slice.json +71 -0
  35. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-03-prepare-context-planner-review-flow/CLOSURE_BRIEF.md +33 -0
  36. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-03-prepare-context-planner-review-flow/EXECUTION_BRIEF.md +52 -0
  37. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-03-prepare-context-planner-review-flow/slice.json +82 -0
  38. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-04-ux-flag-matrix-compatibility/CLOSURE_BRIEF.md +34 -0
  39. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-04-ux-flag-matrix-compatibility/EXECUTION_BRIEF.md +46 -0
  40. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-04-ux-flag-matrix-compatibility/slice.json +73 -0
  41. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-05-progressive-command-adoption/CLOSURE_BRIEF.md +34 -0
  42. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-05-progressive-command-adoption/EXECUTION_BRIEF.md +46 -0
  43. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-05-progressive-command-adoption/slice.json +83 -0
  44. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-06-docs-tests-smoke-readiness/CLOSURE_BRIEF.md +31 -0
  45. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-06-docs-tests-smoke-readiness/EXECUTION_BRIEF.md +50 -0
  46. package/specs/quiver-v29-planner-prepare-context-cli-ux/slices/slice-06-docs-tests-smoke-readiness/slice.json +95 -0
  47. package/src/create-quiver/commands/ai.js +458 -3
  48. package/src/create-quiver/commands/spec.js +64 -2
  49. package/src/create-quiver/index.js +49 -1
  50. package/src/create-quiver/lib/ai/context-proposal.js +389 -0
  51. package/src/create-quiver/lib/ai/context-proposal.schema.js +31 -0
  52. package/src/create-quiver/lib/cli/editor.js +118 -0
  53. package/src/create-quiver/lib/cli/theme.js +100 -0
  54. package/src/create-quiver/lib/cli/ux-flags.js +151 -0
  55. package/src/create-quiver/lib/cli/ux.js +130 -0
@@ -0,0 +1,95 @@
1
+ ## Title
2
+
3
+ Quiver v29: planner-assisted prepare-context and CLI UX standard
4
+
5
+ ## Summary
6
+
7
+ - Adds a shared UX standard for Quiver CLI commands.
8
+ - Keeps `ai prepare-context` deterministic by default.
9
+ - Adds an explicit planner-assisted prepare-context mode.
10
+ - Adds review and interactive patterns with safe non-interactive alternatives.
11
+ - Standardizes color tokens, loaders, prompts, JSON/CI/no-TTY behavior, and command flag applicability.
12
+
13
+ ## Scope
14
+
15
+ - CLI UX infrastructure and docs.
16
+ - Planner proposal validation for context documentation.
17
+ - `ai prepare-context` planner-assisted mode.
18
+ - Progressive UX adoption for selected commands.
19
+ - Tests, generated docs, and package readiness.
20
+
21
+ ## Files
22
+
23
+ Expected areas:
24
+
25
+ - `src/create-quiver/index.js`
26
+ - `src/create-quiver/commands/ai.js`
27
+ - `src/create-quiver/commands/spec.js`
28
+ - `src/create-quiver/lib/cli/**`
29
+ - `src/create-quiver/lib/ai/**`
30
+ - `docs/**`
31
+ - `README.md`
32
+ - `README_FOR_AI.md`
33
+ - `tests/**`
34
+ - `package.json`
35
+ - `package-lock.json`
36
+ - `specs/quiver-v29-planner-prepare-context-cli-ux/**`
37
+
38
+ ## How to Test (DETAILED - REQUIRED)
39
+
40
+ ### Required Environment
41
+
42
+ - Node.js and npm.
43
+ - Git.
44
+ - Local provider CLI only for provider-backed tests/manual smoke.
45
+
46
+ ### Worktree Access
47
+
48
+ - One spec worktree dedicated to `quiver-v29-planner-prepare-context-cli-ux`.
49
+ - One commit per slice.
50
+
51
+ ### Run the Project
52
+
53
+ This is a CLI framework change. Run command-level tests and smoke commands from the Quiver repo root.
54
+
55
+ ### Use Cases
56
+
57
+ - Run deterministic `ai prepare-context`.
58
+ - Run planner-assisted dry-run.
59
+ - Print planner prompt without provider auth.
60
+ - Review planner proposal with `$EDITOR`.
61
+ - Confirm JSON/no-TTY/CI output stays clean.
62
+ - Confirm unsupported UX flags fail with actionable guidance.
63
+
64
+ ### Technical Verification
65
+
66
+ - `node --test tests/**/*.test.js`
67
+ - `npm run smoke:create-quiver`
68
+ - `npm run smoke:doctor-fixtures`
69
+ - `npm run smoke:guided-workflow`
70
+ - `npm run package:quiver`
71
+ - `npm pack --dry-run`
72
+ - `git diff --check`
73
+ - `npx create-quiver spec validate specs/quiver-v29-planner-prepare-context-cli-ux`
74
+
75
+ ## Evidence
76
+
77
+ - Focused command/UX tests passed with 87 tests.
78
+ - Full suite passed with 426 tests.
79
+ - `npm run smoke:create-quiver` passed.
80
+ - `npm run smoke:doctor-fixtures` passed with 13 fixture states.
81
+ - `npm run smoke:guided-workflow` passed.
82
+ - `npm run package:quiver` passed.
83
+ - `npm pack --dry-run` passed for `create-quiver@0.14.0`.
84
+ - `git diff --check` passed.
85
+ - `node bin/create-quiver.js spec validate specs/quiver-v29-planner-prepare-context-cli-ux` passed.
86
+
87
+ ## Rollback
88
+
89
+ Revert the slice commits in reverse order. The deterministic `ai prepare-context` default must remain available throughout rollback.
90
+
91
+ ## Risks / Notes
92
+
93
+ - Dependencies must be validated for CJS/ESM compatibility and package size.
94
+ - Human-mode visual output must never leak into JSON or CI output.
95
+ - Planner output must be treated as untrusted until validated.
@@ -0,0 +1,32 @@
1
+ # CLOSURE_BRIEF - slice-00 CLI UX spec foundation
2
+
3
+ ## Summary
4
+
5
+ Created and validated the Quiver v29 spec package for planner-assisted `ai prepare-context` and the shared CLI UX standard.
6
+
7
+ ## Validation Against Acceptance Criteria
8
+
9
+ - Spec root includes `SPEC.md`, `EXECUTION_PLAN.md`, `STATUS.md`, `EVIDENCE_REPORT.md`, and `pr.md`.
10
+ - Every slice folder includes `slice.json`, `EXECUTION_BRIEF.md`, and `CLOSURE_BRIEF.md`.
11
+ - Every `slice.json` parsed successfully.
12
+ - Every brief passed `check-handoff`.
13
+ - `spec validate` passed.
14
+ - `git diff --check` passed.
15
+
16
+ ## Relevant Changes
17
+
18
+ - Added `specs/quiver-v29-planner-prepare-context-cli-ux/**`.
19
+ - Added 7 planned slices with dependencies and execution waves.
20
+ - Captured approved acceptance criteria, technical plan, UX flag matrix, Quiver color tokens, and validation strategy.
21
+
22
+ ## Pending Work
23
+
24
+ - Execute implementation slices after this documentation foundation commit.
25
+
26
+ ## Remaining Risks
27
+
28
+ - Implementation still needs to validate dependency impact, terminal compatibility, planner output safety, and docs sync.
29
+
30
+ ## Future Recommendations
31
+
32
+ - Keep this slice as the scope anchor for Quiver v29 and update later closure briefs with evidence rather than changing approved scope.
@@ -0,0 +1,45 @@
1
+ # EXECUTION_BRIEF - slice-00 CLI UX spec foundation
2
+
3
+ ## Context
4
+
5
+ Quiver v29 introduces planner-assisted `ai prepare-context` and a shared CLI UX standard. This slice establishes the documentation foundation only.
6
+
7
+ ## Objective
8
+
9
+ Commit the approved spec package so later implementation slices have a stable contract.
10
+
11
+ ## Scope
12
+
13
+ - Review `SPEC.md`, `EXECUTION_PLAN.md`, `STATUS.md`, `pr.md`, and every slice contract.
14
+ - Ensure each slice has `slice.json`, `EXECUTION_BRIEF.md`, and `CLOSURE_BRIEF.md`.
15
+ - Validate JSON and Markdown hygiene.
16
+
17
+ ## Acceptance Criteria
18
+
19
+ - No product code changes.
20
+ - All slice JSON files parse.
21
+ - `git diff --check` passes.
22
+ - Slice dependencies and allowed write paths are explicit.
23
+
24
+ ## Suggested Steps
25
+
26
+ 1. Inspect the spec package.
27
+ 2. Validate every `slice.json`.
28
+ 3. Run `git diff --check`.
29
+ 4. Commit only the spec package.
30
+
31
+ ## Restrictions
32
+
33
+ - Do not modify `src/`, tests, package files, or generated templates in this slice.
34
+ - Do not implement CLI behavior.
35
+
36
+ ## Risks
37
+
38
+ - If this slice is skipped, implementation agents may work from inconsistent scope.
39
+
40
+ ## Completion Checklist
41
+
42
+ - [ ] Spec package reviewed.
43
+ - [ ] JSON validation passed.
44
+ - [ ] Whitespace validation passed.
45
+ - [ ] Documentation foundation committed.
@@ -0,0 +1,58 @@
1
+ {
2
+ "slice_id": "slice-00-cli-ux-spec-foundation",
3
+ "ticket": "QUIVER-29-00",
4
+ "type": "docs",
5
+ "title": "CLI UX spec foundation",
6
+ "objective": "Commit the approved spec package, UX standard, execution plan, and slice contracts before implementation begins.",
7
+ "description": "Creates the documentary foundation for Quiver v29, including the approved acceptance criteria, technical plan, command/flag matrix, execution waves, PR body, and slice handoffs.",
8
+ "git": {
9
+ "branch_type": "feature",
10
+ "base_branch": "main",
11
+ "branch_slug": "v29-cli-ux-spec-foundation",
12
+ "branch_name": "feature/QUIVER-29-00-v29-cli-ux-spec-foundation"
13
+ },
14
+ "files": [
15
+ "specs/quiver-v29-planner-prepare-context-cli-ux/**"
16
+ ],
17
+ "expected_read_paths": [
18
+ "README_FOR_AI.md",
19
+ "README.md",
20
+ "docs/reference/commands.md",
21
+ "specs/quiver-v28-pixel-quiver-feedback-reconciliation/**"
22
+ ],
23
+ "allowed_write_paths": [
24
+ "specs/quiver-v29-planner-prepare-context-cli-ux/**"
25
+ ],
26
+ "depends_on": [],
27
+ "parallel_safe": "no",
28
+ "parallel_safe_reason": "This documentation foundation must land before any implementation slice starts.",
29
+ "must": [
30
+ "Capture approved acceptance criteria and technical plan.",
31
+ "Define the UX flag matrix and Quiver color tokens.",
32
+ "Create EXECUTION_BRIEF.md and CLOSURE_BRIEF.md for every slice.",
33
+ "Include an execution plan that identifies sequential and parallel-safe waves."
34
+ ],
35
+ "not_included": [
36
+ "Product code changes.",
37
+ "Dependency installation.",
38
+ "CLI behavior changes."
39
+ ],
40
+ "acceptance": [
41
+ "The spec root includes SPEC.md, EXECUTION_PLAN.md, STATUS.md, and pr.md.",
42
+ "Every slice folder includes slice.json, EXECUTION_BRIEF.md, and CLOSURE_BRIEF.md.",
43
+ "Every slice has explicit dependencies and allowed write paths.",
44
+ "The documentation package validates as Markdown/JSON and is ready for commit."
45
+ ],
46
+ "tests": [
47
+ "find specs/quiver-v29-planner-prepare-context-cli-ux -name 'slice.json' -print -exec node -e \"JSON.parse(require('fs').readFileSync(process.argv[1], 'utf8'))\" {} \\;",
48
+ "git diff --check"
49
+ ],
50
+ "validation_hints": [
51
+ "Run this slice first.",
52
+ "Do not start code implementation before this slice is committed."
53
+ ],
54
+ "estimated_hours": 2,
55
+ "actual_hours": 2,
56
+ "completed_at": "2026-05-26",
57
+ "status": "completed"
58
+ }
@@ -0,0 +1,33 @@
1
+ # CLOSURE_BRIEF - slice-01 CLI UX primitives, theme, and dependencies
2
+
3
+ ## Summary
4
+
5
+ Completed the shared CLI UX foundation required by later v29 slices.
6
+
7
+ ## Validation Against Acceptance Criteria
8
+
9
+ - Theme tokens are centralized in `src/create-quiver/lib/cli/theme.js` and tested against the approved Quiver palette.
10
+ - UX mode detection disables prompts, spinners, colors, and decorative output for `--json`, CI, and no-TTY modes.
11
+ - `@clack/prompts` is wrapped behind internal helpers and loaded lazily so command code does not couple to it directly.
12
+ - `$VISUAL`/`$EDITOR` resolution, fallback behavior, shell-free execution, and cancellation paths are tested.
13
+ - `npm run package:quiver` passed after adding dependencies.
14
+
15
+ ## Relevant Changes
16
+
17
+ - Added runtime dependencies: `@clack/prompts` and `zod`.
18
+ - Added `theme.js`, `ux.js`, and `editor.js` under `src/create-quiver/lib/cli/`.
19
+ - Added focused `node:test` coverage for theme, UX mode/spinner/prompt behavior, and editor resolution/execution.
20
+
21
+ ## Pending Work
22
+
23
+ - Later slices must adopt these helpers instead of duplicating output logic.
24
+ - `zod` is intentionally added now and will be used by `slice-02` for planner proposal validation.
25
+
26
+ ## Remaining Risks
27
+
28
+ - `@clack/prompts` is ESM-only; it is loaded through dynamic import and covered by tests, but later command adoption must keep this boundary.
29
+ - Windows editor behavior is covered through injected platform/runner tests; real terminal coverage remains part of final smoke/manual validation.
30
+
31
+ ## Future Recommendations
32
+
33
+ - Keep UX helpers minimal and command-owned: command behavior should stay testable without a real TTY.
@@ -0,0 +1,49 @@
1
+ # EXECUTION_BRIEF - slice-01 CLI UX primitives, theme, and dependencies
2
+
3
+ ## Context
4
+
5
+ Quiver currently has no runtime dependencies and uses direct string output. This slice adds a shared UX layer carefully so later command changes stay consistent and script-safe.
6
+
7
+ ## Objective
8
+
9
+ Create internal helpers for Quiver-branded human output, prompts, spinners, mode detection, and editor review.
10
+
11
+ ## Scope
12
+
13
+ - Add `@clack/prompts` and `zod` only if required by the approved implementation path.
14
+ - Add `src/create-quiver/lib/cli/theme.js`.
15
+ - Add `src/create-quiver/lib/cli/ux.js`.
16
+ - Add `src/create-quiver/lib/cli/editor.js`.
17
+ - Add focused unit tests.
18
+
19
+ ## Acceptance Criteria
20
+
21
+ - Existing commands keep current behavior unless using new helpers internally without visible behavior changes.
22
+ - No output decoration in CI/no-TTY/JSON/no-color modes.
23
+ - Quiver color tokens match the approved palette.
24
+ - `$VISUAL`/`$EDITOR` fallback is tested.
25
+
26
+ ## Suggested Steps
27
+
28
+ 1. Add dependencies and lockfile updates.
29
+ 2. Implement theme tokens and symbol fallbacks.
30
+ 3. Implement mode detection and human-output helpers.
31
+ 4. Implement editor helper with cancellation handling.
32
+ 5. Add unit tests.
33
+ 6. Run package smoke.
34
+
35
+ ## Restrictions
36
+
37
+ - Do not migrate CLI parsing in this slice.
38
+ - Do not modify `ai prepare-context` behavior yet.
39
+
40
+ ## Risks
41
+
42
+ - Dependency ESM/CJS compatibility can break `npx`.
43
+ - Decoration can leak into tests if mode detection is weak.
44
+
45
+ ## Completion Checklist
46
+
47
+ - [ ] Dependencies justified and package smoke passes.
48
+ - [ ] Theme/helper/editor tests pass.
49
+ - [ ] No hardcoded Quiver colors outside the theme module.
@@ -0,0 +1,75 @@
1
+ {
2
+ "slice_id": "slice-01-cli-ux-primitives-theme",
3
+ "ticket": "QUIVER-29-01",
4
+ "type": "feature",
5
+ "title": "CLI UX primitives, theme, and dependencies",
6
+ "objective": "Add shared CLI UX primitives for human output, TTY/CI detection, Quiver colors, prompts, spinners, and editor support without changing command behavior yet.",
7
+ "description": "Introduces the reusable internal UX layer that later command slices can adopt safely.",
8
+ "git": {
9
+ "branch_type": "feature",
10
+ "base_branch": "main",
11
+ "branch_slug": "v29-cli-ux-primitives-theme",
12
+ "branch_name": "feature/QUIVER-29-01-v29-cli-ux-primitives-theme"
13
+ },
14
+ "files": [
15
+ "package.json",
16
+ "package-lock.json",
17
+ "src/create-quiver/lib/cli/theme.js",
18
+ "src/create-quiver/lib/cli/ux.js",
19
+ "src/create-quiver/lib/cli/editor.js",
20
+ "tests/lib/cli-theme.test.js",
21
+ "tests/lib/cli-ux.test.js",
22
+ "tests/lib/cli-editor.test.js",
23
+ "specs/quiver-v29-planner-prepare-context-cli-ux/**"
24
+ ],
25
+ "expected_read_paths": [
26
+ "src/create-quiver/index.js",
27
+ "src/create-quiver/commands/next.js",
28
+ "package.json",
29
+ "tests/**"
30
+ ],
31
+ "allowed_write_paths": [
32
+ "package.json",
33
+ "package-lock.json",
34
+ "src/create-quiver/lib/cli/**",
35
+ "tests/lib/cli-theme.test.js",
36
+ "tests/lib/cli-ux.test.js",
37
+ "tests/lib/cli-editor.test.js",
38
+ "specs/quiver-v29-planner-prepare-context-cli-ux/**"
39
+ ],
40
+ "depends_on": [
41
+ "slice-00-cli-ux-spec-foundation"
42
+ ],
43
+ "parallel_safe": "after_dependencies",
44
+ "parallel_safe_reason": "Must run before other implementation slices because it owns shared helpers and dependencies.",
45
+ "must": [
46
+ "Add Quiver color tokens in one shared module.",
47
+ "Detect TTY, CI, JSON, no-color, and machine-output modes.",
48
+ "Wrap @clack/prompts behind internal helpers so command code is not coupled directly.",
49
+ "Add editor helper using VISUAL, EDITOR, and safe fallback.",
50
+ "Keep existing command behavior unchanged."
51
+ ],
52
+ "not_included": [
53
+ "Planner proposal parsing.",
54
+ "prepare-context behavior changes.",
55
+ "Full parser migration to commander/yargs/oclif."
56
+ ],
57
+ "acceptance": [
58
+ "Theme tokens are centralized and tested.",
59
+ "UX helpers disable decoration for CI, no-TTY, --json, and no-color mode.",
60
+ "Editor helper handles missing editor and cancellation without writes.",
61
+ "Package smoke still passes after dependencies are added."
62
+ ],
63
+ "tests": [
64
+ "node --test tests/lib/cli-theme.test.js tests/lib/cli-ux.test.js tests/lib/cli-editor.test.js",
65
+ "npm run package:quiver"
66
+ ],
67
+ "validation_hints": [
68
+ "Prefer small wrappers over direct @clack usage in commands.",
69
+ "Do not hardcode color values outside theme.js."
70
+ ],
71
+ "estimated_hours": 6,
72
+ "actual_hours": 3,
73
+ "status": "completed",
74
+ "completed_at": "2026-05-26"
75
+ }
@@ -0,0 +1,32 @@
1
+ # CLOSURE_BRIEF - slice-02 Planner context proposal contract
2
+
3
+ ## Summary
4
+
5
+ Completed a strict planner context proposal contract for future `ai prepare-context --with-planner` usage.
6
+
7
+ ## Validation Against Acceptance Criteria
8
+
9
+ - Valid structured JSON and fenced JSON planner outputs parse into a normalized docs-only write plan.
10
+ - Unsafe paths are rejected before writes, including product code, dependency/lockfiles, absolute paths, traversal paths, generated outputs, runtime/build config, `.quiver/`, and unapproved docs.
11
+ - Schema validation uses `zod` and reports actionable issues with safe next steps.
12
+ - Invalid raw output can be persisted as a redacted run artifact under `.quiver/runs/<run-id>/raw/`.
13
+
14
+ ## Relevant Changes
15
+
16
+ - Added `src/create-quiver/lib/ai/context-proposal.schema.js`.
17
+ - Added `src/create-quiver/lib/ai/context-proposal.js`.
18
+ - Added valid, fenced, malformed, product-code, absolute-path, and traversal fixtures under `tests/fixtures/ai-context-proposals/`.
19
+ - Added focused unit tests in `tests/lib/ai-context-proposal.test.js`.
20
+
21
+ ## Pending Work
22
+
23
+ - `ai prepare-context` must consume this contract in a later slice.
24
+
25
+ ## Remaining Risks
26
+
27
+ - Planner output compatibility must be tested with real provider transcripts later.
28
+ - The allowlist intentionally matches current `prepare-context` docs; future docs must be added explicitly to avoid unsafe broadening.
29
+
30
+ ## Future Recommendations
31
+
32
+ - Keep the schema versioned if external agents or dashboards start consuming it.
@@ -0,0 +1,47 @@
1
+ # EXECUTION_BRIEF - slice-02 Planner context proposal contract
2
+
3
+ ## Context
4
+
5
+ Planner-assisted `ai prepare-context` needs a strict contract before any provider output can affect project docs.
6
+
7
+ ## Objective
8
+
9
+ Create a safe parser and schema for planner-generated documentation proposals.
10
+
11
+ ## Scope
12
+
13
+ - Add proposal schema.
14
+ - Add proposal parser/normalizer.
15
+ - Add docs-only allowlist.
16
+ - Add path safety checks.
17
+ - Add valid and invalid fixtures.
18
+
19
+ ## Acceptance Criteria
20
+
21
+ - Unsafe planner output is rejected before writes.
22
+ - Valid planner output becomes a normalized docs-only plan.
23
+ - Errors explain what failed and how to continue safely.
24
+
25
+ ## Suggested Steps
26
+
27
+ 1. Define proposal JSON shape.
28
+ 2. Add `zod` schema validation.
29
+ 3. Add path normalization and allowlist checks.
30
+ 4. Add fixtures for valid, invalid, product-code, absolute-path, traversal, and malformed outputs.
31
+ 5. Add unit tests.
32
+
33
+ ## Restrictions
34
+
35
+ - Do not call providers in this slice.
36
+ - Do not modify `runPrepareContext` write behavior yet.
37
+
38
+ ## Risks
39
+
40
+ - Too-strict parsing can reject useful planner output; prefer clear repair guidance over unsafe fallback.
41
+
42
+ ## Completion Checklist
43
+
44
+ - [ ] Valid fixtures parse.
45
+ - [ ] Unsafe fixtures fail.
46
+ - [ ] Proposal errors are actionable.
47
+ - [ ] No docs are written by this slice.
@@ -0,0 +1,71 @@
1
+ {
2
+ "slice_id": "slice-02-planner-context-proposal-contract",
3
+ "ticket": "QUIVER-29-02",
4
+ "type": "feature",
5
+ "title": "Planner context proposal contract",
6
+ "objective": "Define and validate the structured proposal format used when a planner IA suggests context documentation updates.",
7
+ "description": "Adds the parser, schema, path safety, allowlist checks, and diff-ready internal model for planner-generated context proposals.",
8
+ "git": {
9
+ "branch_type": "feature",
10
+ "base_branch": "main",
11
+ "branch_slug": "v29-planner-context-proposal-contract",
12
+ "branch_name": "feature/QUIVER-29-02-v29-planner-context-proposal-contract"
13
+ },
14
+ "files": [
15
+ "src/create-quiver/lib/ai/context-proposal.js",
16
+ "src/create-quiver/lib/ai/context-proposal.schema.js",
17
+ "src/create-quiver/lib/ai/onboarding-template.js",
18
+ "tests/lib/ai-context-proposal.test.js",
19
+ "tests/fixtures/ai-context-proposals/**",
20
+ "specs/quiver-v29-planner-prepare-context-cli-ux/**"
21
+ ],
22
+ "expected_read_paths": [
23
+ "src/create-quiver/lib/ai/onboarding-template.js",
24
+ "src/create-quiver/lib/ai/safety.js",
25
+ "src/create-quiver/commands/ai.js",
26
+ "tests/commands/ai-onboard.test.js",
27
+ "tests/lib/ai-context-packs.test.js"
28
+ ],
29
+ "allowed_write_paths": [
30
+ "src/create-quiver/lib/ai/context-proposal.js",
31
+ "src/create-quiver/lib/ai/context-proposal.schema.js",
32
+ "src/create-quiver/lib/ai/onboarding-template.js",
33
+ "tests/lib/ai-context-proposal.test.js",
34
+ "tests/fixtures/ai-context-proposals/**",
35
+ "specs/quiver-v29-planner-prepare-context-cli-ux/**"
36
+ ],
37
+ "depends_on": [
38
+ "slice-01-cli-ux-primitives-theme"
39
+ ],
40
+ "parallel_safe": "after_dependencies",
41
+ "parallel_safe_reason": "Can run in parallel with slice-04 if both avoid central CLI parser conflicts.",
42
+ "must": [
43
+ "Validate planner proposals with zod.",
44
+ "Accept structured JSON or fenced JSON output when safe.",
45
+ "Reject paths outside the repo, path traversal, absolute writes, product code, dependencies, lockfiles, build files, generated files, and runtime config.",
46
+ "Produce a normalized docs-only write plan that existing prepare-context logic can consume.",
47
+ "Persist invalid raw output as an artifact only when safe and redacted."
48
+ ],
49
+ "not_included": [
50
+ "Invoking provider CLIs.",
51
+ "Writing docs from planner proposals.",
52
+ "Interactive editor review."
53
+ ],
54
+ "acceptance": [
55
+ "Valid planner proposal fixtures parse into a normalized internal model.",
56
+ "Invalid or unsafe proposals fail before writes.",
57
+ "Allowed docs-only paths are explicit and tested.",
58
+ "The parser reports actionable errors with next safe commands."
59
+ ],
60
+ "tests": [
61
+ "node --test tests/lib/ai-context-proposal.test.js"
62
+ ],
63
+ "validation_hints": [
64
+ "Treat planner output as untrusted input.",
65
+ "Keep schema and allowlist close to the proposal parser."
66
+ ],
67
+ "estimated_hours": 8,
68
+ "actual_hours": 3,
69
+ "status": "completed",
70
+ "completed_at": "2026-05-26"
71
+ }
@@ -0,0 +1,33 @@
1
+ # CLOSURE_BRIEF - slice-03 Planner-assisted prepare-context review flow
2
+
3
+ ## Summary
4
+
5
+ Completed explicit planner-assisted context preparation for `ai prepare-context`.
6
+
7
+ ## Validation Against Acceptance Criteria
8
+
9
+ - Default deterministic `ai prepare-context` behavior remains unchanged and existing tests still pass.
10
+ - `--with-planner --dry-run` reports provider invocation, candidate docs, allowed paths, and writes nothing.
11
+ - `--with-planner --print-prompt` prints the exact planner prompt without provider auth or writes.
12
+ - Live `--with-planner` invokes the provider, validates the proposal contract, creates snapshots, and writes only allowed docs.
13
+ - Provider failures, invalid planner output, review cancellation, and declined interactive approval leave docs untouched.
14
+ - `--review` writes a proposal artifact, opens or uses the editor flow, and revalidates edited JSON before writing.
15
+
16
+ ## Relevant Changes
17
+
18
+ - Extended `src/create-quiver/commands/ai.js` with planner prompt building, dry-run/prompt-only reports, provider execution, proposal review, interactive confirmation, and planner write integration.
19
+ - Updated `src/create-quiver/index.js` to forward planner UX flags/options into `runPrepareContext`.
20
+ - Added `tests/commands/ai-prepare-context-planner.test.js`.
21
+
22
+ ## Pending Work
23
+
24
+ - Progressive command adoption should reuse this pattern.
25
+
26
+ ## Remaining Risks
27
+
28
+ - Real provider outputs may need fixture updates after dogfooding.
29
+ - Review mode uses a temporary JSON artifact; future UX can make this artifact easier to discover or persist under run state when useful.
30
+
31
+ ## Future Recommendations
32
+
33
+ - Consider a future `ai describe-project` alias only if users still find `prepare-context --with-planner` unclear.
@@ -0,0 +1,52 @@
1
+ # EXECUTION_BRIEF - slice-03 Planner-assisted prepare-context review flow
2
+
3
+ ## Context
4
+
5
+ The deterministic `ai prepare-context` path must remain default. Planner-assisted mode is opt-in and must never bypass docs-only safety.
6
+
7
+ ## Objective
8
+
9
+ Implement `ai prepare-context --with-planner` with dry-run, prompt printing, review, and interactive support.
10
+
11
+ ## Scope
12
+
13
+ - Parse new flags for `ai prepare-context`.
14
+ - Build planner prompt from context pack and current draft plan.
15
+ - Invoke provider only when not dry-run/print-prompt.
16
+ - Validate planner proposal.
17
+ - Snapshot and write docs-only changes.
18
+ - Add editor review flow.
19
+
20
+ ## Acceptance Criteria
21
+
22
+ - Existing deterministic behavior stays compatible.
23
+ - Planner mode is explicit.
24
+ - No partial writes on provider, validation, editor, or snapshot failure.
25
+ - Human output has clear next safe commands.
26
+
27
+ ## Suggested Steps
28
+
29
+ 1. Extend CLI args for `ai prepare-context`.
30
+ 2. Add planner prompt builder or reuse onboarding prompt pieces.
31
+ 3. Add dry-run and print-prompt paths.
32
+ 4. Add provider execution path.
33
+ 5. Add proposal validation and write integration.
34
+ 6. Add review flow and tests.
35
+
36
+ ## Restrictions
37
+
38
+ - Do not allow product code writes.
39
+ - Do not make planner mode default.
40
+ - Do not require interactive prompts for automation.
41
+
42
+ ## Risks
43
+
44
+ - Combining provider execution, review, and writes can create partial-state bugs unless staged carefully.
45
+
46
+ ## Completion Checklist
47
+
48
+ - [ ] Default mode unchanged.
49
+ - [ ] Planner dry-run and print-prompt tested.
50
+ - [ ] Provider failure tested.
51
+ - [ ] Review cancellation tested.
52
+ - [ ] Snapshot and docs-only write tested.