devrites 1.19.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/.claude-plugin/marketplace.json +24 -0
- package/.claude-plugin/plugin.json +43 -0
- package/CHANGELOG.md +391 -0
- package/LICENSE +56 -0
- package/NOTICE.md +18 -0
- package/README.md +582 -0
- package/SECURITY.md +193 -0
- package/bin/devrites.mjs +100 -0
- package/docs/architecture.md +272 -0
- package/docs/cli-mcp.md +57 -0
- package/docs/command-map.md +143 -0
- package/docs/flow.md +360 -0
- package/docs/release.md +29 -0
- package/docs/skills.md +214 -0
- package/docs/usage.md +325 -0
- package/install.sh +359 -0
- package/mcp/devrites-mcp.mjs +103 -0
- package/pack/.claude/agents/devrites-code-reviewer.md +50 -0
- package/pack/.claude/agents/devrites-doubt-reviewer.md +55 -0
- package/pack/.claude/agents/devrites-frontend-reviewer.md +52 -0
- package/pack/.claude/agents/devrites-performance-reviewer.md +47 -0
- package/pack/.claude/agents/devrites-plan-reviewer.md +79 -0
- package/pack/.claude/agents/devrites-security-auditor.md +53 -0
- package/pack/.claude/agents/devrites-simplifier-reviewer.md +75 -0
- package/pack/.claude/agents/devrites-slice-wright.md +181 -0
- package/pack/.claude/agents/devrites-spec-reviewer.md +72 -0
- package/pack/.claude/agents/devrites-strategy-reviewer.md +62 -0
- package/pack/.claude/agents/devrites-test-analyst.md +47 -0
- package/pack/.claude/hooks/devrites-a1-guard.sh +81 -0
- package/pack/.claude/hooks/devrites-allow.sh +44 -0
- package/pack/.claude/hooks/devrites-cursor.sh +28 -0
- package/pack/.claude/hooks/devrites-orient.sh +53 -0
- package/pack/.claude/hooks/devrites-redwatch.sh +39 -0
- package/pack/.claude/hooks/devrites-refresh-indexes.sh +127 -0
- package/pack/.claude/hooks/devrites-reviewer-readonly.sh +28 -0
- package/pack/.claude/hooks/devrites-statusline.sh +18 -0
- package/pack/.claude/hooks/devrites-stop-gate.sh +45 -0
- package/pack/.claude/hooks/devrites-wright-scope.sh +35 -0
- package/pack/.claude/hooks/hooks.json +52 -0
- package/pack/.claude/rules/README.md +48 -0
- package/pack/.claude/rules/afk-hitl.md +245 -0
- package/pack/.claude/rules/agents.md +98 -0
- package/pack/.claude/rules/anti-patterns.md +48 -0
- package/pack/.claude/rules/code-review.md +38 -0
- package/pack/.claude/rules/coding-style.md +55 -0
- package/pack/.claude/rules/context-hygiene.md +97 -0
- package/pack/.claude/rules/core.md +119 -0
- package/pack/.claude/rules/development-workflow.md +40 -0
- package/pack/.claude/rules/documentation.md +27 -0
- package/pack/.claude/rules/error-handling.md +33 -0
- package/pack/.claude/rules/git-workflow.md +35 -0
- package/pack/.claude/rules/hooks.md +38 -0
- package/pack/.claude/rules/patterns.md +45 -0
- package/pack/.claude/rules/performance.md +27 -0
- package/pack/.claude/rules/prose-style.md +101 -0
- package/pack/.claude/rules/security.md +63 -0
- package/pack/.claude/rules/testing.md +88 -0
- package/pack/.claude/rules/tooling.md +72 -0
- package/pack/.claude/settings.json +53 -0
- package/pack/.claude/skills/devrites-api-interface/SKILL.md +45 -0
- package/pack/.claude/skills/devrites-audit/SKILL.md +73 -0
- package/pack/.claude/skills/devrites-browser-proof/SKILL.md +38 -0
- package/pack/.claude/skills/devrites-debug-recovery/SKILL.md +50 -0
- package/pack/.claude/skills/devrites-debug-recovery/reference/build-the-loop.md +47 -0
- package/pack/.claude/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +17 -0
- package/pack/.claude/skills/devrites-debug-recovery/reference/hypotheses.md +17 -0
- package/pack/.claude/skills/devrites-debug-recovery/reference/instrumentation.md +21 -0
- package/pack/.claude/skills/devrites-debug-recovery/reference/regression-test.md +31 -0
- package/pack/.claude/skills/devrites-doubt/SKILL.md +75 -0
- package/pack/.claude/skills/devrites-frontend-craft/SKILL.md +96 -0
- package/pack/.claude/skills/devrites-frontend-craft/reference/craft.md +59 -0
- package/pack/.claude/skills/devrites-frontend-craft/reference/design-references.md +116 -0
- package/pack/.claude/skills/devrites-frontend-craft/reference/fullstack.md +45 -0
- package/pack/.claude/skills/devrites-frontend-craft/reference/quality-standards.md +215 -0
- package/pack/.claude/skills/devrites-frontend-craft/reference/reuse-first.md +59 -0
- package/pack/.claude/skills/devrites-frontend-craft/reference/shape.md +60 -0
- package/pack/.claude/skills/devrites-interview/SKILL.md +81 -0
- package/pack/.claude/skills/devrites-lib/SKILL.md +76 -0
- package/pack/.claude/skills/devrites-lib/scripts/analyze.sh +78 -0
- package/pack/.claude/skills/devrites-lib/scripts/check-acceptance.sh +75 -0
- package/pack/.claude/skills/devrites-lib/scripts/close-out.sh +47 -0
- package/pack/.claude/skills/devrites-lib/scripts/conventions.py +273 -0
- package/pack/.claude/skills/devrites-lib/scripts/coverage.sh +51 -0
- package/pack/.claude/skills/devrites-lib/scripts/devrites.sh +69 -0
- package/pack/.claude/skills/devrites-lib/scripts/doctor.sh +92 -0
- package/pack/.claude/skills/devrites-lib/scripts/evidence-fresh.sh +63 -0
- package/pack/.claude/skills/devrites-lib/scripts/footprint.sh +45 -0
- package/pack/.claude/skills/devrites-lib/scripts/learnings.sh +74 -0
- package/pack/.claude/skills/devrites-lib/scripts/mutation-gate.sh +52 -0
- package/pack/.claude/skills/devrites-lib/scripts/package-existence.sh +68 -0
- package/pack/.claude/skills/devrites-lib/scripts/preamble.sh +76 -0
- package/pack/.claude/skills/devrites-lib/scripts/progress.sh +103 -0
- package/pack/.claude/skills/devrites-lib/scripts/readiness.sh +62 -0
- package/pack/.claude/skills/devrites-lib/scripts/reconcile.sh +123 -0
- package/pack/.claude/skills/devrites-lib/scripts/resolve.sh +279 -0
- package/pack/.claude/skills/devrites-lib/scripts/stuck.sh +67 -0
- package/pack/.claude/skills/devrites-lib/scripts/test-integrity.sh +87 -0
- package/pack/.claude/skills/devrites-lib/scripts/tick-afk.sh +52 -0
- package/pack/.claude/skills/devrites-prose-craft/SKILL.md +105 -0
- package/pack/.claude/skills/devrites-prose-craft/reference/banned-phrases.md +95 -0
- package/pack/.claude/skills/devrites-prose-craft/reference/examples.md +88 -0
- package/pack/.claude/skills/devrites-prose-craft/reference/structures.md +134 -0
- package/pack/.claude/skills/devrites-refresh-indexes/SKILL.md +54 -0
- package/pack/.claude/skills/devrites-source-driven/SKILL.md +36 -0
- package/pack/.claude/skills/devrites-ux-shape/SKILL.md +121 -0
- package/pack/.claude/skills/devrites-ux-shape/reference/brief-template.md +93 -0
- package/pack/.claude/skills/devrites-ux-shape/reference/visual-direction-probe.md +48 -0
- package/pack/.claude/skills/rite/SKILL.md +135 -0
- package/pack/.claude/skills/rite/reference/menu.md +32 -0
- package/pack/.claude/skills/rite-adopt/SKILL.md +83 -0
- package/pack/.claude/skills/rite-adopt/reference/adoption.md +58 -0
- package/pack/.claude/skills/rite-adopt/reference/anti-patterns.md +19 -0
- package/pack/.claude/skills/rite-autocomplete/SKILL.md +96 -0
- package/pack/.claude/skills/rite-autocomplete/reference/decision-policy.md +35 -0
- package/pack/.claude/skills/rite-autocomplete/reference/loop.md +54 -0
- package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +59 -0
- package/pack/.claude/skills/rite-build/SKILL.md +261 -0
- package/pack/.claude/skills/rite-build/reference/afk-discipline.md +145 -0
- package/pack/.claude/skills/rite-build/reference/anti-patterns.md +25 -0
- package/pack/.claude/skills/rite-build/reference/checkpoint-protocol.md +149 -0
- package/pack/.claude/skills/rite-build/reference/evidence-standard.md +32 -0
- package/pack/.claude/skills/rite-build/reference/frontend-trigger.md +39 -0
- package/pack/.claude/skills/rite-build/reference/one-slice-cycle.md +38 -0
- package/pack/.claude/skills/rite-build/reference/spec-drift-guard.md +43 -0
- package/pack/.claude/skills/rite-build/reference/tdd.md +26 -0
- package/pack/.claude/skills/rite-build/reference/wright-dispatch.md +115 -0
- package/pack/.claude/skills/rite-define/SKILL.md +157 -0
- package/pack/.claude/skills/rite-define/reference/anti-patterns.md +25 -0
- package/pack/.claude/skills/rite-define/reference/gates.md +152 -0
- package/pack/.claude/skills/rite-define/reference/plan-template.md +65 -0
- package/pack/.claude/skills/rite-doctor/SKILL.md +50 -0
- package/pack/.claude/skills/rite-frame/SKILL.md +116 -0
- package/pack/.claude/skills/rite-frame/reference/failure-modes.md +68 -0
- package/pack/.claude/skills/rite-handoff/SKILL.md +95 -0
- package/pack/.claude/skills/rite-handoff/reference/handoff-template.md +34 -0
- package/pack/.claude/skills/rite-learn/SKILL.md +82 -0
- package/pack/.claude/skills/rite-plan/SKILL.md +82 -0
- package/pack/.claude/skills/rite-plan/reference/anti-patterns.md +24 -0
- package/pack/.claude/skills/rite-plan/reference/dependency-graph.md +33 -0
- package/pack/.claude/skills/rite-plan/reference/replan-and-repair.md +42 -0
- package/pack/.claude/skills/rite-plan/reference/slicing.md +52 -0
- package/pack/.claude/skills/rite-plan/reference/task-breakdown.md +34 -0
- package/pack/.claude/skills/rite-polish/SKILL.md +90 -0
- package/pack/.claude/skills/rite-polish/reference/anti-ai-slop.md +177 -0
- package/pack/.claude/skills/rite-polish/reference/anti-patterns.md +27 -0
- package/pack/.claude/skills/rite-polish/reference/backend-polish.md +80 -0
- package/pack/.claude/skills/rite-polish/reference/browser-polish-evidence.md +31 -0
- package/pack/.claude/skills/rite-polish/reference/code.md +85 -0
- package/pack/.claude/skills/rite-polish/reference/design-system-discovery.md +35 -0
- package/pack/.claude/skills/rite-polish/reference/harden-checklist.md +109 -0
- package/pack/.claude/skills/rite-polish/reference/ui.md +136 -0
- package/pack/.claude/skills/rite-pressure-test/SKILL.md +43 -0
- package/pack/.claude/skills/rite-prototype/SKILL.md +87 -0
- package/pack/.claude/skills/rite-prove/SKILL.md +120 -0
- package/pack/.claude/skills/rite-prove/reference/anti-patterns.md +25 -0
- package/pack/.claude/skills/rite-prove/reference/browser-proof.md +26 -0
- package/pack/.claude/skills/rite-prove/reference/failure-triage.md +25 -0
- package/pack/.claude/skills/rite-prove/reference/proof-ladder.md +26 -0
- package/pack/.claude/skills/rite-prove/reference/test-command-discovery.md +30 -0
- package/pack/.claude/skills/rite-quick/SKILL.md +81 -0
- package/pack/.claude/skills/rite-resolve/SKILL.md +113 -0
- package/pack/.claude/skills/rite-resolve/reference/answer-protocol.md +114 -0
- package/pack/.claude/skills/rite-review/SKILL.md +170 -0
- package/pack/.claude/skills/rite-review/reference/anti-patterns.md +32 -0
- package/pack/.claude/skills/rite-review/reference/cognitive-load.md +90 -0
- package/pack/.claude/skills/rite-review/reference/feature-scoped-review.md +26 -0
- package/pack/.claude/skills/rite-review/reference/five-axis-review.md +46 -0
- package/pack/.claude/skills/rite-review/reference/nielsen-heuristics.md +130 -0
- package/pack/.claude/skills/rite-review/reference/parallel-dispatch.md +62 -0
- package/pack/.claude/skills/rite-review/reference/performance-review.md +28 -0
- package/pack/.claude/skills/rite-review/reference/security-review.md +32 -0
- package/pack/.claude/skills/rite-seal/SKILL.md +183 -0
- package/pack/.claude/skills/rite-seal/reference/anti-patterns.md +27 -0
- package/pack/.claude/skills/rite-seal/reference/conventions-ledger.md +63 -0
- package/pack/.claude/skills/rite-seal/reference/final-evidence.md +72 -0
- package/pack/.claude/skills/rite-seal/reference/go-no-go.md +37 -0
- package/pack/.claude/skills/rite-seal/reference/parallel-dispatch.md +69 -0
- package/pack/.claude/skills/rite-seal/reference/risk-and-rollback.md +30 -0
- package/pack/.claude/skills/rite-seal/reference/seal-template.md +36 -0
- package/pack/.claude/skills/rite-ship/SKILL.md +120 -0
- package/pack/.claude/skills/rite-ship/reference/anti-patterns.md +25 -0
- package/pack/.claude/skills/rite-ship/reference/close-out.md +31 -0
- package/pack/.claude/skills/rite-ship/reference/design-memory.md +120 -0
- package/pack/.claude/skills/rite-ship/reference/git-ship.md +42 -0
- package/pack/.claude/skills/rite-ship/reference/ship-template.md +33 -0
- package/pack/.claude/skills/rite-spec/SKILL.md +126 -0
- package/pack/.claude/skills/rite-spec/reference/acceptance-criteria.md +31 -0
- package/pack/.claude/skills/rite-spec/reference/anti-patterns.md +25 -0
- package/pack/.claude/skills/rite-spec/reference/interview-patterns.md +56 -0
- package/pack/.claude/skills/rite-spec/reference/investigation.md +64 -0
- package/pack/.claude/skills/rite-spec/reference/question-protocol.md +61 -0
- package/pack/.claude/skills/rite-spec/reference/references-intake.md +57 -0
- package/pack/.claude/skills/rite-spec/reference/spec-checklists.md +73 -0
- package/pack/.claude/skills/rite-spec/reference/spec-template.md +124 -0
- package/pack/.claude/skills/rite-spec/reference/state-workspace.md +159 -0
- package/pack/.claude/skills/rite-status/SKILL.md +101 -0
- package/pack/.claude/skills/rite-temper/SKILL.md +119 -0
- package/pack/.claude/skills/rite-temper/reference/anti-patterns.md +29 -0
- package/pack/.claude/skills/rite-temper/reference/review-dimensions.md +65 -0
- package/pack/.claude/skills/rite-temper/reference/scope-modes.md +53 -0
- package/pack/.claude/skills/rite-temper/reference/significance.md +46 -0
- package/pack/.claude/skills/rite-temper/reference/strategy-template.md +90 -0
- package/pack/.claude/skills/rite-vet/SKILL.md +155 -0
- package/pack/.claude/skills/rite-vet/reference/anti-patterns.md +29 -0
- package/pack/.claude/skills/rite-vet/reference/artifacts.md +135 -0
- package/pack/.claude/skills/rite-vet/reference/cross-model.md +41 -0
- package/pack/.claude/skills/rite-vet/reference/depth.md +53 -0
- package/pack/.claude/skills/rite-vet/reference/eng-lenses.md +48 -0
- package/pack/.claude/skills/rite-vet/reference/review-axes.md +167 -0
- package/pack/.claude/skills/rite-zoom-out/SKILL.md +75 -0
- package/package.json +68 -0
- package/scripts/build-release-tarball.sh +74 -0
- package/scripts/check-cross-refs.py +121 -0
- package/scripts/check-no-global-writes.sh +44 -0
- package/scripts/check-rule-uniqueness.sh +73 -0
- package/scripts/devrites-detect.sh +175 -0
- package/scripts/eval-runner.py +273 -0
- package/scripts/grade-feature.sh +104 -0
- package/scripts/install-lib.sh +83 -0
- package/scripts/pin.sh +166 -0
- package/scripts/render-eval-summary.py +48 -0
- package/scripts/run-evals.sh +149 -0
- package/scripts/run-outcome-evals.sh +49 -0
- package/scripts/scan-pack-security.py +209 -0
- package/scripts/scan-supply-chain-iocs.py +127 -0
- package/scripts/supply-chain-iocs.json +11 -0
- package/scripts/sync-version.sh +56 -0
- package/scripts/validate-frontmatter.py +149 -0
- package/scripts/validate-workflow-security.py +86 -0
- package/scripts/validate.sh +234 -0
- package/uninstall.sh +137 -0
- package/update.sh +196 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rite-define
|
|
3
|
+
description: Decompose an approved `spec.md` into `plan.md` + vertical task slices + `state.md`; every acceptance criterion maps to ≥1 slice. Use when the user says "plan this", "break this into slices", "task breakdown". Not for writing code or repairing an existing plan (use `/rite-plan`).
|
|
4
|
+
argument-hint: "[feature-slug]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /rite-define — plan from the spec
|
|
9
|
+
|
|
10
|
+
Read the active feature's `spec.md` and turn it into a buildable plan: the approach, a
|
|
11
|
+
dependency-ordered set of **vertical slices**, and the state cursor. The spec is the WHAT/
|
|
12
|
+
WHY (from `/rite-spec`); this is the **HOW**. Splitting spec and plan keeps each focused so
|
|
13
|
+
nothing gets missed in one batch. **No code here.**
|
|
14
|
+
|
|
15
|
+
## Rules consulted (read on demand from `.claude/rules/`)
|
|
16
|
+
**Step 0:** Read `.claude/rules/core.md` first. DevRites skills Read `.claude/rules/core.md`
|
|
17
|
+
as their first step; the other rule files load on demand. Pull these via `Read` when shaping
|
|
18
|
+
the plan:
|
|
19
|
+
- `development-workflow.md` — small batches, trunk-always-green, definition of done.
|
|
20
|
+
- `documentation.md` — record plan-time decisions and rationale.
|
|
21
|
+
|
|
22
|
+
## Operating rules
|
|
23
|
+
- **Requires a readied spec.** Read the active workspace first; if `.devrites/ACTIVE` is empty,
|
|
24
|
+
the workspace has no `spec.md`, its readiness gate hasn't passed, or any spec-quality
|
|
25
|
+
`checklists/<domain>.md` has an open CRITICAL → **STOP** and tell the user to run
|
|
26
|
+
`/rite-spec <feature>` first. **DO NOT plan from a missing or unreadied spec.**
|
|
27
|
+
- Prefer existing conventions; ask before adding a dependency or a second design system.
|
|
28
|
+
- **Slice count is derived, never dictated.** The number of slices falls out of the work
|
|
29
|
+
— one per independently-shippable increment, sized by `slicing.md`, every acceptance
|
|
30
|
+
criterion mapped to ≥1 slice. A user-named count is a hint at most: slice logically and,
|
|
31
|
+
if your honest count differs, present it and why. Never pad or compress to hit a figure.
|
|
32
|
+
(`.devrites/AFK` `max_slices` is a separate AFK iteration budget, not the decomposition.)
|
|
33
|
+
|
|
34
|
+
## Workflow
|
|
35
|
+
0. **Read `.claude/rules/core.md`** — the always-on operating rules and anti-rationalizations.
|
|
36
|
+
Then **run the shared orientation preamble** — it confirms the active feature and which
|
|
37
|
+
artifacts exist (it prints `state.md`, the artifacts present, the run mode, and the
|
|
38
|
+
open-question tally):
|
|
39
|
+
```bash
|
|
40
|
+
P=.claude/skills/devrites-lib/scripts/preamble.sh
|
|
41
|
+
[ -f "$P" ] || P="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/preamble.sh"
|
|
42
|
+
[ -f "$P" ] || P=pack/.claude/skills/devrites-lib/scripts/preamble.sh
|
|
43
|
+
[ -f "$P" ] && bash "$P" || echo "(orientation preamble unavailable on this install — read state.md directly to orient)"
|
|
44
|
+
```
|
|
45
|
+
If there is no active workspace, no `spec.md`, or its readiness gate hasn't passed →
|
|
46
|
+
**STOP** and tell the user to run `/rite-spec <feature>` first.
|
|
47
|
+
1. **Read the spec** — `spec.md` (objective, requirements, acceptance, **placement**,
|
|
48
|
+
design references, gaps/decisions), plus `references.md`, `decisions.md`,
|
|
49
|
+
`assumptions.md`, **`strategy.md` if present** (the scope mode, deferred / out-of-scope
|
|
50
|
+
register, and pre-mortem risks from `/rite-temper` — cut slices to mitigate the top risks
|
|
51
|
+
and respect the IN/OUT line; map coverage against the **hardened** spec), and
|
|
52
|
+
**`design-brief.md` if the feature touches UI** (the UX/UI contract `/rite-spec` shaped —
|
|
53
|
+
its key states + interaction model drive how UI slices are cut). If a blocking
|
|
54
|
+
`[NEEDS CLARIFICATION]` remains, stop → `/rite-spec`.
|
|
55
|
+
2. **Decide the approach + architecture** (the HOW the spec deliberately omitted): the
|
|
56
|
+
strategy, key technical decisions + rationale, and the tech the slices will use. Use a
|
|
57
|
+
code-intelligence index if available — codebase-memory-mcp first, cross-checked with codegraph + graphify, else standard methods (LSP / Read/Grep/Glob)
|
|
58
|
+
(see `.claude/rules/tooling.md`) — for structure/impact; for the current API or behaviour of
|
|
59
|
+
an external library/framework the architecture will rely on, consult context7 if available.
|
|
60
|
+
Record in `plan.md` ([plan-template](reference/plan-template.md)) and `decisions.md`.
|
|
61
|
+
**Deep-modules check** — while sketching the major modules, look for opportunities
|
|
62
|
+
to extract a **deep module**: a small, stable interface that hides a meaningful chunk
|
|
63
|
+
of behavior, and is therefore independently testable. A *shallow* module — interface
|
|
64
|
+
nearly as complex as its implementation — earns nothing; either deepen it or delete
|
|
65
|
+
it. Where a slice will produce a deep module, confirm with the user which deep
|
|
66
|
+
modules they want unit-tested in isolation (this informs the slice's "Tests to
|
|
67
|
+
write/run" field).
|
|
68
|
+
3. **Slice into vertical tasks** — each delivers one observable capability end-to-end and
|
|
69
|
+
is verifiable on its own; the **count emerges from the work, not a target number**;
|
|
70
|
+
first slice = thinnest useful end-to-end path; order by dependency (risk-first within a
|
|
71
|
+
tier). Use `rite-plan/reference/slicing.md` and
|
|
72
|
+
`rite-plan/reference/task-breakdown.md`. Mark per slice: **Frontend craft required**
|
|
73
|
+
and **Browser proof required** (UI), and whether it's **fullstack** (FE+BE → contract
|
|
74
|
+
first, see `devrites-frontend-craft/reference/fullstack.md`). **For UI slices, name which
|
|
75
|
+
of `design-brief.md`'s key states + interaction the slice delivers** — so the brief's
|
|
76
|
+
state coverage maps onto slices, not just acceptance criteria.
|
|
77
|
+
4. **Map coverage** — every spec acceptance criterion maps to ≥1 slice
|
|
78
|
+
(`rite-spec/reference/acceptance-criteria.md`); no orphaned criteria, no slice without a
|
|
79
|
+
criterion.
|
|
80
|
+
4a. **Persist the traceability matrix** — write `coverage.md` (`AC-id → slice(s) → test →
|
|
81
|
+
evidence-status`), the living map `/rite-prove` and `/rite-seal` walk. Generate it with
|
|
82
|
+
`coverage.sh` (it reads `spec.md` acceptance + the `tasks.md` `Satisfies:` lines), or write the
|
|
83
|
+
table by hand from the same inputs if the script is absent:
|
|
84
|
+
```bash
|
|
85
|
+
C=.claude/skills/devrites-lib/scripts/coverage.sh
|
|
86
|
+
[ -f "$C" ] || C="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/coverage.sh"
|
|
87
|
+
[ -f "$C" ] || C=pack/.claude/skills/devrites-lib/scripts/coverage.sh
|
|
88
|
+
S="$(cat .devrites/ACTIVE 2>/dev/null)"
|
|
89
|
+
[ -f "$C" ] && bash "$C" "$S" > ".devrites/work/$S/coverage.md" || echo "(coverage.sh unavailable — write coverage.md by hand from spec AC + tasks Satisfies:)"
|
|
90
|
+
```
|
|
91
|
+
5. **Complexity & deviations gate** — justify anything off DevRites defaults (new dep,
|
|
92
|
+
extra abstraction, second design system) in the plan; if you can't justify it, simplify.
|
|
93
|
+
6. **Write** `plan.md` + `tasks.md`; update `state.md` (phase: plan → next `/rite-build`).
|
|
94
|
+
7. **Readiness gate** (bottom of plan-template): every acceptance criterion covered by a
|
|
95
|
+
slice, dependency order acyclic + risk-first, no unjustified deviation, rollback for
|
|
96
|
+
every destructive/migration step. **Stop and confirm** before code. When the human
|
|
97
|
+
confirms the plan, write `Plan approved: <iso>` to `state.md` (see
|
|
98
|
+
[state-workspace](../rite-spec/reference/state-workspace.md)); `/rite-build` checks
|
|
99
|
+
this exists before building.
|
|
100
|
+
|
|
101
|
+
## tasks.md slice format
|
|
102
|
+
```markdown
|
|
103
|
+
## Slice N: <name>
|
|
104
|
+
Goal:
|
|
105
|
+
Satisfies: AC-n[, AC-m] # reverse traceability — which spec acceptance criteria this slice satisfies
|
|
106
|
+
Acceptance criteria: # which spec FR/criteria this satisfies
|
|
107
|
+
Complexity: N/5 — <reason> # 1=trivial … 5=hairy; >3 triggers a reslice unless the reason justifies it
|
|
108
|
+
Mode: AFK | HITL # AFK = implementable + mergeable without human gating;
|
|
109
|
+
# HITL = needs a human decision mid-slice (design call,
|
|
110
|
+
# architectural choice, destructive migration sign-off).
|
|
111
|
+
# Prefer AFK; only mark HITL with the reason inline.
|
|
112
|
+
Gate: advisory | validating | blocking | escalating # required when Mode=HITL; see reference/gates.md
|
|
113
|
+
SLA: 15m | 4h | 24h | none # required when Mode=HITL; matches the gate
|
|
114
|
+
Checkpoint: <one crisp question> # required when Mode=HITL; what the human must decide
|
|
115
|
+
Blocked by: Slice M, Slice K # other slices that must complete first ("None" if free)
|
|
116
|
+
depends_on: [Slice M, Slice K] # machine-readable mirror of Blocked by (same set) — coverage.sh + /rite-status read it
|
|
117
|
+
Consumes / Produces: # interfaces this slice reads (types/endpoints/events from prior slices) and exposes for later ones
|
|
118
|
+
Known-Gotchas: # sharp edges / ordering hazards / framework footguns the wright must avoid (keeps the slice one-pass)
|
|
119
|
+
Validation commands: # exact runnable commands that prove the slice green (test / build / typecheck / lint)
|
|
120
|
+
Prior-slice learnings: # (filled forward) what an earlier slice discovered that this one must honor — starts empty
|
|
121
|
+
Files likely touched: # from the spec's Placement & integration
|
|
122
|
+
Tests to write/run:
|
|
123
|
+
Browser proof required: yes/no
|
|
124
|
+
Frontend craft required: yes/no
|
|
125
|
+
Design brief states: # UI slices only — which design-brief.md states/interaction this slice delivers (default/empty/error/…)
|
|
126
|
+
Fullstack (FE+BE): yes/no
|
|
127
|
+
Dependencies: # external deps (libs, services), NOT slice ordering
|
|
128
|
+
Existing to reuse / extend: # what already exists (components / utils / hooks) the slice should use
|
|
129
|
+
Rollback notes:
|
|
130
|
+
Evidence required:
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
> **Why Mode + Gate + Blocked by.** `Mode` lets `/rite-build` and `/rite-status` know
|
|
134
|
+
> whether a slice can run unattended or must surface a checkpoint; `Gate` + `SLA` tell
|
|
135
|
+
> AFK loops which gates they may auto-handle vs which always pause (see
|
|
136
|
+
> [`reference/gates.md`](reference/gates.md) for the four-gate taxonomy:
|
|
137
|
+
> advisory / validating / blocking / escalating). `Blocked by` makes the dependency
|
|
138
|
+
> graph explicit so re-planning (`/rite-plan reorder`) doesn't break acceptance-criteria
|
|
139
|
+
> coverage. Keep `Blocked by` cycle-free. `depends_on` is the machine-readable mirror tools read
|
|
140
|
+
> to pick the next *buildable* slice; `Complexity` (>3 → reslice) sizes it; `Satisfies` +
|
|
141
|
+
> `Consumes/Produces` + `Known-Gotchas` + `Validation commands` make each slice a self-contained,
|
|
142
|
+
> one-pass-implementable brief (the PRP target `/rite-vet` checks).
|
|
143
|
+
|
|
144
|
+
> **Mid-flight discipline.** When tempted to skip vertical slicing, coverage mapping, or dependency-order discipline — see [`anti-patterns`](reference/anti-patterns.md) (Common Rationalizations + Red Flags). Load it the moment you reach for the excuse.
|
|
145
|
+
|
|
146
|
+
## Output
|
|
147
|
+
|
|
148
|
+
**Footer first** — render the slice meter + flow ribbon by running the progress footer (`progress.sh`, resolved like the step-0 preamble — canonical snippet in `devrites-lib/SKILL.md`); keep the fact lines below it terse (`key value · key value`). Then:
|
|
149
|
+
```
|
|
150
|
+
Planned: <slug>
|
|
151
|
+
Approach: <one line>
|
|
152
|
+
Slices: N (slice 1: <name>) Fullstack/UI slices: <which>
|
|
153
|
+
Coverage: <all acceptance criteria mapped? yes/no>
|
|
154
|
+
Strategy: honored (mode <m>; <n> pre-mortem risks → mitigation slices) | none (no strategy.md)
|
|
155
|
+
Next: confirm, then /rite-vet to lock in the engineering plan (every feature — light or full per stakes), then /rite-build (or /rite-plan to reshape the slices)
|
|
156
|
+
↻ Hygiene: /clear after user confirms (plan.md + tasks.md + decisions.md + state.md captured). See rules/context-hygiene.md.
|
|
157
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# rite-define — anti-patterns
|
|
2
|
+
|
|
3
|
+
Load this when standing a non-trivial planning decision in `/rite-define`,
|
|
4
|
+
or when the agent feels reluctance toward vertical slicing or coverage
|
|
5
|
+
mapping.
|
|
6
|
+
|
|
7
|
+
Pack-wide rationalizations + red flags: see [rules/anti-patterns.md](../../../rules/anti-patterns.md).
|
|
8
|
+
|
|
9
|
+
## Phase-specific rationalizations
|
|
10
|
+
|
|
11
|
+
| Excuse | Rebuttal |
|
|
12
|
+
|---|---|
|
|
13
|
+
| "Spec is good enough; just start coding." | Plan separates HOW from WHAT for a reason — missed HOW shows up as drift at slice 3. |
|
|
14
|
+
| "One big slice is fine, the work is all related." | If slice 1 isn't shippable on its own, you're not slicing vertically — you're staging waterfall in disguise. |
|
|
15
|
+
| "Tests can come at build time, not in tasks." | Every slice's `Tests to write/run` line is the contract that proves its acceptance — leave it blank, lose the contract. |
|
|
16
|
+
| "Backend + frontend belong in one slice." | Fullstack goes contract-first: split the contract, then build a thin vertical slice that crosses both layers. |
|
|
17
|
+
| "I can skip mapping every spec criterion." | An unmapped criterion is one nobody will build. Coverage isn't bureaucracy. |
|
|
18
|
+
|
|
19
|
+
## Red Flags
|
|
20
|
+
|
|
21
|
+
- A slice with no acceptance criterion link back to `spec.md`.
|
|
22
|
+
- No first slice that's end-to-end thin (every slice depends on infra that doesn't exist yet).
|
|
23
|
+
- A new dependency added without rationale in `decisions.md`.
|
|
24
|
+
- A slice that doesn't list "Existing to reuse / extend" (you didn't search).
|
|
25
|
+
- Plan readiness gate failing but you're about to call `/rite-build` anyway.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Gate taxonomy — advisory · validating · blocking · escalating
|
|
2
|
+
|
|
3
|
+
DevRites uses a four-gate model for HITL pauses, adapted from the regulated-agentic-workflow
|
|
4
|
+
governance pattern. Picking the right gate for each `Mode: HITL` slice is the difference
|
|
5
|
+
between a workflow that catches real risk and one that becomes a review queue.
|
|
6
|
+
|
|
7
|
+
> **Default failure mode:** marking every HITL slice as `blocking`. The same reviewer ends
|
|
8
|
+
> up approving low-stakes and high-stakes items at the same priority and the gate becomes
|
|
9
|
+
> a queue. Mix gate types per slice; most plans use 2-3 of the 4.
|
|
10
|
+
|
|
11
|
+
## The four gates
|
|
12
|
+
|
|
13
|
+
### advisory
|
|
14
|
+
|
|
15
|
+
**Stakes:** low. The slice can ship without the human's input; the question exists for
|
|
16
|
+
audit / future record / FYI.
|
|
17
|
+
|
|
18
|
+
**Behavior:** the slice runs. The question is logged to `questions.md` with
|
|
19
|
+
`gate: advisory` and an explanation. `state.md` does **not** flip to `awaiting_human`.
|
|
20
|
+
`/rite-status` surfaces the count but does not flag it as blocking.
|
|
21
|
+
|
|
22
|
+
**Example:** "We picked option A from the prototype's verdict but option B is also viable.
|
|
23
|
+
Recording the choice for posterity."
|
|
24
|
+
|
|
25
|
+
**SLA:** `none` — there is no waiting time because nothing is waiting.
|
|
26
|
+
|
|
27
|
+
### validating
|
|
28
|
+
|
|
29
|
+
**Stakes:** medium. The slice can be built but should not merge before a human signs off.
|
|
30
|
+
Async — the human reviews when they get to it, but the loop does not stall.
|
|
31
|
+
|
|
32
|
+
**Behavior:** in HITL mode, `/rite-build` pauses on this gate and writes
|
|
33
|
+
`Awaiting human` to `state.md`. In AFK mode with `allow_gates: [advisory, validating]`,
|
|
34
|
+
`/rite-build` builds the slice but marks it `built (pending review)` and writes the
|
|
35
|
+
validating question; the feature does not seal until the entry is resolved. An open
|
|
36
|
+
`gate: validating` entry is **merge-blocking by definition** — a slice marked
|
|
37
|
+
`built (pending review)` is not done, and seal is a NO-GO while it stands open.
|
|
38
|
+
|
|
39
|
+
**Example:** "Schema migration adds a non-null column with a default. Backfill plan is
|
|
40
|
+
recorded; reviewer should confirm the default is the right one for archived rows."
|
|
41
|
+
|
|
42
|
+
**SLA:** `4h` — the work continues but the validating queue should drain within hours,
|
|
43
|
+
not days.
|
|
44
|
+
|
|
45
|
+
### blocking
|
|
46
|
+
|
|
47
|
+
**Stakes:** high. The slice cannot proceed safely without the answer. Synchronous —
|
|
48
|
+
the loop stops.
|
|
49
|
+
|
|
50
|
+
**Behavior:** **always pauses regardless of `.devrites/AFK` config.** `/rite-build`
|
|
51
|
+
writes `Awaiting human`, sets `Status: awaiting_human`, fires the `notify:` hook, and
|
|
52
|
+
STOPs. The slice is not built until `/rite-resolve` lands.
|
|
53
|
+
|
|
54
|
+
**Examples:**
|
|
55
|
+
- Destructive migration (data loss risk).
|
|
56
|
+
- Auth/authz boundary change.
|
|
57
|
+
- Public API break.
|
|
58
|
+
- Spec drift that changes acceptance criteria.
|
|
59
|
+
- Tests / types / lint are red and the agent cannot tell whether the slice's contract is
|
|
60
|
+
wrong or the failing code is.
|
|
61
|
+
|
|
62
|
+
**SLA:** `15m` — synchronous gates demand fast turnaround; otherwise treat the work as
|
|
63
|
+
genuinely blocked and re-plan around it.
|
|
64
|
+
|
|
65
|
+
### escalating
|
|
66
|
+
|
|
67
|
+
**Stakes:** novel pattern. The question is not within the active reviewer's scope and
|
|
68
|
+
needs to route to a specialist (legal, security, principal engineer, designer-of-record).
|
|
69
|
+
|
|
70
|
+
**Behavior:** same pause behavior as `blocking`, but the `questions.md` entry includes a
|
|
71
|
+
`route:` field naming the specialist tag. `/rite-status` shows it under a separate
|
|
72
|
+
"Escalating" line so it doesn't compete with synchronous blockers for the same reviewer.
|
|
73
|
+
|
|
74
|
+
**Example:** "Slice introduces a contract with an external partner — needs legal review
|
|
75
|
+
of the data-sharing language."
|
|
76
|
+
|
|
77
|
+
**SLA:** `24h` — specialist routing implies the SLA is loose; if it needs to be tight,
|
|
78
|
+
it's actually `blocking`.
|
|
79
|
+
|
|
80
|
+
## Picking the gate
|
|
81
|
+
|
|
82
|
+
Apply this decision tree per HITL slice:
|
|
83
|
+
|
|
84
|
+
1. **Can the slice ship safely without the answer?**
|
|
85
|
+
- Yes → `advisory`.
|
|
86
|
+
- No → continue.
|
|
87
|
+
2. **Does the slice need a different reviewer than the default one?**
|
|
88
|
+
- Yes → `escalating`.
|
|
89
|
+
- No → continue.
|
|
90
|
+
3. **Can the slice be built but not merged until reviewed?**
|
|
91
|
+
- Yes → `validating`.
|
|
92
|
+
- No → `blocking`.
|
|
93
|
+
|
|
94
|
+
## SLA mapping
|
|
95
|
+
|
|
96
|
+
| Gate | SLA | Synchronous? |
|
|
97
|
+
|---|---|---|
|
|
98
|
+
| advisory | `none` | — (does not pause) |
|
|
99
|
+
| validating | `4h` | no (async; build continues, merge blocks) |
|
|
100
|
+
| blocking | `15m` | yes |
|
|
101
|
+
| escalating | `24h` | yes, but to a specialist |
|
|
102
|
+
|
|
103
|
+
SLAs are guidance for human reviewers and for tools that surface stale questions. DevRites
|
|
104
|
+
itself does not enforce them; `/rite-status` reports time since `raised_at` so the user
|
|
105
|
+
can see when a gate is slipping.
|
|
106
|
+
|
|
107
|
+
## AFK interaction
|
|
108
|
+
|
|
109
|
+
`.devrites/AFK` carries an `allow_gates:` list. AFK auto-handles a gate by logging the
|
|
110
|
+
question as advisory and proceeding **only when** the gate is in `allow_gates`. The
|
|
111
|
+
defaults and the always-pause rules:
|
|
112
|
+
|
|
113
|
+
| AFK `allow_gates` | advisory | validating | blocking | escalating |
|
|
114
|
+
|---|---|---|---|---|
|
|
115
|
+
| `[]` (or omitted) | log + proceed | pause | pause | pause |
|
|
116
|
+
| `[advisory]` (default) | log + proceed | pause | pause | pause |
|
|
117
|
+
| `[advisory, validating]` | log + proceed | build + queue | pause | pause |
|
|
118
|
+
| `[advisory, validating, blocking]` | log + proceed | build + queue | log + proceed* | pause |
|
|
119
|
+
|
|
120
|
+
\* but **never** for destructive migrations, auth/authz boundary changes, public API
|
|
121
|
+
breaks, or red tests/types/lint — those always pause. See
|
|
122
|
+
[`.claude/rules/afk-hitl.md`](../../../rules/afk-hitl.md) for the irreversible-risk
|
|
123
|
+
list.
|
|
124
|
+
|
|
125
|
+
`escalating` is never in `allow_gates` — specialist routing is not something AFK can
|
|
126
|
+
shortcut.
|
|
127
|
+
|
|
128
|
+
## Anti-patterns
|
|
129
|
+
|
|
130
|
+
- **One gate for everything.** Validates becomes a queue, blocks all work behind one
|
|
131
|
+
reviewer. Pick gates per slice.
|
|
132
|
+
- **Marking a destructive migration `validating` to "keep the loop moving".** Destructive
|
|
133
|
+
work is `blocking` regardless of the urge to ship.
|
|
134
|
+
- **`advisory` as a synonym for "I'm not sure but I don't want to ask".** If the slice
|
|
135
|
+
needs the answer, it's not advisory. Pick the right gate instead.
|
|
136
|
+
- **`escalating` with no `route:` field.** Without a specialist tag, an escalation is
|
|
137
|
+
just a slow blocker. Name who answers.
|
|
138
|
+
|
|
139
|
+
## Field shape in `tasks.md`
|
|
140
|
+
|
|
141
|
+
```markdown
|
|
142
|
+
## Slice 03: list endpoint
|
|
143
|
+
Mode: HITL
|
|
144
|
+
Gate: blocking
|
|
145
|
+
SLA: 15m
|
|
146
|
+
Checkpoint: Confirm (user_id, created_at) composite index choice vs two single-col indexes.
|
|
147
|
+
Blocked by: Slice 02
|
|
148
|
+
...
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
`Gate`, `SLA`, and `Checkpoint` are **required** when `Mode: HITL`. The plan readiness
|
|
152
|
+
gate in `plan-template.md` enforces this.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# `plan.md` template
|
|
2
|
+
|
|
3
|
+
Write **how** to build what `spec.md` defines. The plan is **living, not sacred** —
|
|
4
|
+
`/rite-plan` repairs it when reality disagrees. This is where technology choices live
|
|
5
|
+
(they're banned from the spec).
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
# Plan: <Feature>
|
|
9
|
+
Spec: ./spec.md Date: <date>
|
|
10
|
+
|
|
11
|
+
## Summary
|
|
12
|
+
1–2 sentences: the primary requirement + the chosen approach.
|
|
13
|
+
|
|
14
|
+
## Technical context
|
|
15
|
+
- Language / runtime + version: <e.g. TypeScript 5, Node 20>
|
|
16
|
+
- Frameworks / libraries in play: <...>
|
|
17
|
+
- Storage / data: <...>
|
|
18
|
+
- Testing tools + commands: <from spec "Commands discovered">
|
|
19
|
+
- Target / platform / constraints: <...>
|
|
20
|
+
- `[NEEDS CLARIFICATION: ...]` for any unknown that affects the approach.
|
|
21
|
+
|
|
22
|
+
## Approach
|
|
23
|
+
The strategy in a few sentences. Why this over the alternatives considered.
|
|
24
|
+
|
|
25
|
+
## Architecture decisions
|
|
26
|
+
Key decisions + rationale (mirror into decisions.md). New pattern vs reuse — prefer
|
|
27
|
+
reuse of existing project conventions.
|
|
28
|
+
|
|
29
|
+
## Dependency graph
|
|
30
|
+
What must exist before what (text is fine):
|
|
31
|
+
- Slice 1 (no deps) → Slice 2 (needs 1) → Slice 4 (needs 2,3)
|
|
32
|
+
- Slice 3 (independent / parallelizable)
|
|
33
|
+
|
|
34
|
+
## Implementation order
|
|
35
|
+
Ordered slice list + the reason for the order (risk-first within a dependency tier).
|
|
36
|
+
|
|
37
|
+
## Verification checkpoints
|
|
38
|
+
After which slices to run tests / build / browser proof.
|
|
39
|
+
|
|
40
|
+
## Complexity & deviations gate
|
|
41
|
+
List anything that deviates from DevRites defaults (prefer existing conventions, the
|
|
42
|
+
simplest approach, feature scope only, no new deps/design system) and **justify it**.
|
|
43
|
+
If you can't justify a deviation, simplify instead of recording it.
|
|
44
|
+
| Deviation | Why needed | Simpler option rejected because |
|
|
45
|
+
|-----------|-----------|---------------------------------|
|
|
46
|
+
| <e.g. new dependency X> | <reason> | <why the in-repo option won't work> |
|
|
47
|
+
|
|
48
|
+
## Rollback notes
|
|
49
|
+
How to back out each risky step (migration down, feature flag, revert boundary, backup).
|
|
50
|
+
|
|
51
|
+
## Scope boundaries
|
|
52
|
+
What this plan will NOT touch. Restate "Ask first" / "Never do" from the spec.
|
|
53
|
+
|
|
54
|
+
## Source docs needed
|
|
55
|
+
Framework/library docs to consult (triggers devrites-source-driven). Record URLs in
|
|
56
|
+
decisions.md / evidence.md when used.
|
|
57
|
+
|
|
58
|
+
## Readiness gate *(must pass before /rite-build)*
|
|
59
|
+
- [ ] Every spec acceptance criterion is covered by a slice
|
|
60
|
+
- [ ] Dependency order is acyclic and risk-first
|
|
61
|
+
- [ ] No unjustified deviation remains in the complexity gate
|
|
62
|
+
- [ ] Rollback exists for every destructive / migration step
|
|
63
|
+
- [ ] Every `Mode: HITL` slice has `Gate`, `SLA`, and `Checkpoint` populated
|
|
64
|
+
- [ ] No `Gate: blocking` slice is implicitly chained behind an AFK slice without surfacing the dependency
|
|
65
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rite-doctor
|
|
3
|
+
description: Diagnose DevRites install + workspace health on demand and print a full report — install integrity, a stale `.devrites/ACTIVE` pointer, a corrupt workspace, orphaned gates, and broken hook wiring. Use when the user says "rite doctor", "check my DevRites install", "is DevRites healthy", "diagnose devrites", or "why isn't the workflow picking up my feature". Not for debugging the user's own code (use `devrites-debug-recovery`) or for feature progress / next-action (use `/rite-status`).
|
|
4
|
+
argument-hint: ""
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /rite-doctor — health check
|
|
9
|
+
|
|
10
|
+
The on-demand deep report. The same checks run **silently at session start** (the orient
|
|
11
|
+
hook surfaces issues only when there are any); `/rite-doctor` runs them **verbosely** —
|
|
12
|
+
printing every check, pass or fail — so you can inspect health even when nothing is broken.
|
|
13
|
+
|
|
14
|
+
It is **read-only**: it never edits the workspace, never advances a phase, never blocks.
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
1. Run the diagnose core verbosely (resolve across install layouts):
|
|
18
|
+
```bash
|
|
19
|
+
D=.claude/skills/devrites-lib/scripts/doctor.sh
|
|
20
|
+
[ -f "$D" ] || D="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/doctor.sh"
|
|
21
|
+
[ -f "$D" ] || D=pack/.claude/skills/devrites-lib/scripts/doctor.sh
|
|
22
|
+
[ -f "$D" ] && bash "$D" --verbose; echo "doctor rc=$?"
|
|
23
|
+
```
|
|
24
|
+
1a. **Surface the learnings nudge** — point the user at `/rite-learn` when a pattern recurs across
|
|
25
|
+
shipped features (read-only; silent when there's nothing to say):
|
|
26
|
+
```bash
|
|
27
|
+
L=.claude/skills/devrites-lib/scripts/learnings.sh
|
|
28
|
+
[ -f "$L" ] || L="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/learnings.sh"
|
|
29
|
+
[ -f "$L" ] || L=pack/.claude/skills/devrites-lib/scripts/learnings.sh
|
|
30
|
+
[ -f "$L" ] && bash "$L" nudge || true
|
|
31
|
+
```
|
|
32
|
+
2. Report the result. **rc=0** → "DevRites healthy" + the `ok:` checks. **rc=1** → list each
|
|
33
|
+
`issue:` line with the fix it names, then the single command that resolves the most urgent
|
|
34
|
+
one (a stale ACTIVE → `rite use <slug>` or `/rite-status`; an orphaned gate →
|
|
35
|
+
`/rite-resolve <qid>`; an incomplete install → reinstall).
|
|
36
|
+
3. **Do not fix anything yourself** — doctor is diagnostic. Hand the user the fix command.
|
|
37
|
+
|
|
38
|
+
## Gotchas
|
|
39
|
+
- Read-only — never write the workspace or advance a phase (that's the lifecycle skills' job).
|
|
40
|
+
- It diagnoses **DevRites** health, not the user's application — code bugs go to
|
|
41
|
+
`devrites-debug-recovery`; feature progress goes to `/rite-status`.
|
|
42
|
+
- Healthy is the common case; say so plainly and stop. Don't invent issues.
|
|
43
|
+
|
|
44
|
+
## Output
|
|
45
|
+
```
|
|
46
|
+
DevRites health: OK | N issue(s)
|
|
47
|
+
<for each issue: the problem + its fix>
|
|
48
|
+
Learnings: <n recurring pattern(s) across features → /rite-learn | none>
|
|
49
|
+
Next: <single command for the most urgent issue, or "nothing to do">
|
|
50
|
+
```
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rite-frame
|
|
3
|
+
description: Pre-flight + self-audit lens that applies the four classic LLM coding failure modes — silent assumption, overcomplication, out-of-scope edit, unverifiable goal — to ad-hoc and express-lane work the full lifecycle's gates never see. FRAME converts an imperative ask into a falsifiable success criterion + verify command before any code; AUDIT checks the resulting diff against the four modes, each mapped to its DevRites cure. Use at the top of `/rite-quick`, before a plain "just do X" / "quick fix" edit, or to self-review a raw diff for assumptions, bloat, scope creep, or a missing success criterion. Not a replacement for the lifecycle gates (`/rite-seal`, `/rite-review`), the adversarial subagent pre-mortem (`devrites-doubt`), or the fresh-context axis audit (`devrites-audit`) — it is the lightweight inline reflex for work that skips those.
|
|
4
|
+
argument-hint: "[task to frame | diff to audit]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /rite-frame — frame the goal, audit the diff
|
|
9
|
+
|
|
10
|
+
LLMs reliably get four things wrong: they **assume** silently, **overcomplicate**, edit
|
|
11
|
+
**out of scope**, and run on an **unverifiable** "make it work". The full DevRites
|
|
12
|
+
lifecycle catches all four at its gates (spec readiness, the Spec Drift Guard,
|
|
13
|
+
`touched-files.md` + `reconcile.sh`, `/rite-seal`). But the express lane and plain
|
|
14
|
+
"just do X" requests **skip those gates** — and a raw diff has no gate at all.
|
|
15
|
+
|
|
16
|
+
`rite-frame` is the gate's reflex made portable. Two moves, no workspace required:
|
|
17
|
+
|
|
18
|
+
- **FRAME** (before code) — turn the imperative ask into a falsifiable success criterion
|
|
19
|
+
and the command that proves it. *"Give it success criteria and watch it go."*
|
|
20
|
+
- **AUDIT** (after the change) — read the diff against the four failure modes; route each
|
|
21
|
+
finding to the DevRites cure that already exists for it.
|
|
22
|
+
|
|
23
|
+
It is a self-applied lens, not a subagent and not a phase. Light enough to run at the top
|
|
24
|
+
of a one-line fix; the heavy guns (`devrites-doubt`, `devrites-audit`, the seal) stay where
|
|
25
|
+
they are.
|
|
26
|
+
|
|
27
|
+
## When to use
|
|
28
|
+
At the top of `/rite-quick` · before a plain "just do X" / "quick fix" / "tiny tweak" edit
|
|
29
|
+
that won't go through the lifecycle · to self-review a raw `git diff` before you commit ·
|
|
30
|
+
any time you're about to act on an imperative without a written success criterion.
|
|
31
|
+
|
|
32
|
+
**When not:** a real feature (use `/rite-spec`) · a single high-stakes decision that wants
|
|
33
|
+
an adversarial second read (`devrites-doubt`) · a fresh-context axis review of an active
|
|
34
|
+
feature (`devrites-audit <security|perf|simplify>`) · the final GO/NO-GO (`/rite-seal`).
|
|
35
|
+
rite-frame is the *inline* reflex; those are the *gates*. Don't use it to dodge one.
|
|
36
|
+
|
|
37
|
+
## FRAME — before you touch code
|
|
38
|
+
|
|
39
|
+
Restate the ask as a check, not a chore. Convert the verb into a condition that can be
|
|
40
|
+
**false**:
|
|
41
|
+
|
|
42
|
+
| Imperative ask | Falsifiable success criterion |
|
|
43
|
+
|---|---|
|
|
44
|
+
| "Add validation" | "Inputs `{empty, oversize, wrong-type}` are rejected with a 4xx + message — a test asserts each, and fails today." |
|
|
45
|
+
| "Fix the bug" | "A test reproduces the bug (red now), and turns green after the fix — nothing else changes." |
|
|
46
|
+
| "Make it faster" | "Operation X drops from `<measured baseline>` to `<target>` on `<named benchmark>`." |
|
|
47
|
+
| "Refactor X" | "The existing suite is green before and after; behavior is byte-identical." |
|
|
48
|
+
| "Clean this up" | *(no falsifiable criterion → the ask is ambiguous → mode 1 → ask what "clean" means, or route to `/rite-spec`)* |
|
|
49
|
+
|
|
50
|
+
Checklist (copy it):
|
|
51
|
+
|
|
52
|
+
- [ ] **Criterion** — one sentence: *"Done WHEN `<observable, falsifiable check>`."* If you
|
|
53
|
+
can't write one that could be false, the ask is ambiguous — **stop, name it, ask** (that
|
|
54
|
+
is failure mode 1, surfaced early instead of after the diff).
|
|
55
|
+
- [ ] **Verify command** — the exact test / build / runtime / screenshot that decides it.
|
|
56
|
+
No command → no proof → you're about to confidence-assert. Name it now.
|
|
57
|
+
- [ ] **Scope boundary** — the files/areas you will **not** touch. Anything outside is mode 3.
|
|
58
|
+
- [ ] **Loop** — with a falsifiable criterion you can iterate to green unattended; with a weak
|
|
59
|
+
one ("make it work") you'll need the user every few minutes. Sharpen the criterion until
|
|
60
|
+
it can drive the loop.
|
|
61
|
+
|
|
62
|
+
## AUDIT — after the change
|
|
63
|
+
|
|
64
|
+
Read the diff (or `$ARGUMENTS`) against the four modes. One line per finding, severity-tagged
|
|
65
|
+
(`Critical / Important / Suggestion / Nit / FYI`), each routed to its existing cure. Full
|
|
66
|
+
map + worked examples: [`reference/failure-modes.md`](reference/failure-modes.md).
|
|
67
|
+
|
|
68
|
+
- [ ] **1 · Silent assumption** — did I pick one reading of an ambiguous ask and run with it?
|
|
69
|
+
Any value, contract, or behavior I *guessed*? → surface it; route material ones through
|
|
70
|
+
the Spec Drift Guard (`core.md` #2/#3).
|
|
71
|
+
- [ ] **2 · Overcomplication** — an abstraction / flag / indirection nobody asked for? 200 lines
|
|
72
|
+
where 50 would do? A defensive check inside trusted code? → apply the **deletion test**;
|
|
73
|
+
simplify (`coding-style.md`, `patterns.md`, `devrites-audit simplify`).
|
|
74
|
+
- [ ] **3 · Out-of-scope edit** — did I touch code, comments, or formatting outside the ask?
|
|
75
|
+
"While I'm here" refactors? → revert to the boundary; record the rest as an FYI follow-up
|
|
76
|
+
(`core.md` #7, `touched-files.md`).
|
|
77
|
+
- [ ] **4 · Unverifiable goal** — is there a command that proves this, run, with output? Or am
|
|
78
|
+
I asserting "it works"? Tautological test that can't fail? → run the FRAME verify command;
|
|
79
|
+
record command + output (`testing.md`, evidence-over-confidence).
|
|
80
|
+
|
|
81
|
+
The test for each changed line: **it traces directly to the criterion, and the criterion can
|
|
82
|
+
be proven false.** A line that fails either is a finding.
|
|
83
|
+
|
|
84
|
+
## Escalation
|
|
85
|
+
|
|
86
|
+
If FRAME can't produce a falsifiable criterion, or AUDIT surfaces a mode-1 / mode-3 issue that
|
|
87
|
+
is actually a hidden design decision (new dependency, data model, second design system, an
|
|
88
|
+
auth/migration/public-API touch) → **STOP and route to `/rite-spec`**. Same drift guard the
|
|
89
|
+
express lane enforces — don't quietly grow an unframed ask into unreviewed work.
|
|
90
|
+
|
|
91
|
+
## Rules
|
|
92
|
+
- Self-applied and inline. No subagent, no `.devrites/` workspace required. For an adversarial
|
|
93
|
+
fresh-context read of one decision use `devrites-doubt`; for a fresh-context axis audit of an
|
|
94
|
+
active feature use `devrites-audit`.
|
|
95
|
+
- FRAME before code, AUDIT after. Running AUDIT without having framed the criterion first means
|
|
96
|
+
mode 4 has nothing to check against.
|
|
97
|
+
- A criterion that can't be false isn't a criterion — it's a wish. Rewrite it or ask.
|
|
98
|
+
- Feature/ask scope only. Out-of-scope findings become FYI follow-ups, never silent fixes.
|
|
99
|
+
|
|
100
|
+
## Output
|
|
101
|
+
```
|
|
102
|
+
FRAME
|
|
103
|
+
Criterion: Done WHEN <falsifiable check>.
|
|
104
|
+
Verify: <exact command / observation>
|
|
105
|
+
Boundary: <files/areas NOT touched>
|
|
106
|
+
|
|
107
|
+
AUDIT (post-change)
|
|
108
|
+
1 assumption : <clean | finding → cure>
|
|
109
|
+
2 simplicity : <clean | finding → cure>
|
|
110
|
+
3 scope : <clean | finding → cure>
|
|
111
|
+
4 verifiable : <command → result, or finding>
|
|
112
|
+
Verdict: framed & clean | N findings (acted | escalated to /rite-spec)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
↻ Hygiene: rite-frame adds no workspace state — nothing to persist. If it routed you to
|
|
116
|
+
`/rite-spec`, that phase owns the handoff from here.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# The four failure modes — mapped to their DevRites cure
|
|
2
|
+
|
|
3
|
+
The lens behind `rite-frame`. Each mode is a thing LLMs reliably get wrong; each already
|
|
4
|
+
has a cure somewhere in the pack. The value of naming them here is a **portable
|
|
5
|
+
vocabulary** — a fast self-check you can run on ad-hoc or express-lane work that never
|
|
6
|
+
reaches the gates where those cures normally fire.
|
|
7
|
+
|
|
8
|
+
## The map
|
|
9
|
+
|
|
10
|
+
| # | Failure mode | The tell in a diff / a reply | Cure already in the pack |
|
|
11
|
+
|---|---|---|---|
|
|
12
|
+
| 1 | **Silent assumption** | A value, contract, edge case, or interpretation was *guessed* and run with — no note, no question. The ask had two readings and one was picked silently. | `core.md` #2 (no silent assumptions) / #3 (no guessing through confusion); the Spec Drift Guard; `devrites-doubt` for a single high-stakes call; `devrites-interview` when the ask is underspecified. |
|
|
13
|
+
| 2 | **Overcomplication** | An abstraction, flag, config knob, or indirection nobody asked for. 200 lines where 50 would do. A single-use factory. Defensive `try/catch` + null checks inside trusted code. A dependency added where an in-repo option exists. | `coding-style.md` (simplicity, reuse-first), `patterns.md` (avoid over-engineering), `devrites-audit simplify` (deletion test, Chesterton's Fence), the "over-defensive guarding is slop" anti-pattern. |
|
|
14
|
+
| 3 | **Out-of-scope edit** | Touched code, comments, or formatting outside the ask. A "while I'm here" refactor. Renamed something orthogonal. Reflowed an import block. | `core.md` #7 (feature scope only), `touched-files.md` (the recorded diff boundary), `reconcile.sh` (hard-stops a source file changed outside the claimed set), the "it's only a small refactor" anti-pattern. |
|
|
15
|
+
| 4 | **Unverifiable goal** | "It works" with no command, no output, no test. A success criterion that can't be false ("make it better"). A tautological test that passes no matter what. | `rite-spec/reference/acceptance-criteria.md` (measurable acceptance), `core.md` #6 (evidence over confidence), `testing.md` (assertion strength, see it fail first), the TDD wright. |
|
|
16
|
+
|
|
17
|
+
The first three are the **diseases** Karpathy named; the fourth is the **leverage** — a
|
|
18
|
+
falsifiable criterion is what lets the model loop to done without a human in the loop every
|
|
19
|
+
few minutes. FRAME front-loads mode 4 so the AUDIT of modes 1–3 has something to check
|
|
20
|
+
against.
|
|
21
|
+
|
|
22
|
+
## FRAME: the imperative → falsifiable reframe
|
|
23
|
+
|
|
24
|
+
The move is to rewrite the *verb* as a *condition that can be false*. If you can't, the ask
|
|
25
|
+
is ambiguous — that's mode 1, caught before the diff instead of after.
|
|
26
|
+
|
|
27
|
+
| Imperative ask | Weak (still a wish) | Falsifiable criterion + verify |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| "Add validation" | "validate the inputs" | "`{empty, oversize, wrong-type}` → 4xx + message; a test asserts each and is red today." → `npm test path/to.spec` |
|
|
30
|
+
| "Fix the bug" | "make the bug go away" | "Test reproducing the report is red now, green after, nothing else changes." → the repro test |
|
|
31
|
+
| "Make it faster" | "improve performance" | "Endpoint X p95 `<baseline ms>` → `<target ms>` on `<named bench>`." → the benchmark cmd |
|
|
32
|
+
| "Refactor X" | "clean up X" | "Existing suite green before and after; behavior byte-identical." → full suite, twice |
|
|
33
|
+
| "Handle errors" | "add error handling" | "On `<failure F>` the system fails closed with `<observable>`; a test forces F." → that test |
|
|
34
|
+
| "Improve the UX" | "make it nicer" | *(no falsifiable check → ambiguous → `devrites-ux-shape` / ask which states/flows)* |
|
|
35
|
+
|
|
36
|
+
A criterion passes the bar when a reviewer could run the verify command and get a clear
|
|
37
|
+
pass or fail without asking you what you meant. If they'd have to ask, sharpen it.
|
|
38
|
+
|
|
39
|
+
## AUDIT: worked finding lines
|
|
40
|
+
|
|
41
|
+
Findings read like the rest of the pack — one line, severity-tagged, cite `file:line`, route
|
|
42
|
+
to the cure. Severity ladder is the pack standard (`Critical / Important / Suggestion / Nit /
|
|
43
|
+
FYI`).
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
auth.ts:42 Important mode 1 (assumption): assumes `role` is always present — unset on legacy rows. → validate at boundary or ask (core #2).
|
|
47
|
+
cart.ts:88 Suggestion mode 2 (overcomplication): single-use `StrategyFactory` for one caller. → inline; deletion test fails it (devrites-audit simplify).
|
|
48
|
+
utils.ts:5 FYI mode 3 (scope): reflowed an unrelated import block. → revert to boundary; not in this ask (core #7).
|
|
49
|
+
sum.spec:12 Important mode 4 (unverifiable): test asserts `mock.called`, not the result — passes if the fn is empty. → assert the value; see it fail first (testing.md).
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Clean lanes say so explicitly — `1 assumption: clean` — so the audit is a positive
|
|
53
|
+
statement, not a silent skip.
|
|
54
|
+
|
|
55
|
+
## How this differs from the heavier tools (so you don't reach past it)
|
|
56
|
+
|
|
57
|
+
- **`devrites-doubt`** — adversarial *fresh-context subagent* pre-mortem on **one** decision.
|
|
58
|
+
Heavier, independent, anti-anchoring. rite-frame is *self-applied* and covers the four modes
|
|
59
|
+
broadly; escalate a single load-bearing claim to doubt.
|
|
60
|
+
- **`devrites-audit <axis>`** — *fresh-context subagent* review of an **active feature's** diff
|
|
61
|
+
on one axis (security / perf / simplify). Needs a `.devrites/` workspace. rite-frame needs no
|
|
62
|
+
workspace and runs in your own context — cheaper, less independent.
|
|
63
|
+
- **`/rite-review` · `/rite-seal`** — the **gates**: parallel reviewer fan-out, blocking
|
|
64
|
+
severities, written verdict. rite-frame is the inline reflex for work that never reaches a
|
|
65
|
+
gate; it does not replace one. If the work is a real feature, the gate is the answer.
|
|
66
|
+
|
|
67
|
+
The point is not redundancy — it's a tiered ladder. rite-frame is the cheapest rung: a lens
|
|
68
|
+
you run yourself in seconds. Climb to doubt / audit / the gates as the stakes rise.
|