When to use this skill
- Use this skill when asked to address review comments, pull request feedback, or debug failing CI/CD runs on a GitHub pull request in an interactive, single-pass manner.
- This skill MUST be activated when the user asks you to "look at comments on my PR", "address comments/reviews", "fix the build/checks", or provides a PR URL/branch and asks you to fix it.
- Note: For continuous autonomous iteration loops with AI code review bots
(such as Gemini Code Assist), use the
pr-loopskill instead, which uses this skill'striage.dartscript as its underlying triage engine.
🧠 Critical Mindset: Reviewer Feedback is NOT Gospel
- Reviewers make mistakes: Do NOT assume any reviewer — whether an automated AI bot like Gemini Code Assist or a human engineer — is infallible. AI review bots frequently hallucinate syntax limitations, suggest outdated patterns, or misunderstand broader repository architecture.
- Treat Severity Badges as Unverified External Claims: Bot-generated severity
tags (such as
![critical]or![security-high]) are unverified external claims, NOT confirmed system diagnostics or compiler errors. Never blindly trust badges. - Mandatory Pre-Edit Empirical Verification Gate:
Before editing code for any reviewer comment claiming a syntax error, compilation
failure, or type issue, the agent MUST run static analysis (
dart analyze) on the unmodified existing codebase first.- If
dart analyzereturns 0 issues, the reviewer's claim is empirically false. The item MUST be classified as👎 Disagree (Hallucinated Syntax/Compile Error)and NO code changes may be made for that item.
- If
- You have the execution advantage: External reviewers inspect static code,
whereas you can execute live compilers, static analyzers (
dart analyze), and test suites (dart test). Always empirically test claims before accepting them. - You are free to disagree: If a reviewer's claim is technically wrong, if
their suggestion introduces compiler warnings or regressions, or if the
existing code is already optimal, mark it as
👎 Disagree. Explain your technical rationale in the triage report and propose NO code changes for that item.
How to use this skill (The Workflow)
- NEVER GUESS Target PR or Branch: If the target PR number or branch is not
explicitly provided by the user, and the current git workspace state is on a
trunk branch (
main/master), in detached HEAD state, or matches multiple open PRs, DO NOT GUESS. The agent MUST pause execution and explicitly ask the user (usingask_questionor chat) to clarify which PR or branch to target before taking action.
Run the Triage Script: Execute the
triage.darthelper script using therun_commandtool. Use the--dir(or-C) option to specify the path to the target repository directory (the project you want to triage). This ensures that the underlyinggitandghcommands resolve to the correct repository and branch:dart run <path-to-github-pr-triage-skill>/bin/triage.dart --dir <path-to-target-repository>Note: If you need to target a specific PR or URL, you can also pass
--pr:dart run <path-to-github-pr-triage-skill>/bin/triage.dart --dir <path-to-target-repository> --pr <pr-number-or-url>Save the raw stdout of this script as a new markdown artifact named
raw_triage_output.mdin the artifacts directory (using thewrite_to_filetool).Verify Workspace State:
- The script output will show the PR URL, title, branch, Remote Commit SHA,
Local Commit SHA, and Sync Status (
in_sync,behind_remote,ahead_of_remote,diverged, orbranch_mismatch). - Verify that your current git branch matches the PR source branch (
headRefName). - Check the Sync Status:
- If
Sync Statusisbehind_remote, pull the latest remote commits (git pull) before making changes. - If
Sync Statusisahead_of_remoteordiverged, push or sync local commits (git push). - Do not start making code edits while the local workspace is out of sync with the remote PR.
- If
- The script output will show the PR URL, title, branch, Remote Commit SHA,
Local Commit SHA, and Sync Status (
Analyze Open Comments:
- The script lists all unresolved review threads, top-level review comments (overall review summaries), and general PR conversation comments.
- Read the conversations carefully to understand what reviewers are requesting.
- Focus only on unresolved or actionable comments. Ignore comments marked as resolved unless they provide necessary context.
- Ignore comments from the PR author themselves unless they clarify a reviewer's comment.
Analyze CI Status & Failures:
- The script lists status checks (both failed and active/pending).
- Active/Pending CI Handling: If any CI status checks are currently
running or pending:
- Inform the user and call
ask_questionto ask their preference:- Option 1:
(Recommended) Proceed with triaging open comments now - Option 2:
Wait for active CI status checks to complete first
- Option 1:
- MANDATORY HARD BLOCK: When CI is pending, you MUST halt execution after
calling
ask_question. Do NOT proceed to Step 5 (Generate a Triage Report) or create thepr_triage_report.mdartifact until the user has answered, because final CI results might change the triage plan and action items. - (Note: This interactive prompt and hard block are bypassed when
operating within an outer orchestrator skill like
pr-loop, which handles background timers automatically).
- Inform the user and call
- Analyze the stack traces, compile errors, or analyzer failures to understand why any failed checks failed.
Generate a Triage Report (Artifact):
- Prereq (Hard Gate): If CI status checks are active/pending, you MUST
NOT generate this report until the user has answered the
ask_questionprompt from Step 4. - Create a markdown artifact named
pr_triage_report.mdin the artifacts directory (usingwrite_to_filewithRequestFeedback: trueinArtifactMetadatato render an interactive 'Proceed' button). (Note: This step is bypassed ONLY IF operating within an outer orchestrator skill likepr-loopwith upfront user consent). - Link to Raw Output: Include a markdown link to the
raw_triage_output.mdartifact at the top of the report. - The report MUST group associated comments and CI failures into cohesive action items (you may cluster multiple related comments or failures together if they address the same problem).
- For each action item/group, include:
- Summary of Feedback/Failure: A concise summary of the reviewer
comment(s) or CI failure(s), including direct markdown links back to the
comments/checks on GitHub. When linking to comments, use a descriptive
link that includes both the comment/review number and the GitHub username of the
reviewer (e.g.
[Comment #1 by @reviewer_username](#)or[Review #1 by @reviewer_username](#)). - Thread & Comment/Review Identifiers (For Comments): Explicitly preserve the
Thread ID(e.g.PRRT_...),Comment ID(e.g.3438780787), orReview ID(e.g.PRR_...) from the header inraw_triage_output.mdunder each action item so the resolution step (gh apiorgh pr comment) has immediate access to the identifiers without extra API lookups. - Agent Assessment (For Comments):
- Agreement Level: A short indicator of your agreement using one of
these categories:
🔥 Urgent(Critical fix for a crash, bug, or CI blocker; we should fix immediately)👍 Solid(Good suggestion; we should implement it)🤷 Meh(Optional nit or stylistic preference; we could address it, but it's low priority)👎 Disagree(Incorrect or counter-productive suggestion; we should explain why and propose no action)
- Empirical Verification: Output of
dart analyzeordart testrun on the unmodified codebase before accepting any fix or classifying a claim. - Rationale: Your technical explanation of why you agree, disagree, or recommend a specific direction.
- Agreement Level: A short indicator of your agreement using one of
these categories:
- Planned Action:
- The target file name(s) and specific line ranges.
- The proposed changes (e.g. explanation, code snippet/diff, or "No action needed").
- Summary of Feedback/Failure: A concise summary of the reviewer
comment(s) or CI failure(s), including direct markdown links back to the
comments/checks on GitHub. When linking to comments, use a descriptive
link that includes both the comment/review number and the GitHub username of the
reviewer (e.g.
- Present this triage report to the user.
- Prereq (Hard Gate): If CI status checks are active/pending, you MUST
NOT generate this report until the user has answered the
Wait for Approval:
- DO NOT edit files or make changes until the user explicitly approves the
proposed plan via the interactive 'Proceed' button (or explicit chat
confirmation). (Note: This step is bypassed ONLY IF operating within an
outer orchestrator skill like
pr-loopwith upfront user consent).
- DO NOT edit files or make changes until the user explicitly approves the
proposed plan via the interactive 'Proceed' button (or explicit chat
confirmation). (Note: This step is bypassed ONLY IF operating within an
outer orchestrator skill like
Surgical Implementation & Verification:
- Once approved, address the comments and failures one by one.
- Add tests for new behavior: When a reviewer requests new behavior,
bug fixes, or edge-case handling, proactively write automated tests
(typically placed in the
test/directory with a_test.dartsuffix) to verify the changes and prevent future regressions. - Follow standard development workflows: run formatting, analysis, and tests locally to verify fixes before finishing.
Verify Git State and Offer Unified Resolution Menu:
- Outer Skill Exception: Step 8 is bypassed entirely ONLY IF operating
within an outer orchestrator skill (such as
pr-loop) that has already obtained upfront user consent for autonomous VCS commits and pushes. - Check Git Status first: Run
git statusto check whether uncommitted fixes or unpushed commits exist. - Present Completion Options (
ask_question): Use theask_questiontool to present a unified completion menu based on the working tree state (passing the options as a list parameter). Do NOT output raw text. By selecting an option that includes committing or pushing, the user explicitly authorizes those VCS operations for this workflow.- If uncommitted changes or unpushed commits exist, offer:
(Recommended) Commit fixes, push branch, reply to comments, and resolve threadsCommit fixes and push branch onlyCommit fixes locally onlyDo nothing
- If working tree is clean and all commits are pushed, offer:
(Recommended) Reply to comments and resolve threadsDo nothing
- If uncommitted changes or unpushed commits exist, offer:
- Execute Selected Actions:
- If committing is selected, stage all modified and new files (using
git add <files>orgit add .if no untracked scratch files exist) and create a descriptive commit. - If pushing is selected, run
git push. - If replying and resolving is selected, execute the
triage.dart resolvecommands using the patterns listed below.
- If committing is selected, stage all modified and new files (using
- Outer Skill Exception: Step 8 is bypassed entirely ONLY IF operating
within an outer orchestrator skill (such as
Replying and Resolving Comments
For every addressed review thread, you MUST execute thread resolution (thread resolution is explicit, mandatory, and un-skippable).
Use the resolve subcommand in triage.dart to programmatically reply to comments and resolve threads without shell-escaping issues:
# Reply to a comment and resolve its thread (pass --dir if outside target repo):
dart run <path-to-github-pr-triage-skill>/bin/triage.dart resolve --dir <path-to-target-repository> <thread_graphql_id> <comment_database_id> "<your reply body>"
# Or resolve a thread without posting a reply:
dart run <path-to-github-pr-triage-skill>/bin/triage.dart resolve --dir <path-to-target-repository> <thread_graphql_id>
Note: <thread_graphql_id> is the GraphQL node ID (e.g., PRRT_...) and <comment_database_id> is the numeric database ID (e.g., 3438780787), exactly as output in raw_triage_output.md.
Constraints
- Hard CI Gate: If CI checks are running or pending, you MUST halt execution
after calling
ask_questionin Step 4 and DO NOT proceed to Step 5 or generatepr_triage_report.mduntil the user responds, as pending CI results may alter the final triage plan. (Note: Bypassed ONLY IF operating within an outer orchestrator skill likepr-loop). - CRITICAL: You MUST NOT modify files or make any code edits to address PR
comments or CI failures before generating a
pr_triage_report.mdartifact and obtaining explicit user approval on the plan. (Note: This constraint is bypassed ONLY IF operating within an outer orchestrator skill likepr-loopwith upfront user consent). - VCS Authorization: Selecting an option in
ask_questionthat explicitly mentions committing or pushing serves as the user's explicit permission to perform those operations for the triage fixes. Do NOT ask for permission a second time if the user selects one of those options. (Note: This constraint is bypassed ONLY IF operating within an outer orchestrator skill likepr-loopwith upfront user consent). - Sync Code Before Comments: Do not post "Done" or "Fixed" comment replies or resolve threads on GitHub while the corresponding code fixes remain uncommitted or unpushed.
- Do NOT address resolved comments unless requested.
- NO
commit --amend: Modifying commit history viagit commit --amendis strictly prohibited. Always create new, atomic commits. - NO Force Pushes: Force pushing (
git push -for--force-with-lease) is strictly prohibited under any circumstances. - Always use the
triage.dartscript to fetch PR information instead of manual API calls to ensure consistency and minimize context bloat.