npx skills add https://github.com/posit-dev/skills --skill describe-design研究代码库并生成架构文档,描述功能或系统的工作原理。输出是一个为人类读者和未来 AI 代理组织的 Markdown 文件。
在探索之前理解需要记录的内容:
广泛探索代码库以建立心智模型。在可用时使用轻量级、快速的探索方法(例如,在 Claude Code 中,使用 Haiku Explore 子代理):
向用户呈现一个高级大纲:
## 建议大纲
1. [组件 A] - 简要描述
2. [组件 B] - 简要描述
3. [组件 C] - 简要描述
* 我是否正确捕捉了研究范围?回复 "yes" 以继续。
* 否则,请告诉我我误解了什么。
当用户确认范围后,继续进行深入研究。
对于已批准大纲中的每个组件:
尽量依赖初始代码探索来获取大部分信息。根据需要阅读其他文件。如果阶段 2 的范围发生了重大变化,可以启动第二个代码探索子代理。
当您能够做到以下事项时,就可以开始起草文档:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
表明您尚未完成的迹象:
表明您做得过度的迹象:
按照下面的模板生成文档。将草稿呈现给用户进行审查,并根据反馈进行迭代。如果可用,使用 AskUserQuestion 工具来请求用户对关键决策的输入。
docs/architecture/、ARCHITECTURE.md)提议一个路径,但切勿在未经用户明确确认位置的情况下写入文件。如果用户预先提供了路径,则视为已确认。以下模板提供了一个起点。根据要记录的功能进行调整——省略不适用的部分,为独特方面添加章节,并调整结构以最好地服务目标受众。
# [功能/系统名称] 架构
## 概述
[1-2 段总结此功能/系统的作用及其存在的原因]
## 架构图
```mermaid
flowchart TD
A[入口点] --> B[组件]
B --> C[数据存储]
```
## 组件
### [组件名称]
**目的**:[它的作用]
**位置**:`path/to/file.ext`
**关键函数**:
- `functionName()` - 简要描述
- `anotherFunction()` - 简要描述
**交互**:
- 接收来自:[组件] 的输入
- 发送输出到:[组件]
## 数据流
[描述数据如何通过系统流动,从输入到输出]
## 配置
[如何启用、禁用或配置功能。包括文件路径和环境变量。]
## 代码引用
| 组件 | 文件 | 关键符号 |
|-----------|------|-------------|
| 认证 | `src/auth/index.ts` | `authenticate()`、`AuthConfig` |
| 缓存 | `src/cache/redis.ts` | `CacheManager`、`invalidate()` |
## 术语表
| 术语 | 定义 |
|------|------------|
| [术语] | [项目特定定义] |
使用能够经受重构的稳定引用:
src/auth/login.ts)path/to/file.ext 并单独列出关键符号auth/ 中的 handleAuth 函数)避免:
使用 Mermaid 进行架构可视化:
流程图用于组件关系:
flowchart TD
A[客户端] --> B[API 网关]
B --> C[服务]
C --> D[(数据库)]
序列图用于请求流:
sequenceDiagram
Client->>API: 请求
API->>Service: 处理
Service-->>API: 响应
API-->>Client: 结果
保持图表专注于正在记录的特定功能。避免用不相关的组件使图表过于拥挤。
每周安装量
104
仓库
GitHub 星标数
205
首次出现
2026年2月10日
安全审计
安装于
opencode93
github-copilot92
codex91
cursor90
gemini-cli90
kimi-cli89
Research a codebase and produce an architectural document describing how features or systems work. The output is a markdown file organized for both human readers and future AI agents.
Understand what to document before exploring:
Explore the codebase broadly to build a mental model. Use lightweight, fast exploration methods when available (in Claude Code, for example, use a Haiku Explore subagent):
Present a high-level outline to the user:
## Proposed Outline
1. [Component A] - Brief description
2. [Component B] - Brief description
3. [Component C] - Brief description
* Have I correctly captured the scope of the research? Reply "yes" to continue.
* Otherwise, please let me know what I've misunderstood.
When the user confirms the scope, move on to deep research.
For each component in the approved outline:
Try to rely on the initial code exploration for much of this information. Read additional files as needed. If the scope changed considerably in Stage 2, you can engage a second code exploration subagent.
You're ready to draft when you can:
Signs you're not done:
Signs you've gone too far:
Generate the document following the template below. Present the draft to the user for review and iterate based on feedback. If available, use the AskUserQuestion tool to request user input on key decisions.
docs/architecture/, ARCHITECTURE.md), but NEVER write the file without explicit user confirmation of the location. If the user provided a path upfront, that counts as confirmation.The following template provides a starting point. Adapt it to fit the feature being documented — omit sections that don't apply, add sections for unique aspects, and adjust the structure to best serve the target audience.
# [Feature/System Name] Architecture
## Overview
[1-2 paragraph summary of what this feature/system does and why it exists]
## Architecture Diagram
```mermaid
flowchart TD
A[Entry Point] --> B[Component]
B --> C[Data Store]
```
## Components
### [Component Name]
**Purpose**: [What it does]
**Location**: `path/to/file.ext`
**Key Functions**:
- `functionName()` - Brief description
- `anotherFunction()` - Brief description
**Interactions**:
- Receives input from: [Component]
- Sends output to: [Component]
## Data Flow
[Description of how data moves through the system, from input to output]
## Configuration
[How features are enabled, disabled, or configured. Include file paths and
environment variables.]
## Code References
| Component | File | Key Symbols |
|-----------|------|-------------|
| Auth | `src/auth/index.ts` | `authenticate()`, `AuthConfig` |
| Cache | `src/cache/redis.ts` | `CacheManager`, `invalidate()` |
## Glossary
| Term | Definition |
|------|------------|
| [Term] | [Project-specific definition] |
Use stable references that survive refactoring:
src/auth/login.ts)path/to/file.ext with key symbols listed separatelyhandleAuth function in auth/)Avoid:
Use Mermaid for architecture visualizations:
Flowcharts for component relationships:
flowchart TD
A[Client] --> B[API Gateway]
B --> C[Service]
C --> D[(Database)]
Sequence diagrams for request flows:
sequenceDiagram
Client->>API: Request
API->>Service: Process
Service-->>API: Response
API-->>Client: Result
Keep diagrams focused on the specific feature being documented. Avoid overcrowding with unrelated components.
Weekly Installs
104
Repository
GitHub Stars
205
First Seen
Feb 10, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode93
github-copilot92
codex91
cursor90
gemini-cli90
kimi-cli89
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
157,400 周安装