/loom-engineering:loom-subagent-driven-development <spec_dir>from loom-engineering
Executes approved plans with review checkpoints, using isolated subagents only when context isolation or parallel execution provides concrete benefits. Manages task handoffs, continuation, and verification checkpoints.
Ships in loom-engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
What SKILL.md sets; muted values are Claude Code's defaults
Execute an approved plan with evidence and review; choose isolation only when it has a concrete benefit.
Claude Code installs this plugin but refuses to load it
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest/PreSkillShellCommand at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest/PreSkillShellCommand at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
Checked against Claude Code 2.1.332. The listing below is what the repository ships; Claude Code doesn't load it as published.
默认主执行者保持需求上下文。没有本项目实测证据,不宣称 subagent 的固定成本倍数或成功率。
仅在实际可用且获授权的工具上,针对以下明确收益选择隔离模式:
文件数、task 数和角色数只是风险信号,不自动要求派发。没有可调用的子任务工具时由主 agent 执行,真实记录自审,不伪造独立 reviewer。
此外仍需满足:
specs/<date+feature>/plan.md、requirements.json、traceability.json 和 tasks/ 已存在。从 spec 所属项目核对已冻结的实现包(loom intent packet --spec-dir <specDir> --task T1 --check)。
有冻结包时,按其中已批准的验收预期和回归判据执行;判据变化先核对用户批准的需求和计划,再更新实现包。
按当前阶段与 handoff 持续推进已批准范围内的可执行工作,直至完成、遇到真实阻塞、 等待审批或用户取消。Loom 不设接续次数、回合数或配额上限,同一范围无须重复确认。 局部验证通过后仍需完成当前阶段的全部工作。
在提供 loom_manage_continuation 的 OpenCode 会话中,用户批准计划后先以
{"action":"bind","spec_dir":"当前 specDir"} 将当前会话绑定到该任务。
正常结束回合后,插件检查流水线是否仍未完成,并接续执行剩余已批准的工作。
个别任务受阻时继续独立且就绪的任务;遇到阶段级阻塞、当前阶段无可执行项、等待授权或用户暂停时,先调用
{"action":"pause","reason":"具体原因"},再向用户说明。
新用户输入、宿主错误或取消会暂停;核对真实授权并解决阻塞后,才可显式
{"action":"resume","spec_dir":"当前 specDir"}。状态可用 status 查询。
此工具只管理当前会话与任务的接续,人工 gate 和完成状态仍走正常流水线入口。
其他宿主按其实际可用的接续能力执行。宿主没有自动接续能力时,在当前回合继续可执行工作,
并保存 handoff 供后续回合恢复。
本阶段的 specDir 是 specs/<date+feature>/。所有阶段产物都必须写入该目录内;禁止在项目根目录写 test-report.md、traceability.json、progress.md、task-states/、handoffs/ 或复制 plan.md、tasks/。
默认由主 agent 完成实现、重构、行为测试和证据记录;审查从已批准需求和实际代码分别取证。选择隔离模式后才按下述子任务循环派发。自审与独立审查必须区分标注;若工作流明确要求独立或可信审查而当前无法提供,保持阻断,不降级为自填 PASS。
每个 fresh subagent 都必须以 task handoff 作为跨会话边界:上游只传递必要 spec 片段、task、subagent-context 和相关 handoff,不把主会话的原始讨论、大段搜索输出或长日志整体塞入子会话。
详细状态处理、执行循环和红线见 references/execution-details.md。派发前必须读取相关 prompt 模板:
implementer-prompt.mdcombined-reviewer-prompt.mdtest-reporter-prompt.md从 .loom/workflow.yaml 的 defaults 读取全局配置,step 级别配置可覆盖全局值:
# 全局默认(workflow.yaml defaults 区块)
max_retries: 3 # 单个 task 的最大修复重试次数
timeout_minutes: 60 # 单个隔离 subagent 的超时时间(分钟)
每个 task 独立计算重试次数,不跨 task 累计。
启动执行阶段前,若 loom CLI 已安装,运行批次调度分析:
loom tasks --spec-dir specs/<date+feature>
输出告知哪些 task 无 owns 冲突及依赖;它只说明可并行,不证明应该并行。主线阻塞工作仍由当前 agent 处理。
每个 subagent task 完成后必须生成交接文件 specs/<date+feature>/handoffs/TN.json,格式:
{
"task_id": "T1",
"status": "done",
"summary": "认证接口已完成,JWT 密钥从环境变量 JWT_SECRET 读取,未硬编码",
"artifacts": ["src/auth/index.ts", "tests/auth.test.ts"],
"exported_interfaces": [
{
"name": "Authenticate",
"path": "src/auth/index.ts",
"signature": "(token: string) => Promise<User>"
}
],
"breaking_changes": []
}
下游 task 的 subagent 派发前必须读取上游 handoff 作为紧凑索引,并按 artifacts 定向核对当前源码。handoff 不覆盖源码事实;自动保存的指纹过期时必须刷新 handoff。
读取 specs/<date+feature>/plan.md Task 概览和 specs/<date+feature>/tasks/TN.md 详细内容,创建任务追踪列表。
读取 specs/<date+feature>/requirements.json 与 specs/<date+feature>/traceability.json,确认每个 task frontmatter 的 behavior_ids 已在账本中映射到该 task。
读取 .loom/workflow.yaml 的 defaults,获取 max_retries 和 timeout_minutes;当前 step 有 config 字段时以 step 级别为准。
读取 .loom/contexts/subagent-context.md,必要时读取 specs/<date+feature>/spec.md 相关章节。
仅在已选择隔离模式时,对每个 task 执行以下循环(retry_count 初始为 0);本地执行也须满足相同的需求、审查与证据义务,不虚构派发动作:
LOOP:
派发 implementer(首次实现 或 修复模式)
若 subagent 超时(> timeout_minutes):
→ 通过 loom task/pipeline 状态记录失败,progress.md 由 loom 自动更新
→ 上报用户:任务名、已耗时、建议(拆分 task 或手动介入)
→ 停止当前 task,等待用户指示,禁止自动重试超时任务
处理状态:
DONE / DONE_WITH_CONCERNS → 继续派发 reviewer
NEEDS_CONTEXT → 补充上下文后重新派发,不计入 retry_count
BLOCKED → 上报用户,等待解除后继续,不计入 retry_count
派发 combined reviewer
若 reviewer PASS:
→ 进入下一个 task
若 reviewer FAIL:
retry_count += 1
若 retry_count > max_retries:
→ 触发熔断(见"熔断处理")
否则:
→ 提取修复指令,派发 implementer(修复模式),回到 LOOP 顶部
每个 task PASS 后,更新 specs/<date+feature>/traceability.json:该 task 的每个 behavior_ids 都必须补齐真实持久化测试文件引用到 tests,并记录对应 evidence 引用到 evidence。
所有 task PASS 后,执行 test-reporter 的报告职责;仅在已选隔离模式且工具可用时派发。
test-reporter 编写持久化集成测试、运行回归测试、对照 spec/requirements/traceability 验证并输出 specs/<date+feature>/test-report.md,同时复核 traceability.json 中每个 behavior 的 tests 和 evidence 都指向真实文件。
test-reporter FAIL 时提取修复指令,派发 implementer(修复模式),再重跑 test-reporter。
max_retries 限制,超限触发熔断。执行阶段整体完成后写入 specs/<date+feature>/handoffs/executing.json,摘要说明已完成 task、验证命令、traceability.json 更新情况、关键产物和遗留风险。
planning 阶段只负责把 requirements.json 中的 REQ 与 behaviors 映射到 task;executing 阶段必须把 behavior 级账本补到可验证闭环:
{
"requirements": {
"REQ-001": {
"tasks": ["T1"],
"tests": ["tests/example.test.js"],
"evidence": ["evidence/test.log"],
"behaviors": {
"REQ-001-B01": {
"tasks": ["T1"],
"tests": ["tests/example.test.js#covers REQ-001-B01"],
"evidence": ["evidence/test.log"]
}
}
}
}
}
behavior_ids 必须逐项更新到 traceability.json 对应 behavior。tests 必须引用持久化测试文件,可带 #测试名 或 ::测试名 定位;不得引用临时文件或不存在路径。evidence 必须引用 specs/<date+feature>/evidence/ 下真实日志或 receipt,且与 test-report.md 的 evidence receipt 一致。tasks/tests/evidence,必须同步更新 behavior 级 tasks/tests/evidence。触发条件:单个 task 的 retry_count > max_retries,或 subagent 超时。
熔断后必须执行以下步骤,禁止自动继续:
progress.md 自动反映失败状态;不要手动编辑 progress.md。[A] 拆分此 task,重新规划后继续
[B] 我来手动修复,修复完告诉我继续
[C] 跳过此 task,继续后续 task(需确认影响)
首次实现模式传入:
specs/<date+feature>/spec.md 相关章节specs/<date+feature>/requirements.json 中当前 task 的 Requirement 与 behavior 条目specs/<date+feature>/traceability.json 中当前 task 的 REQ/behavior 映射specs/<date+feature>/tasks/TN.md.loom/contexts/subagent-context.md修复模式只传入:
.loom/contexts/subagent-context.md不要在修复模式重新传递完整 task 和 spec 全文。
loom-dispatching-parallel-agents。traceability.json behavior 级 tests 与 evidence 时把 task 标记为 done。以下为未经本项目真实任务集校准的启发式候选,不承诺固定成本或成功率。实际选择须符合可用模型、预算、任务风险和后续评测结果,不按角色数强制分配模型:
机械实现任务(隔离函数、1-2 个文件、Requirement ID 与验收映射完整、上下文无 UNKNOWN):使用快速、便宜的模型。只有事实已落盘且不存在接口/安全判断时,才把任务视为机械实现
集成和判断任务(多文件协调、模式匹配、调试):使用标准模型
架构、设计和审查任务:使用可用的最强模型
任务复杂度信号:
全部 task、所需真实审查和测试报告通过,traceability.json 中每个 behavior_ids 对应 behavior 都有真实 tests 与 evidence 引用,并完成 specs/<date+feature>/handoffs/executing.json。报告区分本地自审、独立审查和外部可信收据;不能把同一执行者换角色名当作独立证据。按正常门禁推进。OpenCode 可选择 loom_compact_closed_stage 代替普通推进,由插件先推进再尽力请求压缩,无需等待压缩。
22 skills in this plugin
/loom-analyze-artifactsRead-only cross-artifact consistency analysis after planning and before approval. Verifies that spec.md, requirements.json, plan.md, tasks/Tn.md, traceability.json are mutually consistent: no duplicate/ambiguous requirements, every behavior mapped to a task, no orphan tasks, no coverage gaps, no contradictions. Outputs artifact-analysis.json with coverage% and severity. CRITICAL/HIGH findings block the approval gate. Use when: planning produced plan.md + tasks + traceability.json, before the user approves the plan.
/loom-brainstormingExplore 2-3 implementation options with trade-offs when the user describes a new feature or requirement. Use when: the user asks for a new feature design, implementation options, or technical trade-off analysis.
/loom-convergeCheck local behavior references, then independently review code and test semantics against approved requirements. Use when: executing produced test-report.md and implementation drift must be checked before final verification.
/loom-detail-expansionExpand each requirement into verifiable Behavior Obligations across 15 fixed dimensions (happy-path, boundary, invalid-input, authorization, state-transition, idempotency, concurrency, atomicity, external-failure, compatibility, security, performance, observability, recovery, forbidden-behavior) before planning. Use when: brainstorming produced requirements.json and spec is approved, but behaviors are still placeholders or only happy-path; before loom-writing-plans.
/loom-dispatching-parallel-agentsDispatch multiple independent tasks to parallel subagents when no shared file conflicts exist. Use when: a confirmed plan has independent tasks that can run concurrently without touching shared files.
/loom-finishing-a-development-branchClean up a feature branch after verification: merge, create PR, keep, or discard. Follows conventional commits. Use when: a development branch has passed verification and needs merge, PR, keep, or discard handling.
Other plugins' skills for the same job