avoid-ai-writing
conorbronsdon/avoid-ai-writing
- Type
- Skill
- Scanned
- Nov 22, 2026
- Version
- a5d6bae7c0d7
- Files read
- 676
Avoid AI Writing is an AI agent skill and command-line tool that spots common AI writing habits in English text and rewrites drafts while keeping your facts intact. The biggest risks are that edit mode directly overwrites the files you choose, a terminal example in its instructions could lead an AI agent to run commands hidden in pasted text, and certain unusual Markdown lines can cause a local check to freeze.
What it can reach
- Files
- Reads its built-in writing rules, optional style settings, and the text or Markdown files you select, creates temporary files to standardize quotes, and directly overwrites named files in edit mode.
- Shell commands
- Runs included local Node.js scripts to check text, quotes, and style rules when local execution is available, and uses git to find matching files from the command line.
- Network
- Makes no internet connections during normal use; only a developer script in the full project repository downloads public benchmark texts from sites like Project Gutenberg and Hugging Face.
Findings
-
LowExponential backtracking (ReDoS) in Markdown reference-definition parser
In scripts/markdown-prose.js (and its generated copies bundled under skills/avoid-ai-writing/scripts/ and plugins/avoid-ai-writing/skills/avoid-ai-writing/scripts/), the REF_DEF regular expression is built from a template literal where [^\\]\\n] compiles to [^\]\n] instead of excluding backslashes like the adjacent regexes in the same file. Because both branches of (?:\\.|[^\]\n])+ can match a backslash with different lengths, a single unindented line starting with '[' followed by roughly 55 or more backslashes and a closing ']' without ':' causes catastrophic exponential backtracking. Since rewrite and edit modes pass the original document to normalize-quotes.js via --reference by default, untrusted Markdown containing such a line can freeze the Node.js subprocess at 100% CPU until it times out.
Fix: Exclude backslashes from the negated character class in REF_DEF by changing [^\\]\\n] to [^\\]\\\\\\n] in the template string (matching the [^\]\\\n] pattern already used in refs later in the same file).
-
LowQuadratic backtracking on unbounded gap patterns in detector engine
In detector/patterns.js (and its bundled copies under skills/ and plugins/), almost all multi-word gap patterns cap their span length and stop at line breaks, but the 'despite challenges' Tier 1 phrase uses an unbounded [^.]* wildcard (and AI_CITATION_MARKUP similarly uses unbounded [^\]]+ and [^}]* scans). Because the engine's 10,000-word limit counts whitespace-delimited tokens rather than bytes, an untrusted document or PR file containing many repeated 'despite challenges' phrases without periods (especially before a large unspaced token such as a data URI) causes quadratic rescanning to the end of the text on every match, slowing or stalling CLI or CI scans.
Fix: Bound the gap and stop at sentence or line terminators, for example replacing [^.]* with [^.!?;\r\n]{0,200} (and bounding the bracketed spans in AI_CITATION_MARKUP).
