konsistent CLI
A structure linter for TypeScript projects: checks against konsistent.json which files, folders and exports every package must have
- 195 ★ on the repository
- Last commit
Extended access
Why this level
- The check reads the sources and paths of the whole repository but changes nothing
- The `konsistent-fix-violations` skill edits, renames and moves code after your confirmation
Install
- Works in
Manual install
npm install konsistent --save-devFor pnpm use `pnpm add konsistent --save-dev`, for Bun `bun add konsistent --dev`. Run it with `npx konsistent`.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The check reads the sources and paths of the whole repository but changes nothing
- The `konsistent-fix-violations` skill edits, renames and moves code after your confirmation
This is third-party code. Review the repository files before installing.
What it does
konsistent is a command-line linter that matches the files and folders of a TypeScript repository against declared patterns. ESLint, Biome and oxlint check code style inside a file, while konsistent checks project structure: for example, that every provider package lives in `packages/{providerId}`, contains `src/index.ts` and exports a type `<ProviderId>Provider`. Rules go into `konsistent.json` in the project root. Paths take variables such as `packages/{providerId}`, and `must` conditions cover required files and folders and exported values and types, with names built from the variable through `toPascalCase()` and `toFlatCase()`. The `kebabToPascalMap` and `kebabToCamelMap` maps fix acronyms, such as openai to OpenAI. Commands: `konsistent` (same as `check`), `validate` for the config itself, `help` and `version`. Violations print as a list, and in GitHub Actions they become annotations on the pull request diff. Scripts get `json` and `markdown` formats. A convention can be marked as a warning with `"severity": "warning"`; the `--error-on-warnings` flag turns them back into errors for CI. Two skills sit alongside. `konsistent-config` helps an agent write or change `konsistent.json`. `konsistent-fix-violations` runs the check, walks through the violations with you and fixes code after you agree.
Who it is for. Maintainers of TypeScript monorepos with a dozen similar packages that must each export the same set of names.
Good fit when
- A monorepo gains provider packages and CI should fail when a new one lacks `src/index.ts` or the expected type
- An agent writes a new adapter and you need to catch that it does not extend the base class like the others
- Many violations piled up and you want to decide with an agent what to fix in the code and what in the rule
- A pull request needs annotations right on the diff or a table of violations in a comment
Not a fit when
- You need style, unused-variable or best-practice checks inside a file: ESLint, Biome and oxlint handle that
- The code is not TypeScript: the checks rely on TypeScript exports and imports
- The project is small, with one package and nothing to compare
Example request
Write a konsistent.json for my monorepo: every package in packages needs src/index.ts and a Provider type export, then run the check and go through the violationsLimitations
- The npm package is in beta (1.0.0-beta.13), so the `konsistent.json` format and rules may change.
- `konsistent.json` lives in the project root by default; elsewhere you need the `--config-path` flag.
- Without a config file the run ends with a message that the file could not be read.
- The `konsistent-config` skill deliberately writes rules from dominant code patterns even if some files break them: a zero-error report is not the goal.
How to disable. Remove the package with `npm uninstall konsistent`, the `konsistent` line from `scripts` and the `konsistent.json` file. Skills are removed from the agent's skills directory.
FAQ
How do I install konsistent?
Run `npm install konsistent --save-dev` (`pnpm add konsistent --save-dev` for pnpm, `bun add konsistent --dev` for Bun). Add `"konsistent": "konsistent"` to `scripts` and run `npm run konsistent`.
How is konsistent different from ESLint?
ESLint checks code inside a file, while konsistent checks repository structure: files, folders and exports in the right places. Run them together.
How do I add the konsistent skills to an agent?
Run `npx skills add vercel-labs/konsistent --skill konsistent-config` to write the config and `npx skills add vercel-labs/konsistent --skill konsistent-fix-violations` to work through violations.
What if there are too many violations?
The rule is probably the outlier: the codebase has not decided between two conventions. Pick one, update or relax the rule and then fix the remaining code.
How do I turn on annotations in GitHub Actions?
Nothing to turn on: in GitHub Actions konsistent emits `::error` and `::warning` annotations on its own, so violations appear right on the pull request diff. The format can be set with `--format`.
Discussion
No questions or reviews yet.
Related
CLI toolsA zero-config linter and formatter for JavaScript and TypeScript, with ready presets for dozens of AI agents and editors
An agent skill with TypeScript conventions: types, discriminated unions, functions, naming, source layout, React and tests, loaded per topic
A Rust CLI for TypeScript and JavaScript: dead code, duplicates, cycles, complexity and architecture boundaries from one graph, plus MCP and skills
A skill that installs a set of Oxlint rules catching low-quality TypeScript and JavaScript patterns often left by code generation
Three skills and a clippy config: an agent writes, reviews and ports idiomatic Rust, and CI enforces the checkable rules
Tasks, docs, specs and decisions live as markdown files in your repository, and the agent reads them through the CLI and MCP
README in short
The README explains the gap between style linters and project structure, shows installation, an example `konsistent.json` and violation output. Commands, severity levels, CI integration and output formats follow, with two tips about skills for writing the config and fixing violations.