/loom-engineering:loom-init-project <project root>from loom-engineering
Bootstraps .loom/ context files for a new repository: constitution, structured memory, workflow, and agent entry files. Guides through role, tool, and graph backend selection.
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.
.loom/ 是唯一长期维护点,存放项目原则、结构化记忆和 workflow。AGENTS.md 是 Codex/OpenCode 等通用 agent 的标准入口。.loom/contexts/agent-workflow.md,常驻入口只保留索引和关键约束;详细流程按需读取。[TODO] 标记,交给用户确认。用户只需要说 /loom-init-project、初始化项目 或 扫描项目生成配置。
用户明确要求不初始化 .loom 时不触发本 skill,不因配置缺失自行生成。
触发本 skill 后,判断当前目录是不是项目根目录,如果不是根目录,询问用户是否在当前目录运行:
如果用户没有明确指定角色,先询问这个项目给谁用(可多选,取并集):
pm:PM 视角,生成产品上下文 .loom/rules/product.md,走 需求 → spec → 原型 流水线dev:研发视角,生成工程上下文(宪章 / subagent-context),走完整工程流水线角色决定生成哪些 .loom/ 文件;workflow.yaml 始终是含全部 pipeline 的单文件,不裁剪。未指定时默认 dev(与历史行为一致)。把选择通过 --roles 传给脚本,例如 --roles pm,dev。
如果用户没有明确指定 agent 工具,再询问要为哪些工具生成入口文件。可选项为:
claude-code:生成 AGENTS.md+ CLAUDE.mdcodex:生成 AGENTS.mdopencode:生成 AGENTS.md 并合并 opencode.json watcher ignorecursor:生成 .cursor/rules/loom.mdccopilot:生成 .github/copilot-instructions.md拿到用户选择后,把角色和工具通过 --roles / --tools 显式传给脚本,例如:
node <skill-dir>/scripts/init-project.mjs --cwd <project-root> --roles pm,dev --tools claude-code,codex
dev)如果用户没有明确指定图后端,询问这个项目使用哪个代码图谱/知识库后端。可选项为:
codegraph(默认推荐):基于 tree-sitter AST 的本地代码图谱,通过 MCP 实时查询。需要用户按需手动创建 .codegraph/ 索引,初始化脚本不自动建图。sourcegraph:基于 Sourcegraph 的代码搜索和引用查询。需要 Sourcegraph 实例或 MCP server,索引由用户自行搭建。scip:基于 SCIP/LSIF 精确索引。需要已生成的 .lsif 或 .scip 文件,索引由用户自行生成。none:不启用任何图后端,所有代码查询走源码搜索和 git diff。未指定时默认 codegraph(与历史行为一致)。把选择通过 --graph-backend 传给脚本:
node <skill-dir>/scripts/init-project.mjs --cwd <project-root> --roles dev --tools codex --graph-backend codegraph
如果用户在调用 skill 时已经明确指定了图后端(例如"用 sourcegraph 初始化项目"),则跳过此询问。非交互环境(CI、脚本调用)未指定时默认 codegraph,不阻塞流程。
pm)脚本对 pm 角色只写出 .loom/rules/product.md 模板(保留 {{...}} 占位符)。脚本运行后,问用户以下 5 题,再用 Edit 把答案填进 product.md,替换对应占位符:
{{PRODUCT_NAME}} / {{PRODUCT_ONELINE}}{{TARGET_USERS}}{{CORE_VALUE}}{{PLATFORM}}{{UI_STYLE}} / {{PROTOTYPE_AUDIENCE}}填完确认无残留 {{...}} 占位符。## 设计原则 下的 [TODO] 提示用户后续补充,不强制此刻填。
如果当前环境已安装 loom CLI,也可以等价运行:
loom init-project
CLI 可选参数:
--force:覆盖已有 loom 生成文件。--tools claude-code,codex,cursor,copilot,opencode:显式指定要分发的工具;兼容历史别名 claude,不传时 CLI 在交互终端会询问用户,非交互环境会自动检测并默认生成 AGENTS.md。--no-codegraph:兼容旧脚本的 no-op;loom init-project 已不再自动运行 codegraph init。脚本额外参数:
--roles pm,dev:显式指定角色,决定生成哪些 .loom/ 文件;不传时默认 dev(与历史行为一致)。pm 多写 product.md,dev 写工程上下文,两者取并集。--graph-backend codegraph|sourcegraph|scip|none:显式指定图后端;不传时默认 codegraph(与历史行为一致)。初始化只写入图后端配置,不自动建图。也可通过环境变量 LOOM_GRAPH_BACKEND 覆盖;优先级:--graph-backend 参数 > LOOM_GRAPH_BACKEND 环境变量 > 默认 codegraph。--template-dir <path>:使用指定模板目录,主要用于测试或本地调试;CLI 入口不暴露该参数。执行后检查输出报告中的 written 和 skipped。被跳过的文件通常是用户已有的非 loom 管理文件,不要擅自覆盖,除非用户明确同意或使用 --force。
.loom/
graph.config.json # dev 角色,图后端配置
memory/store.json # 所有角色,结构化记忆源
memory/MEMORY.md # 所有角色,只读导出视图
workflow.yaml # 所有角色(单文件,含全部 pipeline)
rules/product.md # 选择 pm 角色时
rules/constitution.md # 选择 dev 角色时
contexts/subagent-context.md # 选择 dev 角色时
contexts/agent-workflow.md # 所有角色,短入口引用的按需指南
AGENTS.md # 选择 Codex/OpenCode/Claude Code 时
CLAUDE.md # 选择 Claude Code 时
.cursor/rules/loom.mdc # 检测到 Cursor 时
.github/copilot-instructions.md # 检测到 GitHub Copilot 时
脚本完成后必须快速审阅(按所选角色):
.loom/rules/constitution.md 中技术栈、构建命令、测试命令、目录树和架构模式是否准确。.loom/graph.config.json 中 backend 与用户选择一致;需要索引时由用户按需运行 loom index 或手动初始化索引;后端不可用时确认图查询能力已跳过。.loom/rules/product.md 中 5 项产品上下文已填,无残留 {{...}} 占位符。.loom/memory/MEMORY.md 是否有需要保留的用户偏好、踩坑和长期决策。.loom/,不要复制大段规则。.loom/contexts/agent-workflow.md 确实存在且入口可定位;初始化不自动证明宿主 hook、CI、只读或压缩能力。{{PLACEHOLDER}}。.mdc 必须有合法 frontmatter。.loom/ 目录结构一致。[TODO],已明确提示用户后续确认。What SKILL.md sets; muted values are Claude Code's defaults
Bootstrap .loom context, workflow, memory, and agent entry files for a repository.
Three short reads, in order
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-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.