Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/hellyguo-code-deconstruct
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/code-deconstruct
What's inside
- Skill name
code-deconstruct- Description
- 读取所有源代码,解构为设计图、设计文档、数据库设计; 没有执行文件,请按流程执行
- License
- Apache-2.0
- Instructions
- 233 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- files: referenced but missing: templates/recipes.md
Files (6)
- SKILL.md
- algorithm.md · templates/
- arch_design_summary.md · templates/
- memory_usage.md · templates/
- middleware_tracing.md · templates/
- network_usage.md · templates/
SKILL.md (first lines)
# 源代码解构(设计)
<HARD-GATE>
完整全面,不遗漏细节。
</HARD-GATE>
> 本文件中的 `templates/...` 均指本技能目录下的 `templates/` 子目录。
## 代码解构流程
1. 读取所有源代码,感知项目目的/意图/结构,以及代码之间关系
2. 定位若干核心类,生成主干类图 `docs/deconstruct/classes_graph.puml`
3. 定位核心数据流,生成数据流图 `docs/deconstruct/core_data_flow.puml(md)`
4. 将代码结构分模块编写设计细节文档 `docs/deconstruct/design_{package}/design.md`
5. 分析内存使用代价、探测是否存在内存泄漏 `docs/deconstruct/memory_usage.md`
6. 对核心算法、数据结构,生成算法文档 `docs/deconstruct/algorithm_{package}/algorithm.md`
7. 对重要的架构设计,总结归纳 `docs/deconstruct/arch_design_summary.md`
8. 汇总所有模块的设计细节后,写出全项目设计细节文档 `docs/deconstruct/global_design.md`
### 模块定义
- Java: `package`,如有 maven module,需识别为 `{module}-{package}`
- Python: `package`/`module`
- Ansi C/C++: Makefile target/CMakeLists.txt target
- JS: `module`
- Rust: `mod`,如有 cargo workspace,需识别为 `{member}-{mod}`
## 数据库解构流程
1. 扫描 SQL 文件、MyBatis/iBATIS 映射文件、代码内嵌 SQL
2. 生成数据库清单 `docs/deconstruct/database/database_inventory.md`
3. 构建 ER 图 `docs/deconstruct/database/er_diagram.puml(md)`
4. 生成数据库设计思路摘要 `docs/deconstruct/database/database_design.md`
### SQL 提取规则
- MyBatis: 从 `<sql>` `<select>` `<insert>` `<update>` `<delete>` 标签提取
- Java注解: 从 `@Query` `@NamedQuery` 注解提取
- 字符串: 正则匹配 `(SELECT|INSERT|UPDATE|DELETE)\s+` 开头的字符串
### SQL 提取(ast-grep-mcp 联动)
当 ast-grep-mcp 可用时,优先使用 `find_code_by_rule` 精准提取内嵌 SQL,替代正则匹配。
**Java 内嵌 SQL**:
```
find_code_by_rule(
project_folder: "<project_root>",
yaml: '''
id: sql-string-java
language: java
rule:
pattern: '"$SQL"'
constraints:
SQL:
regex: '(?i)\\b(select|insert|update|delete)\\b.*\\b(from|into|set)\\b'
'''
)
```
**C++ 内嵌 SQL**:同上,改 `language: cpp`。
**SQL 拼接点识别**:参见 `sql-extract` 技能的 `templates/recipes.md`。
> **注意**:XML(MyBatis mapper)ast-grep 不支持,需用 rg 兜底。详见 `sql-extract` 技能。
## 内存使用分析
识别内存热点:大对象创建、集合操作、字符串处理、字节数组、流处理、缓存对象
探测内存泄漏:静态集合增长、ThreadLocal未清理、监听器未注销、连接未关闭、缓存无过期
模板: `templates/memory_usage.md`
### 内存泄漏 AST 探测(ast-grep-mcp 联动)
**静态集合增长**:
```
find_code_by_rule(
project_folder: "<project_root>",
yaml: '''
id: static-map-leak
language: java
rule:
pattern: 'private static final $MAP_TYPE $VAR = new $CTOR$$$ARGS();'
constraints:
MAP_TYPE:
regex: '(?i).*(Map|HashMap|ConcurrentMap|ConcurrentHashMap|Cache|LinkedHashMap)'
'''
)
```
**ThreadLocal 未清理**:
```
find_code(
pattern: 'ThreadLocal $VAR = $$$INIT',
language: java,
project_folder: "<dir>"
)
```
> 命中后需人工检查是否有对应的 `.remove()` 调用。
**JDBC 资源未关闭**:
```
find_code_by_rule(
project_folder: "<project_root>",
yaml: '''
id: jdbc-resource-leak
language: java
rule:
any:
- pattern: '$TYPE $VAR = $CONN.createStatement()'
- pattern: '$TYPE $VAR = $CONN.prepareStatement($$$ARGS)'
'''
)
```
> 命中后需人工检查是否在 finally/try-with-resources 中关闭。
## 中间件消息追踪From hellyguo/self-ai-spec, Apache-2.0.
More from hellyguo/self-ai-spec
- 0.618score
code-review
hellyguo
代码审查框架:通用审查流程 + 语言特定规则引用,支持多语言代码审查
SkillAFreshness: A★ 8Claude Code +9 - 0.592score
gdb-heap-analysis
hellyguo
GDB heap/arena memory analysis for core dump debugging.
SkillBFreshness: B★ 8Claude Code +9 - 0.589score
java-coverage
hellyguo
Strategies and patterns to boost test coverage to 80%+ line or 60%+ branch coverage.
SkillBFreshness: B★ 8Claude Code +9 - 0.581score
java-check-spotbugs
hellyguo
SpotBugs静态分析技能:使用SpotBugs、Find Security Bugs、fb-contrib进行Java代码缺陷和安全分析
SkillBFreshness: B★ 8Claude Code +9 - 0.581score
cpp-tscancode
hellyguo
TscanCode静态分析技能:使用TscanCode(腾讯开源)进行C/C++代码质量分析,检测缺陷、安全漏洞和代码风格问题
SkillBFreshness: B★ 8Claude Code +9 - 0.580score
ast-grep-block
hellyguo
基于 ast-grep 的代码审查门禁:使用 code-checklist 规则集对 Java/C++/ANSI C 项目分级扫描(high/medium/low),输出命中清单与 CI 退出码。仅使用 CLI 模式(run.sh),适用于交互式审查、CI 质量门禁、批量检测
SkillBFreshness: B★ 8Claude Code +9 - 0.578score
java-check-pmd
hellyguo
PMD静态分析技能:使用PMD进行Java代码质量分析,检测代码坏味道、编码规范和安全问题
SkillBFreshness: B★ 8Claude Code +9 - 0.578score
java-env
hellyguo
该skill没有执行文件,为信息输入:Java开发需要的环境信息
SkillBFreshness: B★ 8Claude Code +9 - 0.575score
code-refactor
hellyguo
该skill没有执行文件,为操作指引:如何重构
SkillBFreshness: B★ 8Claude Code +9 - 0.575score
java-asprof
hellyguo
该skill没有执行文件,为操作指引:采集Java执行情况
SkillBFreshness: B★ 8Claude Code +9 - 0.574score
code-part-modification
hellyguo
局部代码修改技能:最小化修改完成功能,确保无蝴蝶效应,支持独立测试验证和全量关联检查
SkillBFreshness: B★ 8Claude Code +9 - 0.530score
cpp-clang-tidy
hellyguo
Clang-Tidy 静态分析技能:使用 clang-tidy 进行 C/C++ 代码质量检测,支持自定义检查规则和自动修复
SkillCFreshness: C★ 8Claude Code +9
Signals
- Stars
- 8
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 15, 2026 (14 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/hellyguo/self-ai-spec
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from hellyguo
- 0.618score
code-review
hellyguo
代码审查框架:通用审查流程 + 语言特定规则引用,支持多语言代码审查
SkillAFreshness: A★ 8Claude Code +9 - 0.592score
gdb-heap-analysis
hellyguo
GDB heap/arena memory analysis for core dump debugging.
SkillBFreshness: B★ 8Claude Code +9 - 0.589score
java-coverage
hellyguo
Strategies and patterns to boost test coverage to 80%+ line or 60%+ branch coverage.
SkillBFreshness: B★ 8Claude Code +9 - 0.581score
java-check-spotbugs
hellyguo
SpotBugs静态分析技能:使用SpotBugs、Find Security Bugs、fb-contrib进行Java代码缺陷和安全分析
SkillBFreshness: B★ 8Claude Code +9 - 0.581score
cpp-tscancode
hellyguo
TscanCode静态分析技能:使用TscanCode(腾讯开源)进行C/C++代码质量分析,检测缺陷、安全漏洞和代码风格问题
SkillBFreshness: B★ 8Claude Code +9 - 0.580score
ast-grep-block
hellyguo
基于 ast-grep 的代码审查门禁:使用 code-checklist 规则集对 Java/C++/ANSI C 项目分级扫描(high/medium/low),输出命中清单与 CI 退出码。仅使用 CLI 模式(run.sh),适用于交互式审查、CI 质量门禁、批量检测
SkillBFreshness: B★ 8Claude Code +9
Cite this page
code-deconstruct skill. Agent Mart. https://agentmart.dev/skills/hellyguo-code-deconstruct (last updated 2026-10-24)