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,177 @@
|
|
|
1
|
+
# Anti-AI-slop
|
|
2
|
+
|
|
3
|
+
Tells of generic LLM-generated work — in **UI** and in **code**. Applies at two stages:
|
|
4
|
+
|
|
5
|
+
- **At build time** (preventive) — `/rite-build` checks against these as it writes; the
|
|
6
|
+
cheap moment to avoid them.
|
|
7
|
+
- **At polish time** (catch) — `/rite-polish` Phase 1 (Code) + Phase 2 (Backend) + Phase 4
|
|
8
|
+
(UI) scrub anything that slipped through.
|
|
9
|
+
|
|
10
|
+
Avoid these unless the project's existing system explicitly uses them. When in doubt,
|
|
11
|
+
match the neighbors.
|
|
12
|
+
|
|
13
|
+
## UI anti-slop (banned defaults)
|
|
14
|
+
- Default **purple/blue gradients** as the brand look. Special case: any
|
|
15
|
+
hero hex in the `#6366f1 → #a855f7 → #ec4899` family applied as a default.
|
|
16
|
+
- **Gradient text** (`background-clip: text`) used decoratively on headings.
|
|
17
|
+
- **Glassmorphism** (`backdrop-filter: blur(...)` on translucent panels) as
|
|
18
|
+
a default surface.
|
|
19
|
+
- **Side-stripe colored borders** on cards/sections — the
|
|
20
|
+
"tiny-bar-of-meaningful-accent-color-on-the-left" pattern. Distinctive
|
|
21
|
+
templating tell.
|
|
22
|
+
- **Pure `#000` / `#fff`** as raw text or background — too clinical; use
|
|
23
|
+
near-black/near-white tokens (`oklch(0.18 0 0)` / `oklch(0.98 0 0)` or
|
|
24
|
+
the project's surface tokens).
|
|
25
|
+
- **All-CAPS body text** for paragraphs/labels. Reserve uppercase for short
|
|
26
|
+
micro-copy (badges, eyebrows); never for sentences.
|
|
27
|
+
- **Em-dash overuse** in UI copy — multiple em-dashes per paragraph, em-
|
|
28
|
+
dashes where a comma or period would do. A clear AI tell.
|
|
29
|
+
- **Cards inside cards** — nested bordered/elevated containers.
|
|
30
|
+
- **Identical card grids** for everything, regardless of content.
|
|
31
|
+
- A **generic rounded-square icon tile** above every heading/section.
|
|
32
|
+
- **Gray text on colored backgrounds** (fails contrast, looks templated).
|
|
33
|
+
- The **hero-metric cliché** — three big numbers in a row with no real meaning.
|
|
34
|
+
- **Decorative bounce / elastic easing** on everything; motion without purpose.
|
|
35
|
+
- **Reflex fonts** picked because they're the default in a tutorial:
|
|
36
|
+
- Inter for every product when the project has its own choice.
|
|
37
|
+
- **DM Sans**, **Plus Jakarta Sans**, **Fraunces**, **Newsreader** when
|
|
38
|
+
they're not the project's actual type system.
|
|
39
|
+
Match the project; don't reach for the "tasteful default" of 2024.
|
|
40
|
+
- **Modal-first thinking** — reaching for a modal as the answer to every interaction.
|
|
41
|
+
|
|
42
|
+
### Category-reflex check — run at two altitudes
|
|
43
|
+
|
|
44
|
+
Most generic-AI design fails one of these two reflex tests. Run both — the
|
|
45
|
+
second one catches what the first one misses.
|
|
46
|
+
|
|
47
|
+
- **First-order:** if someone could guess the theme + palette *from the
|
|
48
|
+
category alone* — "observability → dark blue", "healthcare → white +
|
|
49
|
+
teal", "fintech → navy + gold", "AI tool → black with a violet accent",
|
|
50
|
+
"crypto → neon on black" — the styling is on the first training-data
|
|
51
|
+
reflex. Rework the scene sentence
|
|
52
|
+
(`devrites-frontend-craft/reference/design-references.md`) and the
|
|
53
|
+
colour-commitment strategy
|
|
54
|
+
(`devrites-frontend-craft/reference/quality-standards.md`) until the
|
|
55
|
+
answer isn't obvious from the domain.
|
|
56
|
+
- **Second-order:** if a stranger looked at the surface with *no copy
|
|
57
|
+
visible* and confidently said "this is a CRM / fitness tracker / fintech
|
|
58
|
+
/ AI workflow tool", the styling is still on a category template — just
|
|
59
|
+
one tier deeper. The first reflex was avoided, the second wasn't.
|
|
60
|
+
Re-shape until the surface doesn't telegraph its category from looks
|
|
61
|
+
alone.
|
|
62
|
+
|
|
63
|
+
Both pass = the surface looks like *this product*, not "an app in this category".
|
|
64
|
+
|
|
65
|
+
## Code anti-slop (UI **and** backend)
|
|
66
|
+
- **Over-defensive checks** — `if (x && x.length > 0)` repeated, layered null guards,
|
|
67
|
+
belt-and-braces nullability the surrounding code already proves. Signals lack of
|
|
68
|
+
confidence in the flow.
|
|
69
|
+
- **Blanket `catch` / "robust" error handling** that swallows errors or wraps them in
|
|
70
|
+
generic "Something went wrong." Hides bugs. Catch narrow; rethrow with context; fail
|
|
71
|
+
closed on auth/permission/transaction.
|
|
72
|
+
- **Useless wrapper functions** — `function getUser(id){ return User.find(id); }` adds a
|
|
73
|
+
hop with no value. Inline or remove.
|
|
74
|
+
- **Over-engineered abstractions** for trivial problems — a factory + interface + plugin
|
|
75
|
+
registry for a 10-line function. **Don't add abstraction before two real callers**
|
|
76
|
+
(see `coding-style.md`, `patterns.md`).
|
|
77
|
+
- **Convention-blind** code — ignores the repo's naming, file layout, error patterns,
|
|
78
|
+
validation style. "Generic good code" beats the project's idiom; reuse first (see
|
|
79
|
+
`coding-style.md`).
|
|
80
|
+
- **Going beyond the spec** — features/options/configs/flags the spec didn't ask for.
|
|
81
|
+
Implement exactly what was specified; flag extras as follow-ups.
|
|
82
|
+
- **Comment noise — the most common code tell.** Default to **zero** comments; the code and
|
|
83
|
+
the names carry the meaning. A comment earns its place only by answering *why* in one
|
|
84
|
+
sentence (intent, a trade-off, a non-obvious constraint, a "here be dragons" warning). Cut
|
|
85
|
+
every comment that restates the code:
|
|
86
|
+
- *What-comments* — `// increment i by 1`, `// set the user name`, `// return the result`.
|
|
87
|
+
- *Tutorial comments* — `// loop through the array` over a `.forEach`; `// check if null`.
|
|
88
|
+
- *Sycophant / filler* — `// helper function`, `// this is important`, `// magic happens here`.
|
|
89
|
+
- *Ownerless TODOs* — `// TODO: improve this later` with no issue/owner.
|
|
90
|
+
- *Meta / edit-process comments* — the agent narrating its own edit: `// Now I'll add error
|
|
91
|
+
handling`, `// Updated to handle the edge case`, `// As requested`, `// Step 1: … Step 2:`.
|
|
92
|
+
The reader doesn't care how the diff was produced.
|
|
93
|
+
- *Hedging / apologetic / overconfident comments* — `// should work`, `// hopefully handles
|
|
94
|
+
this`, `// I think`, `// hacky`, `// sorry`, or `// obviously` / `// just` / `// trivial`.
|
|
95
|
+
They admit the code is unverified (or paper over it). Verify the code; delete the doubt.
|
|
96
|
+
Density smell: more than roughly **one comment per ~10 lines of straightforward code** means
|
|
97
|
+
you are narrating, not explaining. Rename the thing or delete the comment.
|
|
98
|
+
- **Names must match the contract.** A name is a promise about what the symbol does — keep it
|
|
99
|
+
honest. A `validateUser()` that actually checks payment status, an `isReady` that mutates
|
|
100
|
+
state, a `getUser()` that also writes a log: the name lies. Models pick names that *sound*
|
|
101
|
+
plausible for the category; verify the name says what the code does.
|
|
102
|
+
- **Generic AI naming** — `process_data`, `handle_thing`, `do_it`, `result`, `data`,
|
|
103
|
+
`temp`, `manager`, `helper`, `util2`. Name for *intent*, in the repo's casing and idiom —
|
|
104
|
+
not for the action's category.
|
|
105
|
+
- **Premature config** — feature flags / config knobs / extension points with no current
|
|
106
|
+
user.
|
|
107
|
+
- **Dead leftovers** — TODOs without an owner/issue, commented-out code, unused imports,
|
|
108
|
+
`console.log`s, debug prints.
|
|
109
|
+
- **Hallucinated imports & APIs** — an import of a package or module the project doesn't
|
|
110
|
+
declare (absent from the manifest/lockfile) or that doesn't exist, and invented methods or
|
|
111
|
+
parameters on a real library. Unused imports are dead code; *non-existent* ones are the model
|
|
112
|
+
inventing dependencies. Verify every import resolves and every unfamiliar API exists at the
|
|
113
|
+
source (`devrites-source-driven`) — never invent one.
|
|
114
|
+
- **Placeholder bodies posing as complete** — a function that looks implemented but only does
|
|
115
|
+
`pass` / `...` / `return None` / `throw NotImplementedError` / returns a constant. It promises
|
|
116
|
+
functionality that isn't there. A genuine `@abstractmethod` / interface / Protocol stub is
|
|
117
|
+
fine — the slop is the stub pretending to be the real implementation.
|
|
118
|
+
- **Fake or inflated docstrings** — a generic "This function does X" / "Handles the logic" that
|
|
119
|
+
restates the signature, or a 10-line docstring over a 2-line body. A real public-API docstring
|
|
120
|
+
earns its place; the slop is the one that inflates or says nothing. Follow the project's doc
|
|
121
|
+
convention either way.
|
|
122
|
+
- **Oversized units (smell, not a hard gate)** — a function past ~50 logical lines, cyclomatic
|
|
123
|
+
complexity >10, more than ~4 parameters, or nesting ≥4 deep is a god-function smell. Split it
|
|
124
|
+
or flatten with guard clauses; judge in context, don't game the metric.
|
|
125
|
+
- **Unexplained magic constants** — a bare literal, a hardcoded URL/endpoint, or an embedded
|
|
126
|
+
account/provider/test ID inline with no name or source. Give it a name (a const) or a home
|
|
127
|
+
(config/env). The mirror image of premature config, and just as much a tell.
|
|
128
|
+
- **Copy-paste duplication** — a near-identical block pasted and tweaked instead of reused.
|
|
129
|
+
Reuse → extend → build new (`coding-style.md`, `patterns.md`); duplication beats the *wrong*
|
|
130
|
+
abstraction, but pasted clones are slop, not a deliberate AHA call.
|
|
131
|
+
|
|
132
|
+
### Comment density — before / after
|
|
133
|
+
|
|
134
|
+
```js
|
|
135
|
+
// Before (slop): a comment narrating almost every line
|
|
136
|
+
function calculateTotal(items) {
|
|
137
|
+
// initialize the total to zero
|
|
138
|
+
let total = 0;
|
|
139
|
+
// loop through each item in the items array
|
|
140
|
+
for (const item of items) {
|
|
141
|
+
// add the item price to the total
|
|
142
|
+
total += item.price;
|
|
143
|
+
}
|
|
144
|
+
// return the final total
|
|
145
|
+
return total;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// After: the names carry it; no comment needed
|
|
149
|
+
function sumPrices(items) {
|
|
150
|
+
return items.reduce((total, item) => total + item.price, 0);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// A comment that earns its place — it explains WHY, not what:
|
|
154
|
+
// Prices are in minor units (cents); the gateway rejects fractional amounts.
|
|
155
|
+
const total = sumPrices(items);
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Why these are banned
|
|
159
|
+
They signal "a model generated this" rather than "this team designed/wrote this." They
|
|
160
|
+
ignore the product's register and the project's idiom, add noise, hide bugs (defensive
|
|
161
|
+
catches), bloat the diff (over-engineering, beyond-spec), and often fail accessibility
|
|
162
|
+
or correctness review. They're cargo-cult, not craft.
|
|
163
|
+
|
|
164
|
+
## What to do instead
|
|
165
|
+
- **UI**: project tokens / shared components / consistent type & spacing
|
|
166
|
+
(`design-system-discovery.md`); content shapes layout; motion serves feedback;
|
|
167
|
+
reserve modals for focused interrupting tasks.
|
|
168
|
+
- **Code**: validate at trust boundaries (don't sprinkle null checks); catch narrow,
|
|
169
|
+
recover or rethrow; one clear name per concept; one responsibility per function;
|
|
170
|
+
reuse before write (`coding-style.md`); implement exactly the spec; let inherent
|
|
171
|
+
complexity be — don't pad with ceremony.
|
|
172
|
+
- If the project **does** use one of these intentionally, follow the project. Consistency
|
|
173
|
+
beats the rule.
|
|
174
|
+
|
|
175
|
+
## When in doubt: ask
|
|
176
|
+
A "robust" check or shiny abstraction you can't justify in one sentence is probably slop.
|
|
177
|
+
Delete it; or ask the user if it should exist.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# rite-polish — anti-patterns
|
|
2
|
+
|
|
3
|
+
Load this when standing a non-trivial polish decision, or when tempted to
|
|
4
|
+
skip normalize, polish without Chesterton's Fence, or cite clean lint/build
|
|
5
|
+
as proof of quality.
|
|
6
|
+
|
|
7
|
+
Pack-wide rationalizations + red flags (incl. lint-pass-as-quality): see
|
|
8
|
+
[rules/anti-patterns.md](../../../rules/anti-patterns.md).
|
|
9
|
+
|
|
10
|
+
## Phase-specific rationalizations
|
|
11
|
+
|
|
12
|
+
| Excuse | Rebuttal |
|
|
13
|
+
|---|---|
|
|
14
|
+
| "Tests pass; the feature is done." | Tests don't measure ship-quality, design drift, anti-slop, or backend polish. |
|
|
15
|
+
| "UI looks fine to me." | Must align to the design system + meet CWV/WCAG 2.2 — not match a personal taste. |
|
|
16
|
+
| "Code is simple enough; no need to audit." | Measure first. If there's no hotspot, that's fine — but record "no hotspots found", don't skip silently. |
|
|
17
|
+
| "It's a small UI change; polish without normalize is fine." | **NO** — decoration on drift is banned. Phase 3 runs before Phase 4, always. |
|
|
18
|
+
| "Backend looks OK; skip Phase 2." | If the diff touched BE, Phase 2 runs — error responses, logging hygiene, queries, anti-slop. |
|
|
19
|
+
|
|
20
|
+
## Red Flags
|
|
21
|
+
|
|
22
|
+
- About to polish UI (Phase 4) without running normalize (Phase 3) first.
|
|
23
|
+
- No browser evidence saved for a UI polish.
|
|
24
|
+
- Code polish ran without naming a single technique (guard clauses, Extract Method, ...).
|
|
25
|
+
- Backend was touched but `polish-report.md` shows no Phase 2 section.
|
|
26
|
+
- A "simplification" that changes observable behavior — that's not behavior-preserving.
|
|
27
|
+
- Reading a Chesterton's Fence as "looks dead" and deleting without explaining what it guards.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Backend polish (when backend touched)
|
|
2
|
+
|
|
3
|
+
Runs as Phase 2 of `/rite-polish` when the feature touches server-side code — handlers /
|
|
4
|
+
controllers / services / routes / models / migrations / queries / jobs / workers / auth /
|
|
5
|
+
schemas. Polishes the **server side** to ship-quality before review, the way UI normalize
|
|
6
|
+
+ polish does for the client side.
|
|
7
|
+
|
|
8
|
+
## Scope detection (BE is in scope if any of these are touched)
|
|
9
|
+
- API/route handlers (REST/GraphQL/gRPC); controllers/services/middleware.
|
|
10
|
+
- DB layer: models, queries, migrations, schemas, ORM calls.
|
|
11
|
+
- Auth/session/permission code; trust-boundary checks.
|
|
12
|
+
- Background jobs, workers, schedulers, queue handlers.
|
|
13
|
+
- Server-side files in the project's language (`.rb`/`.py`/`.go`/`.rs`/`.java`/`.cs`/
|
|
14
|
+
`.php`/`.ts`-server etc.) outside the UI layer.
|
|
15
|
+
|
|
16
|
+
## Polish checklist
|
|
17
|
+
|
|
18
|
+
### Error handling (consistent + meaningful)
|
|
19
|
+
- [ ] **Consistent error response shape** across endpoints (e.g. an RFC 7807 problem
|
|
20
|
+
document or the project's existing convention). One shape — not three.
|
|
21
|
+
- [ ] **Correct HTTP / protocol status codes** (4xx for client errors, 5xx for server
|
|
22
|
+
errors; not 200 with `{ error: ... }`).
|
|
23
|
+
- [ ] **Custom error classes** (or equivalent) so callers can distinguish error kinds.
|
|
24
|
+
- [ ] **Fail closed** on auth/permission/transaction errors — deny + roll back; never
|
|
25
|
+
default to allow or partial commit (`error-handling.md`, `security.md`).
|
|
26
|
+
- [ ] **Narrow `catch`** — no blanket `catch (e) {}` swallows. If you catch, recover or
|
|
27
|
+
rethrow with context.
|
|
28
|
+
|
|
29
|
+
### Logging hygiene
|
|
30
|
+
- [ ] **Structured logs** (key/value or JSON) with **context** — request id, user/actor
|
|
31
|
+
id, operation, duration.
|
|
32
|
+
- [ ] Log the **events that matter**: failures, access violations, validation rejections,
|
|
33
|
+
retries, auth events.
|
|
34
|
+
- [ ] **Never log** secrets, tokens, full credentials, PII, full request bodies for
|
|
35
|
+
sensitive endpoints. Mask or omit.
|
|
36
|
+
- [ ] No `console.log` / debug prints left in. No noisy "got here" lines.
|
|
37
|
+
|
|
38
|
+
### Data & queries
|
|
39
|
+
- [ ] **No N+1** — fetch in batches / use joins or includes.
|
|
40
|
+
- [ ] **No unbounded result sets** — pagination/limits where data can grow.
|
|
41
|
+
- [ ] **Parameterized queries** only; never string-built SQL/shell/HTML.
|
|
42
|
+
- [ ] **Indexes** exist for new query patterns (or recorded as a follow-up if the project
|
|
43
|
+
adds them by migration).
|
|
44
|
+
- [ ] **Transaction boundaries** are right — one logical write = one transaction; rollback
|
|
45
|
+
on error; no partial commits.
|
|
46
|
+
- [ ] Don't return more fields than the caller needs.
|
|
47
|
+
|
|
48
|
+
### API contract
|
|
49
|
+
- [ ] Response shape matches the contract the spec set (and what the UI / consumers
|
|
50
|
+
expect — match against `references/` if any).
|
|
51
|
+
- [ ] **Idempotency** where applicable (PUT/DELETE; retry-safe POSTs with idempotency
|
|
52
|
+
keys).
|
|
53
|
+
- [ ] **Pagination, sorting, filtering** consistent with neighboring endpoints.
|
|
54
|
+
- [ ] **Validation at the boundary** — type/length/format/range on untrusted input;
|
|
55
|
+
reject what doesn't match (see `security.md` three-tier).
|
|
56
|
+
|
|
57
|
+
### Performance (measure first)
|
|
58
|
+
- [ ] Hot-path work measured; obvious wins (cache, batch, hoist) applied; perf claims
|
|
59
|
+
cite a number (`devrites-audit perf`).
|
|
60
|
+
- [ ] No accidental quadratic loops over growing collections.
|
|
61
|
+
|
|
62
|
+
### Cleanup
|
|
63
|
+
- [ ] **Dead routes / unused endpoints** removed if this feature created them and they're
|
|
64
|
+
unused.
|
|
65
|
+
- [ ] Naming + comments in touched server code: clear, intent-revealing, no fake-helpful
|
|
66
|
+
"// gets the user" lines.
|
|
67
|
+
- [ ] No leftover `TODO`s without an owner/issue.
|
|
68
|
+
- [ ] **Migrations** are reversible where reasonable; destructive ones have rollback notes.
|
|
69
|
+
|
|
70
|
+
### Anti-slop (code patterns — see `anti-ai-slop.md`)
|
|
71
|
+
- [ ] No over-defensive null/length checks layered redundantly.
|
|
72
|
+
- [ ] No useless wrapper functions ("`function getUser(id) { return User.find(id); }`").
|
|
73
|
+
- [ ] No generic AI naming (`process_data`, `handle_thing`, `do_it`).
|
|
74
|
+
- [ ] No "robust" code that catches everything and hides bugs.
|
|
75
|
+
- [ ] Didn't go **beyond the spec** — implemented what the spec asked, no extras.
|
|
76
|
+
|
|
77
|
+
## Rules
|
|
78
|
+
- Feature scope only. Don't refactor unrelated server code.
|
|
79
|
+
- Re-prove after changes: targeted tests + a real request/response observation.
|
|
80
|
+
- A polish change that breaks a test isn't behavior-preserving — revert and reconsider.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Browser polish evidence
|
|
2
|
+
|
|
3
|
+
Polish claims need visual proof. When a browser can run, capture evidence via the proof
|
|
4
|
+
ladder (`devrites-browser-proof`) and record it in `browser-evidence.md` (and summarize
|
|
5
|
+
in `polish-report.md`).
|
|
6
|
+
|
|
7
|
+
## Required when a browser can run
|
|
8
|
+
- Screenshots of the polished UI at the target viewports (375 / 768 / 1280 as relevant).
|
|
9
|
+
**Open each screenshot and describe what's actually visible** — a path is not proof.
|
|
10
|
+
- All key interaction states captured or exercised: hover, focus, active, disabled,
|
|
11
|
+
loading, empty, error, success.
|
|
12
|
+
- Console clean (no errors/warnings) — captured.
|
|
13
|
+
- No layout shift on load — observed.
|
|
14
|
+
- Reduced-motion behavior checked if motion was added.
|
|
15
|
+
- **Design references**: if the spec saved references in `.devrites/work/<slug>/references/`,
|
|
16
|
+
compare the polished UI against them — does it match the agreed target? Note any diffs.
|
|
17
|
+
|
|
18
|
+
## Before/after
|
|
19
|
+
Where polish changed something visible, capture a **before/after** pair. The pair is the
|
|
20
|
+
evidence that the change is real and an improvement, not a regression.
|
|
21
|
+
|
|
22
|
+
## If no browser is available
|
|
23
|
+
- Record the limitation explicitly in `browser-evidence.md`.
|
|
24
|
+
- Write the exact manual steps to verify (route, viewport, what to look for in each
|
|
25
|
+
state).
|
|
26
|
+
- Do **not** claim the polish is verified. Mark it **pending (manual)** and let
|
|
27
|
+
`/rite-review` / `/rite-seal` weigh the UI risk.
|
|
28
|
+
|
|
29
|
+
## Never
|
|
30
|
+
- Cite "lint clean" / "build passed" / "no type errors" as evidence of *visual* quality.
|
|
31
|
+
- Assert a state works without exercising it.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Code + backend polish (Phase 1 + Phase 2)
|
|
2
|
+
|
|
3
|
+
Loaded from `/rite-polish` every run, regardless of UI scope. Two sub-phases:
|
|
4
|
+
code polish (Phase 1) and, when backend is touched, backend polish (Phase 2).
|
|
5
|
+
|
|
6
|
+
## Rules consulted (read on demand from `.claude/rules/`)
|
|
7
|
+
|
|
8
|
+
- `coding-style.md` — Phase 1 (simplify, dead code, naming, comments).
|
|
9
|
+
- `patterns.md` — Phase 1 simplification — avoid over-engineering.
|
|
10
|
+
- `error-handling.md` — Phase 2 backend (no silent catches, consistent errors).
|
|
11
|
+
- `performance.md` — Phase 2 backend (N+1s, query bounds).
|
|
12
|
+
- `documentation.md` — keep touched docs current; record polish-time decisions.
|
|
13
|
+
|
|
14
|
+
## Operating rules
|
|
15
|
+
|
|
16
|
+
- **Never cite clean automation** (lint/build pass) as proof of good design or
|
|
17
|
+
simplicity.
|
|
18
|
+
- Feature scope only. Spec Drift Guard applies.
|
|
19
|
+
- Re-run targeted tests after each change — a simplification that breaks a
|
|
20
|
+
test wasn't behavior-preserving.
|
|
21
|
+
|
|
22
|
+
## Phase 1 — Code polish *(always)*
|
|
23
|
+
|
|
24
|
+
Delegates the audit to `devrites-audit simplify`. Reduce complexity in the
|
|
25
|
+
feature's touched code while **preserving exact behavior**. Scope = active
|
|
26
|
+
feature only.
|
|
27
|
+
|
|
28
|
+
- **Measure first, target hotspots** — deep nesting, long branchy functions,
|
|
29
|
+
high cyclomatic complexity, sprawling conditionals. Don't redistribute
|
|
30
|
+
complexity, reduce it. Untargeted cleanup just moves decision points around.
|
|
31
|
+
- **Behavior-preserving techniques** (name the one used per change): guard
|
|
32
|
+
clauses (flatten nested if/else, return early on unwanted cases), Extract
|
|
33
|
+
Method (a coherent block into a named single-responsibility helper), simplify
|
|
34
|
+
conditionals (switch/lookup over a long if-else; decompose a complex boolean
|
|
35
|
+
into well-named parts), dedupe, inline single-use indirection, replace
|
|
36
|
+
hand-rolled utils with the stdlib/existing helper, delete dead code this
|
|
37
|
+
feature added.
|
|
38
|
+
- **Chesterton's Fence** — understand *why* something exists before removing it.
|
|
39
|
+
If you can't explain a check, branch, or wrapper, you may not remove it —
|
|
40
|
+
many "useless" lines guard a real edge case.
|
|
41
|
+
- **Behavior preservation** — observable behavior stays identical; tests stay
|
|
42
|
+
green. If behavior would change, it's not simplification — it needs its own
|
|
43
|
+
acceptance + proof (and maybe drift handling). Prefer transformations with
|
|
44
|
+
obvious equivalence.
|
|
45
|
+
- **Don't over-reduce / proportionality** — inherent complexity is fine;
|
|
46
|
+
readability is the goal, not a metric. Forcing the complexity number down by
|
|
47
|
+
*hiding* branches elsewhere is worse. Don't spend disproportionate effort on
|
|
48
|
+
small, stable, rarely-touched code; target central/often-read code.
|
|
49
|
+
- **Guardrails** — feature scope only, no project-wide refactor; don't delete
|
|
50
|
+
suspected dead code **outside** this feature without asking; re-prove after
|
|
51
|
+
simplifying (a simplification that breaks a test wasn't behavior-preserving);
|
|
52
|
+
cleverness that's shorter but harder to read is not simpler.
|
|
53
|
+
- **Cleanup**: remove TODOs, `console.log`s, commented-out code, unused
|
|
54
|
+
imports/vars; tighten naming and comments in code this feature touched.
|
|
55
|
+
|
|
56
|
+
## Phase 2 — Backend polish *(if BE touched)*
|
|
57
|
+
|
|
58
|
+
See [backend-polish.md](backend-polish.md). For server-side scope (handlers,
|
|
59
|
+
services, routes, models, migrations, queries, jobs, auth). Polish the server
|
|
60
|
+
side to ship-quality:
|
|
61
|
+
|
|
62
|
+
- **Error responses consistent** + correct status codes + custom error classes
|
|
63
|
+
+ fail closed on auth/permission/transaction errors. No blanket `catch`es.
|
|
64
|
+
- **Logging hygiene** — structured logs with context (request id, user, op);
|
|
65
|
+
log key events; **never** log secrets / tokens / PII. No leftover
|
|
66
|
+
`console.log` / debug prints.
|
|
67
|
+
- **Data & queries** — no N+1, no unbounded result sets, parameterized
|
|
68
|
+
queries, right transaction boundaries, return only what the caller needs.
|
|
69
|
+
- **API contract** matches the spec (and any saved `references/`); idempotency
|
|
70
|
+
where applicable; consistent pagination/sorting/filtering; validation at the
|
|
71
|
+
boundary.
|
|
72
|
+
- **Performance** — measure-first; obvious wins applied; no quadratic loops on
|
|
73
|
+
growing collections (`devrites-audit perf`).
|
|
74
|
+
- **Cleanup** — remove dead routes, unused endpoints + bad naming this feature
|
|
75
|
+
added.
|
|
76
|
+
- **Code anti-slop** — kill over-defensive layered null/length checks, useless
|
|
77
|
+
wrappers, generic AI naming, "robust" catches that hide bugs, anything
|
|
78
|
+
outside the spec ([anti-ai-slop.md](anti-ai-slop.md) — Code section).
|
|
79
|
+
|
|
80
|
+
## Output → appends to `polish-report.md`
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
Phase 1 (code polish): findings → fixes (technique + why behavior preserved)
|
|
84
|
+
Phase 2 (backend polish): error/log/data/API/cleanup fixes | n/a (no backend)
|
|
85
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Design-system discovery
|
|
2
|
+
|
|
3
|
+
Before touching UI, learn the system that already exists. Read it from the codebase —
|
|
4
|
+
don't impose a generic one.
|
|
5
|
+
|
|
6
|
+
## Register first
|
|
7
|
+
Decide the surface's **register** (drives every other rule):
|
|
8
|
+
- **Brand surface** — landing, marketing, portfolio, campaign. More expressive type,
|
|
9
|
+
larger scale contrast, motion welcome.
|
|
10
|
+
- **Product surface** — dashboard, admin, settings, app UI, tools. System fonts are
|
|
11
|
+
legitimate; one family often suffices; fixed rem scale; tighter ratio (1.125–1.2);
|
|
12
|
+
density is a feature.
|
|
13
|
+
|
|
14
|
+
## What to discover
|
|
15
|
+
| Thing | Where to look |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Design docs | `PRODUCT.md`, `DESIGN.md`, `docs/design/*`, Storybook |
|
|
18
|
+
| Tokens | `tailwind.config.*`, CSS custom properties, `theme.*`, tokens files |
|
|
19
|
+
| Shared components | components/ui dir, design-system package, imports neighbors use |
|
|
20
|
+
| Spacing scale | the spacing tokens / Tailwind scale actually in use |
|
|
21
|
+
| Type scale | heading/body sizes, font families, weights in use |
|
|
22
|
+
| Color roles | semantic names (primary/surface/muted/danger), not raw hexes |
|
|
23
|
+
| Icon set | the one icon library already imported |
|
|
24
|
+
| Interaction patterns | how existing buttons/menus/dialogs/toasts behave |
|
|
25
|
+
| Form patterns | label placement, validation, error display in existing forms |
|
|
26
|
+
| Neighboring screens | the closest existing feature — match its flow shape |
|
|
27
|
+
|
|
28
|
+
## Rules
|
|
29
|
+
- Use existing tokens/components **first**. A hard-coded value where a token exists is
|
|
30
|
+
drift.
|
|
31
|
+
- Don't add a second component library or icon set without asking.
|
|
32
|
+
- Match the closest neighbor's IA and flow shape rather than inventing a new one.
|
|
33
|
+
- **Default vs departure**: preserve the existing identity (default, ~90% of cases).
|
|
34
|
+
Reject it only on an explicit signal — a design doc that points at *this* surface as
|
|
35
|
+
the failure, or the user asking to rebuild it. If unsure, you're in default mode.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Harden checklist — UI against real-world inputs
|
|
2
|
+
|
|
3
|
+
Designs that only work on the happy path are not production-ready. `/rite-polish`
|
|
4
|
+
Phase 2 (UI polish) uses this list to harden the feature against the inputs, errors,
|
|
5
|
+
languages, and network conditions real users will throw at it.
|
|
6
|
+
|
|
7
|
+
Feature scope only — don't harden screens this feature doesn't touch.
|
|
8
|
+
|
|
9
|
+
## 1. Extreme content (the input axis)
|
|
10
|
+
|
|
11
|
+
Walk every text-bearing surface in the feature with deliberately hostile data:
|
|
12
|
+
|
|
13
|
+
- **Very long text** — names of 200+ chars, descriptions of 5000+ chars, titles
|
|
14
|
+
longer than the viewport. Check truncation, wrapping, ellipsis, overflow.
|
|
15
|
+
- **Very short / empty text** — single-char names, empty strings, names that are
|
|
16
|
+
whitespace only. Check whether layout collapses or filters fail.
|
|
17
|
+
- **Unicode** — emoji (`👨👩👧👦` — note grapheme clusters in count limits),<!-- pack-scan-ignore: intentional ZWJ in emoji edge-case example -->
|
|
18
|
+
zero-width joiners, RTL text (`مرحبا`), combining accents (`café` vs `café`).
|
|
19
|
+
- **Numerics at scale** — `0`, negative numbers, `1.000.000`, `1234567890`, very
|
|
20
|
+
large currency. Check column width, formatter behaviour, locale separators.
|
|
21
|
+
- **List sizes** — empty list, 1 item, 50 items, 1000+ items. Check pagination,
|
|
22
|
+
virtualisation, empty state, loading-state-then-empty.
|
|
23
|
+
- **Adversarial input** — strings with `<script>`, `` (RTL override),<!-- pack-scan-ignore: intentional RTL-override example in adversarial-input checklist -->
|
|
24
|
+
trailing whitespace, leading zeros. Confirm escaping at render time (not just
|
|
25
|
+
on submit).
|
|
26
|
+
|
|
27
|
+
## 2. Error scenarios (the failure axis)
|
|
28
|
+
|
|
29
|
+
Every async path needs designed behaviour for at least these states:
|
|
30
|
+
|
|
31
|
+
- **Network failure** — offline, slow (throttled to 3G), timeout, intermittent.
|
|
32
|
+
- **HTTP** — `400` (validation), `401` (signed-out), `403` (permission),
|
|
33
|
+
`404` (gone), `409` (conflict), `429` (rate-limited), `500` / `502` /
|
|
34
|
+
`503` (server).
|
|
35
|
+
- **Partial success** — a bulk action where some items succeed and others fail.
|
|
36
|
+
- **Stale data** — user reads, leaves the tab open for an hour, then acts on
|
|
37
|
+
data that's since changed.
|
|
38
|
+
- **Concurrent edit** — two windows of the same user, or two users on the same
|
|
39
|
+
record.
|
|
40
|
+
|
|
41
|
+
For each: what does the UI show? Can the user recover, or are they stranded?
|
|
42
|
+
Errors must be visible **where the user was acting**, not in a corner toast they
|
|
43
|
+
might miss.
|
|
44
|
+
|
|
45
|
+
## 3. Network / device conditions
|
|
46
|
+
|
|
47
|
+
- **Slow connection** — does the surface show progress, or feel frozen?
|
|
48
|
+
- **Offline** — does anything that *could* work offline still work (drafts,
|
|
49
|
+
cached views), and is everything that can't gracefully blocked with a clear
|
|
50
|
+
message?
|
|
51
|
+
- **Touch + small screen** — every interactive element ≥ 24×24 CSS px (44×44
|
|
52
|
+
for primary touch targets). No drag-only flows.
|
|
53
|
+
- **Keyboard-only** — full feature reachable without a mouse; visible focus;
|
|
54
|
+
Esc closes overlays; Enter submits primary forms.
|
|
55
|
+
- **Screen reader** — every control has a name; live regions for async
|
|
56
|
+
feedback; reading order matches visual order.
|
|
57
|
+
- **Reduced motion** — `prefers-reduced-motion` removes non-essential motion
|
|
58
|
+
(no auto-carousel, no spring entrances).
|
|
59
|
+
- **High zoom** — 200% text zoom; layout doesn't break, nothing overflows.
|
|
60
|
+
|
|
61
|
+
## 4. Localisation / i18n
|
|
62
|
+
|
|
63
|
+
Even single-locale features get hardened against the dimensions i18n exposes,
|
|
64
|
+
because real text behaves the same way:
|
|
65
|
+
|
|
66
|
+
- **String length variance** — German + Finnish + Japanese typically run +30–60%
|
|
67
|
+
longer than English; check buttons, table headers, badges.
|
|
68
|
+
- **RTL** — Hebrew / Arabic mirror the layout. Even if the project is LTR-only,
|
|
69
|
+
no RTL content should *break* anything.
|
|
70
|
+
- **Date / number formats** — `1,234.56` vs `1.234,56` vs `1 234.56`. Currency
|
|
71
|
+
symbol placement.
|
|
72
|
+
- **Pluralisation** — "1 item" vs "2 items" vs "0 items" — and locales with
|
|
73
|
+
more than two plural forms.
|
|
74
|
+
|
|
75
|
+
## 5. Permission / authorisation states
|
|
76
|
+
|
|
77
|
+
Designed states for what the **current user** can / cannot do:
|
|
78
|
+
|
|
79
|
+
- **Not signed in** — does the surface degrade, redirect, or 404 cleanly?
|
|
80
|
+
- **Signed in, no permission** — message states what's missing and how to get
|
|
81
|
+
it; doesn't show empty data as if it were a real empty state.
|
|
82
|
+
- **Signed in, partial permission** — read-only mode designed (controls
|
|
83
|
+
disabled with reason; never silently no-oped).
|
|
84
|
+
- **Signed in, owner / admin** — surfaces destructive actions appropriately and
|
|
85
|
+
guards them.
|
|
86
|
+
|
|
87
|
+
## 6. Tooling-assisted checks (when available)
|
|
88
|
+
|
|
89
|
+
If the project has the tools, run them; capture evidence in `evidence.md`.
|
|
90
|
+
|
|
91
|
+
- `prefers-reduced-motion`: emulate in DevTools → re-verify motion.
|
|
92
|
+
- Throttle to "Slow 3G" → re-verify loading + error states.
|
|
93
|
+
- Lighthouse / axe / pa11y → re-verify accessibility floor.
|
|
94
|
+
- Browser-harness or Chrome DevTools MCP (per `devrites-browser-proof`) → capture
|
|
95
|
+
screenshots of the worst-case input states above.
|
|
96
|
+
|
|
97
|
+
## Reporting in `/rite-polish`
|
|
98
|
+
|
|
99
|
+
For each finding raised by this checklist, classify by Phase-3 normalize bucket
|
|
100
|
+
per [ui.md](ui.md):
|
|
101
|
+
- **Token gap** — the design system already has the answer (`text-truncate`
|
|
102
|
+
token, `state-empty` component) and it isn't being used.
|
|
103
|
+
- **Component miss** — the project already has an `EmptyState`, `ErrorBanner`,
|
|
104
|
+
`OfflineNotice`, and a one-off was built instead.
|
|
105
|
+
- **Flow / IA misalignment** — the error / empty / offline state doesn't follow
|
|
106
|
+
the project's pattern (e.g. inline where the project shows a banner; toast
|
|
107
|
+
where the project uses inline).
|
|
108
|
+
|
|
109
|
+
Fix in scope; route anything that would balloon the diff as a follow-up FYI.
|