repo-scan

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

repo-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
undefined
bash
undefined

Fetch 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

核心能力

CapabilityDescription
Cross-stack scanningC/C++, Java/Android, iOS (OC/Swift), Web (TS/JS/Vue) in one pass
File classificationEvery file tagged as project code, third-party, or build artifact
Library detection50+ known libraries (FFmpeg, Boost, OpenSSL…) with version extraction
Four-level verdictsCore Asset / Extract & Merge / Rebuild / Deprecate
HTML reportsInteractive dark-theme pages with drill-down navigation
Monorepo supportHierarchical 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

分析深度等级

LevelFiles ReadUse Case
fast
1-2 per moduleQuick inventory of huge directories
standard
2-5 per moduleDefault audit with full dependency + architecture checks
deep
5-10 per moduleAdds thread safety, memory management, API consistency
full
All filesPre-merge comprehensive review
等级读取文件数适用场景
fast
每个模块1-2个超大目录的快速清点
standard
每个模块2-5个默认审计模式,覆盖完整依赖+架构检查
deep
每个模块5-10个额外增加线程安全、内存管理、API一致性检查
full
所有文件合并前的全面评审

How It Works

工作原理

  1. Classify the repo surface: enumerate files, then tag each as project code, embedded third-party code, or build artifact.
  2. Detect embedded libraries: inspect directory names, headers, license files, and version markers to identify bundled dependencies and likely versions.
  3. Score each module: group files by module or subsystem, then assign one of the four verdicts based on ownership, duplication, and maintenance cost.
  4. Highlight structural risks: call out dead-weight artifacts, duplicated wrappers, outdated vendored code, and modules that should be extracted, rebuilt, or deprecated.
  5. Produce the report: return a concise summary plus the interactive HTML output with per-module drill-down so the audit can be reviewed asynchronously.
  1. 分类仓库表层:枚举所有文件,将每个文件标记为项目代码、嵌入式第三方代码或构建产物。
  2. 检测嵌入式库:检查目录名、头文件、许可证文件和版本标记,识别捆绑依赖及对应版本。
  3. 模块打分:按模块或子系统对文件分组,根据归属、重复度和维护成本分配四级判定结果。
  4. 结构风险高亮:标注冗余产物、重复封装、过时 vendored 代码,以及需要提取、重构或弃用的模块。
  5. 生成报告:返回简明摘要和支持按模块下钻的交互式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
    standard
    depth for first-time audits
  • Use
    fast
    for monorepos with 100+ modules to get a quick inventory
  • Run
    deep
    incrementally on modules flagged for refactoring
  • Review the cross-module analysis for duplicate detection across sub-projects
  • 首次审计使用
    standard
    深度
  • 包含100+模块的monorepo使用
    fast
    模式快速清点
  • 对标记为待重构的模块增量运行
    deep
    模式
  • 查看跨模块分析结果,检测子项目间的重复代码

Links

链接