npx skills add https://github.com/a2f0/tearleads --skill issue-slice-autopilot以最小或无用户干预的方式,通过多个 PR 驱动复杂 Issue 直至完成。
此技能适用于长期运行的任务,在这些任务中,一个巨大的 PR 风险过高。它会重复执行以下步骤:
$commit-and-push,$enter-merge-queue 直至合并完成,main 分支重新评估 Issue。将状态持久化在 git 忽略的工作区状态中,以便循环可以在刷新/重启后恢复:
ISSUE_NUMBER="<issue-number>"
STATE_DIR=".git/issue-slice-autopilot"
STATE_FILE="$STATE_DIR/issue-${ISSUE_NUMBER}.json"
mkdir -p "$STATE_DIR"
状态结构:
{
"issue_number": 2540,
"repo": "owner/repo",
"iteration": 0,
"completed_slices": [],
"skipped_slices": [],
"active_pr": null,
"last_merged_pr": null,
"blocked_reason": null,
"updated_at": "<iso>"
}
Drive a complex issue to completion across multiple PRs with minimal or no user intervention.
This skill is for long-running tasks where one giant PR is too risky. It repeatedly:
$commit-and-push,$enter-merge-queue until merged,main.Persist state in git-ignored workspace state so the loop can resume after refreshes/restarts:
ISSUE_NUMBER="<issue-number>"
STATE_DIR=".git/issue-slice-autopilot"
STATE_FILE="$STATE_DIR/issue-${ISSUE_NUMBER}.json"
mkdir -p "$STATE_DIR"
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
在每个主要阶段结束时更新此文件。
解析仓库并加载 Issue:
REPO=$(./scripts/agents/tooling/agentTool.ts getRepo)
gh issue view "$ISSUE_NUMBER" -R "$REPO" --json number,title,body,state,url
加载 Issue 后,检查其正文是否已采用适合自动导航的格式。一个适合自动导航的 Issue 应具备:
- [ ] 复选框项目的 ## Requirements 部分(或等效标题,如 ## Tasks、## Checklist)跳过规范化,如果 Issue 已有一个包含至少两个 - [ ] 项目的需求式部分。
如果 Issue 正文缺少结构化的需求(例如,纯文本、单个段落或非复选框项目符号),则在继续之前将正文重写为适合自动导航的格式:
解析现有正文以提取意图、范围和个人工作项。
重写为以下结构:
## 摘要
<描述目标和结果的一段话>
## 上下文
<为何重要、影响区域、约束条件>
## 需求
- [ ] <清晰、可测试的需求 1>
- [ ] <清晰、可测试的需求 2>
- [ ] ...
## 实现说明
<初始方法、依赖项或开放性问题>
将原始 Issue 正文保留在底部,放在一个可折叠的 details 块下:
<details>
<summary>原始 Issue 正文</summary>
<原始正文内容>
</details>
在 GitHub 上更新 Issue:
gh issue edit "$ISSUE_NUMBER" -R "$REPO" --body "$NEW_BODY"
从已打开的 PR 构建非重叠上下文:
gh pr list -R "$REPO" --state open --json number,title,headRefName
对于每个已打开的 PR,收集更改的文件:
gh pr view <pr> -R "$REPO" --json files --jq '.files[].path'
2. 收集链接到该 Issue 的先前已合并工作(用于去重):
gh pr list -R "$REPO" --state merged --search "#${ISSUE_NUMBER} in:body" --json number,title,mergedAt
3. 将 Issue 需求转换为切片待办列表。每个切片需要:
namescopecandidate_filesdone_criteriavalidation_commandsrisk_levelestimated_size按以下标准对候选切片评分:
score = size + independence + impact - overlap_risk - migration_risk
选择规则:
candidate_files 与任何已打开 PR 文件重叠的切片。如果不存在非重叠的切片,则设置 blocked_reason 并停止。
确保基础干净:
git checkout main >/dev/null
git pull --ff-only >/dev/null
为此切片创建实现分支。
完整实现并包含测试。
首先运行聚焦验证,然后运行更广泛的必要检查。
如果覆盖率或质量门失败,则在提交前添加测试。不要降低阈值。
在实现完成且本地验证通过后:
$commit-and-push。$enter-merge-queue。$enter-merge-queue 处理)。在确认合并之前,不要开始下一个切片。
$enter-merge-queue 处理)。main 且是干净的。completed_slices。iteration。重复阶段 2-5 直至完成。
当以下所有条件都为真时标记为完成:
当发生以下任何情况时停止并报告:
LOAD/INIT STATE
RECON ISSUE + PR OVERLAP
WHILE NOT COMPLETE:
SELECT LARGEST NON-OVERLAPPING SLICE
IMPLEMENT + TEST
RUN $commit-and-push
RUN $enter-merge-queue
REFRESH + UPDATE STATE
FINAL ISSUE COMPLETION REPORT
对于类似 #2540 的迁移,优先采用以下顺序:
在每个切片之前,始终根据当前已打开的 PR 重新检查重叠情况。
对于每个切片,报告:
在最终完成时,报告:
每周安装次数
1
仓库
首次出现
1 天前
安全审计
安装于
zencoder1
amp1
cline1
openclaw1
opencode1
cursor1
State shape:
{
"issue_number": 2540,
"repo": "owner/repo",
"iteration": 0,
"completed_slices": [],
"skipped_slices": [],
"active_pr": null,
"last_merged_pr": null,
"blocked_reason": null,
"updated_at": "<iso>"
}
Update this file at the end of each major phase.
REPO=$(./scripts/agents/tooling/agentTool.ts getRepo)
gh issue view "$ISSUE_NUMBER" -R "$REPO" --json number,title,body,state,url
After loading the issue, check whether its body is already in autopilot-friendly format. An autopilot-friendly issue has:
## Requirements section (or equivalent heading like ## Tasks, ## Checklist) with - [ ] checkbox itemsSkip normalization if the issue already has a requirements-style section with at least two - [ ] items.
If the issue body lacks structured requirements (e.g., plain prose, a single paragraph, or non-checkbox bullets), rewrite the body into autopilot-friendly format before proceeding:
Parse the existing body to extract intent, scope, and individual work items.
Rewrite into this structure:
## Summary
<one paragraph describing the goal and outcome>
## Context
<why this matters, impacted area, constraints>
## Requirements
- [ ] <clear, testable requirement 1>
- [ ] <clear, testable requirement 2>
- [ ] ...
## Implementation Notes
<initial approach, dependencies, or open questions>
Preserve the original issue body at the bottom under a collapsed details block:
<details>
<summary>Original issue body</summary>
<original body here>
</details>
Update the issue on GitHub:
gh issue edit "$ISSUE_NUMBER" -R "$REPO" --body "$NEW_BODY"
gh pr list -R "$REPO" --state open --json number,title,headRefName
For each open PR, collect changed files:
gh pr view <pr> -R "$REPO" --json files --jq '.files[].path'
gh pr list -R "$REPO" --state merged --search "#${ISSUE_NUMBER} in:body" --json number,title,mergedAt
namescopecandidate_filesdone_criteriavalidation_commandsrisk_levelestimated_sizeScore candidates by:
score = size + independence + impact - overlap_risk - migration_risk
Selection rules:
candidate_files overlap with any open PR files.If no non-overlapping slice exists, set blocked_reason and stop.
git checkout main >/dev/null
git pull --ff-only >/dev/null
If coverage or quality gates fail, add tests before commit. Do not lower thresholds.
After implementation is complete and local validation passes:
$commit-and-push.$enter-merge-queue.$enter-merge-queue).Do not start the next slice until merge is confirmed.
$enter-merge-queue).main and clean.completed_slices.iteration.Repeat Phases 2-5 until done.
Mark complete when all are true:
Stop and report when any occurs:
LOAD/INIT STATE
RECON ISSUE + PR OVERLAP
WHILE NOT COMPLETE:
SELECT LARGEST NON-OVERLAPPING SLICE
IMPLEMENT + TEST
RUN $commit-and-push
RUN $enter-merge-queue
REFRESH + UPDATE STATE
FINAL ISSUE COMPLETION REPORT
For #2540-like migrations, prefer this order:
Always re-check overlap against currently open PRs before each slice.
For each slice, report:
At final completion, report:
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 周安装