Repository navigation
docs: add copilot-pr-review-workflow skill #764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,163 @@ | ||||||
| --- | ||||||
| name: "copilot-pr-review-workflow" | ||||||
| description: "Complete pipeline for handling Copilot PR reviewer bot comments ΓÇö from reading reviews to resolving threads" | ||||||
| domain: "pr-review" | ||||||
| confidence: "medium" | ||||||
| source: "earned" | ||||||
| tools: | ||||||
| - name: "pull_request_read" | ||||||
| description: "GitHub MCP tool to read PR review comments" | ||||||
| when: "Reading Copilot review threads with get_review_comments method" | ||||||
| - name: "gh api graphql" | ||||||
|
Comment on lines
+7
to
+11
|
||||||
| description: "GitHub CLI GraphQL API for thread resolution" | ||||||
| when: "Querying and resolving review threads after fixes are pushed" | ||||||
| --- | ||||||
|
|
||||||
| ## Context | ||||||
|
|
||||||
| When Copilot reviewer bot leaves comments on a PR, agents need a structured workflow to triage, fix, and resolve those comments. This skill covers the full pipeline ΓÇö reading reviews, evaluating comments critically, routing fixes to the correct agent (lockout rules), resolving threads via GraphQL, and verifying CI. Confirmed across PRs #756, #760, #762 in a single session. | ||||||
|
|
||||||
| ## Scope | ||||||
|
|
||||||
| ✅ THIS SKILL PRODUCES: | ||||||
| - A decision on which comments to fix vs push back on | ||||||
| - Correctly routed fix assignments (respecting lockout) | ||||||
| - Resolved review threads after verified fixes | ||||||
| - Green CI confirmation | ||||||
|
|
||||||
| ❌ THIS SKILL DOES NOT PRODUCE: | ||||||
| - New tests (unless a comment specifically requests one) | ||||||
| - Refactors beyond what the comment identifies | ||||||
| - Changes to `.squad/` files (keep PR hygiene separate) | ||||||
|
Comment on lines
+20
to
+31
|
||||||
|
|
||||||
| ## Patterns | ||||||
|
|
||||||
| ### 1. Reading Copilot Reviews | ||||||
|
|
||||||
| Use GitHub MCP `pull_request_read` with `get_review_comments` method to fetch all review threads: | ||||||
|
|
||||||
| ``` | ||||||
| pull_request_read(method: "get_review_comments", owner: "{owner}", repo: "{repo}", pullNumber: {N}) | ||||||
| ``` | ||||||
|
|
||||||
| Or use `gh api graphql` for richer data (includes resolution state): | ||||||
|
|
||||||
| ``` | ||||||
| gh api graphql -f query='query { | ||||||
| repository(owner: "{owner}", name: "{repo}") { | ||||||
| pullRequest(number: {N}) { | ||||||
| reviewThreads(first: 50) { | ||||||
| nodes { | ||||||
| id | ||||||
| isResolved | ||||||
| isOutdated | ||||||
| comments(first: 10) { | ||||||
| nodes { body path line } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| }' | ||||||
| ``` | ||||||
|
|
||||||
| ### 2. Evaluating Comments Critically | ||||||
|
|
||||||
| Do NOT rubber-stamp every suggestion. Assess each comment on its merit: | ||||||
|
|
||||||
| | Category | Action | Example | | ||||||
| |---|---|---| | ||||||
| | **Factual error** | Always fix | Wrong filename referenced, incorrect API endpoint | | ||||||
| | **Missing edge case** | Usually fix | Null/undefined guard, empty-string check | | ||||||
| | **Style / opinion** | Evaluate context | Naming preference, code organization suggestion | | ||||||
| | **Over-engineering** | Push back | Adding abstraction layers for single-use code | | ||||||
|
|
||||||
| **Session evidence:** All 3 comments on #756 were valid (subpath regex gap, wrong filename, misleading text). All 6 on #760/#762 were valid (path safety, breaking type change, misleading warning messages). | ||||||
|
|
||||||
| ### 3. Lockout Enforcement on Fixes | ||||||
|
|
||||||
| **The original PR author CANNOT fix Copilot review comments on their own PR.** Per the reviewer rejection lockout rules in squad.agent.md, route to a DIFFERENT agent. | ||||||
|
|
||||||
| Session examples: | ||||||
| - PR #760: **Network** authored → **FIDO** fixed Copilot comments | ||||||
| - PR #762: **EECOM** authored → **CONTROL** fixed Copilot comments | ||||||
|
Comment on lines
+81
to
+83
|
||||||
|
|
||||||
| The coordinator must track who authored the PR and assign the fix to someone else. | ||||||
|
|
||||||
| ### 4. Resolving Threads After Fix | ||||||
|
|
||||||
| After the fix is pushed and CI is green, resolve each thread via GraphQL. | ||||||
|
|
||||||
| **Step 1 ΓÇö Query unresolved threads:** | ||||||
|
|
||||||
| ```bash | ||||||
| gh api graphql -f query='query { | ||||||
| repository(owner: "{owner}", name: "{repo}") { | ||||||
| pullRequest(number: {N}) { | ||||||
| reviewThreads(first: 50) { | ||||||
| nodes { id isResolved } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| }' | ||||||
| ``` | ||||||
|
|
||||||
| **Step 2 ΓÇö Resolve each unresolved thread:** | ||||||
|
|
||||||
| ```bash | ||||||
| gh api graphql -f query='mutation { | ||||||
| resolveReviewThread(input: {threadId: "{id}"}) { | ||||||
| thread { isResolved } | ||||||
| } | ||||||
| }' | ||||||
| ``` | ||||||
|
|
||||||
| ### 5. Verifying CI After Fixes | ||||||
|
|
||||||
| Always confirm CI stays green after pushing review fixes: | ||||||
|
|
||||||
| ```bash | ||||||
| gh pr checks {N} --repo {owner}/{repo} | ||||||
| ``` | ||||||
|
|
||||||
| Do not resolve threads until CI passes. A fix that breaks the build is worse than the original comment. | ||||||
|
|
||||||
| ### 6. Common Copilot Reviewer Patterns | ||||||
|
|
||||||
| What Copilot reviewer catches well ΓÇö expect these categories: | ||||||
|
|
||||||
| - **Missing edge cases** in input validation (null/undefined guards) | ||||||
| - **Breaking type changes** in public APIs (required → optional field) | ||||||
| - **Misleading error messages** that suggest wrong remediation steps | ||||||
| - **Regex patterns** too narrow for their stated intent | ||||||
| - **Encoding issues** (mojibake in generated content) | ||||||
| - **Pagination limits** in API calls (hardcoded page sizes) | ||||||
|
|
||||||
| ### 7. PR Hygiene Checks (Before Copilot Reviews) | ||||||
|
|
||||||
| Run these checks BEFORE submitting for review to reduce noise: | ||||||
|
|
||||||
| - No `.squad/` files in the diff | ||||||
|
||||||
| - No `.squad/` files in the diff | |
| - No unrelated `.squad/` changes in the diff |
Copilot
AI
Apr 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file includes additional mojibake in numeric/comparison text (e.g., "Γëñ10") and several em-dash occurrences ("ΓÇö"). These should be replaced with the intended symbols (e.g., "≤10" and "—") and the file should be normalized to UTF-8 so future edits don’t reintroduce encoding corruption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file contains mojibake characters (e.g., "ΓÇö") in the YAML frontmatter description, which indicates an encoding/charset issue and will render incorrectly in docs. Replace these with the intended characters (e.g., an em dash "—") and ensure the file is saved as UTF-8.