Repository navigation
docs(skill): guide agents through seeding comments correctly - #680
Merged
Merged
Conversation
Three failure modes an agent hits when it reviews a patch through the CLI rather than reading the user's comments. Each one succeeds silently, so nothing in the current skill steers away from it. Reconstruct The Diff, a new section: an agent needs the same diff the user is looking at before it can pick line numbers, and the slug says which one. Adds the scope-per-slug-segment table and the `<base>~1` detail, since range endpoints are inclusive and diffing from `<base>` silently drops the first commit's changes. `--repo` returning `[]` with exit 0 covers a subdirectory of a real checkout as well as a genuinely sessionless repo. An agent reading it as "nothing open" gives up while a session is running. Seeded comments need verifying: a line past the end of the diff stores fine, prints back, and exits 0, but never renders. `review comments` reports no author, so the ids from `add` are the only way to tell agent comments from the user's later. Folded into Add Agent Comments rather than given its own heading, next to the `--input` shape it depends on. Test plan: - Field shapes read off src/review_cli.rs (AddCommentPayload, JsonCommentTarget::into_comment_target) and exercised against the built binary: the documented flat --input form round-trips; an array is a parse error; `path` is not an alias for `file` - Range recipe measured on this repo. For commits/82e9508..b55e218, `<base>~1..<head>` gives 15 files / 306 insertions; `<base>..<head>` gives 9 / 155, short by exactly commit 82e9508 (6 files / 151) - `[]` exit 0 reproduced for a repo root, a subdirectory, and a nonexistent path - Out-of-range line reproduced: line 9999 in a 3-line file returns the stored comment and exits 0
martintrojer
force-pushed
the
docs/skill-agent-seeding
branch
from
September 3, 2026 08:23
7535fbb to
d61bc73
Compare
agavra
approved these changes
Sep 7, 2026
agavra
left a comment
Owner
There was a problem hiding this comment.
Thank you @martintrojer for the contribution! This looks good to me.
1 task
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.
This targets the second workflow the skill already names — agent review of a patch — where the agent files its findings into tuicr with
review addand the human then opens the TUI to read them. The review lands on the diff, anchored to the lines it is about, instead of arriving as a wall of chat text the human has to map back onto the code themselves. They page through it withj/k, mark hunks reviewed, reply, delete the findings they disagree with, and export what survives. The human is reviewing the review, in the tool they already use for reviewing. That flow only works if the agent anchors comments to the right lines, and today nothing in the skill tells it how.Three failure modes on that path. Each succeeds silently, so nothing steers away from it.
Reconstruct The Diff (new section). An agent needs the same diff the user sees before it can pick line numbers, and the slug says which one. Adds the scope-per-slug-segment table and the
<base>~1detail: range endpoints are inclusive, so diffing from<base>silently drops the first commit. Get this wrong and every line number is off, which is exactly how findings end up anchored to unrelated code.--repocaveat (into Attach To A Session).[]with exit 0 also means "not a repo root" — a subdirectory returns it too. Read as "nothing open", an agent gives up while a session is running.Verify seeded comments (into Add Agent Comments, next to the
--inputshape it depends on). A line past the end of the diff stores, prints back, and exits 0, but never renders — so the agent reports success on a review the human cannot see. Also:review commentsreports no author, so the ids fromaddare the only way to tell agent comments from the user's later.Test plan
src/review_cli.rsand exercised against the built binary: the documented flat--inputform round-trips, an array is a parse error,pathis not an alias forfilecommits/82e9508..b55e218,<base>~1..<head>gives 15 files / 306 insertions;<base>..<head>gives 9 / 155 — short by exactly commit82e9508(6 files / 151)[]exit 0 reproduced for repo root, subdirectory, and nonexistent path