A linter for rules a normal linter cannot check, such as "business logic should live in services" or "modules should expose lots of functionality behind a small API". You can write a rule as a Markdown file, with code that shows it:
---
description: A third-party API going offline should not also take our app down.
---
Our APIs should not depend on a third-party API on a critical path. The
user-facing side should be unaffected if it goes offline, and ingestion should
happen in a separate, asynchronous process.
## Should
```ts
// GET /api/restaurants/:zipCode reads only our own database.
export async function findRestaurants(zipCode: string) {
return db.restaurants.find({ where: { zipCode } });
}
```
## Should not
```ts
// When Google Maps is down, slow, or over quota, so is this endpoint.
export async function findRestaurants(zipCode: string) {
return googleMaps.findAll({ where: { zipCode } });
}
```adhere asks Jev, TypeSafe AI's System One model, whether each file breaks each rule which returns a calibrated probability. adhere reports each rule whose probability is above a threshold, and shows the part of the file Jev points at. The report looks like Oxlint's:
Rules a normal linter can check exactly, such as a banned import or a type
error, belong in that linter.
adhere validate lists the rules Jev
thinks a linter could check, and finds rules that contradict each other.
curl -fsSL https://github.com/darkmatter/adhere/raw/main/scripts/install.sh | sh
adhere login # save your TypeSafe AI API key
adhere lint --preset typescript,react # try the built-in presets on your code
adhere init # scaffold .adhere/config.ts and two example rules
adhere rules create # write a rule with a coding agent: claude, codex, or ompThe script installs to ~/.local/bin. If your shell can't find adhere
afterwards, add that directory to your PATH. adhere lint estimates what
judging will cost. When stdin and stdout are terminals, it asks before it sends
anything; otherwise, or with --yes, it sends without asking. The package is
@drkmttr/adhere: adhere on npm is an unrelated package.
- Start: Introduction, Install, Getting started
- Rules: Rule format, Writing good rules, Generate rules from your repo, Install rules from other repos, Presets
- Usage: Reading the report, Config, Running lint
- Validate & improve rules: Validating rules, Live evals
- Advanced features: State Hooks and Type-Awareness, Providers, Comments and suppressions
- Agent skills
- Reference: Commands, Config file, Cache, How a file is judged
- Compose your AGENTS.md
MIT. See LICENSE. The executables attached to each GitHub release
come with LICENSE and THIRD_PARTY_NOTICES.txt, which go with any copy you
redistribute. To build, test, or release adhere from a checkout, see
CONTRIBUTING.md.
