src/contains the TypeScript CLI and library implementation. Commands live insrc/bin/; analyzer, updater, guardrail, generator, and SSG modules are grouped by directory.tests/contains Vitest unit and contract tests. Packaging checks requiring nested installs live intests/integration/and usevitest.integration.config.ts.skills/contains shipped agent skills;docs/contains command and design documentation;benchmarks/contains performance suites.- Build artifacts are emitted to
dist/and are not source files.
Use Node LTS and npm from the repository root. Install dependencies with npm install (CI uses npm ci).
npm run fmtformats the repository; add-- --checkfor CI-style verification.npm run lintruns Vite+ linting over source, tests, benchmarks, and config files.npm run typecheckruns the TypeScript compiler without emitting files.npm testruns the standard Vitest suite;npm run test:coverageadds coverage reporting.npm run test:peer-floorandnpm run test:templatesrun packaging integration tests.npm run buildproduces the distributable CLI indist/;npm run devrebuilds in watch mode.npm run checkruns the main release checks;npm run benchruns performance gates.
Use TypeScript with two-space indentation, semicolons, and double-quoted strings. Let Vite+ format and lint enforce style. Use kebab-case for filenames, descriptive *.test.ts names, and keep tests near their domain (integration tests under tests/integration/). Prefer small, typed helpers and explicit error messages.
Keep every command narratable from explicit arguments and project files through one visible operation and result. Reject invalid configuration, ambiguous ownership, and unsupported project state at the boundary with errors that name the file or option and the corrective action. Test distinguishable parse, analysis, generation, update, and packaging failure paths. Keep CLI commands, analyzer rules, generators, SSG, and shipped skills independently legible. Prefer explicit command options and registries over discovery or auto-wiring, and add commands or flags only for demonstrated application needs.
Performance work must preserve this causal model. A change is ready only when its behavior has a one-sentence explanation, misuse is caught where it occurs, and docs match the verified command and installed-package behavior.
Add regression tests with every behavior change. Use Vitest’s test/describe APIs and deterministic fixtures; avoid sleeps and network-dependent assumptions outside packaging integration tests. Run focused tests first, then npm test, npm run typecheck, and relevant integration or benchmark commands.
Use imperative, conventional commit subjects such as fix: ..., test: ..., ci: ..., or chore: .... Keep commits focused. Pull requests should explain the behavior change, identify validation commands and results, link the relevant issue, and call out workflow, package, or release implications. Do not publish packages or create tags without explicit authorization.
Do not commit credentials, generated dist/ output, temporary tarballs, or local node_modules/. Preserve package-lock.json whenever dependency manifests change. Prefer npm ci for reproducible CI installs and review npm script-install warnings before approving new dependencies.
A benchmark number is only half of an optimization's success criterion. The change must also preserve a causal path that a human or agent can narrate in one sentence.
Every benchmark-driven change must include:
- the one-sentence causal description of the optimized path;
- the exact fallback trigger and proof that optimized and fallback paths have identical observable behavior and error surfaces;
- an explicit legibility-cost statement, including
nonewhen no new path or concept is introduced; and - evidence that a measured bottleneck in a real application justifies the optimization now.
Prefer making the existing single path faster. New caches, inference, memoization, shortcuts, fast paths, or scheduler states require an explicit legibility decision; a speedup alone does not justify them.