/loom-engineering:loom-writing-plans <spec_dir>from loom-engineering
Decomposes an approved spec into ordered, independently-verifiable task files with dependency analysis and traceability mapping.
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; scripts run unread.
specs/<date+feature>/spec.md 与 specs/<date+feature>/requirements.json 已存在并经用户确认。specs/<date+feature>/plan.md:交付摘要、按依赖排列的任务链接、关键决定和主要验证。specs/<date+feature>/tasks/T1.md、T2.md...:每个 task 一个独立文件。specs/<date+feature>/traceability.json:REQ 与 behavior 到 task/test/evidence 的结构化追踪账本;planning 阶段至少写入 REQ/behavior 到 task 的初始映射,tests/evidence 可先为空并由 executing 补齐。specs/<date+feature>/handoffs/planning.json:规划阶段交接摘要。本阶段的 specDir 是 specs/<date+feature>/。所有阶段产物都必须写入该目录内;禁止在项目根目录写 spec.md、plan.md、tasks/、progress.md 或 handoffs/。
使用 assets/plan-template.md 和 assets/task-template.md 作为输出模板。
spec.md 供读者查范围和需求。## Task 执行顺序与依赖关系 中按依赖排列任务。每项使用 - [T1 任务名称](tasks/T1.md),注明直接前置和可交付结果。任务标题写具体动作,读者可直接跳到对应文件。执行进度查阅 progress.md。tasks/Tn.md;需求和 behavior 的完整映射留在 traceability.json。按实际任务替换示例,删去不适用的条目。任务文件的 depends_on 是调度依据,正文中的依赖说明与其一致。
specs/<date+feature>/spec.md 与 specs/<date+feature>/requirements.json,提取功能点、接口、数据模型、边界场景、Requirement ID 和 behaviors。.loom/rules/constitution.md;如存在,读取 .loom/contexts/subagent-context.md。specs/<date+feature>/plan.md,再为每个 task 写完整 specs/<date+feature>/tasks/TN.md。specs/<date+feature>/traceability.json,把每个 REQ-xxx 及其 REQ-xxx-Bnn behavior 映射到负责的 task;planning 阶段不允许遗漏 behavior。specs/<date+feature>/handoffs/planning.json,摘要说明 task 拆分、依赖顺序、关键接口约束、REQ/behavior 映射、并行/串行边界和主要产物。如果 spec 涵盖多个独立子系统,建议拆成多个计划;每个计划都应能产出可工作、可测试的独立软件。
owns(独占写入的文件/目录)、reads(只读依赖)、depends_on(前置 task)、requirements(覆盖的 REQ-xxx)、behavior_ids(覆盖的 REQ-xxx-Bnn)、complexity。这些字段驱动 loom tasks 命令的冲突检测、批次调度和 traceability 初始映射。requirements.json 中每个 behavior 必须至少映射到一个 task;task 不得使用 requirements.json 中不存在的 behavior_ids。owns 集合不得有交集:跨 task 的写入归属重叠会阻断计划校验,增加依赖或改为串行不能豁免。reads 声明实际路径,并通过 depends_on 保证生产者先完成;有顺序的写读协作不违反计划的独占写入规则。test_plan.inputs 和 test_plan.expected 记录需验证的输入和结果。可用 test_plan.regression_expected 明确需要保留的既有正常路径,写明输入条件和可观察结果。测试文件和隔离方式可在实现后补齐。loom intent packet --spec-dir <specDir> --task T1 预览任务的验收、示例、约束和验证命令。已批准的预期可加 --freeze 保存实现包,并在开工或恢复前用 --check 核对。预期发生实质变化时回到相应需求确认,随后用 --freeze --force 按新决定重新生成实现包。loom failure-signals 记录探针和回归。planning 阶段必须生成 specs/<date+feature>/traceability.json。结构示例:
{
"requirements": {
"REQ-001": {
"tasks": ["T1"],
"tests": [],
"evidence": [],
"behaviors": {
"REQ-001-B01": {
"tasks": ["T1"],
"tests": [],
"evidence": []
}
}
}
}
}
tasks;tests 与 evidence 可为空,由 executing 阶段补齐真实测试和证据。REQ-xxx 必须出现,且每个 REQ-xxx-Bnn behavior 必须出现。traceability.json 里的 task 引用必须对应真实 tasks/TN.md。完成 specs/<date+feature>/plan.md、specs/<date+feature>/tasks/Tn.md 和 specs/<date+feature>/traceability.json 后运行:
调用 MCP 工具 loom_validate_plan,参数:spec_dir: "specs/<date+feature>"。
不要在用户项目或全局 opencode skill 目录中直接执行 node <skill-dir>/scripts/validate-plan.mjs。该脚本是 loom MCP 服务器进程内的工具实现,直接执行部署后的 skill 脚本会因为相对导入脱离 npm 包运行时而失败。
工具返回 ok: false 时,先修复计划文件,再进入用户确认 gate。
如已安装 loom CLI,追加查看调度预览,核对依赖顺序和并行/串行边界:
loom tasks --spec-dir specs/<date+feature>
普通调度会提示全局文件重叠,但可以把冲突任务串行安排;退出成功不替代计划校验通过。
缺失依赖、循环或非法元数据必须修复;无顺序的写读共享须核对是否缺少 depends_on,
有生产者/消费者关系时补齐依赖,不把调度器的串行回退当作业务顺序。
需要检查所有任务间都没有写写/写读冲突时,再运行严格检查:
loom tasks --spec-dir specs/<date+feature> --validate
--validate 对全局写写/写读重叠及缺少 owns 返回失败,即使任务已有依赖顺序也不豁免;
它不是每个合法串行计划都必须通过的门禁。有序写读可在计划校验通过、调度顺序正确后保留,
并在 handoffs/planning.json 说明重叠路径、依赖顺序与严格检查结果;执行时仍须遵守任务启动门禁。
不要仅为通过严格检查删除真实 reads、伪造 owns 或合并合理的分层任务。
planning 完成后,拆分过程、中间推理和探索性搜索输出可以压缩;executing 阶段只应依赖 specs/<date+feature>/spec.md、specs/<date+feature>/requirements.json、specs/<date+feature>/plan.md、specs/<date+feature>/tasks/、specs/<date+feature>/traceability.json、specs/<date+feature>/progress.md、specs/<date+feature>/handoffs/brainstorming.json、specs/<date+feature>/handoffs/planning.json 和必要规则文件。
占位符扫描禁止
禁止使用以下占位符,发现即视为未完成:TBD、TODO、implement later、fill in details、Similar to Task N、"add appropriate error handling"
specs/<date+feature>/plan.md 开头能看到交付结果、任务顺序及链接,且依赖关系与任务文件一致。requirements 与 behavior_ids 覆盖 requirements.json 中对应 REQ/behavior。specs/<date+feature>/traceability.json 包含每个 REQ/behavior 到 task 的初始映射。以下为未经本项目真实任务集校准的启发式候选,不承诺固定成本或成功率。实际选择须符合可用模型、预算、任务风险和后续评测结果,不按角色数强制分配模型:
机械实现任务(隔离函数、1-2 个文件、Requirement ID 与验收映射完整、上下文无 UNKNOWN):使用快速、便宜的模型。只有事实已落盘且不存在接口/安全判断时,才把任务视为机械实现
集成和判断任务(多文件协调、模式匹配、调试):使用标准模型
架构、设计和审查任务:使用可用的最强模型
任务复杂度信号:
specs/<date+feature>/plan.md、所有 specs/<date+feature>/tasks/TN.md、specs/<date+feature>/traceability.json、自动校验和 specs/<date+feature>/handoffs/planning.json 完成。
What SKILL.md sets; muted values are Claude Code's defaults
Decompose an approved spec into ordered, independently verifiable implementation tasks.
Other plugins' skills for the same job
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.
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-