path-quirk-audit
Skill0 starsChanged 46 days agoMITView on GitHub
Read-only scan for Windows file traps: non-ASCII bytes in .bat/.cmd, CRLF in .sh, BOM/bad UTF-8 in .json, files shadowing builtins, case collisions. Use when: "check for bat/encoding landmines", before shipping a Windows repo. Symptoms: winfix.
In this repository34 other files it gives its agents.
- audit-codeSkill
- audit-docsSkill
- auditSkill
- bisect-driverSkill
- coding-conventionsSkill
- commit-gateSkill
- compact-ioSkill
- cron-task-manageSkill
- cve-auditSkill
- data-integrity-auditSkill
- decision-logSkill
- deck-builderSkill
- determinism-guardSkill
- etl-validateSkill
- experiment-logSkill
- fetch-firstSkill
- flaky-test-detectorSkill
- github-repo-polishSkill
- golden-lockSkill
- history-leak-scanSkill
- landing-checkSkill
- llm-eval-harnessSkill
- local-secrets-manageSkill
- long-taskSkill
- milestone-trackSkill
- opus-workersSkill
- reorg-proposalSkill
- research-briefSkill
- seed-controlSkill
- shell-portabilitySkill
- skill-vetSkill
- small-taskSkill
- token-squeezeSkill
- venue-fitSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
When it finds an offender, pair the finding with your own symptom-side runbook for the actual fix.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
path-quirk-audit — sweep a tree for Windows path/file landmines
The engine is path-quirk-audit.js (portable Node, zero deps). It enumerates a
tree (git ls-files in a repo, else a recursive walk skipping node_modules/.git)
and flags file-shaped corruption classes that fail silently on Windows: a
single non-ASCII byte that kills a .bat parse, a shell script that arrived with
CRLFs, a JSON file a PowerShell rewrite left with a BOM or mangled UTF-8, a stray
root file whose name shadows a cmd builtin, and two paths that collide by case on
NTFS. It is strictly read-only — it never writes, moves, or edits anything.
When it finds an offender, pair the finding with your own symptom-side runbook
for the actual fix.
Commands
node path-quirk-audit.js scan [dir] audit dir (default cwd)
node path-quirk-audit.js --canary- scan enumerates and reports one block per finding:
CLASS<tab>file, then a detail line, then afix:hint. Exit 1 if anything is flagged, 0 if clean. - Enumeration uses
git ls-fileswhendiris inside a repo (tracked files only, respects.gitignore), otherwise a recursive walk skippingnode_modules/.git.
Classes flagged
| Class | Matches | Why it bites on Windows |
BAT-NONASCII | .bat/.cmd with any byte > 0x7F (reports offset + value) | one non-ASCII byte silently corrupts the whole batch parse |
SH-CRLF | .sh/.bash containing CRLF | CRLF breaks the shebang/commands under bash |
JSON-BADUTF8 | .json with a UTF-8 BOM or an invalid UTF-8 sequence | parsers choke on a BOM; a PS rewrite mangles emoji/multibyte |
ROOT-SHADOW | scan-root file whose basename (case-insensitive, ext-stripped) is echo/type/sort/find/time/date/path/exit/set, or is purely numeric (12) | a root file named like a builtin/number breaks .bat parses |
CASE-COLLIDE | two paths differing only by case | NTFS treats them as one path; a checkout clobbers one |
Examples
- Before a scheduled .bat runs (a monthly job that runs as a Windows
scheduled task):
node path-quirk-audit.js scan /path/to/project— aBAT-NONASCIIhit is exactly the "one non-ASCII byte silently corrupts the whole batch parse" failure, caught before the task fires and dies with garbled errors. - After a PowerShell edit touched JSON (PS
Set-Contentdefaults to the ANSI codepage and can leave a BOM / corrupt emoji): scan the tree —JSON-BADUTF8flags the BOM or the mangled multibyte sequence and points you at a Node writer. - Cross-checking this repo before a Windows checkout:
CASE-COLLIDEcatches aCase.txt/case.txtpair that would clobber on NTFS, andSH-CRLFcatches a helper script that picked up CRLFs.
Windows notes
- Runs the same in PowerShell 5.1 and Git Bash — no
&&/||chaining, ternary, or??used; it's a single Node process. scanis read-only. It reads content only for.bat/.cmd/.sh/.bash/.json; all other files are inspected by name only (root-shadow, case-collision).- The BOM/invalid-UTF-8 detector is deliberately hand-rolled on raw bytes so the tool never itself re-encodes a file — it reports, it does not touch.
Exit codes
0 clean · 1 one or more findings · 2 usage error (missing/not-a-directory).
Verification (the done-check)
node path-quirk-audit.js --canaryPlants one instance of every class in a throwaway temp dir and asserts all are
flagged (the bad direction), plus a clean dir with the same file types — a pure
-ASCII .bat, an LF .sh, a BOM-free valid-UTF-8 .json (emoji included), a
shadow-named file that is NOT in root — yields zero findings (the good
direction). MUST print CANARY PASS 25/25 before you trust a result.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

