14686039/controller-call-chain-analysis/SKILL.md
--- name: controller-call-chain-analysis description: 本技能用于分析 Java 微服务项目中 Controller 层的完整调用链路,能够自动追溯到 Service、Mapper、Repository 层,并提取完整的 SQL 语句。最终生成结构化的 JSON 文件,便于 API 文档生成、代码审计或架构理解。 --- # Java Controller 调用链路分析 Skill ## 简介 本技能用于分析 Java 微服务项目中 Controller 层的完整调用链路,能够自动追溯到 Service、Mapper、Repository 层,并提取完整的 SQL 语句。最终生成结构化的 JSON 文件,便于 API 文档生成、代码审计或架构理解。 ## 适用场景 - 需要快速了解某个 Controller 接口背后的业务逻辑和数据流向 - 自动化生成 API 调用链路文档 - 审计 SQL 语句或分析数据库访问模式 - 批量分析整个模块的接口实现细节 ## 输入参数 | 参数名 | 类型 | 必填 | 说明 | |----
npx skillsauth add openclaw/skills 14686039/controller-call-chain-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
本技能用于分析 Java 微服务项目中 Controller 层的完整调用链路,能够自动追溯到 Service、Mapper、Repository 层,并提取完整的 SQL 语句。最终生成结构化的 JSON 文件,便于 API 文档生成、代码审计或架构理解。
| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| controllerPath | string | 是 | Controller 源文件的相对路径,例如 src/main/java/org/ssh/boot/itemSupply/controller/pham/TDrugdictController.java |
| outputPath | string | 否 | 输出 JSON 文件的目录,默认为 docs/api_analysis/。如果目录不存在,会自动创建。 |
在指定的输出目录下生成一个以 Controller 类名命名的 JSON 文件(例如 TDrugdictController.json),文件内容遵循固定的 JSON 结构(详见下文)。该文件包含了从 Controller 方法到 Service 实现、再到 Mapper/Repository 以及最终 SQL 语句的完整调用链路信息。
@RequestMapping 路径@Api 或 @ApiOperation 注解(接口描述)@GetMapping、@PostMapping 等)及路径@ApiParam 描述等)mapper/ 目录下)src/main/resources/mapper/ 目录下,命名与接口相同)repository/ 目录下)@Query 注解中的 JPQL 或原生 SQL;如果方法名符合命名规范,则根据方法名解析 SQL(可选)按照预定义的 JSON 结构,将上述信息组合并写入文件。
{
"module": "模块名", // 根据包名自动推断,例如 "itemSupply"
"controller": {
"className": "Controller类名",
"filePath": "Controller源文件路径",
"requestMapping": "/请求路径", // 类级别的 @RequestMapping
"description": "Controller描述", // @Api 注解的 value 或 description
"methods": [
{
"name": "方法名",
"httpMethod": "GET/POST/PUT/DELETE",
"url": "/完整URL", // 类路径 + 方法路径
"description": "接口描述", // @ApiOperation 的值
"controllerFilePath": "Controller.java:行号", // 源文件位置
"params": [
{
"name": "参数名",
"type": "类型",
"required": true/false,
"description": "描述" // @ApiParam 的值
}
],
"service": [{ // 可能多个
"className": "ServiceImpl类名",
"filePath": "ServiceImpl源文件路径",
"method": "方法名", // Service 中调用的方法
"steps": ["业务步骤描述"], // 可选,可提取方法中的业务逻辑注释
"mapper": [{ // 如果调用的是 MyBatis Mapper,可能的多个
"className": "Mapper接口类名",
"filePath": "Mapper接口源文件路径",
"method": "方法名",
"xmlFilePath": "Mapper XML文件路径",
"sql": {
"id": "SQL ID",
"table": "表名",
"statement": "完整SQL语句",
"conditions": ["查询条件"]
}
}],
"repository": [{ // 如果调用的是 JPA Repository,可能的多个
"className": "Repository接口类名",
"filePath": "Repository源文件路径",
"method": "方法名",
"framework": "Spring Data JPA",
"sql": "JPQL或native SQL"
}]
}]
}
]
}
}
outputPath,默认输出到 docs/api_analysis/。controllerPath。service.impl、mapper、repository、resources/mapper)。若项目结构特殊,分析可能不完整。tools
Use when the user wants to connect to, test, or use the McDonalds service at mcp.mcd.cn, including checking authentication, probing MCP endpoints, listing tools, or calling McDonalds MCP tools through a reusable local CLI.
development
Web scraping platform — Twitter/X data, Vinted marketplace, and general web scraping API
development
SlowMist AI Agent Security Review — comprehensive security framework for skills, repositories, URLs, on-chain addresses, and products (Claude Code version)
data-ai
去除中文文本中的 AI 写作痕迹,使其读起来自然。基于维基百科 AI 写作特征指南,检测 24 种 AI 模式。触发词:humanizer-cn、去除 AI 痕迹、去除 AI 写作痕迹、中文文本人性化。