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.
Files changed (232) hide show
  1. package/.claude-plugin/marketplace.json +24 -0
  2. package/.claude-plugin/plugin.json +43 -0
  3. package/CHANGELOG.md +391 -0
  4. package/LICENSE +56 -0
  5. package/NOTICE.md +18 -0
  6. package/README.md +582 -0
  7. package/SECURITY.md +193 -0
  8. package/bin/devrites.mjs +100 -0
  9. package/docs/architecture.md +272 -0
  10. package/docs/cli-mcp.md +57 -0
  11. package/docs/command-map.md +143 -0
  12. package/docs/flow.md +360 -0
  13. package/docs/release.md +29 -0
  14. package/docs/skills.md +214 -0
  15. package/docs/usage.md +325 -0
  16. package/install.sh +359 -0
  17. package/mcp/devrites-mcp.mjs +103 -0
  18. package/pack/.claude/agents/devrites-code-reviewer.md +50 -0
  19. package/pack/.claude/agents/devrites-doubt-reviewer.md +55 -0
  20. package/pack/.claude/agents/devrites-frontend-reviewer.md +52 -0
  21. package/pack/.claude/agents/devrites-performance-reviewer.md +47 -0
  22. package/pack/.claude/agents/devrites-plan-reviewer.md +79 -0
  23. package/pack/.claude/agents/devrites-security-auditor.md +53 -0
  24. package/pack/.claude/agents/devrites-simplifier-reviewer.md +75 -0
  25. package/pack/.claude/agents/devrites-slice-wright.md +181 -0
  26. package/pack/.claude/agents/devrites-spec-reviewer.md +72 -0
  27. package/pack/.claude/agents/devrites-strategy-reviewer.md +62 -0
  28. package/pack/.claude/agents/devrites-test-analyst.md +47 -0
  29. package/pack/.claude/hooks/devrites-a1-guard.sh +81 -0
  30. package/pack/.claude/hooks/devrites-allow.sh +44 -0
  31. package/pack/.claude/hooks/devrites-cursor.sh +28 -0
  32. package/pack/.claude/hooks/devrites-orient.sh +53 -0
  33. package/pack/.claude/hooks/devrites-redwatch.sh +39 -0
  34. package/pack/.claude/hooks/devrites-refresh-indexes.sh +127 -0
  35. package/pack/.claude/hooks/devrites-reviewer-readonly.sh +28 -0
  36. package/pack/.claude/hooks/devrites-statusline.sh +18 -0
  37. package/pack/.claude/hooks/devrites-stop-gate.sh +45 -0
  38. package/pack/.claude/hooks/devrites-wright-scope.sh +35 -0
  39. package/pack/.claude/hooks/hooks.json +52 -0
  40. package/pack/.claude/rules/README.md +48 -0
  41. package/pack/.claude/rules/afk-hitl.md +245 -0
  42. package/pack/.claude/rules/agents.md +98 -0
  43. package/pack/.claude/rules/anti-patterns.md +48 -0
  44. package/pack/.claude/rules/code-review.md +38 -0
  45. package/pack/.claude/rules/coding-style.md +55 -0
  46. package/pack/.claude/rules/context-hygiene.md +97 -0
  47. package/pack/.claude/rules/core.md +119 -0
  48. package/pack/.claude/rules/development-workflow.md +40 -0
  49. package/pack/.claude/rules/documentation.md +27 -0
  50. package/pack/.claude/rules/error-handling.md +33 -0
  51. package/pack/.claude/rules/git-workflow.md +35 -0
  52. package/pack/.claude/rules/hooks.md +38 -0
  53. package/pack/.claude/rules/patterns.md +45 -0
  54. package/pack/.claude/rules/performance.md +27 -0
  55. package/pack/.claude/rules/prose-style.md +101 -0
  56. package/pack/.claude/rules/security.md +63 -0
  57. package/pack/.claude/rules/testing.md +88 -0
  58. package/pack/.claude/rules/tooling.md +72 -0
  59. package/pack/.claude/settings.json +53 -0
  60. package/pack/.claude/skills/devrites-api-interface/SKILL.md +45 -0
  61. package/pack/.claude/skills/devrites-audit/SKILL.md +73 -0
  62. package/pack/.claude/skills/devrites-browser-proof/SKILL.md +38 -0
  63. package/pack/.claude/skills/devrites-debug-recovery/SKILL.md +50 -0
  64. package/pack/.claude/skills/devrites-debug-recovery/reference/build-the-loop.md +47 -0
  65. package/pack/.claude/skills/devrites-debug-recovery/reference/cleanup-and-classify.md +17 -0
  66. package/pack/.claude/skills/devrites-debug-recovery/reference/hypotheses.md +17 -0
  67. package/pack/.claude/skills/devrites-debug-recovery/reference/instrumentation.md +21 -0
  68. package/pack/.claude/skills/devrites-debug-recovery/reference/regression-test.md +31 -0
  69. package/pack/.claude/skills/devrites-doubt/SKILL.md +75 -0
  70. package/pack/.claude/skills/devrites-frontend-craft/SKILL.md +96 -0
  71. package/pack/.claude/skills/devrites-frontend-craft/reference/craft.md +59 -0
  72. package/pack/.claude/skills/devrites-frontend-craft/reference/design-references.md +116 -0
  73. package/pack/.claude/skills/devrites-frontend-craft/reference/fullstack.md +45 -0
  74. package/pack/.claude/skills/devrites-frontend-craft/reference/quality-standards.md +215 -0
  75. package/pack/.claude/skills/devrites-frontend-craft/reference/reuse-first.md +59 -0
  76. package/pack/.claude/skills/devrites-frontend-craft/reference/shape.md +60 -0
  77. package/pack/.claude/skills/devrites-interview/SKILL.md +81 -0
  78. package/pack/.claude/skills/devrites-lib/SKILL.md +76 -0
  79. package/pack/.claude/skills/devrites-lib/scripts/analyze.sh +78 -0
  80. package/pack/.claude/skills/devrites-lib/scripts/check-acceptance.sh +75 -0
  81. package/pack/.claude/skills/devrites-lib/scripts/close-out.sh +47 -0
  82. package/pack/.claude/skills/devrites-lib/scripts/conventions.py +273 -0
  83. package/pack/.claude/skills/devrites-lib/scripts/coverage.sh +51 -0
  84. package/pack/.claude/skills/devrites-lib/scripts/devrites.sh +69 -0
  85. package/pack/.claude/skills/devrites-lib/scripts/doctor.sh +92 -0
  86. package/pack/.claude/skills/devrites-lib/scripts/evidence-fresh.sh +63 -0
  87. package/pack/.claude/skills/devrites-lib/scripts/footprint.sh +45 -0
  88. package/pack/.claude/skills/devrites-lib/scripts/learnings.sh +74 -0
  89. package/pack/.claude/skills/devrites-lib/scripts/mutation-gate.sh +52 -0
  90. package/pack/.claude/skills/devrites-lib/scripts/package-existence.sh +68 -0
  91. package/pack/.claude/skills/devrites-lib/scripts/preamble.sh +76 -0
  92. package/pack/.claude/skills/devrites-lib/scripts/progress.sh +103 -0
  93. package/pack/.claude/skills/devrites-lib/scripts/readiness.sh +62 -0
  94. package/pack/.claude/skills/devrites-lib/scripts/reconcile.sh +123 -0
  95. package/pack/.claude/skills/devrites-lib/scripts/resolve.sh +279 -0
  96. package/pack/.claude/skills/devrites-lib/scripts/stuck.sh +67 -0
  97. package/pack/.claude/skills/devrites-lib/scripts/test-integrity.sh +87 -0
  98. package/pack/.claude/skills/devrites-lib/scripts/tick-afk.sh +52 -0
  99. package/pack/.claude/skills/devrites-prose-craft/SKILL.md +105 -0
  100. package/pack/.claude/skills/devrites-prose-craft/reference/banned-phrases.md +95 -0
  101. package/pack/.claude/skills/devrites-prose-craft/reference/examples.md +88 -0
  102. package/pack/.claude/skills/devrites-prose-craft/reference/structures.md +134 -0
  103. package/pack/.claude/skills/devrites-refresh-indexes/SKILL.md +54 -0
  104. package/pack/.claude/skills/devrites-source-driven/SKILL.md +36 -0
  105. package/pack/.claude/skills/devrites-ux-shape/SKILL.md +121 -0
  106. package/pack/.claude/skills/devrites-ux-shape/reference/brief-template.md +93 -0
  107. package/pack/.claude/skills/devrites-ux-shape/reference/visual-direction-probe.md +48 -0
  108. package/pack/.claude/skills/rite/SKILL.md +135 -0
  109. package/pack/.claude/skills/rite/reference/menu.md +32 -0
  110. package/pack/.claude/skills/rite-adopt/SKILL.md +83 -0
  111. package/pack/.claude/skills/rite-adopt/reference/adoption.md +58 -0
  112. package/pack/.claude/skills/rite-adopt/reference/anti-patterns.md +19 -0
  113. package/pack/.claude/skills/rite-autocomplete/SKILL.md +96 -0
  114. package/pack/.claude/skills/rite-autocomplete/reference/decision-policy.md +35 -0
  115. package/pack/.claude/skills/rite-autocomplete/reference/loop.md +54 -0
  116. package/pack/.claude/skills/rite-autocomplete/reference/stop-conditions.md +59 -0
  117. package/pack/.claude/skills/rite-build/SKILL.md +261 -0
  118. package/pack/.claude/skills/rite-build/reference/afk-discipline.md +145 -0
  119. package/pack/.claude/skills/rite-build/reference/anti-patterns.md +25 -0
  120. package/pack/.claude/skills/rite-build/reference/checkpoint-protocol.md +149 -0
  121. package/pack/.claude/skills/rite-build/reference/evidence-standard.md +32 -0
  122. package/pack/.claude/skills/rite-build/reference/frontend-trigger.md +39 -0
  123. package/pack/.claude/skills/rite-build/reference/one-slice-cycle.md +38 -0
  124. package/pack/.claude/skills/rite-build/reference/spec-drift-guard.md +43 -0
  125. package/pack/.claude/skills/rite-build/reference/tdd.md +26 -0
  126. package/pack/.claude/skills/rite-build/reference/wright-dispatch.md +115 -0
  127. package/pack/.claude/skills/rite-define/SKILL.md +157 -0
  128. package/pack/.claude/skills/rite-define/reference/anti-patterns.md +25 -0
  129. package/pack/.claude/skills/rite-define/reference/gates.md +152 -0
  130. package/pack/.claude/skills/rite-define/reference/plan-template.md +65 -0
  131. package/pack/.claude/skills/rite-doctor/SKILL.md +50 -0
  132. package/pack/.claude/skills/rite-frame/SKILL.md +116 -0
  133. package/pack/.claude/skills/rite-frame/reference/failure-modes.md +68 -0
  134. package/pack/.claude/skills/rite-handoff/SKILL.md +95 -0
  135. package/pack/.claude/skills/rite-handoff/reference/handoff-template.md +34 -0
  136. package/pack/.claude/skills/rite-learn/SKILL.md +82 -0
  137. package/pack/.claude/skills/rite-plan/SKILL.md +82 -0
  138. package/pack/.claude/skills/rite-plan/reference/anti-patterns.md +24 -0
  139. package/pack/.claude/skills/rite-plan/reference/dependency-graph.md +33 -0
  140. package/pack/.claude/skills/rite-plan/reference/replan-and-repair.md +42 -0
  141. package/pack/.claude/skills/rite-plan/reference/slicing.md +52 -0
  142. package/pack/.claude/skills/rite-plan/reference/task-breakdown.md +34 -0
  143. package/pack/.claude/skills/rite-polish/SKILL.md +90 -0
  144. package/pack/.claude/skills/rite-polish/reference/anti-ai-slop.md +177 -0
  145. package/pack/.claude/skills/rite-polish/reference/anti-patterns.md +27 -0
  146. package/pack/.claude/skills/rite-polish/reference/backend-polish.md +80 -0
  147. package/pack/.claude/skills/rite-polish/reference/browser-polish-evidence.md +31 -0
  148. package/pack/.claude/skills/rite-polish/reference/code.md +85 -0
  149. package/pack/.claude/skills/rite-polish/reference/design-system-discovery.md +35 -0
  150. package/pack/.claude/skills/rite-polish/reference/harden-checklist.md +109 -0
  151. package/pack/.claude/skills/rite-polish/reference/ui.md +136 -0
  152. package/pack/.claude/skills/rite-pressure-test/SKILL.md +43 -0
  153. package/pack/.claude/skills/rite-prototype/SKILL.md +87 -0
  154. package/pack/.claude/skills/rite-prove/SKILL.md +120 -0
  155. package/pack/.claude/skills/rite-prove/reference/anti-patterns.md +25 -0
  156. package/pack/.claude/skills/rite-prove/reference/browser-proof.md +26 -0
  157. package/pack/.claude/skills/rite-prove/reference/failure-triage.md +25 -0
  158. package/pack/.claude/skills/rite-prove/reference/proof-ladder.md +26 -0
  159. package/pack/.claude/skills/rite-prove/reference/test-command-discovery.md +30 -0
  160. package/pack/.claude/skills/rite-quick/SKILL.md +81 -0
  161. package/pack/.claude/skills/rite-resolve/SKILL.md +113 -0
  162. package/pack/.claude/skills/rite-resolve/reference/answer-protocol.md +114 -0
  163. package/pack/.claude/skills/rite-review/SKILL.md +170 -0
  164. package/pack/.claude/skills/rite-review/reference/anti-patterns.md +32 -0
  165. package/pack/.claude/skills/rite-review/reference/cognitive-load.md +90 -0
  166. package/pack/.claude/skills/rite-review/reference/feature-scoped-review.md +26 -0
  167. package/pack/.claude/skills/rite-review/reference/five-axis-review.md +46 -0
  168. package/pack/.claude/skills/rite-review/reference/nielsen-heuristics.md +130 -0
  169. package/pack/.claude/skills/rite-review/reference/parallel-dispatch.md +62 -0
  170. package/pack/.claude/skills/rite-review/reference/performance-review.md +28 -0
  171. package/pack/.claude/skills/rite-review/reference/security-review.md +32 -0
  172. package/pack/.claude/skills/rite-seal/SKILL.md +183 -0
  173. package/pack/.claude/skills/rite-seal/reference/anti-patterns.md +27 -0
  174. package/pack/.claude/skills/rite-seal/reference/conventions-ledger.md +63 -0
  175. package/pack/.claude/skills/rite-seal/reference/final-evidence.md +72 -0
  176. package/pack/.claude/skills/rite-seal/reference/go-no-go.md +37 -0
  177. package/pack/.claude/skills/rite-seal/reference/parallel-dispatch.md +69 -0
  178. package/pack/.claude/skills/rite-seal/reference/risk-and-rollback.md +30 -0
  179. package/pack/.claude/skills/rite-seal/reference/seal-template.md +36 -0
  180. package/pack/.claude/skills/rite-ship/SKILL.md +120 -0
  181. package/pack/.claude/skills/rite-ship/reference/anti-patterns.md +25 -0
  182. package/pack/.claude/skills/rite-ship/reference/close-out.md +31 -0
  183. package/pack/.claude/skills/rite-ship/reference/design-memory.md +120 -0
  184. package/pack/.claude/skills/rite-ship/reference/git-ship.md +42 -0
  185. package/pack/.claude/skills/rite-ship/reference/ship-template.md +33 -0
  186. package/pack/.claude/skills/rite-spec/SKILL.md +126 -0
  187. package/pack/.claude/skills/rite-spec/reference/acceptance-criteria.md +31 -0
  188. package/pack/.claude/skills/rite-spec/reference/anti-patterns.md +25 -0
  189. package/pack/.claude/skills/rite-spec/reference/interview-patterns.md +56 -0
  190. package/pack/.claude/skills/rite-spec/reference/investigation.md +64 -0
  191. package/pack/.claude/skills/rite-spec/reference/question-protocol.md +61 -0
  192. package/pack/.claude/skills/rite-spec/reference/references-intake.md +57 -0
  193. package/pack/.claude/skills/rite-spec/reference/spec-checklists.md +73 -0
  194. package/pack/.claude/skills/rite-spec/reference/spec-template.md +124 -0
  195. package/pack/.claude/skills/rite-spec/reference/state-workspace.md +159 -0
  196. package/pack/.claude/skills/rite-status/SKILL.md +101 -0
  197. package/pack/.claude/skills/rite-temper/SKILL.md +119 -0
  198. package/pack/.claude/skills/rite-temper/reference/anti-patterns.md +29 -0
  199. package/pack/.claude/skills/rite-temper/reference/review-dimensions.md +65 -0
  200. package/pack/.claude/skills/rite-temper/reference/scope-modes.md +53 -0
  201. package/pack/.claude/skills/rite-temper/reference/significance.md +46 -0
  202. package/pack/.claude/skills/rite-temper/reference/strategy-template.md +90 -0
  203. package/pack/.claude/skills/rite-vet/SKILL.md +155 -0
  204. package/pack/.claude/skills/rite-vet/reference/anti-patterns.md +29 -0
  205. package/pack/.claude/skills/rite-vet/reference/artifacts.md +135 -0
  206. package/pack/.claude/skills/rite-vet/reference/cross-model.md +41 -0
  207. package/pack/.claude/skills/rite-vet/reference/depth.md +53 -0
  208. package/pack/.claude/skills/rite-vet/reference/eng-lenses.md +48 -0
  209. package/pack/.claude/skills/rite-vet/reference/review-axes.md +167 -0
  210. package/pack/.claude/skills/rite-zoom-out/SKILL.md +75 -0
  211. package/package.json +68 -0
  212. package/scripts/build-release-tarball.sh +74 -0
  213. package/scripts/check-cross-refs.py +121 -0
  214. package/scripts/check-no-global-writes.sh +44 -0
  215. package/scripts/check-rule-uniqueness.sh +73 -0
  216. package/scripts/devrites-detect.sh +175 -0
  217. package/scripts/eval-runner.py +273 -0
  218. package/scripts/grade-feature.sh +104 -0
  219. package/scripts/install-lib.sh +83 -0
  220. package/scripts/pin.sh +166 -0
  221. package/scripts/render-eval-summary.py +48 -0
  222. package/scripts/run-evals.sh +149 -0
  223. package/scripts/run-outcome-evals.sh +49 -0
  224. package/scripts/scan-pack-security.py +209 -0
  225. package/scripts/scan-supply-chain-iocs.py +127 -0
  226. package/scripts/supply-chain-iocs.json +11 -0
  227. package/scripts/sync-version.sh +56 -0
  228. package/scripts/validate-frontmatter.py +149 -0
  229. package/scripts/validate-workflow-security.py +86 -0
  230. package/scripts/validate.sh +234 -0
  231. package/uninstall.sh +137 -0
  232. package/update.sh +196 -0
@@ -0,0 +1,31 @@
1
+ # Acceptance criteria
2
+
3
+ Acceptance criteria are the contract the seal checks. Write them so each is
4
+ **independently verifiable by evidence**, not opinion.
5
+
6
+ ## A good criterion
7
+ - Is observable: a test passes, a command outputs X, a screenshot shows Y.
8
+ - Is binary: met or not — no "mostly".
9
+ - Names the evidence: "`npm test path/x.test.ts` passes" or "POST /export returns 200
10
+ with a CSV body" or "empty state renders 'No exports yet' at 375px".
11
+ - Belongs to a slice: every criterion maps to at least one slice (mapped in `/rite-define`).
12
+
13
+ ## Forms
14
+ | Type | Template |
15
+ |---|---|
16
+ | Functional | "Given <state>, when <action>, then <observable result>." |
17
+ | API | "<METHOD> <route> with <input> returns <status> and <shape>." |
18
+ | UI | "<screen> shows <element/state> at <viewport>; <interaction> does <result>." |
19
+ | UI vs reference | "<screen> matches design reference <Rn> at <viewport>." |
20
+ | Non-functional | "<operation> completes under <budget> / handles <volume>." |
21
+ | Negative | "<invalid input> is rejected with <message>, no <side effect>." |
22
+
23
+ ## Anti-patterns
24
+ - "Works well" / "is fast" / "looks good" — unverifiable. Attach a number or an
25
+ observation.
26
+ - Criteria with no slice — orphaned scope.
27
+ - Criteria only provable by reading the code — require runtime/test evidence instead.
28
+
29
+ ## At seal time
30
+ Each criterion gets a checkbox + the evidence that proves it. Unproven critical
31
+ criteria force **NO-GO**.
@@ -0,0 +1,25 @@
1
+ # rite-spec — anti-patterns
2
+
3
+ Load this when standing a non-trivial decision in `/rite-spec`, or when the
4
+ agent feels reluctance toward investigation depth, gap-closing, or
5
+ placement decisions.
6
+
7
+ Pack-wide rationalizations + red flags: see [rules/anti-patterns.md](../../../rules/anti-patterns.md).
8
+
9
+ ## Phase-specific rationalizations
10
+
11
+ | Excuse | Rebuttal |
12
+ |---|---|
13
+ | "User said *just make it work* — no spec needed." | Vague asks are exactly where `/rite-spec` earns its keep; load `devrites-interview` and ask one question at a time. |
14
+ | "I already understand the request." | Then writing the placement + acceptance criteria takes minutes and saves drift later. Investigation isn't for *you*, it's for `/rite-define`. |
15
+ | "Too small for a spec." | If it's big enough for `/rite-build`, it's big enough for one paragraph of WHAT/WHY + measurable acceptance. |
16
+ | "No design refs were attached, so skip references." | Skip the *gathering*, not the *acknowledgement*. Note "no references provided" in the spec — silence is ambiguous. |
17
+ | "I can resolve gaps as I build." | Drift discovered at slice 3 costs more than 5 questions answered now. |
18
+
19
+ ## Red Flags
20
+
21
+ - About to start writing `spec.md` without a Placement & integration section.
22
+ - Spec has no measurable acceptance criteria — "works as expected" is not measurable.
23
+ - A `[NEEDS CLARIFICATION]` marker remains on a blocking item.
24
+ - Design references were attached but never opened, saved, or indexed in `references.md`.
25
+ - The investigation didn't read the module/component that currently owns this area.
@@ -0,0 +1,56 @@
1
+ # Interview patterns
2
+
3
+ Question ladders by domain. Pull the rung that matches the biggest current unknown.
4
+ Each question still follows the protocol: one at a time, best guess attached.
5
+
6
+ ## Vague ask? Map the decision tree first
7
+ For a fuzzy one-liner (`"design a contact page"`, `"add reporting"`), sketch the branches
8
+ the answer splits into, then resolve each **depth-first** — one branch to a decision before
9
+ opening the next:
10
+
11
+ ```text
12
+ contact page
13
+ ├─ purpose? ── sales lead | support request | general
14
+ ├─ fields? ── name/email/message | + company/phone | file upload
15
+ ├─ on submit? ── email | ticket/CRM | DB row | embedded third-party form
16
+ └─ success? ── inline confirm | redirect | autoresponder
17
+ ```
18
+
19
+ Once per interview you may **challenge the premise** instead of refining it
20
+ (*"is a form even the right answer, or a mailto / booking link?"*) — a good reframe
21
+ collapses whole branches. Then use the domain ladders below for each open branch.
22
+
23
+ ## Objective / problem
24
+ - "What does success look like in one sentence?"
25
+ - "Who hits this, how often, and what do they do today instead?"
26
+ - "If we shipped only one thing here, what must it be?"
27
+
28
+ ## Scope boundaries
29
+ - "What is explicitly **out** of scope for this first version?"
30
+ - "Is this a new capability or a change to an existing flow?"
31
+ - "What's the smallest version that's still useful?" (→ slice 1)
32
+
33
+ ## Data model
34
+ - "What are the core entities and how do they relate?"
35
+ - "What's the source of truth, and can these fields change after creation?"
36
+ - "Any uniqueness, ordering, or soft-delete needs?"
37
+
38
+ ## UX / flow
39
+ - "Walk me through the happy path screen by screen."
40
+ - "What are the empty / loading / error / permission-denied states?"
41
+ - "Brand surface (marketing) or product surface (app UI)?" (drives craft)
42
+
43
+ ## Integration / external
44
+ - "Which external systems or APIs are involved, and who owns them?"
45
+ - "Sync or async? What happens when the dependency is down?"
46
+
47
+ ## Non-functional
48
+ - "Any latency, scale, or volume targets I should design to?"
49
+ - "Auth/permission rules? Anything sensitive (PII, secrets, payments)?"
50
+
51
+ ## Acceptance
52
+ - "How will we *prove* this works — what's the test or observation?"
53
+ - "What would make you reject the PR?"
54
+
55
+ ## Anti-references (taste)
56
+ - "Show me one thing that does this well, and one that does it badly."
@@ -0,0 +1,64 @@
1
+ # Investigation — understand deeply before specifying
2
+
3
+ The spec is only as good as the investigation behind it. Goal: understand the
4
+ requirement **completely**, decide **where it correctly belongs**, name what it
5
+ **resolves**, and surface every **issue and gap** — then drive the gaps to closure with
6
+ the user so the spec ships fully-covered and correctly-placed. A gap found here is cheap;
7
+ a gap found in `/rite-build` is a drift event.
8
+
9
+ Use a code-intelligence index if available — codebase-memory-mcp first, cross-checked with codegraph + graphify, else standard methods (LSP / Read/Grep/Glob)
10
+ (see `../../../rules/tooling.md`) — for the structural parts below; it answers "where does this
11
+ live / what calls it / what would it break" far more cheaply and accurately than reading files.
12
+ With none present, fall back to Read/Grep/Glob.
13
+
14
+ ## Produce these findings (write into spec.md)
15
+ 1. **The real ask** — restate the goal and the *problem behind the request* (people ask
16
+ for "a dashboard" when they want an answer to a question). Who hits it, how often,
17
+ what they do today instead.
18
+ 2. **Current behavior** — how it works today, or what's absent. Read the actual code and
19
+ flows; don't assume.
20
+ 3. **Placement — where it should live** *(so it's correctly placed to be used)*
21
+ - Which module / layer / file / component should own this; the right seam.
22
+ - Existing patterns/components/utilities to **extend or reuse** instead of duplicating.
23
+ - **Integration points**: callers and dependents, the data it reads/writes, the
24
+ APIs/events/contracts it touches (interface analysis — how it interacts with the
25
+ rest of the system).
26
+ 4. **What it resolves** — the outcome/value and how we'll *observe* it's resolved (feeds
27
+ success + acceptance criteria).
28
+ 5. **Issues** — conflicts with existing code/UX/data/permissions, constraints, and
29
+ anything that makes the obvious approach wrong. Each issue gets a disposition.
30
+ 6. **Gaps** — unknowns, ambiguities, undecided behavior, missing inputs. **Every gap
31
+ becomes a question** (next section).
32
+ 7. **Blast radius** — what this change could break (use the code graph's impact/callers).
33
+ Informs risks, test strategy, and rollback.
34
+
35
+ Also gather any **design/reference materials** the human supplies (screenshots, Figma,
36
+ links, video) — see [references-intake](references-intake.md). They're part of
37
+ understanding the requirement and become the target later phases verify against.
38
+
39
+ ## Gap analysis (present → desired)
40
+ State the **present state** and the **desired state**; the delta is the work, and the
41
+ **unknowns in the delta are the gaps**. Drive the count of open gaps toward zero before
42
+ handing off to `/rite-define`. Mark each gap inline with `[NEEDS CLARIFICATION: question]`.
43
+
44
+ ## Turn gaps & issues into questions WITH options
45
+ For each material gap/issue (one that changes scope, placement, data model, UX, security,
46
+ migration risk, or acceptance), ask the user — one question at a time, **best guess
47
+ attached**, with structured options and an escape hatch:
48
+ ```
49
+ <gap/issue stated in one line>. Why it matters: <...>
50
+ 1. <option A> — <implication / where it places the work>
51
+ 2. <option B> — <implication>
52
+ 3. <option C> — <implication>
53
+ 4. Something else — I'll describe it
54
+ (My best guess: #2, because <reason>.)
55
+ ```
56
+ Resolve material gaps before finalizing the spec. Reversible, low-impact gaps: decide,
57
+ record in `assumptions.md`, and move on — don't interrogate.
58
+
59
+ ## Done when
60
+ - The real problem, current behavior, placement, and what-it-resolves are written down.
61
+ - Every issue has a disposition; every material gap is resolved (or explicitly deferred
62
+ as non-blocking).
63
+ - No blocking `[NEEDS CLARIFICATION]` remains — the spec is **fully covered and correctly
64
+ placed**. This is the `/rite-spec` readiness gate before `/rite-define` plans it.
@@ -0,0 +1,61 @@
1
+ # Question protocol
2
+
3
+ The discipline behind `/rite-spec` and `devrites-interview`.
4
+
5
+ ## One question at a time
6
+ Ask exactly one question per turn. Multiple questions at once get one answered and the
7
+ rest ignored, and they signal you haven't prioritized.
8
+
9
+ ## Always attach your best guess
10
+ Every question carries your current assumption and *why*:
11
+ > "I'm assuming the export is CSV only (simplest, covers the stated use case). Right,
12
+ > or do you need XLSX/PDF too?"
13
+ This converts an open question into a cheap yes/no correction and reveals your model so
14
+ the user can fix the premise, not just the question.
15
+
16
+ ## Highest-value question first
17
+ Order by how much the answer changes the build. A question that changes the data model
18
+ or acceptance criteria beats a cosmetic one. If two are equal, ask the one that unblocks
19
+ the most downstream work.
20
+
21
+ ## Structured options when the space is enumerable
22
+ ```
23
+ 1. <option> — <what it implies for build/scope>
24
+ 2. <option> — <implication>
25
+ 3. <option> — <implication>
26
+ 4. Something else — I'll describe it
27
+ ```
28
+ Always include the escape hatch (#4). Mark your recommended option.
29
+
30
+ ## Stop conditions (any one)
31
+ - **Confidence** — you can predict the user's answer to the next question (~95%).
32
+ - **Convergence** — the last 2–3 answers only rubber-stamped your guesses; the spec
33
+ stopped moving.
34
+ - **Soft cap** — after ~8 material questions, proceed with best-guess answers logged as
35
+ assumptions (hard-stop sooner if the ask is small).
36
+
37
+ If you keep circling one area without progress, **reframe once** — challenge the premise
38
+ rather than asking again.
39
+
40
+ ## Coverage gate — am I done asking?
41
+ Before declaring the interview complete, each dimension is **resolved** or **explicitly
42
+ deferred** (logged, non-blocking) — never silently skipped:
43
+ - [ ] **Objective** — one-sentence success + the real problem behind it.
44
+ - [ ] **Scope** — what's in vs explicitly out for v1.
45
+ - [ ] **Data model** — core entities + relationships (or "none").
46
+ - [ ] **UX / flow** — happy path + empty / loading / error / permission states (or "no UI").
47
+ - [ ] **Integration** — external systems / APIs / contracts (or "none").
48
+ - [ ] **Non-functional** — auth, sensitive data, latency / scale (or "n/a").
49
+ - [ ] **Acceptance** — how each requirement is *proven* (test / observation).
50
+
51
+ A blocking gap in any dimension keeps the interview open; a deferred one goes to
52
+ `questions.md` and doesn't block. This feeds the `/rite-spec` readiness gate.
53
+
54
+ ## What NOT to ask
55
+ - Things the codebase answers (read it first).
56
+ - Reversible implementation details (decide and note as an assumption).
57
+ - Everything at once "to be thorough." Thoroughness is depth on the few that matter.
58
+
59
+ ## Record
60
+ Confirmed answers → `decisions.md` (with rationale). Standing assumptions →
61
+ `assumptions.md`. Open non-blocking items → `questions.md`.
@@ -0,0 +1,57 @@
1
+ # Reference intake — design/style materials from the human
2
+
3
+ During the spec phase the human **may** hand you **how it should look or behave**:
4
+ screenshots, mockups, a Figma link, a video of a flow, a reference site, or a doc — **or
5
+ nothing at all** (no design, no screenshots, no explanation is perfectly normal). This is
6
+ entirely **optional**. When references *are* given, treat them as first-class inputs:
7
+ gather them, understand them, **save the local ones**, and index them so every later phase
8
+ (build, prove, polish, seal) can check the work against them. When there are none, skip
9
+ this and proceed with the spec.
10
+
11
+ ## Gather + understand each reference
12
+ - **Images / screenshots / mockups** — open and **view** them (the Read tool renders
13
+ images). Describe what they show: layout, components, spacing, states, the target look.
14
+ - **Figma link** — if a Figma integration is available, pull its design context (frames,
15
+ tokens, components); otherwise record the link and ask the human for an export/screenshot
16
+ so there's something concrete to match offline.
17
+ - **Links / reference sites / docs** — fetch and read for the relevant intent (tone,
18
+ layout, interaction, quality bar). Capture *why* it's a reference, not just the URL.
19
+ - **Video** — note what it demonstrates (the expected interaction/flow). Save it; later
20
+ phases can step through it as tooling allows.
21
+
22
+ ## Save local assets into the workspace
23
+ Copy any local file (screenshot, mockup, video, export) into
24
+ `.devrites/work/<slug>/references/` so it's durable and connectable later:
25
+ ```
26
+ mkdir -p .devrites/work/<slug>/references
27
+ cp "<the file the human gave>" .devrites/work/<slug>/references/<clear-name>.<ext>
28
+ ```
29
+ Use clear names (`login-mockup.png`, `checkout-flow.mp4`). Don't move the user's
30
+ original; copy it. For remote-only refs (a live Figma/URL), record the link in the index.
31
+
32
+ ## Index in `references.md`
33
+ ```markdown
34
+ # References: <slug>
35
+ | Ref | Type | Location | Shows / why it's a reference | Informs |
36
+ |-----|------|----------|------------------------------|---------|
37
+ | R1 | screenshot | references/login-mockup.png | target login layout + spacing | spec UI, slice 2, polish |
38
+ | R2 | figma | https://figma.com/… (+ export references/tokens.png) | design tokens, component set | all UI |
39
+ | R3 | video | references/checkout-flow.mp4 | expected step order + transitions | build, prove |
40
+ | R4 | link | https://example.com | tone + density to match | craft |
41
+ ```
42
+
43
+ ## Feed them into the spec + the design brief
44
+ - Use references to sharpen `spec.md` (UI impact, success/acceptance — e.g. "matches R1").
45
+ - When the feature touches UI, these references are the primary input to **`devrites-ux-shape`**
46
+ (spec step 3a): they anchor the design direction and can seed the visual-direction probe
47
+ (a Figma link → pulled design context; reference sites → screenshots). The resulting
48
+ `design-brief.md` cites them by R-id.
49
+ - A reference can *resolve a gap* ("which layout?") — record that in the gaps table.
50
+ - If a reference **conflicts** with the existing design system, that's an issue to raise
51
+ with the human (match the system, or adopt the reference — their call).
52
+
53
+ ## Later phases use them (wire-through)
54
+ `devrites-frontend-craft` builds **to** the references; `/rite-polish` compares the built
55
+ UI **against** them; `/rite-prove` / `browser-evidence.md` verify against them; `/rite-seal`
56
+ checks "matches the agreed design references" as acceptance. So save them once here and
57
+ everything downstream can connect to them.
@@ -0,0 +1,73 @@
1
+ # Spec-quality checklists — "unit tests for the English"
2
+
3
+ Before the spec hands off to `/rite-define`, test the **requirement prose itself** the way you'd
4
+ unit-test code: is each requirement complete, unambiguous, and measurable? These checklists
5
+ interrogate the *writing*, not the implementation — there is no code to run yet. A criterion like
6
+ "the banner is prominent" passes a human skim and fails here ("prominent" is unquantified).
7
+ Catching it now is a one-line spec edit; catching it at `/rite-prove` is a reslice.
8
+
9
+ **Not implementation tests.** A checklist item asks "is *export* defined for an empty dataset?" —
10
+ it does **not** ask "does `exportCsv()` handle `[]`?". The first tests the spec; the second is
11
+ `/rite-vet`'s test-plan and `/rite-prove`'s job. These files never name a function, file, or library.
12
+
13
+ ## Output — one file per requirement domain
14
+
15
+ Emit `.devrites/work/<slug>/checklists/<domain>.md`, one per domain the spec actually covers (skip
16
+ a domain the spec marks "none"). The domains mirror the interview taxonomy, so a gap here maps to a
17
+ `devrites-interview` dimension:
18
+
19
+ | Domain file | Tests the prose of |
20
+ |---|---|
21
+ | `functional.md` | Functional requirements + scenarios — is each capability stated, bounded, testable? |
22
+ | `data-model.md` | Key entities / data model — shapes, fields, lifecycle, relationships (skip if "none"). |
23
+ | `interaction.md` | API / UI impact + UX states — every screen state and contract named (skip if no UI/API). |
24
+ | `non-functional.md` | Constraints, auth / data sensitivity, latency / scale / compatibility budgets. |
25
+ | `edge-cases.md` | Empty / boundary / invalid / concurrent / failure paths the requirements imply. |
26
+
27
+ ## Each item — a question, a verdict, the line it interrogates
28
+
29
+ ```markdown
30
+ # Spec checklist: <domain> — <slug>
31
+ Scored: <iso> Verdict: pass | gaps (<n CRITICAL / n minor>)
32
+
33
+ | # | Question (tests the requirement prose) | Verdict | Spec line | Severity |
34
+ |---|---|---|---|---|
35
+ | 1 | Is every quantitative qualifier ("prominent", "fast", "large") given a number or reference? | fail | "banner is prominent" | **CRITICAL** |
36
+ | 2 | Does each requirement name an observable outcome a test could check? | pass | FR-001..004 | — |
37
+ | 3 | Are all enumerations closed — no "etc." / "and so on" / open "…"? | pass | — | — |
38
+ ```
39
+
40
+ Verdict is `pass` / `fail` / `n/a`. A `fail` carries a severity:
41
+ - **CRITICAL** — the ambiguity would change the build or its acceptance: an unquantified
42
+ acceptance/success criterion, an incomplete enumeration in a requirement, an ambiguous data
43
+ shape, an undefined edge case on a stated flow, a contradictory pair of requirements.
44
+ - **minor** — vague but non-load-bearing prose. Record it; it does not block.
45
+
46
+ ## The question bank (seed — extend per domain)
47
+
48
+ Each question tests one of the failure modes of requirement prose:
49
+ - **Measurability** — every "good / fast / prominent / simple / secure" carries a number, a budget,
50
+ or a named reference. No adjective stands in for a threshold.
51
+ - **Completeness** — every enumeration is closed (no "etc."); every requirement with a precondition
52
+ states the failure branch; every entity names its required fields + lifecycle; every stated flow
53
+ names its empty / error / boundary behaviour.
54
+ - **Clarity** — one entity, one name (no `user`/`customer`/`account` drift); no requirement two
55
+ readers would implement differently; no "should" where "MUST" is meant.
56
+ - **Testability** — each acceptance criterion is binary and names (or clearly implies) its evidence.
57
+ A criterion only provable by reading code is a fail.
58
+ - **Consistency** — no requirement contradicts another, the data model, or a non-goal.
59
+
60
+ ## How it feeds the readiness gate
61
+
62
+ The spec **Readiness gate** (bottom of [`spec-template.md`](spec-template.md)) folds these in: every
63
+ emitted `checklists/<domain>.md` must reach `Verdict: pass` (zero CRITICAL fails) before the gate
64
+ passes. Minor fails are logged, not blocking. A single open CRITICAL keeps the spec `Status: Draft`.
65
+ `/rite-define` reads the checklists at its step 0 and **hard-blocks while any CRITICAL is unchecked**;
66
+ a spec that skips the checklists is treated as not-yet-scored — define stops and routes back here.
67
+
68
+ ## Discipline
69
+ - Score honestly. A checklist you pass by softening the *question* instead of the *spec* is the
70
+ spec-quality version of weakening a test to go green — it defeats the gate.
71
+ - Don't pad. Five real questions that find one CRITICAL beat thirty rubber-stamped rows.
72
+ - These are *English* tests. The moment a question needs a function name to answer, it belongs in
73
+ `/rite-vet`'s `test-plan.md`, not here.
@@ -0,0 +1,124 @@
1
+ # `spec.md` template
2
+
3
+ Write **what** to build and **why** — never **how** (implementation goes in `plan.md`,
4
+ written later by `/rite-define`). Ground every section in the codebase you investigated;
5
+ don't invent files, commands, or conventions.
6
+
7
+ **Two hard rules:**
8
+ 1. **Mark every unknown** with `[NEEDS CLARIFICATION: the exact question]` instead of
9
+ guessing. Open markers block `/rite-define` and `/rite-build` (no silent assumptions).
10
+ 2. **No implementation details** in the spec — no tech/library/endpoint choices in the
11
+ requirements or success criteria. Those are technology-agnostic.
12
+
13
+ ```markdown
14
+ # Spec: <Feature>
15
+ Slug: <kebab-case> Created: <date> Status: Draft | Ready
16
+
17
+ ## Objective
18
+ One paragraph: what this delivers and the value. WHAT + WHY, not HOW.
19
+
20
+ ## Users / actors
21
+ Who uses it and the goal each has.
22
+
23
+ ## Problem statement
24
+ What's broken/missing today; what users do instead.
25
+
26
+ ## User scenarios *(prioritized, each independently testable)*
27
+ Order by importance; each scenario should be shippable + verifiable on its own → it
28
+ becomes a build slice. Use Given/When/Then.
29
+ - **P1** — Given <state>, When <action>, Then <observable outcome>.
30
+ - **P2** — Given <state>, When <action>, Then <observable outcome>.
31
+ - **P3** — ...
32
+
33
+ ## Functional requirements *(testable, unambiguous)*
34
+ Number them so tasks and the seal can reference them.
35
+ - **FR-001**: The system MUST <capability>.
36
+ - **FR-002**: The system MUST <capability>.
37
+ - **FR-003**: The system MUST NOT <prohibited behavior>.
38
+ (Mark gaps: "FR-004: [NEEDS CLARIFICATION: is export CSV-only or also XLSX?]")
39
+
40
+ ## Key entities / data model *(if data is involved, else "none")*
41
+ Entities, key fields, relationships, lifecycle (created/updated/soft-deleted). No DB
42
+ schema here — that's the plan.
43
+
44
+ ## API / UI impact *(else "none")*
45
+ Endpoints + contracts (shape, status, errors) at the WHAT level; screens + the states
46
+ each must handle (default/loading/empty/error/success/disabled).
47
+
48
+ ## Design references *(if the human supplied any, else "none")*
49
+ The screenshots / mockups / Figma / video / links that define the target look & behavior,
50
+ from references.md. Name what each shows and which scenarios it governs.
51
+ - R1 — references/<file> or <url> — <what it shows> → governs <scenario/FR>
52
+
53
+ ## UX/UI design brief *(if the feature touches UI, else "n/a")*
54
+ When UI is involved, `devrites-ux-shape` writes the feature-level **`design-brief.md`** here
55
+ (design direction, key states, interaction model, visual-direction probe) — the target
56
+ `/rite-build` builds to. Summarize its direction in one line; the full brief lives in
57
+ `design-brief.md`.
58
+ - Direction: <color strategy> · "<scene sentence>" · anchors: <ref A, ref B>
59
+
60
+ ## Success criteria *(measurable AND technology-agnostic)*
61
+ Observable outcomes that mean "this worked". Numbers where possible. No tech names.
62
+ - Good: "A user exports 10k rows and receives a complete file in under 5s."
63
+ - Good (UI): "The list view matches reference R1 at 1280px and 375px."
64
+ - Bad: "The /export Sidekiq job uses streaming CSV." (that's HOW — belongs in plan)
65
+
66
+ ## Acceptance criteria
67
+ Binary, evidence-backed checklist; each maps to a scenario/FR. See acceptance-criteria.md.
68
+ - [ ] <criterion> (FR-00x)
69
+
70
+ ## Non-goals
71
+ Explicitly out of scope for this version.
72
+
73
+ ## Constraints
74
+ Tech/time/compatibility/perf/security/compliance constraints that bound the solution.
75
+
76
+ ## Placement & integration *(where it lives — from investigation.md)*
77
+ So the work is **correctly placed to be used**, not bolted on:
78
+ - **Owns / lives in**: the module / layer / file / component that should hold this, + the
79
+ right seam.
80
+ - **Reuse / extend**: existing patterns, components, utilities to build on — not duplicate.
81
+ - **Integration points**: callers & dependents; data read/written; APIs / events /
82
+ contracts touched (how it interacts with the rest of the system).
83
+ - **Affected areas**: the real modules / routes / models / components this change touches.
84
+ - **Blast radius**: what could break (from the code-graph impact / callers).
85
+
86
+ ## Commands discovered
87
+ - Tests: <cmd> Build/typecheck: <cmd> Lint: <cmd> Run/dev: <cmd>
88
+ (From package scripts / Makefile / Gemfile / pyproject / go.mod / CI.)
89
+
90
+ ## Test strategy
91
+ What proves each acceptance criterion (unit/integration/e2e/manual).
92
+
93
+ ## Browser proof strategy *(if UI, else "n/a")*
94
+ Which proof-ladder rung, which routes/viewports, and which design references to verify against.
95
+
96
+ ## Risks
97
+ Ranked. Include migration / data / security / UX risks.
98
+
99
+ ## Gaps, issues & decisions *(drive the open count toward zero before /rite-define)*
100
+ Every material gap/issue found in investigation, the options offered to the user, and the
101
+ outcome. Resolved here = not rediscovered as drift later.
102
+ | Item | Type (gap / issue / conflict) | Options offered | Decision (owner) | Status |
103
+ |------|------------------------------|-----------------|------------------|--------|
104
+ | <e.g. token scope> | gap | per-user / per-session / follow-up | per-session (user) | resolved |
105
+
106
+ ## Open questions *( [NEEDS CLARIFICATION] register )*
107
+ List every open marker; blocking ones must be zero at the gate.
108
+
109
+ ## Boundaries
110
+ - **Always do**: conventions to follow without asking.
111
+ - **Ask first**: new deps, second design system, schema/migration, auth changes, scope expansion.
112
+ - **Never do**: destructive ops, drive-by refactors, unrelated cleanup.
113
+
114
+ ## Readiness gate *(must pass before /rite-define plans it)*
115
+ - [ ] No blocking `[NEEDS CLARIFICATION]` markers remain (deferred ones are non-blocking)
116
+ - [ ] **Placement decided** — where it lives + integration points are known
117
+ - [ ] All material gaps/issues have a recorded decision
118
+ - [ ] **Every spec dimension resolved or explicitly deferred** — objective · scope · data model · UX · integration · non-functional · acceptance (see question-protocol.md "Coverage gate")
119
+ - [ ] Design references gathered + saved (if the human supplied any)
120
+ - [ ] **UX/UI shaped into `design-brief.md`** (if the feature touches UI) — direction, key states, interaction model decided
121
+ - [ ] Requirements are testable and unambiguous
122
+ - [ ] Success criteria are measurable and technology-agnostic
123
+ - [ ] **Spec-quality checklists pass** — every `checklists/<domain>.md` reaches `Verdict: pass` (zero CRITICAL "unit-tests-for-English" fails; see [spec-checklists.md](spec-checklists.md))
124
+ ```