crewforth 0.0.1 → 3.0.0-rc.1

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 (168) hide show
  1. package/CHANGELOG.md +3784 -0
  2. package/LICENSE +21 -0
  3. package/README.md +37 -7
  4. package/VERSION +1 -0
  5. package/adopt.sh +1670 -0
  6. package/bin/cli.js +497 -0
  7. package/kit/AGENT_TEMPLATE.md +92 -0
  8. package/kit/CLAUDE.md +228 -0
  9. package/kit/README.md +107 -0
  10. package/kit/agents/crew-backend-expert.md +95 -0
  11. package/kit/agents/crew-commit-agent.md +96 -0
  12. package/kit/agents/crew-database-expert.md +84 -0
  13. package/kit/agents/crew-devops-expert.md +82 -0
  14. package/kit/agents/crew-frontend-expert.md +85 -0
  15. package/kit/agents/crew-performance-expert.md +78 -0
  16. package/kit/agents/crew-planner.md +60 -0
  17. package/kit/agents/crew-privacy-agent.md +71 -0
  18. package/kit/agents/crew-review-agent.md +95 -0
  19. package/kit/agents/crew-security-expert.md +73 -0
  20. package/kit/agents/crew-session-manager.md +77 -0
  21. package/kit/agents/crew-test-expert.md +64 -0
  22. package/kit/eval/doctor.sh +465 -0
  23. package/kit/eval/gate-report.sh +137 -0
  24. package/kit/eval/golden-holdout.txt +53 -0
  25. package/kit/eval/golden-routing.txt +199 -0
  26. package/kit/eval/lib/crew-env.sh +14 -0
  27. package/kit/eval/lib/settings-json.awk +154 -0
  28. package/kit/eval/lib/star.sh +70 -0
  29. package/kit/eval/parser-conformance.sh +612 -0
  30. package/kit/eval/preflight.sh +186 -0
  31. package/kit/eval/routing-eval.sh +209 -0
  32. package/kit/eval/scan-skill.sh +162 -0
  33. package/kit/eval/smoke-test.sh +6693 -0
  34. package/kit/eval/update-guard.sh +81 -0
  35. package/kit/eval/utilization.sh +130 -0
  36. package/kit/hooks/board-sync.sh +106 -0
  37. package/kit/hooks/board.sh +962 -0
  38. package/kit/hooks/commit-msg +49 -0
  39. package/kit/hooks/context-usage.sh +353 -0
  40. package/kit/hooks/floor-blocklist.txt +124 -0
  41. package/kit/hooks/guard-bash.sh +1431 -0
  42. package/kit/hooks/guard-commit-scan.sh +511 -0
  43. package/kit/hooks/guard-write.sh +513 -0
  44. package/kit/hooks/pre-commit +577 -0
  45. package/kit/hooks/route-hint.sh +185 -0
  46. package/kit/hooks/secret-blocklist.txt +82 -0
  47. package/kit/hooks/session-guard.sh +149 -0
  48. package/kit/hooks/session-rehydrate.sh +41 -0
  49. package/kit/hooks/session-stats.sh +252 -0
  50. package/kit/hooks/session-update-check.sh +236 -0
  51. package/kit/hooks/skill-trust.sh +150 -0
  52. package/kit/hooks/trace-blocklist.txt +53 -0
  53. package/kit/settings.json +132 -0
  54. package/kit/skills/a11y/SKILL.md +44 -0
  55. package/kit/skills/adr/SKILL.md +74 -0
  56. package/kit/skills/api-design/SKILL.md +50 -0
  57. package/kit/skills/automode-policy/SKILL.md +91 -0
  58. package/kit/skills/automode-policy/references/policy.json +13 -0
  59. package/kit/skills/automode-policy/scripts/apply.sh +84 -0
  60. package/kit/skills/automode-policy/scripts/check.sh +102 -0
  61. package/kit/skills/backend-architecture/SKILL.md +103 -0
  62. package/kit/skills/brainstorm/SKILL.md +47 -0
  63. package/kit/skills/ci-pipeline/SKILL.md +38 -0
  64. package/kit/skills/commit-message/SKILL.md +82 -0
  65. package/kit/skills/commit-message/references/examples.md +8 -0
  66. package/kit/skills/confidence-check/SKILL.md +86 -0
  67. package/kit/skills/crew-board/SKILL.md +55 -0
  68. package/kit/skills/crew-brainstorm/SKILL.md +19 -0
  69. package/kit/skills/crew-code-review/SKILL.md +151 -0
  70. package/kit/skills/crew-code-review/references/history-search.md +19 -0
  71. package/kit/skills/crew-code-review/references/panel-mode.md +32 -0
  72. package/kit/skills/crew-code-review/references/receiving.md +23 -0
  73. package/kit/skills/crew-doctor/SKILL.md +36 -0
  74. package/kit/skills/crew-gates/SKILL.md +25 -0
  75. package/kit/skills/crew-handoff/SKILL.md +14 -0
  76. package/kit/skills/crew-plan/SKILL.md +18 -0
  77. package/kit/skills/crew-review/SKILL.md +23 -0
  78. package/kit/skills/crew-ship/SKILL.md +19 -0
  79. package/kit/skills/crew-skill/SKILL.md +61 -0
  80. package/kit/skills/crew-studio/SKILL.md +129 -0
  81. package/kit/skills/crew-update/SKILL.md +43 -0
  82. package/kit/skills/db-migration/SKILL.md +120 -0
  83. package/kit/skills/db-migration/references/backup-restore.md +33 -0
  84. package/kit/skills/db-migration/references/raw-sql.md +30 -0
  85. package/kit/skills/db-migration/references/tool-matrix.md +35 -0
  86. package/kit/skills/dependency-audit/SKILL.md +61 -0
  87. package/kit/skills/dependency-upgrade/SKILL.md +82 -0
  88. package/kit/skills/deploy/SKILL.md +100 -0
  89. package/kit/skills/deploy/references/proxy-ssl.md +56 -0
  90. package/kit/skills/deploy/references/rollback.md +18 -0
  91. package/kit/skills/deploy/references/scripts.md +9 -0
  92. package/kit/skills/deploy/references/topology-a.md +128 -0
  93. package/kit/skills/deploy/references/topology-b.md +44 -0
  94. package/kit/skills/docs-writer/SKILL.md +53 -0
  95. package/kit/skills/docs-writer/references/coauthoring.md +34 -0
  96. package/kit/skills/eval-grader/SKILL.md +75 -0
  97. package/kit/skills/eval-grader/references/method.md +51 -0
  98. package/kit/skills/frontend/SKILL.md +56 -0
  99. package/kit/skills/frontend/references/verify-contract.md +41 -0
  100. package/kit/skills/frontend-design/SKILL.md +71 -0
  101. package/kit/skills/frontend-design/references/design-review.md +34 -0
  102. package/kit/skills/frontend-rn-expo/SKILL.md +25 -0
  103. package/kit/skills/handoff/SKILL.md +71 -0
  104. package/kit/skills/handoff/references/cold-reader.md +51 -0
  105. package/kit/skills/i18n-integrity/SKILL.md +31 -0
  106. package/kit/skills/incident-runbook/SKILL.md +40 -0
  107. package/kit/skills/incident-runbook/references/postmortem.md +16 -0
  108. package/kit/skills/iterate/SKILL.md +40 -0
  109. package/kit/skills/mcp-builder/SKILL.md +54 -0
  110. package/kit/skills/mcp-builder/references/building.md +71 -0
  111. package/kit/skills/observability/SKILL.md +50 -0
  112. package/kit/skills/performance/SKILL.md +38 -0
  113. package/kit/skills/performance/references/bottlenecks.md +10 -0
  114. package/kit/skills/privacy-compliance/SKILL.md +75 -0
  115. package/kit/skills/red-team/SKILL.md +48 -0
  116. package/kit/skills/reflect/SKILL.md +57 -0
  117. package/kit/skills/release/SKILL.md +44 -0
  118. package/kit/skills/security-scan/SKILL.md +99 -0
  119. package/kit/skills/security-scan/references/ai-agents.md +107 -0
  120. package/kit/skills/security-scan/references/fronts.md +99 -0
  121. package/kit/skills/security-scan/references/prompting.md +23 -0
  122. package/kit/skills/security-scan/references/reporting.md +75 -0
  123. package/kit/skills/security-scan/references/verify.md +131 -0
  124. package/kit/skills/sonarqube-check/SKILL.md +108 -0
  125. package/kit/skills/sonarqube-check/references/local-engines.md +32 -0
  126. package/kit/skills/sonarqube-check/references/stand-up-server.md +25 -0
  127. package/kit/skills/spec-planning/SKILL.md +92 -0
  128. package/kit/skills/systematic-debugging/SKILL.md +57 -0
  129. package/kit/skills/systematic-debugging/references/techniques.md +44 -0
  130. package/kit/skills/teamboard/SKILL.md +88 -0
  131. package/kit/skills/teamboard/references/setup.md +37 -0
  132. package/kit/skills/testing/SKILL.md +49 -0
  133. package/kit/skills/testing/references/flaky-triage.md +51 -0
  134. package/kit/skills/threat-model/SKILL.md +57 -0
  135. package/kit/skills/threat-model/references/interview.md +51 -0
  136. package/kit/skills/threat-model/references/schema.md +42 -0
  137. package/kit/skills/token-budget/SKILL.md +51 -0
  138. package/kit/skills/trace-scan/SKILL.md +43 -0
  139. package/kit/skills/worktree/SKILL.md +40 -0
  140. package/kit/studio/README.md +266 -0
  141. package/kit/studio/ensure-node.sh +471 -0
  142. package/kit/studio/package.json +14 -0
  143. package/kit/studio/server/hooks/studio-gate.sh +169 -0
  144. package/kit/studio/server/index.js +902 -0
  145. package/kit/studio/server/lib/crew-env.js +11 -0
  146. package/kit/studio/server/lib/fleet.js +146 -0
  147. package/kit/studio/server/lib/graph.js +533 -0
  148. package/kit/studio/server/lib/instance.js +135 -0
  149. package/kit/studio/server/lib/kit-telemetry.js +182 -0
  150. package/kit/studio/server/lib/kit.js +158 -0
  151. package/kit/studio/server/lib/palette.js +118 -0
  152. package/kit/studio/server/lib/peers.js +72 -0
  153. package/kit/studio/server/lib/permissions.js +150 -0
  154. package/kit/studio/server/lib/projects.js +294 -0
  155. package/kit/studio/server/lib/roster.js +191 -0
  156. package/kit/studio/server/lib/session.js +309 -0
  157. package/kit/studio/server/lib/terminal.js +91 -0
  158. package/kit/studio/server/lib/transcript.js +100 -0
  159. package/kit/studio/web/app.js +1098 -0
  160. package/kit/studio/web/canvas.js +1179 -0
  161. package/kit/studio/web/chat.js +543 -0
  162. package/kit/studio/web/index.html +86 -0
  163. package/kit/studio/web/md.js +110 -0
  164. package/kit/studio/web/storage-migrate.js +23 -0
  165. package/kit/studio/web/style.css +1453 -0
  166. package/package.json +46 -8
  167. package/start.sh +748 -0
  168. package/bin/crewforth.js +0 -10
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: eval-grader
3
+ description: |
4
+ Measure output quality, don't vibe it: score a generative task with a two-layer grader — deterministic code
5
+ metrics + per-dimension LLM-as-judge — over a fixed task set, as signed deltas vs a pinned baseline. Grades
6
+ cost alongside correctness (pass-slow).
7
+ ---
8
+
9
+ # Eval Grader
10
+
11
+ <!-- routing-eval reads the next line; why it sits in the body: AGENT_TEMPLATE.md -->
12
+ Trigger phrases: "eval", "grader", "measure output quality", "LLM-as-judge", "score the output"
13
+
14
+ **Measure every change; don't vibe it.** When you iterate on a prompt, an agent, or any generative output (docs,
15
+ slides, UI, a summary, an extraction), a two-layer grader over a fixed task set turns "feels better" into a signed
16
+ number you can trust.
17
+
18
+ This is the **external, machine-grounded verifier** the `iterate` skill asks for — a model grading its *own* output
19
+ inflates; a separate grader on a fixed suite does not.
20
+
21
+ > **Crewforth adaptation (local, .claude/):** use when tuning a generative task; the scorecard goes to `docs/EVAL.md`
22
+ > (§4.3). Stack-agnostic — graders are ordinary code + judge calls. §4 Prohibitions apply.
23
+
24
+ ## Two layers
25
+ - **Layer 1 — code graders** (deterministic, near-free, run every time): structural metrics over the artifact —
26
+ *did it produce a valid result?* plus counts, sizes, schema validity, "wall-of-text" / clutter flags. They catch
27
+ gross regressions a judge shouldn't be spent on. Ground truth is **computed from the source**, not hand-authored.
28
+ - **Layer 2 — LLM-as-judge graders** (semantic): **one call per dimension** (clarity · correctness-vs-source ·
29
+ completeness…), scored on an explicit rubric. Steer against leniency — "use the full 0-5 range, not only 3-5";
30
+ judge with a **different model family** to avoid self-preference; **randomize A/B order** to kill position bias.
31
+
32
+ Each grader is one **scorecard column**; adding a metric = appending one grader.
33
+
34
+ ## pass-slow — grade cost alongside correctness
35
+ A result is not just right/wrong. An **efficiency grader** downgrades a correct output that ran **over a
36
+ turn/token budget** to `pass-slow` — so "correct but too expensive" is visible, not hidden inside a green pass.
37
+
38
+ ## The loop
39
+ 1. A **fixed task set** (`tasks`), each with an input and a measurable expectation.
40
+ 2. Run all graders over each task's output → a scorecard.
41
+ 3. **Pin a baseline** once; every later run shows **signed deltas vs that baseline**, not vs the previous run — so
42
+ re-running the same round shows real movement, not noise.
43
+ 4. Change one thing, re-run, read the deltas. Keep what moves the number up.
44
+
45
+ ## Noise floor
46
+ State it. At n=20 tasks, one task ≈ 5 points — deltas smaller than that are not meaningful. If the cheapest option
47
+ already hits the ceiling, say so plainly instead of chasing a fractional gain.
48
+
49
+ ## Micro-test before you commit to a wording
50
+ Changing an instruction — a skill's phrasing, a rule in the discipline, an agent's trigger — is a change to
51
+ behaviour, and the temptation is to reason about whether it reads better. Reading better and working better are
52
+ different properties. Test it cheaply first:
53
+
54
+ 1. **Sample it a handful of times**, not once. Same prompt, same conditions.
55
+ 2. **Against a no-guidance control** — the identical task with the instruction absent. Without the control you
56
+ learn what the model does, not what your wording adds.
57
+ 3. **Read every result by hand.** At this size there is no statistic to hide behind; a score computed over four
58
+ runs is a number pretending to be evidence.
59
+ 4. **Treat run-to-run variance as a warning, not noise to average away.** If the same arm swings across runs,
60
+ the wording is not doing reliable work — and any delta you measure is smaller than the variance you have not
61
+ controlled.
62
+
63
+ The failure this prevents, observed in Crewforth's own evals: a case scored 7/9 against 9/9 — the guidance apparently making
64
+ things *worse* — and an identical second round came back 9/9 to 9/9. Two checks of variance inverted the
65
+ finding. Had the first round been reported, a good rule would have been removed on noise.
66
+
67
+ Corollary: a delta smaller than the observed spread between identical runs is not a result. Say "below the
68
+ noise floor" and either raise n or accept that the change is unmeasurable at this scale — both are honest;
69
+ quoting the number is not.
70
+
71
+ The grader architecture, a starter grader catalogue, and the judge-bias checklist live in **`references/method.md`**.
72
+
73
+ ## DoD
74
+ - A fixed task set + a two-layer grader; a pinned baseline; every change reported as a signed delta with the noise floor stated.
75
+ - Any wording change was micro-tested against a no-guidance control, with every run read rather than averaged.
@@ -0,0 +1,51 @@
1
+ # Eval grader — architecture & catalogue
2
+
3
+ ## Shape
4
+ A **declarative list of graders**; the harness stays grader-agnostic. One grader:
5
+
6
+ ```
7
+ { name, kind: "code" | "judge", description,
8
+ grade(context) -> number | string,
9
+ scale?: { min, max, good: "high" | "low" } }
10
+ ```
11
+ - `scale.good` drives red→yellow→green heat-coloring of a cell (so a scorecard is scannable).
12
+ - Build a **`GraderContext` once per task** (the parsed artifact + a rendered form + any client), and pass it to
13
+ every grader — graders are pure functions of the context.
14
+
15
+ ## Layer 1 — code graders (deterministic; adapt to your artifact)
16
+ - `produced` → `ok` / `missing` / `invalid` — did it produce a valid artifact at all? The cheapest, first gate.
17
+ - structural counts (sections · items · length), `too_long` / `cluttered` flags (`good: "low"`), schema validity.
18
+ - **Compute expected values from the seed/source, not by hand** — reproducible, and it catches "right narrative,
19
+ wrong number" (a `numeric_tolerance` grader with a `must_mention` guard).
20
+
21
+ ## Layer 2 — judge graders (semantic)
22
+ - **One call per dimension** (clarity, correctness-vs-source, completeness, tone…), integer **0-5** on an explicit
23
+ rubric. Do **not** blend dimensions into one holistic score.
24
+ - **Structured output** (a typed schema) so the score lands parsed, not regex'd; retry on schema mismatch.
25
+ - **Memoize shared judge calls**: if four dimensions read the same rendered output, make **one** batched call and
26
+ read four fields from it — not four calls.
27
+ - Add an **anti-hallucination** dimension: does the output say "I don't know / the source doesn't cover this"
28
+ rather than inventing? Reward the honest gap.
29
+
30
+ ## Judge-bias checklist (an LLM judge is biased — correct for it)
31
+ - **Position bias** → randomize A/B order across calls.
32
+ - **Verbosity bias** → a longer answer is not a better one; rubric on substance.
33
+ - **Self-preference** → judge with a **different model family** than the one under test.
34
+ - **Label deference** → don't show the judge the "expected" answer as gospel; ask it to reason first.
35
+ - Calibrate against a few human labels; test the judge on **known-negatives** (does it catch a deliberately-bad output?).
36
+
37
+ ## The measured-iteration loop
38
+ - Pin the baseline once (`baseline.score.json`); later runs print **signed deltas vs the baseline**, not vs the
39
+ previous run.
40
+ - One task's failure must not abort the scorecard (grade each independently, collect all results).
41
+ - A run over the whole suite is **one command**. If you want a structural regression to *block*, wire the Layer-1
42
+ code graders into a Stop / PostToolUse hook (they're deterministic and fast — a natural gate).
43
+
44
+ ## pass-slow / efficiency grader
45
+ Wrap a correctness grader: if it passes but `turns > budget_turns` or `tokens_out > budget`, return **`pass-slow`**
46
+ instead of `pass`. Score = (pass + ½·pass-slow) / N — "correct but too expensive" is a distinct, visible verdict.
47
+
48
+ ## Cost/quality sweep (optional — picking a model/params for a task)
49
+ Sweep the grid (model × thinking × effort), hold everything else constant, and rank on
50
+ `cost_per_success = total_cost / passes` and `seconds_per_success` — a model 3× cheaper per call but passing half as
51
+ often is **not** cheaper. Always state the noise floor next to the winner.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: frontend
3
+ description: |
4
+ Stack-agnostic frontend discipline (web · mobile · desktop): component structure, state, data fetching,
5
+ loading/empty/error states, i18n, accessibility, performance. crew-frontend-expert applies it on every stack.
6
+ ---
7
+
8
+ # Frontend Discipline (stack-agnostic)
9
+
10
+ <!-- routing-eval reads the next line; why it sits in the body: AGENT_TEMPLATE.md -->
11
+ Trigger phrases: "frontend", "screen size", "component", "page", "UI", "state management", "interface"
12
+
13
+ Web (React/Next/Vue/Svelte/Angular), mobile (React Native/Flutter) or desktop — shared principles.
14
+ The stack-specific "how" (native bridge, router choice, etc.) lives in the relevant project skill; this skill applies to all of them.
15
+
16
+ ## Architecture
17
+ - **Presentation / logic separation:** component/view is pure and thin; business logic lives in the hook/composable/service layer.
18
+ - **Reusability:** repeated UI is factored out; the prop contract is clear and typed.
19
+ - **Folder:** feature-based (`features/<name>/`) — view, logic, and test together.
20
+
21
+ ## State & data
22
+ - **Local state first** (`useState`/signal); if global is needed, the project's choice (store/context) — nothing imposed.
23
+ - **Data fetching:** cache + error + loading states are considered; race/abort are handled.
24
+
25
+ ## State-complete UI (design it from the start)
26
+ Every data-bound view covers **four states**: **loading · empty · error · full**.
27
+ Don't code only the "full" case; empty/error/loading are part of the experience.
28
+
29
+ ## i18n & accessibility (default, not decoration)
30
+ - User-visible text comes from the language file (project languages); no hard-coded strings (`i18n-integrity`).
31
+ - Meaningful labels/roles, sufficient contrast, keyboard/screen-reader access, appropriate touch/click target.
32
+
33
+ ## Visual & UX quality
34
+ This skill covers *structure*; the **visual/UX design layer** — hierarchy, spacing rhythm, typographic scale, a
35
+ restrained color system, and polished states — lives in **`frontend-design`**. Apply it when the work is about how the
36
+ interface *looks and feels*, not just how it's wired.
37
+
38
+ ## Responsive & performance
39
+ - Works across the target screen/device matrix (responsive/adaptive).
40
+ - Unnecessary renders (memo/callback), bundle size, lazy loading, virtualization for long lists.
41
+
42
+ ## Verify at runtime (contract)
43
+ Prove a change works by **observing the running UI**, structured — not by interpreting a screenshot. Have components
44
+ emit `data-verify-*` state attributes, register verifiable units with fixtures + invariants (≥1 adversarial `probe`
45
+ each), expose `window.__verify`, and adopt the `PASS/FAIL/BLOCKED/SKIP` taxonomy (when in doubt, FAIL). Then drive
46
+ the browser to check it. The full convention: **`references/verify-contract.md`**.
47
+
48
+ ## DoD (this skill's contribution)
49
+ - `/simplify`; no dead styles/unused props.
50
+ - The four states are covered; `i18n-integrity` clean; accessibility passes the baseline matrix.
51
+ - `crew-review-agent` clean.
52
+
53
+ ## Constraints
54
+ - Surgical change; follow existing conventions, do not impose a stack/preference.
55
+ - Do not present data the platform does not provide as if it existed; do not promise a capability that isn't there.
56
+ - §4 applies: no AI trace or vendor template name in code/comments/strings.
@@ -0,0 +1,41 @@
1
+ # Verify-by-contract — make the UI machine-checkable at runtime
2
+
3
+ Tests and typecheck are CI's job. **Verification is runtime observation at the surface:** you run the thing, drive
4
+ it, and read what it actually shows. Make that observation *structured and cheap* — so an agent (via the browser),
5
+ CI, and a human dashboard all read the **same truth through one code path** — instead of interpreting screenshots.
6
+
7
+ ## 1 · The DOM is the machine-readable surface
8
+ Every component emits `data-verify-*` attributes describing its **state**, not its internals:
9
+ ```html
10
+ <section data-verify-unit="TodoApp" data-verify-total="3" data-verify-done="1" data-verify-active="2">
11
+ ```
12
+ Verifiers read the **contract**, never React/Vue internals — so you can rewrite internals freely as long as the
13
+ contract holds. A component with **no contract is a FAIL, not a warning**.
14
+
15
+ ## 2 · Verifiable units: fixtures + invariants + a schema
16
+ Register each unit with: a props schema, named **fixtures** (a reproducible render config, with an optional
17
+ imperative `act()` to click/type/wait), and **invariants** (a predicate over the mounted DOM → `true` or a
18
+ human-readable violation).
19
+ - **Every unit needs ≥1 `probe` fixture** — an adversarial edge case (empty, huge, inconsistent). Enforce it: "you
20
+ can't ship a unit that only tests the happy path."
21
+ - Keep **one fixture that is *designed to fail*** — it proves the framework catches lies, not just confirms truths.
22
+
23
+ ## 3 · Isolated, deep-linkable render targets
24
+ `/verify/:unit/:fixture` mounts **only** that unit in a known state, no app shell (`?chrome=0` for a clean
25
+ screenshot). An agent navigates there, observes, reads the result — no scrolling the whole app.
26
+
27
+ ## 4 · One agent handle, one verdict taxonomy
28
+ Expose `window.__verify`: `manifest()` (every unit × fixture × verifier), `current()` (structured result for what's
29
+ mounted), `runAll()` (the full matrix). The dashboard is just a human rendering of the same data; CI calls the same
30
+ runner.
31
+
32
+ Verdicts: **`PASS` · `FAIL` · `BLOCKED` · `SKIP`**; checks: `ok / fail / warn / probe`.
33
+ - **`BLOCKED` ("couldn't observe") is deliberately distinct from `FAIL` ("observed and wrong").**
34
+ - Rule: **when in doubt, FAIL** — a false PASS ships a bug; a false FAIL costs one more look.
35
+ - A verifier exception becomes a `fail` check with the stack as evidence — never swallowed.
36
+
37
+ ## 5 · How Crewforth drives it
38
+ A frontend change is verified by driving the browser (the `claude-in-chrome` tools) to the isolated target and
39
+ calling `window.__verify.runAll()`, then reading the **structured verdicts** — closing the "did my change actually
40
+ work at runtime" loop without a human eyeballing pixels. This is the frontend counterpart to `iterate`'s external,
41
+ machine-grounded verifier and `eval-grader`'s scorecard.
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: frontend-design
3
+ description: |
4
+ Visual and UX design quality for interfaces: hierarchy, spacing rhythm, typographic scale, a restrained color
5
+ system, layout composition, and polished states. The taste layer above frontend architecture and a11y.
6
+ ---
7
+
8
+ # Frontend Design (visual & UX quality)
9
+
10
+ <!-- routing-eval reads the next line; why it sits in the body: AGENT_TEMPLATE.md -->
11
+ Trigger phrases: "visual design", "design system", "make it look good", "UI polish", "page layout", "the layout is", "spacing", "typography"
12
+
13
+ `frontend` decides how the code is structured; `a11y` decides whether everyone can use it; **this skill decides
14
+ whether it looks considered and feels right.** The through-line: **a few consistent decisions, applied everywhere,
15
+ read as "designed" — many one-off decisions read as "assembled".** Design is subtraction and rhythm, not adding flourish.
16
+
17
+ > **Crewforth adaptation (local, .claude/):** Stack-agnostic. **Detect and respect the project's existing design system**
18
+ > (tokens, component library, brand) — never impose a personal aesthetic or a new library. Accessibility is a floor,
19
+ > not a trade-off: apply `a11y` alongside (contrast, focus, motion). §4 Prohibitions apply.
20
+
21
+ ## The six levers (order = impact; fix hierarchy before you touch color)
22
+ 1. **Hierarchy** — the eye must land on the one primary thing first. Establish it with size, weight, and space — not with more color. One primary action per view; everything else is visibly secondary.
23
+ 2. **Spacing & rhythm** — consistent spacing from a single scale (e.g. 4/8px steps). Group related things with *less* space, separate groups with *more*. Whitespace is the cheapest way to look premium.
24
+ 3. **Typography** — one or two families, a small scale (≈4–6 steps), consistent line-height (~1.5 body). Limit weights. Measure ~45–75 chars per line. Type does most of the hierarchy work.
25
+ 4. **Color** — a restrained system: 1 brand/accent, a neutral ramp, semantic states (success/warn/error). Accent is for *action and emphasis*, not decoration. Verify contrast (→ `a11y`).
26
+ 5. **Layout & composition** — align to a grid; consistent alignment edges. Respect proximity/similarity (Gestalt). Responsive by *intent* (reflow, not just shrink); design the breakpoints, don't inherit them by accident.
27
+ 6. **State & polish** — design loading / empty / error / disabled / hover / focus as first-class, not afterthoughts. Motion is restrained and purposeful (~150–250ms, ease), and honors `prefers-reduced-motion`.
28
+
29
+ ## When the project gives no design direction
30
+ Look for the project's own system first: a token file, a theme, the components it already has. If there is one,
31
+ follow it; the list below only fills a gap. With none, do not fall into these defaults on your own (use one when
32
+ the user asks for it):
33
+ - a cream or off-white ground with serif headings and a terracotta accent
34
+ - a purple-to-blue gradient hero on white
35
+ - a black ground with a single neon accent
36
+ - an italic accent word in headings
37
+ - "01 / 02 / 03" section numbers that tell no real sequence
38
+ - monospace labels on everything
39
+ - pill buttons and the same shadow everywhere
40
+ - emoji as section markers
41
+ - cards with a colored stripe along one edge
42
+
43
+ "Avoid a generic look" alone swaps one default for another; naming the patterns is what works. After the first
44
+ result, look at which default crept in and add it to this list for the project — iterate, don't restart.
45
+
46
+ ## Checklist
47
+ - [ ] One clear primary action; hierarchy readable at a glance (squint test)
48
+ - [ ] All spacing from one scale; related grouped, groups separated
49
+ - [ ] Type scale limited and consistent; line length and line-height comfortable
50
+ - [ ] Color restrained; accent reserved for action; contrast passes (`a11y`)
51
+ - [ ] Aligned to a grid; responsive by intent with designed breakpoints
52
+ - [ ] Loading / empty / error / disabled states designed, not default
53
+ - [ ] Motion purposeful, reduced-motion honored
54
+ - [ ] Existing design tokens/system reused — nothing one-off invented
55
+
56
+ ---
57
+
58
+ ## Tokens, scales, and a heuristic design review
59
+ Spacing/type/color scale systems, turning ad-hoc values into tokens, dark-mode and density variants, and a
60
+ squint-test / heuristic-review pass to run before handing UI back: **`references/design-review.md`**.
61
+
62
+ ## Coordination
63
+ Architecture, state, and folder structure → `frontend`. Accessibility gate (contrast, focus, ARIA) → `a11y`.
64
+ Applied by **crew-frontend-expert** on any stack; the stack-specific "how" stays in the project's frontend skill.
65
+
66
+ ## Invariant rules
67
+ 1. **Hierarchy before decoration** — fix what the eye sees first before adding any color or flourish.
68
+ 2. **One scale per dimension** — spacing, type, and radius each come from a single defined scale.
69
+ 3. **Reuse the project's system** — detect existing tokens/components; never impose a new aesthetic or library.
70
+ 4. **Accessibility is a floor** — contrast, focus, and reduced-motion are non-negotiable, not a style trade-off.
71
+ 5. **Every state is designed** — loading/empty/error/disabled are part of the design, not defaults.
@@ -0,0 +1,34 @@
1
+ # Tokens, scales, and heuristic review
2
+
3
+ Loaded on demand. The SKILL.md levers are the method; this is the concrete scales and the review pass.
4
+
5
+ ## Scales — turn ad-hoc values into a system
6
+
7
+ **Spacing** — one base unit, multiples only. A 4px (or 8px) base: `4 · 8 · 12 · 16 · 24 · 32 · 48 · 64`. Every margin/padding/gap picks from this list — never `13px` because it "looked right". Consistency is what reads as designed.
8
+
9
+ **Type scale** — a small set of steps from a ratio (~1.2–1.25). Example: `12 · 14 · 16 · 20 · 24 · 32 · 40`. Body ~16, line-height ~1.5; headings tighter (~1.2). Limit weights to 2–3 (e.g. 400/600/700). One or two families max.
10
+
11
+ **Radius / border / shadow** — also scales, not one-offs: e.g. radius `4 · 8 · 16 · full`; elevation as 2–3 defined shadow steps. Consistent elevation communicates depth; random shadows look noisy.
12
+
13
+ **Color ramp** — a neutral scale (e.g. 50→900) plus one accent and semantic colors (success/warning/error/info), each with an on-color that meets contrast. Don't hand-pick greys per component; pull from the ramp.
14
+
15
+ ## Tokens — name the decisions
16
+
17
+ Once the scales exist, name them as tokens (CSS custom properties / theme object / design-token file) so a change is one edit, not fifty: `--space-4`, `--text-lg`, `--color-accent`, `--radius-md`. **First detect the project's existing token layer and extend it**; only introduce tokens where none exist, and match the project's naming. Semantic tokens (`--color-surface`, `--color-text-muted`) layer over primitive ones and make dark-mode/theming a token swap rather than a rewrite.
18
+
19
+ ## Dark mode & density
20
+
21
+ - **Dark mode** is not "invert" — it's a second set of semantic token values. Surfaces get lighter with elevation (not pure black); reduce saturation; re-check contrast in both themes.
22
+ - **Density** — if the product needs compact/comfortable modes, drive them from the spacing scale (a density multiplier), not per-component overrides.
23
+
24
+ ## The heuristic review pass (run before handing UI back)
25
+
26
+ - **Squint test** — blur your eyes (or literally squint): does the primary action still stand out? If everything is equally loud, hierarchy failed.
27
+ - **Grayscale test** — remove color: does it still communicate hierarchy and state? If it only works in color, you're leaning on color to do type/space's job (and it will fail for color-blind users).
28
+ - **Spacing audit** — are there any values not on the scale? Any inconsistent gaps between similar groups?
29
+ - **Alignment audit** — do elements share alignment edges, or is everything slightly off? One stray alignment reads as sloppy.
30
+ - **State sweep** — force loading, empty, error, disabled, long-text, and tiny/huge viewport. Each should look intentional.
31
+ - **Consistency sweep** — same button in two places identical? Same card padding everywhere? Divergence is the top "assembled, not designed" tell.
32
+ - **Restraint check** — can anything be *removed*? A border that a gap already implies, a color that space already separates, a shadow doing nothing. Subtraction usually improves it.
33
+
34
+ Report design findings the way `crew-review-agent` expects: concrete (element + which lever + the fix), not "make it prettier".
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: frontend-rn-expo
3
+ description: |
4
+ OPTIONAL, stack-specific: React Native + Expo (prebuild). Mobile RN projects only; the generic principles
5
+ live in the `frontend` skill.
6
+ ---
7
+
8
+ # React Native + Expo (stack-specific layer)
9
+
10
+ <!-- routing-eval reads the next line; why it sits in the body: AGENT_TEMPLATE.md -->
11
+ Trigger phrases: "expo", "react native", "native bridge", "expo router", "rn screen", "prebuild"
12
+
13
+ For generic frontend discipline, applies the `frontend` skill; this file only covers the RN+Expo-specific additions.
14
+ Not used in web/desktop projects (delete it if needed).
15
+
16
+ ## RN + Expo specifics
17
+ - **Navigation:** expo-router (file-based) or react-navigation — follow whichever the project uses.
18
+ - **Lists:** `FlatList`/`FlashList` + `keyExtractor`; virtualization for heavy lists.
19
+ - **Native bridge:** only when needed; the JS side is **typed**, error paths are explicit (what the UI does if native rejects).
20
+ Via Expo prebuild / config plugin; mind the platform difference (iOS/Android).
21
+ - **Render by capability:** do **not** promise in the UI a capability the device lacks; show it conditionally.
22
+ - **Assets:** image size/resolution, `expo-image` cache, splash/icon prebuild compatibility.
23
+
24
+ ## DoD (in addition to the generic `frontend` DoD)
25
+ - Works across the target iOS/Android version matrix; native bridge error paths are tested.
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: handoff
3
+ description: |
4
+ Session handover: when context fills, a phase closes, or the topic changes, write an action-oriented handover
5
+ to docs/SESSION_STATE.md, then recommend /clear.
6
+ ---
7
+
8
+ # Session Handover (Handoff)
9
+
10
+ <!-- routing-eval reads the next line; why it sits in the body: AGENT_TEMPLATE.md -->
11
+ Trigger phrases: "handoff", "hand off", "session summary", "session state", "clear context", "I'll continue", "next session", "where we left off", "run out of room", "continue tomorrow"
12
+
13
+ ## When
14
+ Session fill (the `🔋` line) > 75% · phase closure · topic change. Goal: the next session should **not start from scratch**.
15
+
16
+ ## Output (docs/SESSION_STATE.md, local)
17
+ ```
18
+ # Session Handover — <date>
19
+ ## Done
20
+ - <completed work + which files>
21
+ ## In progress
22
+ - <what's half-finished + exactly where it was left off>
23
+ ## Next step
24
+ - <a clear, single high-value step>
25
+ ## Open decisions
26
+ - <pending decision + options>
27
+ ## File pointers
28
+ - docs/PLAN.md, relevant modules...
29
+ ## Blockers / risks
30
+ - <if any>
31
+ ```
32
+
33
+ ## Measure the session before summarising it
34
+ Run **`bash .claude/hooks/session-stats.sh`** first. What it reports belongs in the handover as fact, not
35
+ impression — an auto-compaction means state was already dropped before you started writing (say what was lost),
36
+ a runaway loop marks an approach the next session should not walk back into, and repeated prompts mark context
37
+ that never landed and has to be written down explicitly this time. Missing script (plugin install) → say so.
38
+
39
+ ## Principles
40
+ - **Action-oriented:** focused not on "what was done" but on "exactly where to resume now."
41
+ - Preserve the rationale behind decisions (why this path was chosen) — so context isn't lost.
42
+ - Once written, start a fresh session with `/clear`.
43
+
44
+ ## Holding a board item? The handover is not finished until the TEAM has it
45
+ `docs/SESSION_STATE.md` is gitignored — it survives your `/clear`, and nobody else can read it. So when a
46
+ `teamboard` claim is open, **the handover is not complete until it is on the board**. This is not an optional
47
+ extra step:
48
+ - Still on it → `board.sh note <id> "<where it stands, and why the rejected path was rejected>"`.
49
+ - Not coming back → `board.sh drop <id> "<same>"`, which puts it back in circulation with your context attached.
50
+ - Anything settled here that changes how OTHER items must be done → `board.sh decide "<what>" "<why + what it
51
+ means>"`. A decision that stays in your transcript reaches nobody; on the board it reaches every teammate at
52
+ their next session opening.
53
+
54
+ Write the board note FIRST, then the local file — an interrupted handover should lose the private copy, not the
55
+ shared one.
56
+
57
+ ## Redaction (`<private>` marker)
58
+ `docs/SESSION_STATE.md` is local, but its content is copied into board notes and handovers — never persist a secret, token, credential, or
59
+ personal note into it. Any content wrapped in **`<private>…</private>`** is a redaction marker: strip it from the
60
+ written handover and leave a `[redacted]` placeholder in its place. If a resume genuinely needs a sensitive value,
61
+ point to *where it lives* (env var, secret manager, the person to ask) — never the value itself.
62
+
63
+ ## Check it before trusting it
64
+ That DoD sentence is a claim about a file nobody has tested. Before closing, run the **cold-reader pass**: write
65
+ 5–8 questions from the WORK (not from the file) with their expected answers, then answer them from the handover
66
+ alone. A question that cannot be answered is a gap in the file. Procedure, phrasing that keeps the test honest,
67
+ and the common failure shapes: **`references/cold-reader.md`**.
68
+
69
+ ## DoD
70
+ - A handover file; a new session can resume where it left off by reading only this file.
71
+ - The cold-reader questions were written **before** the file and every one of them is answerable from it.
@@ -0,0 +1,51 @@
1
+ # The cold-reader pass
2
+
3
+ Loaded on demand. SKILL.md's DoD says a new session can resume by reading only the handover file. This is how
4
+ that sentence is checked instead of asserted — and it is the only part of the handover that can fail silently:
5
+ a file that reads well to its author reads well *because* the author remembers what it leaves out.
6
+
7
+ ## The rule the pass exists to enforce
8
+
9
+ **Write the questions before you write the file, from the work — not from the file.** An answer key derived
10
+ from the handover only proves the handover is self-consistent. Derived from the session, it proves the handover
11
+ carries the session.
12
+
13
+ ## Procedure
14
+
15
+ 1. **Before writing the handover**, list 5–8 questions the next session must be able to answer to continue. Take
16
+ them from the work itself: what was decided and why, what is half-finished and exactly where, what was ruled
17
+ out, what breaks if it is touched, what the next action is. Write the expected answers down beside them.
18
+ 2. **Write the handover** as usual.
19
+ 3. **Answer the questions from the handover alone.** The consumer may open only the paths the file itself names
20
+ — the template requires a file-pointers section, so following those pointers *is* the file working. It may
21
+ not use the session's memory, search the repository for context the file never mentions, or ask.
22
+ 4. **Score each question**: answered · partly answered · not answerable. Any "not answerable" is a gap in the
23
+ handover, not in the reader.
24
+ 5. **Fix the file and re-answer** the failed questions. The pass closes when every question is answerable.
25
+
26
+ ## Phrasing that keeps the test honest
27
+
28
+ - **Do not reuse the handover's own words in the question.** "What did we decide about the cache?" is answerable
29
+ by keyword-matching the heading; "What happens to a request that arrives while the cache is rebuilding?" is
30
+ not. A question a reader can answer by lifting a phrase has measured the search, not the content.
31
+ - **Ask for the reason, not the label.** "Which approach was chosen" is a lookup. "Why was the other one
32
+ rejected" is what a resuming session actually needs, and it is what handovers most often drop.
33
+ - **Ask at least one question whose answer is a location** — a file, a branch, a command. Handovers routinely
34
+ describe a state that nothing points at.
35
+
36
+ ## Who runs it
37
+
38
+ Wherever the handover is written — usually inside `crew-session-manager`, which the discipline routes this
39
+ through, sometimes the main thread. Either way no agent in Crewforth holds the delegation tool (all twelve
40
+ shipped agents declare an explicit allowlist and none contains it), so there is no separate cold-reader
41
+ subagent to hand the file to. That is a real limitation and worth naming: the same context that wrote the file is answering
42
+ from it, so the discipline is entirely in step 1 (questions from the work, written first) and step 3 (answer
43
+ from the file only). If a genuinely cold reader is available — another session, a teammate, a fresh window
44
+ opened at the file — use it; the procedure is unchanged and the result is stronger.
45
+
46
+ ## What a failure looks like
47
+
48
+ The common ones, in the order they occur: the "in progress" entry names a task but not the line it stopped at;
49
+ a decision is recorded without the alternative it beat; a blocker is described without who or what unblocks it;
50
+ and the next step is a category ("continue the refactor") rather than an action. Each of those passes a reading
51
+ by its author and fails a cold reader.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: i18n-integrity
3
+ description: |
4
+ Translation integrity: every key present in every language, no hardcoded strings, consistent placeholders
5
+ and plurals. Runs when user-facing text changes.
6
+ ---
7
+
8
+ # Translation Integrity (i18n)
9
+
10
+ <!-- routing-eval reads the next line; why it sits in the body: AGENT_TEMPLATE.md -->
11
+ Trigger phrases: "i18n", "translation", "language file", "missing translation", "localization", "translate", "untranslated", "hardcoded string", "multi language", "multiple languages", "still in english", "locale"
12
+
13
+ Goal: no missing/broken text in any language. Languages: the set the project declares (e.g. in `CLAUDE.md` or the locale directory).
14
+
15
+ ## Audit dimensions
16
+ - **Key parity:** every key has a counterpart in ALL languages; a missing/extra key = a finding.
17
+ - **No hardcoded strings:** user-facing text is not embedded in code, it comes from the language file.
18
+ - **Placeholder consistency:** `{name}`, `%s`, ICU `{count, plural, ...}` are identical in every language.
19
+ - **Plural rules:** language-specific plural forms (especially RU) are correct.
20
+ - **Empty/identical value:** an untranslated (identical to the source) placeholder value is flagged.
21
+
22
+ ## Check (key-set comparison)
23
+ ```bash
24
+ # Example: compare the key sets of JSON language files
25
+ for f in locales/*.json; do echo "== $f =="; jq -r 'keys[]' "$f" | sort > "/tmp/$(basename $f).keys"; done
26
+ diff /tmp/tr.json.keys /tmp/en.json.keys # differences = missing/extra keys
27
+ ```
28
+
29
+ ## DoD
30
+ - Key sets are equal across all languages; no hardcoded user text; placeholders are consistent.
31
+ - **Missing translation = red** (no deferral).
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: incident-runbook
3
+ description: |
4
+ Production incident response: diagnose → mitigate → resolve, then a blameless postmortem and a repeatable
5
+ runbook. Stop the impact first, root cause second.
6
+ Use when production is degraded or broken, and again for the postmortem afterwards.
7
+ ---
8
+
9
+ # Incident Response & Runbook
10
+
11
+ <!-- routing-eval reads the next line; why it sits in the body: AGENT_TEMPLATE.md -->
12
+ Trigger phrases: "incident", "incident response", "runbook", "postmortem", "root cause", "outage", "production incident", "post-incident"
13
+
14
+ Two modes: **live incident** (what to do right now) and **aftermath** (postmortem + runbook). Priority: stopping
15
+ user impact > finding the root cause. No panic, one ordered step at a time.
16
+
17
+ ## Live incident — sequence
18
+ 1. **Acknowledge & classify** — what is the impact (who, how much), severity (SEV1 full outage … SEV3 minor).
19
+ 2. **Mitigate the impact FIRST** — rollback, turn off a feature flag, shift traffic, scale up. Without waiting on the root cause.
20
+ 3. **Single coordinator** — it is clear who decides; communication goes through one channel.
21
+ 4. **Diagnose** — last change? (deploy/migration/config) narrow it down with logs+metrics+traces (observability).
22
+ 5. **Resolve** — the smallest safe fix; then verify (health check).
23
+ 6. **Close** — confirm the impact is over; note the timeline (a postmortem input).
24
+
25
+ ## Mitigation reflexes
26
+ - Last deploy suspect → **rollback** (deploy revert).
27
+ - Suspect feature → turn off the **feature flag**.
28
+ - After a destructive migration → restore from backup (db-migration).
29
+ - Dependency/service down → circuit breaker / graceful degradation.
30
+
31
+ ## After the incident
32
+
33
+ Blameless postmortem + producing a durable runbook: **`references/postmortem.md`**.
34
+
35
+ ## Invariant rules
36
+ 1. **Stop the impact, then understand** — the root cause does not hold up the resolution.
37
+ 2. **Blameless culture** — the postmortem questions the system, not the person.
38
+ 3. **Actions are owned + dated** — no "we'll look at it later".
39
+ 4. **The runbook is executable** — real commands/steps, not wishes.
40
+ 5. **Make learning permanent** — the lesson goes into an adr/runbook/monitoring, it does not get lost.
@@ -0,0 +1,16 @@
1
+ # After the incident — postmortem & runbook
2
+
3
+ Both of these happen **after** the live response is over, not during it. Get the impact stopped first (SKILL.md);
4
+ come here once the incident is resolved.
5
+
6
+ ## Postmortem (blameless)
7
+ Once the incident is resolved, within 24-72 hours:
8
+ - **Timeline**: detection → response → resolution (actual times).
9
+ - **Impact**: who, for how long, what was lost.
10
+ - **Root cause**: "5 whys"; the system/process is questioned, not the person (**blameless**).
11
+ - **Actions**: concrete, owned, dated items that prevent a recurrence (no deferral).
12
+ - If a lasting decision came out of it → `adr`.
13
+
14
+ ## Produce a runbook
15
+ For repeatable incidents, a step-by-step runbook: symptom → diagnostic commands → mitigation → verification → escalation.
16
+ The runbook must be **project-specific** and **executable** (not generic); coordinate with `docs-writer`.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: iterate
3
+ description: |
4
+ Refine-to-Done loop: repeat until tests green + review clean + nothing deferred; bounded. Not the harness /loop.
5
+ ---
6
+
7
+ # Iterate — refine to Done, don't stop at the first attempt
8
+
9
+ <!-- routing-eval reads the next line; why it sits in the body: AGENT_TEMPLATE.md -->
10
+ Trigger phrases: "iterate", "loop until done", "keep going until"
11
+
12
+ ## When
13
+ A task has an objective acceptance criterion (tests, a review gate, a spec) and the first attempt may not
14
+ meet it. This is a single-session refinement loop — NOT the harness `/loop`, which schedules a prompt on an
15
+ interval. Open-ended exploration with no checkable target does not belong here.
16
+
17
+ ## The loop
18
+ 1. **Name the exit test first** — the concrete, checkable condition that means "done": tests green,
19
+ `crew-review-agent` clean, the spec's acceptance criterion met, zero SonarQube findings. No exit test →
20
+ go to spec-planning first; a loop without a target never terminates.
21
+ **Prefer an external, machine-grounded verifier** — a test exit code, a schema match, a lint/quality gate —
22
+ over an LLM's self-assessment. A model grading its own output inflates; an "it looks done" or even a single
23
+ "review clean" with no objective check is a weak verifier. When the only available check is a judgment call,
24
+ ground it (a second agent with a distinct lens, an explicit rubric) rather than trusting the loop's own say-so.
25
+ For a generative task with no exit code, the `eval-grader` skill *is* that external verifier — a two-layer
26
+ scorecard (code metrics + LLM-judge) over a fixed set, read as signed deltas vs a pinned baseline.
27
+ 2. **Run one round**: change → verify (drive the real flow, not only tests) → check the exit test.
28
+ 3. **Report the gap** every round — state what still fails and why. Never loop silently.
29
+ 4. **Repeat** until the exit test passes. Stop early and surface it if: two rounds pass with no new
30
+ progress (you are stuck — report, don't spin), the exit test itself is wrong, or a blocker needs a
31
+ decision from the user.
32
+ 5. **Close at the DoD gate, not at a commit.** `crew-commit-agent` still proposes and waits for §4.4
33
+ approval. The loop never commits, pushes, or deploys on its own.
34
+
35
+ ## Guardrails
36
+ - **Bounded, not infinite.** A fixed exit test plus a no-progress stop is the whole point; "keep trying
37
+ forever" is a bug, not diligence.
38
+ - **Token discipline** ([[token-budget]]): each round re-pays for context. Keep a round's output a summary,
39
+ push heavy logs to `docs/*.md`, and don't fan out a subagent per round unless isolation demands it.
40
+ - **Don't move the goalposts.** Never weaken the exit test to end the loop — fix the work, or stop and ask.