Skip to content

Development

m4bwav edited this page Nov 19, 2026 · 3 revisions

Agent rules for the repository are in AGENTS.md; the handoff and the session log are in ai-docs/.

Tests

The development package.json lives in dev/, so installing the plugin installs nothing:

npm ci
npm test

Run both in dev/. npm test runs node --test ../tests/*.test.mjs: unit tests and browser tests that check every template. The v1.6.0 run on Windows (2026-11-18) gave 74 tests, 71 passed, 3 skipped, 0 failed; the 0.6.7 run's summary is kept below:

ℹ tests 66
ℹ pass 63
ℹ fail 0
ℹ skipped 3

The three skips are the templates with a build step (vite-ts, r3f, game-starter): they are built and their dist checked only when the template's own node_modules exists (npm ci in the template folder). Browser tests skip when no Chrome is found. The repository has no CI workflow; run the tests before committing.

Since 0.6.7, the --save/--against assertion uses a static fixture. Comparing two independently animated starter runs could report a real pixel change on a busy machine. The separate perf test still measures the animated starter.

Every CLI change has a test in tests/. scripts/tw.mjs stays dependency-free and runs on Windows, macOS and Linux.

The knowledge base

Edit kb/**/*.md by kb/SCHEMA.md, then:

tw kb validate --strict
tw kb index

validate checks frontmatter, sections, sources, the lint rules' sample and ok texts, and lints code fences in current entries; --strict also fails on an em dash outside code. See The knowledge base.

After a three.js release, tw deprecations lists @deprecated markers no lint rule covers and tw versions --check lists packages the kb and templates are behind on; threewright-curate does the refresh. Release numbers come from npm tarballs (npm pack three@0.<N>.0) or the installed source, never from memory.

Evals

Each skill's eval cases are exported under evals/<skill>/. evals/headless/run.py runs the action and outcome cases through claude -p --plugin-dir in fresh workspaces (3 runs each plus a no-plugin baseline, resumable) and evals/headless/grade.py grades them into evals/results/headless-latest.md. Cases the baseline also passes are marked redundant and skipped unless --all. HANDOFF puts a run at about $0.50 and a full pass at 37 runs; rerun only the skill that changed (--filter <skill>). evals/run-triggers.sh runs the trigger and decoy cases.

Releases

Bump .claude-plugin/plugin.json, the root plugin.json and dev/package.json together (knowledge additions minor, fixes patch, breaking CLI or schema changes major), move the CHANGELOG's Unreleased entries under the version, tag vX.Y.Z and publish a GitHub Release for the tag with the CHANGELOG section as notes. Work lands on main through pull requests; side branches are merged and deleted.

The wiki

The wiki's examples are run by ai-docs/notes/2026-10-26-wiki-verify.py, which downloads a tag's source archive into a scratch folder and runs every command the pages show; its saved output is next to it. ai-docs/notes/2026-10-26-github-wiki.md says how to update the wiki for the next release.

Clone this wiki locally