devdocs-onboard
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese项目上下文
Project Context
生成项目上下文摘要,帮助 AI 工具或团队成员快速了解项目并接手工作。
Generate project context summaries to help AI tools or team members quickly understand and take over the project.
运行模式
Operation Modes
/devdocs-onboard → 智能检测(询问读或写)
/devdocs-onboard --read → 只读取现有文档,不修改
/devdocs-onboard --update → 强制重新扫描更新| 模式 | 读取文档 | 扫描项目 | 写入文件 | 适用场景 |
|---|---|---|---|---|
| 智能检测 | ✅ | 视情况 | 视情况 | 不确定时 |
| ✅ | ❌ | ❌ | 新 AI 接手项目 |
| - | ✅ | ✅ | 完成阶段性工作后 |
/devdocs-onboard → Smart Detection (Ask whether to read or write)
/devdocs-onboard --read → Only read existing documents, no modifications
/devdocs-onboard --update → Force rescan and update| Mode | Read Documents | Scan Project | Write File | Applicable Scenario |
|---|---|---|---|---|
| Smart Detection | ✅ | As needed | As needed | When uncertain |
| ✅ | ❌ | ❌ | New AI taking over project |
| - | ✅ | ✅ | After completing phase work |
智能检测流程
Smart Detection Flow
检测 00-context.md 是否存在
│
├── 不存在 → 自动进入更新模式
│
└── 存在 → 询问用户
├── "读取现有内容" → 展示文档,不修改
└── "重新扫描更新" → 扫描项目,覆盖文件Check if 00-context.md exists
│
├── Does not exist → Automatically enter update mode
│
└── Exists → Ask user
├── "Read existing content" → Display document, no modifications
└── "Rescan and update" → Scan project, overwrite file语言规则
Language Rules
- 支持中英文提问
- 统一中文回复
- 使用中文生成文档
- Support queries in both Chinese and English
- Provide unified English responses
- Generate documents in English
触发条件
Trigger Conditions
- 用户切换 AI 工具,需要传递上下文
- 用户开始新的对话会话
- 团队成员需要了解项目
- 用户要求生成项目简报
- User switches AI tools and needs to transfer context
- User starts a new conversation session
- Team members need to understand the project
- User requests to generate a project brief
核心理念
Core Concepts
上下文传递问题
Context Transfer Issues
会话 A (Claude Code) 会话 B (新 AI 工具)
│ │
├── 了解项目结构 │ ← 需要重新了解
├── 读取设计文档 │ ← 需要重新读取
├── 理解当前进度 │ ← 需要重新理解
└── 知道下一步任务 │ ← 需要重新确认
│
┌────────────────┘
▼
/devdocs-onboard
│
▼
生成上下文摘要
│
▼
快速接手项目核心原则:
- 一份文档包含所有关键上下文
- 新 AI 读取后能立即开始工作
- 避免重复探索和询问
Session A (Claude Code) Session B (New AI Tool)
│ │
├── Understand project structure │ ← Needs to re-understand
├── Read design documents │ ← Needs to re-read
├── Understand current progress │ ← Needs to re-understand
└── Know next tasks │ ← Needs to re-confirm
│
┌────────────────┘
▼
/devdocs-onboard
│
▼
Generate context summary
│
▼
Quickly take over projectCore Principles:
- A single document contains all key context
- New AI can start working immediately after reading
- Avoid repeated exploration and inquiries
工作流程
Workflow
1. 扫描 DevDocs 文档
│
▼
2. 提取关键信息
├── 项目概述
├── 技术架构
├── 当前进度
└── 待办任务
│
▼
3. 扫描代码库结构
│
▼
4. 生成上下文摘要
│
▼
5. 输出文件(可直接传递给新 AI)1. Scan DevDocs documents
│
▼
2. Extract key information
├── Project Overview
├── Technical Architecture
├── Current Progress
└── Pending Tasks
│
▼
3. Scan codebase structure
│
▼
4. Generate context summary
│
▼
5. Output file (can be directly passed to new AI)输出文件
Output File
主文件:
docs/devdocs/00-context.md此文件设计为可直接复制给新 AI 工具作为初始上下文。
Main File:
docs/devdocs/00-context.mdThis file is designed to be directly copied to new AI tools as initial context.
文档结构
Document Structure
markdown
undefinedmarkdown
undefined项目上下文:<项目名称>
Project Context: <Project Name>
生成时间:YYYY-MM-DD HH:mm
生成工具:/devdocs-onboard
Generation Time: YYYY-MM-DD HH:mm
Generation Tool: /devdocs-onboard
1. 项目概述
1. Project Overview
1.1 项目目标
1.1 Project Objectives
<从 01-requirements.md 提取>
<Extracted from 01-requirements.md>
1.2 核心功能
1.2 Core Features
| 编号 | 功能 | 状态 |
|---|---|---|
| F-001 | <功能名称> | ✅ 已完成 / 🔄 进行中 / ⏳ 待开发 |
| ID | Feature | Status |
|---|---|---|
| F-001 | <Feature Name> | ✅ Completed / 🔄 In Progress / ⏳ Pending Development |
1.3 技术栈
1.3 Tech Stack
<从 02-system-design.md 提取>
<Extracted from 02-system-design.md>
2. 系统架构
2. System Architecture
2.1 架构概览
2.1 Architecture Overview
<从 02-system-design.md 提取架构图>
<Extract architecture diagram from 02-system-design.md>
2.2 核心模块
2.2 Core Modules
| 模块 | 职责 | 关键文件 |
|---|---|---|
| <模块名> | <职责> | |
| Module | Responsibility | Key Files |
|---|---|---|
| <Module Name> | <Responsibility> | |
2.3 核心接口
2.3 Core Interfaces
<从 02-system-design.md 提取关键接口签名>
<Extract key interface signatures from 02-system-design.md>
3. 代码结构
3. Code Structure
3.1 目录结构
3.1 Directory Structure
<实际项目目录结构,通过 ls/tree 获取><Actual project directory structure, obtained via ls/tree>3.2 关键文件说明
3.2 Key File Explanations
| 文件 | 用途 |
|---|---|
| 入口文件 |
| 配置管理 |
| File | Purpose |
|---|---|
| Entry file |
| Configuration management |
4. 当前进度
4. Current Progress
4.1 总体进度
4.1 Overall Progress
| 类型 | 总数 | 已完成 | 进行中 | 完成率 |
|---|---|---|---|---|
| 功能点 | X | X | X | XX% |
| 开发任务 | X | X | X | XX% |
| Type | Total | Completed | In Progress | Completion Rate |
|---|---|---|---|---|
| Feature Points | X | X | X | XX% |
| Development Tasks | X | X | X | XX% |
4.2 最近完成
4.2 Recently Completed
- T-05: <任务名称> (YYYY-MM-DD)
- T-04: <任务名称> (YYYY-MM-DD)
- T-05: <Task Name> (YYYY-MM-DD)
- T-04: <Task Name> (YYYY-MM-DD)
4.3 当前进行中
4.3 In Progress
- T-06: <任务名称>
- 状态:<进度描述>
- 涉及文件:
src/xxx.ts
- T-06: <Task Name>
- Status: <Progress Description>
- Involved Files:
src/xxx.ts
4.4 未提交变更
4.4 Uncommitted Changes
<如有未提交的代码变更,列出>
<List any uncommitted code changes>
5. 待办任务
5. Pending Tasks
5.1 下一步任务
5.1 Next Tasks
| 优先级 | 任务 | 依赖 | 关联需求 |
|---|---|---|---|
| P0 | T-07: <任务名称> | T-06 | F-002, AC-005 |
| Priority | Task | Dependencies | Associated Requirements |
|---|---|---|---|
| P0 | T-07: <Task Name> | T-06 | F-002, AC-005 |
5.2 阻塞项
5.2 Blockers
<如有阻塞项,列出>
<List any blockers>
6. 重要约定
6. Important Agreements
6.1 编码规范
6.1 Coding Standards
- 遵循 MTE 原则(可维护、可测试、可扩展)
- 函数不超过 50 行
- 参数不超过 5 个
- Follow MTE principles (Maintainable, Testable, Extensible)
- Functions no longer than 50 lines
- No more than 5 parameters
6.2 测试要求
6.2 Testing Requirements
- 单元测试覆盖率 ≥ 80%
- 禁止弱断言
- Unit test coverage ≥ 80%
- Forbid weak assertions
6.3 提交规范
6.3 Commit Standards
<从 git log 提取项目提交风格>
<Extract project commit style from git log>
7. 快速开始
7. Quick Start
7.1 环境准备
7.1 Environment Preparation
bash
<安装依赖命令>bash
<Dependency installation commands>7.2 运行项目
7.2 Run Project
bash
<运行命令>bash
<Run commands>7.3 运行测试
7.3 Run Tests
bash
<测试命令>bash
<Test commands>8. DevDocs 文档索引
8. DevDocs Document Index
| 文档 | 路径 | 说明 |
|---|---|---|
| 需求文档 | | 功能点、用户故事、验收标准 |
| 系统设计 | | 架构、接口、数据模型 |
| 测试用例 | | 测试策略、追溯矩阵 |
| 开发任务 | | 任务列表、依赖关系 |
接手建议:
- 先阅读本文档了解全貌
- 查看"当前进行中"任务状态
- 从"下一步任务"继续开发
- 遇到细节问题查阅对应 DevDocs 文档
undefined| Document | Path | Description |
|---|---|---|
| Requirements Document | | Feature points, user stories, acceptance criteria |
| System Design | | Architecture, interfaces, data models |
| Test Cases | | Testing strategies, traceability matrix |
| Development Tasks | | Task lists, dependency relationships |
Takeover Recommendations:
- First read this document to get the full picture
- Check the status of "In Progress" tasks
- Continue development from the "Next Tasks" section
- Refer to the corresponding DevDocs documents when encountering detailed issues
undefined信息提取规则
Information Extraction Rules
从 DevDocs 提取
Extract from DevDocs
| 信息 | 来源文档 | 提取内容 |
|---|---|---|
| 项目目标 | | 需求背景、目标用户 |
| 功能列表 | | F-XXX 功能点及状态 |
| 技术栈 | | 技术选型表 |
| 架构图 | | 架构概览图 |
| 核心接口 | | 接口签名表 |
| 当前进度 | | 执行检查清单 |
| 待办任务 | | 未完成的 T-XX |
| Information | Source Document | Extracted Content |
|---|---|---|
| Project Objectives | | Requirements background, target users |
| Feature List | | F-XXX feature points and statuses |
| Tech Stack | | Technology selection table |
| Architecture Diagram | | Architecture overview diagram |
| Core Interfaces | | Interface signature table |
| Current Progress | | Execution checklist |
| Pending Tasks | | Uncompleted T-XX tasks |
从代码库提取
Extract from Codebase
| 信息 | 提取方法 |
|---|---|
| 目录结构 | |
| 关键文件 | 分析 package.json、入口文件 |
| 未提交变更 | |
| 提交风格 | |
| 运行命令 | 从 package.json scripts 或 Makefile 提取 |
| Information | Extraction Method |
|---|---|
| Directory Structure | |
| Key Files | Analyze package.json, entry files |
| Uncommitted Changes | |
| Commit Style | |
| Run Commands | Extract from package.json scripts or Makefile |
使用场景
Usage Scenarios
场景一:完成工作,准备交接(--update)
Scenario 1: Complete work and prepare for handover (--update)
用户: /devdocs-onboard --update
Agent: 正在扫描项目并生成上下文...
✅ 已更新 docs/devdocs/00-context.md
您可以将此文件内容复制给新的 AI 工具,它将快速了解项目并接手工作。User: /devdocs-onboard --update
Agent: Scanning project and generating context...
✅ Updated docs/devdocs/00-context.md
You can copy the content of this file to the new AI tool, which will quickly understand and take over the project.场景二:新 AI 接手项目(--read)
Scenario 2: New AI takes over project (--read)
用户: /devdocs-onboard --read
Agent: 正在读取项目上下文...
[展示 00-context.md 内容]
当前进度:8/12 任务已完成 (67%)
下一步:T-09 用户认证模块
建议从"待办任务"部分继续开发。User: /devdocs-onboard --read
Agent: Reading project context...
[Displays content of 00-context.md]
Current Progress: 8/12 tasks completed (67%)
Next Step: T-09 User Authentication Module
It is recommended to continue development from the "Pending Tasks" section.场景三:不确定时(智能检测)
Scenario 3: Uncertain (Smart Detection)
用户: /devdocs-onboard
Agent: 检测到 docs/devdocs/00-context.md 已存在(更新于 2 小时前)
请选择:
1. 读取现有内容(不修改)
2. 重新扫描更新
用户: 1
Agent: [展示现有文档内容]User: /devdocs-onboard
Agent: Detected that docs/devdocs/00-context.md already exists (updated 2 hours ago)
Please select:
1. Read existing content (no modifications)
2. Rescan and update
User: 1
Agent: [Displays existing document content]约束
Constraints
生成约束
Generation Constraints
- 必须扫描所有 DevDocs 文档
- 必须检查当前代码库状态
- 必须包含未提交变更信息
- 输出文件必须自包含(不依赖外部链接理解)
- 关键信息必须直接展示(不只是引用文档路径)
- Must scan all DevDocs documents
- Must check current codebase status
- Must include uncommitted changes information
- Output files must be self-contained (no external links required for understanding)
- Key information must be directly displayed (not just referencing document paths)
内容约束
Content Constraints
- 项目概述不超过 200 字
- 架构图必须包含(ASCII 或 Mermaid)
- 必须列出下一步可执行的任务
- 敏感信息(密钥、密码)不得包含
- 文件路径必须准确可访问
- Project overview must not exceed 200 words
- Architecture diagram must be included (ASCII or Mermaid)
- Must list executable next-step tasks
- Sensitive information (keys, passwords) must not be included
- File paths must be accurate and accessible
更新约束
Update Constraints
- 每次生成覆盖旧文件
- 生成时间必须记录
- 如 DevDocs 不存在,提示用户先运行相关 skill
- Overwrite old file with each generation
- Must record generation time
- If DevDocs do not exist, prompt user to run the relevant skill first
Skill 协作
Skill Collaboration
| 场景 | 协作 Skill | 说明 |
|---|---|---|
| DevDocs 不存在 | | 先从代码逆向生成文档 |
| 进度信息过时 | | 先同步文档状态 |
| 需要详细任务 | | 查看完整任务列表 |
| Scenario | Collaborative Skill | Description |
|---|---|---|
| DevDocs do not exist | | First reverse-generate documents from code |
| Progress information is outdated | | First sync document status |
| Need detailed tasks | | View complete task list |
命令选项
Command Options
bash
undefinedbash
undefined智能检测:根据文档存在状态询问用户
Smart Detection: Ask user based on document existence status
/devdocs-onboard
/devdocs-onboard
只读模式:读取并展示现有文档,不做任何修改
Read-only Mode: Read and display existing documents, no modifications
/devdocs-onboard --read
/devdocs-onboard --read
更新模式:强制重新扫描项目并更新文档
Update Mode: Force rescan project and update document
/devdocs-onboard --update
undefined/devdocs-onboard --update
undefined下一步
Next Steps
交接方(工具 A)
Handover Party (Tool A)
- 完成阶段性工作后,运行
/devdocs-onboard --update - 将 内容传递给新 AI 工具
00-context.md
- After completing phase work, run
/devdocs-onboard --update - Transfer the content of to the new AI tool
00-context.md
接手方(工具 B)
Takeover Party (Tool B)
- 运行 了解项目
/devdocs-onboard --read - 从"待办任务"部分继续开发
- 完成工作后运行 更新上下文
/devdocs-onboard --update
- Run to understand the project
/devdocs-onboard --read - Continue development from the "Pending Tasks" section
- After completing work, run to update context
/devdocs-onboard --update