From omni
Identifies codebase modules at directory/file levels, classifying into core business, data persistence, interface adaptation, infrastructure, and utility layers. Use for structure analysis, module boundaries, architecture review.
npx claudepluginhub zte-aicloud/co-omnispec --plugin omniThis skill uses the workspace's default tool permissions.
识别代码库中的所有模块,采用目录级(架构边界)+ 文件级(代码实现)双层粒度模型。
Runs 7-phase analysis of TypeScript codebases using typegraph-mcp tools like ts_dependency_tree and ts_import_cycles, producing architectural report for onboarding or overviews.
Deeply explores existing codebases to map architecture, data flow, domain model, API surface, dependencies, and code health using read-only SubAgents.
Share bugs, ideas, or general feedback.
识别代码库中的所有模块,采用目录级(架构边界)+ 文件级(代码实现)双层粒度模型。
必须使用subagent执行此技能,通过Agent tool调用,subagent_type为"general-purpose"。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
project_path | string | ✅ | 待分析的项目根目录路径(绝对路径或相对路径) |
scan_depth | enum | ❌ | 扫描深度:shallow(浅层,1-2层)或 deep(深层,全量),默认 shallow |
output_path | string | ❌ | 分析结果的保存路径。编排层调用时传入具体路径(如 state/modules.json);单独调用时默认保存到 .claude/skills/ai-friendly-module-identifier/output/modules.json |
基于目录职责分析,分类到5个类型之一:
分类方法:
输出严格遵循 schema/output-schema.json 定义的 JSON Schema(完整字段定义见该文件)。
关键字段摘要:
| 字段路径 | 类型 | 说明 |
|---|---|---|
skill_id | string | 固定值 |
rule_version | string | 当前 v1.0 |
scan_depth | enum | shallow | deep |
execute_status | enum | success | failed |
project_path | string | 项目根目录路径 |
modules | object | 按架构层分类(核心业务域/数据持久层/接口适配层/基础设施层/公共工具层) |
modules.<层>.path | string | 模块相对路径 |
modules.<层>.files | array | 文件列表(name + lines) |
statistics.total_modules | integer | 总模块数 |
statistics.by_category | object | 各层模块数统计 |
运行扫描脚本(必须): 执行以下命令获取原始模块结构,脚本已自动过滤空文件和行数不足的文件:
python3 .claude/skills/ai-friendly-module-identifier/scripts/scan_modules.py <project_path>
脚本输出为 JSON 数组,每项包含 path、name、depth、files(已过滤 lines=0 的文件)。
说明:默认使用
shallow扫描深度(1-2层),适合大多数场景。如需全量深层扫描,传入scan_depth=deep。
职责识别与分类: 基于脚本输出结果,对每个目录进行职责分析,归类到5个标准类型之一。
统计汇总: 计算各类别的模块数、文件数、代码行数(直接使用脚本输出的 lines 值,不重复计算)。
生成报告: 将分类结果按输出格式写入文件。
分析结果写入 output_path 参数指定的路径。若未传入 output_path,默认写入:
.claude/skills/ai-friendly-module-identifier/output/modules.json