run-with-it
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRun With It
自动执行工具
Use this skill to process ready-for-agent issues without manually selecting a runner.
Preferred upstream flow:
- resolves requirements and constraints.
break-req - publishes PRD + implementation slices with routing hints.
create-git-issue - performs final runtime routing and executes the selected run.
run-with-it
使用该Skill处理标记为ready-for-agent的问题,无需手动选择运行器。
推荐上游流程:
- 解析需求与约束条件。
break-req - 发布PRD与实现切片,并附带路由提示。
create-git-issue - 执行最终运行时路由,并启动选中的运行任务。
run-with-it
OS Detection
操作系统检测
Detect the current OS before asset discovery and runner selection:
- Windows (native PowerShell): equals
$env:OSand noWindows_NTcommand. Useunamerunners and.ps1for home dir.$env:USERPROFILE - macOS / Linux / Git Bash / WSL: returns
uname -s,Darwin,Linux,MINGW*, orMSYS*. UseCYGWIN*runners and.shfor home dir.$HOME
Adapt all shell commands in this skill to the detected runtime:
| Operation | PowerShell (Windows) | Bash (Mac/Linux/Git Bash) |
|---|---|---|
| Home dir | | |
| Create dir | | |
| Check command | | |
| Check dir | | |
| Temp file | | |
| Copy file | | |
| Make executable | (not needed) | |
在资源发现和运行器选择前,先检测当前操作系统:
- Windows(原生PowerShell):等于
$env:OS且无Windows_NT命令。使用uname运行器,主目录使用.ps1。$env:USERPROFILE - macOS / Linux / Git Bash / WSL:返回
uname -s、Darwin、Linux、MINGW*或MSYS*。使用CYGWIN*运行器,主目录使用.sh。$HOME
根据检测到的运行环境适配本Skill中的所有Shell命令:
| 操作 | PowerShell(Windows) | Bash(Mac/Linux/Git Bash) |
|---|---|---|
| 主目录 | | |
| 创建目录 | | |
| 检查命令 | | |
| 检查目录 | | |
| 临时文件 | | |
| 复制文件 | | |
| 设置可执行权限 | (无需操作) | |
Goal
目标
Resolve required assets, score complexity deterministically, choose required capability, select installed agent/model targets from registry, emit parseable routing and status reports, coordinate one or more agents when work can safely run in parallel, and execute .
run-agent.sh解析所需资源,确定性评估复杂度,选择所需能力,从注册表中挑选已安装的Agent/模型目标,生成可解析的路由与状态报告,在任务可安全并行执行时协调一个或多个Agent,并执行 。
run-agent.shInputs
输入参数
Collect these values before execution:
- Task summary
- Optional pre-fetched issue context (otherwise fetch with )
gh - Optional asset root override:
ASSETS_DEST - Optional registry override:
AGENT_REGISTRY_FILE - Optional intake overrides:
- (default
ISSUE_LABEL)ready-for-agent - (default
ISSUE_LIMIT)10 - (default
ISSUE_STATE)open - (default
COMMITS_LIMIT)5 - (default
MAX_ITERATIONS)20
- Optional routing overrides:
AGENTMODELCOMPLEXITY_LEVELCOMPLEXITY_SCORE
- Optional routing filters:
- (comma-separated)
AGENT_ALLOWLIST - (comma-separated)
AGENT_DENYLIST
- Optional fallback bound:
- (default
MAX_AGENT_FALLBACKS)2
- Optional multi-agent bound:
- (default
MAX_PARALLEL_AGENTS)3 - (default
ALLOW_PARALLEL_AGENTS)true
执行前需收集以下值:
- 任务摘要
- 可选的预获取问题上下文(否则使用 获取)
gh - 可选的资源根目录覆盖:
ASSETS_DEST - 可选的注册表覆盖:
AGENT_REGISTRY_FILE - 可选的问题获取覆盖项:
- (默认值
ISSUE_LABEL)ready-for-agent - (默认值
ISSUE_LIMIT)10 - (默认值
ISSUE_STATE)open - (默认值
COMMITS_LIMIT)5 - (默认值
MAX_ITERATIONS)20
- 可选的路由覆盖项:
AGENTMODELCOMPLEXITY_LEVELCOMPLEXITY_SCORE
- 可选的路由过滤器:
- (逗号分隔)
AGENT_ALLOWLIST - (逗号分隔)
AGENT_DENYLIST
- 可选的回退限制:
- (默认值
MAX_AGENT_FALLBACKS)2
- 可选的多Agent限制:
- (默认值
MAX_PARALLEL_AGENTS)3 - (默认值
ALLOW_PARALLEL_AGENTS)true
Asset Discovery (Required)
资源发现(必填)
Resolve assets in this order:
- if set and complete.
$ASSETS_DEST - .
$HOME/.ai-skill-collections/assets - .
./assets
Required files:
prompt.mdrun-agent.shagent-registry.json
Selection rules:
- Use first path that contains all required files.
- If none are complete, stop and report missing files.
- Do not require git to resolve assets.
- Resolved asset root is the single source for that run.
按以下顺序解析资源:
- 若 已设置且资源完整,则使用该路径。
$ASSETS_DEST - 。
$HOME/.ai-skill-collections/assets - 。
./assets
必填文件:
prompt.mdrun-agent.shagent-registry.json
选择规则:
- 使用首个包含所有必填文件的路径。
- 若没有完整的资源路径,则停止并报告缺失文件。
- 无需依赖Git来解析资源。
- 解析后的资源根目录为本次运行的唯一资源来源。
Fresh/No-Git Project Notes
全新/无Git项目注意事项
- This skill must work in folders that are not initialized with git.
- Asset discovery is filesystem-based, not git-root-based.
- If assets are missing, report the platform-appropriate one-command fix:
PowerShell (Windows):
powershell
New-Item -ItemType Directory -Force "$env:USERPROFILE\.ai-skill-collections\assets"; Copy-Item -Force .\assets\prompt.md, .\assets\run-agent.ps1, .\assets\run-agent.sh, .\assets\agent-registry.json "$env:USERPROFILE\.ai-skill-collections\assets\"Bash (macOS / Linux / Git Bash):
bash
mkdir -p "$HOME/.ai-skill-collections/assets" && cp -f ./assets/prompt.md ./assets/run-agent.sh ./assets/agent-registry.json "$HOME/.ai-skill-collections/assets/" && chmod +x "$HOME/.ai-skill-collections/assets/run-agent.sh"- 本Skill必须能在未初始化Git的文件夹中正常工作。
- 资源发现基于文件系统,而非Git根目录。
- 若资源缺失,报告适配当前平台的一键修复命令:
PowerShell(Windows):
powershell
New-Item -ItemType Directory -Force "$env:USERPROFILE\.ai-skill-collections\assets"; Copy-Item -Force .\assets\prompt.md, .\assets\run-agent.ps1, .\assets\run-agent.sh, .\assets\agent-registry.json "$env:USERPROFILE\.ai-skill-collections\assets\"Bash(macOS / Linux / Git Bash):
bash
mkdir -p "$HOME/.ai-skill-collections/assets" && cp -f ./assets/prompt.md ./assets/run-agent.sh ./assets/agent-registry.json "$HOME/.ai-skill-collections/assets/" && chmod +x "$HOME/.ai-skill-collections/assets/run-agent.sh"Responsibility Boundary
职责边界
This skill owns:
- issue intake and context payload assembly
- deterministic complexity scoring
- capability-band requirement resolution
- agent/model selection using
agent-registry.json - multi-agent batch planning for independent ready issues
- bounded fallback policy
- status and routing report output
run-agent.shprompt.md本Skill负责:
- 问题获取与上下文载荷组装
- 确定性复杂度评分
- 能力区间需求解析
- 使用 选择Agent/模型
agent-registry.json - 为独立就绪问题制定多Agent批量计划
- 有限回退策略
- 状态与路由报告输出
run-agent.shprompt.mdMulti-Agent Capability
多Agent协作能力
run-with-itUse multiple agents when all are true:
- two or more issues are unblocked
ready-for-agent - ownership scopes do not overlap, or one agent has explicit ownership of shared files
- verification can run independently before final integration
- is not
ALLOW_PARALLEL_AGENTSfalse - the batch size is within
MAX_PARALLEL_AGENTS
Use sequential execution when any are true:
- issues depend on one another
- issues touch the same files without a clear owner
- migrations, fixtures, generated assets, or shared contracts are involved
- requirements are ambiguous enough that one result may change the next issue
For multi-agent batches, keep one coordinator in the main session. The coordinator selects issues, assigns ownership, reviews each result, integrates accepted changes, runs verification, commits per issue unless told otherwise, and updates or closes issues.
run-with-it满足以下所有条件时使用多Agent:
- 存在两个或多个未阻塞的 问题
ready-for-agent - 所有权范围无重叠,或某个Agent明确拥有共享文件的所有权
- 验证可独立执行,无需等待最终集成
- 未设为
ALLOW_PARALLEL_AGENTSfalse - 批量大小在 限制内
MAX_PARALLEL_AGENTS
满足以下任一条件时使用顺序执行:
- 问题之间存在依赖关系
- 问题涉及同一文件且无明确所有者
- 涉及迁移、固定数据、生成资源或共享契约
- 需求存在歧义,前一个任务的结果可能影响后续问题
对于多Agent批量任务,主会话中保留一个协调器。协调器负责选择问题、分配所有权、审核每个结果、集成已接受的变更、运行验证、按问题提交(除非另有指示),并更新或关闭问题。
Issue Intake
问题获取
If issue data is missing in context, fetch with .
ghFallback policy:
- Primary: GitHub issues via .
gh - Fallback: local (
issues.mdoverride supported).LOCAL_ISSUES_FILE - If git metadata is unavailable, continue with empty commit context.
Build with:
CONTEXT_PAYLOAD_FILE- previous commits
- issue details
Then pass + to unified runner.
CONTEXT_PAYLOAD_FILEPROMPT_FILE若上下文中缺失问题数据,使用 获取。
gh回退策略:
- 首选:通过 获取GitHub问题。
gh - 回退:本地 (支持
issues.md覆盖)。LOCAL_ISSUES_FILE - 若Git元数据不可用,继续执行,提交上下文为空。
构建 ,包含:
CONTEXT_PAYLOAD_FILE- 历史提交记录
- 问题详情
然后将 + 传递给统一运行器。
CONTEXT_PAYLOAD_FILEPROMPT_FILEDeterministic Router
确定性路由机制
Complexity Scoring (8 dimensions, each 1-5)
复杂度评分(8个维度,每个维度1-5分)
Score each dimension from (lowest) to (highest):
15- dependency complexity
- ownership overlap risk
- architecture risk
- orchestration burden
- verification risk
- ambiguity of requirements
- integration surface breadth
- rollback/recovery risk
Total score range: .
8-40每个维度评分从(最低)到(最高):
15- 依赖复杂度
- 所有权重叠风险
- 架构风险
- 编排负担
- 验证风险
- 需求歧义性
- 集成范围广度
- 回滚/恢复风险
总分范围:。
8-40Model-First Selection
优先选择模型
The orchestrator selects the model first, then the agent that supports it. Agent defaults are ignored.
编排器优先选择模型,然后选择支持该模型的Agent。忽略Agent的默认设置。
Step 1 — Map Score to Target Weight Range
步骤1 — 将评分映射到目标权重范围
Look up the score in from :
model_routing.score_to_weightagent-registry.json| Score | Label | Weight range |
|---|---|---|
| 8–12 | | 1–3 |
| 13–17 | | 2–4 |
| 18–22 | | 4–6 |
| 23–27 | | 6–7 |
| 28–32 | | 7–9 |
| 33–40 | | 9–10 |
从 的 中查找评分对应的范围:
agent-registry.jsonmodel_routing.score_to_weight| 评分 | 标签 | 权重范围 |
|---|---|---|
| 8–12 | | 1–3 |
| 13–17 | | 2–4 |
| 18–22 | | 4–6 |
| 23–27 | | 6–7 |
| 28–32 | | 7–9 |
| 33–40 | | 9–10 |
Step 2 — Apply Hard Minimum Overrides
步骤2 — 应用硬性最低权重覆盖
Before proceeding, raise if any condition is true:
weight_min- dependency state unknown or conflicting →
weight_min = 9 - heavy shared-file ownership conflict risk →
weight_min = 9 - broad cross-module integration change →
weight_min = 7 - explicit user request for deep/complex orchestration →
weight_min = 9
Use the higher of the table and any override.
weight_min在继续之前,若满足以下任一条件,提高 :
weight_min- 依赖状态未知或冲突 →
weight_min = 9 - 存在严重的共享文件所有权冲突风险 →
weight_min = 9 - 涉及跨模块的广泛集成变更 →
weight_min = 7 - 用户明确要求深度/复杂编排 →
weight_min = 9
取表格中的 与所有覆盖值中的较大值。
weight_minStep 3 — Build Pool and Randomly Select Model
步骤3 — 构建候选池并随机选择模型
From in :
model_catalogagent-registry.json- Collect all models where is within
complexity_weight.[weight_min, weight_max] - Keep only models available on at least one detected, non-filtered agent (check each agent's list).
known_models - Apply : remove any model whose
model_routing.provider_routing_rulesexceeds itsproviderfor the current complexity level. Example:max_bandis excluded forgoogleand above.medium-hard - Sort remaining candidates by .
(complexity_weight ASC, price_tier ASC, price_output_per_1m ASC) - Take the top (default 4 from
selection_pool_size) — this is the base pool.model_routing - Append any models listed in that are not already in the base pool. These are always available regardless of price ranking.
model_routing.band_required_models[current_level] - Randomly pick one model from the final pool. This distributes load across agents and providers on every run.
- If fewer than 2 candidates exist after filtering, expand by 1 and retry (up to 3 expansions) until pool reaches at least 2, then fail with diagnostics.
weight_max
从 的 中:
agent-registry.jsonmodel_catalog- 收集所有 在
complexity_weight范围内的模型。[weight_min, weight_max] - 仅保留至少在一个已检测且未被过滤的Agent上可用的模型(检查每个Agent的 列表)。
known_models - 应用 :移除任何其
model_routing.provider_routing_rules超过当前复杂度级别provider的模型。示例:max_band模型在google及以上级别被排除。medium-hard - 按 对剩余候选模型排序。
(complexity_weight ASC, price_tier ASC, price_output_per_1m ASC) - 取前 个模型(默认从
selection_pool_size中取4个)—— 这是基础候选池。model_routing - 将 中未在基础候选池的模型添加进去。这些模型无论价格排名如何,始终可用。
model_routing.band_required_models[current_level] - 从最终候选池中随机选择一个模型。这样每次运行时可在Agent和提供商之间分配负载。
- 若过滤后候选模型不足2个,将 扩大1并重试(最多扩大3次),直到候选池至少有2个模型,否则输出诊断信息后失败。
weight_max
Step 4 — Select Agent
步骤4 — 选择Agent
- Find all agents that list the chosen model in their .
known_models - Apply and
AGENT_ALLOWLIST.AGENT_DENYLIST - Keep only detected (installed) agents.
- Interchangeable group rule: and
codexare identical runners for GPT models. If both are in the candidate set, pick one at random. Do not prefer either.github-copilot - If one agent remains, use it.
- If multiple non-interchangeable agents remain, prefer: for Claude models,
claudefor Gemini models, random pick for GPT models.gemini - If no agent remains, fail with clear filter diagnostics before attempting fallback.
- 找出所有在其 中包含所选模型的Agent。
known_models - 应用 和
AGENT_ALLOWLIST。AGENT_DENYLIST - 仅保留已检测(已安装)的Agent。
- 可互换组规则:和
codex对于GPT模型是相同的运行器。若两者都在候选集中,随机选择一个,不优先选择任何一个。github-copilot - 若仅剩一个Agent,使用该Agent。
- 若存在多个不可互换的Agent,优先选择:Claude模型对应 、Gemini模型对应
claude、GPT模型随机选择。gemini - 若没有Agent剩余,在尝试回退前输出清晰的过滤诊断信息后失败。
Step 5 — Pass to Runner
步骤5 — 传递给运行器
Always pass both and explicitly. Never rely on the agent's registry default.
AGENTMODELbash
run-agent.sh --agent "$AGENT" --model "$MODEL" --unattended始终显式传递 和 。绝不依赖注册表中Agent的默认设置。
AGENTMODELbash
run-agent.sh --agent "$AGENT" --model "$MODEL" --unattendedOverride Precedence (highest first)
优先级覆盖规则(从高到低)
- +
AGENTforced together (both must be valid and installed)MODEL - forced alone → skip Steps 1–3, run Step 4 with forced model
MODEL - forced alone → skip Step 4, run Steps 1–3 restricted to that agent's
AGENTknown_models - forced → use corresponding weight range from table, skip score computation
COMPLEXITY_LEVEL - forced → use as computed score, run full Steps 1–4
COMPLEXITY_SCORE - Computed score from eight dimensions → full Steps 1–4
Validation rules:
- Forced not installed → fail fast.
AGENT - Forced not in chosen agent's
MODEL→ fail fast.known_models - must be one of the documented labels.
COMPLEXITY_LEVEL - must be integer in
COMPLEXITY_SCORE.8–40
- 强制同时设置 +
AGENT(两者必须有效且已安装)MODEL - 单独强制设置 → 跳过步骤1–3,使用强制模型执行步骤4
MODEL - 单独强制设置 → 跳过步骤4,限制在该Agent的
AGENT范围内执行步骤1–3known_models - 强制设置 → 使用表格中对应的权重范围,跳过评分计算
COMPLEXITY_LEVEL - 强制设置 → 将其作为计算出的评分,完整执行步骤1–4
COMPLEXITY_SCORE - 通过8个维度计算出的评分 → 完整执行步骤1–4
验证规则:
- 强制设置的 未安装 → 立即失败。
AGENT - 强制设置的 不在所选Agent的
MODEL中 → 立即失败。known_models - 必须是文档中列出的标签之一。
COMPLEXITY_LEVEL - 必须是8–40之间的整数。
COMPLEXITY_SCORE
Allowlist and Denylist
白名单与黑名单
Apply filters before final selection:
- Start from detected installed agents.
- If is set, keep only listed agents.
AGENT_ALLOWLIST - Then remove any in .
AGENT_DENYLIST - If result is empty, fail with clear filter diagnostics.
Denylist wins on conflicts.
在最终选择前应用过滤器:
- 从已检测到的已安装Agent开始。
- 若设置了 ,仅保留列表中的Agent。
AGENT_ALLOWLIST - 然后移除 中的Agent。
AGENT_DENYLIST - 若结果为空,输出清晰的过滤诊断信息后失败。
冲突时黑名单优先级更高。
Bounded Fallback
有限回退机制
If selected agent fails preflight or execution start:
- Attempt next compatible agent from registry fallback order.
- Stop after attempts.
MAX_AGENT_FALLBACKS - Emit final bounded-fallback failure with attempted chain.
若选中的Agent在预检查或执行启动时失败:
- 尝试注册表回退顺序中的下一个兼容Agent。
- 最多尝试 次。
MAX_AGENT_FALLBACKS - 输出最终的有限回退失败信息,包含尝试过的Agent链。
Preflight Checks
预检查
Before execution verify:
- resolved asset root exists
- exists
prompt.md - runner exists and is executable (on Bash;
run-agent.shon Windows)run-agent.ps1 - exists
agent-registry.json - auth when GitHub intake is required
gh - unified runner supports selected agent/model
执行前验证:
- 解析后的资源根目录存在
- 存在
prompt.md - 运行器存在且可执行(Bash环境使用 ;Windows环境使用
run-agent.sh)run-agent.ps1 - 存在
agent-registry.json - 当需要从GitHub获取问题时,已授权
gh - 统一运行器支持选中的Agent/模型
Execution
执行流程
Use unified runner only. Select runner based on detected OS (see OS Detection table above).
Required environment/flags:
AGENT_REGISTRY_FILE="$ASSET_ROOT/agent-registry.json"CONTEXT_PAYLOAD_FILE- (or override)
PROMPT_FILE="$ASSET_ROOT/prompt.md" - selected
AGENT - selected (optional; default from registry)
MODEL
Bash (macOS / Linux / Git Bash):
bash
AGENT_REGISTRY_FILE="$ASSET_ROOT/agent-registry.json" \
CONTEXT_PAYLOAD_FILE="$CONTEXT_PAYLOAD_FILE" \
PROMPT_FILE="$ASSET_ROOT/prompt.md" \
"$ASSET_ROOT/run-agent.sh" --agent "$AGENT" --model "$MODEL" --unattendedPowerShell (Windows):
powershell
$env:AGENT_REGISTRY_FILE = "$ASSET_ROOT\agent-registry.json"
$env:CONTEXT_PAYLOAD_FILE = $CONTEXT_PAYLOAD_FILE
$env:PROMPT_FILE = "$ASSET_ROOT\prompt.md"
& "$ASSET_ROOT\run-agent.ps1" --agent $AGENT --model $MODEL --unattendedNever invoke legacy per-agent runner scripts from this skill.
仅使用统一运行器。根据检测到的操作系统选择运行器(见上方操作系统检测表格)。
必填环境变量/标志:
AGENT_REGISTRY_FILE="$ASSET_ROOT/agent-registry.json"CONTEXT_PAYLOAD_FILE- (可覆盖)
PROMPT_FILE="$ASSET_ROOT/prompt.md" - 选中的
AGENT - 选中的 (可选;默认从注册表获取)
MODEL
Bash(macOS / Linux / Git Bash):
bash
AGENT_REGISTRY_FILE="$ASSET_ROOT/agent-registry.json" \
CONTEXT_PAYLOAD_FILE="$CONTEXT_PAYLOAD_FILE" \
PROMPT_FILE="$ASSET_ROOT/prompt.md" \
"$ASSET_ROOT/run-agent.sh" --agent "$AGENT" --model "$MODEL" --unattendedPowerShell(Windows):
powershell
$env:AGENT_REGISTRY_FILE = "$ASSET_ROOT\agent-registry.json"
$env:CONTEXT_PAYLOAD_FILE = $CONTEXT_PAYLOAD_FILE
$env:PROMPT_FILE = "$ASSET_ROOT\prompt.md"
& "$ASSET_ROOT\run-agent.ps1" --agent $AGENT --model $MODEL --unattended绝不要从本Skill中调用旧版的Agent专属运行器脚本。
Routing Report (Required)
路由报告(必填)
Emit a parseable one-line route summary before execution:
text
ROUTE|agent=<agent>|model=<model>|complexity_level=<level>|complexity_score=<score>|target_weight=<min>-<max>|model_weight=<n>|price_tier=<tier>|fallback_budget=<n>|allowlist=<value>|denylist=<value>Also provide human-readable details:
- per-dimension scores
- final score and complexity level
- target weight range and selected model (with and
complexity_weight)price_tier - agent selection reason (sole match / interchangeable random pick / provider match)
- runner command summary
- fallback attempts used
- completion status
执行前输出一行可解析的路由摘要:
text
ROUTE|agent=<agent>|model=<model>|complexity_level=<level>|complexity_score=<score>|target_weight=<min>-<max>|model_weight=<n>|price_tier=<tier>|fallback_budget=<n>|allowlist=<value>|denylist=<value>同时提供人类可读的详细信息:
- 各维度评分
- 最终评分与复杂度级别
- 目标权重范围与选中的模型(包含 和
complexity_weight)price_tier - Agent选择原因(唯一匹配 / 可互换随机选择 / 提供商匹配)
- 运行器命令摘要
- 使用的回退尝试次数
- 完成状态
Canonical Coordinator Contract (Required)
标准协调器协议(必填)
Apply these rules after routing and before invoking the selected agent.
在路由完成后、调用选中的Agent前,应用以下规则。
Issues
问题处理
- Treat issue data already present in the context payload as the source of truth for selection and planning.
- Use only when fresh issue data is needed or issue status must be updated.
gh - Work only on issues.
ready-for-agent - Continue selecting and completing ready tasks until no ready work remains for the run.
- If all ready work is complete, output .
<promise>NO MORE TASKS</promise>
- 将上下文载荷中已有的问题数据作为选择和规划的事实来源。
- 仅当需要获取新问题数据或更新问题状态时使用 。
gh - 仅处理标记为 的问题。
ready-for-agent - 持续选择并完成就绪任务,直到本次运行中无就绪任务剩余。
- 若所有就绪任务已完成,输出 。
<promise>NO MORE TASKS</promise>
Operating Mode
运行模式
You are the coordinator. Your job is to plan, delegate, review, integrate, commit, and update issues.
Implementation belongs to child agents or the selected external agent process.
- Prefer a safe parallel batch when several ready issues have independent ownership.
- Use sequential execution when tasks are dependency-sensitive, concentrated in the same files, or share migrations, fixtures, or architecture decisions.
- Do not stop after one issue if other ready work remains.
- Reassess the queue after each completed issue or batch.
你是协调器,负责规划、委派、审核、集成、提交和更新问题。
实现工作由子Agent或选中的外部Agent进程完成。
- 当多个就绪问题的所有权相互独立时,优先选择安全的并行批量处理。
- 当任务存在依赖关系、集中在同一文件中,或涉及迁移、固定数据或架构决策时,使用顺序执行。
- 若存在其他就绪任务,完成一个问题后不要停止。
- 完成每个问题或批量任务后重新评估任务队列。
Task Selection
任务选择
Before selecting a task, confirm dependencies are complete.
If a task depends on another open or in-progress task, run the dependency first or mark the task blocked.
Prioritize in this order:
- critical fixes
- development infrastructure
- tracer-bullet feature slices
- polish and quick wins
- refactors
For each selected issue, define:
- GitHub issue number and title
- why it is ready now
- dependency proof
- expected file or module ownership
- verification steps
选择任务前,确认依赖已完成。
若任务依赖于另一个未关闭或进行中的任务,优先运行依赖任务或将该任务标记为阻塞。
按以下顺序优先级选择:
- 关键修复
- 开发基础设施
- 探路者功能切片
- 优化与快速实现任务
- 重构
对于每个选中的问题,定义:
- GitHub问题编号与标题
- 当前就绪的原因
- 依赖已完成的证明
- 预期的文件或模块所有权
- 验证步骤
Parallel Planning
并行规划
When multiple ready issues are available, build the largest safe batch.
- Assign one issue per child agent.
- Group only issues with minimal file overlap and low coordination cost.
- Avoid batching issues that edit the same files unless one agent owns those files.
- Keep one coordinator responsible for final integration, review, tests, commits, and issue updates.
当存在多个就绪问题时,构建最大的安全批量任务。
- 每个子Agent分配一个问题。
- 仅将文件重叠最少、协调成本低的问题归为一组。
- 避免将编辑同一文件的问题批量处理,除非某个Agent拥有这些文件的所有权。
- 保留一个协调器负责最终集成、审核、测试、提交和问题更新。
Coordination
协作规则
Each child agent receives a self-contained prompt with:
- issue number and goal
- exact ownership scope
- paths it must not edit
- relevant repo conventions copied directly into the prompt
- required verification commands
- instruction to keep changes minimal and compatible with other agents
- TDD requirement when the issue requests test-first implementation
Review every child-agent result before accepting it.
Reject or revise work that violates ownership, skips required tests, duplicates domain logic, or makes unrelated edits.
Child agent lifecycle rules:
- close completed or blocked agents after their result is captured
- record the decision immediately:
integrate|revise|blocked - do not keep agents open only because more tasks might appear later
每个子Agent会收到一个独立的提示,包含:
- 问题编号与目标
- 明确的所有权范围
- 禁止编辑的路径
- 直接复制到提示中的相关仓库约定
- 必填的验证命令
- 要求变更最小化且与其他Agent兼容的指令
- 当问题要求先测试再实现时,需遵循TDD要求
接受子Agent的结果前需进行审核。
拒绝或修改违反所有权规则、跳过必填测试、重复领域逻辑或进行无关编辑的工作。
子Agent生命周期规则:
- 捕获结果后关闭已完成或阻塞的Agent
- 立即记录决策:
integrate|revise|blocked - 不要仅因为后续可能出现更多任务而保持Agent处于打开状态
Status Messages
状态消息
Emit parseable one-line status messages for multi-agent runs:
- spawn:
STATUS|type=spawn|batch=<batch-id>|agent=<agent-name>|issue=#<n>|phase=assigned|scope=<owned-paths>|eta=<rough-eta> - heartbeat:
STATUS|type=heartbeat|batch=<batch-id>|agent=<agent-name>|issue=#<n>|phase=<exploring|implementing|testing|review>|progress=<short-text>|elapsed=<seconds> - completion:
STATUS|type=completion|batch=<batch-id>|agent=<agent-name>|issue=#<n>|result=<done|needs-revision|blocked>|verify=<pass|fail|partial>|next=<integrate|revise|blocked> - stall:
STATUS|type=stall|batch=<batch-id>|agent=<agent-name>|issue=#<n>|idle_for=<seconds>|action=<ping|replan|deparallelize|abort-agent> - batch summary:
STATUS|type=batch|batch=<batch-id>|running=<count>|completed=<count>|blocked=<count>|next=<text> - integration:
STATUS|type=integration|batch=<batch-id>|issue=#<n>|action=<merge|conflict-fix|follow-up-agent>|state=<in-progress|done> - close:
STATUS|type=close|batch=<batch-id>|agent=<agent-name>|issue=#<n>|reason=<completed|blocked|replaced|failed-review>
Keep values under 8 words and values under 5 words.
progressnext多Agent运行时输出一行可解析的状态消息:
- 启动:
STATUS|type=spawn|batch=<batch-id>|agent=<agent-name>|issue=#<n>|phase=assigned|scope=<owned-paths>|eta=<rough-eta> - 心跳:
STATUS|type=heartbeat|batch=<batch-id>|agent=<agent-name>|issue=#<n>|phase=<exploring|implementing|testing|review>|progress=<short-text>|elapsed=<seconds> - 完成:
STATUS|type=completion|batch=<batch-id>|agent=<agent-name>|issue=#<n>|result=<done|needs-revision|blocked>|verify=<pass|fail|partial>|next=<integrate|revise|blocked> - 停滞:
STATUS|type=stall|batch=<batch-id>|agent=<agent-name>|issue=#<n>|idle_for=<seconds>|action=<ping|replan|deparallelize|abort-agent> - 批量摘要:
STATUS|type=batch|batch=<batch-id>|running=<count>|completed=<count>|blocked=<count>|next=<text> - 集成:
STATUS|type=integration|batch=<batch-id>|issue=#<n>|action=<merge|conflict-fix|follow-up-agent>|state=<in-progress|done> - 关闭:
STATUS|type=close|batch=<batch-id>|agent=<agent-name>|issue=#<n>|reason=<completed|blocked|replaced|failed-review>
progressnextQuality and Closure Loop
质量与闭环
- Review each agent diff individually, then review the combined batch diff.
- Run issue-specific checks before broader suites.
- Commit per issue by default.
- Update each issue with completion, verification, and follow-up notes.
- Close completed issues with unless explicitly left open.
gh issue close
- 单独审核每个Agent的差异,然后审核批量合并后的差异。
- 先运行问题专属检查,再运行更广泛的测试套件。
- 默认按问题提交。
- 更新每个问题的完成情况、验证结果和后续说明。
- 已完成的问题使用 关闭,除非明确要求保持打开。
gh issue close
Guardrails
防护规则
- Keep prompt content implementation-only.
- Preserve local fallback behavior when GitHub or git is unavailable.
- Keep changes minimal and focused to routing/control-plane behavior.
- 提示内容仅用于实现细节。
- 当GitHub或Git不可用时,保留本地回退行为。
- 将变更最小化,聚焦于路由/控制平面行为。