| name | install-fast-deterministic-tools |
|---|---|
| description | Install fast deterministic TypeScript/JS tooling (tsgo, bun, knip, oxc, fallow, agent-ci) and wire them into a pre-commit hook so agents get fast feedback and quality code lands in PRs. Use when user wants to set up an agentic validation loop, add deterministic guardrails, speed up CI/local checks, or replace slow tsc/eslint/prettier with native-speed equivalents. |
| author | François Best <github@francoisbest.com> |
Goal: give agents (and humans) instant feedback via deterministic, native-speed tools. Wire them into pre-commit so the agent self-corrects before a commit lands, and into CI as a safety net.
- LLMs: malleable, slow, non-reproducible. Good for judgment.
- Deterministic tools: fast, reproducible, dumb about intent. Good for enforcement.
- Speed matters: faster loop = better prompt cache hits = cheaper + greener + flow-preserving.
| Tool | Lang | Replaces | Job |
|---|---|---|---|
tsgo |
Go | tsc |
Typecheck. TS v7 native preview, package @typescript/native-preview. |
bun |
Zig | node + npm/pnpm + jest/vitest |
Runtime, package manager, test runner, script runner. No transpile. |
knip |
TS | — | Find dead code: unused exports, files, deps. Agents leave junk; knip deletes it. |
oxlint |
Rust | eslint |
Lint (ESLint-compatible rules). |
oxfmt |
Rust | prettier |
Format + import sort + package.json field sort. |
fallow |
Rust | partial knip + lint | Duplication detection, complexity. Verbose — watch token cost in agent loops. |
agent-ci |
TS | act |
Run GitHub Actions locally so agents validate before pushing (avoids ping-pong CI commits). |
Modern Node.js is a viable, less-VC-funded alternative to bun for runtime + test runner.
bun add -d @typescript/native-preview knip oxlint oxfmt fallow
# agent-ci: follow upstream install instructions (early-stage, check repo)package.json scripts:
{
"scripts": {
"typecheck": "tsgo --noEmit",
"lint": "oxlint",
"format": "oxfmt",
"format:check": "oxfmt --check",
"deadcode": "knip",
"test": "bun test",
"validate": "bun run typecheck && bun run lint && bun run format:check && bun run deadcode && bun run test"
}
}Prefer Git 2.54+ config-based hooks. Native, declarative, no dependency, multiple hooks per event, listable via git hook list pre-commit, disable-able via enabled = false. Lives in .git/config (repo), ~/.gitconfig (user), or /etc/gitconfig (system).
# .git/config (or commit a snippet to be sourced via git config --local include.path)
[hook "format"]
event = pre-commit
command = bunx oxfmt
[hook "lint"]
event = pre-commit
command = bunx oxlint
[hook "typecheck"]
event = pre-commit
command = bunx tsgo --noEmit
[hook "deadcode"]
event = pre-commit
command = bunx knipInspect: git hook list pre-commit. Disable one ad hoc: git config hook.lint.enabled false.
Fallback for Git < 2.54 — pick one:
lefthook— fast (Go), parallel, supports{staged_files}andstage_fixed. Recommended.husky— most ubiquitous, JS-based, simpler config but slower bootstrap.- Plain
.git/hooks/pre-commitscript — zero deps, but not shareable across the team.
# lefthook.yml (fallback)
pre-commit:
parallel: true
commands:
format:
run: bunx oxfmt {staged_files}
stage_fixed: true
lint:
run: bunx oxlint {staged_files}
typecheck:
run: bunx tsgo --noEmit
deadcode:
run: bunx knip# husky equivalent: .husky/pre-commit
bunx oxfmt && bunx oxlint && bunx tsgo --noEmit && bunx knipLoop intent: agent attempts a commit → hook runs → auto-fixes applied → checker failures surface as actionable diffs → agent reads, fixes, retries. Only clean code reaches the PR.
Mirror the same bun run validate in CI as a safety net. If the pre-commit hook ran, CI is a no-op; if someone bypassed it, CI catches it.
- Deterministic first. Can a tool catch this? Add/configure rule.
- Malleable second. Only if no tool fits, write guidance in
AGENTS.md/CLAUDE.md.
Tools enforce; prose guides. Don't write a paragraph when a lint rule will do.
tsgois beta — pin the version, expect rough edges, keeptscas fallback in CI for now if shipping prod.oxlintdoesn't yet cover every ESLint rule — audit your existing config before swapping.fallowis verbose; for agent loops, pipe through--quietor filter to keep token usage sane.agent-ciis early;actis the legacy fallback if it doesn't work for your workflow.knipneeds configuration tuning per project to avoid false positives on entrypoints.