create-quiver 0.10.0 → 0.12.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.
- package/BACKLOG.md +16 -17
- package/CHANGELOG.md +78 -0
- package/README.md +208 -41
- package/README_FOR_AI.md +50 -24
- package/ROADMAP.md +34 -11
- package/docs/AI_CONTEXT.md.template +2 -0
- package/docs/AI_ONBOARDING_PROMPT.md.template +31 -18
- package/docs/COMMANDS.md.template +90 -16
- package/docs/CONTEXTO.md.template +2 -0
- package/docs/DECISIONS.md.template +1 -0
- package/docs/INDEX.md.template +20 -18
- package/docs/STATUS.md.template +6 -1
- package/docs/SUPPORT_MATRIX.md.template +2 -2
- package/docs/TROUBLESHOOTING.md.template +50 -0
- package/docs/WORKFLOW.md.template +27 -17
- package/package.json +27 -4
- package/package.template.json +13 -1
- package/scripts/init-docs.sh +11 -4
- package/scripts/package-quiver.sh +18 -2
- package/specs/quiver-v22-guided-ai-workflow/EVIDENCE_REPORT.md +58 -0
- package/specs/quiver-v22-guided-ai-workflow/EXECUTION_PLAN.md +88 -0
- package/specs/quiver-v22-guided-ai-workflow/SPEC.md +228 -0
- package/specs/quiver-v22-guided-ai-workflow/STATUS.md +42 -0
- package/specs/quiver-v22-guided-ai-workflow/pr.md +104 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +35 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +61 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-00-spec-foundation/slice.json +51 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-01-docs-source-of-truth-sync/CLOSURE_BRIEF.md +31 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-01-docs-source-of-truth-sync/EXECUTION_BRIEF.md +58 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-01-docs-source-of-truth-sync/slice.json +55 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-02-prepare-command-diagnostics/CLOSURE_BRIEF.md +30 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-02-prepare-command-diagnostics/EXECUTION_BRIEF.md +57 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-02-prepare-command-diagnostics/slice.json +57 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-03-context-doc-refresh/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-03-context-doc-refresh/EXECUTION_BRIEF.md +56 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-03-context-doc-refresh/slice.json +56 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-04-planner-approval-state/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-04-planner-approval-state/EXECUTION_BRIEF.md +56 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-04-planner-approval-state/slice.json +58 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-05-spec-worktree-lifecycle/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-05-spec-worktree-lifecycle/EXECUTION_BRIEF.md +56 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-05-spec-worktree-lifecycle/slice.json +54 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-06-executor-commit-recovery/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-06-executor-commit-recovery/EXECUTION_BRIEF.md +58 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-06-executor-commit-recovery/slice.json +57 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-07-execution-waves-delegation/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-07-execution-waves-delegation/EXECUTION_BRIEF.md +58 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-07-execution-waves-delegation/slice.json +55 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-08-pr-create-gh-ssh/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-08-pr-create-gh-ssh/EXECUTION_BRIEF.md +58 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-08-pr-create-gh-ssh/slice.json +53 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-09-post-merge-cleanup-release-safety/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-09-post-merge-cleanup-release-safety/EXECUTION_BRIEF.md +59 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-09-post-merge-cleanup-release-safety/slice.json +59 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-10-docs-smokes-release-readiness/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-10-docs-smokes-release-readiness/EXECUTION_BRIEF.md +58 -0
- package/specs/quiver-v22-guided-ai-workflow/slices/slice-10-docs-smokes-release-readiness/slice.json +60 -0
- package/specs/quiver-v23-guided-flow-productization/EVIDENCE_REPORT.md +80 -0
- package/specs/quiver-v23-guided-flow-productization/EXECUTION_PLAN.md +80 -0
- package/specs/quiver-v23-guided-flow-productization/SPEC.md +203 -0
- package/specs/quiver-v23-guided-flow-productization/STATUS.md +39 -0
- package/specs/quiver-v23-guided-flow-productization/pr.md +119 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +30 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +61 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-00-spec-foundation/slice.json +51 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-01-short-command-and-flow-entrypoint/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-01-short-command-and-flow-entrypoint/EXECUTION_BRIEF.md +35 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-01-short-command-and-flow-entrypoint/slice.json +56 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-02-flow-status-wizard/CLOSURE_BRIEF.md +31 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-02-flow-status-wizard/EXECUTION_BRIEF.md +29 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-02-flow-status-wizard/slice.json +55 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-03-agent-profiles/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-03-agent-profiles/EXECUTION_BRIEF.md +29 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-03-agent-profiles/slice.json +54 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-04-context-preparation-onboarding/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-04-context-preparation-onboarding/EXECUTION_BRIEF.md +30 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-04-context-preparation-onboarding/slice.json +59 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-05-planner-iteration-history/CLOSURE_BRIEF.md +31 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-05-planner-iteration-history/EXECUTION_BRIEF.md +29 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-05-planner-iteration-history/slice.json +53 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-06-production-plan-review/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-06-production-plan-review/EXECUTION_BRIEF.md +30 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-06-production-plan-review/slice.json +54 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-07-spec-create-experience/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-07-spec-create-experience/EXECUTION_BRIEF.md +30 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-07-spec-create-experience/slice.json +55 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-08-executor-prompt-generation/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-08-executor-prompt-generation/EXECUTION_BRIEF.md +30 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-08-executor-prompt-generation/slice.json +55 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-09-delegated-slice-execution/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-09-delegated-slice-execution/EXECUTION_BRIEF.md +34 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-09-delegated-slice-execution/slice.json +57 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-10-docs-smokes-release-readiness/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-10-docs-smokes-release-readiness/EXECUTION_BRIEF.md +32 -0
- package/specs/quiver-v23-guided-flow-productization/slices/slice-10-docs-smokes-release-readiness/slice.json +63 -0
- package/specs/quiver-v24-dx-onboarding-hardening/EVIDENCE_REPORT.md +55 -0
- package/specs/quiver-v24-dx-onboarding-hardening/EXECUTION_PLAN.md +43 -0
- package/specs/quiver-v24-dx-onboarding-hardening/SPEC.md +149 -0
- package/specs/quiver-v24-dx-onboarding-hardening/STATUS.md +31 -0
- package/specs/quiver-v24-dx-onboarding-hardening/pr.md +76 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +31 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +52 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-00-spec-foundation/slice.json +51 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-01-init-template-hygiene/CLOSURE_BRIEF.md +38 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-01-init-template-hygiene/EXECUTION_BRIEF.md +53 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-01-init-template-hygiene/slice.json +55 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-02-cli-command-routing-version-errors/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-02-cli-command-routing-version-errors/EXECUTION_BRIEF.md +50 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-02-cli-command-routing-version-errors/slice.json +52 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-03-doctor-fix-doc-link-checks/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-03-doctor-fix-doc-link-checks/EXECUTION_BRIEF.md +50 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-03-doctor-fix-doc-link-checks/slice.json +53 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-04-prepare-output-ai-context-drafts/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-04-prepare-output-ai-context-drafts/EXECUTION_BRIEF.md +50 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-04-prepare-output-ai-context-drafts/slice.json +70 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-05-local-slice-validation-base-guidance/CLOSURE_BRIEF.md +36 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-05-local-slice-validation-base-guidance/EXECUTION_BRIEF.md +49 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-05-local-slice-validation-base-guidance/slice.json +52 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-06-plan-graph-next-history-views/CLOSURE_BRIEF.md +43 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-06-plan-graph-next-history-views/EXECUTION_BRIEF.md +53 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-06-plan-graph-next-history-views/slice.json +60 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-07-analyzer-command-map-hardening/CLOSURE_BRIEF.md +32 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-07-analyzer-command-map-hardening/EXECUTION_BRIEF.md +50 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-07-analyzer-command-map-hardening/slice.json +51 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-08-evidence-run-command/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-08-evidence-run-command/EXECUTION_BRIEF.md +52 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-08-evidence-run-command/slice.json +54 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-09-spec-viewer-demo-scaffolding/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-09-spec-viewer-demo-scaffolding/EXECUTION_BRIEF.md +51 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-09-spec-viewer-demo-scaffolding/slice.json +59 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-10-docs-smokes-release-readiness/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-10-docs-smokes-release-readiness/EXECUTION_BRIEF.md +54 -0
- package/specs/quiver-v24-dx-onboarding-hardening/slices/slice-10-docs-smokes-release-readiness/slice.json +76 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/EVIDENCE_REPORT.md +293 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/EXECUTION_PLAN.md +58 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/SPEC.md +242 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/STATUS.md +35 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/pr.md +77 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +52 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-00-spec-foundation/slice.json +52 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-01-cli-contract-compatibility/CLOSURE_BRIEF.md +36 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-01-cli-contract-compatibility/EXECUTION_BRIEF.md +52 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-01-cli-contract-compatibility/slice.json +56 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-02-run-state-phase-locks/CLOSURE_BRIEF.md +43 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-02-run-state-phase-locks/EXECUTION_BRIEF.md +54 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-02-run-state-phase-locks/slice.json +52 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-03-safe-ai-onboarding-docs/CLOSURE_BRIEF.md +35 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-03-safe-ai-onboarding-docs/EXECUTION_BRIEF.md +53 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-03-safe-ai-onboarding-docs/slice.json +54 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-04-agent-profiles-adapters/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-04-agent-profiles-adapters/EXECUTION_BRIEF.md +54 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-04-agent-profiles-adapters/slice.json +52 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-05-approval-gates/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-05-approval-gates/EXECUTION_BRIEF.md +54 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-05-approval-gates/slice.json +53 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-06-spec-slice-generator/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-06-spec-slice-generator/EXECUTION_BRIEF.md +56 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-06-spec-slice-generator/slice.json +55 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-07-slice-execution-planner/CLOSURE_BRIEF.md +33 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-07-slice-execution-planner/EXECUTION_BRIEF.md +54 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-07-slice-execution-planner/slice.json +52 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-08-controlled-slice-execution/CLOSURE_BRIEF.md +39 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-08-controlled-slice-execution/EXECUTION_BRIEF.md +56 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-08-controlled-slice-execution/slice.json +53 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-09-git-worktree-pr-lifecycle/CLOSURE_BRIEF.md +38 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-09-git-worktree-pr-lifecycle/EXECUTION_BRIEF.md +57 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-09-git-worktree-pr-lifecycle/slice.json +52 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-10-validation-errors-fixtures/CLOSURE_BRIEF.md +39 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-10-validation-errors-fixtures/EXECUTION_BRIEF.md +55 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-10-validation-errors-fixtures/slice.json +56 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-11-export-dashboard-migration/CLOSURE_BRIEF.md +36 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-11-export-dashboard-migration/EXECUTION_BRIEF.md +54 -0
- package/specs/quiver-v25-ai-first-lifecycle-orchestrator/slices/slice-11-export-dashboard-migration/slice.json +53 -0
- package/specs/quiver-v26-0121-smoke-hardening/EVIDENCE_REPORT.md +208 -0
- package/specs/quiver-v26-0121-smoke-hardening/EXECUTION_PLAN.md +57 -0
- package/specs/quiver-v26-0121-smoke-hardening/SPEC.md +137 -0
- package/specs/quiver-v26-0121-smoke-hardening/STATUS.md +32 -0
- package/specs/quiver-v26-0121-smoke-hardening/pr.md +96 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-00-docs-foundation/CLOSURE_BRIEF.md +35 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-00-docs-foundation/EXECUTION_BRIEF.md +55 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-00-docs-foundation/slice.json +73 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-01-cli-help-version-contract/CLOSURE_BRIEF.md +38 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-01-cli-help-version-contract/EXECUTION_BRIEF.md +51 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-01-cli-help-version-contract/slice.json +76 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-02-init-doc-links-and-flow-guidance/CLOSURE_BRIEF.md +37 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-02-init-doc-links-and-flow-guidance/EXECUTION_BRIEF.md +52 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-02-init-doc-links-and-flow-guidance/slice.json +75 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-03-ai-approval-review-consistency/CLOSURE_BRIEF.md +37 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-03-ai-approval-review-consistency/EXECUTION_BRIEF.md +53 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-03-ai-approval-review-consistency/slice.json +77 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-04-local-validation-brief-contracts/CLOSURE_BRIEF.md +35 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-04-local-validation-brief-contracts/EXECUTION_BRIEF.md +52 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-04-local-validation-brief-contracts/slice.json +77 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-05-demo-scaffold-readiness/CLOSURE_BRIEF.md +34 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-05-demo-scaffold-readiness/EXECUTION_BRIEF.md +54 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-05-demo-scaffold-readiness/slice.json +84 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-06-plan-graph-scope-performance/CLOSURE_BRIEF.md +35 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-06-plan-graph-scope-performance/EXECUTION_BRIEF.md +53 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-06-plan-graph-scope-performance/slice.json +82 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-07-smoke-release-readiness/CLOSURE_BRIEF.md +35 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-07-smoke-release-readiness/EXECUTION_BRIEF.md +55 -0
- package/specs/quiver-v26-0121-smoke-hardening/slices/slice-07-smoke-release-readiness/slice.json +92 -0
- package/src/create-quiver/commands/ai.js +1060 -37
- package/src/create-quiver/commands/demo.js +22 -0
- package/src/create-quiver/commands/evidence.js +37 -0
- package/src/create-quiver/commands/flow.js +562 -0
- package/src/create-quiver/commands/graph.js +19 -4
- package/src/create-quiver/commands/next.js +28 -0
- package/src/create-quiver/commands/plan.js +9 -6
- package/src/create-quiver/commands/prepare.js +236 -0
- package/src/create-quiver/commands/spec.js +133 -0
- package/src/create-quiver/index.js +1010 -31
- package/src/create-quiver/lib/actionable-error.js +27 -0
- package/src/create-quiver/lib/agent-profiles.js +148 -0
- package/src/create-quiver/lib/ai/context-packs.js +16 -0
- package/src/create-quiver/lib/ai/execution-plan.js +377 -11
- package/src/create-quiver/lib/ai/executor.js +633 -24
- package/src/create-quiver/lib/ai/export-state.js +534 -0
- package/src/create-quiver/lib/ai/github.js +279 -0
- package/src/create-quiver/lib/ai/onboarding-template.js +578 -0
- package/src/create-quiver/lib/ai/plan-review.js +286 -0
- package/src/create-quiver/lib/ai/providers.js +5 -3
- package/src/create-quiver/lib/ai/run-state.js +414 -0
- package/src/create-quiver/lib/ai/safety.js +5 -0
- package/src/create-quiver/lib/ai/spec-generator.js +12 -0
- package/src/create-quiver/lib/ai/spec-templates.js +80 -11
- package/src/create-quiver/lib/approvals.js +369 -0
- package/src/create-quiver/lib/demo.js +832 -0
- package/src/create-quiver/lib/doctor.js +309 -0
- package/src/create-quiver/lib/evidence.js +115 -0
- package/src/create-quiver/lib/handoff.js +81 -12
- package/src/create-quiver/lib/init-docs.js +302 -17
- package/src/create-quiver/lib/init-layout.js +34 -1
- package/src/create-quiver/lib/json.js +53 -3
- package/src/create-quiver/lib/lifecycle.js +6 -0
- package/src/create-quiver/lib/package-safety.js +117 -0
- package/src/create-quiver/lib/readiness.js +103 -21
- package/src/create-quiver/lib/scope.js +50 -7
- package/src/create-quiver/lib/slice-graph.js +138 -37
- package/src/create-quiver/lib/slice.js +14 -9
- package/src/create-quiver/lib/spec-worktrees.js +363 -0
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
const fs = require('node:fs');
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
|
|
4
|
+
const { getPreparedContextDocPaths } = require('./context-packs');
|
|
5
|
+
|
|
6
|
+
const PROMPT_SOURCE = 'packaged planner onboarding template';
|
|
7
|
+
const PACKAGE_ROOT = path.resolve(__dirname, '../../../..');
|
|
8
|
+
|
|
9
|
+
const ONBOARDING_DOCS = Object.freeze([
|
|
10
|
+
['README.md', 'project entrypoint and human summary'],
|
|
11
|
+
['AGENTS.md', 'agent router and reading rules'],
|
|
12
|
+
['docs/INDEX.md', 'index-first navigation map'],
|
|
13
|
+
['docs/PROJECT_MAP.md', 'stack, commands, and structure facts'],
|
|
14
|
+
['docs/AI_CONTEXT.md', 'AI working contract'],
|
|
15
|
+
['docs/AI_ONBOARDING_PROMPT.md', 'project-specific onboarding contract'],
|
|
16
|
+
['docs/CONTEXTO.md', 'human-readable project context'],
|
|
17
|
+
['docs/WORKFLOW.md', 'WDD/SDD workflow rules'],
|
|
18
|
+
['docs/STATUS.md', 'current state and open risks'],
|
|
19
|
+
['docs/DECISIONS.md', 'durable decisions'],
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
const OMITTED_BY_DEFAULT = Object.freeze([
|
|
23
|
+
'Do not read all docs/ recursively by default.',
|
|
24
|
+
'Do not read source trees until the selected docs identify relevant files.',
|
|
25
|
+
'Do not read dependency folders, generated outputs, caches, secrets, or local AI state.',
|
|
26
|
+
'Use .quiver/scans/PROJECT_SCAN.json only when docs/PROJECT_MAP.md is not enough.',
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
const CONTEXT_PREP_SOURCE_DOCS = Object.freeze([
|
|
30
|
+
['README.md', 'project entrypoint and human summary'],
|
|
31
|
+
['AGENTS.md', 'agent router and reading rules'],
|
|
32
|
+
['README_FOR_AI.md', 'framework guidance source; not project debt when absent'],
|
|
33
|
+
['docs/INDEX.md', 'index-first navigation map'],
|
|
34
|
+
['docs/PROJECT_MAP.md', 'stack, commands, and structure facts'],
|
|
35
|
+
['docs/WORKFLOW.md', 'workflow rules and execution contract'],
|
|
36
|
+
['docs/AI_CONTEXT.md', 'agent-facing project context pack'],
|
|
37
|
+
['docs/AI_ONBOARDING_PROMPT.md', 'project-specific onboarding contract'],
|
|
38
|
+
['docs/CONTEXTO.md', 'human-readable project context'],
|
|
39
|
+
['docs/STATUS.md', 'current state and open risks'],
|
|
40
|
+
['docs/DECISIONS.md', 'durable decisions log'],
|
|
41
|
+
]);
|
|
42
|
+
|
|
43
|
+
function hasPath(projectRoot, relativePath) {
|
|
44
|
+
return fs.existsSync(path.join(projectRoot, relativePath));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function toProjectSlug(projectName) {
|
|
48
|
+
return String(projectName || '')
|
|
49
|
+
.normalize('NFKD')
|
|
50
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
51
|
+
.toLowerCase()
|
|
52
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
53
|
+
.replace(/^-+|-+$/g, '') || 'quiver-project';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function readProjectName(projectRoot) {
|
|
57
|
+
const packageJsonPath = path.join(projectRoot, 'package.json');
|
|
58
|
+
if (fs.existsSync(packageJsonPath)) {
|
|
59
|
+
try {
|
|
60
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
61
|
+
if (typeof packageJson.name === 'string' && packageJson.name.trim()) {
|
|
62
|
+
return packageJson.name.trim();
|
|
63
|
+
}
|
|
64
|
+
} catch {
|
|
65
|
+
// Best effort only. Fall back to the directory name when package.json is unreadable.
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return path.basename(projectRoot) || 'Quiver Project';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function renderTemplate(text, replacements) {
|
|
73
|
+
return text
|
|
74
|
+
.replace(/{{PROJECT_NAME}}/g, replacements.projectName)
|
|
75
|
+
.replace(/{{PROJECT_SLUG}}/g, replacements.projectSlug)
|
|
76
|
+
.replace(/\[project\]/g, replacements.projectSlug)
|
|
77
|
+
.replace(/\[project-name\]/g, replacements.projectSlug)
|
|
78
|
+
.replace(/\[project-slug\]/g, replacements.projectSlug)
|
|
79
|
+
.replace(/{{FECHA}}/g, replacements.currentDate)
|
|
80
|
+
.replace(/{{FECHA_PROXIMA}}/g, replacements.datePlus7 || replacements.currentDate)
|
|
81
|
+
.replace(/{{FECHA_PROXIMA_MES}}/g, replacements.datePlus30 || replacements.currentDate)
|
|
82
|
+
.replace(/{{FECHA_LAUNCH}}/g, replacements.datePlus35 || replacements.currentDate)
|
|
83
|
+
.replace(/{{ESTADO}}/g, replacements.estado || 'En preparación')
|
|
84
|
+
.replace(/{{FASE}}/g, replacements.fase || 'Fase 0')
|
|
85
|
+
.replace(/{{X}}%/g, `${typeof replacements.progress === 'number' ? replacements.progress : 0}%`)
|
|
86
|
+
.replace(/{{PACKAGE_MANAGER}}/g, replacements.packageManager || 'npm')
|
|
87
|
+
.replace(/{{STACK_SUMMARY}}/g, replacements.stackSummary || 'unknown until analyze')
|
|
88
|
+
.replace(/{{PRIMARY_INSTALL}}/g, replacements.primaryInstall || 'npm install')
|
|
89
|
+
.replace(/{{PRIMARY_DEV}}/g, replacements.primaryDev || 'not defined')
|
|
90
|
+
.replace(/{{PRIMARY_TEST}}/g, replacements.primaryTest || 'not defined')
|
|
91
|
+
.replace(/{{ANALYZE_COMMAND}}/g, replacements.analyzeCommand || 'npx create-quiver analyze')
|
|
92
|
+
.replace(/{{PLAN_COMMAND}}/g, replacements.planCommand || 'npx create-quiver plan')
|
|
93
|
+
.replace(/{{GRAPH_COMMAND}}/g, replacements.graphCommand || 'npx create-quiver graph')
|
|
94
|
+
.replace(/{{NEXT_COMMAND}}/g, replacements.nextCommand || 'npx create-quiver next')
|
|
95
|
+
.replace(/{{DOCTOR_COMMAND}}/g, replacements.doctorCommand || 'npx create-quiver doctor')
|
|
96
|
+
.replace(/{{START_SLICE_COMMAND}}/g, replacements.startSliceCommand || 'npx create-quiver start-slice <slice.json>')
|
|
97
|
+
.replace(/{{CHECK_SLICE_COMMAND}}/g, replacements.checkSliceCommand || 'npx create-quiver check-slice <slice.json>')
|
|
98
|
+
.replace(/{{CHECK_PR_COMMAND}}/g, replacements.checkPrCommand || 'npx create-quiver check-pr <slice.json>')
|
|
99
|
+
.replace(/{{CLEANUP_SLICE_COMMAND}}/g, replacements.cleanupSliceCommand || 'npx create-quiver cleanup-slice <slice.json>')
|
|
100
|
+
.replace(/{{CHECK_SCOPE_COMMAND}}/g, replacements.checkScopeCommand || 'npx create-quiver check-scope <slice.json>')
|
|
101
|
+
.replace(/{{REFRESH_ACTIVE_SLICES_COMMAND}}/g, replacements.refreshActiveSlicesCommand || 'npx create-quiver refresh-active-slices');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function uniq(values) {
|
|
105
|
+
return Array.from(new Set((Array.isArray(values) ? values : []).filter(Boolean)));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function markPendingConfirmation(value) {
|
|
109
|
+
const text = String(value || '').trim();
|
|
110
|
+
if (!text || /^(TODO|Assumption|Pending confirmation):/i.test(text)) {
|
|
111
|
+
return text;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return `Pending confirmation: ${text}`;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function readJsonIfExists(filePath) {
|
|
118
|
+
if (!fs.existsSync(filePath)) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
try {
|
|
123
|
+
return JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
124
|
+
} catch {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function detectPackageManager(projectRoot) {
|
|
130
|
+
if (hasPath(projectRoot, 'bun.lockb') || hasPath(projectRoot, 'bun.lock')) return 'bun';
|
|
131
|
+
if (hasPath(projectRoot, 'pnpm-lock.yaml')) return 'pnpm';
|
|
132
|
+
if (hasPath(projectRoot, 'yarn.lock')) return 'yarn';
|
|
133
|
+
return 'npm';
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function detectSourceDirectories(projectRoot) {
|
|
137
|
+
const names = ['src', 'app', 'apps', 'packages', 'lib', 'server', 'client', 'web'];
|
|
138
|
+
return names.filter((name) => {
|
|
139
|
+
try {
|
|
140
|
+
return fs.statSync(path.join(projectRoot, name)).isDirectory();
|
|
141
|
+
} catch {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function collectRootNames(projectRoot) {
|
|
148
|
+
try {
|
|
149
|
+
return fs.readdirSync(projectRoot, { withFileTypes: true })
|
|
150
|
+
.filter((entry) => !entry.name.startsWith('.') && entry.name !== 'node_modules')
|
|
151
|
+
.map((entry) => `${entry.name}${entry.isDirectory() ? '/' : ''}`)
|
|
152
|
+
.slice(0, 20);
|
|
153
|
+
} catch {
|
|
154
|
+
return [];
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function detectStackSummary(packageJson, projectRoot) {
|
|
159
|
+
const dependencies = {
|
|
160
|
+
...(packageJson?.dependencies || {}),
|
|
161
|
+
...(packageJson?.devDependencies || {}),
|
|
162
|
+
};
|
|
163
|
+
const signals = [];
|
|
164
|
+
|
|
165
|
+
if (dependencies.next || hasPath(projectRoot, 'next.config.js') || hasPath(projectRoot, 'next.config.mjs')) signals.push('Next.js');
|
|
166
|
+
if (dependencies.vite || hasPath(projectRoot, 'vite.config.js') || hasPath(projectRoot, 'vite.config.ts')) signals.push('Vite');
|
|
167
|
+
if (dependencies.react) signals.push('React');
|
|
168
|
+
if (dependencies.vue) signals.push('Vue');
|
|
169
|
+
if (dependencies.angular || dependencies['@angular/core'] || hasPath(projectRoot, 'angular.json')) signals.push('Angular');
|
|
170
|
+
if (dependencies.svelte || hasPath(projectRoot, 'svelte.config.js')) signals.push('Svelte');
|
|
171
|
+
if (dependencies.express) signals.push('Express');
|
|
172
|
+
if (hasPath(projectRoot, 'pyproject.toml') || hasPath(projectRoot, 'requirements.txt')) signals.push('Python');
|
|
173
|
+
if (hasPath(projectRoot, 'go.mod')) signals.push('Go');
|
|
174
|
+
|
|
175
|
+
return signals.length > 0 ? signals.join(', ') : 'Pending confirmation: no primary stack could be inferred from root signals.';
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function collectProjectFacts(projectRoot) {
|
|
179
|
+
const packageJson = readJsonIfExists(path.join(projectRoot, 'package.json'));
|
|
180
|
+
const scripts = packageJson?.scripts && typeof packageJson.scripts === 'object' ? packageJson.scripts : {};
|
|
181
|
+
const packageManager = packageJson?.packageManager
|
|
182
|
+
? String(packageJson.packageManager).split('@')[0]
|
|
183
|
+
: detectPackageManager(projectRoot);
|
|
184
|
+
|
|
185
|
+
return {
|
|
186
|
+
packageJsonPresent: Boolean(packageJson),
|
|
187
|
+
packageManager,
|
|
188
|
+
stackSummary: detectStackSummary(packageJson, projectRoot),
|
|
189
|
+
scripts,
|
|
190
|
+
rootNames: collectRootNames(projectRoot),
|
|
191
|
+
sourceDirectories: detectSourceDirectories(projectRoot),
|
|
192
|
+
commands: {
|
|
193
|
+
install: packageManager === 'pnpm' ? 'pnpm install' : packageManager === 'yarn' ? 'yarn install' : packageManager === 'bun' ? 'bun install' : 'npm install',
|
|
194
|
+
dev: scripts.dev || scripts.start || 'Pending confirmation: no dev/start script detected.',
|
|
195
|
+
build: scripts.build || 'Pending confirmation: no build script detected.',
|
|
196
|
+
test: scripts.test || 'Pending confirmation: no test script detected.',
|
|
197
|
+
lint: scripts.lint || 'Pending confirmation: no lint script detected.',
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function readProjectMapField(projectRoot, label) {
|
|
203
|
+
const filePath = path.join(projectRoot, 'docs', 'PROJECT_MAP.md');
|
|
204
|
+
if (!fs.existsSync(filePath)) {
|
|
205
|
+
return '';
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const text = fs.readFileSync(filePath, 'utf8');
|
|
209
|
+
const escaped = label.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
210
|
+
const match = text.match(new RegExp(`^- ${escaped}:\\s*(.+)$`, 'mi'));
|
|
211
|
+
return match ? match[1].trim() : '';
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function collectContextContradictions(projectRoot, plan, facts) {
|
|
215
|
+
const contradictions = [];
|
|
216
|
+
const mappedName = readProjectMapField(projectRoot, 'Name');
|
|
217
|
+
const mappedPackageManager = readProjectMapField(projectRoot, 'Package manager');
|
|
218
|
+
|
|
219
|
+
if (mappedName && mappedName !== plan.projectName) {
|
|
220
|
+
contradictions.push(`docs/PROJECT_MAP.md reports project name '${mappedName}', but package/root identity resolves to '${plan.projectName}'.`);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (mappedPackageManager && mappedPackageManager !== facts.packageManager) {
|
|
224
|
+
contradictions.push(`docs/PROJECT_MAP.md reports package manager '${mappedPackageManager}', but current root signals resolve to '${facts.packageManager}'.`);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return contradictions.map(markPendingConfirmation);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function formatDocStatusLines(items) {
|
|
231
|
+
if (!Array.isArray(items) || items.length === 0) {
|
|
232
|
+
return ['- none'];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return items.map((item) => {
|
|
236
|
+
const status = item.present ? 'present' : 'absent';
|
|
237
|
+
const note = item.reason ? ` (${item.reason})` : '';
|
|
238
|
+
return `- ${item.path}: ${status}${note}`;
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function formatSimpleBullets(items, emptyLabel = 'none') {
|
|
243
|
+
if (!Array.isArray(items) || items.length === 0) {
|
|
244
|
+
return [`- ${emptyLabel}`];
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return items.map((item) => `- ${item}`);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function resolveProjectIdentity(projectRoot) {
|
|
251
|
+
const projectName = readProjectName(projectRoot);
|
|
252
|
+
return {
|
|
253
|
+
projectName,
|
|
254
|
+
projectSlug: toProjectSlug(projectName),
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function collectOnboardingContextPlan(projectRoot) {
|
|
259
|
+
const docs = ONBOARDING_DOCS.map(([relativePath, reason]) => ({
|
|
260
|
+
path: relativePath,
|
|
261
|
+
reason,
|
|
262
|
+
present: hasPath(projectRoot, relativePath),
|
|
263
|
+
}));
|
|
264
|
+
const selectedDocs = docs.filter((item) => item.present);
|
|
265
|
+
const missingDocs = docs.filter((item) => !item.present);
|
|
266
|
+
const assumptions = [];
|
|
267
|
+
const risks = [];
|
|
268
|
+
|
|
269
|
+
if (!hasPath(projectRoot, 'docs/INDEX.md')) {
|
|
270
|
+
risks.push('docs/INDEX.md is missing, so the planner cannot use index-first navigation.');
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (!hasPath(projectRoot, 'docs/PROJECT_MAP.md')) {
|
|
274
|
+
risks.push('docs/PROJECT_MAP.md is missing; run analyze before broad onboarding.');
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (!hasPath(projectRoot, 'docs/AI_ONBOARDING_PROMPT.md')) {
|
|
278
|
+
risks.push('docs/AI_ONBOARDING_PROMPT.md is missing; project-specific onboarding may be incomplete.');
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (selectedDocs.length === 0) {
|
|
282
|
+
assumptions.push('No onboarding docs were detected; use README.md or initialize Quiver first.');
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return {
|
|
286
|
+
promptSource: PROMPT_SOURCE,
|
|
287
|
+
selectedDocs,
|
|
288
|
+
missingDocs,
|
|
289
|
+
omittedByDefault: OMITTED_BY_DEFAULT.slice(),
|
|
290
|
+
assumptions,
|
|
291
|
+
risks,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function collectContextPreparationPlan(projectRoot) {
|
|
296
|
+
const onboardingPlan = collectOnboardingContextPlan(projectRoot);
|
|
297
|
+
const identity = resolveProjectIdentity(projectRoot);
|
|
298
|
+
const facts = collectProjectFacts(projectRoot);
|
|
299
|
+
const filesConsidered = CONTEXT_PREP_SOURCE_DOCS.map(([relativePath, reason]) => ({
|
|
300
|
+
path: relativePath,
|
|
301
|
+
reason,
|
|
302
|
+
present: hasPath(projectRoot, relativePath),
|
|
303
|
+
}));
|
|
304
|
+
const assumptions = uniq([
|
|
305
|
+
...onboardingPlan.assumptions,
|
|
306
|
+
!hasPath(projectRoot, 'README_FOR_AI.md')
|
|
307
|
+
? 'Assumption: README_FOR_AI.md is framework guidance only and is not counted as generated-project debt when absent.'
|
|
308
|
+
: null,
|
|
309
|
+
]);
|
|
310
|
+
const risks = uniq([
|
|
311
|
+
...onboardingPlan.risks.map(markPendingConfirmation),
|
|
312
|
+
!hasPath(projectRoot, 'docs/PROJECT_MAP.md')
|
|
313
|
+
? 'Pending confirmation: docs/PROJECT_MAP.md is missing, so the draft must stay on documented facts only.'
|
|
314
|
+
: null,
|
|
315
|
+
!hasPath(projectRoot, 'docs/INDEX.md')
|
|
316
|
+
? 'Pending confirmation: docs/INDEX.md is missing, so navigation should stay conservative and index-first.'
|
|
317
|
+
: null,
|
|
318
|
+
]);
|
|
319
|
+
const plan = {
|
|
320
|
+
...onboardingPlan,
|
|
321
|
+
...identity,
|
|
322
|
+
approvedDocPaths: getPreparedContextDocPaths(),
|
|
323
|
+
filesConsidered,
|
|
324
|
+
omittedPaths: onboardingPlan.omittedByDefault.slice(),
|
|
325
|
+
assumptions,
|
|
326
|
+
risks,
|
|
327
|
+
facts,
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
return {
|
|
331
|
+
...plan,
|
|
332
|
+
contradictions: collectContextContradictions(projectRoot, plan, facts),
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function buildContextPreparationNotes(plan) {
|
|
337
|
+
const lines = [
|
|
338
|
+
'## Context Preparation Notes',
|
|
339
|
+
'- TODO: confirm any repo fact that is not supported by README.md, AGENTS.md, docs/INDEX.md, or docs/PROJECT_MAP.md.',
|
|
340
|
+
'- Assumption: missing README_FOR_AI.md in a generated project is guidance-only and not project debt.',
|
|
341
|
+
'- Pending confirmation: keep writes limited to docs/context files and never product code.',
|
|
342
|
+
'',
|
|
343
|
+
'### Files Considered',
|
|
344
|
+
...formatDocStatusLines(plan.filesConsidered),
|
|
345
|
+
'',
|
|
346
|
+
'### Assumptions',
|
|
347
|
+
...formatSimpleBullets(plan.assumptions, 'none'),
|
|
348
|
+
'',
|
|
349
|
+
'### Risks',
|
|
350
|
+
...formatSimpleBullets(plan.risks, 'none'),
|
|
351
|
+
'',
|
|
352
|
+
'### Contradictions',
|
|
353
|
+
...formatSimpleBullets(plan.contradictions, 'none'),
|
|
354
|
+
'',
|
|
355
|
+
'### Omitted Paths',
|
|
356
|
+
...formatSimpleBullets(plan.omittedPaths, 'none'),
|
|
357
|
+
];
|
|
358
|
+
|
|
359
|
+
return `${lines.join('\n')}\n`;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
function appendNotes(body, notes) {
|
|
363
|
+
const trimmedBody = String(body || '').replace(/\s+$/g, '');
|
|
364
|
+
const trimmedNotes = String(notes || '').trimEnd();
|
|
365
|
+
return `${trimmedBody}\n\n${trimmedNotes}\n`;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
function readTemplate(relativePath) {
|
|
369
|
+
return fs.readFileSync(path.join(PACKAGE_ROOT, relativePath), 'utf8');
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
function renderProjectMapDraft(plan) {
|
|
373
|
+
const facts = plan.facts;
|
|
374
|
+
const lines = [
|
|
375
|
+
'# Project Map',
|
|
376
|
+
'',
|
|
377
|
+
'This file was prepared by `npx create-quiver ai prepare-context`.',
|
|
378
|
+
'Run `npx create-quiver analyze` to refresh it with a deeper repository scan.',
|
|
379
|
+
'',
|
|
380
|
+
'## Project',
|
|
381
|
+
`- Name: ${plan.projectName}`,
|
|
382
|
+
`- Slug: ${plan.projectSlug}`,
|
|
383
|
+
`- Package manager: ${facts.packageManager}`,
|
|
384
|
+
`- package.json present: ${facts.packageJsonPresent ? 'yes' : 'no'}`,
|
|
385
|
+
`- Stack summary: ${facts.stackSummary}`,
|
|
386
|
+
'',
|
|
387
|
+
'## Commands',
|
|
388
|
+
`- Install: ${facts.commands.install}`,
|
|
389
|
+
`- Dev: ${facts.commands.dev}`,
|
|
390
|
+
`- Build: ${facts.commands.build}`,
|
|
391
|
+
`- Test: ${facts.commands.test}`,
|
|
392
|
+
`- Lint: ${facts.commands.lint}`,
|
|
393
|
+
'',
|
|
394
|
+
'## Structure',
|
|
395
|
+
`- Source directories: ${facts.sourceDirectories.length > 0 ? facts.sourceDirectories.join(', ') : 'Pending confirmation: no common source directory detected.'}`,
|
|
396
|
+
`- Root entries: ${facts.rootNames.length > 0 ? facts.rootNames.join(', ') : 'Pending confirmation: root entries could not be listed.'}`,
|
|
397
|
+
'',
|
|
398
|
+
'## Assumptions',
|
|
399
|
+
...formatSimpleBullets(plan.assumptions, 'none'),
|
|
400
|
+
'',
|
|
401
|
+
'## Risks',
|
|
402
|
+
...formatSimpleBullets(plan.risks, 'none'),
|
|
403
|
+
'',
|
|
404
|
+
'## Contradictions',
|
|
405
|
+
...formatSimpleBullets(plan.contradictions, 'none'),
|
|
406
|
+
];
|
|
407
|
+
|
|
408
|
+
return `${lines.join('\n')}\n`;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function renderArchitectureDraft(plan) {
|
|
412
|
+
const facts = plan.facts;
|
|
413
|
+
const lines = [
|
|
414
|
+
`# ${plan.projectName} Architecture`,
|
|
415
|
+
'',
|
|
416
|
+
'This document captures only what Quiver can infer safely from repository structure and docs.',
|
|
417
|
+
'',
|
|
418
|
+
'## Current Understanding',
|
|
419
|
+
`- Stack: ${facts.stackSummary}`,
|
|
420
|
+
`- Source directories: ${facts.sourceDirectories.length > 0 ? facts.sourceDirectories.join(', ') : 'Pending confirmation: no common source directory detected.'}`,
|
|
421
|
+
`- Package manager: ${facts.packageManager}`,
|
|
422
|
+
'',
|
|
423
|
+
'## Boundaries',
|
|
424
|
+
'- TODO: confirm application boundaries with the team.',
|
|
425
|
+
'- Pending confirmation: no architecture decision should be treated as approved unless it appears in `docs/DECISIONS.md` or an approved spec.',
|
|
426
|
+
'',
|
|
427
|
+
'## Commands That Shape Architecture',
|
|
428
|
+
`- Build: ${facts.commands.build}`,
|
|
429
|
+
`- Test: ${facts.commands.test}`,
|
|
430
|
+
`- Lint: ${facts.commands.lint}`,
|
|
431
|
+
'',
|
|
432
|
+
'## Risks',
|
|
433
|
+
...formatSimpleBullets(plan.risks, 'none'),
|
|
434
|
+
'',
|
|
435
|
+
'## Contradictions',
|
|
436
|
+
...formatSimpleBullets(plan.contradictions, 'none'),
|
|
437
|
+
];
|
|
438
|
+
|
|
439
|
+
return `${lines.join('\n')}\n`;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function buildContextPreparationDrafts(projectRoot) {
|
|
443
|
+
const plan = collectContextPreparationPlan(projectRoot);
|
|
444
|
+
const currentDate = new Date().toISOString().slice(0, 10);
|
|
445
|
+
const replacements = {
|
|
446
|
+
currentDate,
|
|
447
|
+
projectName: plan.projectName,
|
|
448
|
+
projectSlug: plan.projectSlug,
|
|
449
|
+
estado: 'En preparación',
|
|
450
|
+
fase: 'Fase 0',
|
|
451
|
+
progress: 0,
|
|
452
|
+
packageManager: plan.facts.packageManager,
|
|
453
|
+
stackSummary: plan.facts.stackSummary,
|
|
454
|
+
primaryInstall: plan.facts.commands.install,
|
|
455
|
+
primaryDev: plan.facts.commands.dev,
|
|
456
|
+
primaryTest: plan.facts.commands.test,
|
|
457
|
+
};
|
|
458
|
+
const notes = buildContextPreparationNotes(plan);
|
|
459
|
+
const decisionSection = [
|
|
460
|
+
'## Context Preparation Decisions',
|
|
461
|
+
'| Date | Decision | Reason | Alternatives | Impact |',
|
|
462
|
+
`| ${currentDate} | README_FOR_AI.md absence in generated projects is guidance-only, not project debt | Keeps prepare output aligned with generated repos. | Report it as debt | Dry-runs stay accurate and less noisy |`,
|
|
463
|
+
`| ${currentDate} | ai prepare-context must remain docs-only | Keeps context prep from touching product code. | Broader write targets | Draft generation stays safe and reviewable |`,
|
|
464
|
+
].join('\n');
|
|
465
|
+
const docs = [
|
|
466
|
+
{
|
|
467
|
+
path: 'docs/INDEX.md',
|
|
468
|
+
content: appendNotes(renderTemplate(readTemplate('docs/INDEX.md.template'), replacements), notes),
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
path: 'docs/PROJECT_MAP.md',
|
|
472
|
+
content: appendNotes(renderProjectMapDraft(plan), notes),
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
path: 'docs/AI_CONTEXT.md',
|
|
476
|
+
content: appendNotes(renderTemplate(readTemplate('docs/AI_CONTEXT.md.template'), replacements), notes),
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
path: 'docs/AI_ONBOARDING_PROMPT.md',
|
|
480
|
+
content: appendNotes(renderTemplate(readTemplate('docs/AI_ONBOARDING_PROMPT.md.template'), replacements), notes),
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
path: 'docs/CONTEXTO.md',
|
|
484
|
+
content: appendNotes(renderTemplate(readTemplate('docs/CONTEXTO.md.template'), replacements), notes),
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
path: 'docs/WORKFLOW.md',
|
|
488
|
+
content: appendNotes(renderTemplate(readTemplate('docs/WORKFLOW.md.template'), replacements), notes),
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
path: 'docs/ARCHITECTURE.md',
|
|
492
|
+
content: appendNotes(renderArchitectureDraft(plan), notes),
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
path: 'docs/STATUS.md',
|
|
496
|
+
content: appendNotes(renderTemplate(readTemplate('docs/STATUS.md.template'), replacements), notes),
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
path: 'docs/DECISIONS.md',
|
|
500
|
+
content: appendNotes(renderTemplate(readTemplate('docs/DECISIONS.md.template'), replacements), decisionSection),
|
|
501
|
+
},
|
|
502
|
+
];
|
|
503
|
+
|
|
504
|
+
return {
|
|
505
|
+
docs,
|
|
506
|
+
plan,
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
function formatDocBullets(items) {
|
|
511
|
+
if (!Array.isArray(items) || items.length === 0) {
|
|
512
|
+
return ['- none'];
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
return items.map((item) => `- ${item.path}: ${item.reason}`);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
function buildPlannerOnboardingPrompt({ pack, inputText, inputPath, repoRoot }) {
|
|
519
|
+
const plan = collectOnboardingContextPlan(repoRoot);
|
|
520
|
+
const sections = [
|
|
521
|
+
pack.prompt,
|
|
522
|
+
'Task: planner onboarding for this repository.',
|
|
523
|
+
'Goal: understand the project context and prepare safe WDD/SDD work with the smallest useful context.',
|
|
524
|
+
'Rules:',
|
|
525
|
+
'- Start with README.md and AGENTS.md when present.',
|
|
526
|
+
'- Then read docs/INDEX.md as the navigation map when present.',
|
|
527
|
+
'- Use docs/INDEX.md to choose only the docs needed for the current task.',
|
|
528
|
+
'- Do not read all docs/ recursively by default.',
|
|
529
|
+
'- Do not modify product code.',
|
|
530
|
+
'- Do not modify product code during onboarding.',
|
|
531
|
+
'- Do not invent architecture, workflow, roles, domain rules, or conventions.',
|
|
532
|
+
'- Report assumptions, risks, missing docs, and files read.',
|
|
533
|
+
'Selected docs to inspect first:',
|
|
534
|
+
...formatDocBullets(plan.selectedDocs),
|
|
535
|
+
'Documentation debt to report if relevant:',
|
|
536
|
+
...formatDocBullets(plan.missingDocs),
|
|
537
|
+
'Omit by default:',
|
|
538
|
+
...plan.omittedByDefault.map((item) => `- ${item}`),
|
|
539
|
+
];
|
|
540
|
+
|
|
541
|
+
if (inputPath) {
|
|
542
|
+
sections.push(`Input file: ${inputPath}`);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
if (inputText) {
|
|
546
|
+
sections.push('Input:', inputText.trimEnd());
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
sections.push(
|
|
550
|
+
'Expected output:',
|
|
551
|
+
'- Files read.',
|
|
552
|
+
'- Files created or modified.',
|
|
553
|
+
'- Product code status.',
|
|
554
|
+
'- Project context prepared.',
|
|
555
|
+
'- WDD/SDD understanding based only on repo docs.',
|
|
556
|
+
'- Assumptions.',
|
|
557
|
+
'- Risks and blockers.',
|
|
558
|
+
'- Next safe steps.',
|
|
559
|
+
);
|
|
560
|
+
|
|
561
|
+
return {
|
|
562
|
+
plan,
|
|
563
|
+
prompt: sections.join('\n\n'),
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
module.exports = {
|
|
568
|
+
CONTEXT_PREP_SOURCE_DOCS,
|
|
569
|
+
OMITTED_BY_DEFAULT,
|
|
570
|
+
ONBOARDING_DOCS,
|
|
571
|
+
PROMPT_SOURCE,
|
|
572
|
+
buildContextPreparationDrafts,
|
|
573
|
+
buildContextPreparationPlan: collectContextPreparationPlan,
|
|
574
|
+
buildPlannerOnboardingPrompt,
|
|
575
|
+
collectOnboardingContextPlan,
|
|
576
|
+
resolveProjectIdentity,
|
|
577
|
+
renderTemplate,
|
|
578
|
+
};
|