Skip to content

Add get-reviews agent skill#765

Open
2chanhaeng wants to merge 13 commits into
fedify-dev:mainfrom
2chanhaeng:get-switch
Open

Add get-reviews agent skill#765
2chanhaeng wants to merge 13 commits into
fedify-dev:mainfrom
2chanhaeng:get-switch

Conversation

@2chanhaeng
Copy link
Copy Markdown
Contributor

This PR adds a new agent skill at .agents/skills/get-reviews/ that gives AI agents an end-to-end workflow for handling GitHub PR reviews on this repository, with explicit checkpoints that keep authoritative judgement with the contributor.

The motivation, design principles, and out-of-scope items are described in detail in #764. In short:

  • Each review thread is materialized as a local file under plans/{PR_NUMBER}/reviews/{REVIEW_ID}.md with stable frontmatter and fixed sections, so review state survives across agent sessions and the contributor can navigate it independently of the agent.
  • A focused GraphQL query (fetch_reviews.sh) extracts only the fields the agent needs (thread state, file/line, comment bodies, author, permalink), avoiding the context overload of dumping the whole PR conversation into the prompt.
  • The Judgement step (CORRECT / WRONG / PARTIAL / NEEDS EVALUATION / NEEDS DISCUSSION) and any non-English review's translated response are gated behind a mandatory contributor checkpoint, so the agent proposes but does not unilaterally decide or post.

Files

  • .agents/skills/get-reviews/SKILL.md — the workflow document.
  • .agents/skills/get-reviews/fetch_reviews.sh — the GraphQL fetch script with pagination support.
  • .agents/skills/get-reviews/review.md — the per-review file template.

Closes #764.

Assisted-by: Claude Code:claude-opus-4-7

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a get-reviews agent skill: workflow documentation, a Bash GraphQL fetch script that saves timestamped PR review JSON under plans/{PR_NUMBER}/fetched/, and a per-review template to structure contributor-supervised review resolution.

Changes

get-reviews agent skill

Layer / File(s) Summary
Skill workflow and review management documentation
.agents/skills/get-reviews/SKILL.md
Documents fetch→organize→resolve workflow, on-disk layout for review artifacts under plans/{PR_NUMBER}/, rules for REVIEW_ID generation, splitting/quoting long content, and the contributor-supervised resolution process including commit/dismissal and multilingual comment handling.
GitHub GraphQL review fetching script
.agents/skills/get-reviews/fetch_reviews.sh
Implements a Bash script that creates plans/$PR_NUMBER/fetched/, runs a parameterized gh api graphql query (comments, reviews, threads) with optional after pagination, formats with jq, and writes a timestamped JSON file.
Review template structure with metadata and analysis sections
.agents/skills/get-reviews/review.md
Adds a per-review template with frontmatter (id, description, link(s), commit(s)), and sections Title, Summary, Judgement (enumerated labels), Plans (judgement-dependent), and Comments (language/commit reference guidance).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

type/documentation

Suggested reviewers

  • dahlia
  • sij411
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and concisely describes the main change: adding a new get-reviews agent skill, which matches the PR's primary objective of introducing this workflow.
Description check ✅ Passed The description clearly explains the purpose, design principles, and lists all files added, with direct reference to issue #764 and the motivation behind the change.
Linked Issues check ✅ Passed The PR fully implements all primary objectives from #764: structured local review files with frontmatter/sections, focused GraphQL fetch script with pagination, contributor-gated judgement checkpoint, and complete documentation/templates.
Out of Scope Changes check ✅ Passed All three files added are directly aligned with #764 requirements: SKILL.md documents workflow, fetch_reviews.sh implements the GraphQL query, and review.md provides the template. No unrelated changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@2chanhaeng
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/get-reviews/fetch_reviews.sh:
- Line 1: The mkdir command uses single quotes which prevent $PR_NUMBER
expansion; change the path quoting so the variable expands (e.g., replace the
literal 'plans/$PR_NUMBER/fetched' used in the mkdir -p invocation with a form
that allows expansion such as using double quotes or separating quotes around
the variable, and prefer ${PR_NUMBER} for clarity).
- Line 1: The script .agents/skills/get-reviews/fetch_reviews.sh is missing a
shebang so it may not execute with the intended shell; add a shebang line (e.g.,
#!/usr/bin/env bash or #!/bin/bash) as the very first line of fetch_reviews.sh
so the mkdir -p 'plans/$PR_NUMBER/fetched' command runs under the correct shell
interpreter and variable expansion behavior.
- Line 27: The output path in fetch_reviews.sh uses single quotes so variables
don't expand; replace the single quotes around the path with double quotes so
$PR_NUMBER and $CURRENT_TIMESTAMP_MMDDHHMM are expanded, ensure the previous
line's opening quote is properly closed, and consistently quote the variable
(e.g., "$PR_NUMBER") in the path to avoid word-splitting or globbing while
referring to the output filename string.

In @.agents/skills/get-reviews/review.md:
- Line 50: Fix the typographical error by replacing the token "insufficient,use"
with "insufficient, use" in the review text; locate the occurrence of the exact
string "insufficient,use" in the document and insert a single space after the
comma so the sentence reads correctly.
- Around line 112-114: Fix the grammar in the sentence that currently reads
"evaluate the review explain how" by inserting the missing connector: change it
to either "evaluate the review to explain how" or "evaluate the review and
explain how" so the clause reads correctly; locate the phrase in the
.agents/skills/get-reviews/review.md content and replace the fragment so the
sentence becomes grammatically correct.
- Around line 5-14: The YAML frontmatter has inconsistent spacing after list
markers for the keys links, commit, and commits; normalize all list items to use
a single space after the dash (e.g., "- text") for every list entry under the
links/commits sections so lines currently using two spaces become single-spaced,
ensuring consistent formatting across the "links:", "commit:", and "commits:"
lists.

In @.agents/skills/get-reviews/SKILL.md:
- Line 81: Fix the example URL string that contains an extra closing
parenthesis: replace the fragment ending with `...DATABASE_ID})` in the SKILL.md
example with the correct `...DATABASE_ID}` or remove the stray `)` so the URL
becomes
`https://github.com/fedify-dev/fedify/pull/{PR_NUMBER}#discussion_r{REVIEW_THREAD.COMMENTS[0].DATABASE_ID}`;
update the example occurrence in .agents/skills/get-reviews/SKILL.md
accordingly.
- Around line 93-94: The sentence "Post all of the review in English" is
grammatically incorrect; update the string in
.agents/skills/get-reviews/SKILL.md (the sentence at Line 93) to a clear plural
or more specific phrase such as "Post all review comments in English" or "Post
all of the reviews in English" so it correctly refers to multiple
reviews/comments and improves clarity.
- Around line 55-59: The markdown contains an escaped asterisk sequence
("\**plans/{PR_NUMBER}/reviews/{REVIEW_ID}/index.md*") that will not render
correctly; update the text to either use proper emphasis syntax
"*plans/{PR_NUMBER}/reviews/{REVIEW_ID}/index.md*" to italicize the path or
escape the literal asterisks properly if you need them displayed literally —
replace the problematic "\**plans/{PR_NUMBER}/reviews/{REVIEW_ID}/index.md*"
token in SKILL.md with the chosen correct form.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d87a3a3d-fc03-4f44-a1d2-67ca53d09398

📥 Commits

Reviewing files that changed from the base of the PR and between 74d18f0 and ee41d96.

📒 Files selected for processing (3)
  • .agents/skills/get-reviews/SKILL.md
  • .agents/skills/get-reviews/fetch_reviews.sh
  • .agents/skills/get-reviews/review.md

Comment thread .agents/skills/get-reviews/fetch_reviews.sh Outdated
Comment thread .agents/skills/get-reviews/fetch_reviews.sh Outdated
Comment thread .agents/skills/get-reviews/review.md Outdated
Comment thread .agents/skills/get-reviews/review.md Outdated
Comment thread .agents/skills/get-reviews/review.md
Comment thread .agents/skills/get-reviews/SKILL.md
Comment thread .agents/skills/get-reviews/SKILL.md Outdated
Comment thread .agents/skills/get-reviews/SKILL.md Outdated
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new 'get-reviews' skill for AI agents, consisting of a documentation guide, a shell script for fetching GitHub reviews via GraphQL, and a review template. Feedback focuses on fixing critical bugs in the shell script related to variable expansion and GraphQL variable declarations. Additionally, several documentation refinements are required, such as correcting typos, adhering to the repository's style guide for em dashes, and replacing placeholders with concrete examples to enhance readability.

Comment thread .agents/skills/get-reviews/fetch_reviews.sh Outdated
Comment thread .agents/skills/get-reviews/SKILL.md Outdated
Comment thread .agents/skills/get-reviews/SKILL.md Outdated
Comment thread .agents/skills/get-reviews/review.md Outdated
Comment thread .agents/skills/get-reviews/review.md Outdated
Comment thread .agents/skills/get-reviews/review.md Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dahlia dahlia added the type/chore Build, configuration, and maintenance tasks label May 12, 2026
@dahlia dahlia self-assigned this May 12, 2026
Copy link
Copy Markdown
Member

@dahlia dahlia left a comment

Choose a reason for hiding this comment

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

I think many of bot reviews are valid. Also left my few comments.

Comment thread .agents/skills/get-reviews/fetch_reviews.sh Outdated
Comment thread .agents/skills/get-reviews/fetch_reviews.sh Outdated
Comment thread .agents/skills/get-reviews/fetch_reviews.sh Outdated
Comment thread .agents/skills/get-reviews/SKILL.md
Comment thread .agents/skills/get-reviews/SKILL.md Outdated
Comment thread .agents/skills/get-reviews/review.md
Comment thread .agents/skills/get-reviews/SKILL.md Outdated
Comment thread .agents/skills/get-reviews/SKILL.md
Comment thread .agents/skills/get-reviews/SKILL.md Outdated
Comment thread .agents/skills/get-reviews/review.md Outdated
2chanhaeng added a commit to 2chanhaeng/fedify that referenced this pull request May 14, 2026
The previous query body referenced `$NUMBER_OF_THREADS` and
`$NUMBER_OF_COMMENTS_PER_THREAD` inside `gh api graphql -f query='…'`
without declaring them in the `query(...)` header or forwarding them
via `-F`, so every invocation came back with
`Variable $NUMBER_OF_THREADS is not defined`.  The script could not
have completed a single fetch in this state.

Declare `$prComments`, `$reviews`, `$threads`, and `$comments` as
proper GraphQL Int parameters and forward the corresponding
`$NUMBER_OF_*` shell variables — the ones SKILL.md tells the user to
substitute — via matching `-F` flags.  Also add a `#!/usr/bin/env bash`
shebang so the script is self-contained, and quote
`-F number="$PR_NUMBER"` for consistency with the other parameters.

The single-quoted redirect path that
fedify-dev#765 (comment)
flagged is already addressed: the prior refactor pointed the redirect
target at the double-quoted `"$FETCHED_FILE"` shell variable, so the
literal `$PR_NUMBER` directory bug it described can no longer occur.

Addresses:

 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)

Assisted-by: Claude Code:claude-opus-4-7
2chanhaeng added a commit to 2chanhaeng/fedify that referenced this pull request May 14, 2026
Switch `fetch_reviews.sh` to cursor-based incremental fetches and
correct three typos in the surrounding documentation.

Incremental fetches were previously described as "use
`after: $LAST_REVIEW_ID`", but GitHub GraphQL's `after` argument
takes a base64 cursor (`pageInfo.endCursor`), not a review-thread
node ID, so following the instructions literally produced API
errors.  Declare `$after: String` in the query header, select
`pageInfo { hasNextPage endCursor }` on `reviewThreads`, and
conditionally forward `-F after="$LAST_CURSOR"` only when the shell
variable is set so the first-time fetch keeps working unchanged.
Update SKILL.md to describe the cursor flow in matching terms.

The three typo fixes:

 -  Drop a stray backslash before an italic path so the path renders
    as italics consistently with the rest of the list.
 -  Remove a stray trailing `)` on the example discussion URL that
    contributors copy verbatim into commit messages.
 -  Rephrase "Post all of the review in English" to "Post all review
    comments in English".

`plans/` is already covered by *.gitignore* (line 21), so the related
review thread needs no code change.

Addresses:

 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)

Assisted-by: Claude Code:claude-opus-4-7
2chanhaeng added a commit to 2chanhaeng/fedify that referenced this pull request May 14, 2026
The frontmatter used to expose both `link` and `links`, and both
`commit` and `commits`, while telling the reader inside the YAML
that the pairs were mutually exclusive.  Every freshly copied
review file therefore started out internally self-contradictory.

Keep `link` and `commit` active by default, and demote `links` /
`commits` to commented-out YAML examples right below them, so a
new review file is in a consistent shape from the moment it's
created.  The rewrite also removes the en-dash lines and uneven
YAML list-marker spacing that three other review threads asked us
to fix, so those threads no longer have any text to point at.

Two body typos:

 -  Insert the missing space in `insufficient,use`.
 -  Insert the missing "to" in `evaluate the review explain how`.

Addresses:

 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)

Assisted-by: Claude Code:claude-opus-4-7
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/get-reviews/fetch_reviews.sh:
- Around line 2-6: The script assumes required env vars (notably PR_NUMBER and
the various count variables) are present; add early validation that ensures
PR_NUMBER and each count var used to build GraphQL variables are non-empty,
printing a clear error via stderr and exiting non-zero if any are missing so you
fail fast before creating PR_PATH/FETCHED_PATH or writing FETCHED_FILE;
implement this check near the top (before constructing PR_PATH, FETCHED_PATH,
TIMESTAMP, FETCHED_FILE) and reuse the same validation for the other count vars
referenced later (the ones used to form GraphQL input) so the script never
proceeds with invalid or empty variables.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b23ef39b-734c-4b26-94b9-bead62a1e559

📥 Commits

Reviewing files that changed from the base of the PR and between ee41d96 and fdb80e4.

📒 Files selected for processing (3)
  • .agents/skills/get-reviews/SKILL.md
  • .agents/skills/get-reviews/fetch_reviews.sh
  • .agents/skills/get-reviews/review.md

Comment thread .agents/skills/get-reviews/fetch_reviews.sh
2chanhaeng added a commit to 2chanhaeng/fedify that referenced this pull request May 14, 2026
Without any guards the script trusted `PR_NUMBER` and the four
`NUMBER_OF_*` variables to be set.  Missing ones expanded to empty
strings, so the script silently constructed paths like
`plans//fetched/...` and forwarded empty `-F threads=`, `-F comments=`
arguments.  `gh` would then reject the call with a generic GraphQL
error instead of pointing at the missing variable, while the empty
directory had already been created.

Add `set -euo pipefail` and a `: "${VAR:?…}"` guard for each of the
five required variables, so the script aborts at the missing variable
with a clear "VAR is required" message before touching the filesystem
or talking to GitHub.

`LAST_CURSOR` is intentionally not guarded — it is the optional
incremental-fetch cursor and is referenced only through
`${LAST_CURSOR:+-F after="$LAST_CURSOR"}`, which is safe under `set -u`.

Addresses:

 -  fedify-dev#765 (comment)

Assisted-by: Claude Code:claude-opus-4-7
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/get-reviews/SKILL.md:
- Around line 31-39: Add explicit documentation to SKILL.md describing the
environment variables required by fetch_reviews.sh: list PR_NUMBER,
NUMBER_OF_PR_COMMENTS, NUMBER_OF_REVIEWS, NUMBER_OF_THREADS,
NUMBER_OF_COMMENTS_PER_THREAD (all required) and LAST_CURSOR (optional for
incremental pagination), and show a one-line example of invoking
fetch_reviews.sh with these environment variables set; reference the script name
fetch_reviews.sh and the exact variable names so users can copy them directly.
- Around line 135-137: The doc currently tells users to "fetch only the
necessary attributes" but doesn't say how; update
.agents/skills/get-reviews/SKILL.md to either (A) point to a new lightweight
script (e.g., create fetch_reviews_minimal.sh alongside fetch_reviews.sh) that
runs a smaller GraphQL query selecting only review fields needed for
verification (review state, body/text, author/login, createdAt, and id), or (B)
explicitly state that users can avoid rerunning fetch by manually inspecting the
latest fetched JSON under plans/{PR_NUMBER}/fetched/ and list which keys to look
for (e.g., reviews.nodes[*].state, reviews.nodes[*].body,
reviews.nodes[*].author.login, reviews.nodes[*].createdAt); include a short
example sentence on which option to choose and where the minimal script or JSON
keys live so readers can locate the verification data easily.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a47db21b-00ba-4c2d-bcb0-5ef527b66915

📥 Commits

Reviewing files that changed from the base of the PR and between fdb80e4 and 69bb15e.

📒 Files selected for processing (2)
  • .agents/skills/get-reviews/SKILL.md
  • .agents/skills/get-reviews/fetch_reviews.sh

Comment thread .agents/skills/get-reviews/SKILL.md
Comment thread .agents/skills/get-reviews/SKILL.md
2chanhaeng added 13 commits May 14, 2026 21:20
Introduce a new agent skill that streamlines fetching, organizing, and
resolving GitHub pull request reviews.  The skill provides:

 -  SKILL.md documenting the end-to-end workflow: fetching reviews via
    the GitHub GraphQL API, organizing them under plans/{PR_NUMBER}/,
    and resolving them by applying or dismissing with proper commit
    references and English translations.
 -  fetch_reviews.sh as a reusable GraphQL query script for retrieving
    review threads with pagination support.
 -  review.md as a template for individual review files, capturing the
    review metadata, comments, judgement, and resolution status.

Assisted-by: Claude Code:claude-opus-4-7
Extend the get-reviews skill so that the fetch script also retrieves
PullRequestReview nodes (id, author, body, state, etc.) alongside the
existing review threads, and add a `pullRequestReview` back-reference on
each review thread comment so threads can be grouped by the review that
created them.

Update the SKILL.md to point future invocations to the cached JSON in
*plans/{PR_NUMBER}/fetched/* when more context (e.g., the review a
thread belongs to, or the original body of a comment) is needed,
instead of re-fetching from GitHub.

Update the review.md template so the `links` metadata can include URLs
to related PR comments (issue comments) and review thread replies that
provide additional context for the review.

Assisted-by: Claude Code:claude-opus-4-7
Add harnesses for agents often mistaking parts
Name the path-building pieces of `fetch_reviews.sh` (`PR_PATH`,
`FETCHED_PATH`, `TIMESTAMP`, `FETCHED_FILE`) so the script reads as a
single recipe instead of repeating the same path expression twice, and
pipe the response through `jq .` so saved JSON is pretty-printed and
diffable across fetches.

In `review.md`, capitalise the description sentences for `link` and
`commit` to match the other frontmatter descriptions, and join a
two-line `links` bullet that was needlessly wrapped.

These are cosmetic preparations for the upcoming review-driven fixes
on this branch; they do not address any specific reviewer comment.

Assisted-by: Claude Code:claude-opus-4-7
The previous query body referenced `$NUMBER_OF_THREADS` and
`$NUMBER_OF_COMMENTS_PER_THREAD` inside `gh api graphql -f query='…'`
without declaring them in the `query(...)` header or forwarding them
via `-F`, so every invocation came back with
`Variable $NUMBER_OF_THREADS is not defined`.  The script could not
have completed a single fetch in this state.

Declare `$prComments`, `$reviews`, `$threads`, and `$comments` as
proper GraphQL Int parameters and forward the corresponding
`$NUMBER_OF_*` shell variables — the ones SKILL.md tells the user to
substitute — via matching `-F` flags.  Also add a `#!/usr/bin/env bash`
shebang so the script is self-contained, and quote
`-F number="$PR_NUMBER"` for consistency with the other parameters.

The single-quoted redirect path that
fedify-dev#765 (comment)
flagged is already addressed: the prior refactor pointed the redirect
target at the double-quoted `"$FETCHED_FILE"` shell variable, so the
literal `$PR_NUMBER` directory bug it described can no longer occur.

Addresses:

 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)

Assisted-by: Claude Code:claude-opus-4-7
Switch `fetch_reviews.sh` to cursor-based incremental fetches and
correct three typos in the surrounding documentation.

Incremental fetches were previously described as "use
`after: $LAST_REVIEW_ID`", but GitHub GraphQL's `after` argument
takes a base64 cursor (`pageInfo.endCursor`), not a review-thread
node ID, so following the instructions literally produced API
errors.  Declare `$after: String` in the query header, select
`pageInfo { hasNextPage endCursor }` on `reviewThreads`, and
conditionally forward `-F after="$LAST_CURSOR"` only when the shell
variable is set so the first-time fetch keeps working unchanged.
Update SKILL.md to describe the cursor flow in matching terms.

The three typo fixes:

 -  Drop a stray backslash before an italic path so the path renders
    as italics consistently with the rest of the list.
 -  Remove a stray trailing `)` on the example discussion URL that
    contributors copy verbatim into commit messages.
 -  Rephrase "Post all of the review in English" to "Post all review
    comments in English".

`plans/` is already covered by *.gitignore* (line 21), so the related
review thread needs no code change.

Addresses:

 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)

Assisted-by: Claude Code:claude-opus-4-7
The frontmatter used to expose both `link` and `links`, and both
`commit` and `commits`, while telling the reader inside the YAML
that the pairs were mutually exclusive.  Every freshly copied
review file therefore started out internally self-contradictory.

Keep `link` and `commit` active by default, and demote `links` /
`commits` to commented-out YAML examples right below them, so a
new review file is in a consistent shape from the moment it's
created.  The rewrite also removes the en-dash lines and uneven
YAML list-marker spacing that three other review threads asked us
to fix, so those threads no longer have any text to point at.

Two body typos:

 -  Insert the missing space in `insufficient,use`.
 -  Insert the missing "to" in `evaluate the review explain how`.

Addresses:

 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)
 -  fedify-dev#765 (comment)

Assisted-by: Claude Code:claude-opus-4-7
Without any guards the script trusted `PR_NUMBER` and the four
`NUMBER_OF_*` variables to be set.  Missing ones expanded to empty
strings, so the script silently constructed paths like
`plans//fetched/...` and forwarded empty `-F threads=`, `-F comments=`
arguments.  `gh` would then reject the call with a generic GraphQL
error instead of pointing at the missing variable, while the empty
directory had already been created.

Add `set -euo pipefail` and a `: "${VAR:?…}"` guard for each of the
five required variables, so the script aborts at the missing variable
with a clear "VAR is required" message before touching the filesystem
or talking to GitHub.

`LAST_CURSOR` is intentionally not guarded — it is the optional
incremental-fetch cursor and is referenced only through
`${LAST_CURSOR:+-F after="$LAST_CURSOR"}`, which is safe under `set -u`.

Addresses:

 -  fedify-dev#765 (comment)

Assisted-by: Claude Code:claude-opus-4-7
The `Get the reviews` section previously said only "Replace
`$VARIABLES` with the actual values or variables in the command", which
left readers to open `fetch_reviews.sh` to discover which variables the
script actually expects.

Replace that single line with two complementary blocks:

 -  A one-line invocation example pre-filling all five required
    variables (`PR_NUMBER`, `NUMBER_OF_PR_COMMENTS`,
    `NUMBER_OF_REVIEWS`, `NUMBER_OF_THREADS`,
    `NUMBER_OF_COMMENTS_PER_THREAD`) plus the optional `LAST_CURSOR`.
 -  A bullet list explaining what each variable controls.

The script itself is unchanged — its fail-fast guards already cover
missing values.

Addresses:

 -  fedify-dev#765 (comment)

Assisted-by: Claude Code:claude-opus-4-7
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
.agents/skills/get-reviews/SKILL.md (1)

150-156: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clarify "fetch only the necessary attributes" instruction.

Lines 153-155 instruct users to "fetch only the necessary attributes to check the review status and comments," but fetch_reviews.sh has a fixed GraphQL query. Users cannot customize which attributes are fetched without modifying the script. Consider either:

  1. Clarifying that users should manually inspect the most recent JSON file in plans/{PR_NUMBER}/fetched/ to check status, or
  2. Providing a separate lightweight verification script.
📝 Proposed clarification (option 1)
 After resolving the reviews, pushing commits, posting comments, and updating
 the reviews as resolved, move the review files to
 *plans/{PR_NUMBER}/reviews/resolved*. Before moving the files, check status and
-comments of the PR from GitHub. Use [fetch_reviews.sh](./fetch_reviews.sh),
-but instead of fetching all reviews and attributes, fetch only the necessary
-attributes to check the review status and comments.
+comments of the PR from GitHub by inspecting the most recent JSON file in
+*plans/{PR_NUMBER}/fetched/* (check `reviewThreads.nodes[*].isResolved` and
+`reviewThreads.nodes[*].comments` fields), or re-run [fetch_reviews.sh](./fetch_reviews.sh)
+to fetch updated review data.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/get-reviews/SKILL.md around lines 150 - 156, Clarify that
fetch_reviews.sh uses a fixed GraphQL query and cannot be parameterized: update
SKILL.md around the move-to-resolved paragraph to either (A) tell users to
inspect the most recent JSON in plans/{PR_NUMBER}/fetched/ (e.g., open the
latest file to read review states and comments) before moving files to
plans/{PR_NUMBER}/reviews/resolved, referencing fetch_reviews.sh by name, or (B)
add a note suggesting a lightweight verification helper (separate script) if
they want to fetch fewer attributes; mention both options briefly and pick one
as the recommended workflow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/get-reviews/SKILL.md:
- Around line 109-113: Replace the non-idiomatic phrase "fill the format as a
draft" with a clearer alternative in the SKILL.md text: e.g., "fill in the
format as a draft", "follow the format and save as a draft", or "use the format
as a draft" so the sentence reads naturally; update the sentence containing
"fill the format as a draft" to one of these alternatives to improve clarity
while keeping surrounding instructions intact.

---

Duplicate comments:
In @.agents/skills/get-reviews/SKILL.md:
- Around line 150-156: Clarify that fetch_reviews.sh uses a fixed GraphQL query
and cannot be parameterized: update SKILL.md around the move-to-resolved
paragraph to either (A) tell users to inspect the most recent JSON in
plans/{PR_NUMBER}/fetched/ (e.g., open the latest file to read review states and
comments) before moving files to plans/{PR_NUMBER}/reviews/resolved, referencing
fetch_reviews.sh by name, or (B) add a note suggesting a lightweight
verification helper (separate script) if they want to fetch fewer attributes;
mention both options briefly and pick one as the recommended workflow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2dc429bd-976e-457b-af90-52828afb48c0

📥 Commits

Reviewing files that changed from the base of the PR and between 69bb15e and 7b91c4a.

📒 Files selected for processing (3)
  • .agents/skills/get-reviews/SKILL.md
  • .agents/skills/get-reviews/fetch_reviews.sh
  • .agents/skills/get-reviews/review.md

Comment on lines +109 to +113
The format of review files should be as [review.md](./review.md).
Read the reviews and fill the format as a draft with the related information.
The files should be written in the contributor's language. But the title of
the item in the file (e.g., “Summary”, “Judgement”, “Plans”) should be in
English for consistency.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Awkward phrasing in line 110.

The phrase "fill the format as a draft" is non-idiomatic. Consider "fill in the format," "follow the format," or "use the format."

📝 Proposed fix
 The format of review files should be as [review.md](./review.md).
-Read the reviews and fill the format as a draft with the related information.
+Read the reviews and fill in the format as a draft with the related information.
 The files should be written in the contributor's language. But the title of
🧰 Tools
🪛 LanguageTool

[grammar] ~110-~110: Ensure spelling is correct
Context: ...view.md). Read the reviews and fill the format as a draft with the related information...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/get-reviews/SKILL.md around lines 109 - 113, Replace the
non-idiomatic phrase "fill the format as a draft" with a clearer alternative in
the SKILL.md text: e.g., "fill in the format as a draft", "follow the format and
save as a draft", or "use the format as a draft" so the sentence reads
naturally; update the sentence containing "fill the format as a draft" to one of
these alternatives to improve clarity while keeping surrounding instructions
intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/chore Build, configuration, and maintenance tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get-reviews agent skill for handling PR reviews

2 participants