/loom-engineering:loom-detail-expansion <spec directory containing spec.md and requirements.json>from loom-engineering
Expands 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.
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 已存在并经用户批准。requirements.json 中某些 REQ 的 behaviors 仍为默认 REQ-xxx-B01(happy-path 占位),未按需求 types 覆盖全部必需维度。loom-writing-plans,需要先把每个 REQ 拆成可独立验证、可分配到 task 的行为义务。requirements.json 已显式覆盖每个 REQ 的所有 required_categories,且每个 behavior 都有具体 description 与 acceptance。调用 loom MCP 工具 loom_detail_expansion_check(参数 spec_dir)。
工具会读取 requirements.json,对每个 REQ 检查:所有 required_categories 都有对应 behavior、每个 behavior 有 test_plan、无 requires-clarification 残留、description 非占位文案。返回 ok:false 表示有缺口需要补齐。
说明:
scripts/check-detail-expansion.mjs是该工具的实现,运行在 loom MCP 服务器进程内,可直接 import loom 仓库的 core 模块。不要在用户项目里用node skills/...调用(部署后路径会断裂)。
读取 specs/<date+feature>/spec.md、specs/<date+feature>/requirements.json、必要时的 specs/<date+feature>/handoffs/brainstorming.json。禁止重新展开用户已显式确定的 behavior;只补充缺失维度或细化占位 description。
v2 账本保留已确认的 intent、原文版本、例子、非目标和不变量;展开行为不得把推断改标为用户明确要求。先运行 loom intent check --spec-dir <dir>;关键未决问题、未批准推断或来源过期时返回 brainstorming 确认,不自行补业务规则。
对每个 REQ,根据其 types 与 required_categories,合并出必须覆盖的 category 集合:
functional → happy-pathinput → invalid-inputauthorization / auth → authorizationwrite / mutation → atomicitystate → state-transitionidempotent → idempotencyconcurrent → concurrencyexternal → external-failuresecurity → securityperformance → performanceobservable → observabilityrecovery → recoveryforbidden-behavior:所有涉及写、权限、外部副作用或旧 API 的 REQ 都应额外考虑一个 forbidden-behavior 维度,用于"不应发生"的负空间。对每个必需维度,若 requirements.json 中没有对应 category 的 behavior,追加新的 REQ-xxx-Bnn:
id:递增 Bnn,保持 REQ-xxx-Bnn 格式。category:固定维度之一。description:具体到可被代码实现与测试验证的单一行为。禁止"系统应正常"、"接口应稳定"等模糊描述。status:初始 failing。acceptance:可测量、可观察的验收项列表。每个 acceptance 必须可由一个或多个测试用例证明,例如:
applicability每个必需维度必须显式标注:
applicable:已生成 behavior。not-applicable:明确说明为何不适用,例如"本 REQ 只读取公开数据,无权限维度"。requires-clarification:阻塞 planning,必须回到 brainstorming 或询问用户澄清。requires-clarification 的 behavior 不得进入 planning。状态机层面由 loom-analyze-artifacts 在 planning 前阻断。
test_plan 占位为每个 behavior 写最小 test_plan:
{
"id": "REQ-001-B02",
"category": "invalid-input",
"test_plan": {
"strategy": "property-based + boundary value",
"inputs": ["empty string", "max length +1", "non-utf8"],
"expected": ["400 Bad Request", "400 Bad Request", "400 Bad Request"],
"coverage_target": "100% branches of validateInput"
}
}
没有 test_plan 的 behavior 不得进入 planning。
requirements.json把展开后的 behavior 写回 specs/<date+feature>/requirements.json。不允许删除用户已显式确认的 behavior;只能追加或细化。
required_categories 都有对应 behavior,或显式标注 not-applicable。description 可被一个 task 实现、可被一个测试验证。requires-clarification 残留。test_plan。写入 specs/<date+feature>/handoffs/detail-expansion.json:
{
"stage": "detail-expansion",
"status": "done",
"summary": "已把 N 个 REQ 展开为 M 个 behavior,覆盖 K 个维度",
"artifacts": ["requirements.json"],
"expanded_behaviors": ["REQ-001-B01", "REQ-001-B02", "..."],
"blocked_behaviors": []
}
所有产物写入 specs/<date+feature>/。禁止在项目根写 requirements.json 或 detail-expansion.json。
requires-clarification 必须在交接前清零或显式 escalate。requirements.json 每个 REQ 的 required_categories 都有对应 behavior 或 not-applicable 说明。description、acceptance 与 test_plan。requires-clarification 残留。handoffs/detail-expansion.json。What SKILL.md sets; muted values are Claude Code's defaults
After brainstorming approval and before planning, when requirements.json behaviors are incomplete or do not cover the required dimensions for each REQ type.
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-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-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.
/loom-index-updateSynchronize graph backend index, structured memory, and entry docs with code after verification passes. Use when: verified code changes need graph index sync, memory updates, or entry documentation refresh.