获取CodeRabbit线程
MotleyAI2026-10-27查看 636复制 1961
当用户要求获取/列出/读取/显示 GitHub PR 上未解决的 CodeRabbit 审核线程时使用。提取 CodeRabbit 打开的每个尚未解决的线程的线程 URL、文件:行、作者和完整评论正文,以及 CodeRabbit 的评论摘要挑剔。
📘如何使用这个技能
- 1复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
- 2打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
- 3粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
- 4直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景
💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。
SKILL.md2334 chars
---
name: fetch-coderabbit-threads
description: Use when the user asks to fetch / list / read / show unresolved CodeRabbit review threads on a GitHub PR. Pulls thread URL, file:line, author, and full comment body for every thread CodeRabbit opened that is not yet resolved, plus CodeRabbit's review-summary nitpicks.
---
**Preflight:** run `la-doctor --plugin <this skill's base directory>` once per session before using any `la-*` or `dr-*` command; if it fails, stop and show the user its output.
# Fetch unresolved CodeRabbit review threads from a PR
## How to run
```bash
la-fetch-coderabbit-threads <PR_NUMBER> [--repo OWNER/REPO] [--all-authors]
```
Works in any repo; it does not read `living-architecture.yaml`.
- `<PR_NUMBER>` — required, the PR number.
- `--repo OWNER/REPO` — optional; defaults to the repo of the current git directory (auto-detected via `gh repo view`).
- `--all-authors` — include unresolved threads from any author, not just CodeRabbit.
## Output
Always emits **both** formats side-by-side:
- **Markdown to stdout** — one section per inline thread (URL, file:line, author, resolved/outdated, each comment body), followed by `## CodeRabbit review-summary nitpicks` and `## CodeRabbit outside-diff-range comments` sections.
- **JSON file** — full filtered payload at `${TMPDIR:-/tmp}/coderabbit-threads-<pr>-<utc-timestamp>.json`. The path is printed on the last line, prefixed `JSON: `.
The JSON schema is:
```json
{"pr": 63, "repo": "owner/name", "threads": [...], "nitpicks": [...], "outside_diff": [...]}
```
## Steps
1. Run the script with the PR number the user gave (or, if they didn't say, infer from `gh pr view --json number -q .number`).
2. Read the Markdown output and present a concise summary to the user — count, files touched, visible severity. Re-parse the JSON file (no extra API call) if you need structured data.
3. **Never** call any "resolve" mutation or click "Resolve" on threads. Only read — CodeRabbit and reviewers manage thread resolution.
## Why this skill
Fetching unresolved CodeRabbit threads needs `gh api graphql` (the REST API doesn't expose `isResolved`) and a separate `gh api .../pulls/N/reviews` call to pick up nitpicks that live in review bodies, not threads. This skill bundles both. Always use it instead of hand-rolling `gh api graphql` queries.