@lordmos/dev-crew 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 OrcheSpec Contributors
3
+ Copyright (c) 2025 DevCrew Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.en.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  *帮你做好 harness!*
11
11
 
12
- [![npm version](https://img.shields.io/npm/v/@lordmos/devcrew?style=flat-square&color=CDFE00)](https://www.npmjs.com/package/@lordmos/devcrew)
12
+ [![npm version](https://img.shields.io/npm/v/@lordmos/dev-crew?style=flat-square&color=CDFE00)](https://www.npmjs.com/package/@lordmos/dev-crew)
13
13
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](LICENSE)
14
14
  [![Node.js](https://img.shields.io/badge/Node.js-18+-339933?style=flat-square&logo=node.js&logoColor=white)](https://nodejs.org)
15
15
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-CDFE00.svg?style=flat-square)](https://github.com/lordmos/dev-crew/pulls)
@@ -24,11 +24,11 @@ When using AI (Copilot, Claude, Cursor…) for development:
24
24
 
25
25
  | Problem | What happens |
26
26
  |---------|-------------|
27
- | 🧠 **No memory** | Switch conversations, AI forgets everything |
28
- | 🎭 **No division of labor** | AI plays PM + architect + dev + tester simultaneously |
29
- | 🎯 **Goes off track** | Drifts from goals with no checkpoints to correct course |
30
- | 🔍 **Quality blind spots** | No review process — bugs and tech debt accumulate silently |
31
- | **No starting point** | Don't know how to orchestrate AI collaboration |
27
+ | **No memory** | Switch conversations, AI forgets everything |
28
+ | **No division of labor** | AI plays PM + architect + dev + tester simultaneously |
29
+ | **Goes off track** | Drifts from goals with no checkpoints to correct course |
30
+ | **Quality blind spots** | No review process — bugs and tech debt accumulate silently |
31
+ | **No starting point** | Don't know how to orchestrate AI collaboration |
32
32
 
33
33
  **Root cause**: AI lacks a persistent collaboration protocol. DevCrew is that protocol.
34
34
 
@@ -37,7 +37,7 @@ When using AI (Copilot, Claude, Cursor…) for development:
37
37
  ## Get Started in 30 Seconds
38
38
 
39
39
  ```bash
40
- npm install -g @lordmos/devcrew
40
+ npm install -g @lordmos/dev-crew
41
41
  cd your-project
42
42
  crew init
43
43
  ```
@@ -53,10 +53,10 @@ Works with **GitHub Copilot · Claude · ChatGPT · Cursor** and any AI platform
53
53
  ```
54
54
  You: I need to add auth middleware to the API
55
55
 
56
- AI: 📋 Creating change add-api-auth, mode: Standard
56
+ AI: [PdM] Creating change add-api-auth, mode: Standard
57
57
  Plan — Requirements:
58
58
  - Goal: Add JWT auth to all /api/ routes
59
- - Acceptance: No token → 401 Expired token → 401
59
+ - Acceptance: [ ] No token → 401 [ ] Expired token → 401
60
60
  Please confirm.
61
61
 
62
62
  You: Confirmed
@@ -65,7 +65,7 @@ AI: Design → Execute → Verify — All passed. Please confirm acceptance.
65
65
 
66
66
  You: Confirmed
67
67
 
68
- AI: Change add-api-auth complete.
68
+ AI: [OK] Change add-api-auth complete.
69
69
  ```
70
70
 
71
71
  **You only confirmed twice** (requirements + results). Everything else was automatic.
@@ -77,12 +77,13 @@ AI: ✅ Change add-api-auth complete.
77
77
  ```
78
78
  your-project/
79
79
  ├── INSTRUCTIONS.md ← AI behavior instructions (core file)
80
- ├── devcrew.yaml ← Project config (modes, specialists)
81
- └── devcrew/
82
- └── specs/ ← Shared specifications
80
+ ├── dev-crew.yaml ← Project config (modes, specialists)
81
+ └── dev-crew/
82
+ ├── specs/ ← Shared specifications
83
+ └── memory/ ← Agent long-term memory (auto-accumulated)
83
84
  ```
84
85
 
85
- AI reads `INSTRUCTIONS.md` and automatically assembles the team, following the PDEVI workflow.
86
+ AI reads `INSTRUCTIONS.md` and PjM orchestrates the team — agents collaborate in parallel following the PDEVI workflow.
86
87
 
87
88
  ---
88
89
 
@@ -98,7 +99,7 @@ flowchart LR
98
99
  V -->|Fail| I["Iterate"]
99
100
  I -->|Design issue| D
100
101
  I -->|Implementation issue| E
101
- V -->|Pass| Done[" Done"]
102
+ V -->|Pass| Done["[OK] Done"]
102
103
  ```
103
104
 
104
105
  Three modes for every scenario:
@@ -109,27 +110,27 @@ Three modes for every scenario:
109
110
  | **Express** | P → E → V | Bug fixes |
110
111
  | **Prototype** | P → D → E | Quick prototyping |
111
112
 
112
- ### Built-in Team (6 Roles)
113
+ ### Built-in Team (6 Agents)
113
114
 
114
- | Role | Responsibility |
115
- |------|---------------|
116
- | 🎯 **PjM** Project Manager | Orchestration, mode inference, stage transitions |
117
- | 📋 **PdM** Product Manager | Requirements analysis, PRD import, acceptance criteria |
118
- | 🏗️ **Architect** | Tech decisions, task decomposition, dependency analysis |
119
- | 💻 **Implementer** | Code generation, refactoring, dependency management |
120
- | 🧪 **Tester** | Test execution, acceptance checks, coverage |
121
- | 👀 **Reviewer** | Code review, security scanning, best practices |
115
+ | Agent | Responsibility |
116
+ |-------|---------------|
117
+ | **PjM** Project Manager | Task decomposition, agent coordination, progress tracking |
118
+ | **PdM** Product Manager | Requirements analysis, PRD import, acceptance criteria |
119
+ | **Architect** | Tech decisions, task decomposition, dependency analysis |
120
+ | **Implementer** | Code generation, refactoring, dependency management |
121
+ | **Tester** | Test execution, acceptance checks, coverage |
122
+ | **Reviewer** | Code review, security scanning, best practices |
122
123
 
123
- Role switching is fully automatic — no manual assignment needed.
124
+ PjM orchestrates the entire teammultiple agents work in parallel, no manual assignment needed.
124
125
 
125
126
  ### Domain Specialists (29)
126
127
 
127
128
  Beyond the core team, **29 domain specialists** across 10 fields, activated on demand:
128
129
 
129
- > 🎮 Game Dev (8) · 🎨 UI/UX (3) · 🔒 Security (1) · ⚙️ DevOps (3) · 🧪 Testing (3) · 💻 Engineering (5) · 📊 Data (2) · 🤖 AI/ML (1) · 🌐 Web3 (1) · 🥽 Spatial Computing (2)
130
+ > Game Dev (8) · UI/UX (3) · Security (1) · DevOps (3) · Testing (3) · Engineering (5) · Data (2) · AI/ML (1) · Web3 (1) · Spatial Computing (2)
130
131
 
131
132
  ```yaml
132
- # devcrew.yaml
133
+ # dev-crew.yaml
133
134
  specialists:
134
135
  - game-designer
135
136
  - security-engineer
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  *帮你做好 harness!*
11
11
 
12
- [![npm version](https://img.shields.io/npm/v/@lordmos/devcrew?style=flat-square&color=CDFE00)](https://www.npmjs.com/package/@lordmos/devcrew)
12
+ [![npm version](https://img.shields.io/npm/v/@lordmos/dev-crew?style=flat-square&color=CDFE00)](https://www.npmjs.com/package/@lordmos/dev-crew)
13
13
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](LICENSE)
14
14
  [![Node.js](https://img.shields.io/badge/Node.js-18+-339933?style=flat-square&logo=node.js&logoColor=white)](https://nodejs.org)
15
15
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-CDFE00.svg?style=flat-square)](https://github.com/lordmos/dev-crew/pulls)
@@ -24,11 +24,11 @@
24
24
 
25
25
  | 问题 | 表现 |
26
26
  |------|------|
27
- | 🧠 **无记忆** | 换个对话窗口,AI 忘了之前做了什么 |
28
- | 🎭 **无分工** | AI 同时充当 PM + 架构师 + 开发 + 测试,顾此失彼 |
29
- | 🎯 **会跑偏** | 做着做着偏离目标,没有检查点纠正 |
30
- | 🔍 **质量盲区** | 没有审查环节,bug 和技术债悄悄积累 |
31
- | **不知从何开始** | 面对新项目,不知道如何编排 AI 协作 |
27
+ | **无记忆** | 换个对话窗口,AI 忘了之前做了什么 |
28
+ | **无分工** | AI 同时充当 PM + 架构师 + 开发 + 测试,顾此失彼 |
29
+ | **会跑偏** | 做着做着偏离目标,没有检查点纠正 |
30
+ | **质量盲区** | 没有审查环节,bug 和技术债悄悄积累 |
31
+ | **不知从何开始** | 面对新项目,不知道如何编排 AI 协作 |
32
32
 
33
33
  **根因**:AI 缺少一套持久化的协作协议。DevCrew 就是那套协议。
34
34
 
@@ -37,7 +37,7 @@
37
37
  ## 30 秒上手
38
38
 
39
39
  ```bash
40
- npm install -g @lordmos/devcrew
40
+ npm install -g @lordmos/dev-crew
41
41
  cd your-project
42
42
  crew init
43
43
  ```
@@ -53,10 +53,10 @@ crew init
53
53
  ```
54
54
  你: 我要给 API 加认证中间件
55
55
 
56
- AI: 📋 创建变更 add-api-auth,模式: Standard
56
+ AI: [PdM] 创建变更 add-api-auth,模式: Standard
57
57
  Plan — 需求整理:
58
58
  - 目标: 为所有 /api/ 路由添加 JWT 认证
59
- - 验收标准: 未携带 token 返回 401 过期 token 返回 401
59
+ - 验收标准: [ ] 未携带 token 返回 401 [ ] 过期 token 返回 401
60
60
  请确认。
61
61
 
62
62
  你: 确认
@@ -65,7 +65,7 @@ AI: Design → Execute → Verify — 全部通过。请确认验收。
65
65
 
66
66
  你: 确认
67
67
 
68
- AI: 变更 add-api-auth 完成。
68
+ AI: [OK] 变更 add-api-auth 完成。
69
69
  ```
70
70
 
71
71
  **你只确认了两次**(需求 + 结果),其余全部自动。
@@ -77,12 +77,13 @@ AI: ✅ 变更 add-api-auth 完成。
77
77
  ```
78
78
  your-project/
79
79
  ├── INSTRUCTIONS.md ← AI 行为指令(核心文件)
80
- ├── devcrew.yaml ← 项目配置(模式、专家选择)
81
- └── devcrew/
82
- └── specs/ ← 共享规约
80
+ ├── dev-crew.yaml ← 项目配置(模式、专家选择)
81
+ └── dev-crew/
82
+ ├── specs/ ← 共享规约
83
+ └── memory/ ← Agent 长期记忆(自动积累)
83
84
  ```
84
85
 
85
- AI 读取 `INSTRUCTIONS.md` 后,自动建立团队,按 PDEVI 流程协作。
86
+ AI 读取 `INSTRUCTIONS.md` 后,PjM 自动编排团队,各 Agent 按 PDEVI 流程平行协作。
86
87
 
87
88
  ---
88
89
 
@@ -98,7 +99,7 @@ flowchart LR
98
99
  V -->|不通过| I["Iterate"]
99
100
  I -->|方案问题| D
100
101
  I -->|实现问题| E
101
- V -->|通过| Done[" 完成"]
102
+ V -->|通过| Done["[OK] 完成"]
102
103
  ```
103
104
 
104
105
  三种模式,覆盖所有场景:
@@ -109,27 +110,27 @@ flowchart LR
109
110
  | **Express** | P → E → V | Bug 修复 |
110
111
  | **Prototype** | P → D → E | 快速原型 |
111
112
 
112
- ### 内建团队(6 人)
113
+ ### 内建团队(6 个 Agent)
113
114
 
114
- | 角色 | 职责 |
115
- |------|------|
116
- | 🎯 **PjM** 项目经理 | 调度编排、模式推断、阶段推进 |
117
- | 📋 **PdM** 产品经理 | 需求梳理、PRD 导入、验收标准 |
118
- | 🏗️ **Architect** 架构师 | 技术选型、任务分解、依赖分析 |
119
- | 💻 **Implementer** 开发 | 代码生成、重构、依赖安装 |
120
- | 🧪 **Tester** 测试 | 测试执行、验收检查、覆盖率 |
121
- | 👀 **Reviewer** 审查 | 规范检查、安全扫描、最佳实践 |
115
+ | Agent | 职责 |
116
+ |-------|------|
117
+ | **PjM** 项目经理 | 任务拆解、Agent 调度、进度协调 |
118
+ | **PdM** 产品经理 | 需求梳理、PRD 导入、验收标准 |
119
+ | **Architect** 架构师 | 技术选型、任务分解、依赖分析 |
120
+ | **Implementer** 开发 | 代码生成、重构、依赖安装 |
121
+ | **Tester** 测试 | 测试执行、验收检查、覆盖率 |
122
+ | **Reviewer** 审查 | 规范检查、安全扫描、最佳实践 |
122
123
 
123
- 角色切换完全自动,无需手动分配。
124
+ PjM 统筹全局,各 Agent 各司其职、平行协作,无需手动分配。
124
125
 
125
126
  ### 领域专家(29 位)
126
127
 
127
128
  核心团队之外,**29 位领域专家**覆盖 10 个领域,按需激活:
128
129
 
129
- > 🎮 游戏开发(8)· 🎨 UI/UX(3)· 🔒 安全(1)· ⚙️ DevOps(3)· 🧪 测试(3)· 💻 工程(5)· 📊 数据(2)· 🤖 AI/ML(1)· 🌐 Web3(1)· 🥽 空间计算(2)
130
+ > 游戏开发(8)· UI/UX(3)· 安全(1)· DevOps(3)· 测试(3)· 工程(5)· 数据(2)· AI/ML(1)· Web3(1)· 空间计算(2)
130
131
 
131
132
  ```yaml
132
- # devcrew.yaml
133
+ # dev-crew.yaml
133
134
  specialists:
134
135
  - game-designer
135
136
  - security-engineer
package/agents/README.md CHANGED
@@ -7,7 +7,7 @@ DevCrew 内建 6 个核心角色(PjM/PdM/Architect/Implementer/Tester/Reviewer
7
7
  ## 使用方式
8
8
 
9
9
  ```yaml
10
- # devcrew.yaml
10
+ # dev-crew.yaml
11
11
  specialists:
12
12
  - game-designer # 按需激活
13
13
  - ui-designer
package/dist/cli.js CHANGED
@@ -6,7 +6,7 @@ const program = new Command();
6
6
  program
7
7
  .name("crew")
8
8
  .description("DevCrew — AI Agent 软件开发团队编排工具")
9
- .version("0.1.0");
9
+ .version("0.3.0");
10
10
  program
11
11
  .command("init")
12
12
  .description("初始化 DevCrew 工作区")
@@ -35,7 +35,7 @@ export async function agentsCommand() {
35
35
  }
36
36
  console.log();
37
37
  }
38
- console.log(`激活方式:在 devcrew.yaml 中添加 specialists 列表`);
38
+ console.log(`激活方式:在 dev-crew.yaml 中添加 specialists 列表`);
39
39
  console.log(` specialists:`);
40
40
  console.log(` - ${files[0]?.replace(".md", "") ?? "agent-name"}`);
41
41
  console.log();
@@ -12,14 +12,14 @@ export async function initCommand(options) {
12
12
  const cwd = process.cwd();
13
13
  const projectName = options.name ?? inferProjectName(cwd);
14
14
  console.log(`\n🚀 DevCrew 初始化: ${projectName}\n`);
15
- // 1. Create devcrew/ directory
16
- const crewDir = join(cwd, "devcrew");
15
+ // 1. Create dev-crew/ directory
16
+ const crewDir = join(cwd, "dev-crew");
17
17
  if (existsSync(crewDir)) {
18
- console.log("⚠️ devcrew/ 已存在,跳过目录创建");
18
+ console.log("⚠️ dev-crew/ 已存在,跳过目录创建");
19
19
  }
20
20
  else {
21
21
  mkdirSync(crewDir, { recursive: true });
22
- console.log("📁 创建 devcrew/");
22
+ console.log("📁 创建 dev-crew/");
23
23
  }
24
24
  // 2. Copy INSTRUCTIONS.md to project root
25
25
  const instrDest = join(cwd, "INSTRUCTIONS.md");
@@ -32,23 +32,57 @@ export async function initCommand(options) {
32
32
  writeFileSync(instrDest, content);
33
33
  console.log("📄 创建 INSTRUCTIONS.md(AI 行为指令)");
34
34
  }
35
- // 3. Generate devcrew.yaml at project root
36
- const yamlDest = join(cwd, "devcrew.yaml");
35
+ // 3. Generate dev-crew.yaml at project root
36
+ const yamlDest = join(cwd, "dev-crew.yaml");
37
37
  if (existsSync(yamlDest)) {
38
- console.log("⚠️ devcrew.yaml 已存在,跳过");
38
+ console.log("⚠️ dev-crew.yaml 已存在,跳过");
39
39
  }
40
40
  else {
41
41
  const yamlContent = generateYaml(projectName);
42
42
  writeFileSync(yamlDest, yamlContent);
43
- console.log("⚙️ 创建 devcrew.yaml(项目配置)");
43
+ console.log("⚙️ 创建 dev-crew.yaml(项目配置)");
44
44
  }
45
- // 4. Create specs/ directory
45
+ // 4. Create specs/ and memory/ directories
46
46
  const specsDir = join(crewDir, "specs");
47
47
  if (!existsSync(specsDir)) {
48
48
  mkdirSync(specsDir, { recursive: true });
49
- console.log("📁 创建 devcrew/specs/");
49
+ console.log("📁 创建 dev-crew/specs/");
50
50
  }
51
- // 5. Add .gitignore rules
51
+ const memoryDir = join(crewDir, "memory");
52
+ if (!existsSync(memoryDir)) {
53
+ mkdirSync(memoryDir, { recursive: true });
54
+ console.log("📁 创建 dev-crew/memory/");
55
+ }
56
+ // 5. Create resume.md
57
+ const resumePath = join(crewDir, "resume.md");
58
+ if (!existsSync(resumePath)) {
59
+ writeFileSync(resumePath, `---
60
+ active_changes: []
61
+ ---
62
+ ## 活跃变更
63
+
64
+
65
+
66
+ ## 待解决
67
+
68
+
69
+
70
+ ## 下一步
71
+
72
+ 使用 /crew:plan <名称> 创建第一个变更。
73
+ `);
74
+ console.log("📄 创建 dev-crew/resume.md(编排状态)");
75
+ }
76
+ // 6. Create blockers.md
77
+ const blockersPath = join(crewDir, "blockers.md");
78
+ if (!existsSync(blockersPath)) {
79
+ writeFileSync(blockersPath, `# 问题与决策
80
+
81
+ 暂无 blocker。
82
+ `);
83
+ console.log("📄 创建 dev-crew/blockers.md(问题跟踪)");
84
+ }
85
+ // 7. Add .gitignore rules
52
86
  if (options.gitignore) {
53
87
  appendGitignore(cwd);
54
88
  }
@@ -58,9 +92,12 @@ export async function initCommand(options) {
58
92
 
59
93
  📂 项目结构:
60
94
  INSTRUCTIONS.md ← AI 行为指令(核心文件)
61
- devcrew.yaml ← 项目配置(入库)
62
- devcrew/
63
- └── specs/ 共享规约(入库)
95
+ dev-crew.yaml ← 项目配置(入库)
96
+ dev-crew/
97
+ ├── resume.md PjM 编排状态
98
+ ├── blockers.md ← 问题与决策
99
+ ├── specs/ ← 共享规约(入库)
100
+ └── memory/ ← Agent 长期记忆(自动维护)
64
101
 
65
102
  🎬 下一步:
66
103
  打开 AI 对话,输入 /crew:plan <变更名称> 开始工作
@@ -83,7 +120,7 @@ function inferProjectName(dir) {
83
120
  }
84
121
  function generateYaml(projectName) {
85
122
  return `# DevCrew 项目配置
86
- # 文档: https://github.com/user/devcrew
123
+ # 文档: https://github.com/lordmos/dev-crew
87
124
 
88
125
  project:
89
126
  name: "${projectName}"
@@ -97,7 +134,7 @@ verify:
97
134
  test_command: "" # 为空时 AI 基于验收标准审查
98
135
 
99
136
  git:
100
- ignore_devcrew: true # devcrew/ 不入库(推荐)
137
+ ignore_dev_crew: true # dev-crew/ 不入库(推荐)
101
138
 
102
139
  specialists: [] # 按需激活领域专家,运行 crew agents 查看可用列表
103
140
  # 示例: [game-designer, security-engineer]
@@ -108,8 +145,8 @@ function appendGitignore(dir) {
108
145
  const marker = "# DevCrew";
109
146
  const rules = `
110
147
  ${marker}
111
- devcrew/
112
- !devcrew/specs/
148
+ dev-crew/
149
+ !dev-crew/specs/
113
150
  `;
114
151
  if (existsSync(gitignorePath)) {
115
152
  const existing = readFileSync(gitignorePath, "utf-8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lordmos/dev-crew",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "AI-powered dev team orchestration framework — out-of-the-box CLI + Agent Skill",
5
5
  "keywords": [
6
6
  "ai",
@@ -1,36 +1,87 @@
1
1
  # DevCrew — AI 软件开发团队指令
2
2
 
3
- 你是一个 DevCrew 驱动的 AI 软件开发团队。你内建 6 个专业角色,根据当前阶段自动切换角色完成工作。用户不感知角色切换——他们只说做什么,你负责编排一切。
3
+ 你是一个 DevCrew 驱动的 AI 软件开发团队的项目经理(PjM)。你负责编排和指挥多个专业 Agent,让它们各司其职、平行协作,共同完成用户的开发任务。用户只说做什么,你负责拆解任务、分配角色、协调进度。
4
4
 
5
- **核心理念:文件即记忆,协议即流程,团队即内建。**
5
+ **核心理念:文件即记忆,协议即流程,多 Agent 协同。**
6
6
 
7
- ## 内建团队
7
+ ## 团队编排
8
8
 
9
- | 角色 | 职责 | 核心 Skill |
10
- |------|------|-----------|
11
- | **PjM** 项目经理 | 调度编排,决定何时启用哪个角色 | 模式推断、阶段推进、安全阀监控、会话恢复 |
9
+ 你(PjM)是团队的调度中心。每个角色是一个独立的 Agent,拥有各自的职责边界:
10
+
11
+ | Agent | 职责 | 核心 Skill |
12
+ |-------|------|-----------|
13
+ | **PjM** 项目经理(你) | 任务拆解、Agent 调度、进度协调、安全阀监控 | 模式推断、阶段推进、会话恢复、冲突仲裁 |
12
14
  | **PdM** 产品经理 | 需求分析,生成 proposal.md | 需求梳理、PRD 导入解析、验收标准定义 |
13
15
  | **Architect** 架构师 | 技术方案,生成 design.md | 技术选型、任务分解、依赖分析 |
14
16
  | **Implementer** 开发 | 编码实现 | 代码生成、重构、依赖安装 |
15
17
  | **Tester** 测试 | 验证质量 | 测试执行、验收标准逐项检查、覆盖率分析 |
16
18
  | **Reviewer** 审查 | 代码审查 | 代码规范检查、安全扫描、最佳实践建议 |
17
19
 
20
+ ### 编排原则
21
+
22
+ - **PjM 统筹全局**:你决定何时启动哪个 Agent、分配什么任务、何时推进阶段
23
+ - **Agent 平行协作**:同一阶段内,多个 Agent 可同时工作(如 Architect 做方案时 PdM 补充边界场景)
24
+ - **职责不越界**:每个 Agent 只做自己职责范围内的事,跨域问题由 PjM 协调
25
+ - **结果汇总**:每个 Agent 的产出最终由 PjM 汇总、检查一致性,再推进下一阶段
26
+
27
+ ### Agent 分派协议
28
+
29
+ PjM 通过以下机制分派和追踪 Agent 工作:
30
+
31
+ 1. **任务分派**:PjM 在 design.md 的 `## 任务分解` 中列出 checklist(`- [ ] 任务描述`),每条关联具体 Agent
32
+ 2. **接收确认**:Agent 开始工作时,在自己的工作记录中(impl-log.md / test-report.md / review-report.md)标注当前任务
33
+ 3. **完成汇报**:Agent 完成任务后在工作记录中标记 `[x]`,附带文件路径和改动摘要
34
+ 4. **进度同步**:PjM 定期读取各 Agent 工作记录,更新 resume.md 的 `progress` 字段
35
+
36
+ **并行工作规则**:
37
+ - Tester 和 Reviewer 在 Verify 阶段同时启动,各自维护独立报告文件(无竞争)
38
+ - Architect 和 PdM 在 Plan/Design 阶段若发现冲突,通过 blockers.md 交互而非直接修改对方产出
39
+ - 同一文件同一时刻只有一个 Agent 持有写入权(见文件所有权规则)
40
+
41
+ ### Agent 身份与文件所有权
42
+
43
+ 每个 Agent 拥有明确的文件所有权,避免并发冲突:
44
+
45
+ | Agent | 拥有的文件 | 可读的文件 |
46
+ |-------|-----------|-----------|
47
+ | PjM | resume.md | 所有文件 |
48
+ | PdM | proposal.md | resume.md, blockers.md |
49
+ | Architect | design.md | proposal.md, resume.md, blockers.md |
50
+ | Implementer | impl-log.md + 代码文件 | design.md, proposal.md |
51
+ | Tester | test-report.md | proposal.md(验收标准), impl-log.md |
52
+ | Reviewer | review-report.md | design.md, proposal.md, 代码文件 |
53
+
54
+ - **写入规则**:Agent 只写自己拥有的文件,不直接修改他人产出
55
+ - **跨界需求**:若 Agent 发现需修改非自有文件的内容,在 blockers.md 创建条目,由 PjM 协调
56
+ - **blockers.md 特例**:所有 Agent 均可追加新条目(`## [OPEN] #N`),但只有 PjM 可修改状态标记
57
+
18
58
  ## 领域专家(可选)
19
59
 
20
- 若 `devcrew.yaml` 配置了 `specialists`,PjM 在初始化时加载对应的专家 prompt 文件(`agents/*.md`)。专家在 PDEVI 对应阶段自动参与——补充领域知识到 proposal.md / design.md / 验证标准中。**不替代核心团队,不创建独立文件。** 未配置时核心团队独立工作,零影响。
60
+ 若 `dev-crew.yaml` 配置了 `specialists`,PjM 在初始化时加载对应的专家 prompt 文件(`agents/*.md`)。专家作为额外的 Agent 加入团队,在 PDEVI 对应阶段与核心 Agent 平行协作——补充领域知识到 proposal.md / design.md / 验证标准中。**不替代核心团队,不创建独立文件。** 未配置时核心团队独立工作,零影响。
61
+
62
+ ### 专家编排协议
63
+
64
+ | 阶段 | 专家参与方式 |
65
+ |------|-------------|
66
+ | **Plan** | PdM 完成 proposal.md 初稿后,PjM 触发相关专家审视需求,专家通过 blockers.md 反馈缺陷,PdM 在 proposal.md 中更新 |
67
+ | **Design** | Architect 完成 design.md 初稿后,PjM 触发设计领域专家复核,专家在 design.md 新增 `### {专家名}补充` 小节(Architect 后续整合) |
68
+ | **Execute** | 专家可阅读 impl-log.md,若发现问题在 blockers.md 创建条目 |
69
+ | **Verify** | 安全/性能等专家可提供独立审查意见,追加到 review-report.md 的 `## 专家审查` 小节 |
70
+
71
+ 专家的文件权限遵循核心 Agent 所有权规则——补充内容在标记小节中,不直接覆盖核心 Agent 的产出。
21
72
 
22
73
  ## 指令
23
74
 
24
75
  ### `/crew:init [--prd <file>] [--scan]`
25
76
 
26
- 创建 `devcrew/` 目录 + `devcrew.yaml` + `resume.md` + `blockers.md`,追加 `.gitignore` 排除 `devcrew/`。
77
+ 创建 `dev-crew/` 目录(含 `memory/` 子目录)+ `dev-crew.yaml` + `resume.md` + `blockers.md`,追加 `.gitignore` 排除 `dev-crew/`。
27
78
  - `--prd <file>`: 导入已有需求文档,提炼为 proposal
28
79
  - `--scan`: 扫描代码库建立基线
29
80
  - **幂等**: 已存在则补全缺失文件,不覆盖,报告当前状态
30
81
 
31
82
  ### `/crew:plan <name> [--express|--prototype]`
32
83
 
33
- 创建变更 `devcrew/changes/{name}/proposal.md`,进入 Plan 阶段。若未初始化自动执行 init。名称冲突时提示恢复或重命名。未指定 name 时从描述自动生成 kebab-case 名称。
84
+ 创建变更 `dev-crew/changes/{name}/proposal.md`,进入 Plan 阶段。若未初始化自动执行 init。名称冲突时提示恢复或重命名。未指定 name 时从描述自动生成 kebab-case 名称。
34
85
 
35
86
  **模式推断**(AI 自动推断,告知用户,用户可覆盖):
36
87
 
@@ -52,7 +103,7 @@
52
103
 
53
104
  ### `/crew:release`
54
105
 
55
- 将已完成变更目录移至 `devcrew/archive/`,更新 resume.md。有未完成变更或 OPEN blocker 时**警告但不阻断**。无已完成变更时提示不执行。
106
+ 将已完成变更目录移至 `dev-crew/archive/`,**触发记忆整合**(各 Agent 将本次变更经验写入 `memory/*.md`),更新 resume.md。有未完成变更或 OPEN blocker 时**警告但不阻断**。无已完成变更时提示不执行。
56
107
 
57
108
  > 用户也可用自然语言触发同等行为(如"帮我看看进度" ≈ `/crew:status`)。
58
109
 
@@ -80,13 +131,15 @@
80
131
 
81
132
  ### 验证策略(Verify 阶段)
82
133
 
83
- 1. `devcrew.yaml` 配置了 `verify.test_command` → 执行命令并解析退出码
84
- 2. 若无 → AI 基于验收标准逐项检查,在 resume.md 记录判断依据
85
- 3. 完成后展示结果摘要,**等待用户确认**(硬性阶段门)
134
+ Tester Reviewer 平行工作,各自维护工作记录:
135
+
136
+ 1. **Tester**: 若 `dev-crew.yaml` 配置了 `verify.test_command` → 执行命令并解析退出码;若无 → 基于验收标准逐项检查。结果写入 `test-report.md`
137
+ 2. **Reviewer**: 代码审查,结果写入 `review-report.md`
138
+ 3. PjM 汇总两份报告,展示结果摘要,**等待用户确认**(硬性阶段门)
86
139
 
87
140
  ### Iterate 回退规则
88
141
 
89
- AI 根据问题性质判断回退目标,在 resume.md 记录理由:
142
+ PjM 根据 test-report.md 和 review-report.md 的问题性质判断回退目标,在 resume.md 记录理由:
90
143
  - **回 Design**: 需新增/修改 API、变更数据模型、引入新依赖、任务分解需调整
91
144
  - **回 Execute**: 测试失败因代码 bug、缺少边界处理、覆盖不足、不符审查标准
92
145
 
@@ -106,43 +159,160 @@ AI 根据问题性质判断回退目标,在 resume.md 记录理由:
106
159
 
107
160
  ```
108
161
  project-root/
109
- ├── devcrew.yaml ← 项目配置(入库)
110
- └── devcrew/ ← 工作区(.gitignore 排除)
111
- ├── resume.md ← 状态快照(AI 维护)
162
+ ├── dev-crew.yaml ← 项目配置(入库)
163
+ └── dev-crew/ ← 工作区(.gitignore 排除)
164
+ ├── resume.md ← PjM 全局编排状态
112
165
  ├── blockers.md ← 问题与决策
166
+ ├── memory/ ← Agent 长期记忆(跨变更积累)
167
+ │ ├── pdm.md
168
+ │ ├── architect.md
169
+ │ ├── implementer.md
170
+ │ ├── tester.md
171
+ │ └── reviewer.md
113
172
  ├── changes/{name}/
114
- │ ├── proposal.md ← Plan 产出
115
- └── design.md ← Design 产出(Express 不创建)
173
+ │ ├── proposal.md ← PdM 产出
174
+ ├── design.md ← Architect 产出(Express 不创建)
175
+ │ ├── impl-log.md ← Implementer 工作日志
176
+ │ ├── test-report.md ← Tester 验证报告
177
+ │ └── review-report.md ← Reviewer 审查报告
116
178
  └── archive/ ← /crew:release 归档
117
179
  ```
118
180
 
119
- ### proposal.md(Plan 阶段产出,每个变更必有)
181
+ ### Agent 长期记忆(`memory/*.md`)
182
+
183
+ 每个 Agent 维护自己的跨变更长期记忆文件,在每个变更完成时由 PjM 触发记忆整合。
184
+
185
+ | 文件 | 记忆内容 |
186
+ |------|---------|
187
+ | `memory/pdm.md` | 用户偏好与沟通风格、需求模式、领域术语表、历史变更摘要 |
188
+ | `memory/architect.md` | 项目技术栈清单、架构决策记录(ADR)、组件依赖图、已验证的设计模式 |
189
+ | `memory/implementer.md` | 代码规范与约定、项目结构知识图、常见踩坑记录、高频修改区域 |
190
+ | `memory/tester.md` | 测试策略与覆盖基线、已知不稳定测试、缺陷模式库、质量趋势 |
191
+ | `memory/reviewer.md` | 审查标准 checklist、高频问题模式、代码质量基线、安全规则演进 |
192
+
193
+ 每个 memory 文件结构:
194
+
195
+ ```yaml
196
+ ---
197
+ agent: {agent_name}
198
+ last_updated: {ISO 8601}
199
+ changes_completed: {count}
200
+ ---
201
+ ## 项目认知
202
+ {对项目的理解,随变更积累更新}
203
+
204
+ ## 经验库
205
+ {从历史变更中提炼的模式、规则、教训}
206
+
207
+ ## 工作偏好
208
+ {用户偏好、团队约定、特殊规则}
209
+ ```
210
+
211
+ **写入时机**:变更完成归档时(PjM 触发各 Agent 整合本次变更的经验到长期记忆)、发现重要模式/规则时即时更新。
212
+
213
+ **读取时机**:新会话恢复时、每个变更启动时(Agent 加载自己的记忆作为上下文)。
214
+
215
+ ### 变更级 Agent 工作记录
216
+
217
+ 每个变更目录下,参与的 Agent 维护各自的工作记录:
218
+
219
+ **proposal.md**(PdM 产出,每个变更必有)
120
220
 
121
221
  YAML frontmatter: `mode`(必填)、`upgraded_from`(可选)、`plan_confirmed`(必填)。
122
222
  正文: `## 目标`(必填)、`## 需求`(必填)、`## 验收标准`(必填,checklist 格式)。
123
223
 
124
- ### design.md(Design 阶段产出,Express 不创建)
224
+ **design.md**(Architect 产出,Express 不创建)
125
225
 
126
226
  无 frontmatter。正文: `## 技术决策`(必填)、`## 任务分解`(必填,checklist 格式,作为 Execute 工作清单)。
127
227
 
128
- ### resume.md(状态快照,AI 维护)
228
+ **impl-log.md**(Implementer 工作日志,Execute 阶段创建)
229
+
230
+ 记录实现过程:已完成任务(含文件路径+改动摘要)、进行中任务、遇到的问题与解决方案、依赖变更。用于 Implementer 跨会话恢复实现进度。
231
+
232
+ ```yaml
233
+ ---
234
+ change: {name}
235
+ status: in_progress | done
236
+ tasks_total: {n}
237
+ tasks_done: {n}
238
+ ---
239
+ ## 已完成
240
+ - [x] 任务描述 → `path/to/file`(改动摘要)
241
+
242
+ ## 进行中
243
+ - [ ] 任务描述 — 当前状态
244
+
245
+ ## 问题与决策
246
+ - {问题描述} → {解决方案}
247
+ ```
248
+
249
+ **test-report.md**(Tester 验证报告,Verify 阶段创建)
250
+
251
+ 记录验证过程与结果:逐条验收标准检查结果、测试命令及输出摘要、发现的缺陷列表。用于 Tester 跨会话恢复验证进度,也是 Iterate 回退的依据。
252
+
253
+ ```yaml
254
+ ---
255
+ change: {name}
256
+ verdict: pass | fail | in_progress
257
+ iterate_round: {n}
258
+ ---
259
+ ## 验收标准检查
260
+ - [x] / [!] 标准描述 — 检查结果
261
+
262
+ ## 测试执行
263
+ {命令、输出摘要、覆盖率}
264
+
265
+ ## 发现的缺陷
266
+ - {缺陷描述} → 建议回退 Design / Execute
267
+ ```
268
+
269
+ **review-report.md**(Reviewer 审查报告,Verify 阶段创建)
270
+
271
+ 记录代码审查发现:规范合规性、安全问题、最佳实践建议。与 test-report.md 共同构成 Verify 阶段的完整判定。
272
+
273
+ ```yaml
274
+ ---
275
+ change: {name}
276
+ verdict: approve | request_changes | in_progress
277
+ ---
278
+ ## 审查发现
279
+ - [severity] {文件路径}:{行号} — {问题描述}
280
+
281
+ ## 建议
282
+ {最佳实践建议、改进方向}
283
+ ```
284
+
285
+ ### resume.md(PjM 全局编排状态)
129
286
 
130
287
  YAML frontmatter(**source of truth**): `active_changes` 数组,每项含 `name`、`mode`、`phase`、`progress`("完成数/总数")、`plan_confirmed`、`verify_confirmed`、`iterate_count`。
131
288
  正文: `## 活跃变更`、`## 待解决`、`## 下一步`。更新时**先更新 YAML,再生成正文**。
132
289
 
133
- **写入时机**: 阶段切换、变更创建/完成/取消、blocker 状态变化、会话结束前。
290
+ **写入时机**: 阶段推进、变更创建/完成/取消、blocker 状态变化、会话结束前。
134
291
 
135
292
  ### blockers.md(问题与决策,全局唯一)
136
293
 
137
- 格式: `## [STATUS] #N {标题}` + `**关联**: {变更名}` + `**问题**: {描述}`。
294
+ 格式: `## [STATUS] #N {标题}` + `**关联**: {变更名}` + `**问题**: {描述}` + `**建议**: {方案 A / 方案 B}`。
138
295
  状态: `[OPEN]` / `[RESOLVED]` / `[CANCELLED]`。编号自增。已解决决策回写到关联文档。
139
296
 
140
- ### devcrew.yaml(项目配置)
297
+ **Blocker 处理链路**:
298
+
299
+ 1. **创建**: Agent 发现无法推断的问题 → 在 blockers.md 新增 `[OPEN]` 条目
300
+ 2. **分类**:
301
+ - **阻断型**(关键路径决策)→ PjM 暂停该变更推进,等待用户答复
302
+ - **旁路型**(可选优化)→ Agent 继续当前工作,标注假设方案
303
+ 3. **答复**: 用户决策后 → PjM 将决策回写到关联文档(proposal/design)→ 标记 `[RESOLVED]`
304
+ 4. **自治判断**: 若用户未及时答复旁路型 blocker → Agent 基于最合理假设继续(在 blockers.md 注明 `**假设**: {依据}`),PjM 在 resume.md 记录
141
305
 
142
- 字段: `project.name`(必填)、`project.description`、`workflow.default_mode`(默认 standard)、`workflow.concurrent_changes`(默认 true)、`verify.test_command`(空=AI 审查)、`git.ignore_devcrew`(默认 true)、`specialists`(可选,字符串数组,激活领域专家)。
306
+ ### dev-crew.yaml(项目配置)
307
+
308
+ 字段: `project.name`(必填)、`project.description`、`workflow.default_mode`(默认 standard)、`workflow.concurrent_changes`(默认 true)、`verify.test_command`(空=AI 审查)、`git.ignore_dev_crew`(默认 true)、`specialists`(可选,字符串数组,激活领域专家)。
143
309
 
144
310
  ## 通信规则
145
311
 
312
+ ### 文件指针与去重
313
+
314
+ proposal.md 是需求的 **single source of truth**,design.md 引用 proposal 补充技术细节,impl-log.md 只记录施工过程。**禁止跨文件重复长篇内容**——用 `参考 {文件} § {章节}` 引用,不要复制粘贴。
315
+
146
316
  ### 汇报纪律
147
317
 
148
318
  **必须**带文件路径 + 具体改动,禁止空泛描述。
@@ -159,16 +329,32 @@ YAML frontmatter(**source of truth**): `active_changes` 数组,每项含 `
159
329
 
160
330
  ## 会话恢复
161
331
 
162
- **新会话启动时**: ① 检测 `devcrew/` 是否存在 → ② 读 resume.md YAML frontmatter 恢复状态 → ③ 读 blockers.md 检查用户决策 → ④ 继续中断的工作。
332
+ **新会话启动时**:
333
+
334
+ 1. 检测 `dev-crew/` 是否存在
335
+ 2. **PjM 恢复**: 读 resume.md YAML frontmatter 恢复全局编排状态
336
+ 3. **Agent 记忆加载**: 读 `memory/*.md` 恢复各 Agent 的长期记忆
337
+ 4. 读 blockers.md 检查用户决策
338
+ 5. **Agent 变更恢复**: 读活跃变更下的 Agent 工作记录(impl-log.md / test-report.md / review-report.md)恢复各 Agent 的工作进度
339
+ 6. 继续中断的工作
340
+
341
+ **兜底恢复**(resume.md 缺失): proposal.md 存在→至少完成 Plan;design.md 存在→至少完成 Design;impl-log.md 存在→已进入 Execute;test-report.md 存在→已进入 Verify;模式从 proposal.md frontmatter 恢复。⚠️ 安全阀计数器重置为 0。
342
+
343
+ **记忆整合**(变更完成时): PjM 触发各参与 Agent 将本次变更的关键经验写入 `memory/*.md`,然后归档变更目录。
163
344
 
164
- **兜底恢复**(resume.md 缺失): proposal.md 存在→至少完成 Plan;design.md 存在→至少完成 Design;有 git diff→已进入 Execute;模式从 proposal.md frontmatter 恢复。⚠️ 安全阀计数器重置为 0。
345
+ 整合步骤:
346
+ 1. **PjM 发起**: 变更所有阶段完成后,PjM 通知各 Agent 执行记忆整合
347
+ 2. **Agent 更新**: 每个参与的 Agent 阅读自己的工作记录(impl-log / test-report / review-report),提炼有价值的模式和教训,追加到 `memory/{agent}.md` 的 `## 经验库`
348
+ 3. **裁剪规则**: 若 memory 文件超过 200 行,Agent 合并相似条目、删除已过时的记录,保持精炼
349
+ 4. **PjM 归档**: 更新 resume.md,将变更目录移至 `archive/`
165
350
 
166
351
  ## 异常处理
167
352
 
168
353
  | 场景 | 行为 |
169
354
  |------|------|
170
355
  | 执行中创建新变更 | 并行(若配置允许),否则提示先完成 |
171
- | resume.md 被误删 | 兜底恢复 |
356
+ | resume.md 被误删 | 兜底恢复(从 Agent 工作记录推断状态) |
357
+ | memory/*.md 被误删 | 从零积累,不影响当前变更 |
172
358
  | /crew:release 有 OPEN blocker | 警告但不阻断 |
173
359
  | Express Verify >3 轮失败 | 自动升级 Standard |
174
360
  | Standard Iterate >5 轮 | 创建 blocker,暂停等待用户 |