@yawlabs/ctxlint 0.7.0 → 0.8.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/.pre-commit-hooks.yaml +0 -1
- package/README.md +37 -4
- package/action.yml +27 -0
- package/dist/index.js +51232 -3
- package/package.json +16 -17
- package/dist/chunk-DYPYGTPV.js +0 -3082
- package/dist/chunk-ZXMDA7VB.js +0 -16
- package/dist/cli-7DNRBGDO.js +0 -463
- package/dist/mcp/chunk-MCKGQKYU.js +0 -15
- package/dist/mcp/server.js +0 -3330
- package/dist/mcp/tiktoken-MWTCLHI2.js +0 -465
- package/dist/server-ADUSCPPU.js +0 -288
- package/dist/tiktoken-CCNRJMFQ.js +0 -466
package/.pre-commit-hooks.yaml
CHANGED
package/README.md
CHANGED
|
@@ -12,15 +12,23 @@ Your `CLAUDE.md` is lying to your agent. Your `.mcp.json` has a hardcoded API ke
|
|
|
12
12
|
|
|
13
13
|
## Why ctxlint?
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Every AI coding tool ships a context file: `CLAUDE.md`, `.cursorrules`, `AGENTS.md`, `.mcp.json`. These files are the single most important interface between you and your agent — they tell it what to build, how to test, where things live.
|
|
16
16
|
|
|
17
|
+
But 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 stale instructions faithfully, then fails. You lose 10 minutes debugging what turns out to be a wrong path in line 12 of a markdown file.
|
|
18
|
+
|
|
19
|
+
Multiply that across a team with 5 context files, 3 MCP configs, and 2 people who touched the build system last week — and you have a real problem with no existing solution.
|
|
20
|
+
|
|
21
|
+
ctxlint is a linter purpose-built for this. It reads your context files, cross-references them against your actual codebase, and catches the drift before your agent does.
|
|
22
|
+
|
|
23
|
+
- **Instant startup** — ships as a single self-contained bundle with zero runtime dependencies. `npx` downloads ~200 KB and starts immediately
|
|
17
24
|
- **Catches real problems** — broken paths, wrong commands, stale references, contradictions across files
|
|
18
25
|
- **Smart suggestions** — detects git renames and fuzzy-matches to suggest the right path
|
|
19
26
|
- **Auto-fix** — `--fix` rewrites broken paths automatically using git history
|
|
20
27
|
- **Token-aware** — shows how much context window your files consume and flags redundant content
|
|
21
28
|
- **Every AI tool** — supports Claude Code, Cursor, Copilot, Windsurf, Gemini, Cline, Aider, and 14 more
|
|
22
29
|
- **Multiple outputs** — text, JSON, and SARIF (GitHub Code Scanning)
|
|
23
|
-
- **MCP server** —
|
|
30
|
+
- **MCP server** — 6 tools for IDE/agent integration with tool annotations for auto-approval
|
|
31
|
+
- **Watch mode** — `--watch` re-lints automatically when context files change
|
|
24
32
|
|
|
25
33
|
## Install
|
|
26
34
|
|
|
@@ -161,7 +169,7 @@ The full specification for MCP config linting rules, the cross-client config lan
|
|
|
161
169
|
## Example Output
|
|
162
170
|
|
|
163
171
|
```
|
|
164
|
-
ctxlint v0.
|
|
172
|
+
ctxlint v0.7.0
|
|
165
173
|
|
|
166
174
|
Scanning /Users/you/my-app...
|
|
167
175
|
|
|
@@ -205,6 +213,7 @@ Options:
|
|
|
205
213
|
--mcp-only Run only MCP config checks, skip context file checks
|
|
206
214
|
--mcp-global Also scan user/global MCP config files (implies --mcp)
|
|
207
215
|
--mcp-server Start the MCP server (for IDE/agent integration)
|
|
216
|
+
--watch Re-lint on context file changes
|
|
208
217
|
-V, --version Output the version number
|
|
209
218
|
-h, --help Display help
|
|
210
219
|
|
|
@@ -216,6 +225,14 @@ Commands:
|
|
|
216
225
|
|
|
217
226
|
Passing any `mcp-*` check name implies `--mcp`.
|
|
218
227
|
|
|
228
|
+
## Watch Mode
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
npx @yawlabs/ctxlint --watch
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Re-lints automatically when any context file, MCP config, or `package.json` changes. Useful during development when you're editing context files alongside code.
|
|
235
|
+
|
|
219
236
|
## Use in CI
|
|
220
237
|
|
|
221
238
|
```yaml
|
|
@@ -225,6 +242,22 @@ Passing any `mcp-*` check name implies `--mcp`.
|
|
|
225
242
|
|
|
226
243
|
Exits with code 1 if any errors or warnings are found.
|
|
227
244
|
|
|
245
|
+
### GitHub Action
|
|
246
|
+
|
|
247
|
+
```yaml
|
|
248
|
+
- name: Lint context files
|
|
249
|
+
uses: yawlabs/ctxlint-action@v1
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Or with options:
|
|
253
|
+
|
|
254
|
+
```yaml
|
|
255
|
+
- name: Lint context files
|
|
256
|
+
uses: yawlabs/ctxlint-action@v1
|
|
257
|
+
with:
|
|
258
|
+
args: '--strict --mcp'
|
|
259
|
+
```
|
|
260
|
+
|
|
228
261
|
### SARIF Output (GitHub Code Scanning)
|
|
229
262
|
|
|
230
263
|
```yaml
|
|
@@ -262,7 +295,7 @@ Add to your `.pre-commit-config.yaml`:
|
|
|
262
295
|
```yaml
|
|
263
296
|
repos:
|
|
264
297
|
- repo: https://github.com/yawlabs/ctxlint
|
|
265
|
-
rev: v0.
|
|
298
|
+
rev: v0.7.0
|
|
266
299
|
hooks:
|
|
267
300
|
- id: ctxlint
|
|
268
301
|
```
|
package/action.yml
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: 'ctxlint'
|
|
2
|
+
description: 'Lint AI agent context files and MCP server configs against your actual codebase'
|
|
3
|
+
branding:
|
|
4
|
+
icon: 'check-circle'
|
|
5
|
+
color: 'blue'
|
|
6
|
+
|
|
7
|
+
inputs:
|
|
8
|
+
args:
|
|
9
|
+
description: 'CLI arguments to pass to ctxlint (default: --strict)'
|
|
10
|
+
required: false
|
|
11
|
+
default: '--strict'
|
|
12
|
+
version:
|
|
13
|
+
description: 'ctxlint version to use (default: latest)'
|
|
14
|
+
required: false
|
|
15
|
+
default: 'latest'
|
|
16
|
+
|
|
17
|
+
runs:
|
|
18
|
+
using: 'composite'
|
|
19
|
+
steps:
|
|
20
|
+
- name: Set up Node.js
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: '20'
|
|
24
|
+
|
|
25
|
+
- name: Run ctxlint
|
|
26
|
+
shell: bash
|
|
27
|
+
run: npx -y @yawlabs/ctxlint@${{ inputs.version }} ${{ inputs.args }}
|