Repository navigation
skills(running-in-ci): extend bang-escape guidance to git commit -m - #427
Merged
Merged
Conversation
The bang-escape paragraph already covers `--body-file` / `--title` surfaces but not `git commit -m`. Recent worktrunk-bot fix commit shipped to permanent git history with `assert\!` and `format\!` in the message body via `git commit -m "..."` — the Bash-tool preprocessor rewrites every `!` in command arguments, and git stores the literal argument bytes when reading from `-m`. Add a short paragraph (and `-F file` recipe) covering the same trap for git commit messages. `git commit -F` reads the file directly, so the preprocessor never sees the bang. Co-Authored-By: Claude Opus 4.7 <[email protected]>
The new paragraph used `!` inside inline code spans (`assert!`, `format!`,
`panic!`, and the bare `!` token), which trips the
no-preprocessor-poison-in-skills pre-commit hook. The hook forbids bang
immediately followed by backtick because Claude Code's slash-command
preprocessor treats that as command substitution and crashes the session.
Rewrite to follow the existing convention in the file: when an inline code
span needs to show a macro, follow the bang with parens (`assert!(...)`),
and use plain prose ("exclamation mark") elsewhere.
No semantic change to the guidance itself.
This was referenced May 12, 2026
max-sixty
pushed a commit
that referenced
this pull request
May 15, 2026
…rule (#495) ## Summary Extend the existing `<<'EOF' ... EOF` backtick-escape rule to cover nested fenced code blocks. The current rule warns about escaping *inline code spans* (`` \`foo\` ``); the same single-quoted-heredoc mechanic also corrupts *nested fences* when the model defensively escapes the inner three-backtick fence (`` \`\`\`bash ``) to keep it from closing the outer fence. The fix is the standard markdown idiom: use a longer outer fence (four or five backticks) so the inner three-backtick fence renders intact without escaping. ## Evidence [PRQL/prql#5900](PRQL/prql#5900) (`tend ci-fix: transient classifier ignores repeat occurrences`, opened by prql-bot 2026-05-15T08:56:34Z). The body wraps a proposed skill addition in a `` ```markdown `` outer fence and contains an inner `` ```bash `` fence plus several inline code spans. The model escaped the inner fence and all inline backticks inside the inner section, producing visibly corrupted markdown — the rendered body shows `` \`\`\`bash ``, `` \`rustup-init\` ``, `` \`composer connect timeout\` ``, `` \`docker pull rate limit\` ``, `` \`gh issue search\` ``, and trailing `` \`\`\` `` (six distinct corrupted spans). Direct API spot-check: ```` $ gh api repos/PRQL/prql/issues/5900 --jq '.body' | grep -c '\\`' 6 ```` This is the first such occurrence in the PRQL evidence gist's tracked corruption-scan history (prior ticks all reported `backslash-backtick: clean`); the [evidence log](https://gist.github.com/tend-agent/5686b1fca82c08d385d9031a79be4a3e) for May 2026 records the scans. ## Classification - **Failure class**: structural. The trigger is deterministic — a body composed in a single-quoted heredoc that contains a nested fenced block + the model's defensive instinct to escape the inner fence. Replayed, this produces the same corruption every time. The existing rule already classifies the inline-code-span variant as authored (not preprocessor-injected); the nested-fence variant is the same shape with a different originating model habit. - **Evidence level**: structural / 1 occurrence — sufficient under [`review-gates.md`](https://github.com/max-sixty/tend/blob/main/plugins/tend-ci-runner/skills/review-reviewers/review-gates.md): *"Structural: no decision point — the same conditions produce the same failure every time... One clear occurrence is sufficient evidence for a targeted fix."* - **Change magnitude**: targeted fix — one sentence appended to an existing paragraph. Within the Gate-2 magnitude budget for structural-fix scope. ## Change `plugins/tend-ci-runner/skills/running-in-ci/SKILL.md`: extend the existing backtick-escape paragraph (already covering inline spans like `` \`foo\` ``) with a second sentence covering nested fenced blocks. Recommend a longer outer fence (four or five backticks outside, three inside) as the standard remedy. Adds a parenthetical noting that `--body-file` via the Write tool helps with delivery but not authoring — the model still has to author with bare backticks, since Write preserves data verbatim. ## Notes - #5900 itself is left as-is for now; its body is readable and stands as the in-evidence example for this fix. A clean re-author can follow once this skill update lands. - This change does not touch the inline-code-span rule (#423) or the bang-escape rules (#404, #427, #381, #432) — same paragraph, different shape, same delivery channel. Co-authored-by: tend-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
running-in-ci's bang-escape paragraph coversgh ... --body/gh pr create --titlecorruption with--body-fileand$(cat …)recipes, but does not covergit commit -m "…". A bot-authored commit onmax-sixty/worktrunkjust shipped to permanent git history with backslash-bang corruption in both the title and body of the message:Source:
worktrunk@148a9f54. Verified literal backslash-bang viagh api repos/.../commits/<sha> --jq '.commit.message' | od -c— bytes area s s e r t \ !(not a JSON-escape artifact).The mechanism is the same as the
--titlecorruption tend#318 / #320 / #422 addressed:git commit -m "msg"passes the message as a literal string argument, the Bash-tool preprocessor rewrites every!to\!in command strings before bash parses, and git stores those argument bytes verbatim into the commit object. Rust code is especially exposed becauseassert!,format!,panic!,eprintln!,vec!are everywhere — a fix-test-coverage commit that quotes those identifiers will ship corrupted.Prior
review-reviewersevidence (April) explicitly claimed git commit was immune ("the commit message on the same branch is clean ... confirming the corruption is specific to--titlestring arguments, notgit commit"). That claim was based on commits whose messages happened to have no!or were composed via-F. The corruption shape on-mis identical to--titleand just hadn't been observed in the wild yet.Fix
Add a short paragraph after the existing
--titlerecipe in the Comment Formatting section, explicitly calling outgit commit -mand providing thegit commit -F /tmp/commit-msg.txtrecipe.git commit -Freads the file directly, so the preprocessor never sees the bang.The example at line ~592 (
git commit -m "skills(running-tend): ...") is left as-is — its title has no!, so it's still safe, and the new paragraph clarifies that-Fbecomes mandatory only when the message contains code references or breaking-change markers.Evidence
148a9f54, 2026-05-11T21:47:22Z).--titlerewrite (tend#318 / bot PR descriptions are hard-wrapped at ~72 chars, breaking mid-sentence on GitHub #320 / Opus 4.7 over-escapes backticks in single-quoted heredocs, corrupting bot comment bodies #422).assert!/format!/ etc.Evidence gist for the worktrunk-bot run that produced this: https://gist.github.com/9675d1510da32c68a68c1d45137b21e0.
Related: tend#318 (
--body-fileworkaround), tend#320 / tend#422 (--titleworkaround), tend#423 (bang-escape in single-quoted heredocs), tend#424 (review-reviewers backslash-backtick scan).