instrlint 0.1.8 → 0.1.10

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
@@ -69,6 +69,8 @@ Run from your project root where `CLAUDE.md` or `AGENTS.md` lives.
69
69
 
70
70
  **Auto-fix** — `--fix` safely removes dead rules, stale refs, and exact duplicates. Requires a clean git working tree.
71
71
 
72
+ **LLM Verification** — `/instrlint --verify` (Claude Code / Codex skill) runs a two-pass protocol: instrlint emits low-confidence findings as `candidates.json`, you (the host agent) judge each one and write `verdicts.json`, then instrlint merges results — filtering false positives and attaching `✓ confirmed` / `❓ uncertain` badges. No API key required; the host model is the verifier.
73
+
72
74
  **CI Integration** — `instrlint ci` exits 0 or 1 based on findings severity, with SARIF output for GitHub Code Scanning.
73
75
 
74
76
  ## Supported tools
@@ -106,6 +108,11 @@ instrlint init-ci --gitlab # Print GitLab CI snippet to stdout
106
108
  instrlint install --claude-code # Install as global Claude Code skill
107
109
  instrlint install --claude-code --project # Install into project
108
110
  instrlint install --codex # Install as Codex skill
111
+
112
+ # Host-orchestrated LLM verification (two-pass, no API key needed)
113
+ instrlint --emit-candidates instrlint-candidates.json # Write low-confidence findings for host LLM to judge
114
+ instrlint --emit-candidates instrlint-candidates.json --skip-report # Same, without printing the report
115
+ instrlint --apply-verdicts instrlint-verdicts.json # Apply host LLM verdicts and re-render report
109
116
  ```
110
117
 
111
118
  ## CI Integration
@@ -155,10 +162,22 @@ Then **restart Claude Code** to activate the command. Then in your editor:
155
162
  /instrlint
156
163
  /instrlint --fix
157
164
  /instrlint ci --fail-on warning
165
+ /instrlint --verify
158
166
  ```
159
167
 
160
168
  > **Note:** Claude Code only loads custom commands at startup. `/reload-plugins` does not pick up newly installed commands.
161
169
 
170
+ ### LLM verification (`/instrlint --verify`)
171
+
172
+ The `--verify` flag triggers a two-pass protocol where the host agent (Claude Code or Codex) judges low-confidence findings to eliminate false positives:
173
+
174
+ 1. **Emit candidates** — instrlint writes `instrlint-candidates.json` with contradiction/duplicate findings that need semantic review
175
+ 2. **Judge** — you (or the host agent) read the file and determine `confirmed` / `rejected` / `uncertain` for each
176
+ 3. **Write verdicts** — save decisions to `instrlint-verdicts.json`
177
+ 4. **Apply** — instrlint merges verdicts, filters rejected findings, and re-renders the report with `✓` / `❓` badges
178
+
179
+ instrlint never calls an LLM API. It delegates judgment to whatever model is already running the session.
180
+
162
181
  ## Score and grade
163
182
 
164
183
  | Grade | Score | Meaning |
package/README.zh-TW.md CHANGED
@@ -75,6 +75,8 @@ npx instrlint --lang zh-TW
75
75
 
76
76
  **自動修復** — `--fix` 安全地移除冗餘規則、過時參照和完全重複的規則。需要乾淨的 git 工作目錄。
77
77
 
78
+ **LLM 驗證** — `/instrlint --verify`(Claude Code / Codex skill)執行兩段式驗證協議:instrlint 將低信心的 findings 輸出為 `candidates.json`,由你(host agent)逐一判斷後寫入 `verdicts.json`,再由 instrlint 合併結果 — 過濾 false positive,並附上 `✓ confirmed` / `❓ uncertain` badge。不需要任何 API key;host model 本身就是驗證者。
79
+
78
80
  **CI 整合** — `instrlint ci` 依 findings 嚴重程度回傳 exit code 0 或 1,並支援 SARIF 輸出供 GitHub Code Scanning 使用。
79
81
 
80
82
  ## 支援工具
@@ -112,6 +114,11 @@ instrlint init-ci --gitlab # 輸出 GitLab CI 設定片段
112
114
  instrlint install --claude-code # 安裝為全域 Claude Code skill
113
115
  instrlint install --claude-code --project # 安裝到專案
114
116
  instrlint install --codex # 安裝為 Codex skill
117
+
118
+ # 由 host 協調的 LLM 驗證(兩段式,不需要 API key)
119
+ instrlint --emit-candidates instrlint-candidates.json # 將低信心 findings 輸出供 host LLM 判斷
120
+ instrlint --emit-candidates instrlint-candidates.json --skip-report # 同上,不印報告
121
+ instrlint --apply-verdicts instrlint-verdicts.json # 套用 host LLM 的判斷結果並重新呈現報告
115
122
  ```
116
123
 
117
124
  ## CI 整合
@@ -161,10 +168,22 @@ npx instrlint install --codex
161
168
  /instrlint
162
169
  /instrlint --fix
163
170
  /instrlint ci --fail-on warning
171
+ /instrlint --verify
164
172
  ```
165
173
 
166
174
  > **注意:** Claude Code 只在啟動時載入 custom commands。`/reload-plugins` 無法載入新安裝的指令。
167
175
 
176
+ ### LLM 驗證(`/instrlint --verify`)
177
+
178
+ `--verify` 觸發兩段式協議,由 host agent(Claude Code 或 Codex)判斷低信心的 findings 以消除 false positive:
179
+
180
+ 1. **輸出 candidates** — instrlint 將需要語意審查的 contradiction / duplicate findings 寫成 `instrlint-candidates.json`
181
+ 2. **判斷** — 你(或 host agent)讀取檔案,對每筆 finding 決定 `confirmed` / `rejected` / `uncertain`
182
+ 3. **寫 verdicts** — 將判斷結果儲存為 `instrlint-verdicts.json`
183
+ 4. **套用** — instrlint 合併 verdicts,過濾被 rejected 的 findings,並重新輸出附有 `✓` / `❓` badge 的報告
184
+
185
+ instrlint 從不呼叫任何 LLM API,而是將判斷委託給當前 session 中正在運行的 model。
186
+
168
187
  ## 分數與等級
169
188
 
170
189
  | 等級 | 分數 | 說明 |
package/dist/cli.cjs CHANGED
@@ -453,7 +453,11 @@ var SKIP_DIRS = /* @__PURE__ */ new Set([
453
453
  ".git",
454
454
  ".claude",
455
455
  ".turbo",
456
- "coverage"
456
+ "coverage",
457
+ "tests",
458
+ "test",
459
+ "__tests__",
460
+ "spec"
457
461
  ]);
458
462
  function findSubClaudeFiles(dir, projectRoot, depth = 0) {
459
463
  if (depth > 10) return [];
@@ -1296,6 +1300,9 @@ var POLARITY_STOP_WORDS = /* @__PURE__ */ new Set([
1296
1300
  "prefer",
1297
1301
  "follow",
1298
1302
  "keep",
1303
+ "calls",
1304
+ "run",
1305
+ "runs",
1299
1306
  // Common modals and auxiliaries
1300
1307
  "must",
1301
1308
  "should",