npx skills add https://github.com/a2f0/tearleads --skill address-gemini-feedback首先:使用 agentTool 包装器获取 PR 信息:
./scripts/agents/tooling/agentTool.ts getPrInfo --fields number,headRefName,url
提取 number 作为 PR_NUMBER,提取 url 作为 PR_URL,供后续命令使用。
回复 Gemini 评论时,必须使用 REST API 创建即时评论回复。不要使用 gh pr review 或 GraphQL 评审变更 - 这些操作会创建待处理/草稿评审,这些评审在提交前是不可见的,Gemini 将永远看不到它们。
每条回复都必须标记 @gemini-code-assist,以确保 Gemini 收到通知并作出响应。
关于正确的 API 用法和示例,请参阅 $follow-up-with-gemini。
First : Get PR info using the agentTool wrapper:
./scripts/agents/tooling/agentTool.ts getPrInfo --fields number,headRefName,url
Extract number as PR_NUMBER and url as PR_URL for use in subsequent commands.
When replying to Gemini comments, you MUST use the REST API to create immediate comment replies. Do NOT use gh pr review or GraphQL review mutations - these create pending/draft reviews that remain invisible until submitted, and Gemini will never see them.
Always tag@gemini-code-assist in every reply to ensure Gemini receives a notification and responds.
See for the correct API usage and examples.
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
在获取评论之前,检查 Gemini 是否已达到其每日配额:
./scripts/agents/tooling/agentTool.ts getPrInfo --fields comments
解析评论以检查 Gemini 的配额消息。如果响应包含“您已达到每日配额限制”:
回退到 Codex 评审:
./scripts/agents/tooling/agentTool.ts solicitCodexReview
跳过剩余步骤(没有 Gemini 反馈需要处理)
提前返回一条消息,说明已使用 Codex 作为回退方案
处理反馈时,请区分:
不要随意推迟修复。 仅在以下情况下推迟:
推迟时,将项目添加到 deferred_items 状态数组(由 $enter-merge-queue 跟踪):
deferred_items.push({
thread_id: <thread_node_id>,
path: <file_path>,
line: <line_number>,
body: <需要完成工作的摘要>,
html_url: <评审线程的链接>
})
回复线程解释推迟原因:
@gemini-code-assist 此反馈是有效的,但超出了本 PR 的范围。我将推迟到合并后创建的一个后续问题中处理。该问题将被标记为 `deferred-fix` 并引用此线程。
然后解决该线程。
获取未解决的评论:使用 agentTool 包装器获取评审线程:
./scripts/agents/tooling/agentTool.ts getReviewThreads --number $PR_NUMBER --unresolved-only
这将返回未解决评审线程的 JSON 数组,包含:
* `id`:线程节点 ID(用于解决)
* `isResolved`:布尔值(由于 `--unresolved-only` 将为 false)
* `path`:文件路径
* `line`:行号
* `comments`:包含 `{id, databaseId, author: {login}, body}` 的数组
包装器会自动处理分页。
处理反馈:对于每个您认为相关/重要的未解决评论:
deferred_items 并回复解释推迟原因。提交并推送(如果进行了代码更改):使用约定式提交消息(例如 fix: address Gemini review feedback)提交,记录用于线程回复的 SHA,并直接推送(不要使用 $commit-and-push 以避免循环)。
关键:在回复前验证推送是否完成。
推送后,验证提交在远程仓库是否可见:
BRANCH=$(git branch --show-current)
git fetch origin "$BRANCH"
LOCAL_SHA=$(git rev-parse HEAD)
REMOTE_SHA=$(git rev-parse "origin/$BRANCH")
if [ "$LOCAL_SHA" != "$REMOTE_SHA" ]; then
echo "ERROR: Push not yet complete. Wait and retry."
exit 1
fi
在此验证通过之前,不要进行第 5 步。 当提交 X 尚未推送到远程仓库时,回复 Gemini“已在提交 X 中修复”会造成混淆。
更新 PR 描述:如果更改很重要,使用 gh pr edit --body 更新 PR 正文。
跟进:运行 $follow-up-with-gemini 进行回复,等待确认,并解决线程。跟进技能将在回复前重新验证推送状态。
重复:如果 Gemini 要求进一步更改,从步骤 1 开始重复。
在仅退出代码重要的情况下,抑制详细输出:
# 抑制代码检查/类型检查/测试输出
pnpm lint >/dev/null
pnpm typecheck >/dev/null
pnpm test >/dev/null
# 抑制 git 操作
git commit -S -m "message" >/dev/null
git push >/dev/null
对 gh 命令使用 --json 配合 --jq 过滤,以仅获取所需字段。失败时,重新运行而不抑制输出以进行调试。
每周安装次数
1
仓库
首次出现
1 天前
安全审计
安装于
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
$follow-up-with-geminiBefore fetching comments, check if Gemini has hit its daily quota:
./scripts/agents/tooling/agentTool.ts getPrInfo --fields comments
Parse the comments to check for Gemini's quota message. If the response contains "You have reached your daily quota limit":
Fall back to Codex review:
./scripts/agents/tooling/agentTool.ts solicitCodexReview
Skip the remaining steps (no Gemini feedback to address)
Return early with a message that Codex was used as fallback
When addressing feedback, distinguish between:
Do NOT defer fixes casually. Only defer when:
When deferring, add the item to the deferred_items state array (tracked by $enter-merge-queue):
deferred_items.push({
thread_id: <thread_node_id>,
path: <file_path>,
line: <line_number>,
body: <summary of what needs to be done>,
html_url: <link to the review thread>
})
Reply to the thread explaining the deferral:
@gemini-code-assist This feedback is valid but out of scope for this PR. I'm deferring this to a follow-up issue that will be created after merge. The issue will be labeled `deferred-fix` and reference this thread.
Then resolve the thread.
Fetch unresolved comments : Use the agentTool wrapper to get review threads:
./scripts/agents/tooling/agentTool.ts getReviewThreads --number $PR_NUMBER --unresolved-only
This returns JSON array of unresolved review threads with:
* `id`: Thread node ID (for resolving)
* `isResolved`: Boolean (will be false due to `--unresolved-only`)
* `path`: File path
* `line`: Line number
* `comments`: Array with `{id, databaseId, author: {login}, body}`
The wrapper handles pagination automatically.
Address feedback : For each unresolved comment that you think is relevant/important:
deferred_items and reply explaining the deferral.Commit and push (if code changes were made): Commit with conventional message (e.g., fix: address Gemini review feedback), note the SHA for thread replies, and push directly (do NOT use $commit-and-push to avoid loops).
CRITICAL: Verify push completed before replying.
After pushing, verify commits are visible on remote:
BRANCH=$(git branch --show-current)
git fetch origin "$BRANCH"
LOCAL_SHA=$(git rev-parse HEAD)
REMOTE_SHA=$(git rev-parse "origin/$BRANCH")
if [ "$LOCAL_SHA" != "$REMOTE_SHA" ]; then
echo "ERROR: Push not yet complete. Wait and retry."
exit 1
fi
Do NOT proceed to step 5 until this verification passes. Replying to Gemini with "Fixed in commit X" when X is not yet on remote creates confusion.
Update PR description : If changes are significant, update the PR body with gh pr edit --body.
Follow up : Run $follow-up-with-gemini to reply, wait for confirmation, and resolve threads. The follow-up skill will re-verify push status before replying.
Repeat : If Gemini requests further changes, repeat from step 1.
Suppress verbose output where only exit codes matter:
# Suppress lint/typecheck/test output
pnpm lint >/dev/null
pnpm typecheck >/dev/null
pnpm test >/dev/null
# Suppress git operations
git commit -S -m "message" >/dev/null
git push >/dev/null
Use --json with --jq filtering for gh commands to get only needed fields. On failure, re-run without suppression to debug.
Weekly Installs
1
Repository
First Seen
1 day ago
Security Audits
Installed on
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
147,400 周安装