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,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rite-autocomplete
|
|
3
|
+
description: Run the entire DevRites lifecycle end-to-end with no per-phase human iteration — spec → temper → define → vet → build×N → prove → polish → review → seal → ship — picking the best option at each soft gate and recording why. A vague prompt triggers an up-front interview, then it runs unattended, pausing only on hard irreversible-risk / blocking / escalating gates or a NO-GO; `--ship` (alias `--yolo`) auto-confirms the final type-GO. Use when the user says "autocomplete", "do the whole thing", "run the full cycle", "one-shot this feature", or "ship it autonomously". Not for a single phase (use the specific `/rite-*` skill) or when the user wants to drive each step.
|
|
4
|
+
argument-hint: "[idea] [--ship|--yolo] [--max-slices N]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /rite-autocomplete — full lifecycle, unattended
|
|
9
|
+
|
|
10
|
+
Drives every DevRites phase in order without stopping for discretionary input. The
|
|
11
|
+
prompt may be vague — autocomplete asks its clarifying questions **up front**, then
|
|
12
|
+
runs to completion. It does **not** disable the safety gates: hard irreversible-risk,<!-- pack-scan-ignore: negated statement — gates are NOT disabled -->
|
|
13
|
+
blocking / escalating gates, and any NO-GO still pause.
|
|
14
|
+
|
|
15
|
+
## Rules consulted (read on demand from `.claude/rules/`)
|
|
16
|
+
**Step 0:** Read `.claude/rules/core.md` and `.claude/rules/afk-hitl.md` first.
|
|
17
|
+
|
|
18
|
+
## Operating rules
|
|
19
|
+
- **One human window.** Clarifying questions are batched up front via
|
|
20
|
+
`devrites-interview`. After that, discretionary decisions are made automatically and
|
|
21
|
+
recorded in `decisions.md` — not asked. See [reference/decision-policy.md](reference/decision-policy.md).
|
|
22
|
+
- **Safety gates are not bypassable.** AFK never auto-passes destructive migration /
|
|
23
|
+
auth-authz change / public-API break / external-contract change / red tests; blocking
|
|
24
|
+
and escalating gates and any open `gate: validating` always pause. `--ship` auto-confirms
|
|
25
|
+
the **final** type-GO only — nothing else.
|
|
26
|
+
- **Loop budget = the plan's own slice count, not a fixed number.** After `/rite-vet`
|
|
27
|
+
(not `/rite-define` — vet may split or add slices, so the count isn't final until then),
|
|
28
|
+
set the AFK budget to however many slices the plan has, so the loop builds exactly the
|
|
29
|
+
task's slices and stops when they're done. `--max-slices N` is an OPTIONAL *lower* safety
|
|
30
|
+
cap (partial / babysat run); omit it to run the whole plan. The budget is finite
|
|
31
|
+
(= planned slices), so a runaway is still bounded.
|
|
32
|
+
- **Best option, recorded.** For each discretionary choice, pick the option the relevant
|
|
33
|
+
specialist / reviewer favours and record the rationale. Never silently coin-flip.
|
|
34
|
+
- **Strategic review runs, but never auto-grows scope.** After `/rite-spec`, run `/rite-temper`
|
|
35
|
+
(significance-gated — it skips low-stakes specs in one line). Unattended it auto-applies only
|
|
36
|
+
`hold-rigor` + `reduce-to-MVP` (these never grow acceptance); **any `expand` is a blocking
|
|
37
|
+
pause**, and irreversible-risk findings always pause. Autocomplete hardens and may *prune* the
|
|
38
|
+
spec on its own; it never *expands* the build's scope without the human.
|
|
39
|
+
- **Engineering review runs on every plan, but never auto-grows scope.** After `/rite-define`,
|
|
40
|
+
run `/rite-vet` on **every** feature (depth scales — a light pass on simple plans, full rigor on
|
|
41
|
+
big/risky; never skipped). Unattended it auto-applies only *hardening* findings — added test
|
|
42
|
+
requirements, error-handling / failure-mode coverage, tightened scope, reuse-over-rebuild,
|
|
43
|
+
ordering / parallel-lane fixes (these never grow acceptance); **any finding that grows scope,
|
|
44
|
+
adds a slice, or changes acceptance is a blocking pause**, and irreversible-risk findings always
|
|
45
|
+
pause. Cross-model is off unless `--cross-model` was armed.
|
|
46
|
+
|
|
47
|
+
## Workflow
|
|
48
|
+
1. **Orient + parse args.** Run the shared orientation preamble — it prints `state.md`, the artifacts present,
|
|
49
|
+
the run mode (HITL/AFK), and the open-question tally by gate, so you orient deterministically
|
|
50
|
+
instead of re-deriving state from raw Markdown:
|
|
51
|
+
```bash
|
|
52
|
+
P=.claude/skills/devrites-lib/scripts/preamble.sh
|
|
53
|
+
[ -f "$P" ] || P="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/preamble.sh"
|
|
54
|
+
[ -f "$P" ] || P=pack/.claude/skills/devrites-lib/scripts/preamble.sh
|
|
55
|
+
[ -f "$P" ] && bash "$P" || echo "(orientation preamble unavailable on this install — read state.md directly to orient)"
|
|
56
|
+
```
|
|
57
|
+
The idea + flags: `--ship` / `--yolo` (auto-confirm the final
|
|
58
|
+
type-GO), `--max-slices N` (OPTIONAL *lower* safety cap for a partial run; default =
|
|
59
|
+
the plan's slice count, i.e. run all planned slices).
|
|
60
|
+
2. **Clarify up front.** If the idea is underspecified, run `devrites-interview` to
|
|
61
|
+
~95% confidence — the only interactive window. If already clear, skip.
|
|
62
|
+
3. **Arm AFK.** Write `.devrites/AFK` with `allow_gates: [advisory]`; set the slice budget
|
|
63
|
+
from the plan's count after `/rite-vet` (the slice count is only final post-vet), or from
|
|
64
|
+
an explicit `--max-slices` ([reference/loop.md](reference/loop.md)). validating / blocking / escalating +
|
|
65
|
+
irreversible-risk still pause.
|
|
66
|
+
4. **Drive the phases** ([reference/loop.md](reference/loop.md)): `/rite-spec` →
|
|
67
|
+
**`/rite-temper`** → `/rite-define` → **`/rite-vet`** → `/rite-build` (loop until all slices
|
|
68
|
+
built; `tick-afk.sh` each) → `/rite-prove` → `/rite-polish` → `/rite-review` → `/rite-seal`.
|
|
69
|
+
Run each by Reading its `SKILL.md` and executing its workflow; state is carried by the
|
|
70
|
+
workspace files, not chat.
|
|
71
|
+
5. **Apply stop conditions at every gate** ([reference/stop-conditions.md](reference/stop-conditions.md)):
|
|
72
|
+
on hard-risk / blocking / escalating / NO-GO / budget-exhausted / still-low-confidence
|
|
73
|
+
→ write `state.md` (`Status`, `Next step`), surface *why*, and **STOP**.
|
|
74
|
+
6. **Seal GO → ship.** With `--ship`, proceed to `/rite-ship` and auto-confirm the
|
|
75
|
+
type-GO. Without it, render the type-GO prompt and stop for the human.
|
|
76
|
+
|
|
77
|
+
> **Mid-flight discipline.** When tempted to auto-pass a blocking gate "to keep moving",
|
|
78
|
+
> answer a material question yourself instead of pausing, or run past red tests — stop.
|
|
79
|
+
> Autonomy is for the routine path; the gates exist for everything else.
|
|
80
|
+
|
|
81
|
+
## Output
|
|
82
|
+
A phase-by-phase progress log, then the final status. **End with the progress footer** —
|
|
83
|
+
run `progress.sh` (resolved like the step-0 preamble — canonical snippet in
|
|
84
|
+
`devrites-lib/SKILL.md`) as the last lines so the final slice meter + flow ribbon match the
|
|
85
|
+
rest of the lifecycle (it reads the lifecycle position the run reached, e.g. `ship ✓` or the
|
|
86
|
+
phase it stopped at):
|
|
87
|
+
```
|
|
88
|
+
Autocomplete: <slug>
|
|
89
|
+
spec ✓ temper ✓ (mode <m> | skipped) define ✓ vet ✓ (depth <light|full>, floor <band>) build ✓ (N slices) prove ✓ polish ✓ review ✓ seal: GO
|
|
90
|
+
→ SHIPPED <sha> on <branch> (--ship)
|
|
91
|
+
— or —
|
|
92
|
+
→ STOPPED — awaiting human at <phase>: <reason>
|
|
93
|
+
Resume: <single command>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
End with `↻ Hygiene` per `.claude/rules/context-hygiene.md` (`/clear` between long phases).
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Decision policy — how autocomplete "chooses the best option"
|
|
2
|
+
|
|
3
|
+
Unattended ≠ careless. Every discretionary choice is made the way a senior engineer
|
|
4
|
+
would, then **recorded** so the seal can audit it. The difference from interactive mode
|
|
5
|
+
is only *who answers* a discretionary question — not whether it's reasoned.
|
|
6
|
+
|
|
7
|
+
## The rule
|
|
8
|
+
|
|
9
|
+
For each non-trivial choice, pick the option the **relevant specialist favours**, and
|
|
10
|
+
write the choice + the one-line rationale to `decisions.md`. Do not coin-flip, and do
|
|
11
|
+
not pick the option that's merely easiest to implement.
|
|
12
|
+
|
|
13
|
+
| Choice type | Defer to | Then |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| Uncertain framework / library behaviour | `devrites-source-driven` (check the docs/source) | record the source in `evidence.md` |
|
|
16
|
+
| Risky boundary / data-model / API decision | `devrites-doubt` (+ `devrites-doubt-reviewer`) | record the trade-off in `decisions.md` |
|
|
17
|
+
| Cross-boundary contract (FE/BE split, API shape) | `devrites-api-interface` | contract-first slice |
|
|
18
|
+
| UI surface / states / a11y | `devrites-frontend-craft` | shape before code |
|
|
19
|
+
| Two reasonable designs, no clear winner | the simpler one that meets acceptance | note why in `decisions.md` |
|
|
20
|
+
|
|
21
|
+
## Defaults autocomplete may assume (record them)
|
|
22
|
+
|
|
23
|
+
- Follow the project's existing conventions, components, and test commands — always.
|
|
24
|
+
- Prefer the smallest vertical slice that proves the acceptance criterion.
|
|
25
|
+
- Reuse → extend → build new, in that order (`coding-style.md`).
|
|
26
|
+
- When two options are equivalent on the evidence, choose the lower-risk / more
|
|
27
|
+
reversible one.
|
|
28
|
+
|
|
29
|
+
## When a choice is NOT autocomplete's to make
|
|
30
|
+
|
|
31
|
+
If a discretionary choice would change **product behaviour, scope, data model, security
|
|
32
|
+
posture, or acceptance criteria**, it is no longer discretionary — it is a material
|
|
33
|
+
question. Route it through the Spec Drift Guard / a `blocking` question and **stop**
|
|
34
|
+
(see [stop-conditions.md](stop-conditions.md)). Autocomplete answers *how*, never
|
|
35
|
+
*what to build* beyond what the up-front interview settled.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# The autocomplete loop — arm AFK, drive every phase
|
|
2
|
+
|
|
3
|
+
Autocomplete is an orchestrator: it runs the existing `/rite-*` skills in order,
|
|
4
|
+
exactly as a human would, but without stopping between them. It owns no workflow of
|
|
5
|
+
its own — the phases do the work; autocomplete sequences them and enforces stops.
|
|
6
|
+
|
|
7
|
+
## Arm AFK
|
|
8
|
+
|
|
9
|
+
Arm the gate policy up front; set the slice budget once the plan's count is known:
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
allow_gates: [advisory] # only advisory auto-handles; validating+ pause
|
|
13
|
+
# notify: "<cmd>" # optional — fired on any awaiting_human pause
|
|
14
|
+
# max_slices: <N> # the slice BUDGET — set from the plan's count after
|
|
15
|
+
# /rite-define (or an explicit --max-slices). NOT a target decomposition; it only
|
|
16
|
+
# caps how many run unattended (default = all the plan's slices).
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The budget is the plan's own slice count, not a fixed number — so the loop builds exactly
|
|
20
|
+
the task's slices and stops when they're done; `--max-slices N` only *lowers* it for a
|
|
21
|
+
partial run. Arm the gate policy at step 3; write `max_slices` / `AFK slices remaining`
|
|
22
|
+
**after `/rite-vet`** (it runs before the build loop and may split or add a slice, so the
|
|
23
|
+
count isn't final until then — vet runs on every plan here, so always set the budget after it).
|
|
24
|
+
|
|
25
|
+
`allow_gates: [advisory]` is deliberate: an open `gate: validating` is merge-blocking
|
|
26
|
+
at seal (`afk-hitl.md`), so autocomplete must *pause* on it rather than queue it and
|
|
27
|
+
then hit NO-GO. Widen `allow_gates` only if the caller explicitly asked.
|
|
28
|
+
|
|
29
|
+
## Drive the phases
|
|
30
|
+
|
|
31
|
+
Run each by Reading its `SKILL.md` and executing that workflow. State flows through the
|
|
32
|
+
workspace files (`state.md`, `tasks.md`, `evidence.md`, …), so each phase picks up where
|
|
33
|
+
the last left off — there is nothing to thread through chat.
|
|
34
|
+
|
|
35
|
+
| Step | Phase | Loop / gate |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| 1 | `/rite-spec` | feed the interview answers; write `spec.md` |
|
|
38
|
+
| 2 | `/rite-temper` | significance-gated strategic review; harden spec + write `strategy.md`. Skip low-stakes specs in one line. AFK: `hold-rigor` / `reduce-to-MVP` auto-apply; **any `expand` pauses (blocking)**; irreversible-risk pauses |
|
|
39
|
+
| 3 | `/rite-define` | reads `strategy.md`; `plan.md` + `tasks.md`; record `Plan approved` |
|
|
40
|
+
| 4 | `/rite-vet` | engineering plan review on **every** plan (light pass on simple plans, full on big/risky; never skipped); harden `plan.md` / `tasks.md` + write `eng-review.md` + `test-plan.md`. AFK: hardening / coverage findings auto-apply; **any scope-growing / acceptance-changing finding pauses (blocking)**; irreversible-risk pauses. Set the slice budget after this (vet may split a slice) |
|
|
41
|
+
| 5 | `/rite-build` ×N | **loop** while any slice is `pending`; build one (the slice-wright reads `test-plan.md` for coverage), then run `bash .claude/skills/devrites-lib/scripts/tick-afk.sh state.md` — exit 3 (budget hit) ⇒ STOP |
|
|
42
|
+
| 6 | `/rite-prove` | once all slices `built`; walks `test-plan.md`; on failure → `devrites-debug-recovery` within scope |
|
|
43
|
+
| 7 | `/rite-polish` | re-verify after code edits (evidence must stay fresh) |
|
|
44
|
+
| 8 | `/rite-review` | apply in-scope fixes; re-prove if code changed |
|
|
45
|
+
| 9 | `/rite-seal` | GO/NO-GO decision (no git here) |
|
|
46
|
+
| 10 | `/rite-ship` | only if seal GO; `--ship` auto-confirms type-GO, else stop for human |
|
|
47
|
+
|
|
48
|
+
## Between phases
|
|
49
|
+
|
|
50
|
+
- Re-read the active workspace before each phase (don't trust chat memory).
|
|
51
|
+
- After a phase that edits code (build, polish, review), evidence may be stale — let
|
|
52
|
+
the next gate re-prove rather than carrying a stale pass (see
|
|
53
|
+
`.claude/rules/development-workflow.md`).
|
|
54
|
+
- Check [stop-conditions.md](stop-conditions.md) at every gate **before** advancing.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Stop conditions — when autocomplete must pause for a human
|
|
2
|
+
|
|
3
|
+
Autonomy covers the routine path. These are the cases where autocomplete writes
|
|
4
|
+
`state.md` (`Status: awaiting_human` or `blocked`), surfaces *why* + the single resume
|
|
5
|
+
command, fires `notify` if set, and **stops**. None are bypassable by `--ship`.
|
|
6
|
+
|
|
7
|
+
## Always stop (irreversible-risk list — from `afk-hitl.md`)
|
|
8
|
+
|
|
9
|
+
Regardless of `allow_gates` or `--ship`:
|
|
10
|
+
- Destructive data migration (drop column/table, irreversible backfill).
|
|
11
|
+
- Auth / authz boundary change.
|
|
12
|
+
- Public-API break (response shape, removed endpoint, changed status semantics).
|
|
13
|
+
- External-service contract change.
|
|
14
|
+
- Filesystem destruction outside the workspace.
|
|
15
|
+
- Red tests / types / lint at slice end (fail-on-red).
|
|
16
|
+
|
|
17
|
+
## Stop on gate severity
|
|
18
|
+
|
|
19
|
+
- `blocking` gate fires → synchronous pause.
|
|
20
|
+
- `escalating` gate fires → pause, route to the specialist tag.
|
|
21
|
+
- Any `questions.md` entry with `gate: validating` and `status: open` → pause (it is a
|
|
22
|
+
seal NO-GO by definition; don't sail into a guaranteed NO-GO).
|
|
23
|
+
|
|
24
|
+
## Stop on strategic-review scope expansion (`/rite-temper`)
|
|
25
|
+
|
|
26
|
+
- `/rite-temper` choosing scope mode `expand` — or otherwise **adding** any acceptance
|
|
27
|
+
criterion to `spec.md` — → synchronous pause, regardless of `allow_gates` / `--ship`.
|
|
28
|
+
Autocomplete may auto-apply only `hold-rigor` and `reduce-to-MVP` (they harden / prune and
|
|
29
|
+
never grow the build's scope); **growing scope unattended is never automatic**. A low-stakes
|
|
30
|
+
spec that temper skips, or a `hold-rigor` / `reduce-to-MVP` run, does **not** pause.
|
|
31
|
+
|
|
32
|
+
## Stop on workflow state
|
|
33
|
+
|
|
34
|
+
- **NO-GO at seal** → stop; surface every blocker with `file:line` and the fix
|
|
35
|
+
direction. Do not round NO-GO up to GO.
|
|
36
|
+
- **Spec Drift Guard fires** (`/rite-build` finds the plan is wrong and the change
|
|
37
|
+
alters product behaviour) → stop; route through `/rite-plan repair`.
|
|
38
|
+
- **Budget exhausted with slices still pending** — `tick-afk.sh` exit 3 while `tasks.md`
|
|
39
|
+
still has unbuilt slices (only when an explicit `--max-slices` capped the run below the
|
|
40
|
+
plan's count) → stop; report slices remaining. Exhausting the default budget = all
|
|
41
|
+
planned slices built = normal completion → continue to `/rite-prove`, don't pause.
|
|
42
|
+
- **Still low-confidence after the interview** — the idea can't be pinned to testable
|
|
43
|
+
acceptance criteria → stop and ask, rather than guessing the product.
|
|
44
|
+
- **Repeated failure** — a phase fails, `devrites-debug-recovery` can't fix it within
|
|
45
|
+
scope after a bounded number of attempts → stop with the reproduction.
|
|
46
|
+
|
|
47
|
+
## The final type-GO
|
|
48
|
+
|
|
49
|
+
- Default: render the type-GO prompt at `/rite-ship` and **stop** for the human's
|
|
50
|
+
literal `GO`.
|
|
51
|
+
- With `--ship` / `--yolo`: auto-confirm the type-GO (the *only* thing the flag changes).
|
|
52
|
+
Everything above still pauses.
|
|
53
|
+
|
|
54
|
+
## How to stop well
|
|
55
|
+
|
|
56
|
+
State must be enough for a fresh agent to resume cold:
|
|
57
|
+
- `state.md`: `Status`, the blocking reason, and a single `Next step` command.
|
|
58
|
+
- The relevant `questions.md` / `drift.md` / `seal.md` entry that explains the pause.
|
|
59
|
+
- A one-line user-facing message: *what* stopped it and *what command* resumes.
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rite-build
|
|
3
|
+
description: Implement exactly ONE vertical slice of the active feature, then stop with evidence. A fresh-context `devrites-slice-wright` writes the slice (orient → TDD → verify, anti-slop, project idiom); this skill gates it (readiness, HITL/AFK, doubt loop, Spec Drift Guard) and records the evidence. Use when the user says "build the next slice", "implement slice N", "continue", "code this slice". Not for bug fixes, prototypes, refactors outside scope, or two slices in a row.
|
|
4
|
+
argument-hint: "[slice number or name]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /rite-build — one verified slice
|
|
9
|
+
|
|
10
|
+
Build the next single slice, leave it working and proven, then **stop**. **Read the
|
|
11
|
+
active workspace first**; if none, tell the user to run `/rite-spec <feature>`.
|
|
12
|
+
|
|
13
|
+
This skill is the **orchestrator**: it owns the gates and the workspace; a fresh-context
|
|
14
|
+
[`devrites-slice-wright`](../../agents/devrites-slice-wright.md) owns the **writing**. You run
|
|
15
|
+
pre-flight (readiness, slice select, HITL pause), dispatch the wright for the build core, then
|
|
16
|
+
run the post-return gates (doubt, fail-on-red, record, stop). See
|
|
17
|
+
[`reference/wright-dispatch.md`](reference/wright-dispatch.md).
|
|
18
|
+
|
|
19
|
+
## Rules consulted (read on demand from `.claude/rules/`)
|
|
20
|
+
DevRites skills Read `.claude/rules/core.md` as their first step (workflow step 0). The
|
|
21
|
+
following load on demand — **the wright reads them** (they are named in its contract) while it
|
|
22
|
+
writes; read them yourself for the doubt/record gates or in the inline fallback:
|
|
23
|
+
- `coding-style.md` — naming, function shape, guard clauses, comments, reuse-first.
|
|
24
|
+
- `error-handling.md` — fail fast, no silent catches, fail closed.
|
|
25
|
+
- `testing.md` — pyramid, behaviour over implementation, see-it-fail-first.
|
|
26
|
+
- `patterns.md` — composition over inheritance, avoid premature abstraction.
|
|
27
|
+
- `security.md` — when the slice touches user input, auth, data, or external integrations.
|
|
28
|
+
|
|
29
|
+
## Operating rules
|
|
30
|
+
- **One slice at a time. DO NOT** start the next slice without the user asking.
|
|
31
|
+
- Evidence over confidence. Prefer existing conventions. Feature scope only — no
|
|
32
|
+
drive-by refactors.
|
|
33
|
+
- Surface material assumptions; ask before adding dependencies or a second design
|
|
34
|
+
system. The [Spec Drift Guard](reference/spec-drift-guard.md) is active throughout.
|
|
35
|
+
- **Avoid AI slop while writing.** `devrites-slice-wright` enforces the anti-slop charter **at
|
|
36
|
+
the source** — the canonical do-not list is `rite-polish/reference/anti-ai-slop.md` (the
|
|
37
|
+
wright reads it; don't restate it here). It writes the code the *project* would write, in its
|
|
38
|
+
idiom, reusing before building; **you verify the charter held on return** — you do not re-list
|
|
39
|
+
it and you do not fix slop by editing source. Polish catches what slips; build prevents.
|
|
40
|
+
The **prose you write yourself** — `evidence.md`, `decisions.md`, the slice report — follows
|
|
41
|
+
the human-voice charter (`.claude/rules/prose-style.md`; depth in `devrites-prose-craft`): no
|
|
42
|
+
filler openers, no marketing adjectives, exact commands and identifiers kept verbatim.
|
|
43
|
+
- **You never edit source — the wright is the only writer of code + tests.** You write only
|
|
44
|
+
`.devrites/` bookkeeping. On any red gate, doubt finding, or coverage gap your only remedies
|
|
45
|
+
are **continue the same wright once** (it fixes in its own context) or **stop + escalate** —
|
|
46
|
+
never patch the code yourself. The `reconcile.sh` gate (step 6) enforces this by exit code:
|
|
47
|
+
any source file changed outside the wright's claimed set is a hard STOP.
|
|
48
|
+
|
|
49
|
+
## Workflow ([one-slice-cycle](reference/one-slice-cycle.md))
|
|
50
|
+
0. **Rules + AFK + readiness check.** Read `.claude/rules/core.md` first. Then **run the
|
|
51
|
+
shared orientation preamble** — it prints `state.md`, the artifacts present, the run
|
|
52
|
+
mode (HITL/AFK), and the open-question tally by gate, deterministically:
|
|
53
|
+
```bash
|
|
54
|
+
P=.claude/skills/devrites-lib/scripts/preamble.sh
|
|
55
|
+
[ -f "$P" ] || P="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/preamble.sh"
|
|
56
|
+
[ -f "$P" ] || P=pack/.claude/skills/devrites-lib/scripts/preamble.sh
|
|
57
|
+
[ -f "$P" ] && bash "$P" || echo "(orientation preamble unavailable on this install — read state.md directly to orient)"
|
|
58
|
+
```
|
|
59
|
+
Then **run the readiness gate** — it enforces the step-0 stop conditions by exit code,
|
|
60
|
+
not by memory:
|
|
61
|
+
```bash
|
|
62
|
+
G=.claude/skills/devrites-lib/scripts/readiness.sh
|
|
63
|
+
[ -f "$G" ] || G="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/readiness.sh"
|
|
64
|
+
[ -f "$G" ] || G=pack/.claude/skills/devrites-lib/scripts/readiness.sh
|
|
65
|
+
[ -f "$G" ] && { bash "$G"; echo "readiness rc=$?"; } || echo "(readiness gate unavailable — apply the prose checks below)"
|
|
66
|
+
```
|
|
67
|
+
A non-zero `rc` is a hard STOP: `2` → `/rite-define` (plan not approved), `3` →
|
|
68
|
+
`/rite-resolve` (awaiting human), `4` → `/rite-plan` (blocked). The prose below is the
|
|
69
|
+
same gate for installs without the script.
|
|
70
|
+
Orient from its digest. If `Status == awaiting_human` → **STOP**, tell the user to run
|
|
71
|
+
`/rite-resolve <qid> "<answer>"`. If `state.md` has no `Plan approved: <iso>` field
|
|
72
|
+
→ **STOP**, tell the user the plan isn't approved yet (`/rite-define` writes it when
|
|
73
|
+
the human confirms). If `.devrites/AFK` is present, re-derive the remaining AFK budget
|
|
74
|
+
from `state.md`'s `AFK slices remaining: <n>` field (initialized from `.devrites/AFK`
|
|
75
|
+
`max_slices` on the first AFK build); if it is `0` → **STOP** (forced HITL stop; raise
|
|
76
|
+
the count in `state.md` or remove the sentinel to continue). See
|
|
77
|
+
[`reference/afk-discipline.md`](reference/afk-discipline.md).
|
|
78
|
+
1. Read `spec.md`, `plan.md`, `tasks.md`, `assumptions.md`, `drift.md`, and `test-plan.md`
|
|
79
|
+
if present (the vetted coverage target from `/rite-vet` — the slice's tests come from
|
|
80
|
+
here when it exists). `state.md` and the open-`questions.md` tally are already in the
|
|
81
|
+
preamble digest from step 0 — re-read `questions.md` only for the full text of a flagged
|
|
82
|
+
blocking question.
|
|
83
|
+
If a **blocking `[NEEDS CLARIFICATION]`** remains or the spec/plan readiness gates
|
|
84
|
+
don't pass, stop → `/rite-spec` (to resolve) or `/rite-plan` (to repair). Don't build
|
|
85
|
+
on an unresolved spec.
|
|
86
|
+
2. Select the next pending slice (or the one in `$ARGUMENTS`). **Restate its goal,
|
|
87
|
+
acceptance criteria, and scope boundary** in one short block. Confirm it's still the
|
|
88
|
+
right next slice. Write the slice's `Mode` to `state.md` as `Slice mode: <HITL|AFK>` on
|
|
89
|
+
**every** selection (not only on the HITL pause path); `/rite-resolve` clears or updates
|
|
90
|
+
it on resume.
|
|
91
|
+
2a. **HITL gate (pre-action pause).** Read the slice's `Mode`. If `HITL` → render the
|
|
92
|
+
checkpoint per [`reference/checkpoint-protocol.md`](reference/checkpoint-protocol.md):
|
|
93
|
+
append a `questions.md` entry with the slice's `Checkpoint:` + `Gate:` + `SLA:`,
|
|
94
|
+
write the `Awaiting human` block to `state.md`, set `Status: awaiting_human`, run
|
|
95
|
+
the `notify:` hook if `.devrites/AFK` defines one, then **STOP**. Resume happens
|
|
96
|
+
when the user runs `/rite-resolve <qid> "<answer>"`.
|
|
97
|
+
3. **Snapshot the tree, then dispatch the build core to `devrites-slice-wright`** — one `Task`
|
|
98
|
+
call, fresh context. **First**, capture the pre-dispatch tree so the reconcile gate (step 6)
|
|
99
|
+
can prove you never touched source — run this immediately before the `Task` call:
|
|
100
|
+
```bash
|
|
101
|
+
RC=.claude/skills/devrites-lib/scripts/reconcile.sh
|
|
102
|
+
[ -f "$RC" ] || RC="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/reconcile.sh"
|
|
103
|
+
[ -f "$RC" ] || RC=pack/.claude/skills/devrites-lib/scripts/reconcile.sh
|
|
104
|
+
[ -f "$RC" ] && bash "$RC" snapshot || echo "(reconcile gate unavailable — verify by hand that only the wright wrote source)"
|
|
105
|
+
```
|
|
106
|
+
Then log the dispatch so the stuck-loop detector can catch a slice that keeps being
|
|
107
|
+
re-dispatched without progress (it pauses the build even under AFK):
|
|
108
|
+
```bash
|
|
109
|
+
ST=.claude/skills/devrites-lib/scripts/stuck.sh
|
|
110
|
+
[ -f "$ST" ] || ST="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/stuck.sh"
|
|
111
|
+
[ -f "$ST" ] || ST=pack/.claude/skills/devrites-lib/scripts/stuck.sh
|
|
112
|
+
[ -f "$ST" ] && bash "$ST" log "$(cat .devrites/ACTIVE 2>/dev/null)" dispatch "<slice id>" || true
|
|
113
|
+
```
|
|
114
|
+
Then assemble the slice contract and send it per
|
|
115
|
+
[`reference/wright-dispatch.md`](reference/wright-dispatch.md): the slice goal, acceptance
|
|
116
|
+
criteria, and **scope boundary**; the paths it may touch (`touched-files.md`); the context
|
|
117
|
+
paths to read (`spec.md`, `plan.md`, `decisions.md`, `assumptions.md`, plus `test-plan.md`
|
|
118
|
+
when present — its per-gap test requirements + regression-criticals for this slice are the
|
|
119
|
+
coverage the wright must write — and `design-brief.md`
|
|
120
|
+
when the slice touches UI per [frontend-trigger](reference/frontend-trigger.md)); and the
|
|
121
|
+
`.claude/rules/` files in scope. The wright **orients** on the project's idiom (using a
|
|
122
|
+
code-intelligence index **if available** — `codebase-memory-mcp` first, cross-checked with
|
|
123
|
+
`codegraph` (`.codegraph/` / `codegraph_*`) + `graphify` (`graphify-out/`), else standard
|
|
124
|
+
methods (LSP / `Read`/`Grep`/`Glob`); see `.claude/rules/tooling.md` — for
|
|
125
|
+
placement/callers/impact), writes the **failing test first** when
|
|
126
|
+
behaviour changes ([tdd](reference/tdd.md)), implements the **smallest complete** version in
|
|
127
|
+
the project's style (applying `devrites-frontend-craft` to `design-brief.md` for UI, and
|
|
128
|
+
`devrites-source-driven` — with context7 if available — for uncertain framework facts), runs the slice's **targeted tests**
|
|
129
|
+
(plus typecheck / lint / build where the project has them), and returns a structured artifact
|
|
130
|
+
— **code + tests only; it does not write the workspace files.** If the slice is UI but no `design-brief.md` exists (e.g. a spec written before
|
|
131
|
+
shaping), shape it via `devrites-ux-shape` before the wright codes. If the `Task` tool is
|
|
132
|
+
unavailable, run the wright's discipline **inline** as a flagged fallback (see the reference)
|
|
133
|
+
— same one-slice cycle, no isolation; in that case write
|
|
134
|
+
`.devrites/work/<slug>/.reconcile-inline` so the reconcile gate skips (you are legitimately
|
|
135
|
+
the writer in this fallback).
|
|
136
|
+
4. **Doubt the decisions it stood up.** For each entry in the wright's `Decisions stood`
|
|
137
|
+
(branching, boundary crossing, data model, auth, public API, migration, user-flow change,
|
|
138
|
+
"this is safe/scales") apply `devrites-doubt` **before accepting the slice** — the writer
|
|
139
|
+
doesn't grade its own decisions. The doubt loop honours `.devrites/AFK` (see its AFK
|
|
140
|
+
exception): findings below the slice's gate ceiling become advisory entries in `questions.md`;
|
|
141
|
+
destructive / auth / public-API concerns always pause regardless. A non-empty `Escalation` in
|
|
142
|
+
the artifact is handled here too: irreversible-risk / blockers → blocking question + set
|
|
143
|
+
`Status: awaiting_human`; a scope-changing answer → `/rite-plan repair` (Spec Drift Guard),
|
|
144
|
+
never silently into the slice. **If an irreversible-risk item shows up under the wright's
|
|
145
|
+
`Decisions stood` rather than `Escalation`**, treat that misclassification as itself a
|
|
146
|
+
blocking protocol violation — pause and re-dispatch with the item flagged out-of-bounds, do
|
|
147
|
+
**not** doubt-and-accept it. (The wright's return is the not-yet-load-bearing moment — the
|
|
148
|
+
slice isn't `built` or merged yet — so this post-return doubt is still pre-commit.)
|
|
149
|
+
5. **Fail-on-red.** If the wright's `Gates` were red (targeted tests / types / lint) or it
|
|
150
|
+
couldn't verify: do **not** mark the slice `built`, and **do not fix the code yourself**.
|
|
151
|
+
First remedy — **continue the same wright once** (`SendMessage` to it, carrying the failing
|
|
152
|
+
gate + its real output) so it fixes in its own context. This retry is for **objective
|
|
153
|
+
failures only** — red gate / type / lint / missing test coverage / UI browser-proof fail —
|
|
154
|
+
never a contested decision (that routes to `/rite-plan repair`). **Still red after the one
|
|
155
|
+
retry** → escalate: AFK → append a blocking question to `questions.md` (gate=blocking,
|
|
156
|
+
slice's SLA) + set `Status: awaiting_human`; HITL → pause as a blocking gate. Either way,
|
|
157
|
+
`Next step: /rite-plan unblock` until resolved.
|
|
158
|
+
6. **Record — you are the canonical writer.** **First, run the reconcile gate (A1):** write the
|
|
159
|
+
wright's reported `Files changed` paths (one per line) to
|
|
160
|
+
`.devrites/work/<slug>/.reconcile-claimed`, then:
|
|
161
|
+
```bash
|
|
162
|
+
RC=.claude/skills/devrites-lib/scripts/reconcile.sh
|
|
163
|
+
[ -f "$RC" ] || RC="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/reconcile.sh"
|
|
164
|
+
[ -f "$RC" ] || RC=pack/.claude/skills/devrites-lib/scripts/reconcile.sh
|
|
165
|
+
[ -f "$RC" ] && { bash "$RC" check; echo "reconcile rc=$?"; } || echo "(reconcile gate unavailable — confirm by hand only the wright wrote source)"
|
|
166
|
+
```
|
|
167
|
+
**Exit 5 → hard STOP:** a source file changed outside the wright's claimed set — code was
|
|
168
|
+
edited by something other than the wright (A1 breach). Revert it and re-dispatch the wright;
|
|
169
|
+
do **not** mark the slice `built`.
|
|
170
|
+
|
|
171
|
+
**Then run the test-integrity gate (anti-reward-hacking)** — prove the slice didn't reach
|
|
172
|
+
green by weakening its tests:
|
|
173
|
+
```bash
|
|
174
|
+
TI=.claude/skills/devrites-lib/scripts/test-integrity.sh
|
|
175
|
+
[ -f "$TI" ] || TI="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/test-integrity.sh"
|
|
176
|
+
[ -f "$TI" ] || TI=pack/.claude/skills/devrites-lib/scripts/test-integrity.sh
|
|
177
|
+
[ -f "$TI" ] && { bash "$TI"; echo "test-integrity rc=$?"; } || echo "(test-integrity gate unavailable — confirm by hand no test was deleted/skipped/loosened)"
|
|
178
|
+
```
|
|
179
|
+
**Exit 3 → hard STOP:** a test was deleted, skipped, or de-asserted since the slice base — the
|
|
180
|
+
slice went green by weakening its tests, a Critical protocol violation. Revert the weakening and
|
|
181
|
+
re-dispatch the wright; do **not** mark the slice `built`.
|
|
182
|
+
|
|
183
|
+
Then, from the wright's artifact, update `state.md`,
|
|
184
|
+
`evidence.md`, `touched-files.md` (and `browser-evidence.md` for UI). If the wright reported
|
|
185
|
+
an approach it tried and backed out of, record it under a `## Dead ends` section in
|
|
186
|
+
`decisions.md` so a retry or the next agent doesn't repeat it.
|
|
187
|
+
**If the wright's `Conventions` field reports a contradiction** (the live code now
|
|
188
|
+
disagrees with a held convention), record the drift — you own this bookkeeping:
|
|
189
|
+
```bash
|
|
190
|
+
C=.claude/skills/devrites-lib/scripts/conventions.py
|
|
191
|
+
[ -f "$C" ] || C="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/conventions.py"
|
|
192
|
+
[ -f "$C" ] || C=pack/.claude/skills/devrites-lib/scripts/conventions.py
|
|
193
|
+
command -v python3 >/dev/null 2>&1 && [ -f "$C" ] && \
|
|
194
|
+
python3 "$C" contradict --key <key> --slug <slug> --evidence "<what the live code does>" \
|
|
195
|
+
--drift-file .devrites/work/<slug>/drift.md || true
|
|
196
|
+
```
|
|
197
|
+
It lowers the convention's band (or retires it) and appends a `convention-drift` entry to
|
|
198
|
+
`drift.md`. The ledger is **promoted only at `/rite-seal` on GO** — build only records
|
|
199
|
+
contradictions, never new conventions. **Evidence is the
|
|
200
|
+
wright's real command output, not its say-so.** Capture per
|
|
201
|
+
[evidence-standard](reference/evidence-standard.md). Append a footprint record for this
|
|
202
|
+
slice's wright dispatch (deterministic run-weight bookkeeping the seal reports):
|
|
203
|
+
```bash
|
|
204
|
+
FP=.claude/skills/devrites-lib/scripts/footprint.sh
|
|
205
|
+
[ -f "$FP" ] || FP="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/footprint.sh"
|
|
206
|
+
[ -f "$FP" ] || FP=pack/.claude/skills/devrites-lib/scripts/footprint.sh
|
|
207
|
+
[ -f "$FP" ] && bash "$FP" log <slug> wright "<slice id>" || true
|
|
208
|
+
```
|
|
209
|
+
If `.devrites/AFK` is present, decrement
|
|
210
|
+
the budget by running `bash .claude/skills/devrites-lib/scripts/tick-afk.sh <state.md path>` —
|
|
211
|
+
it decrements `state.md`'s `AFK slices remaining` field, prints the new value, and exits `3`
|
|
212
|
+
when it hits 0. **Exit 3 → STOP** (forced HITL stop; the cap is exhausted). Never rewrite
|
|
213
|
+
`.devrites/AFK` `max_slices` in place — it is read-only initial budget.
|
|
214
|
+
7. **STOP.** Render the progress footer, then report and recommend the next step. Run the
|
|
215
|
+
shared footer (mirror of the step-0 preamble) so the slice meter + flow ribbon are
|
|
216
|
+
deterministic, not model-typed:
|
|
217
|
+
```bash
|
|
218
|
+
PR=.claude/skills/devrites-lib/scripts/progress.sh
|
|
219
|
+
[ -f "$PR" ] || PR="${CLAUDE_SKILL_DIR:-}/../devrites-lib/scripts/progress.sh"
|
|
220
|
+
[ -f "$PR" ] || PR=pack/.claude/skills/devrites-lib/scripts/progress.sh
|
|
221
|
+
[ -f "$PR" ] && bash "$PR" || echo "(progress footer unavailable on this install)"
|
|
222
|
+
```
|
|
223
|
+
It reads `state.md` (already updated in step 6), so the meter reflects the slice you
|
|
224
|
+
just built. **When every slice is built** (`✅ ALL BUILT`) say so explicitly — the build
|
|
225
|
+
phase is complete, the next phase is `/rite-prove` — don't leave completion implicit.
|
|
226
|
+
|
|
227
|
+
> **Mid-flight discipline.** The wright (or you, in the inline fallback) must resist doing two slices, skipping TDD, adding a defensive check, or wandering outside `touched-files.md`; you must resist skipping the post-return `devrites-doubt` because the wright "seems confident" — see [`anti-patterns`](reference/anti-patterns.md). Load it the moment you reach for the excuse.
|
|
228
|
+
|
|
229
|
+
## Output
|
|
230
|
+
|
|
231
|
+
The `progress.sh` footer (step 7) prints the first three lines — the header rule, the
|
|
232
|
+
**slice meter** (how many of N are built), and the **flow ribbon**. Your fact lines sit
|
|
233
|
+
under it. Two shapes:
|
|
234
|
+
|
|
235
|
+
**Slices still pending:**
|
|
236
|
+
```
|
|
237
|
+
── rite-build ──────────────────────────────
|
|
238
|
+
Slice 3/5 ██████░░░░ csv-streaming ✓
|
|
239
|
+
Flow spec ✓ define ✓ build ◉ prove ○ polish ○ review ○ seal ○ ship ○
|
|
240
|
+
Built slice 3 — csv-streaming (by devrites-slice-wright | inline fallback)
|
|
241
|
+
Acceptance ✓ met · Tests <cmd → pass> · Browser <summary | n/a> · Drift <none | handled>
|
|
242
|
+
Next ▸ /rite-build (slice 4 — pagination)
|
|
243
|
+
↻ Hygiene /clear between slices (state.md + touched-files.md + evidence.md carry forward); /rite-handoff if away > a few hours.
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**All slices built (build phase complete — say it):**
|
|
247
|
+
```
|
|
248
|
+
── rite-build ──────────────────────────────
|
|
249
|
+
Slices 5/5 ██████████ ✅ ALL BUILT
|
|
250
|
+
Flow spec ✓ define ✓ build ◉ prove ○ polish ○ review ○ seal ○ ship ○
|
|
251
|
+
Built slice 5 — error-states (by devrites-slice-wright | inline fallback)
|
|
252
|
+
Acceptance ✓ met · Tests <cmd → pass> · Browser <summary | n/a> · Drift <none | handled>
|
|
253
|
+
✅ Feature implemented — every slice built. Build phase done.
|
|
254
|
+
Next ▸ /rite-prove (prove the completed feature)
|
|
255
|
+
↻ Hygiene /clear (state.md + evidence.md captured); /rite-handoff if away > a few hours.
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Keep fact lines terse — one `key value` per fact, `·` between, no prose. The meter, the
|
|
259
|
+
`✅ ALL BUILT` marker, and the ribbon carry the progress; don't restate them in words.
|
|
260
|
+
|
|
261
|
+
**DO NOT continue to the next slice automatically** — even at `✅ ALL BUILT`, `/rite-prove` is the user's call.
|