/omni-reverse:reverse-functionsfrom omni-reverse
Orchestrates reverse-engineering of project functions: identifies entry points, scenarios, and generates function documentation with caching and batch processing.
Ships in omni-reverse. 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.
reverse --target functions ... 或 --target all 触发--path / --files 等参数确定扫描范围{REPO_ROOT}/.cache/reverse/functions/
project-entries.jsonscenarios.jsonfunction-list.json、function-tree.json.cache-status.json{REPO_ROOT}/omni-doc/specs/functions/
FUNC-XXX-功能名称.md本 Skill 对应原
reverse-functions的“快捷命令 + 详细步骤”,现在以 Skill 形式承载该编排逻辑。
本 Skill 阶段文档中引用了以下路径变量,执行阶段命令前须先解析:
${CLAUDE_PLUGIN_ROOT}:omni-reverse 插件安装根(运行期注入;指向本 skill 内专属脚本,如 ${CLAUDE_PLUGIN_ROOT}/skills/reverse-<X>/scripts/)。${DSDD}:共享插件 omni-dsdd 安装根(含共享 scripts/ 与 omni-infra/)。首次使用前必须解析:
DSDD="$(bash "${CLAUDE_PLUGIN_ROOT}/scripts/resolve-dsdd-root.sh")" || { echo "缺少 omni-dsdd,中止"; exit 1; }
解析器优先用 ${CLAUDE_PLUGIN_ROOT}/../omni-dsdd,回退到脚本相对位置推算;失败则提示需与 omni-reverse 同 marketplace 安装 omni-dsdd。{REPO_ROOT} / ${CLAUDE_WORKING_DIR}:被反构的代码工程根(运行期产物,与插件位置无关)。${CLAUDE_SKILL_DIR}:本 skill 自身目录(指向本 skill 内 references/scripts/ 等自包含资源)。说明:
${DSDD}不是运行期自动注入的变量,必须经resolve-dsdd-root.sh取值后方可使用。
reverse 命令的关系reverse 负责:
--target 固定为 functions(或在 all 流水线中进入功能阶段);--interactive / --non-interactive / --yes);本 Skill 按以下阶段执行,阶段详细说明见本目录下 references/stages/:
.cache-status.json,confirmed==true 时跳过该阶段{REPO_ROOT}/.cache/reverse/functions/.cache-status.jsonproject_entry_identification、scenario_identification、function_partitioning、function_document_generation 四个段落confirmed == true 且对应输出存在,可在后续执行中跳过该阶段。project-entries.json(支持批次与索引)--interactive 模式下可让用户确认入口识别结果。scenarios.json(支持批次与索引)function-list.json(批次+索引)function-tree.json--interactive 模式下展示功能划分结果并等待确认。{REPO_ROOT}/omni-doc/specs/functions/FUNC-XXX-功能名称.mdfunction-list.json 为输入,分批处理功能;.omni-infra/metamodel/5.function-template.md 的结构和字段生成文档(frontmatter、章节、PlantUML 部分等必须保持一致);--interactive:在每个阶段结束后暂停,使用中文询问用户是否继续;--non-interactive / --yes:强制全自动。{REPO_ROOT}/.cache/reverse/functions/.cache-status.jsonreverse 为功能反构创建主任务与 4 个阶段 todo;{REPO_ROOT}/.cache/reverse/functions/.cache-status.json,记录各阶段 confirmed 状态{stage}/batch-details-{N}.json 和 {stage}-batch-status.json{stage}-index.json,避免生成过大的合并文件| 传递方向 | 传递方式 | 传递内容 |
|---|---|---|
| 阶段1 → 阶段2 | entry-index.json | 入口点批次索引和统计 |
| 阶段2 → 阶段3 | scenario-index.json | 场景批次索引和统计 |
| 阶段3 → 阶段4 | function-index.json + function-tree.json | 功能清单索引和功能树结构 |
本 Skill 编排 4 个阶段,各阶段通过 Agent 工具调用子 Agent 执行并发分析。
子 Agent 命名空间:子 Agent 使用归属插件的命名空间前缀,由 Agent 工具的 subagent_type 参数指定——本插件(omni-reverse)本地提供的 agent 用 omni-reverse: 前缀,omni-dsdd 共享的 agent 用 omni-dsdd: 前缀。
| 阶段 | 子 Agent | 职责 | 并发策略 |
|---|---|---|---|
| 阶段1 | omni-dsdd:entry-identifier | 识别项目入口点 | 每轮最多2个 |
| 阶段2 | omni-reverse:scenario-recognizer | 识别业务场景 | 每轮最多2个 |
| 阶段3 | omni-dsdd:function-partitioner | 划分功能构建功能树 | 每轮最多2个 |
| 阶段4 | omni-dsdd:function-detail-writer | 生成功能详细文档 | 每轮最多2个 |
并发控制:采用分轮执行策略,每轮启动不超过2个子 Agent,避免上下文超限。每轮完成后执行 /compact 压缩上下文。
参数传递:通过 {REPO_ROOT}/.cache/reverse/functions/{stage}/batch-details-{N}.json 文件传递批次信息。
返回值处理:子 Agent 将结果写入对应批次文件,主 Agent 收集后更新索引文件。
合并检查:每轮处理完成后,主 Agent 必须验证:
本 Skill 的详细规范位于本目录下 references/:
执行本 Skill 时,AI Agent 应读取上述文档并严格按照其中描述的步骤和数据结构进行操作。
执行功能反构,自动识别入口点、场景、功能并生成文档:
reverse --target functions --path ./src
在每个阶段完成后暂停确认:
reverse --target functions --interactive --path ./src
从断点恢复,跳过已确认的阶段:
reverse --target functions --path ./src
# 阶段1已确认(confirmed=true),自动跳过
| 场景 | 正确输出 | 禁止输出 |
|---|---|---|
| 无入口点 | "未找到任何入口点,请检查扫描路径" | 基于猜测列出虚假入口 |
| 阶段产出缺失 | 报错并退出当前阶段 | 跳过或自行生成 |
references/stages/01-project-entry-identification.md (opens in a new tab)references/stages/02-scenario-identification.md (opens in a new tab)references/stages/03-function-partitioning.md (opens in a new tab)references/stages/04-function-detail-extraction-and-document-generation.md (opens in a new tab)references/token-management.md (opens in a new tab)scripts/python/generate_entry_batches.py (opens in a new tab)scripts/python/generate_function_batches.py (opens in a new tab)scripts/python/generate_function_doc_batches.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub zte-aicloud/co-omnispec --plugin omni-reverse12 skills in this plugin
/reverse执行 reverse 命令从代码库反构接口、架构、实体、场景、需求等要素,生成标准化文档。/reverse-deep-logic-architecture从代码库自动识别并生成深度逻辑架构文档,提取核心业务逻辑层、数据流模式、模块依赖关系和决策逻辑集中点,输出 logic_architecture.md。适用于代码架构分析、遗留系统改造、技术尽职调查等场景。当 reverse 的 --target 为 deep_logic_architecture 时触发。/reverse-entities实体清单与实体关系反构的编排Skill. 当 reverse 的 --target 为 entities 或 all 的实体阶段时触发./reverse-external-interfaces识别代码库中的外部依赖接口并生成标准化文档。扫描导入语句,将外部符号按系统/本库/外部分类,仅对有调用点的外部接口生成 EXTERNAL-API_xxx.md 和汇总文件。当用户执行 reverse --target external-interfaces 或 --target all 的外部接口阶段时触发。Other plugins' skills for the same job