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     → 强制重新扫描更新
模式读取文档扫描项目写入文件适用场景
智能检测视情况视情况不确定时
--read
新 AI 接手项目
--update
-完成阶段性工作后
/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
ModeRead DocumentsScan ProjectWrite FileApplicable Scenario
Smart DetectionAs neededAs neededWhen uncertain
--read
New AI taking over project
--update
-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 project
Core 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.md
This file is designed to be directly copied to new AI tools as initial context.

文档结构

Document Structure

markdown
undefined
markdown
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<功能名称>✅ 已完成 / 🔄 进行中 / ⏳ 待开发
IDFeatureStatus
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

模块职责关键文件
<模块名><职责>
src/xxx/
ModuleResponsibilityKey Files
<Module Name><Responsibility>
src/xxx/

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

文件用途
src/index.ts
入口文件
src/config.ts
配置管理

FilePurpose
src/index.ts
Entry file
src/config.ts
Configuration management

4. 当前进度

4. Current Progress

4.1 总体进度

4.1 Overall Progress

类型总数已完成进行中完成率
功能点XXXXX%
开发任务XXXXX%
TypeTotalCompletedIn ProgressCompletion Rate
Feature PointsXXXXX%
Development TasksXXXXX%

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

优先级任务依赖关联需求
P0T-07: <任务名称>T-06F-002, AC-005
PriorityTaskDependenciesAssociated Requirements
P0T-07: <Task Name>T-06F-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

文档路径说明
需求文档
docs/devdocs/01-requirements.md
功能点、用户故事、验收标准
系统设计
docs/devdocs/02-system-design.md
架构、接口、数据模型
测试用例
docs/devdocs/03-test-cases.md
测试策略、追溯矩阵
开发任务
docs/devdocs/04-dev-tasks.md
任务列表、依赖关系

接手建议
  1. 先阅读本文档了解全貌
  2. 查看"当前进行中"任务状态
  3. 从"下一步任务"继续开发
  4. 遇到细节问题查阅对应 DevDocs 文档
undefined
DocumentPathDescription
Requirements Document
docs/devdocs/01-requirements.md
Feature points, user stories, acceptance criteria
System Design
docs/devdocs/02-system-design.md
Architecture, interfaces, data models
Test Cases
docs/devdocs/03-test-cases.md
Testing strategies, traceability matrix
Development Tasks
docs/devdocs/04-dev-tasks.md
Task lists, dependency relationships

Takeover Recommendations:
  1. First read this document to get the full picture
  2. Check the status of "In Progress" tasks
  3. Continue development from the "Next Tasks" section
  4. Refer to the corresponding DevDocs documents when encountering detailed issues
undefined

信息提取规则

Information Extraction Rules

从 DevDocs 提取

Extract from DevDocs

信息来源文档提取内容
项目目标
01-requirements.md
需求背景、目标用户
功能列表
01-requirements.md
F-XXX 功能点及状态
技术栈
02-system-design.md
技术选型表
架构图
02-system-design.md
架构概览图
核心接口
02-system-design.md
接口签名表
当前进度
04-dev-tasks.md
执行检查清单
待办任务
04-dev-tasks.md
未完成的 T-XX
InformationSource DocumentExtracted Content
Project Objectives
01-requirements.md
Requirements background, target users
Feature List
01-requirements.md
F-XXX feature points and statuses
Tech Stack
02-system-design.md
Technology selection table
Architecture Diagram
02-system-design.md
Architecture overview diagram
Core Interfaces
02-system-design.md
Interface signature table
Current Progress
04-dev-tasks.md
Execution checklist
Pending Tasks
04-dev-tasks.md
Uncompleted T-XX tasks

从代码库提取

Extract from Codebase

信息提取方法
目录结构
ls -la
tree
关键文件分析 package.json、入口文件
未提交变更
git status
提交风格
git log --oneline -5
运行命令从 package.json scripts 或 Makefile 提取
InformationExtraction Method
Directory Structure
ls -la
or
tree
Key FilesAnalyze package.json, entry files
Uncommitted Changes
git status
Commit Style
git log --oneline -5
Run CommandsExtract 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 不存在
/devdocs-retrofit
先从代码逆向生成文档
进度信息过时
/devdocs-sync
先同步文档状态
需要详细任务
/devdocs-dev-tasks
查看完整任务列表
ScenarioCollaborative SkillDescription
DevDocs do not exist
/devdocs-retrofit
First reverse-generate documents from code
Progress information is outdated
/devdocs-sync
First sync document status
Need detailed tasks
/devdocs-dev-tasks
View complete task list

命令选项

Command Options

bash
undefined
bash
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)

  1. 完成阶段性工作后,运行
    /devdocs-onboard --update
  2. 00-context.md
    内容传递给新 AI 工具
  1. After completing phase work, run
    /devdocs-onboard --update
  2. Transfer the content of
    00-context.md
    to the new AI tool

接手方(工具 B)

Takeover Party (Tool B)

  1. 运行
    /devdocs-onboard --read
    了解项目
  2. 从"待办任务"部分继续开发
  3. 完成工作后运行
    /devdocs-onboard --update
    更新上下文
  1. Run
    /devdocs-onboard --read
    to understand the project
  2. Continue development from the "Pending Tasks" section
  3. After completing work, run
    /devdocs-onboard --update
    to update context