repo-scan
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineserepo-scan
repo-scan
Every ecosystem has its own dependency manager, but no tool looks across C++, Android, iOS, and Web to tell you: how much code is actually yours, what's third-party, and what's dead weight.
每个技术生态都有自己的依赖管理器,但没有工具可以同时覆盖C++、Android、iOS和Web栈,帮你理清:到底有多少代码是自研的、哪些是第三方的、哪些是无用冗余代码。
When to Use
适用场景
- Taking over a large legacy codebase and need a structural overview
- Before major refactoring — identify what's core, what's duplicate, what's dead
- Auditing third-party dependencies embedded directly in source (not declared in package managers)
- Preparing architecture decision records for monorepo reorganization
- 接手大型遗留代码库,需要快速了解整体结构
- 大规模重构前,识别核心代码、重复代码和死代码
- 审计直接嵌入源代码(未在包管理器中声明)的第三方依赖
- 为monorepo重组准备架构决策记录
Installation
安装
bash
undefinedbash
undefinedFetch only the pinned commit for reproducibility
Fetch only the pinned commit for reproducibility
mkdir -p ~/.claude/skills/repo-scan
git init repo-scan
cd repo-scan
git remote add origin https://github.com/haibindev/repo-scan.git
git fetch --depth 1 origin 2742664
git checkout --detach FETCH_HEAD
cp -r . ~/.claude/skills/repo-scan
> Review the source before installing any agent skill.mkdir -p ~/.claude/skills/repo-scan
git init repo-scan
cd repo-scan
git remote add origin https://github.com/haibindev/repo-scan.git
git fetch --depth 1 origin 2742664
git checkout --detach FETCH_HEAD
cp -r . ~/.claude/skills/repo-scan
> 安装任何agent skill前请先审查源代码。Core Capabilities
核心能力
| Capability | Description |
|---|---|
| Cross-stack scanning | C/C++, Java/Android, iOS (OC/Swift), Web (TS/JS/Vue) in one pass |
| File classification | Every file tagged as project code, third-party, or build artifact |
| Library detection | 50+ known libraries (FFmpeg, Boost, OpenSSL…) with version extraction |
| Four-level verdicts | Core Asset / Extract & Merge / Rebuild / Deprecate |
| HTML reports | Interactive dark-theme pages with drill-down navigation |
| Monorepo support | Hierarchical scanning with summary + sub-project reports |
| 能力 | 描述 |
|---|---|
| 跨栈扫描 | 一次扫描即可覆盖C/C++、Java/Android、iOS (OC/Swift)、Web (TS/JS/Vue) |
| 文件分类 | 每个文件都会被标记为项目代码、第三方代码或构建产物 |
| 库检测 | 支持50+已知库(FFmpeg、Boost、OpenSSL…)并可提取版本号 |
| 四级判定 | 核心资产 / 提取合并 / 重构 / 弃用 |
| HTML报告 | 支持下钻导航的深色主题交互式页面 |
| Monorepo支持 | 层级扫描,同时输出总览报告和子项目报告 |
Analysis Depth Levels
分析深度等级
| Level | Files Read | Use Case |
|---|---|---|
| 1-2 per module | Quick inventory of huge directories |
| 2-5 per module | Default audit with full dependency + architecture checks |
| 5-10 per module | Adds thread safety, memory management, API consistency |
| All files | Pre-merge comprehensive review |
| 等级 | 读取文件数 | 适用场景 |
|---|---|---|
| 每个模块1-2个 | 超大目录的快速清点 |
| 每个模块2-5个 | 默认审计模式,覆盖完整依赖+架构检查 |
| 每个模块5-10个 | 额外增加线程安全、内存管理、API一致性检查 |
| 所有文件 | 合并前的全面评审 |
How It Works
工作原理
- Classify the repo surface: enumerate files, then tag each as project code, embedded third-party code, or build artifact.
- Detect embedded libraries: inspect directory names, headers, license files, and version markers to identify bundled dependencies and likely versions.
- Score each module: group files by module or subsystem, then assign one of the four verdicts based on ownership, duplication, and maintenance cost.
- Highlight structural risks: call out dead-weight artifacts, duplicated wrappers, outdated vendored code, and modules that should be extracted, rebuilt, or deprecated.
- Produce the report: return a concise summary plus the interactive HTML output with per-module drill-down so the audit can be reviewed asynchronously.
- 分类仓库表层:枚举所有文件,将每个文件标记为项目代码、嵌入式第三方代码或构建产物。
- 检测嵌入式库:检查目录名、头文件、许可证文件和版本标记,识别捆绑依赖及对应版本。
- 模块打分:按模块或子系统对文件分组,根据归属、重复度和维护成本分配四级判定结果。
- 结构风险高亮:标注冗余产物、重复封装、过时 vendored 代码,以及需要提取、重构或弃用的模块。
- 生成报告:返回简明摘要和支持按模块下钻的交互式HTML输出,方便异步审阅审计结果。
Examples
示例
On a 50,000-file C++ monorepo:
- Found FFmpeg 2.x (2015 vintage) still in production
- Discovered the same SDK wrapper duplicated 3 times
- Identified 636 MB of committed Debug/ipch/obj build artifacts
- Classified: 3 MB project code vs 596 MB third-party
在一个包含50000个文件的C++ monorepo上运行结果:
- 发现生产环境仍在使用2015年的FFmpeg 2.x版本
- 发现同一个SDK封装被重复实现了3次
- 识别出636 MB已提交的Debug/ipch/obj构建产物
- 分类结果:3 MB自研代码 vs 596 MB第三方代码
Best Practices
最佳实践
- Start with depth for first-time audits
standard - Use for monorepos with 100+ modules to get a quick inventory
fast - Run incrementally on modules flagged for refactoring
deep - Review the cross-module analysis for duplicate detection across sub-projects
- 首次审计使用深度
standard - 包含100+模块的monorepo使用模式快速清点
fast - 对标记为待重构的模块增量运行模式
deep - 查看跨模块分析结果,检测子项目间的重复代码