yun520-1/mark-heartflow-skill/skills/code-analyzer/SKILL.md
code-analyzer
Use it for engineering tasks; the detail page covers purpose, installation, and practical steps.
- Source repository stars
- 36
- Declared platforms
- 0
- Static risk flags
- 1
- Last source update
- 2026-07-28
- Source checked
- 2026-07-28
Decision brief
What it does—and where it fits
专业的深度代码库分析工具,超越表面指标,深入理解:
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/yun520-1/mark-heartflow-skill --skill "skills/code-analyzer"Inspect the Agent Skill "code-analyzer" from https://github.com/yun520-1/mark-heartflow-skill/blob/20bbbb4eacf56c941ddc3420dcbc81c04d55ec5c/skills/code-analyzer/SKILL.md at commit 20bbbb4eacf56c941ddc3420dcbc81c04d55ec5c. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
快速开始
Review the “快速开始” section in the pinned source before continuing.
Review and apply the “快速开始” source section. - 02
完整深度分析
python3 scripts/analyze.py --path /path/to/project --output report.md
python3 scripts/analyze.py --path /path/to/project --output report.md - 03
DDD 专项分析
python3 scripts/ddd-analyzer.py --path /path/to/project --output ddd-report.md
python3 scripts/ddd-analyzer.py --path /path/to/project --output ddd-report.md - 04
排除特定目录
python3 scripts/analyze.py --path . --exclude "nodemodules,vendor,target" --output analysis.md markdown
python3 scripts/analyze.py --path . --exclude "nodemodules,vendor,target" --output analysis.md markdown
Permission review
Static risk signals and limitations
Runs scripts
The documentation asks the agent to run terminal commands or scripts.
python3 scripts/analyze.py --path /path/to/project --output report.mdRuns scripts
The documentation asks the agent to run terminal commands or scripts.
python3 scripts/ddd-analyzer.py --path /path/to/project --output ddd-report.mdEvidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 60/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 36 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- yun520-1/mark-heartflow-skill
- Skill path
- skills/code-analyzer/SKILL.md
- Commit
- 20bbbb4eacf56c941ddc3420dcbc81c04d55ec5c
- License
- Not declared
- Collected
- 2026-07-28
- Default branch
- main
View the original SKILL.md
Code Analyzer - 深度代码分析
专业的深度代码库分析工具,超越表面指标,深入理解:
- 🏗️ 架构风格 - 识别 MVC、Clean Architecture、微服务等
- 🚀 执行流程 - 入口点、调用图、执行路径追踪
- 💧 数据流动 - 数据如何在系统中传输和转换
- 📜 业务规则 - 从代码中提取验证逻辑、业务约束
- 🔗 外部依赖 - API、数据库、第三方服务
- 📊 数据模型 - 实体、DTO、值对象及其关系
- 🏛️ DDD 模式 - 聚合根、实体、值对象、领域服务
快速开始
# 完整深度分析
python3 scripts/analyze.py --path /path/to/project --output report.md
# DDD 专项分析
python3 scripts/ddd-analyzer.py --path /path/to/project --output ddd-report.md
# 排除特定目录
python3 scripts/analyze.py --path . --exclude "node_modules,vendor,target" --output analysis.md
核心功能
📊 代码质量评估
| 维度 | 说明 |
|---|---|
| 可维护性 | 代码结构、复杂度、可读性 |
| 可测试性 | 单元测试覆盖率、可测试程度 |
| 文档完整性 | 注释、文档覆盖率 |
| 复杂度 | 圈复杂度、耦合度 |
🏛️ DDD 模式识别
| 模式 | 识别能力 |
|---|---|
| 聚合根 | ✅ 识别一致性边界 |
| 实体 | ✅ 识别有身份的对象 |
| 值对象 | ✅ 识别不可变对象 |
| 领域服务 | ✅ 识别无状态业务逻辑 |
| 仓储 | ✅ 识别持久化抽象 |
| 领域事件 | ✅ 识别事件驱动模式 |
| 限界上下文 | ✅ 识别模块边界 |
📝 报告生成
- 执行摘要
- 质量评分
- 问题清单(分级)
- 改进建议(分优先级)
- 架构图(Mermaid)
输出示例
# 代码分析报告
## 执行摘要
- 总文件数:105
- 总代码行数:24,780
- 架构风格:Layered
- 入口点:5 个
- 数据模型:45 个
- 业务规则:23 个
## 质量指标
| 指标 | 评分 | 状态 |
|------|------|------|
| 可维护性 | 75/100 | 👍 |
| 可测试性 | 82/100 | ✅ |
| 文档完整性 | 68/100 | ⚠️ |
| 复杂度 | 71/100 | 👍 |
## 发现的问题
### 严重 (1)
- 循环依赖:module_a ↔ module_b
### 主要 (3)
- 高复杂度函数:calculate_score (复杂度=25)
- 过大文件:admin.py (850 行)
支持语言
| 语言 | 扩展名 | 分析深度 |
|---|---|---|
| Python | .py | 深度 (AST) |
| JavaScript | .js | 深度 |
| TypeScript | .ts | 深度 |
| Rust | .rs | 深度 |
| Java | .java | 中等 |
| Go | .go | 中等 |
| C/C++ | .c, .cpp | 基础 |
使用场景
1. 新项目熟悉
python3 scripts/analyze.py --path /new/project --output onboarding.md
2. 架构文档生成
python3 scripts/analyze.py --path . --output architecture.md
3. 代码审查准备
python3 scripts/analyze.py --path ./feature --output pr-analysis.md
4. 技术债务评估
python3 scripts/analyze.py --path . --exclude "tests" --output debt-review.md
5. DDD 模式识别
python3 scripts/ddd-analyzer.py --path . --output ddd-analysis.md
与 AI 助手配合
Claude/Codex:
"分析这个代码库并解释:
1. 主要入口点是什么?
2. 核心数据模型有哪些?
3. 编码了哪些业务规则?
4. 数据如何在系统中流动?"
AI 会:
- 运行 code-analyzer
- 解读分析报告
- 提供针对性解释
- 回答具体问题
最佳实践
详见 references/best-practices.md:
- 代码分析方法论
- 架构识别技巧
- DDD 模式识别指南
- 质量改进建议
参见
Alternatives
Compare before choosing
K-Dense-AI/scientific-agent-skills
dask
Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.
K-Dense-AI/scientific-agent-skills
medchem
Medicinal chemistry filters for compound triage. Apply drug-likeness rules (Lipinski, Veber, CNS), structural alert catalogs (PAINS, NIBR, ChEMBL), complexity metrics, and the medchem query language for library filtering.
K-Dense-AI/scientific-agent-skills
neurokit2
Use NeuroKit2 to build or audit reproducible research workflows for physiological time-series preprocessing, event/interval analysis, multimodal alignment, variability, and complexity. Trigger when code imports neurokit2 or needs its current APIs, schemas, and method-aware validation—not for diagnosis or device validation.
K-Dense-AI/scientific-agent-skills
esm
Use when working directly with the `esm` Python SDK, ESM3 or ESMC model IDs, Forge/Biohub inference clients, or ESMFold2 folding workflows.