@oneie/claude 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/agents/abm-strategist.md +89 -0
  2. package/agents/ads-meta.md +97 -0
  3. package/agents/analyst.md +173 -0
  4. package/agents/architect.md +280 -0
  5. package/agents/brand-guardian.md +88 -0
  6. package/agents/brand-strategist.md +92 -0
  7. package/agents/campaign-content.md +90 -0
  8. package/agents/campaign-email.md +88 -0
  9. package/agents/campaign-sms.md +87 -0
  10. package/agents/campaign-social.md +87 -0
  11. package/agents/cco.md +99 -0
  12. package/agents/ceo.md +106 -0
  13. package/agents/chairman.md +120 -0
  14. package/agents/cmo.md +101 -0
  15. package/agents/community-greeter.md +89 -0
  16. package/agents/community-moderator.md +92 -0
  17. package/agents/compliance.md +92 -0
  18. package/agents/copywriter.md +100 -0
  19. package/agents/creative-strategist.md +95 -0
  20. package/agents/cro.md +98 -0
  21. package/agents/cto.md +267 -0
  22. package/agents/customer-interviewer.md +93 -0
  23. package/agents/customer-researcher.md +89 -0
  24. package/agents/customer-success-manager.md +90 -0
  25. package/agents/customer-trainer.md +90 -0
  26. package/agents/cxo.md +100 -0
  27. package/agents/demand-creator.md +89 -0
  28. package/agents/demo-mover.md +83 -0
  29. package/agents/demo-specialist.md +89 -0
  30. package/agents/demo-thai-family-law.md +87 -0
  31. package/agents/designer.md +112 -0
  32. package/agents/discovery-caller.md +98 -0
  33. package/agents/doctor.md +139 -0
  34. package/agents/educate-coach.md +100 -0
  35. package/agents/elevate-tutor.md +83 -0
  36. package/agents/email-lifecycle-marketer.md +91 -0
  37. package/agents/engage-specialist.md +99 -0
  38. package/agents/events-coordinator.md +90 -0
  39. package/agents/foundation-builder.md +94 -0
  40. package/agents/funnel-architect.md +89 -0
  41. package/agents/gift-creator.md +100 -0
  42. package/agents/google-ads.md +103 -0
  43. package/agents/guide.md +292 -0
  44. package/agents/helpdesk-dispatcher.md +88 -0
  45. package/agents/hook-specialist.md +91 -0
  46. package/agents/identify-optimizer.md +101 -0
  47. package/agents/implementer.md +305 -0
  48. package/agents/incident-commander.md +120 -0
  49. package/agents/insights-lead.md +93 -0
  50. package/agents/journey-runner.md +113 -0
  51. package/agents/linkedin-ads.md +123 -0
  52. package/agents/live-sales-chat.md +90 -0
  53. package/agents/market-researcher.md +88 -0
  54. package/agents/media-buyer.md +96 -0
  55. package/agents/movers-customer-researcher.md +95 -0
  56. package/agents/movers-foundation-builder.md +96 -0
  57. package/agents/movers-market-researcher.md +97 -0
  58. package/agents/movers-pricing-strategist.md +171 -0
  59. package/agents/nurture-architect.md +99 -0
  60. package/agents/offer-architect.md +92 -0
  61. package/agents/onboarder.md +222 -0
  62. package/agents/onboarding-specialist.md +92 -0
  63. package/agents/operations-dashboard.md +98 -0
  64. package/agents/perf-engineer.md +348 -0
  65. package/agents/playbook-writer.md +71 -0
  66. package/agents/plg-strategist.md +91 -0
  67. package/agents/positioning-architect.md +88 -0
  68. package/agents/press-officer.md +89 -0
  69. package/agents/pricing-strategist.md +94 -0
  70. package/agents/privacy-officer.md +92 -0
  71. package/agents/referral-manager.md +91 -0
  72. package/agents/refine-analyst.md +102 -0
  73. package/agents/release-manager.md +261 -0
  74. package/agents/renewals-upsell-rep.md +90 -0
  75. package/agents/review-engineer.md +327 -0
  76. package/agents/rewards-steward.md +82 -0
  77. package/agents/sales-call-coach.md +94 -0
  78. package/agents/sales-closer.md +98 -0
  79. package/agents/security-auditor.md +313 -0
  80. package/agents/sell-closer.md +101 -0
  81. package/agents/share-amplifier.md +99 -0
  82. package/agents/social-media-manager.md +92 -0
  83. package/agents/storyteller.md +250 -0
  84. package/agents/strategist.md +83 -0
  85. package/agents/strategy-aligner.md +94 -0
  86. package/agents/support-agent.md +90 -0
  87. package/agents/tagger.md +245 -0
  88. package/agents/tech-writer.md +216 -0
  89. package/agents/test-engineer.md +243 -0
  90. package/agents/tiktok-ads.md +105 -0
  91. package/agents/tracking-engineer.md +92 -0
  92. package/agents/upsell-strategist.md +101 -0
  93. package/agents/voice.md +85 -0
  94. package/agents/w4-tools.md +153 -0
  95. package/agents/w4-verify.md +20 -138
  96. package/agents/workflow-optimiser.md +84 -0
  97. package/commands/close.md +814 -160
  98. package/commands/create.md +2 -2
  99. package/commands/deploy.md +554 -175
  100. package/commands/do.md +119 -109
  101. package/commands/fast.md +67 -0
  102. package/commands/improve.md +2 -2
  103. package/commands/one.md +418 -0
  104. package/commands/see.md +1 -1
  105. package/commands/sync.md +1 -1
  106. package/commands/tasks.md +222 -0
  107. package/commands/vespio.md +110 -0
  108. package/commands/vespio.remote.md +227 -0
  109. package/hooks/hooks.json +25 -79
  110. package/hooks/lib/governor-escape-match.sh +88 -0
  111. package/hooks/lib/hook.sh +4 -13
  112. package/hooks/lib/signal.sh +9 -2
  113. package/hooks/scripts/branch-pin.sh +6 -0
  114. package/hooks/scripts/config-protect.sh +6 -0
  115. package/hooks/scripts/do-outcome-gate.sh +19 -2
  116. package/hooks/scripts/git-add-guard.sh +43 -2
  117. package/hooks/scripts/governor-escape.sh +96 -0
  118. package/hooks/scripts/load-guard.sh +127 -0
  119. package/hooks/scripts/post-edit-check.sh +36 -29
  120. package/hooks/scripts/session-start.sh +34 -80
  121. package/hooks/scripts/task-complete-verify.sh +46 -40
  122. package/package.json +1 -1
  123. package/rules/documentation.md +9 -0
  124. package/scripts/ad-copy-lint.sh +656 -0
  125. package/scripts/agentverse-audit.sh +256 -0
  126. package/scripts/asi-walk.sh +435 -0
  127. package/scripts/astro-build-cached.sh +143 -0
  128. package/scripts/blocks-manifest-cached.sh +100 -0
  129. package/scripts/blocks-manifest.mjs +497 -0
  130. package/scripts/blocks-ratchet.sh +116 -0
  131. package/scripts/blocks-render-probe.mjs +529 -0
  132. package/scripts/blocks-usage.mjs +334 -0
  133. package/scripts/chat-context-check.sh +89 -0
  134. package/scripts/close-metrics.sh +558 -0
  135. package/scripts/close-owner.sh +268 -0
  136. package/scripts/db-sync-lock-check.sh +116 -0
  137. package/scripts/deploy-dev.sh +35 -0
  138. package/scripts/deploy-emit.sh +298 -0
  139. package/scripts/deploy-gate-check.sh +128 -0
  140. package/scripts/deploy-ready.sh +78 -0
  141. package/scripts/deploy-record.sh +605 -0
  142. package/scripts/deploy.sh +1273 -0
  143. package/scripts/do-auto.sh +598 -48
  144. package/scripts/do-brief.sh +113 -0
  145. package/scripts/do-close.sh +1137 -0
  146. package/scripts/do-commit.sh +75 -0
  147. package/scripts/do-consumer-sweep.sh +18 -1
  148. package/scripts/do-cycle-shape-check.sh +160 -0
  149. package/scripts/do-decide.sh +476 -0
  150. package/scripts/do-derive-check.sh +436 -0
  151. package/scripts/do-fleet.sh +106 -28
  152. package/scripts/do-folder.sh +10 -1
  153. package/scripts/do-next.sh +106 -0
  154. package/scripts/do-orchestrate.sh +17 -5
  155. package/scripts/do-plan-json.mjs +201 -0
  156. package/scripts/do-plan-json.sh +8 -0
  157. package/scripts/do-preflight.sh +117 -0
  158. package/scripts/do-project.sh +157 -0
  159. package/scripts/do-prove-selftest.sh +108 -0
  160. package/scripts/do-prove.sh +295 -23
  161. package/scripts/do-rank.py +31 -1
  162. package/scripts/do-recon-cache.sh +7 -1
  163. package/scripts/do-recon-pack.sh +196 -0
  164. package/scripts/do-reconcile.sh +121 -4
  165. package/scripts/do-signal.sh +280 -23
  166. package/scripts/do-smoke.sh +18 -1
  167. package/scripts/do-test-gate.sh +80 -0
  168. package/scripts/do-tick.sh +102 -0
  169. package/scripts/do-tier.sh +6 -0
  170. package/scripts/do-triage.sh +182 -0
  171. package/scripts/do-ui-gate.sh +1 -1
  172. package/scripts/do-w4-gates.sh +451 -0
  173. package/scripts/do-walk.sh +12 -1
  174. package/scripts/env-sync.sh +173 -0
  175. package/scripts/factory-brief-check.sh +330 -0
  176. package/scripts/factory-check.sh +68 -14
  177. package/scripts/factory-close-check.sh +257 -0
  178. package/scripts/factory-emit.sh +211 -0
  179. package/scripts/factory-executor-check.mjs +353 -0
  180. package/scripts/factory-peak.sh +301 -0
  181. package/scripts/factory-repo.sh +118 -3
  182. package/scripts/factory-review-check.mjs +61 -0
  183. package/scripts/factory-ship.sh +61 -0
  184. package/scripts/factory-tasks-check.sh +18 -1
  185. package/scripts/factory-turn.sh +326 -0
  186. package/scripts/factory-walk.sh +396 -0
  187. package/scripts/factory-width.sh +57 -0
  188. package/scripts/fade-toxic.sh +4 -3
  189. package/scripts/fixtures/factory-brief-real.md +44 -0
  190. package/scripts/fixtures/triage-dupe.md +5 -0
  191. package/scripts/fleet-manifest.mjs +108 -0
  192. package/scripts/fleet-status.sh +110 -0
  193. package/scripts/full-suite-paths-check.sh +144 -0
  194. package/scripts/gate-reaper-check.sh +98 -0
  195. package/scripts/gate-reaper.sh +125 -0
  196. package/scripts/gate-run.sh +73 -0
  197. package/scripts/gc-content-check.sh +140 -0
  198. package/scripts/gen-dev-config.py +20 -0
  199. package/scripts/govern-bound-check.sh +60 -0
  200. package/scripts/govern-claims-check.sh +233 -0
  201. package/scripts/govern-mem-check.sh +290 -0
  202. package/scripts/governor-doors-check.sh +362 -0
  203. package/scripts/governor-escape-check.sh +171 -0
  204. package/scripts/health.sh +413 -0
  205. package/scripts/id-inventory.mjs +418 -0
  206. package/scripts/land.sh +551 -0
  207. package/scripts/lib/gc-finished.sh +77 -0
  208. package/scripts/lib/govern.sh +361 -0
  209. package/scripts/lib/govern.ts +756 -0
  210. package/scripts/lighthouse-run.sh +187 -0
  211. package/scripts/livekit-live-check.sh +61 -0
  212. package/scripts/livekit-ratchet.sh +46 -0
  213. package/scripts/load-guard-check.sh +49 -0
  214. package/scripts/machine-check.sh +102 -0
  215. package/scripts/machine-watch.sh +177 -0
  216. package/scripts/one-agents.mjs +415 -0
  217. package/scripts/one-resume.sh +78 -0
  218. package/scripts/orphan-baseline.json +182 -0
  219. package/scripts/orphan-modules.mjs +179 -0
  220. package/scripts/pr-body.sh +335 -0
  221. package/scripts/preview-fd-check.sh +289 -0
  222. package/scripts/promise-manifest.mjs +24 -1
  223. package/scripts/release.sh +322 -0
  224. package/scripts/roles-check.sh +946 -0
  225. package/scripts/sdk-build-cached.sh +64 -0
  226. package/scripts/signal-watch.sh +241 -0
  227. package/scripts/skills-publish.sh +94 -0
  228. package/scripts/speed-cache-check.sh +173 -0
  229. package/scripts/speed-check.mjs +907 -0
  230. package/scripts/speed-parity-check.sh +648 -0
  231. package/scripts/speed-waterfall-check.sh +355 -0
  232. package/scripts/substrate-env-parity.mjs +156 -0
  233. package/scripts/tasks-claim-race.mjs +108 -0
  234. package/scripts/tasks-loop.sh +185 -0
  235. package/scripts/test-cached.sh +255 -0
  236. package/scripts/test-full.sh +87 -0
  237. package/scripts/test-honesty.mjs +137 -0
  238. package/scripts/test-lanes.sh +166 -0
  239. package/scripts/test-speed.sh +94 -0
  240. package/scripts/triage-shape-check.sh +149 -0
  241. package/scripts/tsc-cached.sh +179 -0
  242. package/scripts/typedb-flake-check.sh +197 -0
  243. package/scripts/urls-lint.sh +15 -0
  244. package/scripts/verify-fast.sh +445 -0
  245. package/scripts/vespio-sync.sh +149 -0
  246. package/scripts/wf-check.mjs +104 -1
  247. package/scripts/worktree-preview.sh +879 -0
  248. package/scripts/worktree-up.sh +208 -0
  249. package/skills/livekit-agents/SKILL.md +285 -0
  250. package/skills/livekit-agents/references/freshness-rules.md +168 -0
  251. package/skills/shadcn/SKILL.md +1 -1
  252. package/skills/signal/SKILL.md +0 -1
  253. package/skills/voice/SKILL.md +94 -6
  254. package/skills/voice/corpus-check.sh +87 -0
  255. package/hooks/scripts/compact-hint.sh +0 -35
  256. package/hooks/scripts/gate-guard.sh +0 -83
  257. package/hooks/scripts/read-tracker.sh +0 -26
  258. package/hooks/scripts/session-end-verify.sh +0 -51
  259. package/hooks/scripts/stop-reflect.sh +0 -140
  260. package/hooks/scripts/sync-priority-todo.sh +0 -57
  261. package/hooks/scripts/sync-todo-docs.sh +0 -46
  262. package/hooks/scripts/tool-signal.sh +0 -48
  263. package/scripts/do-tasks-bridge.py +0 -366
@@ -0,0 +1,153 @@
1
+ # W4 — verification tooling (loaded on demand)
2
+
3
+ Companion to `.claude/agents/w4-verify.md`. Split out 2026-09-01: this block is
4
+ ~9KB of per-dimension tool recipes that a W4 agent pays for on every spawn but
5
+ uses only when the cycle's dimensions call for them.
6
+
7
+ **The security grep at the end is NOT optional.** It is the zero-LLM backstop a
8
+ scored security dimension cannot replace; W4 runs it on every cycle. Everything
9
+ above it is conditional on the dimension being scored.
10
+
11
+ ---
12
+
13
+ ## Verification Tools
14
+
15
+ Use these to produce the numbers — not estimates.
16
+
17
+ ### Lighthouse (Speed dim)
18
+
19
+ **File → route map** (derive pages to audit from files touched in W3):
20
+
21
+ | Touched path pattern | Audit URL |
22
+ |---------------------|-----------|
23
+ | `src/pages/index.astro` | `http://localhost:4321/` |
24
+ | `src/pages/get-yours.astro` | `http://localhost:4321/get-yours` |
25
+ | `src/pages/u/**` | `http://localhost:4321/u/demo` |
26
+ | `src/components/chat/**` | `http://localhost:4321/chat` |
27
+ | `src/components/**` | `http://localhost:4321/` + `/chat` |
28
+ | `src/layouts/**` | all pages |
29
+ | `src/pages/api/**` | skip (server routes — no Lighthouse) |
30
+
31
+ **Pre-flight check before running:**
32
+
33
+ ```bash
34
+ # 1. Check lighthouse is installed
35
+ which lighthouse || npx lighthouse --version 2>/dev/null
36
+ LIGHTHOUSE_OK=$?
37
+
38
+ # 2. Check dev server is up (start it if needed)
39
+ curl -sf http://localhost:4321/ > /dev/null 2>&1
40
+ SERVER_OK=$?
41
+
42
+ if [ $SERVER_OK -ne 0 ]; then
43
+ bun run dev > /tmp/dev-server.log 2>&1 &
44
+ DEV_PID=$!
45
+ # Poll until ready (max 15s)
46
+ for i in $(seq 1 15); do
47
+ sleep 1
48
+ curl -sf http://localhost:4321/ > /dev/null 2>&1 && break
49
+ done
50
+ curl -sf http://localhost:4321/ > /dev/null 2>&1
51
+ SERVER_OK=$?
52
+ fi
53
+ ```
54
+
55
+ **If both available — run Lighthouse:**
56
+
57
+ ```bash
58
+ # Run against each derived page URL
59
+ npx lighthouse http://localhost:4321/chat --output=json --quiet \
60
+ --chrome-flags="--headless --no-sandbox" \
61
+ | jq '{
62
+ perf: (.categories.performance.score * 100 | round),
63
+ a11y: (.categories.accessibility.score * 100 | round),
64
+ bp: (.categories["best-practices"].score * 100 | round),
65
+ seo: (.categories.seo.score * 100 | round),
66
+ failing_audits: [.audits | to_entries[]
67
+ | select(.value.score != null and .value.score < 1)
68
+ | {audit: .key, score: .value.score, desc: .value.description}]
69
+ }'
70
+ ```
71
+
72
+ Scores are 0–1 from Lighthouse; multiply by 100. Target is 100 on all four.
73
+ The `failing_audits` array tells you exactly which audit to fix — include these in the
74
+ `→ improve:` instruction so the next cycle knows precisely what to address.
75
+
76
+ **If Lighthouse unavailable — fallback scoring:**
77
+
78
+ ```
79
+ Score speed on what IS measurable:
80
+ - Bundle size vs .w0-baseline.json: bundleKB delta
81
+ - Build time vs .w0-baseline.json: buildMs delta
82
+ - Hydration grep: no new client:load where client:idle suffices
83
+
84
+ Cap speed score at 0.80 when Lighthouse skipped.
85
+ Flag in receipt: "lighthouse: skipped — run manually to confirm 100%"
86
+ Do NOT score 1.0 for speed without a real Lighthouse number.
87
+ ```
88
+
89
+ ### Playwright (functional + a11y verification)
90
+
91
+ Playwright runs only when the cycle declares `requires_playwright: true` (testing policy,
92
+ `.claude/commands/do.md`). Vitest is the default; do not add a Playwright gate to a cycle
93
+ that did not ask for one.
94
+
95
+ ```bash
96
+ # Only if the cycle declares requires_playwright AND a config exists
97
+ if [ -f playwright.config.ts ] || [ -f playwright.config.js ]; then
98
+ npx playwright test --reporter=line 2>&1 | tail -20
99
+ # a11y scan (axe-playwright) on touched pages — if that suite exists
100
+ [ -d tests/a11y ] && npx playwright test tests/a11y --reporter=line
101
+ else
102
+ echo "playwright: n/a — no config in this folder"
103
+ fi
104
+ ```
105
+
106
+ Playwright failures are stability failures — they join the vitest gate.
107
+ A11y failures from playwright count against the Accessibility Lighthouse category.
108
+ Absent config → `playwright: n/a`, never a silent pass.
109
+
110
+ ### Bundle size (Speed dim)
111
+
112
+ ```bash
113
+ # Check CF Worker bundle size
114
+ npx wrangler deploy --dry-run --outdir=.wrangler/output 2>&1 | grep -E 'Total|gzip'
115
+
116
+ # Or check Astro build output (in the package folder — no root package.json)
117
+ FOLDER="${FOLDER:-one.ie/web}"
118
+ ( cd "$FOLDER" && bun run build ) 2>&1 | grep -E 'dist/|\.js|\.css|kB'
119
+
120
+ # Delta vs W0: compare to the buildMs + sizes recorded in W0
121
+ ```
122
+
123
+ ### TypeScript strict check (Stability dim)
124
+
125
+ ```bash
126
+ npx tsc --noEmit --strict 2>&1 | grep -c 'error TS' # 0 = pass
127
+ ```
128
+
129
+ ### Security grep (Security dim)
130
+
131
+ ```bash
132
+ # Run against the diff only (staged + unstaged changes from W3)
133
+ # secrets
134
+ git diff HEAD | grep -E '^\+' | grep -iE 'api[_-]?key|secret|password|token' \
135
+ | grep -vE '^\+\+\+|zod|schema|type |interface |//|process\.env\.PUBLIC'
136
+
137
+ # injection vectors
138
+ git diff HEAD | grep -E '^\+.*eval\(' | grep -v '// allow'
139
+ git diff HEAD | grep -E '^\+.*dangerouslySetInnerHTML' | grep -v 'sanitize\|DOMPurify'
140
+
141
+ # Worker env access
142
+ git diff HEAD | grep -E '^\+.*process\.env' | grep -v '// allow\|PUBLIC_'
143
+
144
+ # CORS wildcard
145
+ git diff HEAD | grep -E '^\+.*Access-Control-Allow-Origin.*\*'
146
+
147
+ # TypeDB string concatenation in queries (parameterized form required)
148
+ git diff HEAD | grep -E '^\+' | grep -E 'define|match|insert' \
149
+ | grep -E '\+\s*[`"\x27]|\.concat\(|\$\{' | grep -iE 'typedb|tql|query'
150
+ ```
151
+
152
+ Zero hits across all greps = security score eligible for 1.0.
153
+ Each hit = `→ improve: file:line — what the pattern is`.
@@ -77,8 +77,15 @@ The rubric is not a verdict; it is a map forward.
77
77
  failure and must never be reported as one:
78
78
  ```bash
79
79
  FOLDER="${FOLDER:-one.ie/web}" # bind it — an unset FOLDER means cd "" = repo root
80
- ( cd "$FOLDER" && bun run verify ) # one.ie/web = sdk build + tsc + vitest
80
+ ( cd "$FOLDER" && bun run verify:fast ) # DEV LANE sdk build + tsc + related tests + pins
81
81
  ```
82
+ **`verify:fast` is the default for a build cycle.** The full 875-file suite is the
83
+ REVIEW gate, not the per-wave gate: it runs at `/close`, at `./deploy`, and on demand
84
+ via `FULL_VERIFY=1 bun run verify:fast`. Run the FULL gate — not fast — when any of:
85
+ the cycle is the LAST cycle of the plan · it touched `schema/`, `packages/sdk/`, or
86
+ auth/authority code · W3 renamed or deleted a file · a fast pass just went red and you
87
+ are confirming the fix. Report which lane ran (`lane: fast|full`) in the receipts; a
88
+ fast pass is never reported as a full pass.
82
89
  Bind `FOLDER` to the cycle's folder before running (`do-folder.sh` resolves it;
83
90
  `one.ie/web` is the default for web work). Capture exit code and counts. If `bun` is
84
91
  unavailable, fall back to `( cd "$FOLDER" && npm run verify )`. If the folder has no `verify` script,
@@ -361,148 +368,23 @@ If `.w0-rubric.json` is absent, set `velocity: null` and omit deltas.
361
368
  header comments for the same.
362
369
 
363
370
  ---
364
-
365
371
  ## Verification Tools
366
372
 
367
- Use these to produce the numbers not estimates.
368
-
369
- ### Lighthouse (Speed dim)
370
-
371
- **File → route map** (derive pages to audit from files touched in W3):
373
+ Recipes live in `.claude/agents/w4-tools.md` **read it when you score the
374
+ dimension that needs it**, not by default:
372
375
 
373
- | Touched path pattern | Audit URL |
374
- |---------------------|-----------|
375
- | `src/pages/index.astro` | `http://localhost:4321/` |
376
- | `src/pages/get-yours.astro` | `http://localhost:4321/get-yours` |
377
- | `src/pages/u/**` | `http://localhost:4321/u/demo` |
378
- | `src/components/chat/**` | `http://localhost:4321/chat` |
379
- | `src/components/**` | `http://localhost:4321/` + `/chat` |
380
- | `src/layouts/**` | all pages |
381
- | `src/pages/api/**` | skip (server routes — no Lighthouse) |
376
+ | Dimension | Tool | Condition |
377
+ |---|---|---|
378
+ | Speed | Lighthouse | cycle touched a page/route |
379
+ | Stability | Playwright | cycle declares `requires_playwright: true` — never otherwise |
380
+ | Speed | Bundle size | cycle changed worker/Astro build output |
381
+ | Stability | `tsc --strict` | always |
382
+ | **Security** | **security grep over the diff** | **ALWAYS — mandatory, zero-LLM** |
382
383
 
383
- **Pre-flight check before running:**
384
-
385
- ```bash
386
- # 1. Check lighthouse is installed
387
- which lighthouse || npx lighthouse --version 2>/dev/null
388
- LIGHTHOUSE_OK=$?
389
-
390
- # 2. Check dev server is up (start it if needed)
391
- curl -sf http://localhost:4321/ > /dev/null 2>&1
392
- SERVER_OK=$?
393
-
394
- if [ $SERVER_OK -ne 0 ]; then
395
- bun run dev > /tmp/dev-server.log 2>&1 &
396
- DEV_PID=$!
397
- # Poll until ready (max 15s)
398
- for i in $(seq 1 15); do
399
- sleep 1
400
- curl -sf http://localhost:4321/ > /dev/null 2>&1 && break
401
- done
402
- curl -sf http://localhost:4321/ > /dev/null 2>&1
403
- SERVER_OK=$?
404
- fi
405
- ```
406
-
407
- **If both available — run Lighthouse:**
408
-
409
- ```bash
410
- # Run against each derived page URL
411
- npx lighthouse http://localhost:4321/chat --output=json --quiet \
412
- --chrome-flags="--headless --no-sandbox" \
413
- | jq '{
414
- perf: (.categories.performance.score * 100 | round),
415
- a11y: (.categories.accessibility.score * 100 | round),
416
- bp: (.categories["best-practices"].score * 100 | round),
417
- seo: (.categories.seo.score * 100 | round),
418
- failing_audits: [.audits | to_entries[]
419
- | select(.value.score != null and .value.score < 1)
420
- | {audit: .key, score: .value.score, desc: .value.description}]
421
- }'
422
- ```
423
-
424
- Scores are 0–1 from Lighthouse; multiply by 100. Target is 100 on all four.
425
- The `failing_audits` array tells you exactly which audit to fix — include these in the
426
- `→ improve:` instruction so the next cycle knows precisely what to address.
427
-
428
- **If Lighthouse unavailable — fallback scoring:**
429
-
430
- ```
431
- Score speed on what IS measurable:
432
- - Bundle size vs .w0-baseline.json: bundleKB delta
433
- - Build time vs .w0-baseline.json: buildMs delta
434
- - Hydration grep: no new client:load where client:idle suffices
435
-
436
- Cap speed score at 0.80 when Lighthouse skipped.
437
- Flag in receipt: "lighthouse: skipped — run manually to confirm 100%"
438
- Do NOT score 1.0 for speed without a real Lighthouse number.
439
- ```
440
-
441
- ### Playwright (functional + a11y verification)
442
-
443
- Playwright runs only when the cycle declares `requires_playwright: true` (testing policy,
444
- `.claude/commands/do.md`). Vitest is the default; do not add a Playwright gate to a cycle
445
- that did not ask for one.
446
-
447
- ```bash
448
- # Only if the cycle declares requires_playwright AND a config exists
449
- if [ -f playwright.config.ts ] || [ -f playwright.config.js ]; then
450
- npx playwright test --reporter=line 2>&1 | tail -20
451
- # a11y scan (axe-playwright) on touched pages — if that suite exists
452
- [ -d tests/a11y ] && npx playwright test tests/a11y --reporter=line
453
- else
454
- echo "playwright: n/a — no config in this folder"
455
- fi
456
- ```
457
-
458
- Playwright failures are stability failures — they join the vitest gate.
459
- A11y failures from playwright count against the Accessibility Lighthouse category.
460
- Absent config → `playwright: n/a`, never a silent pass.
461
-
462
- ### Bundle size (Speed dim)
463
-
464
- ```bash
465
- # Check CF Worker bundle size
466
- npx wrangler deploy --dry-run --outdir=.wrangler/output 2>&1 | grep -E 'Total|gzip'
467
-
468
- # Or check Astro build output (in the package folder — no root package.json)
469
- FOLDER="${FOLDER:-one.ie/web}"
470
- ( cd "$FOLDER" && bun run build ) 2>&1 | grep -E 'dist/|\.js|\.css|kB'
471
-
472
- # Delta vs W0: compare to the buildMs + sizes recorded in W0
473
- ```
474
-
475
- ### TypeScript strict check (Stability dim)
476
-
477
- ```bash
478
- npx tsc --noEmit --strict 2>&1 | grep -c 'error TS' # 0 = pass
479
- ```
480
-
481
- ### Security grep (Security dim)
482
-
483
- ```bash
484
- # Run against the diff only (staged + unstaged changes from W3)
485
- # secrets
486
- git diff HEAD | grep -E '^\+' | grep -iE 'api[_-]?key|secret|password|token' \
487
- | grep -vE '^\+\+\+|zod|schema|type |interface |//|process\.env\.PUBLIC'
488
-
489
- # injection vectors
490
- git diff HEAD | grep -E '^\+.*eval\(' | grep -v '// allow'
491
- git diff HEAD | grep -E '^\+.*dangerouslySetInnerHTML' | grep -v 'sanitize\|DOMPurify'
492
-
493
- # Worker env access
494
- git diff HEAD | grep -E '^\+.*process\.env' | grep -v '// allow\|PUBLIC_'
495
-
496
- # CORS wildcard
497
- git diff HEAD | grep -E '^\+.*Access-Control-Allow-Origin.*\*'
498
-
499
- # TypeDB string concatenation in queries (parameterized form required)
500
- git diff HEAD | grep -E '^\+' | grep -E 'define|match|insert' \
501
- | grep -E '\+\s*[`"\x27]|\.concat\(|\$\{' | grep -iE 'typedb|tql|query'
502
- ```
384
+ The security grep is the deterministic backstop for the security dimension (a
385
+ scored score can miss a leaked key). Absent tool ⇒ report `n/a`, never `ok` — an
386
+ absent tool is an unrun check, not a green one.
503
387
 
504
- Zero hits across all greps = security score eligible for 1.0.
505
- Each hit = `→ improve: file:line — what the pattern is`.
506
388
 
507
389
  13. **Write improvement artifacts** — this is how the system learns.
508
390
 
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: workflow-optimiser
3
+ description: "Watches every workflow's edge weights and proposes the one evidenced fix. For: workflow, bottleneck."
4
+ tools: "Read, Grep, Glob, Bash, Edit, Write, WebFetch"
5
+ model: sonnet
6
+ color: blue
7
+ ---
8
+ <!-- GENERATED by .claude/scripts/one-agents.mjs from one.ie/ai/agents/workflow-optimiser/agent.md — do not hand-edit.
9
+ Edit the platform agent, then re-run the generator. -->
10
+
11
+ ## Substrate constants (you inherit no CLAUDE.md — these are the locked facts)
12
+
13
+ You are running inside the ONE monorepo at `/Users/toc/Server/one-ie`.
14
+
15
+ **6 dimensions (LOCKED, never rename):** Groups · Actors · Things · Paths · Events · Learning.
16
+ Dead names that must never appear: knowledge, connections, people, node, scent, alarm, trail, colony.
17
+
18
+ **6 verbs (LOCKED):** `signal` · `mark` · `warn` · `fade` · `follow` · `harden`.
19
+ Every signal closes with `mark()`, `warn()`, or dissolve. **No silent returns.**
20
+
21
+ **Tags are BARE words** — `marketing`, `lead`, `engineering` — never `lifecycle:marketing`.
22
+ A namespaced subscribe tag matches zero signals.
23
+
24
+ **Structural time** — plan in tasks → waves → cycles. Never days/hours/weeks.
25
+
26
+ **Where things live:** web UI + API routes `one.ie/web/` · TypeDB schema `schema/` (never
27
+ duplicate .tql elsewhere) · specs and docs `text/` · payments `pay/` · agent runtime `channels/`.
28
+ Backend routes live ONLY in `one.ie/web/src/pages/api/`.
29
+
30
+ **Tests:** `bun run verify:fast` is the dev lane; the full `bun run verify` (~87s) is the review
31
+ gate. Say which lane you ran — a fast pass is never reported as a full pass. A test touching the
32
+ DOM needs `// @vitest-environment jsdom` on line 1.
33
+
34
+ **Where you collaborate, and where you plan.** `/u/<slug>/in` is the room. Its Spaces ARE
35
+ your `subscribes:` tags — `FN_TAGS` maps a department to bare words
36
+ (`one.ie/web/src/lib/in/spaces.ts:28`), so staking `marketing` IS having a desk in the
37
+ marketing Space. `/u/<slug>/tasks` is the same words as plannable rows.
38
+
39
+ **A task comment is a message in that room — one store, one renderer, one vocabulary.**
40
+ `tasks:comment` writes to the SAME D1 message store the inbox thread uses
41
+ (`one.ie/web/src/lib/resolvers/tasks.ts:1639`, thread id `task:<tid>` at `:1665`), and it
42
+ renders through the same `Thread` component the conversation uses
43
+ (`one.ie/web/src/components/in/TaskDetail.tsx:13,859`). An `@mention` in a comment body
44
+ INSERTs a `follows` row (`resolvers/tasks.ts:1686-1693`) — mentioning someone subscribes
45
+ them to that task. So: report where the work already is. Never open a second room, and never
46
+ invent a second vocabulary — the tag that routes your signal is the same word that names your
47
+ Space and tags the task.
48
+
49
+ **Proof discipline:** a presence grep is not proof. Probe the running thing. Report numbers you
50
+ actually measured, and say plainly when a check did not run — an unrun gate is not a pass.
51
+
52
+ ---
53
+
54
+ # Workflow Optimiser
55
+
56
+ You watch the weights every workflow already deposits — `workflow_edge.strength` on every completed traversal, `resistance` on every stall or failure (`one.ie/web/src/lib/workflow-executor.ts`). Those numbers are the workflow's own memory of what worked. Your job is to read them, find the one bottleneck worth fixing, and bring the owner exactly one evidenced diff to approve.
57
+
58
+ ## What you do
59
+
60
+ **1. Read the weights.** Call `workflow:get` for the workflow in question. Run `bottleneckEdges()` (`one.ie/web/src/lib/workflow-edits.ts`) over its edges — that is the canonical definition of "worth fixing": resistance has outpaced strength.
61
+
62
+ **2. Cite the numbers.** Never propose from a hunch. `edgeEvidence()` turns the bottleneck edges into the human-readable line you attach to the proposal — the exact strength/resistance a human can verify against the canvas.
63
+
64
+ **3. Propose exactly ONE diff.** A single `workflow:apply-diff`-shaped edit that addresses the highest-resistance bottleneck — reroute, drop, or add a human gate before it. Never batch multiple fixes into one proposal; the owner approves or rejects one claim at a time.
65
+
66
+ **4. Refuse without evidence.** If no edge clears the bottleneck threshold, say so and propose nothing. A proposal with no cited numbers is a guess wearing a diff's clothes.
67
+
68
+ ## Operating instructions
69
+
70
+ - You never call `workflow:apply-diff` yourself — you propose, a human taps approve. Auto-applying is out of scope by design (`text/workflows.md`).
71
+ - Decay is not your job — the daily `workflow:fade` tick already ages weights down; you read whatever is current at the moment you're asked.
72
+ - Escalate to the workflow's owner (via chat), not to `cto` — the owner is the one who can approve the diff.
73
+
74
+ ## Output format
75
+
76
+ One proposal: `{workflowId, edge: {source, target}, evidence: "<edgeEvidence() line>", diff: <WorkflowDiff>}` — or `{ok: false, reason: "no bottleneck clears the threshold"}`.
77
+
78
+ ---
79
+
80
+ ## Closing the loop
81
+
82
+ Return a compact report: what you found or did, the file:line evidence, and one
83
+ sentence naming what you did NOT do. If you were asked for something you cannot
84
+ verify, say so — do not fill the gap with a plausible answer.