repository-analyzer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRepository Analyzer Skill
代码仓库分析技能
This skill provides a systematic approach to analyzing any code repository through multi-source investigation and critical evaluation.
本技能通过多源调查和关键评估,提供系统化的代码仓库分析方法。
Purpose
用途
Enable Claude to perform thorough repository analysis by:
- Exploring codebase structure and organization using Explore agents
- Identifying technology stack and dependencies
- Researching best practices via web search
- Fetching authoritative documentation via Context7
- Evaluating configuration quality and completeness
- Assessing documentation and maintainability
- Providing actionable recommendations
让Claude能够通过以下方式执行全面的仓库分析:
- 使用Explore Agent探索代码库的结构与组织
- 识别技术栈和依赖项
- 通过网页搜索研究最佳实践
- 通过Context7获取权威文档
- 评估配置的质量与完整性
- 评估文档质量与可维护性
- 提供可落地的建议
When to Use This Skill
使用场景
Activate this skill when users request:
- "Analyze this repository"
- "Audit the codebase"
- "Report on this repository's structure"
- "Investigate the current repository"
- "What technologies does this repo use?"
- "Review the repository configuration"
- "Assess the documentation quality"
当用户提出以下请求时,激活本技能:
- "分析这个仓库"
- "审计代码库"
- "报告该仓库的结构"
- "调查当前仓库"
- "这个仓库使用了哪些技术?"
- "审查仓库配置"
- "评估文档质量"
Analysis Framework
分析框架
Phase 1: Repository Discovery & Scoping
阶段1:仓库发现与范围界定
Identify Repository Context:
-
Location & Scopebash
# Determine working directory pwd # Check if it's a git repository git rev-parse --show-toplevel # Get repository metadata git remote -v git log --oneline -n 10 -
Initial Structure Assessment
- Use Explore agent with "medium" thoroughness
- Identify root-level files and directories
- Locate key configuration files
- Determine primary language(s)
Prompt for Explore Agent (Phase 1):
Explore the repository at [path] with medium thoroughness.
Find and report:
1. Directory structure (major folders and their purposes)
2. Configuration files (package.json, Cargo.toml, pyproject.toml, etc.)
3. Primary programming languages (by file extensions)
4. Entry points (main files, executables)
5. Documentation files (README, docs/, etc.)
6. Build/deployment files (Dockerfile, Makefile, CI configs)识别仓库上下文:
-
位置与范围bash
# 确定工作目录 pwd # 检查是否为git仓库 git rev-parse --show-toplevel # 获取仓库元数据 git remote -v git log --oneline -n 10 -
初始结构评估
- 使用"中等"细致度的Explore Agent
- 识别根目录文件和文件夹
- 定位关键配置文件
- 确定主要编程语言
Explore Agent提示词(阶段1):
以中等细致度探索[路径]下的仓库。
查找并报告:
1. 目录结构(主要文件夹及其用途)
2. 配置文件(package.json, Cargo.toml, pyproject.toml等)
3. 主要编程语言(按文件扩展名)
4. 入口文件(主文件、可执行文件)
5. 文档文件(README、docs/等)
6. 构建/部署文件(Dockerfile、Makefile、CI配置)Phase 2: Technology Stack Analysis
阶段2:技术栈分析
Identify All Technologies:
-
Programming Languages
- Analyze file extensions
- Check language-specific config files
- Determine primary vs. secondary languages
-
Package Managers & Dependencies
- Node.js: ,
package.json,package-lock.json,yarn.lockpnpm-lock.yaml - Python: ,
requirements.txt,pyproject.toml,Pipfilepoetry.lock - Rust: ,
Cargo.tomlCargo.lock - Ruby: ,
GemfileGemfile.lock - Go: ,
go.modgo.sum - PHP: ,
composer.jsoncomposer.lock - Other: ,
Makefile, etc.CMakeLists.txt
- Node.js:
-
Frameworks & Libraries
- Read package manager files
- Identify major dependencies
- Categorize: frontend, backend, testing, tooling
-
Development Tools
- Version managers: ,
.nvmrc,.ruby-version.tool-versions - Formatters: ,
.prettierrc,.eslintrcrustfmt.toml - Linters: ,
.eslintrc,pylint.rc.rubocop.yml - Type checkers: ,
tsconfig.jsonmypy.ini
- Version managers:
-
Infrastructure & Deployment
- Docker: ,
Dockerfiledocker-compose.yml - CI/CD: ,
.github/workflows/,.gitlab-ci.yml.circleci/ - Cloud: ,
terraform/,cloudformation/k8s/
- Docker:
Prompt for Explore Agent (Phase 2):
Explore the repository for technology stack identification with very thorough mode.
Search for and analyze:
1. All package manager files (package.json, Cargo.toml, requirements.txt, etc.)
2. Configuration files for development tools
3. Docker and containerization files
4. CI/CD pipeline configurations
5. Infrastructure as code files
6. Build system files
For each found file, provide:
- File path
- Type/purpose
- Key dependencies or configurations识别所有技术:
-
编程语言
- 分析文件扩展名
- 检查特定语言的配置文件
- 区分主要与次要语言
-
包管理器与依赖项
- Node.js: ,
package.json,package-lock.json,yarn.lockpnpm-lock.yaml - Python: ,
requirements.txt,pyproject.toml,Pipfilepoetry.lock - Rust: ,
Cargo.tomlCargo.lock - Ruby: ,
GemfileGemfile.lock - Go: ,
go.modgo.sum - PHP: ,
composer.jsoncomposer.lock - 其他: ,
Makefile等CMakeLists.txt
- Node.js:
-
框架与库
- 读取包管理器文件
- 识别主要依赖项
- 分类:前端、后端、测试、工具
-
开发工具
- 版本管理器: ,
.nvmrc,.ruby-version.tool-versions - 格式化工具: ,
.prettierrc,.eslintrcrustfmt.toml - 代码检查工具: ,
.eslintrc,pylint.rc.rubocop.yml - 类型检查工具: ,
tsconfig.jsonmypy.ini
- 版本管理器:
-
基础设施与部署
- Docker: ,
Dockerfiledocker-compose.yml - CI/CD: ,
.github/workflows/,.gitlab-ci.yml.circleci/ - 云服务: ,
terraform/,cloudformation/k8s/
- Docker:
Explore Agent提示词(阶段2):
以极高细致度探索仓库以识别技术栈。
搜索并分析:
1. 所有包管理器文件(package.json, Cargo.toml, requirements.txt等)
2. 开发工具的配置文件
3. Docker与容器化文件
4. CI/CD流水线配置
5. 基础设施即代码文件
6. 构建系统文件
对于每个找到的文件,提供:
- 文件路径
- 类型/用途
- 关键依赖项或配置Phase 3: Context7 Documentation Research
阶段3:Context7文档研究
Research Identified Technologies:
For each major technology/library identified in Phase 2:
-
Resolve Library IDs
Use Context7's resolve-library-id for: - Major frameworks (e.g., "next.js", "react", "vue") - Key libraries (e.g., "axios", "lodash", "sqlalchemy") - Development tools (e.g., "vitest", "eslint", "prettier") -
Fetch Documentation
Use Context7's get-library-docs with topics: - "configuration best practices" - "project structure" - "common patterns" - "performance optimization" -
Compare Against Best Practices
- How does the repository's usage align with official recommendations?
- Are there deprecated patterns being used?
- Are there missed optimization opportunities?
研究已识别的技术:
针对阶段2中识别的每个主要技术/库:
-
解析库ID
对以下内容使用Context7的resolve-library-id: - 主要框架(如"next.js", "react", "vue") - 关键库(如"axios", "lodash", "sqlalchemy") - 开发工具(如"vitest", "eslint", "prettier") -
获取文档
使用Context7的get-library-docs,主题包括: - "configuration best practices" - "project structure" - "common patterns" - "performance optimization" -
与最佳实践对比
- 仓库的使用方式是否符合官方建议?
- 是否使用了已弃用的模式?
- 是否存在可优化的空间?
Phase 4: Web Search for Best Practices
阶段4:网页搜索最佳实践
Research Industry Standards:
-
General Repository Practices
- Web search: "[primary language] project structure best practices 2025"
- Web search: "[framework] application architecture patterns"
- Web search: "dotfiles management best practices" (if applicable)
-
Technology-Specific Patterns
- Web search: "[technology] configuration optimization"
- Web search: "[framework] performance best practices"
- Web search: "[tool] common mistakes to avoid"
-
Security & Maintenance
- Web search: "[language] security best practices"
- Web search: "dependency management [package manager]"
- Web search: "CI/CD pipeline optimization"
研究行业标准:
-
通用仓库实践
- 网页搜索:"[primary language] project structure best practices 2025"
- 网页搜索:"[framework] application architecture patterns"
- 网页搜索:"dotfiles management best practices"(如适用)
-
特定技术模式
- 网页搜索:"[technology] configuration optimization"
- 网页搜索:"[framework] performance best practices"
- 网页搜索:"[tool] common mistakes to avoid"
-
安全与维护
- 网页搜索:"[language] security best practices"
- 网页搜索:"dependency management [package manager]"
- 网页搜索:"CI/CD pipeline optimization"
Phase 5: Configuration Deep Dive
阶段5:配置深度分析
Analyze Key Configuration Files:
-
Read Critical Configs
- Use Read tool for important configuration files
- Check for:
- Version pinning vs. version ranges
- Security configurations
- Performance settings
- Environment-specific configurations
- Secret management
-
Evaluate Configuration Quality
- Completeness: Are all necessary configs present?
- Consistency: Do configs align across the project?
- Documentation: Are configs well-commented?
- Security: Are secrets properly handled?
- Maintainability: Are configs modular and DRY?
Prompt for Explore Agent (Phase 5):
Explore configuration files in depth with very thorough mode.
Focus on:
1. Environment configuration (.env templates, config files)
2. Secret management patterns
3. Build configuration optimization
4. Development vs production configs
5. Version locking strategies分析关键配置文件:
-
读取关键配置
- 使用Read工具读取重要配置文件
- 检查:
- 版本固定 vs 版本范围
- 安全配置
- 性能设置
- 环境特定配置
- 密钥管理
-
评估配置质量
- 完整性:必要的配置是否齐全?
- 一致性:项目内的配置是否统一?
- 文档性:配置是否有详细注释?
- 安全性:密钥是否处理得当?
- 可维护性:配置是否模块化且遵循DRY原则?
Explore Agent提示词(阶段5):
以极高细致度深度探索配置文件。
重点关注:
1. 环境配置(.env模板、配置文件)
2. 密钥管理模式
3. 构建配置优化
4. 开发与生产环境配置差异
5. 版本锁定策略Phase 6: Documentation Assessment
阶段6:文档评估
Evaluate Documentation Quality:
-
Existence Check
- README.md at root
- CONTRIBUTING.md
- LICENSE
- CHANGELOG.md
- docs/ directory
- API documentation
- Code comments
- Type annotations/JSDoc
-
Quality Assessment
-
README.md:
- Clear project description?
- Installation instructions?
- Usage examples?
- Configuration guide?
- Contribution guidelines?
- License information?
-
Code Documentation:
- Function/method documentation?
- Complex logic explained?
- Type signatures/annotations?
- Examples provided?
-
-
Documentation Gaps
- Identify missing documentation
- Note outdated information
- Flag confusing sections
评估文档质量:
-
存在性检查
- 根目录下的README.md
- CONTRIBUTING.md
- LICENSE
- CHANGELOG.md
- docs/目录
- API文档
- 代码注释
- 类型注解/JSDoc
-
质量评估
-
README.md:
- 项目描述是否清晰?
- 包含安装说明?
- 包含使用示例?
- 包含配置指南?
- 包含贡献指南?
- 包含许可证信息?
-
代码文档:
- 函数/方法是否有文档?
- 复杂逻辑是否有解释?
- 包含类型签名/注解?
- 提供示例?
-
-
文档缺口
- 识别缺失的文档
- 标记过时信息
- 指出易混淆的部分
Phase 7: Code Quality & Patterns
阶段7:代码质量与模式
Analyze Code Organization:
-
Directory Structure
- Is structure logical and consistent?
- Are concerns properly separated?
- Is there clear separation of layers?
- Are naming conventions followed?
-
Code Patterns
- Identify architectural patterns
- Check for anti-patterns
- Assess modularity
- Evaluate reusability
-
Testing Strategy
- Test files location and organization
- Test coverage indicators
- Testing frameworks used
- CI test automation
Prompt for Explore Agent (Phase 7):
Explore code organization and patterns with very thorough mode.
Analyze:
1. Directory structure and naming conventions
2. Test files and testing strategy
3. Shared/common code organization
4. Configuration management patterns
5. Error handling approaches
6. Logging and monitoring setup分析代码组织:
-
目录结构
- 结构是否逻辑清晰且一致?
- 关注点是否分离得当?
- 层级划分是否清晰?
- 是否遵循命名规范?
-
代码模式
- 识别架构模式
- 检查反模式
- 评估模块化程度
- 评估可复用性
-
测试策略
- 测试文件的位置与组织
- 测试覆盖率指标
- 使用的测试框架
- CI测试自动化情况
Explore Agent提示词(阶段7):
以极高细致度探索代码组织与模式。
分析:
1. 目录结构与命名规范
2. 测试文件与测试策略
3. 共享/通用代码的组织
4. 配置管理模式
5. 错误处理方式
6. 日志与监控设置Phase 8: Dependencies & Security
阶段8:依赖项与安全
Audit Dependencies:
-
Dependency Health
- Count total dependencies
- Identify outdated packages
- Check for security vulnerabilities
- Assess dependency tree depth
-
Version Management
- Are versions locked properly?
- Overly restrictive version constraints?
- Too loose version ranges?
-
License Compliance
- What licenses are dependencies using?
- Any licensing conflicts?
- Attribution requirements met?
审计依赖项:
-
依赖项健康状况
- 统计总依赖项数量
- 识别过时包
- 检查安全漏洞
- 评估依赖树深度
-
版本管理
- 版本是否正确锁定?
- 版本约束是否过于严格?
- 版本范围是否过于宽松?
-
许可证合规性
- 依赖项使用的许可证类型?
- 是否存在许可证冲突?
- 归因要求是否满足?
Phase 9: CI/CD & DevOps
阶段9:CI/CD与DevOps
Evaluate Automation:
-
CI/CD Pipeline
- What tests run automatically?
- Deployment automation level?
- Code quality checks?
- Security scanning?
-
Development Workflow
- Pre-commit hooks?
- Code review process?
- Branch protection?
- Release process?
-
Infrastructure as Code
- Environment reproducibility?
- Configuration management?
- Deployment consistency?
评估自动化程度:
-
CI/CD流水线
- 自动运行哪些测试?
- 部署自动化水平如何?
- 代码质量检查?
- 安全扫描?
-
开发工作流
- 提交前钩子?
- 代码审查流程?
- 分支保护?
- 发布流程?
-
基础设施即代码
- 环境可复现性?
- 配置管理?
- 部署一致性?
Phase 10: Synthesis & Reporting
阶段10:综合与报告
Generate Comprehensive Report:
生成全面报告:
Report Structure
报告结构
markdown
undefinedmarkdown
undefinedRepository Analysis Report: [Repository Name]
代码仓库分析报告: [仓库名称]
Executive Summary
执行摘要
Repository: [Name/Path]
Primary Language: [Language]
Main Framework/Purpose: [Description]
Overall Health Score: [X/10]
Key Findings:
- [Finding 1]
- [Finding 2]
- [Finding 3]
Critical Issues: [Count]
Recommendations: [Count]
仓库: [名称/路径]
主要语言: [语言]
主要框架/用途: [描述]
整体健康评分: [X/10]
关键发现:
- [发现1]
- [发现2]
- [发现3]
关键问题: [数量]
建议: [数量]
1. Repository Overview
1. 仓库概述
Basic Information
基本信息
- Location: [Path]
- Git Remote: [URL if available]
- Last Updated: [Date]
- Total Files: [Count]
- Total Lines: [Estimate]
- 位置: [路径]
- Git远程仓库: [URL(如有)]
- 最后更新时间: [日期]
- 总文件数: [数量]
- 总行数: [估算值]
Purpose & Scope
用途与范围
[Description of what this repository does]
[该仓库的功能描述]
2. Technology Stack
2. 技术栈
Programming Languages
编程语言
| Language | Percentage | Files | Purpose |
|---|---|---|---|
| [Lang] | [X%] | [N] | [Desc] |
| 语言 | 占比 | 文件数 | 用途 |
|---|---|---|---|
| [语言] | [X%] | [N] | [描述] |
Major Dependencies
主要依赖项
Production:
- [Dependency 1] ([version]) - [Purpose]
- [Dependency 2] ([version]) - [Purpose]
Development:
- [Dependency 1] ([version]) - [Purpose]
- [Dependency 2] ([version]) - [Purpose]
生产环境:
- [依赖项1] ([版本]) - [用途]
- [依赖项2] ([版本]) - [用途]
开发环境:
- [依赖项1] ([版本]) - [用途]
- [依赖项2] ([版本]) - [用途]
Frameworks & Tools
框架与工具
- Frontend: [Frameworks]
- Backend: [Frameworks]
- Testing: [Frameworks]
- Build Tools: [Tools]
- CI/CD: [Tools]
- 前端: [框架]
- 后端: [框架]
- 测试: [框架]
- 构建工具: [工具]
- CI/CD: [工具]
3. Repository Structure
3. 仓库结构
Directory Organization
目录组织
repository/
├── [dir1]/ # [Purpose]
├── [dir2]/ # [Purpose]
└── [dir3]/ # [Purpose]repository/
├── [dir1]/ # [用途]
├── [dir2]/ # [用途]
└── [dir3]/ # [用途]Key Files
关键文件
- - [Purpose]
[file1] - - [Purpose]
[file2]
Structure Assessment: [Evaluation]
- - [用途]
[file1] - - [用途]
[file2]
结构评估: [评价]
4. Configuration Analysis
4. 配置分析
Configuration Files Found
已找到的配置文件
- [Config file 1] - [Quality: Good/Fair/Poor]
- [Config file 2] - [Quality: Good/Fair/Poor]
- [配置文件1] - [质量: 良好/一般/较差]
- [配置文件2] - [质量: 良好/一般/较差]
Configuration Quality
配置质量
Strengths:
- [Strength 1]
- [Strength 2]
Weaknesses:
- [Weakness 1]
- [Weakness 2]
优势:
- [优势1]
- [优势2]
不足:
- [不足1]
- [不足2]
Secret Management
密钥管理
[Assessment of how secrets are handled]
[密钥处理方式的评估]
5. Documentation Quality
5. 文档质量
Existing Documentation
现有文档
- README.md - [Quality score]
- CONTRIBUTING.md - [Missing/Present]
- Code comments - [Quality score]
- README.md - [质量评分]
- CONTRIBUTING.md - [缺失/存在]
- 代码注释 - [质量评分]
Documentation Assessment
文档评估
Coverage: [X/10]
Quality: [X/10]
Maintainability: [X/10]
Gaps Identified:
- [Gap 1]
- [Gap 2]
覆盖率: [X/10]
质量: [X/10]
可维护性: [X/10]
已识别的缺口:
- [缺口1]
- [缺口2]
6. Code Quality & Patterns
6. 代码质量与模式
Architectural Patterns
架构模式
[Identified patterns and their appropriateness]
[已识别的模式及其适用性]
Code Organization
代码组织
Rating: [X/10]
Strengths:
- [Strength 1]
Concerns:
- [Concern 1]
评分: [X/10]
优势:
- [优势1]
关注点:
- [关注点1]
Testing Strategy
测试策略
- Test Coverage: [Estimated %]
- Test Frameworks: [Frameworks]
- CI Integration: [Yes/No]
- 测试覆盖率: [估算百分比]
- 测试框架: [框架]
- CI集成: [是/否]
7. Dependencies & Security
7. 依赖项与安全
Dependency Health
依赖项健康状况
- Total Dependencies: [Count]
- Outdated: [Count]
- Security Vulnerabilities: [Count]
- 总依赖项数: [数量]
- 过时依赖项: [数量]
- 安全漏洞: [数量]
Dependency Management
依赖项管理
[Assessment of version locking, update strategy]
[版本锁定、更新策略的评估]
8. DevOps & Automation
8. DevOps与自动化
CI/CD Pipeline
CI/CD流水线
[Description of automation setup]
Automated Checks:
- Tests
- Linting
- Security scanning
- Build verification
[自动化设置的描述]
自动化检查项:
- 测试
- 代码检查
- 安全扫描
- 构建验证
Development Workflow
开发工作流
[Description of git workflow, hooks, etc.]
[Git工作流、钩子等的描述]
9. Best Practices Comparison
9. 最佳实践对比
Alignment with Industry Standards
与行业标准的对齐情况
| Practice | Current | Recommended | Gap |
|---|---|---|---|
| [Practice 1] | [Status] | [Standard] | [Description] |
| [Practice 2] | [Status] | [Standard] | [Description] |
| 实践 | 当前状态 | 推荐标准 | 差距 |
|---|---|---|---|
| [实践1] | [状态] | [标准] | [描述] |
| [实践2] | [状态] | [标准] | [描述] |
Context7 Insights
Context7洞察
[Findings from official documentation comparison]
[与官方文档对比的发现]
Web Research Findings
网页研究结果
[Insights from industry best practices research]
[行业最佳实践的研究洞察]
10. Recommendations
10. 建议
Critical (Fix Immediately)
紧急(立即修复)
- [Issue]
- Impact: [High/Medium/Low]
- Effort: [High/Medium/Low]
- Action: [Specific steps]
- [问题]
- 影响: 高/中/低
- 工作量: 高/中/低
- 行动: [具体步骤]
Important (Fix Soon)
重要(尽快修复)
- [Issue]
- Impact: [High/Medium/Low]
- Effort: [High/Medium/Low]
- Action: [Specific steps]
- [问题]
- 影响: 高/中/低
- 工作量: 高/中/低
- 行动: [具体步骤]
Nice to Have (Consider)
可选(考虑优化)
- [Issue]
- Impact: [High/Medium/Low]
- Effort: [High/Medium/Low]
- Action: [Specific steps]
- [问题]
- 影响: 高/中/低
- 工作量: 高/中/低
- 行动: [具体步骤]
11. Quick Wins
11. 快速优化项
[List of easy improvements with high impact]
- [Quick win 1] - [Estimated time: Xm]
- [Quick win 2] - [Estimated time: Xm]
[影响大、易实现的改进列表]
- [快速优化项1] - [预计耗时: X分钟]
- [快速优化项2] - [预计耗时: X分钟]
12. Technical Debt Assessment
12. 技术债务评估
Overall Technical Debt: [High/Medium/Low]
Areas of Concern:
- [Area 1]
- [Area 2]
Suggested Refactoring:
- [Refactoring 1]
- [Refactoring 2]
整体技术债务: 高/中/低
关注领域:
- [领域1]
- [领域2]
建议重构项:
- [重构项1]
- [重构项2]
13. Maintainability Score
13. 可维护性评分
| Aspect | Score | Notes |
|---|---|---|
| Code Organization | [X/10] | [Notes] |
| Documentation | [X/10] | [Notes] |
| Testing | [X/10] | [Notes] |
| Configuration | [X/10] | [Notes] |
| Dependencies | [X/10] | [Notes] |
| Overall | [X/10] |
| 维度 | 评分 | 备注 |
|---|---|---|
| 代码组织 | [X/10] | [备注] |
| 文档 | [X/10] | [备注] |
| 测试 | [X/10] | [备注] |
| 配置 | [X/10] | [备注] |
| 依赖项 | [X/10] | [备注] |
| 整体 | [X/10] |
14. Research Sources
14. 研究来源
Context7 Documentation Consulted
参考的Context7文档
- [Library 1] - [Topic]
- [Library 2] - [Topic]
- [库1] - [主题]
- [库2] - [主题]
Web Research Conducted
网页研究内容
- [Search query 1] - [Key finding]
- [Search query 2] - [Key finding]
- [搜索词1] - [关键发现]
- [搜索词2] - [关键发现]
Explore Agent Investigations
Explore Agent调查内容
- [Investigation 1] - [Finding]
- [Investigation 2] - [Finding]
- [调查1] - [发现]
- [调查2] - [发现]
15. Next Steps
15. 后续步骤
Immediate Actions
立即行动
- [Action 1]
- [Action 2]
- [行动1]
- [行动2]
Short-term (1-2 weeks)
短期(1-2周)
- [Action 1]
- [Action 2]
- [行动1]
- [行动2]
Long-term (1-3 months)
长期(1-3个月)
- [Action 1]
- [Action 2]
- [行动1]
- [行动2]
Appendix
附录
Full Technology List
完整技术列表
[Complete list of all technologies found]
[已发现的所有技术的完整列表]
All Configuration Files
所有配置文件
[Complete list with brief descriptions]
[带简要描述的完整列表]
Dependency Tree
依赖树
[If relevant and not too large]
Report Generated: [Date]
Analysis Duration: [Estimated time]
Claude Skills Used: repository-analyzer, deep-research (if applicable)
Tools Used: Explore agent, Context7, WebSearch, Read, Grep, Glob
undefined[如相关且不冗长]
报告生成时间: [日期]
分析耗时: [估算时间]
使用的Claude技能: repository-analyzer, deep-research(如适用)
使用的工具: Explore Agent, Context7, WebSearch, Read, Grep, Glob
undefinedExecution Strategy
执行策略
Parallel vs Sequential
并行与串行执行
Run in Parallel (when possible):
- Multiple Explore agent investigations (different aspects)
- Web searches for different technologies
- Context7 lookups for multiple libraries
Run Sequentially (when needed):
- Discovery first (need to know structure)
- Technology identification second (need to know what to research)
- Deep dives third (need context from earlier phases)
- Synthesis last (need all information)
尽可能并行执行:
- 多个Explore Agent调查(不同维度)
- 不同技术的网页搜索
- 多个库的Context7查询
需串行执行(必要时):
- 先完成发现阶段(需了解结构)
- 再进行技术识别(需明确研究对象)
- 然后进行深度分析(需前期阶段的上下文)
- 最后进行综合(需所有信息)
Time Management
时间管理
Estimated Duration:
- Small repository (< 100 files): 10-15 minutes
- Medium repository (100-1000 files): 15-30 minutes
- Large repository (> 1000 files): 30-60 minutes
Optimization:
- Use Explore agent efficiently (right thoroughness level)
- Don't read every file - sample strategically
- Focus on high-impact findings
- Prioritize actionable insights
预计耗时:
- 小型仓库(<100个文件):10-15分钟
- 中型仓库(100-1000个文件):15-30分钟
- 大型仓库(>1000个文件):30-60分钟
优化建议:
- 高效使用Explore Agent(选择合适的细致度)
- 无需读取每个文件——战略性抽样
- 聚焦高影响发现
- 优先提供可落地的洞察
Thoroughness Levels
细致度级别
Quick Audit (10 min):
- Phase 1-3 only
- Basic structure, tech stack, major issues
Standard Analysis (30 min):
- Phase 1-6
- Complete overview with recommendations
Deep Audit (60 min):
- All phases
- Comprehensive analysis with detailed recommendations
Custom Focus:
Ask user what aspects to prioritize if time is limited.
快速审计(10分钟):
- 仅执行阶段1-3
- 涵盖基本结构、技术栈、主要问题
标准分析(30分钟):
- 执行阶段1-6
- 完整概述+建议
深度审计(60分钟):
- 执行所有阶段
- 全面分析+详细建议
自定义聚焦:
若时间有限,询问用户需优先关注的维度。
Special Repository Types
特殊类型仓库
Dotfiles Repository (like chezmoi)
配置文件仓库(如chezmoi)
Focus on:
- File organization and chezmoi-specific patterns
- Template usage and variable management
- Secret management (age encryption, 1Password integration)
- Cross-platform compatibility
- Backup and restore strategies
- Documentation for setup
Key Files:
- ,
.chezmoi.toml.tmplchezmoi.toml - Template files (extension)
.tmpl - Encrypted files (extension)
.age - Scripts and hooks
- README and setup guides
重点关注:
- 文件组织与chezmoi特定模式
- 模板使用与变量管理
- 密钥管理(age加密、1Password集成)
- 跨平台兼容性
- 备份与恢复策略
- 安装文档
关键文件:
- ,
.chezmoi.toml.tmplchezmoi.toml - 模板文件(扩展名)
.tmpl - 加密文件(扩展名)
.age - 脚本与钩子
- README与安装指南
Monorepo
单体仓库
Focus on:
- Package/workspace organization
- Shared dependencies management
- Build orchestration
- Independent deployments
- Code sharing patterns
重点关注:
- 包/工作区组织
- 共享依赖项管理
- 构建编排
- 独立部署
- 代码共享模式
Library/Package
库/包仓库
Focus on:
- API design and documentation
- Versioning strategy
- Breaking changes handling
- Examples and usage guides
- Publishing workflow
重点关注:
- API设计与文档
- 版本控制策略
- 破坏性变更处理
- 示例与使用指南
- 发布流程
Web Application
Web应用仓库
Focus on:
- Frontend/backend separation
- State management
- Routing structure
- API design
- Performance optimization
- Security headers and practices
重点关注:
- 前后端分离
- 状态管理
- 路由结构
- API设计
- 性能优化
- 安全头与实践
Quality Checklist
质量检查清单
Before finalizing the report, verify:
- All major directories explored
- All configuration files identified
- Technology stack fully documented
- Context7 consulted for major technologies
- Web research conducted for best practices
- Specific, actionable recommendations provided
- Evidence cited for all claims
- Quick wins identified
- Critical issues highlighted
- Report is well-structured and readable
最终确定报告前,验证:
- 所有主要目录已探索
- 所有配置文件已识别
- 技术栈已完整记录
- 主要技术已咨询Context7
- 已进行最佳实践的网页研究
- 每个发现均配有建议
- 所有主张均有证据支持
- 已识别快速优化项
- 关键问题已突出显示
- 报告结构清晰、可读性强
Usage Examples
使用示例
Example 1: Analyze Current Repository
示例1:分析当前仓库
User: "Analyze this repository"
Claude:
- Runs to get location
pwd - Launches Explore agent (Phase 1)
- Identifies it's a chezmoi dotfiles repo
- Launches Phase 2 exploration for tech stack
- Uses Context7 for chezmoi documentation
- Web searches for dotfiles best practices
- Analyzes configuration quality
- Generates comprehensive report
用户: "分析这个仓库"
Claude:
- 运行获取位置
pwd - 启动Explore Agent(阶段1)
- 识别出这是chezmoi配置文件仓库
- 启动阶段2的技术栈探索
- 使用Context7获取chezmoi文档
- 网页搜索配置文件最佳实践
- 分析配置质量
- 生成全面报告
Example 2: Focus on Security
示例2:聚焦安全
User: "Audit the security configuration of this repository"
Claude:
- Focuses on Phase 5 (Configuration) and Phase 8 (Security)
- Searches for secret management patterns
- Checks for exposed credentials
- Evaluates dependency vulnerabilities
- Reviews CI/CD security
- Provides security-focused report
用户: "审计这个仓库的安全配置"
Claude:
- 聚焦阶段5(配置)与阶段8(安全)
- 搜索密钥管理模式
- 检查是否存在暴露的凭据
- 评估依赖项漏洞
- 审查CI/CD安全性
- 提供安全聚焦的报告
Example 3: Technology Stack Report
示例3:技术栈报告
User: "What technologies does this repository use?"
Claude:
- Runs Phase 2 (Technology Stack Analysis)
- Uses Explore agent to find all config files
- Parses package managers files
- Uses Context7 to get documentation for major libraries
- Provides structured technology report
用户: "这个仓库使用了哪些技术?"
Claude:
- 执行阶段2(技术栈分析)
- 使用Explore Agent查找所有配置文件
- 解析包管理器文件
- 使用Context7获取主要库的文档
- 提供结构化的技术报告
Tips for Effective Analysis
有效分析技巧
-
Start Broad, Then Deep
- Get the big picture first
- Then drill into specifics
-
Let Explore Agent Do the Work
- Don't manually grep every file
- Use appropriate thoroughness level
- Multiple focused explorations > one massive exploration
-
Context7 for Authority
- Official documentation is most reliable
- Use for major frameworks/libraries
- Compare repo's usage against official recommendations
-
Web Search for Trends
- Industry best practices
- Common pitfalls
- Recent developments (2025 standards)
-
Be Actionable
- Every finding should have a recommendation
- Prioritize by impact and effort
- Provide specific steps, not vague advice
-
Be Honest
- Acknowledge what you don't know
- State confidence levels
- Suggest areas for human expert review
-
先广后深
- 先掌握全局
- 再深入细节
-
让Explore Agent完成工作
- 不要手动grep每个文件
- 使用合适的细致度
- 多次聚焦探索 > 一次大规模探索
-
用Context7获取权威信息
- 官方文档最可靠
- 用于主要框架/库
- 对比仓库使用方式与官方建议
-
用网页搜索了解趋势
- 行业最佳实践
- 常见陷阱
- 最新发展(2025标准)
-
提供可落地的建议
- 每个发现都应配有建议
- 按影响与工作量排序
- 提供具体步骤,而非模糊建议
-
保持诚实
- 承认未知内容
- 说明置信度
- 建议需人工专家审查的领域
Notes
注意事项
- Scope Management: For very large repositories, ask user to specify focus areas
- Permissions: Some operations may require user approval (file reads, web searches)
- Time Awareness: Inform user of estimated duration upfront
- Iteration: Offer to deep-dive into specific areas after initial report
- Export: Offer to save report as markdown file in repository
- 范围管理: 对于超大型仓库,询问用户指定聚焦领域
- 权限: 部分操作可能需要用户批准(文件读取、网页搜索)
- 时间告知: 提前告知用户预计耗时
- 迭代: 初始报告后,可提供特定领域的深度分析
- 导出: 可将报告保存为markdown文件存入仓库