repowiki
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRepoWiki - Repository Report Generator
RepoWiki - 仓库报告生成工具
Generate a DeepWiki-style in-depth analysis report based on the current repository's code structure, configuration files, and dependency relationships.
基于当前仓库的代码结构、配置文件和依赖关系,生成DeepWiki风格的深度分析报告。
Report Structure Specification
报告结构规范
The generated report must strictly follow the layered structure below, output as a single Markdown file.
生成的报告必须严格遵循以下分层结构,输出为单个Markdown文件。
Layer 1: Project Overview
第一层:项目概述
markdown
undefinedmarkdown
undefined{Project Name}
{项目名称}
{One-line project positioning description}
{一句话项目定位描述}
Purpose & Scope
目标与范围
{2-3 paragraphs describing what problem the project solves, core value, target users}
{2-3段文字,描述项目解决的问题、核心价值、目标用户}
Tech Stack
技术栈
| Category | Technology | Purpose |
|---|---|---|
| Language | ... | ... |
| Framework | ... | ... |
| Build Tool | ... | ... |
| Testing | ... | ... |
| Database | ... | ... |
| 类别 | 技术 | 用途 |
|---|---|---|
| 编程语言 | ... | ... |
| 框架 | ... | ... |
| 构建工具 | ... | ... |
| 测试工具 | ... | ... |
| 数据库 | ... | ... |
Repository Structure
仓库结构
{Mermaid graph showing top-level directory structure and module relationships}
{Mermaid图表展示顶层目录结构与模块关系}
Core Systems Overview
核心系统概览
{Mermaid graph showing interactions between major subsystems}
undefined{Mermaid图表展示主要子系统间的交互关系}
undefinedLayer 2: Module & Package Analysis
第二层:模块与包分析
markdown
undefinedmarkdown
undefinedModule Inventory
模块清单
| Module | Path | Responsibility | Key Dependencies |
|---|---|---|---|
| ... | ... | ... | ... |
| 模块 | 路径 | 职责 | 核心依赖 |
|---|---|---|---|
| ... | ... | ... | ... |
Module Dependency Architecture
模块依赖架构
{Mermaid graph: inter-module dependency diagram}
{Mermaid图表:模块间依赖关系图}
{Module Name} Detailed Analysis
{模块名称} 详细分析
<details>
<summary>Related Source Files</summary>
path/to/file1.tspath/to/file2.ts
<details>
<summary>相关源文件</summary>
path/to/file1.tspath/to/file2.ts
Responsibilities & Boundaries
职责与边界
{What this module is and isn't responsible for}
{该模块负责和不负责的内容}
Internal Architecture
内部架构
{Mermaid graph: class/function relationships within the module}
{Mermaid图表:模块内的类/函数关系}
Key Interfaces
核心接口
{Code block: main exported APIs, type definitions, interfaces}
{代码块:主要导出的API、类型定义、接口}
Data Flow
数据流
{Mermaid sequence/flowchart: how data flows within the module}
undefined{Mermaid时序图/流程图:模块内的数据流转方式}
undefinedLayer 3: Core System Deep Analysis
第三层:核心系统深度分析
Generate an independent section for each core system:
markdown
undefined为每个核心系统生成独立章节:
markdown
undefined{System Name}
{系统名称}
<details>
<summary>Related Source Files</summary>
path/to/relevant/file.ts
<details>
<summary>相关源文件</summary>
path/to/relevant/file.ts
Purpose & Scope
目标与范围
{Description of the system's responsibilities}
{描述该系统的职责}
System Architecture
系统架构
{Mermaid graph: overall architecture diagram of the system}
{Mermaid图表:系统整体架构图}
Core Workflows
核心工作流
{Mermaid sequence diagram: main business processes}
{Mermaid时序图:主要业务流程}
Key Components
核心组件
| Component | File | Responsibility |
|---|---|---|
| ... | ... | ... |
| 组件 | 文件 | 职责 |
|---|---|---|
| ... | ... | ... |
Configuration & Extension Points
配置与扩展点
{Code block: key configuration file snippets}
{代码块:关键配置文件片段}
Design Decisions
设计决策
{Why it was designed this way, what trade-offs were made}
undefined{为何如此设计,做出了哪些权衡}
undefinedLayer 4: Infrastructure & Toolchain
第四层:基础设施与工具链
markdown
undefinedmarkdown
undefinedBuild System
构建系统
Build Pipeline
构建流水线
{Mermaid flowchart: complete process from source to artifacts}
{Mermaid流程图:从源码到产物的完整流程}
Build Configuration
构建配置
{Table: key build configuration items}
{表格:关键构建配置项}
Testing Infrastructure
测试基础设施
Testing Strategy
测试策略
| Test Type | Tool | Coverage |
|---|---|---|
| Unit Tests | ... | ... |
| Integration Tests | ... | ... |
| E2E Tests | ... | ... |
| 测试类型 | 工具 | 覆盖率 |
|---|---|---|
| 单元测试 | ... | ... |
| 集成测试 | ... | ... |
| 端到端测试 | ... | ... |
Test Configuration
测试配置
{Code block: key test configuration file snippets}
{代码块:关键测试配置文件片段}
CI/CD Pipeline
CI/CD流水线
{Mermaid flowchart: CI/CD process}
{Mermaid流程图:CI/CD流程}
Dependency Management
依赖管理
Key Dependencies
核心依赖
| Dependency | Version | Purpose |
|---|---|---|
| ... | ... | ... |
| 依赖 | 版本 | 用途 |
|---|---|---|
| ... | ... | ... |
Dependency Strategy
依赖策略
{Version locking, update strategy, security auditing}
undefined{版本锁定、更新策略、安全审计}
undefinedMermaid Diagram Specifications
Mermaid图表规范
Each report must include the following types of diagrams:
每份报告必须包含以下类型的图表:
1. Repository Structure Diagram (Required)
1. 仓库结构图表(必填)
mermaid
graph TD
Root[Project Root]
Root --> Src[src/]
Root --> Config[Configuration]
Root --> Tests[tests/]
Src --> Core[core/]
Src --> Utils[utils/]
Src --> Types[types/]mermaid
graph TD
Root[Project Root]
Root --> Src[src/]
Root --> Config[Configuration]
Root --> Tests[tests/]
Src --> Core[core/]
Src --> Utils[utils/]
Src --> Types[types/]2. Module Dependency Diagram (Required)
2. 模块依赖图表(必填)
mermaid
graph LR
A[Module A] --> B[Module B]
A --> C[Module C]
B --> D[Module D]
C --> Dmermaid
graph LR
A[Module A] --> B[Module B]
A --> C[Module C]
B --> D[Module D]
C --> D3. Core Workflow Diagram (Required)
3. 核心工作流图表(必填)
mermaid
sequenceDiagram
participant User
participant API
participant Service
participant DB
User->>API: Request
API->>Service: Process
Service->>DB: Query
DB-->>Service: Result
Service-->>API: Response
API-->>User: Returnmermaid
sequenceDiagram
participant User
participant API
participant Service
participant DB
User->>API: Request
API->>Service: Process
Service->>DB: Query
DB-->>Service: Result
Service-->>API: Response
API-->>User: Return4. Data Flow Diagram (As Needed)
4. 数据流图表(按需添加)
mermaid
flowchart LR
Input[Input] --> Validate[Validate]
Validate --> Transform[Transform]
Transform --> Process[Process]
Process --> Output[Output]mermaid
flowchart LR
Input[Input] --> Validate[Validate]
Validate --> Transform[Transform]
Transform --> Process[Process]
Process --> Output[Output]5. State/Lifecycle Diagram (As Needed)
5. 状态/生命周期图表(按需添加)
mermaid
stateDiagram-v2
[*] --> Created
Created --> Active
Active --> Paused
Paused --> Active
Active --> Completed
Completed --> [*]mermaid
stateDiagram-v2
[*] --> Created
Created --> Active
Active --> Paused
Paused --> Active
Active --> Completed
Completed --> [*]Analysis Execution Flow
分析执行流程
Step 1: Collect Repository Metadata
第一步:收集仓库元数据
Use the following tools to gather information (execute in parallel):
- Directory Structure - Use Glob to scan for the complete file tree
**/* - Package Management - Read ,
package.json,go.mod,Cargo.toml,pyproject.toml, etc.pom.xml - Configuration Files - Read ,
tsconfig.json,.eslintrc.*,vite.config.*, etc.webpack.config.* - CI/CD - Read ,
.github/workflows/*,.gitlab-ci.yml, etc.Dockerfile - Git History - Get file change frequency from the last 100 commits
使用以下工具收集信息(并行执行):
- 目录结构 - 使用Glob扫描获取完整文件树
**/* - 包管理 - 读取、
package.json、go.mod、Cargo.toml、pyproject.toml等pom.xml - 配置文件 - 读取、
tsconfig.json、.eslintrc.*、vite.config.*等webpack.config.* - CI/CD配置 - 读取、
.github/workflows/*、.gitlab-ci.yml等Dockerfile - Git历史 - 从最近100次提交中获取文件变更频率
Step 2: Identify Core Systems
第二步:识别核心系统
Determine core systems based on the following signals:
| Signal | Weight | Method |
|---|---|---|
| File change frequency | High | git log statistics |
| Directory size | Medium | File count |
| Entry file references | High | grep import/require |
| README mentions | Medium | Read documentation |
| Export count | Medium | grep export |
根据以下信号确定核心系统:
| 信号 | 权重 | 方法 |
|---|---|---|
| 文件变更频率 | 高 | git日志统计 |
| 目录大小 | 中 | 文件数量统计 |
| 入口文件引用 | 高 | grep查找import/require语句 |
| README提及 | 中 | 读取文档内容 |
| 导出数量 | 中 | grep查找export语句 |
Step 3: Deep Analysis of Each System
第三步:深度分析每个系统
For each core system, perform:
- Read all files in that directory
- Identify main class, function, and type definitions
- Trace import/export dependency chains
- Identify design patterns (Repository, Factory, Observer, etc.)
- Extract key configurations and constants
对每个核心系统执行以下操作:
- 读取该目录下的所有文件
- 识别主要类、函数和类型定义
- 追踪导入/导出依赖链
- 识别设计模式(仓库模式、工厂模式、观察者模式等)
- 提取关键配置与常量
Step 4: Generate Mermaid Diagrams
第四步:生成Mermaid图表
Based on the analysis results, generate:
- At least 1 architecture overview diagram
- At least 1 module dependency diagram
- At least 1 core workflow sequence diagram
- Add state diagrams and data flow diagrams as needed
基于分析结果生成:
- 至少1张架构概览图
- 至少1张模块依赖图
- 至少1张核心工作流时序图
- 按需添加状态图与数据流图
Step 5: Assemble Report
第五步:组装报告
Assemble the complete report according to the structure specification above, output to .
REPOWIKI.md按照上述结构规范组装完整报告,输出到。
REPOWIKI.mdSource File Reference Specification
源文件引用规范
Each section must include collapsible source file references:
markdown
<details>
<summary>Related Source Files</summary>
- `src/core/engine.ts` - Core engine implementation
- `src/core/types.ts` - Type definitions
- `src/config/default.ts` - Default configuration
</details>Reference rules:
- Only reference files directly related to the current section
- Each reference includes a brief description
- Sort by importance, most critical files first
- 3-10 referenced files per section
每个章节必须包含可折叠的源文件引用:
markdown
<details>
<summary>相关源文件</summary>
- `src/core/engine.ts` - 核心引擎实现
- `src/core/types.ts` - 类型定义
- `src/config/default.ts` - 默认配置
</details>引用规则:
- 仅引用与当前章节直接相关的文件
- 每个引用包含简短描述
- 按重要性排序,最关键的文件排在前面
- 每个章节引用3-10个文件
Table Usage Specification
表格使用规范
Tables must be used in the following scenarios:
- Tech Stack - Inventory of languages, frameworks, and tools
- Module Inventory - Paths, responsibilities, and dependencies of all modules
- Configuration Comparison - Configuration differences across environments/modes
- API Inventory - Methods, parameters, and return values of public APIs
- Dependency Inventory - Versions and purposes of key dependencies
以下场景必须使用表格:
- 技术栈 - 编程语言、框架与工具清单
- 模块清单 - 所有模块的路径、职责与依赖
- 配置对比 - 不同环境/模式下的配置差异
- API清单 - 公共API的方法、参数与返回值
- 依赖清单 - 核心依赖的版本与用途
Output Requirements
输出要求
- Filename: , placed in the repository root
REPOWIKI.md - Language: Match the user's conversation language (Chinese conversation = Chinese report)
- Length:
- Small projects (<50 files): 800-1500 lines
- Medium projects (50-200 files): 1500-3000 lines
- Large projects (>200 files): 3000-6000 lines
- Diagram count: At least 3 Mermaid diagrams, 6-10 for large projects
- Table count: At least 3 tables
- Code blocks: Key configurations and interface definitions, no more than 30 lines each
- 文件名:,放置在仓库根目录
REPOWIKI.md - 语言:匹配用户对话语言(中文对话=中文报告)
- 长度:
- 小型项目(<50个文件):800-1500行
- 中型项目(50-200个文件):1500-3000行
- 大型项目(>200个文件):3000-6000行
- 图表数量:至少3张Mermaid图表,大型项目6-10张
- 表格数量:至少3张表格
- 代码块:关键配置与接口定义,每个不超过30行
Quality Checklist
质量检查清单
After generating the report, verify the following items:
- Contains project overview and one-line positioning
- Tech stack table is complete and accurate
- Repository structure Mermaid diagram matches reality
- Each core system has an independent section
- Each section has collapsible source file references
- Module dependency diagram correctly reflects actual dependencies
- At least one sequence diagram shows core workflows
- All tables are correctly formatted with accurate content
- Code block syntax highlighting is correct
- No fabricated files or modules
- Mermaid diagram syntax is correct and renderable
生成报告后,验证以下项目:
- 包含项目概述与一句话定位
- 技术栈表格完整准确
- 仓库结构Mermaid图表与实际一致
- 每个核心系统有独立章节
- 每个章节有可折叠的源文件引用
- 模块依赖图正确反映实际依赖关系
- 至少有一张时序图展示核心工作流
- 所有表格格式正确、内容准确
- 代码块语法高亮正确
- 无虚构文件或模块
- Mermaid图表语法正确可渲染
Example Snippet
示例片段
Below is a report snippet example for a TypeScript web project:
markdown
undefined以下是TypeScript Web项目的报告片段示例:
markdown
undefinedMyApp
MyApp
A full-stack e-commerce platform built on Next.js, supporting multi-tenancy and real-time inventory management.
基于Next.js构建的全栈电商平台,支持多租户与实时库存管理。
Purpose & Scope
目标与范围
MyApp is an e-commerce SaaS platform for small and medium-sized merchants. It provides
product management, order processing, payment integration, and real-time inventory
synchronization as core features. The project uses Next.js App Router architecture,
Prisma as the ORM, and PostgreSQL as the primary database.
MyApp是面向中小商家的电商SaaS平台,提供商品管理、订单处理、支付集成与实时库存同步等核心功能。项目采用Next.js App Router架构,Prisma作为ORM,PostgreSQL作为主数据库。
Tech Stack
技术栈
| Category | Technology | Purpose |
|---|---|---|
| Language | TypeScript 5.3 | Full-stack development language |
| Framework | Next.js 14 | Full-stack React framework |
| ORM | Prisma 5.8 | Database access layer |
| Database | PostgreSQL 16 | Primary data storage |
| Cache | Redis 7 | Session and hot data caching |
| Testing | Vitest + Playwright | Unit and E2E testing |
| 类别 | 技术 | 用途 |
|---|---|---|
| 编程语言 | TypeScript 5.3 | 全栈开发语言 |
| 框架 | Next.js 14 | 全栈React框架 |
| ORM | Prisma 5.8 | 数据库访问层 |
| 数据库 | PostgreSQL 16 | 主数据存储 |
| 缓存 | Redis 7 | 会话与热点数据缓存 |
| 测试 | Vitest + Playwright | 单元与端到端测试 |
Repository Structure
仓库结构
mermaid
graph TD
Root["myapp/"]
Root --> App["app/ - Next.js App Router"]
Root --> Lib["lib/ - Shared Business Logic"]
Root --> Components["components/ - UI Components"]
Root --> Prisma["prisma/ - Database Schema"]
Root --> Tests["tests/ - Test Files"]
App --> API["api/ - API Routes"]
App --> Pages["(routes)/ - Pages"]
Lib --> Services["services/ - Business Services"]
Lib --> Utils["utils/ - Utility Functions"]mermaid
graph TD
Root["myapp/"]
Root --> App["app/ - Next.js App Router"]
Root --> Lib["lib/ - 共享业务逻辑"]
Root --> Components["components/ - UI组件"]
Root --> Prisma["prisma/ - 数据库Schema"]
Root --> Tests["tests/ - 测试文件"]
App --> API["api/ - API路由"]
App --> Pages["(routes)/ - 页面"]
Lib --> Services["services/ - 业务服务"]
Lib --> Utils["utils/ - 工具函数"]Core Systems Overview
核心系统概览
mermaid
graph LR
Client["Client"] --> AppRouter["App Router"]
AppRouter --> Auth["Auth System"]
AppRouter --> API["API Layer"]
API --> OrderService["Order Service"]
API --> ProductService["Product Service"]
API --> PaymentService["Payment Service"]
OrderService --> DB["PostgreSQL"]
ProductService --> DB
ProductService --> Cache["Redis"]
PaymentService --> Stripe["Stripe API"]mermaid
graph LR
Client["客户端"] --> AppRouter["App Router"]
AppRouter --> Auth["认证系统"]
AppRouter --> API["API层"]
API --> OrderService["订单服务"]
API --> ProductService["商品服务"]
API --> PaymentService["支付服务"]
OrderService --> DB["PostgreSQL"]
ProductService --> DB
ProductService --> Cache["Redis"]
PaymentService --> Stripe["Stripe API"]Order System
订单系统
<details>
<summary>Related Source Files</summary>
- - Order service core logic
lib/services/order.ts - - Order API routes
app/api/orders/route.ts - - Order data model
prisma/schema.prisma - - Order data validation
lib/validators/order.ts - - Order form component
components/order/OrderForm.tsx
<details>
<summary>相关源文件</summary>
- - 订单服务核心逻辑
lib/services/order.ts - - 订单API路由
app/api/orders/route.ts - - 订单数据模型
prisma/schema.prisma - - 订单数据校验
lib/validators/order.ts - - 订单表单组件
components/order/OrderForm.tsx
Purpose & Scope
目标与范围
The order system manages the complete order lifecycle from shopping cart to payment completion.
This includes order creation, inventory locking, payment processing, status transitions, and notification delivery.
订单系统管理从购物车到支付完成的完整订单生命周期,包括订单创建、库存锁定、支付处理、状态流转与通知推送。
Order Lifecycle
订单生命周期
mermaid
stateDiagram-v2
[*] --> Created: User places order
Created --> Paying: Initiate payment
Paying --> Paid: Payment successful
Paying --> Cancelled: Payment timeout/failure
Paid --> Shipping: Merchant ships
Shipping --> Completed: Delivery confirmed
Completed --> [*]
Cancelled --> [*]undefinedmermaid
stateDiagram-v2
[*] --> Created: 用户下单
Created --> Paying: 发起支付
Paying --> Paid: 支付成功
Paying --> Cancelled: 支付超时/失败
Paid --> Shipping: 商家发货
Shipping --> Completed: 确认收货
Completed --> [*]
Cancelled --> [*]undefinedLanguage/Framework Adaptation
语言/框架适配
Adjust analysis focus based on project type:
| Project Type | Analysis Focus |
|---|---|
| Node.js/TypeScript | package.json, tsconfig, module exports |
| Go | go.mod, package structure, interface definitions |
| Python | pyproject.toml, package structure, class hierarchy |
| Rust | Cargo.toml, crate structure, trait definitions |
| Java/Kotlin | pom.xml/build.gradle, package structure, class hierarchy |
| Monorepo | workspace config, inter-package dependencies, build order |
| Frontend SPA | routing structure, state management, component tree |
| Backend API | route definitions, middleware chain, data models |
| CLI Tool | command structure, argument parsing, subcommands |
根据项目类型调整分析重点:
| 项目类型 | 分析重点 |
|---|---|
| Node.js/TypeScript | package.json、tsconfig、模块导出 |
| Go | go.mod、包结构、接口定义 |
| Python | pyproject.toml、包结构、类层级 |
| Rust | Cargo.toml、 crate结构、 trait定义 |
| Java/Kotlin | pom.xml/build.gradle、包结构、类层级 |
| 单体仓库 | 工作区配置、包间依赖、构建顺序 |
| 前端SPA | 路由结构、状态管理、组件树 |
| 后端API | 路由定义、中间件链、数据模型 |
| CLI工具 | 命令结构、参数解析、子命令 |