Open Source Release v0.1.0

Semantic Linting for Modern Codebases

Write natural language rules to catch what regex can't.
Semlint uses your favorite AI agent to enforce architecture, naming, and best practices with zero noise.

npm install -g semlint
Get Started

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

1

Configure your environment

Create a semlint.json at your project root. Connect it to your preferred agentic backend.

semlint.json
{
  "backend": "cursor-cli",
  "model": "auto",
  "execution": {
    "batch": true
  },
  "backends": {
    "cursor-cli": {
      "executable": "cursor"
    }
  }
}
2

Define semantic rules

Add JSON rules in your rules/ directory. Use natural language to describe what the agent should look for.

rules/SEMLINT_NAMING_001.json
{
  "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."
}
3

Run checks locally or in CI

Semlint filters rules by diff context, builds precise prompts, handles LLM flakiness, and emits standard diagnostic output.

bash
$ 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)