ask
免费Route a codebase question to the right tool — structural graph, semantic search, or risk analysis. Use when you need to find or understand code without knowing exact file names.
中文简介正在准备中。当前显示原文说明。
PR triage — audit open PRs, deep review selected ones, draft and post review comments. Args: "all" to review all, PR numbers to focus (e.g. "42 57"), "fr" for French output, no arg = audit only in English.
中文简介正在准备中。当前显示原文说明。
安装前可以查看交给 AI 代理的指令内容。
Workflow in 3 phases: automatic audit → opt-in deep review → comments with mandatory user validation.
| Skill | Usage | Output |
|---|---|---|
/pr-triage | Triage, review, and comment on PRs | Action table + reviews + posted comments |
/repo-recap | General recap to share with the team | Markdown summary (PRs + issues + releases) |
Triggers:
/pr-triage or /pr-triage all or /pr-triage 42 57fr or french → output tables and summary in Frenchen, english, or no argument → English (default)git rev-parse --is-inside-work-tree
gh auth status
If either fails, stop and explain what's missing.
# Repo identity
gh repo view --json nameWithOwner -q .nameWithOwner
# Open PRs with full metadata
gh pr list --state open --limit 50 \
--json number,title,author,createdAt,updatedAt,additions,deletions,changedFiles,isDraft,mergeable,reviewDecision,statusCheckRollup,body
# Collaborators (to distinguish "our PRs" from external ones)
gh api "repos/{owner}/{repo}/collaborators" --jq '.[].login'
Collaborators fallback — if gh api .../collaborators fails (403/404):
gh pr list --state merged --limit 10 --json author --jq '.[].author.login' | sort -u
If still ambiguous, ask the user via AskUserQuestion.
For each PR, fetch existing reviews AND modified files:
gh api "repos/{owner}/{repo}/pulls/{num}/reviews" \
--jq '[.[] | .user.login + ":" + .state] | join(", ")'
gh pr view {num} --json files --jq '[.files[].path] | join(",")'
Note on rate limiting: fetching files is N API calls (1 per PR). For repos with 20+ PRs, prioritize PRs that are candidates for overlap (same functional area, same author).
Note: author is an object {login: "..."} — always extract .author.login.
Size classification:
| Label | Additions |
|---|---|
| XS | < 50 |
| S | 50–200 |
| M | 200–500 |
| L | 500–1000 |
| XL | > 1000 |
Size format: +{additions}/-{deletions}, {files} files ({label})
Detections:
statusCheckRollup → clean / unstable / dirtyPR ↔ Issue links:
body for fixes #N, closes #N, resolves #N (case-insensitive)Fixes #42 in the Action/Status columnCategorization:
Our PRs: author in collaborators list
External — Ready: additions ≤ 1000 AND files ≤ 10 AND mergeable ≠ CONFLICTING AND CI clean/unstable
External — Problematic: any of:
mergeable == CONFLICTING (merge conflict)## Open PRs ({count})
### Our PRs
| PR | Title | Size | CI | Status |
| -- | ----- | ---- | -- | ------ |
### External — Ready for Review
| PR | Author | Title | Size | CI | Reviews | Action |
| -- | ------ | ----- | ---- | -- | ------- | ------ |
### External — Problematic
| PR | Author | Title | Size | Problem | Recommended Action |
| -- | ------ | ----- | ---- | ------- | ------------------ |
### Summary
- Quick wins: {XS/S PRs ready to merge}
- Risks: {overlaps, XL sizes, dirty CI}
- Clusters: {authors with 3+ PRs}
- Stale: {PRs with no activity >14d}
- Overlaps: {PRs touching the same files}
0 PRs → display No open PRs. and finish.
After displaying the triage table, copy to clipboard:
clip() {
if command -v pbcopy &>/dev/null; then pbcopy
elif command -v xclip &>/dev/null; then xclip -selection clipboard
elif command -v wl-copy &>/dev/null; then wl-copy
else cat
fi
}
Confirm: Triage table copied to clipboard.
If argument passed:
"all" → all external PRs"42 57") → only those PRsAskUserQuestionIf no argument, ask:
question: "Which PRs do you want to deep review?"
header: "Deep Review"
multiSelect: true
options:
- label: "All external"
description: "Review {N} external PRs with code-reviewer agents in parallel"
- label: "Problematic only"
description: "Focus on the {M} at-risk PRs (dirty CI, too large, overlaps)"
- label: "Ready only"
description: "Review {K} PRs ready to merge"
- label: "Skip"
description: "Stop here — audit only"
Draft PRs:
42)If "Skip" → end workflow.
For each selected PR, spawn a reviewer subagent via the Agent tool in parallel:
subagent_type: reviewer
prompt: |
Review PR #{num}: "{title}" by @{author}
**Metadata**: +{additions}/-{deletions}, {changedFiles} files ({size_label})
**CI**: {ci_status} | **Reviews**: {existing_reviews} | **Draft**: {isDraft}
**PR Body**:
{body}
**Diff**:
{gh pr diff {num} output}
Apply your full 10-point review protocol. Focus on:
- Correctness and logic
- Test coverage for new code paths
- Security implications (injection, data exposure, permissions)
- Cross-layer consistency (if applicable)
- Code quality and maintainability
Return a structured review:
### Critical Issues 🔴
### Important Issues 🟡
### Suggestions 🟢
### What's Good ✅
Be specific: quote file:line, explain why it's an issue, suggest the fix.
Fetch diff via:
gh pr diff {num}
gh pr view {num} --json body,title,author -q '{body: .body, title: .title, author: .author.login}'
Aggregate all reports. Display a summary after all reviews complete.
For each reviewed PR, generate a GitHub comment in English.
Rules:
file.ext:42)Display ALL drafted comments in format:
---
### Draft — PR #{num}: {title}
{full comment}
---
Then ask via AskUserQuestion:
question: "These comments are ready. Which ones do you want to post?"
header: "Post"
multiSelect: true
options:
- label: "All ({N} comments)"
description: "Post on all reviewed PRs"
- label: "PR #{x} — {title_truncated}"
description: "Post only on this PR"
- label: "None"
description: "Cancel — don't post anything"
For each validated comment:
gh pr comment {num} --body-file - <<'REVIEW_EOF'
{comment}
REVIEW_EOF
Confirm each post: ✅ Comment posted on PR #{num}: {title}
If "None" → No comments posted. Workflow complete.
| Situation | Behavior |
|---|---|
| 0 open PRs | No open PRs. + finish |
| Draft PR | Flag in table, skip for review unless explicitly selected |
| Unknown CI | Display ? in CI column |
| Reviewer agent timeout | Show partial error, continue with others |
gh pr diff empty | Skip that PR, notify user |
| Very large PR (>5000 additions) | Warn: "Partial review, diff truncated" |
| Collaborators API 403/404 | Fallback to authors of last 10 merged PRs |
gh repo view, never hardcodegh CLI (not curl GitHub API) except for the collaborators liststatusCheckRollup can be null → treat as ?mergeable can be MERGEABLE, CONFLICTING, or UNKNOWN → treat UNKNOWN as ?gh pr comment还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Route a codebase question to the right tool — structural graph, semantic search, or risk analysis. Use when you need to find or understand code without knowing exact file names.
中文简介正在准备中。当前显示原文说明。
Auto-configure CLAUDE.md and claude/ knowledge docs for a new project. Use when setting up Brain Bootstrap in a new repository. Discovers the codebase, fills in templates, and writes project-specific configuration.
中文简介正在准备中。当前显示原文说明。
Use before any new feature, component, or behavioral change — when you need to explore requirements and design before writing code
中文简介正在准备中。当前显示原文说明。
Activate safety guards for the session. Use /careful before critical operations — blocks rm -rf, DROP TABLE, git push --force, kubectl delete namespace, docker system prune via PreToolUse hook.
中文简介正在准备中。当前显示原文说明。
Generate a user-facing changelog from git commits — categorize, filter noise, translate to user language. Runs in isolated fork context.
中文简介正在准备中。当前显示原文说明。
Save session state before context gets full or before ending. Writes current task state, branch, and loaded docs to claude/tasks/todo.md so the next session can resume cleanly.
中文简介正在准备中。当前显示原文说明。