/openmatrix:om:planfrom openmatrix
Generates a structured technical plan (plan.md + tasks-input.json) before coding. Activates after brainstorming or when the user requests a formal plan. Part of the OpenMatrix task orchestration workflow.
Ships in openmatrix. 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.
None: SKILL.md is the whole skill.
AI 应根据用户语义判断意图:
| 用户意图 | 应调用 |
|---|---|
| 需求不明确,需要探索 | /om:brainstorm |
| 已有方案,直接执行 | /om:start |
| 小改动,不需要方案 | /om:feature |
| 查看状态 | /om:status |
| 用户消息 | 判断 | 结果 |
|---|---|---|
| "基于刚才的设计生成方案" | 方案生成意图 | 触发 |
| brainstorm 路由过来 | 自动路由 | 触发 |
| "直接开始实现" | 执行意图 | /om:start |
| "这个功能怎么设计" | 设计探索 | /om:brainstorm |
相关技能: /om:brainstorm (需求探索) | /om:start (标准执行) | /om:feature (轻量执行) | /om:auto (全自动)
Step 0: 获取当前 runId(读取 .openmatrix/current.json)
Step 1: 读取输入(brainstorm 设计文档 / 用户描述 / 研究上下文)
Step 2: 生成技术方案,写入 .openmatrix/{runId}/plan.md <- 独立阶段
Step 3: 提取结构化元数据(goals/goalTypes/goalComplexity)
Step 4: 写入 .openmatrix/{runId}/tasks-input.json <- 必须完成
Step 5: 展示执行计划
Step 5.5: 质量门禁检查(调用 om:gate --checkpoint plan) <- 必须完成
Step 6: 确认后路由到 start/feature
违反以下任一规则将导致方案质量下降:
openmatrix start --init-only 由 CLI 生成,不要用 bash $RANDOM 或 md5sum 生成plan 阶段只做方案设计和元数据提取,不写任何业务代码。
文件隔离: 所有文件写入 .openmatrix/{runId}/ 目录,通过 current.json 获取 runId。
重要:runId 必须由 CLI 生成,禁止 AI 自己生成。
读取 current.json 获取当前运行 ID:
cat .openmatrix/current.json 2>/dev/null || echo '{"runId":"run-default"}'
从返回结果提取 runId,后续所有文件写入 .openmatrix/{runId}/ 目录。
如果 current.json 不存在或 runId 无效(如 "run-default"):
openmatrix start --init-only --json
CLI 返回包含真实 runId 的 JSON,例如:
{"status": "initialized", "runId": "run-20260525-cbux"}
禁止事项:
echo "run-$(date)...$(RANDOM)" 自己生成 runId.openmatrix/run-xxx/ 目录openmatrix start --init-only 由 CLI 统一管理按优先级检测输入来源(从 {runId} 目录读取):
| 来源 | 检测方式 | 处理 |
|---|---|---|
| brainstorm 设计文档 | docs/openmatrix/YYYY-MM-DD-*-design.md | 读取最新设计文档 |
| 研究上下文 | .openmatrix/{runId}/research/context.json | 读取研究目标和报告 |
$ARGUMENTS 直接描述 | 参数非空 | 直接使用 |
| 无输入 | 以上都不存在 | AskUserQuestion 询问 |
检测研究上下文(使用 runId):
cat .openmatrix/${runId}/research/context.json 2>/dev/null || echo "NO_RESEARCH"
如果检测到研究上下文,同时读取研究报告作为领域知识。
独立阶段 — 产出供 Agent 执行时参考的技术方案文档。
写入路径: .openmatrix/{runId}/plan.md(使用 Step 0 获取的 runId)
AI 分析需求,生成完整的技术方案,用 Write 工具写入:
.openmatrix/{runId}/plan.md
# 技术方案: 任务标题
## 整体架构
(架构图、模块划分、数据流)
## 模块设计
(每个模块的职责、接口、依赖关系)
## 接口定义
(核心 API / 函数签名 / 数据结构)
## 数据模型
(实体关系、表结构、字段定义)
## 技术栈
(语言、框架、库、工具)
## 关键决策
(技术选型理由、权衡取舍)
## 实现顺序建议
(模块间依赖关系,建议的开发顺序)
研究上下文集成: 如果已加载研究领域,AI 应基于研究报告中领域知识生成 plan,包含领域技术栈、架构模式等。
从需求和 plan 中提取 CLI 需要的结构化信息:
development - 需要编写代码的功能/模块实现 -> 拆分为"实现+测试"任务对testing - 明确的测试任务(如"编写 E2E 测试")-> 单个测试任务documentation - 文档编写(如"编写 API 文档")-> 单个文档任务other - 配置、部署、优化等非编码任务 -> 单个任务low - 简单配置、样式、工具函数medium - 一般功能实现、测试任务high - 架构设计、核心模块、复杂业务逻辑goalTypes 标注示例:
| Goal | Type | Complexity | 理由 |
|---|---|---|---|
| "项目脚手架: Vite+TS 配置" | development | low | 配置类 |
| "GameLoop 60fps 游戏循环" | development | high | 核心功能 |
| "所有核心模块的单元测试" | testing | medium | 测试任务 |
| "API 文档编写" | documentation | low | 文档类 |
| "CI/CD 流水线配置" | other | medium | 配置类 |
写入路径: .openmatrix/{runId}/tasks-input.json(使用 Step 0 获取的 runId)
用 Write 工具写入:
{
"title": "任务标题",
"description": "整体描述",
"goals": ["目标1", "目标2", "目标3"],
"goalTypes": ["development", "development", "testing"],
"goalComplexity": ["high", "medium", "medium"],
"constraints": ["约束1"],
"deliverables": ["src/xxx.ts"]
}
注意:
quality、mode、e2eTests 不在此写入,由执行阶段(/om:start)的必选问题决定plan 不在此写入,plan.md 是独立文件,CLI 会自动读取展示执行计划:
执行计划
Goals:
1. [development/high] 目标1
2. [development/medium] 目标2
3. [testing/medium] 目标3
质量配置、E2E、执行模式 将在执行阶段选择。
技术方案已写入: .openmatrix/{runId}/plan.md
任务输入已写入: .openmatrix/{runId}/tasks-input.json
调用 om:gate 检查 goals 与设计文档的对齐度:
Skill 工具: skill = "om:gate", args = "--checkpoint plan"
om:gate 执行:
根据 gate 结果决定下一步:
| 对齐度评分 | 处理方式 |
|---|---|
| >= 90 | 继续到 Step 6(路由执行) |
| 70-89 | 用户确认:接受偏差或修正 goals |
| 50-69 | 建议修正 tasks-input.json 后重新 gate |
| < 50 | 必须重新提取 goals(回到 Step 3) |
用户选择"修正 goals"或 gate 失败时:
路由判断:
AI 根据 goals 数量和任务特征判断路由:
| 条件 | 路由 |
|---|---|
| goals <= 2 + 实现路径清晰 | /om:feature |
| goals > 2 + 需完整追踪 | /om:start |
| 用户明确要求全自动 | /om:auto |
自动路由到对应 Skill:
Skill 工具:
- start → skill = "om:start"
- feature → skill = "om:feature"
- auto → skill = "om:auto"
/om:start 会检测已存在的 tasks-input.json 和 plan.md,询问必选问题(质量等级、E2E、执行模式)后执行/om:feature 使用轻量流程执行小任务/om:auto 全自动执行,无交互无审批brainstorm (澄清需求) → plan (生成方案 + gate检查) → start/feature (执行)
plan 是连接需求和执行的桥梁:
所有 plan 相关文件写入 .openmatrix/{runId}/ 目录:
.openmatrix/{runId}/plan.md - 技术方案.openmatrix/{runId}/tasks-input.json - 任务输入元数据.openmatrix/{runId}/research/context.json - 研究上下文(如果有)runId 通过 current.json 获取,确保不同运行之间数据隔离。
| Skill | plan 的角色 |
|---|---|
| /om:brainstorm | 完成后调用 /om:plan |
| /om:start | 读取 plan.md + tasks-input.json 执行 |
| /om:feature | 轻量任务可能不需要 plan |
| /om:auto | 读取 plan.md + tasks-input.json 全自动执行 |
如果 .openmatrix/{runId}/plan.md 已存在:
通过 CLI 检查:
openmatrix status --json | jq '.files.hasPlan'
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (bigfish1913/openmatrix) — no native marketplace selected
npx claudepluginhub p/bigfish1913-openmatrix20 skills in this plugin
/om:approveUse when handling pending approvals including plan review, merge confirmation, deploy approval, and blocked task decisions during OpenMatrix execution. Triggers on APPROVAL intent: user wants to review and approve pending items, handle merge conflicts, or confirm deploy. DO NOT trigger on: starting tasks, debugging, or status checks. Intent signals: user mentions 'approve', 'review plan', 'confirm merge', 'approve deploy', or refers to pending approval actions./om:autoUse when the user wants fully automated task execution with zero manual approvals. Triggers on AUTOMATION intent: user explicitly requests hands-free execution, wants to skip all confirmations, or needs batch processing without interruptions. Expects plan.md + tasks-input.json to already exist (generated by /om:plan). DO NOT trigger on: interactive requests, debugging, or status checks. Intent signals: user says 'fully auto', 'hands-free', 'no interruptions', 'skip approvals', or describes large batch operations./om:brainstormUse when the user wants to explore requirements, design alternatives, or validate ideas before implementation. Triggers on CLARIFICATION/DESIGN intent: user needs to clarify unclear requirements, explore multiple approaches, or design architecture before coding. DO NOT trigger on: simple implementation requests (clear path), status checks, or pure information queries. Intent signals: user says 'how should I', mentions multiple options/uncertainties, describes complex system from scratch, or task scope is ambiguous./check自动检测项目可改进点并提供升级建议,用户确认后自动执行/om:debugUse when user encounters ANY technical problem and needs systematic diagnosis. Triggers on PROBLEM-EXPLORATION intent: user wants to understand WHY something failed, investigate root cause, or diagnose unexpected behavior. DO NOT trigger on: simple questions (how to do X), implementation requests (build/fix/add), or status checks. Intent signals: user seems confused about failure, asks '为什么', mentions error/issue without clear solution, wants to investigate before fixing./om:deployUse for deployment, publishing, environment setup, or creating deployment scripts. Triggers on DEPLOYMENT intent: deploy to server, Docker/K8s config, publish npm package, or generate deployment scripts. DO NOT trigger on: development tasks, debugging, or status checks.