instrlint
Lint and optimize agent instruction files. Produces a scored health report across three dimensions: token budget, dead rules, and structure.
Command Resolution Protocol
When the user runs /instrlint [args]:
Detect language — identify conversation language → output: locale
- 繁體中文 →
zh-TW - English or any other →
en
- 繁體中文 →
Check
--verify— if args contain--verify→ jump to LLM Verification Protocol below. Otherwise continue.Map command — parse user args against this table → output: base command
User args Base command (none) npx instrlint@latestbudgetnpx instrlint@latest budgetdeadrulesnpx instrlint@latest deadrulesstructurenpx instrlint@latest structure--fixnpx instrlint@latest --fixci --fail-on warningnpx instrlint@latest ci --fail-on warningBuild final command — append flags from steps 1 and 3:
{base command} --format markdown --lang {locale}Exception:--fixomits--format markdown(output is a fix summary, not a report).Execute and present — run the command → present the markdown output directly to the user. Never summarize or paraphrase.
LLM Verification Protocol (--verify)
contradiction / duplicate / structure detectors are text heuristics and may produce false positives. You (the host agent) can judge these semantically.
Protocol: instrlint never calls an LLM API. It writes suspicious findings as candidates.json, you judge them and write verdicts.json, then instrlint merges the results back into the report.
Quick steps
npx instrlint@latest --emit-candidates instrlint-candidates.json --skip-report --lang <detected>- Read
instrlint-candidates.jsonand judge each candidate using criteria from references/judgment-framework.md (confirmed/rejected/uncertain) - Write
instrlint-verdicts.jsonwith your verdicts (idmust match 12-char hex from candidates) npx instrlint@latest --apply-verdicts instrlint-verdicts.json --format markdown --lang <detected>
Splitting Guidance
When instrlint reports either of these conditions, do not paste the suggestion text directly — run the splitting decision walkthrough instead:
- Budget warning: root instruction file exceeds recommended line count (> 200 lines)
- Structure findings contain path-scope suggestions (
messageKey: structure.scopePathScoped)
Walkthrough flow
- Read the file, list major sections (heading + line count)
- Classify each section using the 4-bucket framework (see references/judgment-framework.md)
- Present a decision table to the user (section / lines / recommended action / reason)
- Ask the user: "Minimum split (bucket 1 only) / Full split (buckets 1+2+3) / Custom"
- Execute: bucket 1 → extract to rules directory with
paths:/globs:frontmatter; bucket 2 → extract without path-scope; bucket 3 → replace with one-line pointer
Source: jed1978/instrlint — distributed by TomeVault.