@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 +55 -7
- package/dist/chunk-WEYNMCAH.js +1562 -0
- package/dist/cli-VYWAONGX.js +354 -0
- package/dist/index.js +5 -1911
- package/dist/mcp/server.js +120 -93
- package/dist/server-7C2IQ7VV.js +202 -0
- package/package.json +11 -17
package/README.md
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
# ctxlint
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@yawlabs/ctxlint)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://github.com/YawLabs/ctxlint/stargazers)
|
|
6
|
+
[](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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
198
|
+
### With `.mcp.json` (Cursor, Windsurf, and other MCP clients)
|
|
199
|
+
|
|
200
|
+
Create `.mcp.json` in your project root:
|
|
183
201
|
|
|
184
|
-
|
|
185
|
-
|
|
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
|