instrlint 0.1.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/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "instrlint",
3
+ "version": "0.1.0",
4
+ "description": "Lint and optimize your CLAUDE.md / AGENTS.md — find dead rules, token waste, and structural issues",
5
+ "type": "module",
6
+ "bin": {
7
+ "instrlint": "./dist/cli.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "skills",
19
+ "LICENSE",
20
+ "README.md"
21
+ ],
22
+ "engines": {
23
+ "node": ">=18"
24
+ },
25
+ "license": "MIT",
26
+ "author": "Jed Lin",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/jed1978/instrlint"
30
+ },
31
+ "homepage": "https://github.com/jed1978/instrlint#readme",
32
+ "bugs": {
33
+ "url": "https://github.com/jed1978/instrlint/issues"
34
+ },
35
+ "keywords": [
36
+ "claude",
37
+ "codex",
38
+ "cursor",
39
+ "lint",
40
+ "agent",
41
+ "instructions",
42
+ "cli",
43
+ "llm",
44
+ "CLAUDE.md",
45
+ "AGENTS.md",
46
+ "agentic-coding"
47
+ ],
48
+ "scripts": {
49
+ "dev": "tsx watch src/cli.ts",
50
+ "build": "tsup",
51
+ "test": "vitest run",
52
+ "lint": "eslint src/ tests/",
53
+ "lint:fix": "eslint src/ tests/ --fix",
54
+ "typecheck": "tsc --noEmit",
55
+ "audit": "pnpm audit",
56
+ "check": "pnpm typecheck && pnpm lint && pnpm test"
57
+ },
58
+ "dependencies": {
59
+ "chalk": "^5.3.0",
60
+ "commander": "^12.1.0",
61
+ "js-tiktoken": "^1.0.15"
62
+ },
63
+ "devDependencies": {
64
+ "@types/node": "^22.0.0",
65
+ "@typescript-eslint/eslint-plugin": "^8.58.0",
66
+ "@typescript-eslint/parser": "^8.58.0",
67
+ "@vitest/coverage-v8": "^2.1.9",
68
+ "eslint": "^10.2.0",
69
+ "tsup": "^8.3.0",
70
+ "tsx": "^4.19.0",
71
+ "typescript": "^5.6.0",
72
+ "vitest": "^2.1.0"
73
+ }
74
+ }
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: instrlint
3
+ description: Health check your CLAUDE.md and rule files — find dead rules, token waste, duplicates, contradictions, and stale references. Produces a scored health report (0-100) with auto-fix support.
4
+ command: /instrlint
5
+ argument-hint: "[budget|deadrules|structure|ci] [--fix] [--format json|markdown|sarif] [--lang zh-TW]"
6
+ ---
7
+
8
+ # instrlint
9
+
10
+ Lint and optimize agent instruction files. Produces a scored health report across three dimensions: token budget, dead rules, and structure.
11
+
12
+ ## Language detection
13
+
14
+ **Always detect the language of the current conversation before running instrlint:**
15
+
16
+ - If the user is conversing in **Traditional Chinese (繁體中文)**: run with `--lang zh-TW`
17
+ - If the user is conversing in **English**: run with `--lang en`
18
+ - For any other language instrlint does not support: fall back to `--lang en`
19
+
20
+ Examples:
21
+ - User writes in 繁體中文 → `npx instrlint --lang zh-TW`
22
+ - User writes in English → `npx instrlint --lang en`
23
+ - User writes in Japanese → `npx instrlint --lang en` (fallback)
24
+
25
+ ## Usage
26
+
27
+ ```
28
+ /instrlint # Full health check (score + grade)
29
+ /instrlint budget # Token budget analysis only
30
+ /instrlint deadrules # Dead rule detection only
31
+ /instrlint structure # Structural analysis only
32
+ /instrlint ci --fail-on warning # CI mode: exit 1 if warnings found
33
+ /instrlint --fix # Auto-fix safe issues + show actionable suggestions
34
+ /instrlint --format json # JSON output for CI
35
+ /instrlint --format markdown # Markdown output for PR comments
36
+ /instrlint --lang zh-TW # Output in Traditional Chinese
37
+ /instrlint install --claude-code # Install skill globally
38
+ ```
39
+
40
+ ## What it checks
41
+
42
+ - **Budget** — token consumption across all instruction files and MCP servers. Flags files > 200 lines, baselines > 25% of context window.
43
+ - **Dead rules** — rules already enforced by tsconfig, prettier, eslint, commitlint, editorconfig, and more. ~15 overlap patterns.
44
+ - **Structure** — contradictions between rules, stale file references, duplicates, and path-scoping opportunities.
45
+
46
+ ## Auto-fix (--fix)
47
+
48
+ Auto-applied (safe, deterministic):
49
+ - Rules already enforced by config files (dead rules)
50
+ - References to non-existent files (stale refs)
51
+ - Exact duplicate rules
52
+
53
+ Actionable suggestions shown (requires human judgment):
54
+ - Git hook suggestions — shown with copy-paste `.claude/settings.json` snippet
55
+ - Path-scoped rule file suggestions — shown with ready-to-create file content
56
+
57
+ ## Score and grade
58
+
59
+ | Grade | Score | Meaning |
60
+ |-------|-------|---------|
61
+ | A | 90–100 | Excellent — minor issues only |
62
+ | B | 80–89 | Good — a few improvements possible |
63
+ | C | 70–79 | Fair — some issues to address |
64
+ | D | 60–69 | Poor — significant problems |
65
+ | F | < 60 | Critical — needs immediate attention |
66
+
67
+ ## Supported tools
68
+
69
+ Claude Code, Codex, Cursor — auto-detected from project structure.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: instrlint
3
+ description: Health check your AGENTS.md and rule files — find dead rules, token waste, duplicates, contradictions, and stale references.
4
+ command: /instrlint
5
+ argument-hint: "[budget|deadrules|structure|ci] [--fix] [--format json|markdown|sarif]"
6
+ ---
7
+
8
+ # instrlint
9
+
10
+ Lint and optimize agent instruction files. Produces a scored health report across three dimensions: token budget, dead rules, and structure.
11
+
12
+ ## Language detection
13
+
14
+ **Always detect the language of the current conversation before running instrlint:**
15
+
16
+ - If the user is conversing in **Traditional Chinese (繁體中文)**: run with `--lang zh-TW`
17
+ - If the user is conversing in **English**: run with `--lang en`
18
+ - For any other language instrlint does not support: fall back to `--lang en`
19
+
20
+ ## Usage
21
+
22
+ ```
23
+ /instrlint # Full health check (score + grade)
24
+ /instrlint budget # Token budget analysis only
25
+ /instrlint deadrules # Dead rule detection only
26
+ /instrlint structure # Structural analysis only
27
+ /instrlint ci --fail-on warning # CI mode: exit 1 if warnings found
28
+ /instrlint --fix # Auto-fix safe issues + show actionable suggestions
29
+ /instrlint --format json # JSON output for CI
30
+ /instrlint --format markdown # Markdown output for PR comments
31
+ /instrlint install --codex # Install skill into .agents/skills/
32
+ ```
33
+
34
+ ## What it checks
35
+
36
+ - **Budget** — token consumption across AGENTS.md, skills, and MCP servers.
37
+ - **Dead rules** — rules already enforced by tsconfig, prettier, eslint, and other config files.
38
+ - **Structure** — contradictions, stale file references, duplicates, and path-scoping opportunities.