首页/ AI 技能 / @skilllib/skill-2117939930272410120
Skill站外收录 @skilllib/skill-2117939930272410120

add-review-comment

在 GitHub 拉取请求的指定代码行或行范围内添加评审评论,支持单行注释、多行范围标注及内联代码建议,自动关联最新提交哈希并附带生成标识。

0.0 (0) 17 次安装 原作者 编程导航
收录于 2026-01-22
开发运维 AI 技能

Skills.MD

# Add Review Comment Adds a review comment to a specific line in a GitHub pull request. ## Usage **Single-line comment:** ```bash gh api repos/<owner>/<repo>/pulls/<pr_number>/comments \ # Body must end with "🤖 Generated with Claude" on a separate line -f body=<comment> \ -f path=<file_path> \ -F line=<line_number> \ -f side=<side> \ -f commit_id="$(gh pr view <pr_number> --repo <owner>/<repo> --json headRefOid -q .headRefOid)" \ --jq '.html_url' ``` **Multi-line comment:** ```bash gh api repos/<owner>/<repo>/pulls/<pr_number>/comments \ # Body must end with "🤖 Generated with Claude" on a separate line -f body=<comment> \ -f path=<file_path> \ -F start_line=<first_line> \ -f start_side=<side> \ -F line=<last_line> \ -f side=<side> \ -f commit_id="$(gh pr view <pr_number> --repo <owner>/<repo> --json headRefOid -q .headRefOid)" \ --jq '.html_url' ``` ## Parameters - `line`: Line number in the file (for multi-line, the last line) - `side`: `RIGHT` for added/modified lines (+), `LEFT` for deleted lines (-) - `start_line`/`start_side`: For multi-line comments, the first line of the range ## Best Practices - Use suggestion blocks (three backticks + "suggestion") for simple fixes that maintainers can apply with one click ```` ```suggestion <suggested code here> ``` ```` Note: Preserve original indentation exactly in suggestion blocks - For repetitive issues, leave one representative comment instead of flagging every instance - For bugs, explain the potential problem and suggested fix clearly

评论 0

还没有评论,来抢沙发。