SuperAPI AI Directory

repo-analyzer

Coding & development

View repository

Updated 10-16 01:37

About this skill

Code Repository Deep Analyzer

Help users quickly understand the overall architecture and core logic of an unfamiliar code repository, conducting in-depth analysis from the perspective of a first-time developer.

Core Principles:

  1. Parallel subagent processing - Use multiple subagents to analyze different dimensions in parallel, avoiding blowing up the main agent's context
  2. Code snippets first - Output core code snippets and file paths so users can locate them directly
  3. Process-driven - Explain clearly how the project runs from a process perspective

Trigger Scenarios

  • "Deeply research the xxx project"
  • "Help me analyze this code repository"
  • "Understand this project's architecture"
  • "Analyze the github.com/user/repo repository"
  • "I want to quickly get started with this project"

Analysis Modes

Mode Number of Subagents Estimated Time Applicable Scenarios
Quick 3-4 2-3 minutes Quickly understand the project
Standard 5-6 5-8 minutes Daily analysis [default]
Deep 7-8 10-15 minutes In-depth understanding of important projects
UltraDeep 9-10 20-30 minutes Comprehensive mastery of core projects

Execution Flow

Phase 1: Project Discovery (DISCOVERY)

Goal: Obtain the code repository, identify the project type and tech stack

Activities:

  1. Clone the repository based on the GitHub address, or use a local directory
  2. Scan the project root directory to identify the tech stack
  3. Read README, CLAUDE.md, and other documentation

Tech Stack Identification:

File Tech Stack
package.json Node.js/JavaScript/TypeScript
requirements.txt / pyproject.toml Python
pom.xml / build.gradle Java
go.mod Go
Cargo.toml Rust

Output: Create a working directory <project>/docs/analysis-temp/


Phase 2: Parallel Analysis (PARALLEL ANALYSIS)

Key: Use the Agent tool to launch multiple subagents in parallel, each focusing on one dimension

Standard mode launches 6 subagents:

[单个消息中并行启动所有 subagent]
- Agent(subagent_type="Explore", description="分析项目结构", prompt="...")
- Agent(subagent_type="Explore", description="分析启动流程", prompt="...")
- Agent(subagent_type="Explore", description="分析核心业务流程", prompt="...")
- Agent(subagent_type="Explore", description="分析数据模型", prompt="...")
- Agent(subagent_type="Explore", description="分析依赖关系", prompt="...")
- Agent(subagent_type="Explore", description="分析配置系统", prompt="...")

Subagent Prompt Template:

Each subagent's prompt uses the following format:

你是一个{分析领域}专家。

## 任务要求
请阅读以下规范文件,按要求分析项目:
{SKILL_PATH}/reference/subagents/{分析器名称}.md

## 项目路径
{PROJECT_PATH}

## 输出要求
- 输出 JSON 格式结果
- 包含代码片段、文件路径、行号
- 包含 Mermaid 图表代码

Subagent and Specification File Correspondence:

Subagent Specification File
Project Structure Analysis reference/subagents/structure-analyzer.md
Startup Flow Analysis reference/subagents/startup-analyzer.md
Business Process Analysis reference/subagents/business-flow-analyzer.md
Data Model Analysis reference/subagents/data-model-analyzer.md
Dependency Relationship Analysis reference/subagents/dependency-analyzer.md
Configuration System Analysis reference/subagents/config-analyzer.md

Phase 3: Result Aggregation (AGGREGATION)

Goal: Collect the analysis results of all subagents

Activities:

  1. Wait for all subagents to complete
  2. Read each subagent's output
  3. Merge into a unified analysis result

Phase 4: Report Generation (REPORT GENERATION)

Key: Generate the report progressively, writing each chapter separately

Chapter generation order (each appended using Edit):

  1. Report Header and Project Overview
  2. Quick Start Guide
  3. Startup Process Detailed Explanation
  4. Core Business Processes
  5. Module Details
  6. Data Model
  7. Configuration Instructions
  8. Dependency Analysis
  9. Summary

Report Template: Reference reference/report-template.md

Quality Standards: Reference reference/quality-standards.md


Reference Files

File Purpose
reference/subagents/structure-analyzer.md Project Structure Analysis Specification
reference/subagents/startup-analyzer.md Startup Process Analysis Specification
reference/subagents/business-flow-analyzer.md Business Process Analysis Specification
reference/subagents/data-model-analyzer.md Data Model Analysis Specification
reference/subagents/dependency-analyzer.md Dependency Relationship Analysis Specification
reference/subagents/config-analyzer.md Configuration System Analysis Specification
reference/report-template.md Report Template
reference/quality-standards.md Quality Standards Checklist

Output Requirements

Project Requirements
File Name repo-analysis-YYYYMMDD.md
Location <项目根目录>/docs/
Temporary File <项目根目录>/docs/analysis-temp/