chore: add local triage-github skill with discussions support#633
Conversation
Vendors the global triage-github skill into the repo and extends it to triage open Discussions alongside Issues and PRs. Discussions are fetched via `gh api graphql` (no built-in `gh discussion list`) and ranked with a category-aware rubric: unanswered Q&A and high-upvote Ideas surface as P0, with `convert-to-issue` recommended when a discussion looks like a bug report. Skill is read-only — produces a report, never posts or closes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR introduces a new Claude Code skill for automated GitHub repository triage. The document specifies a complete workflow: fetching open PRs, issues, and discussions; dispatching up to 100 parallel subagents to score each item; aggregating results by priority; and writing a structured triage report with prioritized sections and metadata. ChangesTriage Skill Specification
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
|
View your CI Pipeline Execution ↗ for commit 435bef2
☁️ Nx Cloud last updated this comment at |
@tanstack/ai
@tanstack/ai-anthropic
@tanstack/ai-client
@tanstack/ai-code-mode
@tanstack/ai-code-mode-skills
@tanstack/ai-devtools-core
@tanstack/ai-elevenlabs
@tanstack/ai-event-client
@tanstack/ai-fal
@tanstack/ai-gemini
@tanstack/ai-grok
@tanstack/ai-groq
@tanstack/ai-isolate-cloudflare
@tanstack/ai-isolate-node
@tanstack/ai-isolate-quickjs
@tanstack/ai-ollama
@tanstack/ai-openai
@tanstack/ai-openrouter
@tanstack/ai-preact
@tanstack/ai-react
@tanstack/ai-react-ui
@tanstack/ai-solid
@tanstack/ai-solid-ui
@tanstack/ai-svelte
@tanstack/ai-utils
@tanstack/ai-vue
@tanstack/ai-vue-ui
@tanstack/openai-base
@tanstack/preact-ai-devtools
@tanstack/react-ai-devtools
@tanstack/solid-ai-devtools
commit: |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.claude/skills/triage-github/SKILL.md (1)
72-72: ⚡ Quick winAdd language identifiers to fenced code blocks to satisfy markdownlint MD040.
Use explicit fence languages (e.g.,
text,json, ormarkdown) for the three prompt-template blocks.Proposed diff
-``` +```text Triage GitHub PR [URL]. You have read-only access via `gh` and web tools. @@ -``` +``` -``` +```text Triage GitHub issue [URL]. Read-only access via `gh`. @@ -``` +``` -``` +```text Triage GitHub discussion [URL]. Read-only access via `gh api graphql`. @@ -``` +```Also applies to: 94-94, 115-115
🤖 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 @.claude/skills/triage-github/SKILL.md at line 72, Add explicit fenced-code language identifiers ("text") to the three prompt-template blocks so markdownlint MD040 is satisfied: update the block starting with "Triage GitHub PR [URL]. You have read-only access via `gh` and web tools.", the block starting with "Triage GitHub issue [URL]. Read-only access via `gh`.", and the block starting with "Triage GitHub discussion [URL]. Read-only access via `gh api graphql`." by replacing the opening triple backticks with ```text and leaving the closing triple backticks unchanged.
🤖 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 @.claude/skills/triage-github/SKILL.md:
- Around line 236-240: Update the summary-generation template under the "6.
Summarize for the user" section so the summary format is conditional on whether
discussions are enabled: when discussions are disabled omit the "top 3
discussions to engage with" line and instead ensure the earlier "Discussions are
disabled" one-liner is present near the top; when enabled include the existing
"top 3 discussions" entry. Modify the logic around the "Discussions to engage
with" heading and the final 3–5 line user-summary wording so that the
discussions bullet is only produced if the discussions feature flag is true,
keeping the rest of the summary (total counts, top PRs, top issues, report path)
unchanged.
- Around line 58-64: Choose a single behavior: remove the "ask the user to
choose" branch and implement deterministic auto-selection using the existing
counts nPRs, nIssues, nDiscussions; compute total = nPRs+nIssues+nDiscussions,
and if total > 100 select the top items by priority (PRs first, then issues by
most-recently-updated, then discussions by most-recently-updated) up to 100 and
mark skipped items in the final report, ensuring only the auto-selection logic
referenced by nPRs/nIssues/nDiscussions remains in the procedure.
- Line 158: The ranking logic is using ageDays ascending while the spec says
newer-first for P0/P1, so update the comparator that sorts PRs by "ageDays" for
each priority tier: for P0 and P1 sort by ageDays descending (larger ageDays =
newer if your field represents days since creation, or invert accordingly if
ageDays means the opposite), and for P3 sort by ageDays ascending (oldest
first); locate the code that groups by priority and calls sort on ageDays
(search for "ageDays" and the "PRs by priority" ranking block) and flip the
comparator sign or swap a and b in the compare function, or alternatively rename
the field/wording if you prefer clarity, then add a unit test verifying P0/P1
are newer-first and P3 is oldest-first.
---
Nitpick comments:
In @.claude/skills/triage-github/SKILL.md:
- Line 72: Add explicit fenced-code language identifiers ("text") to the three
prompt-template blocks so markdownlint MD040 is satisfied: update the block
starting with "Triage GitHub PR [URL]. You have read-only access via `gh` and
web tools.", the block starting with "Triage GitHub issue [URL]. Read-only
access via `gh`.", and the block starting with "Triage GitHub discussion [URL].
Read-only access via `gh api graphql`." by replacing the opening triple
backticks with ```text and leaving the closing triple backticks unchanged.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7cdf40b1-b765-458a-a849-0913daea1c1a
📒 Files selected for processing (1)
.claude/skills/triage-github/SKILL.md
| If the combined total exceeds 100 items, tell the user the counts (PRs / issues / discussions) and ask whether to cap at 100 most-recently-updated or split into batches. The agent cap is 100 total across all three categories. | ||
|
|
||
| ### 2. Decide the parallel split | ||
|
|
||
| - Count `nPRs`, `nIssues`, `nDiscussions`. | ||
| - If `nPRs + nIssues + nDiscussions <= 100`: spawn one agent per item. | ||
| - Otherwise: prioritize PRs first (they block contributors), then issues by most-recently-updated, then discussions by most-recently-updated, up to the 100 budget. Note in the final report which items were skipped. |
There was a problem hiding this comment.
Resolve conflicting over-budget behavior in the procedure.
Line 58 says to ask the user to choose between capping vs batching, but Line 64 prescribes automatic prioritization into the 100-item budget. Keep one source of truth (either explicit user choice or deterministic auto-selection), otherwise implementations will diverge.
🤖 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 @.claude/skills/triage-github/SKILL.md around lines 58 - 64, Choose a single
behavior: remove the "ask the user to choose" branch and implement deterministic
auto-selection using the existing counts nPRs, nIssues, nDiscussions; compute
total = nPRs+nIssues+nDiscussions, and if total > 100 select the top items by
priority (PRs first, then issues by most-recently-updated, then discussions by
most-recently-updated) up to 100 and mark skipped items in the final report,
ensuring only the auto-selection logic referenced by nPRs/nIssues/nDiscussions
remains in the procedure.
|
|
||
| Sort: | ||
|
|
||
| 1. PRs by priority (P0→P3), then by `ageDays` ascending within each tier (newer first for P0/P1 to capture momentum; for P3 by oldest first — those are stalest). |
There was a problem hiding this comment.
Fix the ageDays sort direction mismatch.
ageDays ascending means older first, but the text says “newer first” for P0/P1. This is a correctness bug in ranking logic. Use descending for newer-first (or rename field/wording for clarity).
🤖 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 @.claude/skills/triage-github/SKILL.md at line 158, The ranking logic is
using ageDays ascending while the spec says newer-first for P0/P1, so update the
comparator that sorts PRs by "ageDays" for each priority tier: for P0 and P1
sort by ageDays descending (larger ageDays = newer if your field represents days
since creation, or invert accordingly if ageDays means the opposite), and for P3
sort by ageDays ascending (oldest first); locate the code that groups by
priority and calls sort on ageDays (search for "ageDays" and the "PRs by
priority" ranking block) and flip the comparator sign or swap a and b in the
compare function, or alternatively rename the field/wording if you prefer
clarity, then add a unit test verifying P0/P1 are newer-first and P3 is
oldest-first.
| If discussions are disabled on the repo, omit the "Discussions to engage with" section and add a one-liner near the top noting they're disabled. | ||
|
|
||
| ### 6. Summarize for the user | ||
|
|
||
| After writing the file, give the user a 3–5 line summary: total counts, top 3 PRs to review, top 3 issues to fix, top 3 discussions to engage with, and the report path. Do not paste the full report into chat. |
There was a problem hiding this comment.
Make user-summary requirements conditional when discussions are disabled.
Line 236 correctly omits the discussions section when disabled, but Line 240 still requires “top 3 discussions.” Add explicit conditional wording so the summary format remains valid without discussions.
🤖 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 @.claude/skills/triage-github/SKILL.md around lines 236 - 240, Update the
summary-generation template under the "6. Summarize for the user" section so the
summary format is conditional on whether discussions are enabled: when
discussions are disabled omit the "top 3 discussions to engage with" line and
instead ensure the earlier "Discussions are disabled" one-liner is present near
the top; when enabled include the existing "top 3 discussions" entry. Modify the
logic around the "Discussions to engage with" heading and the final 3–5 line
user-summary wording so that the discussions bullet is only produced if the
discussions feature flag is true, keeping the rest of the summary (total counts,
top PRs, top issues, report path) unchanged.
Summary
triage-githubskill into.claude/skills/triage-github/SKILL.mdso the repo carries its own version and can evolve it independently.gh api graphql(no built-ingh discussion list).convert-to-issuewhen a discussion is actually a bug report, plusanswer,engage,mark-answered,close,wait.hasDiscussionsEnabledis false.No SDK / docs / E2E coupling triggered — this is maintainer tooling under
.claude/skills/.Test plan
convert-to-issueandcloserecommendations on a few P0 discussions before acting.🤖 Generated with Claude Code
Summary by CodeRabbit