crewforth 0.0.1 → 3.0.0-rc.2

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 (169) hide show
  1. package/CHANGELOG.md +3805 -0
  2. package/LICENSE +21 -0
  3. package/README.md +37 -7
  4. package/VERSION +1 -0
  5. package/adopt.sh +1739 -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 +639 -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/skill-listing.awk +43 -0
  29. package/kit/eval/lib/star.sh +70 -0
  30. package/kit/eval/parser-conformance.sh +612 -0
  31. package/kit/eval/preflight.sh +186 -0
  32. package/kit/eval/routing-eval.sh +209 -0
  33. package/kit/eval/scan-skill.sh +162 -0
  34. package/kit/eval/smoke-test.sh +6736 -0
  35. package/kit/eval/update-guard.sh +81 -0
  36. package/kit/eval/utilization.sh +130 -0
  37. package/kit/hooks/board-sync.sh +106 -0
  38. package/kit/hooks/board.sh +962 -0
  39. package/kit/hooks/commit-msg +49 -0
  40. package/kit/hooks/context-usage.sh +353 -0
  41. package/kit/hooks/floor-blocklist.txt +124 -0
  42. package/kit/hooks/guard-bash.sh +1433 -0
  43. package/kit/hooks/guard-commit-scan.sh +511 -0
  44. package/kit/hooks/guard-write.sh +513 -0
  45. package/kit/hooks/pre-commit +577 -0
  46. package/kit/hooks/route-hint.sh +185 -0
  47. package/kit/hooks/secret-blocklist.txt +82 -0
  48. package/kit/hooks/session-guard.sh +149 -0
  49. package/kit/hooks/session-rehydrate.sh +41 -0
  50. package/kit/hooks/session-stats.sh +252 -0
  51. package/kit/hooks/session-update-check.sh +236 -0
  52. package/kit/hooks/skill-trust.sh +163 -0
  53. package/kit/hooks/trace-blocklist.txt +53 -0
  54. package/kit/settings.json +132 -0
  55. package/kit/skills/a11y/SKILL.md +44 -0
  56. package/kit/skills/adr/SKILL.md +74 -0
  57. package/kit/skills/api-design/SKILL.md +50 -0
  58. package/kit/skills/automode-policy/SKILL.md +91 -0
  59. package/kit/skills/automode-policy/references/policy.json +13 -0
  60. package/kit/skills/automode-policy/scripts/apply.sh +84 -0
  61. package/kit/skills/automode-policy/scripts/check.sh +102 -0
  62. package/kit/skills/backend-architecture/SKILL.md +103 -0
  63. package/kit/skills/brainstorm/SKILL.md +47 -0
  64. package/kit/skills/ci-pipeline/SKILL.md +38 -0
  65. package/kit/skills/commit-message/SKILL.md +82 -0
  66. package/kit/skills/commit-message/references/examples.md +8 -0
  67. package/kit/skills/confidence-check/SKILL.md +86 -0
  68. package/kit/skills/crew-board/SKILL.md +55 -0
  69. package/kit/skills/crew-brainstorm/SKILL.md +19 -0
  70. package/kit/skills/crew-code-review/SKILL.md +151 -0
  71. package/kit/skills/crew-code-review/references/history-search.md +19 -0
  72. package/kit/skills/crew-code-review/references/panel-mode.md +32 -0
  73. package/kit/skills/crew-code-review/references/receiving.md +23 -0
  74. package/kit/skills/crew-doctor/SKILL.md +46 -0
  75. package/kit/skills/crew-gates/SKILL.md +25 -0
  76. package/kit/skills/crew-handoff/SKILL.md +14 -0
  77. package/kit/skills/crew-plan/SKILL.md +18 -0
  78. package/kit/skills/crew-review/SKILL.md +26 -0
  79. package/kit/skills/crew-ship/SKILL.md +19 -0
  80. package/kit/skills/crew-skill/SKILL.md +62 -0
  81. package/kit/skills/crew-studio/SKILL.md +129 -0
  82. package/kit/skills/crew-update/SKILL.md +43 -0
  83. package/kit/skills/db-migration/SKILL.md +120 -0
  84. package/kit/skills/db-migration/references/backup-restore.md +33 -0
  85. package/kit/skills/db-migration/references/raw-sql.md +30 -0
  86. package/kit/skills/db-migration/references/tool-matrix.md +35 -0
  87. package/kit/skills/dependency-audit/SKILL.md +61 -0
  88. package/kit/skills/dependency-upgrade/SKILL.md +82 -0
  89. package/kit/skills/deploy/SKILL.md +100 -0
  90. package/kit/skills/deploy/references/proxy-ssl.md +56 -0
  91. package/kit/skills/deploy/references/rollback.md +18 -0
  92. package/kit/skills/deploy/references/scripts.md +9 -0
  93. package/kit/skills/deploy/references/topology-a.md +128 -0
  94. package/kit/skills/deploy/references/topology-b.md +44 -0
  95. package/kit/skills/docs-writer/SKILL.md +53 -0
  96. package/kit/skills/docs-writer/references/coauthoring.md +34 -0
  97. package/kit/skills/eval-grader/SKILL.md +75 -0
  98. package/kit/skills/eval-grader/references/method.md +51 -0
  99. package/kit/skills/frontend/SKILL.md +56 -0
  100. package/kit/skills/frontend/references/verify-contract.md +41 -0
  101. package/kit/skills/frontend-design/SKILL.md +71 -0
  102. package/kit/skills/frontend-design/references/design-review.md +34 -0
  103. package/kit/skills/frontend-rn-expo/SKILL.md +25 -0
  104. package/kit/skills/handoff/SKILL.md +71 -0
  105. package/kit/skills/handoff/references/cold-reader.md +51 -0
  106. package/kit/skills/i18n-integrity/SKILL.md +31 -0
  107. package/kit/skills/incident-runbook/SKILL.md +40 -0
  108. package/kit/skills/incident-runbook/references/postmortem.md +16 -0
  109. package/kit/skills/iterate/SKILL.md +40 -0
  110. package/kit/skills/mcp-builder/SKILL.md +54 -0
  111. package/kit/skills/mcp-builder/references/building.md +71 -0
  112. package/kit/skills/observability/SKILL.md +50 -0
  113. package/kit/skills/performance/SKILL.md +38 -0
  114. package/kit/skills/performance/references/bottlenecks.md +10 -0
  115. package/kit/skills/privacy-compliance/SKILL.md +75 -0
  116. package/kit/skills/red-team/SKILL.md +48 -0
  117. package/kit/skills/reflect/SKILL.md +57 -0
  118. package/kit/skills/release/SKILL.md +44 -0
  119. package/kit/skills/security-scan/SKILL.md +99 -0
  120. package/kit/skills/security-scan/references/ai-agents.md +107 -0
  121. package/kit/skills/security-scan/references/fronts.md +99 -0
  122. package/kit/skills/security-scan/references/prompting.md +23 -0
  123. package/kit/skills/security-scan/references/reporting.md +75 -0
  124. package/kit/skills/security-scan/references/verify.md +131 -0
  125. package/kit/skills/sonarqube-check/SKILL.md +108 -0
  126. package/kit/skills/sonarqube-check/references/local-engines.md +32 -0
  127. package/kit/skills/sonarqube-check/references/stand-up-server.md +25 -0
  128. package/kit/skills/spec-planning/SKILL.md +92 -0
  129. package/kit/skills/systematic-debugging/SKILL.md +57 -0
  130. package/kit/skills/systematic-debugging/references/techniques.md +44 -0
  131. package/kit/skills/teamboard/SKILL.md +88 -0
  132. package/kit/skills/teamboard/references/setup.md +37 -0
  133. package/kit/skills/testing/SKILL.md +49 -0
  134. package/kit/skills/testing/references/flaky-triage.md +51 -0
  135. package/kit/skills/threat-model/SKILL.md +57 -0
  136. package/kit/skills/threat-model/references/interview.md +51 -0
  137. package/kit/skills/threat-model/references/schema.md +42 -0
  138. package/kit/skills/token-budget/SKILL.md +51 -0
  139. package/kit/skills/trace-scan/SKILL.md +43 -0
  140. package/kit/skills/worktree/SKILL.md +40 -0
  141. package/kit/studio/README.md +266 -0
  142. package/kit/studio/ensure-node.sh +471 -0
  143. package/kit/studio/package.json +14 -0
  144. package/kit/studio/server/hooks/studio-gate.sh +169 -0
  145. package/kit/studio/server/index.js +902 -0
  146. package/kit/studio/server/lib/crew-env.js +11 -0
  147. package/kit/studio/server/lib/fleet.js +146 -0
  148. package/kit/studio/server/lib/graph.js +533 -0
  149. package/kit/studio/server/lib/instance.js +135 -0
  150. package/kit/studio/server/lib/kit-telemetry.js +182 -0
  151. package/kit/studio/server/lib/kit.js +158 -0
  152. package/kit/studio/server/lib/palette.js +118 -0
  153. package/kit/studio/server/lib/peers.js +72 -0
  154. package/kit/studio/server/lib/permissions.js +150 -0
  155. package/kit/studio/server/lib/projects.js +294 -0
  156. package/kit/studio/server/lib/roster.js +191 -0
  157. package/kit/studio/server/lib/session.js +309 -0
  158. package/kit/studio/server/lib/terminal.js +91 -0
  159. package/kit/studio/server/lib/transcript.js +100 -0
  160. package/kit/studio/web/app.js +1098 -0
  161. package/kit/studio/web/canvas.js +1179 -0
  162. package/kit/studio/web/chat.js +543 -0
  163. package/kit/studio/web/index.html +86 -0
  164. package/kit/studio/web/md.js +110 -0
  165. package/kit/studio/web/storage-migrate.js +23 -0
  166. package/kit/studio/web/style.css +1453 -0
  167. package/package.json +46 -8
  168. package/start.sh +764 -0
  169. package/bin/crewforth.js +0 -10
@@ -0,0 +1,128 @@
1
+ # Topology A — self-managed host (phases 1-5)
2
+
3
+ Read this only when Phase 0 answered **A**: you have SSH to a machine you own or rent, a release is a directory on
4
+ that host, and rollback means moving a pointer back. On topology B read `references/topology-b.md` instead — never
5
+ both, because mixing them is where deploys go wrong.
6
+
7
+ The invariant rules in SKILL.md hold over everything here: no deploy without approval, back up before the swap,
8
+ health-gate after it, keep the last three versions, the app binds to `127.0.0.1` only.
9
+
10
+ ## Phase 1 (A) — Surface: method and runtime
11
+
12
+ ```bash
13
+ if [ -f Dockerfile ] || [ -f docker-compose.yml ]; then METHOD=docker
14
+ elif [ -f package.json ]; then METHOD=bare RUNTIME=node
15
+ elif [ -f requirements.txt ] || [ -f pyproject.toml ]; then METHOD=bare RUNTIME=python
16
+ elif [ -f go.mod ]; then METHOD=bare RUNTIME=go
17
+ elif ls ./*.csproj ./*.sln >/dev/null 2>&1; then METHOD=bare RUNTIME=dotnet
18
+ elif [ -f pom.xml ] || [ -f build.gradle ]; then METHOD=bare RUNTIME=java
19
+ elif [ -f Cargo.toml ]; then METHOD=bare RUNTIME=rust
20
+ elif [ -f Gemfile ]; then METHOD=bare RUNTIME=ruby
21
+ elif [ -f composer.json ]; then METHOD=bare RUNTIME=php
22
+ else METHOD=unknown; fi
23
+ ```
24
+ If `method: docker` and there's no Dockerfile, generate one. `method: bare` → a process manager suited to the runtime; build the release artefact with the runtime's own command (`dotnet publish -c Release`, `mvn package`, `cargo build --release`, …) and run it under systemd. Prefer Docker for any runtime whose bare setup needs a toolchain on the box. If detection is ambiguous, ask the user — never guess a runtime.
25
+
26
+ ---
27
+
28
+ ## Phase 2 (A) — Preparation: config, SSH, proxy, SSL
29
+
30
+ **Config** — read `.deploy.yml` from the root, and if it's missing ask for each field:
31
+ ```yaml
32
+ host: 192.168.1.100 # VPS IP/hostname (required)
33
+ user: deploy # SSH user (required)
34
+ ssh_key: ~/.ssh/id_rsa # private key
35
+ app_port: 3000 # application port (required)
36
+ health_check: /api/health # HTTP path (default /)
37
+ deploy_path: /var/www/app # server path (required)
38
+ method: auto # auto | docker | bare
39
+ domain: app.example.com # for proxy/SSL (optional)
40
+ ssl: true # default true if there is a domain
41
+ reverse_proxy: auto # auto | nginx | caddy
42
+ ```
43
+ **Verify SSH first** — if you can't connect, stop immediately:
44
+ ```bash
45
+ ssh -i $SSH_KEY -o ConnectTimeout=5 -o StrictHostKeyChecking=accept-new $USER@$HOST "echo OK"
46
+ ```
47
+
48
+ **Reverse proxy** — detect the one installed on the server (`auto` → Caddy if present, otherwise Nginx). The application binds only to `127.0.0.1`; it is exposed outward **only** through the proxy.
49
+
50
+ **SSL** — skip if `ssl: false` or there's no domain, and never on a bare IP. On the Nginx path, verify DNS resolves to the host (`dig +short $DOMAIN` = `$HOST`) *before* running Certbot; on the Caddy path the certificate and its renewal are automatic and there is no separate step.
51
+
52
+ Config file contents for both proxies, the Certbot commands and the renewal timer: **`references/proxy-ssl.md`** — read the half for the proxy you found, not both.
53
+
54
+ ---
55
+
56
+ ## Phase 3 (A) — Swap: keep the old, put the new
57
+
58
+ **First back up the running version** (timestamped `releases/`, last 3 kept):
59
+ ```bash
60
+ ssh -i $SSH_KEY $USER@$HOST "
61
+ mkdir -p $DEPLOY_PATH/releases
62
+ [ -d $DEPLOY_PATH/current ] && cp -a $DEPLOY_PATH/current $DEPLOY_PATH/releases/$(date +%Y%m%d_%H%M%S)
63
+ cd $DEPLOY_PATH/releases && ls -dt */ | tail -n +4 | xargs -r rm -rf
64
+ "
65
+ ```
66
+
67
+ **Docker** — build the image locally, transfer it, replace the container:
68
+ ```bash
69
+ docker build -t $APP:latest .
70
+ docker save $APP:latest | gzip | ssh -i $SSH_KEY $USER@$HOST "gunzip | docker load"
71
+ ssh -i $SSH_KEY $USER@$HOST "
72
+ docker rm -f $APP 2>/dev/null || true
73
+ docker run -d --name $APP --restart unless-stopped -p 127.0.0.1:$APP_PORT:$APP_PORT $APP:latest
74
+ "
75
+ ```
76
+
77
+ **Bare-metal** — `rsync` the source, install dependencies, start with the process manager:
78
+ ```bash
79
+ rsync -avz --delete --exclude .git --exclude node_modules --exclude .venv \
80
+ -e "ssh -i $SSH_KEY" ./ $USER@$HOST:$DEPLOY_PATH/current/
81
+ ```
82
+
83
+ | Runtime | Dependencies + startup |
84
+ |---|---|
85
+ | Node | `npm ci --production` → PM2: `pm2 start ecosystem.config.js --name $APP || pm2 start npm --name $APP -- start` → `pm2 save` |
86
+ | Python | `python3 -m venv venv && venv/bin/pip install -r requirements.txt` → systemd (gunicorn/uvicorn or `python main.py`) |
87
+ | Go | build locally `GOOS=linux GOARCH=amd64 go build -o $APP` → `scp` → systemd |
88
+
89
+ systemd unit (for Python/Go, fill in ExecStart per the runtime):
90
+ ```ini
91
+ [Unit]
92
+ After=network.target
93
+ [Service]
94
+ Type=simple
95
+ User=$USER
96
+ WorkingDirectory=$DEPLOY_PATH/current
97
+ ExecStart=<runtime command>
98
+ Restart=always
99
+ Environment=PORT=$APP_PORT
100
+ [Install]
101
+ WantedBy=multi-user.target
102
+ ```
103
+ `systemctl daemon-reload && systemctl enable --now $APP`.
104
+
105
+ ---
106
+
107
+ ## Phase 4 (A) — Health gate
108
+
109
+ Right after the swap; retry for ~30 s until a 200 comes back. **If it doesn't pass, trigger Phase 5 automatically.**
110
+ ```bash
111
+ ssh -i $SSH_KEY $USER@$HOST '
112
+ for i in $(seq 1 6); do
113
+ [ "$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:'"$APP_PORT$HEALTH_CHECK"')" = 200 ] \
114
+ && { echo "Health gate PASSED"; exit 0; }
115
+ sleep 5
116
+ done
117
+ echo "Health gate FAILED"; exit 1
118
+ '
119
+ ```
120
+ Also verify the process is up: `docker ps` on Docker, otherwise `systemctl is-active $APP` / `pm2 show $APP`.
121
+
122
+ ---
123
+
124
+ ## Phase 5 (A) — Rollback
125
+
126
+ On health-gate failure: put the most recent `releases/` version back into `current`, restart the service, and
127
+ re-run the health gate (Phase 4). Guard-safe rollback script (uses `rsync --delete`, not `rm -rf`) + the
128
+ approval-gate note: **`references/rollback.md`**.
@@ -0,0 +1,44 @@
1
+ # Topology B — managed platform (phases B1-B4)
2
+
3
+ Read this only when Phase 0 answered **B**: you have an API/CLI and no shell on the box, a release is an immutable
4
+ artefact, and rollback means re-pointing the environment at the previous one. On topology A read
5
+ `references/topology-a.md` instead — never both.
6
+
7
+ The invariant rules in SKILL.md hold over everything here, including the two that are B's alone: never rebuild to
8
+ roll back, and the platform's own status is not the health gate.
9
+
10
+ ## Phase B1 — Build once, and know what you built
11
+ The artefact is produced **once**, and the same one moves through every environment. Rebuilding for production
12
+ means the thing you tested is not the thing you shipped — the inputs moved underneath you (a floating base
13
+ image, a lockfile resolved a minute later, a different builder). Two consequences:
14
+ - **Address it immutably.** A digest or a build id, never a moving tag. `latest`, `main` and a branch name all
15
+ name different bytes on different days, which makes both promotion and rollback unverifiable.
16
+ - **Record which artefact is in which environment.** If nobody can answer "what exactly is running in
17
+ production", rollback is a guess and the health gate has nothing to compare against.
18
+
19
+ ## Phase B2 — Promote, do not rebuild
20
+ Deploying to the next environment means pointing that environment at an artefact that already exists and has
21
+ already passed the previous gate. Configuration is injected per environment, never baked into the artefact — the
22
+ same bytes must be able to run in staging and in production, or you are back to rebuilding. Secrets come from
23
+ the platform's own store; a secret inside the artefact ships to everyone who can pull it.
24
+
25
+ **Approval is per environment (§4.4), and per topology.** Promoting to a user-facing environment is a deploy,
26
+ whatever the platform calls it.
27
+
28
+ ## Phase B3 — Health gate, from outside
29
+ Identical in spirit to Phase 4 (A) and worth stating because platforms invite the opposite: **the platform
30
+ reporting "deployed", "healthy" or "active" is not the verification.** It reports that its own reconciliation
31
+ finished. Check the thing users touch — a request through the public entry point, a real response body, the
32
+ version endpoint returning the version you promoted. Give it the same failure rule: if the gate does not pass,
33
+ go back before investigating.
34
+
35
+ ## Phase B4 — Roll back by re-pointing
36
+ Rollback is promoting the previous artefact, not rebuilding the previous commit — a rebuild is a new artefact
37
+ with new inputs and it may not even reproduce the bug you are escaping. So:
38
+ - Keep the previous artefacts addressable for at least as long as you promise to be able to roll back. A
39
+ retention policy that deletes them is a rollback policy that does not work.
40
+ - Rolling back **code** does not roll back a **migration**. If the release included an irreversible schema
41
+ change, the old artefact may not run against the new schema — that is `db-migration`'s expand/contract
42
+ question and it has to be answered before the deploy, not during the incident.
43
+ - After a rollback, the environment is running an artefact older than the recorded state. Say so plainly to
44
+ whoever is watching; a silent rollback is how two people fix the same outage twice.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: docs-writer
3
+ description: |
4
+ Keeps documentation in sync with the code: README, usage and related docs when a public API or behavior
5
+ changes. Leaves no dead or misleading docs behind.
6
+ ---
7
+
8
+ # Documentation
9
+
10
+ <!-- routing-eval reads the next line; why it sits in the body: AGENT_TEMPLATE.md -->
11
+ Trigger phrases: "documentation", "docs", "update README", "API docs", "write docs", "document it", "write usage"
12
+
13
+ Goal: the docs must **match the code**. Wrong/stale docs are worse than no docs (they inspire trust and mislead).
14
+ Trigger: when a public API, command, configuration, or user-visible behavior changes.
15
+
16
+ ## When it is mandatory
17
+ - A public function/endpoint/CLI signature or behavior changed.
18
+ - A new feature, configuration key, or environment variable was added.
19
+ - The install/run steps changed.
20
+ - A breaking change was made (also coordinate via `release`/CHANGELOG).
21
+
22
+ ## Checklist
23
+ - [ ] Docs are up to date for the changed public surface
24
+ - [ ] Examples **work** (copy-paste tested / mentally traced)
25
+ - [ ] Dead/misleading wording removed (no leftover old name/parameter)
26
+ - [ ] New configuration/env documented (default + whether required)
27
+ - [ ] Scope minimal — not a repetition of the code, but "why/how to use it"
28
+ - [ ] No secret/real credential in the docs (use a placeholder)
29
+
30
+ ## How
31
+ 1. **Identify the changed surface** — extract the public signature/behavior diff from the diff.
32
+ 2. **Find the right doc** — README, `docs/`, docstring, OpenAPI, command `--help`. If there is more than one, update them all.
33
+ 3. **Write**: what it does · how it is called (example) · input/output · limits/error cases. Short and correct.
34
+ 4. **Verify the examples** — does the command/code example actually run.
35
+ 5. **Clean up the old** — delete references to removed APIs/parameters.
36
+ 6. **Translation**: if the user-visible doc is multilingual, coordinate with `i18n-integrity`.
37
+
38
+ ## Principles
39
+ - **Single source** — behavior lives in the code; the doc *explains* it, does not copy it (a copied doc goes stale).
40
+ - **Example > paragraph** — a working example beats three paragraphs.
41
+ - **Minimal** — don't write a giant doc no one will maintain; answer the most-asked question.
42
+
43
+ ## Co-authoring a longer doc (guide, tutorial, README rewrite)
44
+ For a substantial doc the content lives in the author's head, not the diff — don't guess it. Interview for intent
45
+ and audience, draft in passes, and let the user steer before you polish. The collaborative workflow (audience/intent
46
+ questions, outline-first, section-by-section drafting, revision loop): **`references/coauthoring.md`**.
47
+
48
+ ## Invariant rules
49
+ 1. **Correctness > completeness** — don't write a wrong doc; if unsure, flag it/ask.
50
+ 2. **Examples must work.**
51
+ 3. **Leave no stale/dead docs.**
52
+ 4. **No secret/real credential** — use a placeholder (aligned with §4).
53
+ 5. **Don't repeat the code** — don't just copy the signature; explain the usage.
@@ -0,0 +1,34 @@
1
+ # Co-authoring a longer doc
2
+
3
+ Loaded on demand. For a substantial doc (a guide, tutorial, concept explainer, README rewrite) — not a mechanical
4
+ sync of a changed signature. Here the content lives in the author's head; your job is to draw it out and shape it,
5
+ not to invent it.
6
+
7
+ ## Why not just write it
8
+
9
+ A generated long-form doc that no one steered reads as generic, states things the maintainer wouldn't, and quietly
10
+ guesses at intent — then it has to be rewritten anyway. Co-authoring front-loads the cheap questions so the expensive
11
+ draft is right the first time.
12
+
13
+ ## The workflow
14
+
15
+ 1. **Interview first (before drafting).** Ask, don't assume:
16
+ - **Audience** — who reads this? (new user, integrator, contributor, ops) Their assumed knowledge sets the level.
17
+ - **Intent** — what should the reader be able to *do* after? One doc, one job.
18
+ - **Scope** — what's explicitly out of scope? (prevents the doc sprawling)
19
+ - **Voice/constraints** — house style, terminology, things that must/mustn't be said.
20
+ Keep it to the few questions whose answers actually change the draft — offer options where useful, don't interrogate.
21
+
22
+ 2. **Outline, get sign-off.** Propose the section structure (headings + one line each) and confirm it *before* writing prose. Re-structuring an outline is cheap; re-structuring 800 words is not.
23
+
24
+ 3. **Draft in passes, not one wall.** Write section by section (or a first full pass explicitly marked as a draft). Surface the open questions inline (`> TODO: confirm default value`) rather than silently guessing — the maintainer fills the gaps you can't.
25
+
26
+ 4. **Revision loop.** Invite specific feedback ("is the auth section at the right level?"), apply it, and keep the diff reviewable. Don't rewrite wholesale on each round — converge.
27
+
28
+ 5. **Then apply the base discipline.** Once the content is agreed, the SKILL.md rules take over: examples must actually run, no stale/dead wording, no real secrets, single-source (explain the code, don't copy it), and coordinate `i18n-integrity` if it's multilingual.
29
+
30
+ ## Keep it honest
31
+
32
+ - Don't state capabilities, defaults, or roadmap you haven't verified — ask or mark as TODO.
33
+ - Don't pad to look thorough; the maintainer maintains every sentence you add.
34
+ - The author's voice wins over yours — you're drafting *their* doc, not authoring your own.
@@ -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.