@yawlabs/ctxlint 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,26 @@
1
1
  # ctxlint
2
2
 
3
- Lint your AI agent context files against your actual codebase.
3
+ [![npm version](https://img.shields.io/npm/v/@yawlabs/ctxlint)](https://www.npmjs.com/package/@yawlabs/ctxlint)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+ [![GitHub stars](https://img.shields.io/github/stars/YawLabs/ctxlint)](https://github.com/YawLabs/ctxlint/stargazers)
6
+ [![CI](https://github.com/YawLabs/ctxlint/actions/workflows/ci.yml/badge.svg)](https://github.com/YawLabs/ctxlint/actions/workflows/ci.yml)
7
+
8
+ **Lint your AI agent context files against your actual codebase.** 7 checks, 21+ formats, auto-fix. Works as a CLI, CI step, pre-commit hook, or MCP server.
4
9
 
5
10
  Your `CLAUDE.md` is lying to your agent. ctxlint catches it.
6
11
 
12
+ ## Why ctxlint?
13
+
14
+ Context files rot fast. You rename a file, change a build script, or switch from Jest to Vitest — and your `CLAUDE.md` still says the old thing. Your agent follows those instructions faithfully, then fails.
15
+
16
+ - **Catches real problems** — broken paths, wrong commands, stale references, contradictions across files
17
+ - **Smart suggestions** — detects git renames and fuzzy-matches to suggest the right path
18
+ - **Auto-fix** — `--fix` rewrites broken paths automatically using git history
19
+ - **Token-aware** — shows how much context window your files consume and flags redundant content
20
+ - **Every AI tool** — supports Claude Code, Cursor, Copilot, Windsurf, Gemini, Cline, Aider, and 14 more
21
+ - **Multiple outputs** — text, JSON, and SARIF (GitHub Code Scanning)
22
+ - **MCP server** — 4 tools for IDE/agent integration with tool annotations for auto-approval
23
+
7
24
  ## Install
8
25
 
9
26
  ```bash
@@ -92,6 +109,7 @@ Options:
92
109
  --quiet Suppress all output (exit code only, for scripts)
93
110
  --config <path> Path to config file (default: .ctxlintrc in project root)
94
111
  --depth <n> Max subdirectory depth to scan (default: 2)
112
+ --mcp Start the MCP server instead of running the linter
95
113
  -V, --version Output the version number
96
114
  -h, --help Display help
97
115
 
@@ -175,14 +193,44 @@ CLI flags override config file settings. Use `--config <path>` to load a config
175
193
 
176
194
  ## Use as MCP Server
177
195
 
178
- ctxlint ships with an MCP server that exposes four tools (`ctxlint_audit`, `ctxlint_validate_path`, `ctxlint_token_report`, `ctxlint_fix`):
196
+ ctxlint ships with an MCP server that exposes four tools (`ctxlint_audit`, `ctxlint_validate_path`, `ctxlint_token_report`, `ctxlint_fix`). All tools declare annotations so MCP clients can skip confirmation dialogs for read-only operations.
179
197
 
180
- ```bash
181
- # Claude Code
182
- claude mcp add ctxlint -- node node_modules/@yawlabs/ctxlint/dist/mcp/server.js
198
+ ### With `.mcp.json` (Cursor, Windsurf, and other MCP clients)
199
+
200
+ Create `.mcp.json` in your project root:
183
201
 
184
- # Or run from source
185
- claude mcp add ctxlint -- node /path/to/ctxlint/dist/mcp/server.js
202
+ macOS / Linux / WSL:
203
+
204
+ ```json
205
+ {
206
+ "mcpServers": {
207
+ "ctxlint": {
208
+ "command": "npx",
209
+ "args": ["-y", "@yawlabs/ctxlint", "--mcp"]
210
+ }
211
+ }
212
+ }
213
+ ```
214
+
215
+ Windows:
216
+
217
+ ```json
218
+ {
219
+ "mcpServers": {
220
+ "ctxlint": {
221
+ "command": "cmd",
222
+ "args": ["/c", "npx", "-y", "@yawlabs/ctxlint", "--mcp"]
223
+ }
224
+ }
225
+ }
226
+ ```
227
+
228
+ > **Tip:** This file is safe to commit — it contains no secrets.
229
+
230
+ ### With Claude Code
231
+
232
+ ```bash
233
+ claude mcp add ctxlint -- npx -y @yawlabs/ctxlint --mcp
186
234
  ```
187
235
 
188
236
  ## JSON Output