# Enforce consistent code for agents and humans with konsistent

**Published:** July 1, 2026 | **Authors:** Felix Arntz

---

[konsistent](https://www.npmjs.com/package/konsistent) is now open source.

`konsistent` is a CLI linter for TypeScript codebases that enforces structural conventions, giving agents and humans the consistent context they need to implement features correctly. Deterministic, fast, and covers structural patterns that TypeScript and ESLint don't model.

Configure conventions in a project-level `konsistent.json` file for concerns like:

- Do all files matching pattern X export functions Y and Z?
- Does every folder that has file X also have file Y?
- Does every class exported from files matching pattern X implement type Y?

`konsistent` is used in [AI SDK](https://ai-sdk.dev/) and [Chat SDK](https://chat-sdk.dev/) to enforce structural code conventions.

```text
▲ pnpm konsistent

packages/harness-demo-code/src/index.ts
  -  error  Missing export type "DemoCodeHarnessSettings" from "./demo-code-harness"  [harness-package-must-export-harness-creator-and-settings]
  -  error  Missing export constant "demoCode"  [harness-package-must-export-harness-creator-and-settings]
packages/harness-demo-code/src/demo-code-harness.ts
  -  error  Missing required file: demo-code-auth.ts  [harness-file-must-export-harness-creator-and-settings-type]
  -  error  Missing export type "DemoCodeHarnessSettings"  [harness-file-must-export-harness-creator-and-settings-type]
  -  error  Missing import type "HarnessV1"  [harness-file-must-export-harness-creator-and-settings-type]
  -  error  Missing local type declaration "DemoCodeBridgeCoords"  [harness-file-with-bridge-must-declare-bridge-contracts]
  -  error  Missing local constant declaration "demoCodeBridgeCoordsSchema"  [harness-file-with-bridge-must-declare-bridge-contracts]
 12  error  Function "createDemoCode" must return value of type "HarnessV1"  [harness-file-must-export-harness-creator-and-settings-type]
packages/harness-demo-code/src/demo-code-bridge-protocol.ts
  -  error  Missing export type "BridgeReady"  [harness-bridge-protocol-file-must-export-relevant-symbols]
  -  error  Missing export constant "bridgeReadySchema"  [harness-bridge-protocol-file-must-export-relevant-symbols]
packages/harness-demo-code/src/bridge/index.ts
  -  error  Missing local function declaration "runTurn"  [harness-bridge-must-declare-and-use-relevant-symbols]
  -  error  Missing import "runBridge"  [harness-bridge-must-declare-and-use-relevant-symbols]
  -  error  Missing import type "StartMessage"  [harness-bridge-must-declare-and-use-relevant-symbols]
  -  error  Missing import type "BridgeEvent"  [harness-bridge-must-declare-and-use-relevant-symbols]
  -  error  Missing import type "BridgeTurn"  [harness-bridge-must-declare-and-use-relevant-symbols]
Checked 340 files in 212ms. Found 15 errors.
```

Use the konsistent skill to help your agent create a `konsistent.json`:

```bash
npx skills add vercel-labs/konsistent --skill konsistent-config
```

**Get started with konsistent**
Add the package to your project, then use the skill with your agent so it can help you declare the conventions.
[Get started](https://www.npmjs.com/package/konsistent)

---

📚 **More updates:** [View all changelog entries](/changelog/sitemap.md) | [Blog](/blog/sitemap.md)