Skip to content

Improve line-number accuracy in radius-code-review skill#12017

Open
brooke-hamilton wants to merge 1 commit into
mainfrom
update-code-review-skill-line-numbers
Open

Improve line-number accuracy in radius-code-review skill#12017
brooke-hamilton wants to merge 1 commit into
mainfrom
update-code-review-skill-line-numbers

Conversation

@brooke-hamilton
Copy link
Copy Markdown
Member

@brooke-hamilton brooke-hamilton commented May 29, 2026

Description

Improves the radius-code-review skill to eliminate incorrect line numbers, which is a frequent issue with the review scripts. An alternate approach is to remove the generated script altogether.

Changes

.github/skills/radius-code-review/SKILL.md:

  • Anchor-based comments: Every review comment now records an anchor (a unique code snippet on the target line). The anchor — not the integer — is the source of truth.
  • New "Line-number accuracy (mandatory)" section: Instructs the agent to never type a line number from memory and to look up each line via grep -n, and to ensure the cited line is on the RIGHT side of the diff.
  • Mandatory line-number verification (Step 3): Adds a step to print actual file content at every cited line and confirm it matches the comment's anchor before generating the script.
  • Runtime anchor resolution (Step 5): Adds a line_for shell helper that resolves line numbers from anchors at script build time and fails loudly if an anchor matches zero or more than one line, so a wrong/stale anchor aborts the script instead of mis-placing a comment.
  • Checklist updates: Adds items requiring anchors and line-number verification.

Type of change

  • This pull request fixes a bug or improves an existing skill.

Signed-off-by: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 29, 2026 15:36
@brooke-hamilton brooke-hamilton requested review from a team as code owners May 29, 2026 15:36
@github-actions
Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Radius code-review skill to reduce incorrect inline-review line numbers by requiring anchor snippets, verification, and runtime line resolution.

Changes:

  • Adds anchor-based review comment formatting and mandatory line-number accuracy guidance.
  • Adds a verification step to compare cited lines against anchors before script generation.
  • Updates the generated review-posting script template to resolve line numbers from anchors.

# from silently landing a comment on the wrong line.
line_for() {
local file="$1" anchor="$2" matches
matches=$(grep -nF -- "${anchor}" "${file}" || true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants