# Enforce consistent code for agents and humans with konsistent

Source: [Vercel](https://vercel.com/changelog/enforce-consistent-code-for-agents-and-humans-with-konsistent)  
Feed7 permalink: https://feed7.dev/p/enforce-consistent-code-for-agents-and-humans-with-konsistent-1xy6zkf  
Published: Unknown  
Trust: Official Source (official_source)

## Why Included

Vercel open-sourced konsistent, a deterministic CLI linter that enforces structural conventions in TypeScript repos — the folder/export patterns agents drift on that TypeScript and ESLint don't catch.

## Source Summary

**The gist** Vercel open-sourced **konsistent**, a CLI linter for TypeScript codebases that enforces structural conventions — whether files matching a pattern export required functions, or every folder with one file also has its counterpart — configured in a project-level **konsistent.json**. It's deterministic, covers patterns TypeScript and ESLint don't model, and Vercel's example run checks **340 files in 212ms**. It already gates **AI SDK and Chat SDK**.

## Practical Implication

**Why it matters** Structural drift is where agent-written code goes wrong quietly: it compiles but ignores your repo's layout. A deterministic check turns conventions into a failing exit code an agent can loop against, instead of prose in an **AGENTS.md** it may skip. A companion **skill** (npx skills add vercel-labs/konsistent) helps your agent draft the config.

## Agent-Ready Context

**The gist** Vercel open-sourced **konsistent**, a CLI linter for TypeScript codebases that enforces structural conventions — whether files matching a pattern export required functions, or every folder with one file also has its counterpart — configured in a project-level **konsistent.json**. It's deterministic, covers patterns TypeScript and ESLint don't model, and Vercel's example run checks **340 files in 212ms**. It already gates **AI SDK and Chat SDK**.

**Why it matters** Structural drift is where agent-written code goes wrong quietly: it compiles but ignores your repo's layout. A deterministic check turns conventions into a failing exit code an agent can loop against, instead of prose in an **AGENTS.md** it may skip. A companion **skill** (npx skills add vercel-labs/konsistent) helps your agent draft the config.

**Watch out** It only enforces what you encode — writing a **konsistent.json** that reflects your real conventions is the actual work — and it checks **structural** patterns (files, exports, types), not semantics, so it complements ESLint rather than replacing it.

## Context Map

- Layer: infra
- Domains: coding
- Topics: harness-engineering, dev-ux

## Uncertainty

- It only enforces what you encode — writing a **konsistent.json** that reflects your real conventions is the actual work — and it checks **structural** patterns (files, exports, types), not semantics, so it complements ESLint rather than replacing it.

## Agent Instruction

Use this item as source-backed context. Do not invent claims beyond the linked source. If this item conflicts with another source, call out the conflict.
