mandrel 2.0.0 → 2.2.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/.agents/README.md +59 -28
- package/.agents/agents/acceptance-critic.md +20 -9
- package/.agents/agents/story-worker.md +45 -48
- package/.agents/audit-checklists/performance.md +1 -1
- package/.agents/docs/SDLC.md +60 -46
- package/.agents/docs/agentrc-reference.json +8 -13
- package/.agents/docs/configuration.md +33 -57
- package/.agents/docs/execution-reference.md +39 -10
- package/.agents/docs/quality-gates.md +17 -19
- package/.agents/docs/workflows.md +6 -6
- package/.agents/instructions.md +64 -79
- package/.agents/rules/ci-remediation.md +3 -3
- package/.agents/rules/gherkin-standards.md +10 -0
- package/.agents/rules/git-conventions-reference.md +42 -51
- package/.agents/schemas/acceptance-eval-verdict.schema.json +2 -2
- package/.agents/schemas/agentrc.schema.json +35 -46
- package/.agents/schemas/audit-rules.json +59 -1
- package/.agents/schemas/audit-rules.schema.json +33 -1
- package/.agents/schemas/lifecycle/README.md +1 -2
- package/.agents/schemas/lifecycle/ledger-record.schema.json +1 -1
- package/.agents/schemas/lifecycle/merge.flip-failed.schema.json +33 -0
- package/.agents/schemas/lifecycle/merge.unlanded.schema.json +1 -0
- package/.agents/schemas/lifecycle/story.merged.schema.json +1 -1
- package/.agents/schemas/signal-event.schema.json +3 -3
- package/.agents/schemas/story-deliver-terminal.schema.json +152 -0
- package/.agents/schemas/validation-evidence.schema.json +1 -1
- package/.agents/scripts/acceptance-eval.js +24 -68
- package/.agents/scripts/agents-bootstrap-github.js +1 -1
- package/.agents/scripts/bootstrap.js +3 -3
- package/.agents/scripts/check-dead-exports.js +43 -104
- package/.agents/scripts/check-doc-links.js +2 -2
- package/.agents/scripts/check-lifecycle-lint.js +1 -1
- package/.agents/scripts/check-workflow-cli-lint.js +91 -0
- package/.agents/scripts/deliver-recover.js +122 -0
- package/.agents/scripts/drain-pending-cleanup.js +1 -1
- package/.agents/scripts/evidence-gate.js +20 -50
- package/.agents/scripts/generate-skills-index.js +17 -1
- package/.agents/scripts/generate-workflows-doc.js +4 -4
- package/.agents/scripts/lib/ITicketingProvider.js +1 -19
- package/.agents/scripts/lib/audit-suite/selector.js +323 -23
- package/.agents/scripts/lib/baselines/kinds/maintainability.js +0 -11
- package/.agents/scripts/lib/bootstrap/ci-workflow-template.js +28 -33
- package/.agents/scripts/lib/bootstrap/manifest.js +8 -11
- package/.agents/scripts/lib/bootstrap/project-bootstrap.js +30 -53
- package/.agents/scripts/lib/bootstrap/quality-bootstrap.js +0 -2
- package/.agents/scripts/lib/checks/core-bare-clean.js +4 -1
- package/.agents/scripts/lib/checks/index.js +1 -1
- package/.agents/scripts/lib/checks/loop-health.js +12 -11
- package/.agents/scripts/lib/checks/state.js +17 -248
- package/.agents/scripts/lib/checks/story-init-not-backgrounded.js +3 -3
- package/.agents/scripts/lib/checks/subagent-agent-tool-required.js +3 -4
- package/.agents/scripts/lib/checks/worktree-bootstrap-env.js +2 -2
- package/.agents/scripts/lib/checks/worktree-residue-biome.js +3 -3
- package/.agents/scripts/lib/cli-args.js +23 -2
- package/.agents/scripts/lib/close-validation/gates.js +13 -13
- package/.agents/scripts/lib/close-validation/projections/inputs.js +7 -7
- package/.agents/scripts/lib/close-validation/projections/maintainability.js +12 -12
- package/.agents/scripts/lib/close-validation/runner.js +13 -21
- package/.agents/scripts/lib/close-validation/telemetry.js +17 -8
- package/.agents/scripts/lib/config/acceptance-eval.js +2 -2
- package/.agents/scripts/lib/config/delivery-routing.js +7 -6
- package/.agents/scripts/lib/config/explain.js +10 -16
- package/.agents/scripts/lib/config/github.js +7 -5
- package/.agents/scripts/lib/config/limits.js +15 -25
- package/.agents/scripts/lib/config/quality.js +11 -14
- package/.agents/scripts/lib/config/runners.js +8 -21
- package/.agents/scripts/lib/config/temp-paths.js +18 -56
- package/.agents/scripts/lib/config-settings-schema-delivery.js +34 -16
- package/.agents/scripts/lib/config-settings-schema-quality.js +9 -2
- package/.agents/scripts/lib/config-settings-schema.js +48 -22
- package/.agents/scripts/lib/dead-exports-knip.js +105 -0
- package/.agents/scripts/lib/dead-exports-mode.js +51 -0
- package/.agents/scripts/lib/duplicate-search.js +38 -7
- package/.agents/scripts/lib/findings/promote-finding.js +23 -14
- package/.agents/scripts/lib/format-generated-json.js +97 -0
- package/.agents/scripts/lib/framework-version.js +19 -189
- package/.agents/scripts/lib/gh-exec.js +8 -0
- package/.agents/scripts/lib/git-branch-lifecycle.js +0 -158
- package/.agents/scripts/lib/git-utils.js +0 -14
- package/.agents/scripts/lib/json-utils.js +1 -2
- package/.agents/scripts/lib/label-constants.js +0 -15
- package/.agents/scripts/lib/label-taxonomy.js +1 -12
- package/.agents/scripts/lib/observability/active-story-env.js +42 -163
- package/.agents/scripts/lib/observability/runtime-friction.js +243 -0
- package/.agents/scripts/lib/observability/signal-validator.js +4 -4
- package/.agents/scripts/lib/observability/signals-writer.js +6 -82
- package/.agents/scripts/lib/observability/source-classifier.js +2 -2
- package/.agents/scripts/lib/observability/tool-trace-hook.js +2 -12
- package/.agents/scripts/lib/orchestration/acceptance-clusters.js +1 -1
- package/.agents/scripts/lib/orchestration/acceptance-eval-decision.js +2 -2
- package/.agents/scripts/lib/orchestration/ceremony-routing.js +43 -45
- package/.agents/scripts/lib/orchestration/change-set.js +103 -0
- package/.agents/scripts/lib/orchestration/code-review.js +70 -191
- package/.agents/scripts/lib/orchestration/consolidation-precondition.js +3 -3
- package/.agents/scripts/lib/orchestration/deliver-recover.js +328 -0
- package/.agents/scripts/lib/orchestration/detectors-phase.js +12 -6
- package/.agents/scripts/lib/orchestration/git-cleanup/phases/fast-forward.js +34 -0
- package/.agents/scripts/lib/orchestration/lease-guard-shared.js +3 -2
- package/.agents/scripts/lib/orchestration/lifecycle/emit-ledger-event.js +142 -0
- package/.agents/scripts/lib/orchestration/lifecycle/emit-loop-tick.js +9 -11
- package/.agents/scripts/lib/orchestration/lifecycle/emit-merge-flip-failed.js +86 -0
- package/.agents/scripts/lib/orchestration/lifecycle/emit-merge-unlanded.js +37 -103
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/README.md +7 -3
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/watcher.js +50 -85
- package/.agents/scripts/lib/orchestration/lifecycle/trace-logger.js +3 -14
- package/.agents/scripts/lib/orchestration/merge-block-class.js +76 -20
- package/.agents/scripts/lib/orchestration/merge-poll.js +104 -0
- package/.agents/scripts/lib/orchestration/plan-context.js +116 -33
- package/.agents/scripts/lib/orchestration/plan-critic-conditions.js +26 -36
- package/.agents/scripts/lib/orchestration/plan-critics-evaluate.js +31 -22
- package/.agents/scripts/lib/orchestration/plan-metrics.js +38 -6
- package/.agents/scripts/lib/orchestration/plan-persist/fan-out-gate.js +16 -6
- package/.agents/scripts/lib/orchestration/plan-persist/persist-helpers.js +173 -25
- package/.agents/scripts/lib/orchestration/plan-persist/plan-context-source.js +116 -0
- package/.agents/scripts/lib/orchestration/plan-persist/run-plan-persist.js +280 -100
- package/.agents/scripts/lib/orchestration/plan-persist/story-ops.js +472 -55
- package/.agents/scripts/lib/orchestration/plan-persist/summary.js +21 -16
- package/.agents/scripts/lib/orchestration/plan-persist/supersede-ops.js +509 -0
- package/.agents/scripts/lib/orchestration/plan-text-hygiene.js +230 -0
- package/.agents/scripts/lib/orchestration/planning/authoring-context.js +41 -40
- package/.agents/scripts/lib/orchestration/planning/decomposer-context.js +1 -2
- package/.agents/scripts/lib/orchestration/planning/spec-authoring-grounding.js +1 -1
- package/.agents/scripts/lib/orchestration/resolve-stories.js +344 -0
- package/.agents/scripts/lib/orchestration/retro-proposals.js +7 -7
- package/.agents/scripts/lib/orchestration/review-depth.js +105 -40
- package/.agents/scripts/lib/orchestration/review-providers/findings-renderer.js +3 -13
- package/.agents/scripts/lib/orchestration/review-providers/native.js +1 -154
- package/.agents/scripts/lib/orchestration/review-providers/review-depth.js +3 -2
- package/.agents/scripts/lib/orchestration/review-providers/security-review.js +1 -1
- package/.agents/scripts/lib/orchestration/review-providers/types.js +5 -4
- package/.agents/scripts/lib/orchestration/review-providers/ultrareview.js +1 -1
- package/.agents/scripts/lib/orchestration/run-epilogue.js +374 -16
- package/.agents/scripts/lib/orchestration/single-story-close/phases/auto-merge.js +24 -0
- package/.agents/scripts/lib/orchestration/single-story-close/phases/base-sync.js +11 -9
- package/.agents/scripts/lib/orchestration/single-story-close/phases/close-validation.js +4 -4
- package/.agents/scripts/lib/orchestration/single-story-close/phases/code-review.js +4 -13
- package/.agents/scripts/lib/orchestration/single-story-close/phases/confirm-merge.js +608 -152
- package/.agents/scripts/lib/orchestration/single-story-close/phases/options.js +72 -30
- package/.agents/scripts/lib/orchestration/single-story-close/phases/post-land.js +305 -0
- package/.agents/scripts/lib/orchestration/single-story-close/phases/pull-request.js +1 -1
- package/.agents/scripts/lib/orchestration/single-story-close/phases/review-block.js +12 -8
- package/.agents/scripts/lib/orchestration/single-story-close/phases/worktree-reap.js +37 -4
- package/.agents/scripts/lib/orchestration/single-story-close/phases/wrong-tree-guard.js +2 -2
- package/.agents/scripts/lib/orchestration/single-story-close/runner.js +264 -43
- package/.agents/scripts/lib/orchestration/single-story-lease-guard.js +1 -1
- package/.agents/scripts/lib/orchestration/story-close/format-autofix.js +10 -10
- package/.agents/scripts/lib/orchestration/story-close/phases/code-review.js +104 -279
- package/.agents/scripts/lib/orchestration/story-close/phases/local-lens-review.js +191 -0
- package/.agents/scripts/lib/orchestration/story-close/phases/review-core.js +120 -0
- package/.agents/scripts/lib/orchestration/story-deliver-terminal.js +360 -0
- package/.agents/scripts/lib/orchestration/story-follow-ups.js +75 -14
- package/.agents/scripts/lib/orchestration/story-init-remote.js +12 -8
- package/.agents/scripts/lib/orchestration/story-plan-state.js +14 -29
- package/.agents/scripts/lib/orchestration/task-body-validator.js +52 -7
- package/.agents/scripts/lib/orchestration/ticket-lease.js +27 -74
- package/.agents/scripts/lib/orchestration/ticket-validator-conflicts.js +119 -14
- package/.agents/scripts/lib/orchestration/ticket-validator-sizing.js +3 -4
- package/.agents/scripts/lib/orchestration/ticket-validator.js +121 -18
- package/.agents/scripts/lib/orchestration/ticketing/bulk.js +14 -47
- package/.agents/scripts/lib/orchestration/ticketing/reads.js +19 -32
- package/.agents/scripts/lib/orchestration/ticketing/transition.js +61 -1
- package/.agents/scripts/lib/orchestration/ticketing.js +0 -1
- package/.agents/scripts/lib/plan-phase-cleanup.js +12 -14
- package/.agents/scripts/lib/planning-corpus.js +12 -286
- package/.agents/scripts/lib/preflight-runner.js +2 -2
- package/.agents/scripts/lib/qa/qa-context-hydrator.js +5 -5
- package/.agents/scripts/lib/signals/index.js +4 -17
- package/.agents/scripts/lib/signals/read.js +35 -35
- package/.agents/scripts/lib/signals/schema.js +8 -11
- package/.agents/scripts/lib/signals/span-tree.js +7 -7
- package/.agents/scripts/lib/signals/write.js +0 -1
- package/.agents/scripts/lib/single-story/story-merged-notify.js +13 -2
- package/.agents/scripts/lib/skills/parse-skill.js +16 -3
- package/.agents/scripts/lib/story-adjacency.js +8 -7
- package/.agents/scripts/lib/story-body/story-body.js +81 -13
- package/.agents/scripts/lib/templates/decomposer-prompts.js +15 -16
- package/.agents/scripts/lib/test-env.js +14 -1
- package/.agents/scripts/lib/test-tiers.js +0 -3
- package/.agents/scripts/lib/ticket-body-sections.js +0 -14
- package/.agents/scripts/lib/validation-evidence.js +31 -59
- package/.agents/scripts/lib/wave-runner/live-probe.js +315 -0
- package/.agents/scripts/lib/wave-runner/ready-set.js +32 -6
- package/.agents/scripts/lib/worktree/lifecycle/pending-cleanup.js +1 -1
- package/.agents/scripts/lib/worktree/lifecycle/reap.js +68 -19
- package/.agents/scripts/lib/worktree/lifecycle-manager.js +1 -2
- package/.agents/scripts/plan-context.js +38 -7
- package/.agents/scripts/plan-critics.js +203 -0
- package/.agents/scripts/plan-persist.js +145 -35
- package/.agents/scripts/plan-run-epilogue.js +83 -38
- package/.agents/scripts/post-structured-comment.js +0 -38
- package/.agents/scripts/pr-watch-with-update.js +43 -22
- package/.agents/scripts/providers/github/compose.js +0 -1
- package/.agents/scripts/providers/github/errors.js +0 -19
- package/.agents/scripts/providers/github/issues.js +1 -11
- package/.agents/scripts/providers/github/mappers.js +5 -0
- package/.agents/scripts/providers/github/sub-issues.js +0 -47
- package/.agents/scripts/providers/github/tickets.js +33 -153
- package/.agents/scripts/providers/github.js +17 -6
- package/.agents/scripts/quality-preview.js +13 -6
- package/.agents/scripts/resolve-stories.js +236 -0
- package/.agents/scripts/run-coverage.js +4 -1
- package/.agents/scripts/run-lint.js +2 -2
- package/.agents/scripts/run-verify.js +31 -2
- package/.agents/scripts/signals-view.js +9 -10
- package/.agents/scripts/single-story-close.js +173 -18
- package/.agents/scripts/single-story-confirm-merge.js +288 -15
- package/.agents/scripts/single-story-init.js +6 -10
- package/.agents/scripts/stories-wave-tick.js +380 -53
- package/.agents/scripts/story-plan.js +3 -3
- package/.agents/scripts/update-ticket-state.js +8 -50
- package/.agents/skills/core/code-review-and-quality/SKILL.md +28 -450
- package/.agents/skills/core/code-review-and-quality/reference.md +458 -0
- package/.agents/skills/core/debugging-and-error-recovery/SKILL.md +22 -315
- package/.agents/skills/core/debugging-and-error-recovery/reference.md +323 -0
- package/.agents/skills/core/diagnose-friction/SKILL.md +14 -18
- package/.agents/skills/core/documentation-and-adrs/SKILL.md +25 -397
- package/.agents/skills/core/documentation-and-adrs/reference.md +403 -0
- package/.agents/skills/core/gates-and-baselines/SKILL.md +12 -12
- package/.agents/skills/core/idea-refinement/SKILL.md +3 -3
- package/.agents/skills/core/scope-triage/SKILL.md +3 -0
- package/.agents/skills/core/security-and-hardening/SKILL.md +22 -367
- package/.agents/skills/core/security-and-hardening/reference.md +375 -0
- package/.agents/skills/skills.index.json +2 -12
- package/.agents/skills/stack/qa/playwright-bdd/SKILL.md +2 -4
- package/.agents/skills/stack/qa/qa-explore-driving/SKILL.md +1 -1
- package/.agents/skills/stack/qa/qa-harness/SKILL.md +1 -3
- package/.agents/workflows/audit-architecture.md +3 -4
- package/.agents/workflows/audit-clean-code.md +4 -4
- package/.agents/workflows/audit-documentation.md +4 -5
- package/.agents/workflows/audit-lighthouse.md +8 -0
- package/.agents/workflows/audit-navigability.md +10 -0
- package/.agents/workflows/audit-performance.md +2 -3
- package/.agents/workflows/audit-quality.md +8 -9
- package/.agents/workflows/audit-security.md +1 -2
- package/.agents/workflows/audit-seo.md +10 -0
- package/.agents/workflows/audit-ux-ui.md +7 -0
- package/.agents/workflows/deliver.md +133 -45
- package/.agents/workflows/git-cleanup.md +2 -2
- package/.agents/workflows/git-deliver.md +1 -1
- package/.agents/workflows/helpers/acceptance-self-eval.md +34 -17
- package/.agents/workflows/helpers/code-quality-guardrails.md +15 -12
- package/.agents/workflows/helpers/code-review.md +14 -12
- package/.agents/workflows/helpers/deliver-story-reference.md +73 -32
- package/.agents/workflows/helpers/deliver-story.md +209 -118
- package/.agents/workflows/helpers/parallel-tooling.md +2 -2
- package/.agents/workflows/helpers/worktree-lifecycle.md +28 -32
- package/.agents/workflows/plan.md +239 -19
- package/.agents/workflows/qa-assist.md +6 -6
- package/.agents/workflows/qa-explore.md +3 -3
- package/.agents/workflows/qa-run.md +1 -5
- package/bin/mandrel.js +12 -1
- package/docs/CHANGELOG.md +62 -0
- package/lib/cli/registry.js +262 -19
- package/lib/cli/sync-agents.js +157 -0
- package/lib/cli/sync-commands.js +115 -6
- package/lib/cli/sync.js +168 -6
- package/lib/cli/update.js +105 -8
- package/lib/cli/version-helpers.js +131 -0
- package/lib/migrations/README.md +7 -5
- package/lib/migrations/index.js +17 -9
- package/lib/migrations/steps/2.1.0-retire-mi-drop-knobs.js +100 -0
- package/lib/migrations/steps/2.1.0-retire-verify-concurrency-cap.js +101 -0
- package/lib/migrations/steps/2.2.0-retire-epic-ac-tags.js +154 -0
- package/package.json +2 -2
- package/.agents/schemas/epic-perf-report.schema.json +0 -89
- package/.agents/schemas/lifecycle/acceptance.reconcile.failed.schema.json +0 -13
- package/.agents/schemas/lifecycle/acceptance.reconcile.ok.schema.json +0 -13
- package/.agents/schemas/lifecycle/acceptance.reconcile.skipped.schema.json +0 -13
- package/.agents/schemas/lifecycle/acceptance.reconcile.start.schema.json +0 -12
- package/.agents/schemas/lifecycle/acceptance.reconcile.waived.schema.json +0 -13
- package/.agents/schemas/lifecycle/epic.automerge.end.schema.json +0 -15
- package/.agents/schemas/lifecycle/epic.automerge.start.schema.json +0 -13
- package/.agents/schemas/lifecycle/epic.blocked.schema.json +0 -13
- package/.agents/schemas/lifecycle/epic.cleanup.end.schema.json +0 -12
- package/.agents/schemas/lifecycle/epic.cleanup.start.schema.json +0 -12
- package/.agents/schemas/lifecycle/epic.close.end.schema.json +0 -12
- package/.agents/schemas/lifecycle/epic.complete.schema.json +0 -13
- package/.agents/schemas/lifecycle/epic.finalize.end.schema.json +0 -13
- package/.agents/schemas/lifecycle/epic.finalize.start.schema.json +0 -12
- package/.agents/schemas/lifecycle/epic.merge.armed.schema.json +0 -13
- package/.agents/schemas/lifecycle/epic.merge.blocked.schema.json +0 -14
- package/.agents/schemas/lifecycle/epic.merge.confirmed.schema.json +0 -17
- package/.agents/schemas/lifecycle/epic.merge.ready.schema.json +0 -15
- package/.agents/schemas/lifecycle/epic.plan.end.schema.json +0 -18
- package/.agents/schemas/lifecycle/epic.plan.start.schema.json +0 -12
- package/.agents/schemas/lifecycle/epic.snapshot.end.schema.json +0 -16
- package/.agents/schemas/lifecycle/epic.snapshot.start.schema.json +0 -12
- package/.agents/schemas/lifecycle/epic.watch.end.schema.json +0 -29
- package/.agents/schemas/lifecycle/epic.watch.start.schema.json +0 -16
- package/.agents/schemas/lifecycle/story.heartbeat.schema.json +0 -20
- package/.agents/schemas/risk-verdict.schema.json +0 -53
- package/.agents/schemas/story-perf-summary.schema.json +0 -73
- package/.agents/scripts/analyze-execution.js +0 -444
- package/.agents/scripts/check-prepush-recovery.js +0 -90
- package/.agents/scripts/lib/git-merge-orchestrator.js +0 -261
- package/.agents/scripts/lib/observability/baseline-refresh-rate.js +0 -221
- package/.agents/scripts/lib/observability/hook-heartbeat.js +0 -187
- package/.agents/scripts/lib/observability/perf-aggregator.js +0 -813
- package/.agents/scripts/lib/observability/perf-report-readers.js +0 -328
- package/.agents/scripts/lib/observability/perf-report-render.js +0 -182
- package/.agents/scripts/lib/orchestration/audit-lens-routing.js +0 -128
- package/.agents/scripts/lib/orchestration/bookkeeping-outbox.js +0 -273
- package/.agents/scripts/lib/orchestration/error-journal.js +0 -139
- package/.agents/scripts/lib/orchestration/lifecycle/emit-story-heartbeat.js +0 -155
- package/.agents/scripts/lib/orchestration/lifecycle/ledger-diff.js +0 -140
- package/.agents/scripts/lib/orchestration/lifecycle/listeners/merge-watcher.js +0 -665
- package/.agents/scripts/lib/orchestration/plan-review-routing.js +0 -63
- package/.agents/scripts/lib/orchestration/planning/risk-verdict.js +0 -104
- package/.agents/scripts/lib/orchestration/planning-context-budget.js +0 -213
- package/.agents/scripts/lib/orchestration/planning-risk.js +0 -194
- package/.agents/scripts/lib/orchestration/post-merge/phases/branch-cleanup.js +0 -56
- package/.agents/scripts/lib/orchestration/post-merge/phases/dashboard-refresh.js +0 -21
- package/.agents/scripts/lib/orchestration/post-merge/phases/notification.js +0 -78
- package/.agents/scripts/lib/orchestration/post-merge/phases/temp-cleanup.js +0 -68
- package/.agents/scripts/lib/orchestration/post-merge/phases/ticket-closure.js +0 -118
- package/.agents/scripts/lib/orchestration/post-merge/phases/worktree-reap.js +0 -397
- package/.agents/scripts/lib/orchestration/preflight-cache.js +0 -187
- package/.agents/scripts/lib/orchestration/resolve-plan-run.js +0 -155
- package/.agents/scripts/lib/orchestration/retro-perf-heuristics.js +0 -275
- package/.agents/scripts/lib/orchestration/story-progress/story-run-progress-writer.js +0 -400
- package/.agents/scripts/lib/single-story/confirm-merge-follow-ups.js +0 -36
- package/.agents/scripts/resolve-plan-run.js +0 -117
- package/.agents/skills/core/analyze-execution/SKILL.md +0 -101
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
# Documentation and ADRs — Reference (on-demand)
|
|
2
|
+
|
|
3
|
+
**Read this when** a task engages one of the sections below and the Policy
|
|
4
|
+
Capsule in [`SKILL.md`](SKILL.md) does not settle it on its own. The capsule
|
|
5
|
+
is the contract; this file is the reference material behind it. Nothing here
|
|
6
|
+
relaxes a capsule MUST, and nothing here is required reading merely because
|
|
7
|
+
the skill is active.
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Document decisions, not just code. The most valuable documentation captures the
|
|
12
|
+
_why_ — the context, constraints, and trade-offs that led to a decision. Code
|
|
13
|
+
shows _what_ was built; documentation explains _why it was built this way_ and
|
|
14
|
+
_what alternatives were considered_. This context is essential for future humans
|
|
15
|
+
and agents working in the codebase.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
- Making a significant architectural decision
|
|
20
|
+
- Choosing between competing approaches
|
|
21
|
+
- Adding or changing a public API
|
|
22
|
+
- Shipping a feature that changes user-facing behavior
|
|
23
|
+
- Onboarding new team members (or agents) to the project
|
|
24
|
+
- When you find yourself explaining the same thing repeatedly
|
|
25
|
+
|
|
26
|
+
**When NOT to use:** Don't document obvious code. Don't add comments that
|
|
27
|
+
restate what the code already says. Don't write docs for throwaway prototypes.
|
|
28
|
+
|
|
29
|
+
## Architecture Decision Records (ADRs)
|
|
30
|
+
|
|
31
|
+
ADRs capture the reasoning behind significant technical decisions. They're the
|
|
32
|
+
highest-value documentation you can write.
|
|
33
|
+
|
|
34
|
+
### When to Write an ADR
|
|
35
|
+
|
|
36
|
+
- Choosing a framework, library, or major dependency
|
|
37
|
+
- Designing a data model or database schema
|
|
38
|
+
- Selecting an authentication strategy
|
|
39
|
+
- Deciding on an API architecture (REST vs. GraphQL vs. tRPC)
|
|
40
|
+
- Choosing between build tools, hosting platforms, or infrastructure
|
|
41
|
+
- Any decision that would be expensive to reverse
|
|
42
|
+
|
|
43
|
+
### Decisions-log layouts
|
|
44
|
+
|
|
45
|
+
Mandrel ships **two supported layouts** for the decisions log. Both keep the
|
|
46
|
+
mandatory-read file named `docs/decisions.md` (the `project.docsContextFiles`
|
|
47
|
+
default), so `config-resolver.js` and every `.agents/` reference resolve the
|
|
48
|
+
same regardless of which you pick — only the **shape** differs. Choose one at
|
|
49
|
+
onboarding:
|
|
50
|
+
|
|
51
|
+
| Layout | Shape | Template(s) | When to use |
|
|
52
|
+
| ----------------------------------- | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
|
|
53
|
+
| **Single-file dated entries** (default) | One `decisions.md` of append-only `## YYYY-MM-DD — title` entries | [`templates/docs/decisions.md`](../../../templates/docs/decisions.md) | Small projects; a handful of decisions; you want everything in one scannable file. |
|
|
54
|
+
| **Index + `decisions/` directory** | `decisions.md` is a one-row-per-ADR **index**; each ADR is `decisions/NNNN-*.md` | [`templates/docs/decisions.index.md`](../../../templates/docs/decisions.index.md) + [`templates/docs/decisions/_template.md`](../../../templates/docs/decisions/_template.md) | The log has outgrown a single file (dozens of ADRs); you want per-decision history and `git blame` per ADR. |
|
|
55
|
+
|
|
56
|
+
To adopt the directory layout, replace `decisions.md` with the index variant,
|
|
57
|
+
create a `decisions/` directory beside it, and scaffold each ADR from
|
|
58
|
+
`decisions/_template.md` using zero-padded sequential numbering
|
|
59
|
+
(`0001-*.md`, `0002-*.md`, …).
|
|
60
|
+
|
|
61
|
+
> **Loading model (resolved design question).** The decisions **index** is the
|
|
62
|
+
> only artifact loaded into mandatory task context — individual ADR bodies
|
|
63
|
+
> under `decisions/` are **lazy / link-followed**, not auto-loaded. This is
|
|
64
|
+
> **index-only by default**: auto-loading every ADR body into each task's
|
|
65
|
+
> context would reintroduce exactly the bloat the split exists to remove.
|
|
66
|
+
> `project.docsContextFiles` entries are plain filenames resolved against the
|
|
67
|
+
> docs root (no glob expansion in the loader), so the index ships as a normal
|
|
68
|
+
> mandatory-read with no loader change. A project that genuinely wants the full
|
|
69
|
+
> ADR set in mandatory context can add explicit per-file entries (or a
|
|
70
|
+
> `decisions/*.md`-style entry if it maintains its own globbing) as a
|
|
71
|
+
> deliberate opt-in, but that is the exception, not the default.
|
|
72
|
+
|
|
73
|
+
### ADR Template
|
|
74
|
+
|
|
75
|
+
In the **single-file** layout, append a short dated entry per the
|
|
76
|
+
`templates/docs/decisions.md` format. In the **directory** layout, store ADRs
|
|
77
|
+
in `docs/decisions/` with sequential numbering:
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
# ADR-001: Use PostgreSQL for primary database
|
|
81
|
+
|
|
82
|
+
## Status
|
|
83
|
+
|
|
84
|
+
Accepted | Superseded by ADR-XXX | Deprecated
|
|
85
|
+
|
|
86
|
+
## Date
|
|
87
|
+
|
|
88
|
+
2025-01-15
|
|
89
|
+
|
|
90
|
+
## Deciders
|
|
91
|
+
|
|
92
|
+
The platform team (architect + two senior engineers).
|
|
93
|
+
|
|
94
|
+
## Context
|
|
95
|
+
|
|
96
|
+
We need a primary database for the task management application. Key
|
|
97
|
+
requirements:
|
|
98
|
+
|
|
99
|
+
- Relational data model (users, tasks, teams with relationships)
|
|
100
|
+
- ACID transactions for task state changes
|
|
101
|
+
- Support for full-text search on task content
|
|
102
|
+
- Managed hosting available (for small team, limited ops capacity)
|
|
103
|
+
|
|
104
|
+
## Decision
|
|
105
|
+
|
|
106
|
+
Use PostgreSQL with Prisma ORM.
|
|
107
|
+
|
|
108
|
+
## Alternatives Considered
|
|
109
|
+
|
|
110
|
+
### MongoDB
|
|
111
|
+
|
|
112
|
+
- Pros: Flexible schema, easy to start with
|
|
113
|
+
- Cons: Our data is inherently relational; would need to manage relationships
|
|
114
|
+
manually
|
|
115
|
+
- Rejected: Relational data in a document store leads to complex joins or data
|
|
116
|
+
duplication
|
|
117
|
+
|
|
118
|
+
### SQLite
|
|
119
|
+
|
|
120
|
+
- Pros: Zero configuration, embedded, fast for reads
|
|
121
|
+
- Cons: Limited concurrent write support, no managed hosting for production
|
|
122
|
+
- Rejected: Not suitable for multi-user web application in production
|
|
123
|
+
|
|
124
|
+
### MySQL
|
|
125
|
+
|
|
126
|
+
- Pros: Mature, widely supported
|
|
127
|
+
- Cons: PostgreSQL has better JSON support, full-text search, and ecosystem
|
|
128
|
+
tooling
|
|
129
|
+
- Rejected: PostgreSQL is the better fit for our feature requirements
|
|
130
|
+
|
|
131
|
+
## Consequences
|
|
132
|
+
|
|
133
|
+
- Prisma provides type-safe database access and migration management
|
|
134
|
+
- We can use PostgreSQL's full-text search instead of adding Elasticsearch
|
|
135
|
+
- Team needs PostgreSQL knowledge (standard skill, low risk)
|
|
136
|
+
- Hosting on managed service (Supabase, Neon, or RDS)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### ADR Lifecycle
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
PROPOSED → ACCEPTED → (SUPERSEDED or DEPRECATED)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
- **Don't delete old ADRs.** They capture historical context.
|
|
146
|
+
- When a decision changes, write a new ADR that references and supersedes the
|
|
147
|
+
old one.
|
|
148
|
+
|
|
149
|
+
## Inline Documentation
|
|
150
|
+
|
|
151
|
+
### When to Comment
|
|
152
|
+
|
|
153
|
+
Comment the _why_, not the _what_:
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
// BAD: Restates the code
|
|
157
|
+
// Increment counter by 1
|
|
158
|
+
counter += 1;
|
|
159
|
+
|
|
160
|
+
// GOOD: Explains non-obvious intent
|
|
161
|
+
// Rate limit uses a sliding window — reset counter at window boundary,
|
|
162
|
+
// not on a fixed schedule, to prevent burst attacks at window edges
|
|
163
|
+
if (now - windowStart > WINDOW_SIZE_MS) {
|
|
164
|
+
counter = 0;
|
|
165
|
+
windowStart = now;
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### When NOT to Comment
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
// Don't comment self-explanatory code
|
|
173
|
+
function calculateTotal(items: CartItem[]): number {
|
|
174
|
+
return items.reduce((sum, item) => sum + item.price * item.quantity, 0);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Don't leave TODO comments for things you should just do now
|
|
178
|
+
// TODO: add error handling ← Just add it
|
|
179
|
+
|
|
180
|
+
// Don't leave commented-out code
|
|
181
|
+
// const oldImplementation = () => { ... } ← Delete it, git has history
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Document Known Gotchas
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
/**
|
|
188
|
+
* IMPORTANT: This function must be called before the first render.
|
|
189
|
+
* If called after hydration, it causes a flash of unstyled content
|
|
190
|
+
* because the theme context isn't available during SSR.
|
|
191
|
+
*
|
|
192
|
+
* See ADR-003 for the full design rationale.
|
|
193
|
+
*/
|
|
194
|
+
export function initializeTheme(theme: Theme): void {
|
|
195
|
+
// ...
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## API Documentation
|
|
200
|
+
|
|
201
|
+
For public APIs (REST, GraphQL, library interfaces):
|
|
202
|
+
|
|
203
|
+
### Inline with Types (Preferred for TypeScript)
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
/**
|
|
207
|
+
* Creates a new task.
|
|
208
|
+
*
|
|
209
|
+
* @param input - Task creation data (title required, description optional)
|
|
210
|
+
* @returns The created task with server-generated ID and timestamps
|
|
211
|
+
* @throws {ValidationError} If title is empty or exceeds 200 characters
|
|
212
|
+
* @throws {AuthenticationError} If the user is not authenticated
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* const task = await createTask({ title: 'Buy groceries' });
|
|
216
|
+
* console.log(task.id); // "task_abc123"
|
|
217
|
+
*/
|
|
218
|
+
export async function createTask(input: CreateTaskInput): Promise<Task> {
|
|
219
|
+
// ...
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### OpenAPI / Swagger for REST APIs
|
|
224
|
+
|
|
225
|
+
```yaml
|
|
226
|
+
paths:
|
|
227
|
+
/api/tasks:
|
|
228
|
+
post:
|
|
229
|
+
summary: Create a task
|
|
230
|
+
requestBody:
|
|
231
|
+
required: true
|
|
232
|
+
content:
|
|
233
|
+
application/json:
|
|
234
|
+
schema:
|
|
235
|
+
$ref: '#/components/schemas/CreateTaskInput'
|
|
236
|
+
responses:
|
|
237
|
+
'201':
|
|
238
|
+
description: Task created
|
|
239
|
+
content:
|
|
240
|
+
application/json:
|
|
241
|
+
schema:
|
|
242
|
+
$ref: '#/components/schemas/Task'
|
|
243
|
+
'422':
|
|
244
|
+
description: Validation error
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## README Structure
|
|
248
|
+
|
|
249
|
+
Every project should have a README that covers:
|
|
250
|
+
|
|
251
|
+
```markdown
|
|
252
|
+
# Project Name
|
|
253
|
+
|
|
254
|
+
One-paragraph description of what this project does.
|
|
255
|
+
|
|
256
|
+
## Quick Start
|
|
257
|
+
|
|
258
|
+
1. Clone the repo
|
|
259
|
+
2. Install dependencies: `npm install`
|
|
260
|
+
3. Set up environment: `cp .env.example .env`
|
|
261
|
+
4. Run the dev server: `npm run dev`
|
|
262
|
+
|
|
263
|
+
## Commands
|
|
264
|
+
|
|
265
|
+
| Command | Description |
|
|
266
|
+
| --------------- | ------------------------ |
|
|
267
|
+
| `npm run dev` | Start development server |
|
|
268
|
+
| `npm test` | Run tests |
|
|
269
|
+
| `npm run build` | Production build |
|
|
270
|
+
| `npm run lint` | Run linter |
|
|
271
|
+
|
|
272
|
+
## Architecture
|
|
273
|
+
|
|
274
|
+
Brief overview of the project structure and key design decisions. Link to ADRs
|
|
275
|
+
for details.
|
|
276
|
+
|
|
277
|
+
## Contributing
|
|
278
|
+
|
|
279
|
+
How to contribute, coding standards, PR process.
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## Changelog Maintenance
|
|
283
|
+
|
|
284
|
+
For shipped features:
|
|
285
|
+
|
|
286
|
+
```markdown
|
|
287
|
+
# Changelog
|
|
288
|
+
|
|
289
|
+
## [1.2.0] - 2025-01-20
|
|
290
|
+
|
|
291
|
+
### Added
|
|
292
|
+
|
|
293
|
+
- Task sharing: users can share tasks with team members (#123)
|
|
294
|
+
- Email notifications for task assignments (#124)
|
|
295
|
+
|
|
296
|
+
### Fixed
|
|
297
|
+
|
|
298
|
+
- Duplicate tasks appearing when rapidly clicking create button (#125)
|
|
299
|
+
|
|
300
|
+
### Changed
|
|
301
|
+
|
|
302
|
+
- Task list now loads 50 items per page (was 20) for better UX (#126)
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## Pruning & Archiving
|
|
306
|
+
|
|
307
|
+
Living docs accrete history — dated changelog entries, closed decision-log
|
|
308
|
+
rows, completed rollout checklists, resolved runbook incidents. Left
|
|
309
|
+
unpruned, that verbatim history crowds out the live guidance a reader (human
|
|
310
|
+
or agent) actually needs, and every task that loads the doc re-pays the cost.
|
|
311
|
+
The fix is to **archive, don't delete**: relocate the cold history so the live
|
|
312
|
+
doc stays lean while the record stays recoverable.
|
|
313
|
+
|
|
314
|
+
### The archive-don't-delete rule
|
|
315
|
+
|
|
316
|
+
**History is preserved by _moving_ it, never by deleting it.** Pruning a doc
|
|
317
|
+
never destroys its past — the verbatim content is relocated to a dated archive
|
|
318
|
+
file under version control, so the full record remains diffable and
|
|
319
|
+
recoverable. Deleting history outright (even with "git has it") is the
|
|
320
|
+
anti-pattern this convention exists to prevent: the archive is discoverable
|
|
321
|
+
from the live doc, a buried git revision is not.
|
|
322
|
+
|
|
323
|
+
### How to prune a doc
|
|
324
|
+
|
|
325
|
+
1. **Extract the still-live signal first — before you archive anything.**
|
|
326
|
+
Gotchas, traps, and hard-won caveats buried in the history are the most
|
|
327
|
+
valuable lines in the doc. Lift them into the live doc's standing guidance
|
|
328
|
+
(a "Known gotchas" list, an inline warning, or an ADR) **before** the
|
|
329
|
+
history moves. Archiving first risks stranding a live trap in a cold file
|
|
330
|
+
nobody rereads.
|
|
331
|
+
2. **Move the verbatim history to a dated archive file.** Relocate the cold
|
|
332
|
+
content — untouched, word-for-word — to
|
|
333
|
+
`docs/archive/<name>-<YYYY-MM>.md`, where `<name>` is the source doc's base
|
|
334
|
+
name and `<YYYY-MM>` is the archive date (e.g. `docs/archive/changelog-2025-01.md`,
|
|
335
|
+
`docs/archive/decisions-2024-11.md`). The archive is an exact copy of what
|
|
336
|
+
was live; do not summarize or rewrite it in the move.
|
|
337
|
+
3. **Collapse completed checklists to a one-line summary.** A finished
|
|
338
|
+
checklist (a rollout runbook, a migration plan, a release gate) does not
|
|
339
|
+
need to keep every ticked box in the live doc. Replace it with a single
|
|
340
|
+
line recording the outcome and date — e.g.
|
|
341
|
+
`Auth-migration rollout — completed 2025-01-18, all 12 steps green` — and
|
|
342
|
+
let the archived copy carry the full detail.
|
|
343
|
+
4. **Leave a one-line pointer behind.** Every archived doc leaves exactly one
|
|
344
|
+
line in the live doc pointing at where its history went, so the record is
|
|
345
|
+
never orphaned — e.g.
|
|
346
|
+
`Older entries archived to docs/archive/changelog-2024.md`. The pointer is
|
|
347
|
+
what makes "moved, not deleted" true from the reader's vantage point.
|
|
348
|
+
|
|
349
|
+
### When to prune
|
|
350
|
+
|
|
351
|
+
- A changelog, decision log, or runbook has grown long enough that the live
|
|
352
|
+
entries are hard to find among the historical ones.
|
|
353
|
+
- A checklist or rollout plan is fully complete and its step-by-step detail is
|
|
354
|
+
now reference-only.
|
|
355
|
+
- A doc reloaded into agent context on many tasks carries more cold history
|
|
356
|
+
than live guidance.
|
|
357
|
+
|
|
358
|
+
Do **not** prune ADRs by archiving — an ADR that no longer holds is
|
|
359
|
+
**superseded** in place (see [ADR Lifecycle](#adr-lifecycle)), keeping the
|
|
360
|
+
numbered chain intact. Archiving is for the accreted history of living docs,
|
|
361
|
+
not for the immutable decision record.
|
|
362
|
+
|
|
363
|
+
## Documentation for Agents
|
|
364
|
+
|
|
365
|
+
Special consideration for AI agent context:
|
|
366
|
+
|
|
367
|
+
- **CLAUDE.md / rules files** — Document project conventions so agents follow
|
|
368
|
+
them
|
|
369
|
+
- **Spec files** — Keep specs updated so agents build the right thing
|
|
370
|
+
- **ADRs** — Help agents understand why past decisions were made (prevents
|
|
371
|
+
re-deciding)
|
|
372
|
+
- **Inline gotchas** — Prevent agents from falling into known traps
|
|
373
|
+
|
|
374
|
+
## Common Rationalizations
|
|
375
|
+
|
|
376
|
+
| Rationalization | Reality |
|
|
377
|
+
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
|
|
378
|
+
| "The code is self-documenting" | Code shows what. It doesn't show why, what alternatives were rejected, or what constraints apply. |
|
|
379
|
+
| "We'll write docs when the API stabilizes" | APIs stabilize faster when you document them. The doc is the first test of the design. |
|
|
380
|
+
| "Nobody reads docs" | Agents do. Future engineers do. Your 3-months-later self does. |
|
|
381
|
+
| "ADRs are overhead" | A 10-minute ADR prevents a 2-hour debate about the same decision six months later. |
|
|
382
|
+
| "Comments get outdated" | Comments on _why_ are stable. Comments on _what_ get outdated — that's why you only write the former. |
|
|
383
|
+
|
|
384
|
+
## Red Flags
|
|
385
|
+
|
|
386
|
+
- Architectural decisions with no written rationale
|
|
387
|
+
- Public APIs with no documentation or types
|
|
388
|
+
- README that doesn't explain how to run the project
|
|
389
|
+
- Commented-out code instead of deletion
|
|
390
|
+
- TODO comments that have been there for weeks
|
|
391
|
+
- No ADRs in a project with significant architectural choices
|
|
392
|
+
- Documentation that restates the code instead of explaining intent
|
|
393
|
+
|
|
394
|
+
## Verification
|
|
395
|
+
|
|
396
|
+
After documenting:
|
|
397
|
+
|
|
398
|
+
- [ ] ADRs exist for all significant architectural decisions
|
|
399
|
+
- [ ] README covers quick start, commands, and architecture overview
|
|
400
|
+
- [ ] API functions have parameter and return type documentation
|
|
401
|
+
- [ ] Known gotchas are documented inline where they matter
|
|
402
|
+
- [ ] No commented-out code remains
|
|
403
|
+
- [ ] Rules files (CLAUDE.md etc.) are current and accurate
|
|
@@ -18,10 +18,10 @@ allowed_tools:
|
|
|
18
18
|
- **No gate may be skipped.** Failing lint means fix lint, not disable the rule; a failing test means fix the code, not `.skip` or delete the test. Gates are ordered shift-left so cheap checks fail first, and CI failure output is fed back verbatim with the directive to reproduce and fix locally before re-pushing.
|
|
19
19
|
- **Introducing a gate that asserts on pre-existing state** (doc-drift, lint-vocabulary, dependency-cycle, missing-coverage) MUST land green at merge: either advisory-first (report-only until the backlog is burned down) or with the populated baseline committed in the same change that turns the gate on. Never wire a gate into `requiredChecks` that lands red on latent findings nobody authored.
|
|
20
20
|
- **Refresh a baseline only when the change is deliberate** — a rename/move, an operator-approved complexity bump, a signed-off perf delta, an intentional API-surface change. Never refresh to paper over an unintentional regression; fix the regression instead.
|
|
21
|
-
- Run the kind-specific
|
|
21
|
+
- Run the kind-specific refresh (`npm run crap:update` / `npm run maintainability:update`; dead-exports and lighthouse have no npm script — regenerate the rows and edit `baselines/dead-exports*.json` / `baselines/lighthouse.json` directly) on the **Story branch**, not on `main`.
|
|
22
22
|
- Verify the refresh diff is scoped to the relevant `baselines/<kind>.json` (plus cosmetic `package-lock.json` churn only). If unrelated files appear, STOP — the refresh is contaminated. Stage baseline files **explicitly** (`git add baselines/<kind>.json`); never `git add -A` in a refresh commit.
|
|
23
|
-
- Commit-subject contract: a **Conventional-Commits** subject `chore(baselines): refresh <kind> snapshot for <reason>` — never an ad-hoc leading token like `baseline-refresh:` (commitlint and the planner validator reject it). The body is **mandatory** and non-empty: what changed, why the new floor is correct, and the Story
|
|
24
|
-
- Add the machine-readable trailer `baseline-refresh: true` (git-trailer `Key: value` style) and `
|
|
23
|
+
- Commit-subject contract: a **Conventional-Commits** subject `chore(baselines): refresh <kind> snapshot for <reason>` — never an ad-hoc leading token like `baseline-refresh:` (commitlint and the planner validator reject it). The body is **mandatory** and non-empty: what changed, why the new floor is correct, and the Story that triggered it.
|
|
24
|
+
- Add the machine-readable trailer `baseline-refresh: true` (git-trailer `Key: value` style) and `Story: #<storyId>` to the body whenever observability classification matters. Never pass `--no-verify`; the `commit-msg` hook (commitlint) MUST run and pass.
|
|
25
25
|
- After the refresh lands, re-run `node .agents/scripts/check-baselines.js` to confirm the gate passes against the new snapshot; if it still fails, a sibling kind drifted — refresh that kind too.
|
|
26
26
|
- Keep credentials in GitHub Secrets (or platform equivalent) even for CI-only test databases; treat the security audit (`npm audit` or equivalent) as gating for critical/high vulnerabilities reachable in production code.
|
|
27
27
|
|
|
@@ -77,7 +77,7 @@ chore(baselines): refresh <kind> snapshot for <reason>
|
|
|
77
77
|
baseline is the correct floor, and any operator sign-off reference>
|
|
78
78
|
|
|
79
79
|
baseline-refresh: true
|
|
80
|
-
|
|
80
|
+
Story: #<storyId>
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
The `commit-msg` hook (`commitlint`) rejects any subject whose leading token is
|
|
@@ -88,10 +88,10 @@ subject MUST conform. `release-please` consumes the subject on `main`;
|
|
|
88
88
|
`chore(baselines):` keeps the refresh out of the user-facing changelog (correct —
|
|
89
89
|
it is internal hygiene) while staying machine-parseable. The
|
|
90
90
|
`baseline-refresh: true` **body trailer** is the canonical machine-readable
|
|
91
|
-
marker
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
for
|
|
91
|
+
marker — subject-level leading tokens are not, and must not be, used for this
|
|
92
|
+
purpose. (Its only reader, `baseline-refresh-rate.js`, went with the
|
|
93
|
+
execution-analysis surface in Story #4545; the trailer convention stands on its
|
|
94
|
+
own as the parseable marker for any future reader.)
|
|
95
95
|
|
|
96
96
|
### Procedure
|
|
97
97
|
|
|
@@ -99,8 +99,8 @@ for this purpose.
|
|
|
99
99
|
| --------------- | -------------------------------- |
|
|
100
100
|
| CRAP | `npm run crap:update` |
|
|
101
101
|
| Maintainability | `npm run maintainability:update` |
|
|
102
|
-
| Dead-exports | `
|
|
103
|
-
| Lighthouse | `
|
|
102
|
+
| Dead-exports | edit `baselines/dead-exports.json` / `baselines/dead-exports-production.json` (rows are `(file, symbol)`; `check-dead-exports.js --json` prints the current rows) |
|
|
103
|
+
| Lighthouse | edit `baselines/lighthouse.json` |
|
|
104
104
|
|
|
105
105
|
1. **Run the matching update command** on the Story branch (HEAD must already be
|
|
106
106
|
the Story branch, not `main`).
|
|
@@ -115,10 +115,10 @@ for this purpose.
|
|
|
115
115
|
git commit -m "$(cat <<'EOF'
|
|
116
116
|
chore(baselines): refresh <kind> snapshot for <reason>
|
|
117
117
|
|
|
118
|
-
<body: what changed, why the new floor is correct, linking the Story
|
|
118
|
+
<body: what changed, why the new floor is correct, linking the Story.>
|
|
119
119
|
|
|
120
120
|
baseline-refresh: true
|
|
121
|
-
|
|
121
|
+
Story: #<storyId>
|
|
122
122
|
EOF
|
|
123
123
|
)"
|
|
124
124
|
```
|
|
@@ -13,7 +13,7 @@ description:
|
|
|
13
13
|
- Phase 1 MUST restate the idea as a "How Might We" statement, ask 3–5 sharpening questions via `AskUserQuestion`, and generate 5–8 variations (not 20+ shallow ones); do not proceed until target user and success criteria are explicit.
|
|
14
14
|
- Phase 2 grill loop poses **one** question at a time, each with a recommended answer + one-line rationale grounded in user input / codebase / first principles; never batch questions and never omit the recommendation.
|
|
15
15
|
- Re-enumerate open branches after every grill answer; stop only when no unresolved decisions remain. Take the off-ramp directly to Phase 3 when the idea is already crisply scoped.
|
|
16
|
-
- Phase 3 emits a markdown one-pager with the canonical five
|
|
16
|
+
- Phase 3 emits a markdown one-pager with the canonical five planning headings exactly: `## Context`, `## Goal`, `## Non-Goals`, `## Scope`, `## Acceptance Criteria` (plus optional `## Open Questions`). No alternate heading text — the `/plan` clarity gate depends on this verbatim.
|
|
17
17
|
- Surface every key assumption inside `## Context` (or `## Scope`); assumptions do not get their own heading. Unresolved decisions MUST NOT carry into the one-pager.
|
|
18
18
|
- The `## Non-Goals` list is mandatory and each entry includes a reason — focus is created by explicit exclusion.
|
|
19
19
|
- Be honest, not supportive: push back on weak ideas with kindness; never function as a yes-machine.
|
|
@@ -63,7 +63,7 @@ bash /mnt/skills/user/idea-refine/scripts/idea-refine.sh
|
|
|
63
63
|
## Output
|
|
64
64
|
|
|
65
65
|
The final output is a markdown one-pager saved to `docs/ideas/[idea-name].md`
|
|
66
|
-
(after user confirmation), containing the five canonical
|
|
66
|
+
(after user confirmation), containing the five canonical planning sections:
|
|
67
67
|
|
|
68
68
|
- Context (problem framing + current state)
|
|
69
69
|
- Goal (desired outcome)
|
|
@@ -211,7 +211,7 @@ it inside the grill loop, not after the one-pager is already written.
|
|
|
211
211
|
Produce a concrete artifact — a markdown one-pager that moves work forward.
|
|
212
212
|
The five canonical headings below match `.agents/templates/epic-from-idea.md`
|
|
213
213
|
and the `/plan` clarity gate; emit them verbatim so the renderer can
|
|
214
|
-
substitute the body into a
|
|
214
|
+
substitute the body into a `/plan` Story seed without translation.
|
|
215
215
|
|
|
216
216
|
```markdown
|
|
217
217
|
# [Idea Name]
|
|
@@ -22,6 +22,9 @@ description:
|
|
|
22
22
|
- Lead with **cohesion**: one Story is one coherent change with one reason
|
|
23
23
|
to exist. Coupled work stays one Story and uses `## Slicing` for
|
|
24
24
|
intra-session checkpoints.
|
|
25
|
+
- Emit an **advisory only** — `keep-single` (the default) or `split` with its
|
|
26
|
+
seam/overlap rationale. **Never auto-route**: the operator decides, and
|
|
27
|
+
`--yes` defaults to `keep-single`.
|
|
25
28
|
|
|
26
29
|
## Split policy (when N>1 is allowed)
|
|
27
30
|
|