agent harness · ts · py · swift[ release / 1.13.1 — 2026 ]
Rules give
your agent freedom.
klint is the bridge between vibe coding and agentic engineering — architecture-level rules your AI cannot ignore, declared in YAML, enforced at the Stop hook.
[ marginalia ]An agent that knows the boundaries spends zero cognitive overhead second-guessing them. The tighter the harness, the wider the runway.
- 01 / LANGS
- ts · py · swift
- architecture checks
- 02 / CONFIG
- yaml, not code
- declarative architecture
- 03 / RUNTIME
- rust-backed
- macos · linux · windows
- 04 / EXITS
- --json
- structured violations
- structurally enforced
- agent-blocking exit codes
- declared in yaml
- imports · layers · forbidden · singleton
- typescript · python · swift
- rust-backed architecture checks
- homebrew · pypi · npm
- stop hook integration
- custom rules in typescript
- the agent ships the fix
01the gap
The agent didn't read your AGENTS.md.
Or it did, then it forgot. Or it drifted three turns later. Instructions in a prompt are a contract with no enforcement — a model that's context-starved or just wrong will violate them silently and ship anyway.
AGENTS.md tells the model what to do.
klint ensures it actually did.
02architecture-as-code
Architecture as code.
Four primitives. One YAML file. Every rule you'd otherwise hide in AGENTS.md and pray, expressed declaratively and enforced structurally.
klint.yaml · 4 primitives
Layers
Name your architectural zones once. Reference them everywhere — no glob copy-paste, no drift between rules.
Imports
Deny lists, allowlists, type-only exceptions. The dependency graph your README claims you have.
Forbidden
Block literal strings — console.log, process.exit, raw SDK fetches — scoped to the layer.
Singleton
Pin a pattern to one file. Every other touch is a violation — the only honest way to enforce a module of record.
03engines and distribution
Native where it should be.
klint now ships beyond the Bun package: native artifacts, Homebrew, and a Python package all point at the Rust-backed architecture engine. The TypeScript engine remains the full semantic path.
TypeScript engine
The full compatibility path: type-aware checks, custom rules, plugins, and fixes.
Rust engine
Portable architecture checks and syntax-local rules backed by tree-sitter.
Hybrid auto mode
Rust-supported rules run natively while TypeScript-owned rules stay semantic.
- npm packageprimary$bun add -d @konvert7/klint
Primary path for TypeScript projects and the full CLI surface.
- homebrew$brew install klint
Native CLI for local architecture checks on macOS.
- python$pip install klint
PyPI package wrapping the native architecture engine.
04the gate
Ships the fix, not the violation.
Run interactively. Wire into CI. Drop into the agent's Stop hook with --json and let the model self-correct before the session closes.
05stop hook
Wired into the Stop hook.
Every agent edit ends with klint. Exit 2 means the session can't close. The model reads the structured violations, fixes them, and tries again — no human in the loop, no silent drift to production.
import { runHook } from "./run-hook"; const exitCode = runHook([ "bun", "klint/cli.ts", "--json", ]); process.exit(exitCode);
- 01
agent edits files
The model writes whatever its context permits — refactor, feature, bug fix. No interference during the work loop.
- 02
stop hook fires klint
Before the agent's turn closes, klint runs against the changed layers and emits machine-readable diagnostics on stdout.
- 03
exit 2 blocks the close
Violations land in the agent's event stream as structured JSON. The session can't end until they're resolved — fix or explicit override.
- 04
agent self-corrects
The model reads the rule, the file, the line, and the message it wrote itself. Then it does the right thing. Quietly. Every time.
[ works with any agent that runs a stop hook ]
- claude code
- opencode
- codex
- cursor
- your own
06philosophy
Rules don't constrain your agent. They free it.
An agent that knows the boundaries spends zero cognitive overhead second-guessing them. It just executes — confidently, fast, inside the zone you defined. That is the freedom. The tighter the harness, the wider the runway.
- Architecture, not style
- Formatters and language linters enforce local correctness. klint enforces project boundaries and policies an agent must not bypass.
- Agent-blocking, not advisory
- A warning the model ignores is the same as no rule at all. klint exits with intent — the Stop hook respects it, the session waits, the fix lands.
- YAML, not code
- Architecture rules belong in declarative config a reviewer can read in ten seconds. Escape hatch to TypeScript exists, but most of the time you'll never reach for it.
[ aside ]Biome, oxlint, Ruff, and SwiftLint enforce syntax-level style. klint enforces what spans files, requires the type graph, and an agent must not bypass.