implement-issues

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Implement Issues

实现Issues

Turn a set of GitHub issues into open PRs via parallel, worktree-isolated lanes. One lane per issue: its own worktree, its own branch, its own PR. This skill orchestrates and composes
branch
,
commit
, and
pr
— it never merges. Hand-off to
babysit-pr
/
babysit-pr --merge
for shepherding and merge.
通过并行的、工作树隔离的任务分支,将一组GitHub Issues转换为已打开的PR。 每个Issues对应一个任务分支:独立的工作树、独立的分支、独立的PR。该技能 编排并组合
branch
commit
pr
能力——从不执行合并。 如需后续跟进和合并,请转交
babysit-pr
/
babysit-pr --merge
处理。

Invocation

调用方式

  • /implement-issues #12 #14 #17
    — implement exactly these issues.
  • /implement-issues
    (bare) — triage the backlog (
    gh issue list
    ), prefer self-contained, file-disjoint issues, propose a set and confirm before spawning any lane.
  • --sequential
    — run one lane at a time (still one worktree/branch/PR each).
  • /implement-issues #12 #14 #17
    —— 精准实现指定编号的Issues。
  • /implement-issues
    (无参数)—— 分类处理积压任务(执行
    gh issue list
    ),优先选择 独立无依赖、文件无重叠的Issues,在启动任何任务分支前,先提议一组任务并确认
  • --sequential
    —— 依次运行每个任务分支(每个分支仍拥有独立的工作树/分支/PR)。

Inputs & readiness

输入与准备工作

  • Load repo context first. At start, from the target repo checkout root, read
    AGENTS.md
    and/or
    CLAUDE.md
    if present. Precedence:
    AGENTS.md
    is authoritative when both exist — do not also apply conflicting
    CLAUDE.md
    instructions; if only one exists, use that file; if both conflict in a blocking way, stop and ask. Record which filename is authoritative (e.g.
    AGENTS.md
    or
    CLAUDE.md
    ) and treat its house standards, operating agreement, and standing constraints as binding for every lane. Pass that chosen filename into each lane prompt so lanes do not re-pick. See the
    stand-general
    skill's Per-repo agent context section for the expected file shape. Missing the file is fine — fall back to chat instructions and
    stand-*
    skills.
  • Take issues from the args, or select from
    gh issue list
    favouring self-contained and file-disjoint work.
  • Every issue must carry an AI Implementation Prompt comment (per the
    issue
    skill). Missing it means the issue is not fan-out-ready — write one first, or run that issue as a single lane yourself. Do not hand a bare issue to a sub-agent.
  • Reproduce against current
    main
    before implementing
    — specs can be stale. If the reported problem no longer exists, report back rather than fabricating a change.
  • 先加载仓库上下文。启动时,从目标仓库的 checkout 根目录读取
    AGENTS.md
    和/或
    CLAUDE.md
    (如果存在)。优先级规则:当两个文件同时存在时,
    AGENTS.md
    具有权威性——请勿应用
    CLAUDE.md
    中与之冲突的指令;若仅存在其中一个文件,则使用该文件;若两个文件存在阻塞性冲突,请停止操作并询问用户。记录哪个文件具有权威性(例如
    AGENTS.md
    CLAUDE.md
    ),并将其包含的编码规范、操作协议和既定约束视为所有任务分支必须遵守的规则。将选定的文件名传入每个任务分支的提示语中,避免分支重复选择文件。关于文件的预期格式,请参考
    stand-general
    技能中的每个仓库的代理上下文部分。若文件不存在也无需担心——可回退至聊天指令和
    stand-*
    系列技能。
  • 从参数中获取Issues,或从
    gh issue list
    中选择优先处理独立无依赖、文件无重叠的任务。
  • 每个Issue 必须包含AI实现提示评论(遵循
    issue
    技能规范)。若缺少该评论,则表示该Issue 不具备拆分执行的条件——请先编写该评论,或自行单独处理该Issue。请勿将未准备好的Issue交给子代理(sub-agent)处理。
  • 在实现前基于当前
    main
    分支复现问题
    ——需求规格可能已过时。若报告的问题已不存在,请反馈给用户,而非强行修改代码。

Conflict grouping

冲突分组

  • Build a file-overlap matrix from each issue's declared file targets.
  • Disjoint file sets → run in parallel lanes.
  • Overlapping file sets → sequence them, or bundle into a single lane only when the issues genuinely must share files.
  • Cap at ~10 lanes — beyond that, batch across sessions.
  • 根据每个Issue声明的目标文件构建文件重叠矩阵。
  • 无重叠的文件集 → 以并行方式运行任务分支。
  • 有重叠的文件集 → 按顺序执行,或仅当Issues确实必须共享文件时,才将其合并到同一个任务分支中。
  • 任务分支数量上限为约10个——超出该数量时,分批次处理。

Lane claiming

任务分支占用

Before spawning, claim each lane — assign the issue to yourself and/or add a working label. This prevents a second session from opening a duplicate PR for the same issue (a race that has bitten this workflow before).
在启动任务分支前,占用每个分支——将Issue分配给自己和/或添加"处理中"标签。这可避免另一个会话为同一个Issue打开重复的PR(此前该工作流曾遇到过此类竞态问题)。

Per lane

每个任务分支的处理流程

  1. Orchestrator creates the worktree per the
    branch -w
    convention: a sibling directory, branch
    type/NN-slug
    cut from a freshly fetched
    origin/main
    . Never place a worktree under
    .claude/
    — lint configs commonly exclude that path and will silently scan nothing.
  2. Sub-agent prompt is pointers, not content. Instruct the lane to:
    • Work only inside the lane worktree path the orchestrator created.
    • Read issue #N and its AI Implementation Prompt comment.
    • From the lane worktree root (absolute path), read the authoritative context file the parent already chose (
      AGENTS.md
      or
      CLAUDE.md
      ) when present. Do not resolve context from the parent checkout or any other directory; do not re-pick between the two files. Treat its standards/constraints/contract as binding; follow applicable
      stand-*
      skills.
    • Run the full lint and full test suite before every commit — never a subset.
    • Use the
      commit
      skill, then the
      pr
      skill with
      Closes #N
      .
    • Never merge. Report the PR URL on completion.
  3. Orchestrator verifies each PR exists once the lane reports done.
  1. 编排器按照
    branch -w
    约定创建工作树:在同级目录中创建分支
    type/NN-slug
    ,分支基于刚拉取的
    origin/main
    切勿将工作树放置在
    .claude/
    目录下——代码检查配置通常会排除该路径,导致扫描无结果。
  2. 子代理提示语为指向性内容,而非具体细节。向任务分支下达以下指令:
    • 仅在编排器创建的任务分支工作树路径内工作。
    • 查看Issue #N及其AI实现提示评论。
    • 任务分支工作树的根目录(绝对路径)读取父级已选定的权威上下文文件(
      AGENTS.md
      CLAUDE.md
      ,如果存在)。请勿从父级checkout目录或其他目录解析上下文;请勿重新选择两个文件中的一个。将该文件中的规范/约束/协议视为必须遵守的规则;遵循适用的
      stand-*
      技能。
    • 每次提交前运行完整的代码检查和完整的测试套件——绝不执行子集检查。
    • 使用
      commit
      技能,然后使用
      pr
      技能并添加
      Closes #N
      标识。
    • 绝不合并。完成后报告PR的URL。
  3. 编排器在任务分支报告完成后,验证每个PR是否存在。

Guardrails

防护规则

  • Signing pre-flight before spawning. Confirm commit signing works now — a locked signing key must be surfaced to the user before you go AFK, not discovered mid-run.
  • A lane that cannot stay green STOPS and reports. Never weaken or delete tests, never open a knowingly broken PR.
  • Final report lists every PR URL and every blocked lane with the reason.
  • 启动前确认签名功能正常。先确认提交签名功能当前可正常工作——若签名密钥锁定,必须在开始执行前告知用户,而非在执行过程中才发现问题。
  • 若任务分支无法保持测试通过状态,则停止并报告。绝不能弱化或删除测试,绝不能打开明知有问题的PR。
  • 最终报告需列出所有PR的URL以及所有阻塞的任务分支及其原因。

Hand-off

转交后续处理

Shepherding and merging are not this skill. Once PRs are open, hand off to
babysit-pr
(drive to merge-ready) or
babysit-pr --merge
.
See also
backlog
: the interactive routing entry point that composes this skill with
babysit-pr
. It does not auto-invoke either.
跟进和合并不属于本技能的职责范围。PR打开后,请转交
babysit-pr
(推动PR达到可合并状态)或
babysit-pr --merge
处理。
另请参考
backlog
:这是一个交互式路由入口,可将本技能与
babysit-pr
组合使用,但不会自动调用其中任何一个。

Harness mechanics (Claude Code)

底层机制(Claude Code)

  • Run lanes as background sub-agents so the main thread stays free.
  • Model per lane by risk:
    • docs / config / mechanical →
      sonnet
    • logic / refactor / security / auth / CI-touching →
      opus
    • never
      haiku
      for code.
    • An explicit user instruction overrides these defaults.
  • Elsewhere (harnesses without sub-agent spawning): run the lanes sequentially using the same worktree-per-lane layout.
  • 将任务分支作为后台子代理运行,使主线程保持空闲。
  • 根据风险为每个任务分支选择模型
    • 文档/配置/机械性修改 → 使用
      sonnet
      模型
    • 逻辑重构/安全/认证/涉及CI的修改 → 使用
      opus
      模型
    • 绝不为代码任务使用
      haiku
      模型
    • 用户的明确指令可覆盖上述默认规则。
  • 其他场景(不支持子代理启动的底层框架):使用相同的"每个任务分支对应一个工作树"布局,按顺序运行任务分支。