Documents
Agentlint
Agentlint
Type
Topic
Status
Published
Created
May 29, 2026
Updated
May 29, 2026

Agentlint#

"ESLint for your coding agents." Agentlint automatically scans, validates, and maintains agent context files — AGENTS.md, CLAUDE.md, skills, rules, workflows, and plans — keeping them structured, current, and aligned with the codebase .

The core problem it solves: agent context files are written once and silently go stale as modules, scripts, and workflows evolve . Agentlint provides a repeatable maintenance workflow through a CLI and a read-only MCP server. It also detects the active IDE and automatically routes maintenance rules to the optimal location for that client.

Core guarantees :

  • Local-first — no hosted LLM, no database, no auth layer.
  • Read-only MCP server — Agentlint returns guidance; the client agent makes repository changes.
  • Lightweight — separate CLI and MCP packages with minimal dependencies and strict TypeScript throughout.

Packages on npm: @agent-lint/cli | @agent-lint/mcp

Package Structure#

Agentlint is a pnpm monorepo with four publishable packages :

PackageRole
@agent-lint/sharedShared types, Zod schemas, artifact parsing helpers
@agent-lint/coreWorkspace discovery, scoring, plan building, guidelines
@agent-lint/mcpMCP server (stdio + HTTP transports), tools, resources
@agent-lint/cliCLI commands (init, scan, prompt, score)

Entry points: packages/mcp/src/index.ts for the MCP package; packages/core/src/workspace-discovery.ts and packages/core/src/plan-builder.ts for core scan logic.

CLI Commands#

Quickstart (no global install required):

npx @agent-lint/cli
CommandPurpose
agent-lint initSet up MCP config and optionally install maintenance rules
agent-lint scanScan the workspace; report missing types, incomplete files, stale, conflicting, and weak findings
agent-lint promptPrint a ready-to-paste IDE prompt; auto-selects broad-scan or targeted-maintenance mode based on workspace state
agent-lint score <file>Score a context artifact against 12 quality dimensions; auto-detects artifact type from filename or accepts --type

MCP Server & Tools#

The MCP package (packages/mcp/src/index.ts) exposes a read-only server over stdio or HTTP. All five tools are registered in packages/mcp/src/tools/index.ts; workspace scanning is gated behind an enableWorkspaceScan option .

Tools#

ToolPurpose
agentlint_get_guidelinesReturn artifact-specific guidance (do/don't, guardrails, template, quality checklist) before creating or editing context files
agentlint_plan_workspace_autofixScan a workspace and return a step-by-step markdown fix plan
agentlint_quick_checkDetect whether recent code changes require context-file updates
agentlint_emit_maintenance_snippetReturn a reusable maintenance snippet for the detected IDE client
agentlint_score_artifactScore a context artifact against 12 quality dimensions; designed for autoresearch loops

Resources#

Resource URIPurpose
agentlint://guidelines/{type}Readable guidelines for one artifact type
agentlint://template/{type}Skeleton template for a new artifact
agentlint://path-hints/{type}File discovery hints per IDE client

Workspace Discovery & Scan#

discoverWorkspaceArtifacts() in packages/core/src/workspace-discovery.ts is the engine behind agent-lint scan and agentlint_plan_workspace_autofix.

Scan constraints : max depth 6, max 200 files, max 500 KB per file. Standard noise directories (node_modules, .git, dist, build, etc.) are skipped .

Artifact types detected: agents, skills, rules, workflows, plans. Each discovered artifact is analyzed for :

  • Missing sections — required headings absent from the file
  • Stale references — markdown links or code spans pointing to files that no longer exist
  • Placeholder sections — sections containing only TODO/TBD/<placeholder> text
  • Cross-tool leaks — e.g., Claude-specific patterns (CLAUDE.md, mcpServers) found inside a Cursor or Copilot rules file
  • Weak signals — sections that exist but lack runnable commands or meaningful content

The plan builder (packages/core/src/plan-builder.ts) converts discovery results into a prioritized markdown action plan with remediation steps. It also sets a recommendedPromptMode: "broad-scan" when missing or incomplete artifacts exist, "targeted-maintenance" otherwise .

IDE Detection & Environment-Aware Routing#

detectInstalledClients() in packages/cli/src/commands/clients.ts detects which IDEs are active by checking PATH binaries, VS Code extension directories, and workspace-level config directories. It supports 13 clients: Claude Code, Codex, Cursor, OpenCode, Windsurf, Claude Desktop, VS Code, Kilo Code, Cline, Roo Code, Kiro, Zed, and Antigravity .

Based on the detected client, agent-lint init routes maintenance rules to the optimal location :

TargetClient
AGENTS.md (repo root)Universal default
CLAUDE.md (repo root)Claude-family clients
.cursor/rules/*.md / .windsurf/rules/*.mdCursor / Windsurf managed rules
.github/copilot-instructions.mdVS Code / GitHub Copilot

Client-specific guidance is also injected into buildGuidelines() output so the agent receives IDE-aware instructions when calling agentlint_get_guidelines.

Guidelines & Artifact Scoring#

buildGuidelines() in packages/core/src/guidelines-builder.ts assembles the full guidance document returned by agentlint_get_guidelines. It composes: artifact spec, do/don't lists, guardrails, a 12-dimension quality checklist, a template skeleton, and client-specific notes. Workflow discipline guidance (plan-first, subagent strategy, verification gates) is appended for agents, workflows, and plans types .

12 quality dimensions scored by agentlint_score_artifact (0–100 total):

DimensionWhat it checks
clarityHeadings, bullets, absence of vague phrases
specificityCode blocks, file paths, CLI commands, numeric constraints
scope-controlExplicit in-scope / out-of-scope boundaries
completenessPresence of artifact-type-specific required sections
actionabilityNumbered steps, imperative verbs
verifiabilityVerification section with code blocks and evidence expectations
safetySafety/guardrails section, prohibition language (NEVER/DO NOT)
injection-resistanceGuards against prompt injection, trust boundary statements
secret-hygieneNo exposed secrets, tokens, or hardcoded env vars
token-efficiencyBody under 5000 chars, no duplicate headings, short paragraphs
platform-fitClient-specific format (YAML frontmatter for skills, cross-tool leak detection)
maintainabilityNo placeholders/TODOs, no stale years, minimal inline path references

The score is designed to drive an autoresearch loop: score → improve → compare → keep or revert .

Quick Check#

agentlint_quick_check (core: packages/core/src/quick-check.ts) detects whether recent code changes require context-file updates — without a full workspace scan.

It matches against two signal types:

  • Path-based: changed files matching patterns for package.json, lockfiles, tsconfig.json, CI workflows (.github/workflows/*.yml), security-sensitive paths (auth/, .env), skills directories, and root context files (AGENTS.md, CLAUDE.md).
  • Description-based: keywords in commit/change descriptions such as "new module", "refactor", "security", "deploy", "dependency upgrade", and IDE client names (cursor, windsurf, copilot, claude, etc.).

For each matched signal, the tool returns a trigger (human-readable signal name), affected artifacts (which context files likely need updating), and a recommended action — often suggesting agentlint_plan_workspace_autofix for comprehensive follow-up.