From 1acd33ee19dc465823280f7127580b4f2a8b1212 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Tue, 30 Sep 2025 16:14:27 +0800 Subject: [PATCH] docs: add comprehensive Chinese workflow guide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add detailed workflow explanation (头脑风暴 → 规划 → 执行 → 测试) - Document brainstorming phase with role commands - Explain action planning phase with coordinator architecture - Include context-package.json and task JSON structure examples - Document execution phase with agent assignment - Add testing workflow and multi-level test generation - Include feature development and bug fix workflows - Add LINUX DO community discussion link 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- README.md | 191 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 191 insertions(+) diff --git a/README.md b/README.md index ac1fcfcf..ba2335b4 100644 --- a/README.md +++ b/README.md @@ -330,6 +330,197 @@ graph LR /workflow:review ``` +--- + +## 📖 完整工作流详解 (Complete Workflow Guide) + +> **💡 社区讨论**: [LINUX DO 论坛讨论帖](https://linux.do/t/topic/995175/24) +> **📦 项目仓库**: [GitHub - Claude-Code-Workflow](https://github.com/catlog22/Claude-Code-Workflow) + +### 🎯 核心工作流程 (Core Workflow) + +**完整开发流程**: 头脑风暴 → 用户打磨修改 → 行动规划 → 执行 → 测试 + +```mermaid +graph LR + A[💭 头脑风暴] --> B[✏️ 用户修改] + B --> C[📋 行动规划] + C --> D[⚡ 执行] + D --> E[🧪 测试] +``` + +### 🧠 头脑风暴阶段 (Brainstorming Phase) + +#### 涉及指令: +- `/workflow:brainstorm:auto-parallel` - 自动概念规划(并行版) +- `/workflow:brainstorm:auto-squeeze` - 自动概念规划(串行版,用于测试) +- 单个角色指令(用于重新规划) + +#### 工作流程: + +1. **初始规划**: 通过 `/workflow:brainstorm:auto-squeeze [topic]` 进行自动规划 +2. **修改优化**: 如果对规划不满意,使用单个角色指令如 `/workflow:brainstorm:ui-designer` 进行修改 +3. **综合文档**: 通过 `/workflow:brainstorm:synthesis` 生成综合规划文档 + +**可用角色指令**: +- `🏗️ system-architect` - 系统架构分析 +- `🎨 ui-designer` - UI/UX 设计规划 +- `🗄️ data-architect` - 数据架构设计 +- `🔒 security-expert` - 安全架构分析 +- `📊 product-manager` - 产品需求分析 +- `🔬 innovation-lead` - 技术创新建议 +- `📋 feature-planner` - 功能规划 +- `📈 business-analyst` - 业务流程分析 +- `👥 user-researcher` - 用户行为分析 + +### 📋 行动规划阶段 (Action Planning Phase) + +前述工作过程被称为**概念规划**,完成后进入**行动规划**阶段: + +```bash +/workflow:plan "d:\test_project\.workflow\.active-WFS-promptmaster-platform" +# 一般会传入前一项任务的标识符,也可以增加任务描述 +``` + +#### Plan 命令协调器架构: + +`/workflow:plan` 被设计为协调器,自动协调其他斜杠命令执行,包括四个阶段: + +1. **🚀 Session 启动**: `/workflow:session:start` - 启动一个 workflow session +2. **🔍 上下文收集**: `/workflow:tools:context-gather` + - 查找相关代码文件(如果是功能更新) + - 使用 MCP 查找示例代码 + - 产出 `context-package.json` 供 agent 引用 +3. **🧪 概念增强**: `/workflow:tools:concept-enhanced` + - 使用 CLI 工具对现有计划进行分析 + - 提出改进建议及重点关注事项 + - 产出 `ANALYSIS_RESULTS.md` 供 agent 引用 +4. **📝 任务生成**: `/workflow:tools:task-generate` 或 `/workflow:tools:task-generate-agent` + - 制定详细规划 + - 产出任务 JSON 文件、`IMPL_PLAN.md`、`TODO_LIST.md` + +#### 🗂️ Context Package 示例结构: + +```json +{ + "metadata": { + "task_description": "Implement PromptMaster platform...", + "phase_type": "brainstorming", + "brainstorming_completed": true, + "session_id": "WFS-promptmaster-platform", + "tech_stack": { + "frontend": ["Vue 3", "TypeScript", "Element Plus"], + "backend": ["Python", "FastAPI", "SQLAlchemy"], + "database": ["PostgreSQL", "Redis"] + } + }, + "assets": [ + { + "type": "documentation", + "path": ".workflow/WFS-xxx/.brainstorming/synthesis-specification.md", + "priority": "critical" + } + ], + "implementation_guidance": { + "start_with": ["项目结构初始化", "数据库架构", "认证系统"], + "key_deliverables": ["后端API", "前端界面", "测试套件"] + } +} +``` + +#### 📋 Task JSON 示例结构: + +```json +{ + "id": "IMPL-1", + "title": "Project Infrastructure & Environment Setup", + "status": "pending", + "meta": { + "type": "feature", + "agent": "@code-developer", + "complexity": "medium", + "priority": "P0" + }, + "context": { + "requirements": ["设置后端项目结构", "配置 Docker Compose"], + "focus_paths": ["backend/", "frontend/", "docker-compose.yml"], + "acceptance": ["后端服务运行在 8000 端口", "前端运行在 3000 端口"] + }, + "flow_control": { + "pre_analysis": [ + { + "step": "load_synthesis_specification", + "action": "加载综合规范文档", + "commands": ["Read(.workflow/xxx/synthesis-specification.md)"] + } + ] + } +} +``` + +系统自动产生上下文,执行下一个斜杠命令,直到流程执行完毕。 + +### ⚡ 任务执行阶段 (Execution Phase) + +通过 `/workflow:execute` 进入任务执行阶段: + +#### 🤖 Agent 自动分配: +- **code-developer**: 代码开发任务 +- **code-review-test-agent**: 代码审查和测试任务 + +#### 📚 技术栈指南自动加载: +Agent 根据上下文自动加载对应的技术栈指南(位置:`~\.claude\workflows\cli-templates\tech-stacks`) + +**可用技术栈模板**: +- `typescript-dev.md` - TypeScript 开发规范 +- `python-dev.md` - Python 开发约定 +- `react-dev.md` - React 架构指南 +- `vue-dev.md` - Vue 开发最佳实践 +- `fastapi-dev.md` - FastAPI 后端规范 + +> 💡 **欢迎贡献**: 如果您有更好的技术栈提示词,欢迎提交 PR! + +### 🐛 功能新增与 Bug 修复工作流 (Feature & Bug Fix Workflow) + +#### 快速交互式规划: + +使用 CLI 命令进行交互式询问,形成计划文档: + +```bash +# Bug 分析和修复 +/cli:mode:bug-index "描述 bug 现象" --tool gemini + +# 深度代码分析 +/cli:mode:code-analysis "分析目标" --tool codex + +# 架构规划 +/cli:mode:plan "规划主题" --tool qwen +``` + +**执行策略**: +- **简单任务**: 让 Claude 直接执行 +- **复杂任务**: 按照完整工作流执行(头脑风暴 → 规划 → 执行) + +### 🧪 测试工作流 (Testing Workflow) + +在 `/workflow:execute` 完成后: + +```bash +# 生成测试工作流 +/workflow:test-gen WFS-session-id + +# 执行测试任务 +/workflow:execute +``` + +测试工作流自动生成多层次测试: +- **单元测试** (Unit Tests) +- **集成测试** (Integration Tests) +- **端到端测试** (E2E Tests) +- **性能测试** (Performance Tests) +- **安全测试** (Security Tests) + + --- ## 🏗️ Project Structure