Why Semlint?
Agentic Backend
Leverages LLM agents via standard CLI tools (like cursor-cli). Semlint handles
the orchestration, diffing, and strict JSON output enforcement.
Cost-Effective Batching
Run all applicable semantic rules in a single LLM pass with --batch mode,
dramatically reducing inference costs and wait times.
Git-Aware Execution
Automatically scopes analysis to your local branch changes (tracked, staged, unstaged, and untracked) or specific git refs.
How It Works
Configure your environment
Create a semlint.json at your project root. Connect it to your preferred
agentic backend.
{
"backend": "cursor-cli",
"model": "auto",
"execution": {
"batch": true
},
"backends": {
"cursor-cli": {
"executable": "cursor"
}
}
}
Define semantic rules
Add JSON rules in your rules/ directory. Use natural language to describe
what the agent should look for.
{
"id": "SEMLINT_NAMING_001",
"title": "Ambient naming convention consistency",
"severity_default": "warn",
"include_globs": ["src/**/*.ts"],
"exclude_globs": ["**/*.test.ts", "**/*.spec.ts"],
"prompt": "Verify naming is consistent with ambient conventions, infer the convention from the surrounding code."
}
Run checks locally or in CI
Semlint filters rules by diff context, builds precise prompts, handles LLM flakiness, and emits standard diagnostic output.
$ semlint check --batch
src/main.ts
64:1 warn SEMLINT_NAMING_001 Variable 'rules_dir' uses snake_case; ambient convention is camelCase (e.g. changedFiles, runnableRules). Use 'rulesDir' instead.
✖ 1 problem (0 errors, 1 warning)