Skip to content

pr-review: suggestion block eats code fence markers when target range includes backtick lines #1326

@worktrunk-bot

Description

@worktrunk-bot

Problem

In run 22790184425 reviewing PR #1322, the review bot posted a suggestion block anchored on lines 289–291 of .claude/skills/review-pr/SKILL.md. Line 291 was the closing ``` of a markdown code fence. Applying the suggestion would have removed that closing fence, breaking the markdown.

The maintainer caught this: "but doesn't this format remove the closing codeblock backticks?"

Root Cause

GitHub's suggestion syntax uses ``` as delimiters. When the target range includes a line that is itself ```, the suggestion's closing delimiter is consumed by the syntax, and the original backtick line is replaced without being preserved in the suggestion body.

The existing guidance (SKILL.md lines 330–334) says:

Minimize the range — only include lines that actually need changing. A range that's too wide can delete correct code adjacent to the bug. Before posting, verify that every line in [start_line, line] is either removed or rewritten in the suggestion body.

The bot violated this — line 291 (```) was in the range but wasn't reproduced in the suggestion body. However, this specific failure mode (backtick collision) is subtle enough to warrant explicit guidance.

Related

Suggested Fix

Add guidance to the review skill about code fence markers in suggestion ranges. When the target lines contain ```, either:

  1. Exclude fence marker lines from the suggestion range, or
  2. Reproduce them verbatim in the suggestion body

Also: use quadruple or quintuple backticks (````) as suggestion delimiters when the content itself contains triple backticks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    claude-behaviorIssues with Claude CI bot behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions