Skip to content

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

Merged
sylvainsf merged 3 commits into
mainfrom
update-code-review-skill-line-numbers
Jun 1, 2026
Merged

Improve line-number accuracy in radius-code-review skill#12017
sylvainsf merged 3 commits into
mainfrom
update-code-review-skill-line-numbers

Conversation

@brooke-hamilton

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

Copy link
Copy Markdown
Member

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

github-actions Bot commented May 29, 2026

Copy link
Copy Markdown

Dependency Review

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

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread .github/skills/radius-code-review/SKILL.md Outdated
brooke-hamilton and others added 2 commits June 1, 2026 10:32
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com>

@sylvainsf sylvainsf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@sylvainsf sylvainsf merged commit 344c0e5 into main Jun 1, 2026
45 checks passed
@sylvainsf sylvainsf deleted the update-code-review-skill-line-numbers branch June 1, 2026 18:26
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.

3 participants