npx skills add https://github.com/jezweb/claude-skills --skill project-docs通过分析代码库生成结构化的项目文档。生成的文档反映实际代码,而非理想化的架构。
扫描项目根目录以确定项目类型:
| 指示器 | 项目类型 |
|---|---|
wrangler.jsonc / wrangler.toml | Cloudflare Worker |
vite.config.ts + src/App.tsx | React 单页应用 |
astro.config.mjs |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| Astro 站点 |
next.config.js | Next.js 应用 |
package.json 中包含 hono | Hono API |
src/index.ts 中包含 Hono | API 服务器 |
drizzle.config.ts | 包含数据库层 |
schema.ts 或 schema/ 目录 | 包含数据库模式 |
pyproject.toml / setup.py | Python 项目 |
Cargo.toml | Rust 项目 |
我应该生成哪些文档?
1. ARCHITECTURE.md — 系统概览、技术栈、目录结构、关键流程
2. API_ENDPOINTS.md — 路由、方法、参数、响应结构、认证
3. DATABASE_SCHEMA.md — 数据表、关系、迁移、索引
4. 以上全部
仅提供与项目匹配的文档。对于静态站点,不提供 API_ENDPOINTS.md。如果没有数据库,则不提供 DATABASE_SCHEMA.md。
针对每个请求的文档,读取相关的源文件:
ARCHITECTURE.md — 扫描:
package.json / pyproject.toml (技术栈、依赖项)src/index.ts, src/main.tsx, src/App.tsx)wrangler.jsonc, vite.config.ts, tsconfig.json)API_ENDPOINTS.md — 扫描:
src/routes/, src/api/, 或 index 文件中的内联路由)DATABASE_SCHEMA.md — 扫描:
src/db/schema.ts, src/schema/)drizzle/, migrations/)将每个文档写入 docs/ 目录 (如果目录不存在则创建)。如果项目已存在文档,提供更新选项而非直接覆盖。
对于没有 docs/ 目录的小型项目,则写入项目根目录。
# 架构
## 概述
[一段话:描述项目功能和结构]
## 技术栈
| 层 | 技术 | 版本 |
|-------|-----------|---------|
| 运行时 | [例如:Cloudflare Workers] | — |
| 框架 | [例如:Hono] | [版本] |
| 数据库 | [例如:D1 (SQLite)] | — |
| ORM | [例如:Drizzle] | [版本] |
| 前端 | [例如:React 19] | [版本] |
| 样式 | [例如:Tailwind v4] | [版本] |
## 目录结构
[带注释的树状结构 — 前 2 级目录及其用途说明]
## 关键流程
### [流程 1:例如“用户认证”]
[逐步说明:请求 → 中间件 → 处理器 → 数据库 → 响应]
### [流程 2:例如“数据处理管道”]
[贯穿系统的逐步说明]
## 配置
[关键配置文件及其控制内容]
## 部署
[如何部署、所需环境变量、构建命令]
# API 端点
## 基础 URL
[例如:`https://api.example.com` 或相对路径 `/api`]
## 认证
[方法:Bearer 令牌、会话 Cookie、API 密钥、无]
[令牌来源、获取方式]
## 端点
### [分组:例如 用户]
#### `GET /api/users`
- **认证**: 必需
- **参数**: `?page=1&limit=20`
- **响应**: `{ users: User[], total: number }`
#### `POST /api/users`
- **认证**: 必需 (管理员)
- **请求体**: `{ name: string, email: string }`
- **响应**: `{ user: User }` (201)
- **错误**: 400 (验证失败), 409 (邮箱重复)
[为每个端点重复此格式]
## 错误格式
[标准错误响应结构]
## 速率限制
[如果适用]
# 数据库模式
## 引擎
[例如:Cloudflare D1 (SQLite)、PostgreSQL、MySQL]
## 数据表
### `users`
| 列名 | 类型 | 约束 | 描述 |
|--------|------|-------------|-------------|
| id | TEXT | 主键 | UUID |
| email | TEXT | 唯一, 非空 | 用户邮箱 |
| name | TEXT | 非空 | 显示名称 |
| created_at | TEXT | 非空, 默认值 now | ISO 时间戳 |
### `posts`
[相同格式]
## 关系
[外键、连接模式、级联规则]
## 索引
[非主键索引及其存在原因]
## 迁移
- 生成: `npx drizzle-kit generate`
- 本地应用: `npx wrangler d1 migrations apply DB --local`
- 远程应用: `npx wrangler d1 migrations apply DB --remote`
## 种子数据
[如果存在种子脚本,请引用]
<!-- TODO: 记录用途 --> 标记如果文档已存在:
切勿静默覆盖用户添加到其文档中的自定义内容。
每周安装数
157
代码仓库
GitHub 星标数
643
首次出现
10 天前
安全审计
安装于
cursor151
gemini-cli150
opencode150
github-copilot150
cline150
amp149
Generate structured project documentation by analysing the codebase. Produces docs that reflect the actual code , not aspirational architecture.
Scan the project root to determine what kind of project this is:
| Indicator | Project Type |
|---|---|
wrangler.jsonc / wrangler.toml | Cloudflare Worker |
vite.config.ts + src/App.tsx | React SPA |
astro.config.mjs | Astro site |
next.config.js | Next.js app |
package.json with hono | Hono API |
src/index.ts with Hono | API server |
drizzle.config.ts | Has database layer |
schema.ts or schema/ | Has database schema |
pyproject.toml / setup.py | Python project |
Cargo.toml | Rust project |
Which docs should I generate?
1. ARCHITECTURE.md — system overview, stack, directory structure, key flows
2. API_ENDPOINTS.md — routes, methods, params, response shapes, auth
3. DATABASE_SCHEMA.md — tables, relationships, migrations, indexes
4. All of the above
Only offer docs that match the project. Don't offer API_ENDPOINTS.md for a static site. Don't offer DATABASE_SCHEMA.md if there's no database.
For each requested doc, read the relevant source files:
ARCHITECTURE.md — scan:
package.json / pyproject.toml (stack, dependencies)src/index.ts, src/main.tsx, src/App.tsx)wrangler.jsonc, vite.config.ts, tsconfig.json)API_ENDPOINTS.md — scan:
src/routes/, src/api/, or inline in index)DATABASE_SCHEMA.md — scan:
src/db/schema.ts, src/schema/)drizzle/, migrations/)Write each doc to docs/ (create the directory if it doesn't exist). If the project already has docs there, offer to update rather than overwrite.
For small projects with no docs/ directory, write to the project root instead.
# Architecture
## Overview
[One paragraph: what this project does and how it's structured]
## Stack
| Layer | Technology | Version |
|-------|-----------|---------|
| Runtime | [e.g. Cloudflare Workers] | — |
| Framework | [e.g. Hono] | [version] |
| Database | [e.g. D1 (SQLite)] | — |
| ORM | [e.g. Drizzle] | [version] |
| Frontend | [e.g. React 19] | [version] |
| Styling | [e.g. Tailwind v4] | [version] |
## Directory Structure
[Annotated tree — top 2 levels with purpose comments]
## Key Flows
### [Flow 1: e.g. "User Authentication"]
[Step-by-step: request → middleware → handler → database → response]
### [Flow 2: e.g. "Data Processing Pipeline"]
[Step-by-step through the system]
## Configuration
[Key config files and what they control]
## Deployment
[How to deploy, environment variables needed, build commands]
# API Endpoints
## Base URL
[e.g. `https://api.example.com` or relative `/api`]
## Authentication
[Method: Bearer token, session cookie, API key, none]
[Where tokens come from, how to obtain]
## Endpoints
### [Group: e.g. Users]
#### `GET /api/users`
- **Auth**: Required
- **Params**: `?page=1&limit=20`
- **Response**: `{ users: User[], total: number }`
#### `POST /api/users`
- **Auth**: Required (admin)
- **Body**: `{ name: string, email: string }`
- **Response**: `{ user: User }` (201)
- **Errors**: 400 (validation), 409 (duplicate email)
[Repeat for each endpoint]
## Error Format
[Standard error response shape]
## Rate Limits
[If applicable]
# Database Schema
## Engine
[e.g. Cloudflare D1 (SQLite), PostgreSQL, MySQL]
## Tables
### `users`
| Column | Type | Constraints | Description |
|--------|------|-------------|-------------|
| id | TEXT | PK | UUID |
| email | TEXT | UNIQUE, NOT NULL | User email |
| name | TEXT | NOT NULL | Display name |
| created_at | TEXT | NOT NULL, DEFAULT now | ISO timestamp |
### `posts`
[Same format]
## Relationships
[Foreign keys, join patterns, cascading rules]
## Indexes
[Non-primary indexes and why they exist]
## Migrations
- Generate: `npx drizzle-kit generate`
- Apply local: `npx wrangler d1 migrations apply DB --local`
- Apply remote: `npx wrangler d1 migrations apply DB --remote`
## Seed Data
[Reference to seed script if one exists]
<!-- TODO: document purpose -->If docs already exist:
Never silently overwrite custom content the user has added to their docs.
Weekly Installs
157
Repository
GitHub Stars
643
First Seen
10 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
cursor151
gemini-cli150
opencode150
github-copilot150
cline150
amp149
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
36,300 周安装