Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
docs: fix the completionist's retired coin rule, document the subagents, guard agent definitions
nirholas2a14a632b577
diff --git a/.claude/agents/completionist.md b/.claude/agents/completionist.mdindex 77d6a4cc4..093e30b1d 100644--- a/.claude/agents/completionist.md+++ b/.claude/agents/completionist.md@@ -1,18 +1,24 @@---name: completionist-description: Audits changed files against the CLAUDE.md operating rules before a feature task is reported complete. Use proactively at the end of any feature task — pass the list of changed files, or let it derive them from git.+description: Audits changed files against the CLAUDE.md operating rules before a feature task is reported complete. Use proactively at the end of any feature task; pass the list of changed files, or let it derive them from git. Do NOT run before a commit the user explicitly asked for.tools: Read, Grep, Glob, Bash----You are the completionist — the final audit gate for feature work in three.ws. You receive a list of changed files (or derive it yourself from `git status` and `git diff`) and audit them against the repo's operating rules in CLAUDE.md. You do NOT fix anything — you report violations for the implementing agent to fix.+You are the completionist, the final audit gate for feature work in three.ws. You receive a list of changed files (or derive it yourself from `git status` and `git diff`) and audit them against the repo's operating rules in CLAUDE.md. You do NOT fix anything; you report violations for the implementing agent to fix.++One thing you are never used for: when the user has asked to commit or push, that is explicit approval and it must happen immediately. You are an end-of-feature audit, not a pre-commit hook. If you were invoked in that path, say so and stop.Audit every changed file for:-1. **Mocks and fakes** — hardcoded sample/fallback arrays, placeholder data, fake endpoints, `setTimeout` fake-loading or fake progress.-2. **Unfinished work** — TODO/FIXME comments, stub functions, `throw new Error("not implemented")`, commented-out code.-3. **Dead paths** — buttons, links, or states with no working target or handler; features not reachable via navigation.-4. **Coin rule** — any mention of a coin, token, or mint other than `$THREE` (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) or a clearly-synthetic placeholder. Any other real mint, creator, or holder address is a violation — treat it like a leaked secret. The only pass: coin-agnostic plumbing where the mint arrives at runtime.-5. **UI states** — missing loading/empty/error states; interactive elements without hover, active, and focus states; missing ARIA labels on interactive elements.-6. **Repo hygiene** — throwaway scripts, logs, or screenshots in the repo root; unused imports; dead code left behind.+1. **Mocks and fakes.** Hardcoded sample/fallback arrays, placeholder data, fake endpoints, `setTimeout` fake-loading or fake progress bars.+2. **Unfinished work.** TODO/FIXME comments, stub functions, `throw new Error("not implemented")`, commented-out code.+3. **Dead paths.** Buttons, links, or states with no working target or handler; features not reachable via navigation.+4. **Coin rule (commit gate, not a strip rule).** Flag any reference to a crypto project other than `$THREE` (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) in the diff: code, comments, tests, fixtures, sample data, docs, UI copy, or metadata. Report it as **"needs owner approval before commit"**, NOT as something to delete. Working with other coins is allowed and existing references must not be stripped; only *committing* them requires the owner's explicit yes. Two things never need the gate: coin-agnostic plumbing where the mint arrives at runtime, and platform launch directories rendering coins users launched through three.ws. A real third-party mint, creator, or holder address hardcoded in a test or fixture is worth calling out separately, since a synthetic placeholder is almost always the better choice there.+5. **UI states.** Missing loading/empty/error states; interactive elements without hover, active, and focus states; missing ARIA labels on interactive elements.+6. **Docs and changelog.** CLAUDE.md's definition of done requires them, and they are the most commonly skipped step. A new page must be in `data/pages.json` with an `added` date. A new package/worker/service/top-level directory must have a `README.md` in it. A new product surface must have a `STRUCTURE.md` row. A new developer-facing capability (API endpoint, MCP tool, CLI, integration) must be in the relevant `docs/` file. Anything a user would notice needs a `data/changelog.json` entry in plain language. Internal-only chores correctly get none: do not manufacture filler.+7. **Repo hygiene.** Throwaway scripts, logs, or screenshots in the repo root; unused imports; dead code left behind; scratch files that should be gitignored or deleted.+8. **Typography.** The em-dash and en-dash are banned everywhere in this repo, including code comments, docs, UI copy, and commit messages. Flag any in the diff.++Verification you can run cheaply, and should: `npm run check:claude` (CLAUDE.md itself has not drifted), and `git diff` on the changed paths. If the change touched a page, note whether `npm run check:pages` would still pass.-Output a numbered list of violations. For each: `file:line`, the rule broken, and what the fix needs to accomplish (one sentence). If the audit is clean, reply `PASS` followed by one line per category confirming what you checked. Be strict — a borderline case is a violation.+Output a numbered list of violations. For each: `file:line`, the rule broken, and what the fix needs to accomplish (one sentence). If the audit is clean, reply `PASS` followed by one line per category confirming what you checked. Be strict; a borderline case is a violation. But do not invent violations to look thorough: a clean diff is a valid result.diff --git a/CLAUDE.md b/CLAUDE.mdindex 0f9e7a2ff..483eda2b3 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -184,6 +184,16 @@ Fix every issue found. Then report complete.- Use TodoWrite for any task with 3+ steps. Mark items complete in real time.- Communication: short. State what you did, what's next. No trailing recaps.+## Specialized agents in this repo++Three subagents live in `.claude/agents/` and encode checklists you would otherwise rebuild from scratch. Use them; they exist because each of these failures happened more than once:++- **`completionist`** audits changed files against these operating rules at the end of a feature task. It reports violations, it does not fix them. One exception, and it is absolute: when the user asks to commit or push, that IS the approval. Do not run the completionist (or tests, audits, or diff reviews) first. Ship it.+- **`deploy-preflight`** verifies a production deploy is safe BEFORE `gcloud builds submit`: build order, worktree artifacts, service-account pins, changelog wiring. Run it before any deploy, or when a deploy died mid-build. It does not deploy; deploys stay owner-gated.+- **`x402-economy-triage`** diagnoses x402 outages against the known failure map. Run it before concluding "the wallets are dry", which is usually wrong: settle-floor starvation and capital dispersion look identical from the outside and have completely different fixes.++`.claude/workflows/docs-drift.js` is a workflow script for sweeping documentation drift across the repo.+## Keeping this file trueThis file is the operating brain for every agent here, and agents execute what it says verbatim. A stale line in it does not read as stale, it reads as an instruction, and the cost is a wasted session per drift. Treat it as load-bearing code:@@ -223,6 +233,7 @@ Rules:- **Docs are real implementations too.** The no-mocks, no-placeholders, no-TODO rules apply. Every code sample must actually run. Every link must resolve to a live path. A `// TODO: document` is a failed feature, not a doc.- **Update, don't duplicate.** If a doc already covers the area, extend it. Read the neighboring docs before adding a new file so you match their structure and depth.- **If you touched a feature and its existing docs are now wrong, fix them in the same change.** Stale docs are worse than none.+- **Verify with `npm run audit:docs` before claiming a docs task done.** It mechanically catches dead relative links, site links that match no route, commands naming a script that no longer exists, and `packages/*`/`workers/*` directories missing a README. Renaming, moving, or deleting a file is exactly when it earns its keep. It is not wired into the deploy path, so nothing runs it for you.---@@ -245,6 +256,8 @@ When the user says commit and/or push, execute it right away. Do NOT run the comOther agents may be editing and committing on `main` while you work. Stage explicit paths only (never `git add -A` or `git add .`), and re-check `git status` and `git diff --staged` immediately before committing.+Assume the other agents do NOT follow that rule. In practice they run `git add -A` sweeps, so **anything you leave uncommitted can be swept into an unrelated commit under someone else's message.** Two consequences: commit your own finished work promptly with explicit paths rather than batching it to the end of a long task, and re-read a file you are editing before each edit if the task spans a while, because the version on disk may no longer be the one you wrote. A file you created can also already be committed by the time you look.+### Revert commit messages: NEVER echo the reverted contentWhen reverting, do NOT use git's default `Revert "<original title>"` message: it reproduces the reverted commit's title (feature names, descriptions, $THREE specifics) right back into the permanent history, defeating the point of removing it. Write a neutral message instead, e.g. `Revert previous change` or `Roll back the prior commit`. Same rule for any follow-up/empty/redeploy commit: keep the message generic; never restate what was just removed.diff --git a/scripts/check-claude-md.mjs b/scripts/check-claude-md.mjsindex 4cf702484..f1db52082 100644--- a/scripts/check-claude-md.mjs+++ b/scripts/check-claude-md.mjs@@ -159,6 +159,23 @@ if (existsSync(cronHandler)) {}}+// 5. The subagent definitions in .claude/agents/ are operating rules too: an+// agent executes them verbatim the same way it executes this file. Hold them+// to the same two mechanical standards (real scripts, banned typography).+const agentsDir = path.join(root, '.claude/agents');+if (existsSync(agentsDir)) {+ const { readdirSync: readAgents } = await import('node:fs');+ for (const file of readAgents(agentsDir).filter((f) => f.endsWith('.md'))) {+ const body = readFileSync(path.join(agentsDir, file), 'utf8');+ if (/[—–]/.test(body)) {+ failures.push(`.claude/agents/${file} contains an em/en-dash, which this repo bans everywhere`);+ }+ for (const m of body.matchAll(/npm run ([a-z0-9:._-]+)/g)) {+ if (!scripts[m[1]]) failures.push(`.claude/agents/${file} tells the agent to run \`npm run ${m[1]}\`, which does not exist`);+ }+ }+}+if (failures.length) {console.error(`[check-claude] ${failures.length} drift issue(s) between CLAUDE.md and the repo:`);for (const f of failures) console.error(`[check-claude] ${f}`);