cowork-flow 0.0.3 → 0.0.5
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 +21 -0
- package/README.md +39 -10
- package/package.json +6 -4
- package/src/lib/copy-template.js +15 -11
- package/src/lib/package-info.js +8 -2
- package/template/.agent/skills/agent-team-execution/SKILL.md +26 -0
- package/template/{.superpowers → .agent/skills}/brainstorming/SKILL.md +1 -1
- package/template/{.superpowers → .agent/skills}/brainstorming/scripts/start-server.sh +0 -0
- package/template/{.superpowers → .agent/skills}/brainstorming/scripts/stop-server.sh +0 -0
- package/template/.agent/skills/record-session/SKILL.md +8 -8
- package/template/.agent/skills/start/SKILL.md +29 -24
- package/template/.cowork-flow/.version +1 -1
- package/template/.cowork-flow/agent-team/adapters.yaml +15 -0
- package/template/.cowork-flow/agent-team/agents.yaml +68 -0
- package/template/.cowork-flow/agent-team/policy.yaml +23 -0
- package/template/.cowork-flow/config.yaml +9 -0
- package/template/.cowork-flow/run +166 -0
- package/template/.cowork-flow/run.cmd +198 -0
- package/template/.cowork-flow/scripts/add_session.py +2 -2
- package/template/.cowork-flow/scripts/agent_team.py +508 -0
- package/template/.cowork-flow/scripts/change.py +5 -11
- package/template/.cowork-flow/scripts/common/agent_team.py +241 -0
- package/template/.cowork-flow/scripts/common/config.py +18 -0
- package/template/.cowork-flow/scripts/common/developer.py +1 -1
- package/template/.cowork-flow/scripts/common/git_context.py +21 -4
- package/template/.cowork-flow/scripts/get_context.py +2 -2
- package/template/.cowork-flow/scripts/init_developer.py +1 -1
- package/template/.cowork-flow/scripts/task.py +45 -45
- package/template/.cowork-flow/workflow.md +61 -175
- package/template/.cowork-flow/workspace/index.md +3 -3
- package/template/.superpowers/executing-plans/SKILL.md +2 -0
- package/template/AGENTS.md +6 -3
- /package/template/{.superpowers → .agent/skills}/brainstorming/scripts/frame-template.html +0 -0
- /package/template/{.superpowers → .agent/skills}/brainstorming/scripts/helper.js +0 -0
- /package/template/{.superpowers → .agent/skills}/brainstorming/scripts/server.cjs +0 -0
- /package/template/{.superpowers → .agent/skills}/brainstorming/spec-document-reviewer-prompt.md +0 -0
- /package/template/{.superpowers → .agent/skills}/brainstorming/visual-companion.md +0 -0
- /package/template/{.superpowers → .agent/skills}/requesting-code-review/SKILL.md +0 -0
- /package/template/{.superpowers → .agent/skills}/requesting-code-review/code-reviewer.md +0 -0
- /package/template/{.superpowers → .agent/skills}/subagent-driven-development/SKILL.md +0 -0
- /package/template/{.superpowers → .agent/skills}/subagent-driven-development/code-quality-reviewer-prompt.md +0 -0
- /package/template/{.superpowers → .agent/skills}/subagent-driven-development/implementer-prompt.md +0 -0
- /package/template/{.superpowers → .agent/skills}/subagent-driven-development/spec-reviewer-prompt.md +0 -0
- /package/template/{.superpowers → .agent/skills}/writing-plans/SKILL.md +0 -0
- /package/template/{.superpowers → .agent/skills}/writing-plans/plan-document-reviewer-prompt.md +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 fisklikewater
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ cowork-flow 是一个用于新项目初始化协作流程的模板仓库。它
|
|
|
28
28
|
└── .cowork-flow/
|
|
29
29
|
├── config.yaml
|
|
30
30
|
├── workflow.md
|
|
31
|
+
├── agent-team/
|
|
31
32
|
├── scripts/
|
|
32
33
|
├── spec/
|
|
33
34
|
├── changes/
|
|
@@ -56,6 +57,9 @@ cowork-flow 是一个用于新项目初始化协作流程的模板仓库。它
|
|
|
56
57
|
`template/.cowork-flow/plans/`
|
|
57
58
|
保存可执行步骤、验证方式和执行状态。
|
|
58
59
|
|
|
60
|
+
`template/.cowork-flow/agent-team/`
|
|
61
|
+
保存 agent team 的项目级 registry、适配器和策略。默认适配器是 `codex`,由主 agent 调度 Codex 子 agent;没有子 agent 能力时可退回 `manual` 提示词模式。
|
|
62
|
+
|
|
59
63
|
## 快速开始
|
|
60
64
|
|
|
61
65
|
使用 CLI 把模板内容安装到目标项目根目录:
|
|
@@ -132,39 +136,64 @@ cowork-flow sync . --dry-run
|
|
|
132
136
|
|
|
133
137
|
## 常用入口
|
|
134
138
|
|
|
139
|
+
模板内置统一入口来运行 Python 工作流脚本:
|
|
140
|
+
|
|
141
|
+
- macOS / Linux / Git Bash / WSL:`./.cowork-flow/run`
|
|
142
|
+
- Windows cmd / PowerShell:`.\.cowork-flow\run.cmd`
|
|
143
|
+
|
|
144
|
+
入口会按 `COWORK_FLOW_PYTHON`、`PYTHON`、`python3`、`python`、`py -3`
|
|
145
|
+
的顺序查找 Python 3.8+ 解释器,避免不同环境中 `python` / `python3`
|
|
146
|
+
命令不一致的问题。
|
|
147
|
+
|
|
148
|
+
下面示例使用 macOS / Linux 写法;Windows 原生命令行中把
|
|
149
|
+
`./.cowork-flow/run` 替换为 `.\.cowork-flow\run.cmd`。
|
|
150
|
+
|
|
135
151
|
初始化或查看开发者身份:
|
|
136
152
|
|
|
137
153
|
```bash
|
|
138
|
-
|
|
139
|
-
|
|
154
|
+
./.cowork-flow/run get-developer
|
|
155
|
+
./.cowork-flow/run init-developer <developer-name>
|
|
140
156
|
```
|
|
141
157
|
|
|
142
158
|
查看当前上下文:
|
|
143
159
|
|
|
144
160
|
```bash
|
|
145
|
-
|
|
146
|
-
|
|
161
|
+
./.cowork-flow/run get-context
|
|
162
|
+
./.cowork-flow/run task list
|
|
147
163
|
```
|
|
148
164
|
|
|
149
165
|
创建并验证行为变更:
|
|
150
166
|
|
|
151
167
|
```bash
|
|
152
|
-
|
|
153
|
-
|
|
168
|
+
./.cowork-flow/run change create <slug>
|
|
169
|
+
./.cowork-flow/run change validate <slug>
|
|
154
170
|
```
|
|
155
171
|
|
|
156
172
|
创建并启动任务:
|
|
157
173
|
|
|
158
174
|
```bash
|
|
159
|
-
|
|
160
|
-
|
|
175
|
+
./.cowork-flow/run task create "<title>" --slug <task-name>
|
|
176
|
+
./.cowork-flow/run task start <task-dir>
|
|
161
177
|
```
|
|
162
178
|
|
|
179
|
+
执行 plan 时准备 agent team:
|
|
180
|
+
|
|
181
|
+
默认 `agent_team.enabled: false`。运行 `agent-team prepare/status/next/record-result/record-review/retry/complete` 前,先在 `.cowork-flow/config.yaml` 中设置 `agent_team.enabled: true`。
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
./.cowork-flow/run agent-team init
|
|
185
|
+
./.cowork-flow/run agent-team prepare <task-dir> --plan <plan-file>
|
|
186
|
+
./.cowork-flow/run agent-team next <task-dir>
|
|
187
|
+
./.cowork-flow/run agent-team complete <task-dir>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
`agent-team` 命令会生成任务目录内的 dispatch plan、assignments、状态、审阅和 metrics 工件。默认 `codex` 适配器采用主 agent 调度型:脚本生成 Codex-ready 分派文件,主 agent 负责调用子 agent、协调并回写结果。
|
|
191
|
+
|
|
163
192
|
记录 session:
|
|
164
193
|
|
|
165
194
|
```bash
|
|
166
|
-
|
|
167
|
-
|
|
195
|
+
./.cowork-flow/run get-context --mode record
|
|
196
|
+
./.cowork-flow/run add-session \
|
|
168
197
|
--title "<session-title>" \
|
|
169
198
|
--commit "<commit-or-handoff-ref>" \
|
|
170
199
|
--summary "<summary>"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cowork-flow",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "CLI for installing and maintaining cowork-flow collaboration templates.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
"bin",
|
|
11
11
|
"src",
|
|
12
12
|
"template",
|
|
13
|
-
"README.md"
|
|
13
|
+
"README.md",
|
|
14
|
+
"!template/**/__pycache__/**",
|
|
15
|
+
"!template/**/*.pyc"
|
|
14
16
|
],
|
|
15
17
|
"scripts": {
|
|
16
18
|
"test": "node --test",
|
|
17
|
-
"test:template": "
|
|
18
|
-
"pack:check": "
|
|
19
|
+
"test:template": "node scripts/run-template-tests.js",
|
|
20
|
+
"pack:check": "node scripts/pack-check.js",
|
|
19
21
|
"test:all": "npm test && npm run test:template && npm run pack:check"
|
|
20
22
|
},
|
|
21
23
|
"engines": {
|
package/src/lib/copy-template.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { constants } from 'node:fs';
|
|
2
|
-
import { access, copyFile, mkdir, readFile, readdir, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { access, chmod, copyFile, mkdir, readFile, readdir, stat, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { dirname, join, relative } from 'node:path';
|
|
4
4
|
|
|
5
5
|
import { templateRoot } from './paths.js';
|
|
@@ -90,9 +90,7 @@ export async function buildSuperpowersPlan(targetDir, options = {}) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
const PROTECTED_SYNC_FILES = new Set([
|
|
93
|
-
'
|
|
94
|
-
'.cowork-flow/config.yaml',
|
|
95
|
-
'.cowork-flow/workflow.md'
|
|
93
|
+
'.cowork-flow/config.yaml'
|
|
96
94
|
]);
|
|
97
95
|
|
|
98
96
|
const PROTECTED_SYNC_PREFIXES = [
|
|
@@ -105,26 +103,30 @@ const PROTECTED_SYNC_PREFIXES = [
|
|
|
105
103
|
|
|
106
104
|
const SAFE_SYNC_PREFIXES = [
|
|
107
105
|
'.agent/skills/',
|
|
108
|
-
'.cowork-flow/
|
|
106
|
+
'.cowork-flow/'
|
|
109
107
|
];
|
|
110
108
|
|
|
111
109
|
const SAFE_SYNC_FILES = new Set([
|
|
112
110
|
'.cowork-flow/.gitignore',
|
|
113
|
-
'.cowork-flow/.version'
|
|
111
|
+
'.cowork-flow/.version',
|
|
112
|
+
'.cowork-flow/run',
|
|
113
|
+
'.cowork-flow/run.cmd'
|
|
114
114
|
]);
|
|
115
115
|
|
|
116
116
|
const COWORK_FLOW_START = '<!-- COWORK-FLOW:START -->';
|
|
117
117
|
const COWORK_FLOW_END = '<!-- COWORK-FLOW:END -->';
|
|
118
118
|
|
|
119
119
|
function isProtectedSyncFile(relativePath) {
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
const templatePath = toTemplatePath(relativePath);
|
|
121
|
+
return PROTECTED_SYNC_FILES.has(templatePath)
|
|
122
|
+
|| PROTECTED_SYNC_PREFIXES.some((prefix) => templatePath.startsWith(prefix));
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
function isSafeSyncFile(relativePath) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
||
|
|
126
|
+
const templatePath = toTemplatePath(relativePath);
|
|
127
|
+
return SAFE_SYNC_FILES.has(templatePath)
|
|
128
|
+
|| SAFE_SYNC_PREFIXES.some((prefix) => templatePath.startsWith(prefix))
|
|
129
|
+
|| templatePath.endsWith('/.gitkeep');
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
function replaceManagedBlock(targetContent, templateContent) {
|
|
@@ -242,6 +244,8 @@ export async function applyPlan(actions, options = {}) {
|
|
|
242
244
|
await writeFile(item.destination, item.content, 'utf8');
|
|
243
245
|
} else {
|
|
244
246
|
await copyFile(item.source, item.destination);
|
|
247
|
+
const sourceStats = await stat(item.source);
|
|
248
|
+
await chmod(item.destination, sourceStats.mode & 0o777);
|
|
245
249
|
}
|
|
246
250
|
}
|
|
247
251
|
}
|
package/src/lib/package-info.js
CHANGED
|
@@ -31,9 +31,14 @@ export function compareVersions(left, right) {
|
|
|
31
31
|
return 0;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
export function npmCommandOptions(platform = process.platform) {
|
|
35
|
+
return platform === 'win32' ? { shell: true } : {};
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
export async function fetchLatestVersion(packageName = 'cowork-flow') {
|
|
35
39
|
const result = await execFileAsync('npm', ['view', packageName, 'version'], {
|
|
36
|
-
encoding: 'utf8'
|
|
40
|
+
encoding: 'utf8',
|
|
41
|
+
...npmCommandOptions()
|
|
37
42
|
});
|
|
38
43
|
return result.stdout.trim();
|
|
39
44
|
}
|
|
@@ -41,7 +46,8 @@ export async function fetchLatestVersion(packageName = 'cowork-flow') {
|
|
|
41
46
|
export async function runGlobalInstall(packageSpec = 'cowork-flow@latest') {
|
|
42
47
|
return new Promise((resolvePromise, rejectPromise) => {
|
|
43
48
|
const child = spawn('npm', ['install', '-g', packageSpec], {
|
|
44
|
-
stdio: 'inherit'
|
|
49
|
+
stdio: 'inherit',
|
|
50
|
+
...npmCommandOptions()
|
|
45
51
|
});
|
|
46
52
|
child.on('error', rejectPromise);
|
|
47
53
|
child.on('close', (code) => resolvePromise(code ?? 1));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-team-execution
|
|
3
|
+
description: Use when executing an approved implementation plan with independent tasks, multiple agents, or an explicit request to use agent team execution
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent Team Execution
|
|
7
|
+
|
|
8
|
+
Use this skill after a task is active and an approved `.cowork-flow/plans/*.md` file is in task context.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
1. Run `./.cowork-flow/run agent-team prepare <task-dir> --plan <plan-file>`.
|
|
13
|
+
2. Review `agent-team/dispatch-plan.yaml` for unsafe parallelism, file conflicts, missing context, or weak agent matches.
|
|
14
|
+
3. Run `./.cowork-flow/run agent-team next <task-dir>` to get ready assignments.
|
|
15
|
+
4. In Codex, dispatch the ready assignments to the recommended agent types. Tell each worker it is not alone in the codebase, must respect the write boundary, must not revert others' edits, and must list changed files.
|
|
16
|
+
5. While workers run, coordinate: answer questions, unblock context gaps, and integrate non-conflicting results.
|
|
17
|
+
6. Record outputs with `record-result` and reviews with `record-review`.
|
|
18
|
+
7. Use `retry` only after adding missing context, changing agent choice, or splitting an oversized assignment.
|
|
19
|
+
8. Run `complete` before claiming the agent team work is done.
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
|
|
23
|
+
- The script suggests; the main agent decides.
|
|
24
|
+
- Do not parallelize assignments with overlapping write files.
|
|
25
|
+
- Do not skip spec review or quality review.
|
|
26
|
+
- Do not rely on chat history for state; write results through `agent-team` commands.
|
|
@@ -110,7 +110,7 @@ digraph brainstorming {
|
|
|
110
110
|
|
|
111
111
|
- Write the validated change artifacts under `.cowork-flow/changes/<slug>/`
|
|
112
112
|
- `proposal.md` explains why the behavior should change
|
|
113
|
-
- `
|
|
113
|
+
- `spec.md` defines external behavior and acceptance criteria
|
|
114
114
|
- `design.md` records important design trade-offs for L2 work
|
|
115
115
|
- (User preferences for spec location override this default)
|
|
116
116
|
- Use elements-of-style:writing-clearly-and-concisely skill if available
|
|
File without changes
|
|
File without changes
|
|
@@ -24,7 +24,7 @@ Do not archive a task while the plan file still shows stale progress.
|
|
|
24
24
|
### Step 1: Get Context & Check Tasks
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
|
|
27
|
+
./.cowork-flow/run get-context --mode record
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
[!] Archive tasks whose work is **actually done** — judge by work status, not the `status` field in task.json:
|
|
@@ -33,20 +33,20 @@ python3 ./.cowork-flow/scripts/get_context.py --mode record
|
|
|
33
33
|
- Don't skip archiving just because `status` still says `planning` or `in_progress`
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
|
|
36
|
+
./.cowork-flow/run task archive <task-name>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
### Step 2: One-Click Add Session
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
42
|
# Method 1: Simple parameters
|
|
43
|
-
|
|
43
|
+
./.cowork-flow/run add-session \
|
|
44
44
|
--title "Session Title" \
|
|
45
45
|
--commit "hash1,hash2" \
|
|
46
46
|
--summary "Brief summary of what was done"
|
|
47
47
|
|
|
48
48
|
# Method 2: Pass detailed content via stdin
|
|
49
|
-
cat << 'EOF' |
|
|
49
|
+
cat << 'EOF' | ./.cowork-flow/run add-session --title "Title" --commit "hash"
|
|
50
50
|
| Feature | Description |
|
|
51
51
|
|---------|-------------|
|
|
52
52
|
| Change | Description |
|
|
@@ -72,7 +72,7 @@ EOF
|
|
|
72
72
|
|
|
73
73
|
| Command | Purpose |
|
|
74
74
|
|---------|---------|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
75
|
+
| `./.cowork-flow/run get-context --mode record` | Get context for record-session |
|
|
76
|
+
| `./.cowork-flow/run add-session --title "..." --commit "..."` | **One-click add session (recommended)** |
|
|
77
|
+
| `./.cowork-flow/run task archive <name>` | Archive completed task (auto-commits) |
|
|
78
|
+
| `./.cowork-flow/run task list` | List active tasks |
|
|
@@ -44,13 +44,17 @@ cat AGENTS.md
|
|
|
44
44
|
- Best practices
|
|
45
45
|
- Project-specific collaboration and documentation rules
|
|
46
46
|
|
|
47
|
+
Command examples use macOS / Linux / Git Bash / WSL syntax. In native Windows
|
|
48
|
+
cmd or PowerShell, replace `./.cowork-flow/run <command>` with
|
|
49
|
+
`.\.cowork-flow\run.cmd <command>`.
|
|
50
|
+
|
|
47
51
|
> **Important**:
|
|
48
52
|
> Reusable skills are already part of the template. During project onboarding, put project-specific facts in `AGENTS.md`, `.cowork-flow/workflow.md`, `.cowork-flow/config.yaml`, and `.cowork-flow/spec/` rather than editing `SKILL.md`.
|
|
49
53
|
|
|
50
54
|
### Step 2: Get Current Context
|
|
51
55
|
|
|
52
56
|
```bash
|
|
53
|
-
|
|
57
|
+
./.cowork-flow/run resume
|
|
54
58
|
```
|
|
55
59
|
|
|
56
60
|
This shows: developer identity, git status, current task (if any), active tasks, and
|
|
@@ -108,9 +112,9 @@ Before entering Task Workflow, classify the change as `L0` / `L1` / `L2` using `
|
|
|
108
112
|
|
|
109
113
|
- `L0`: No external behavior change. Continue with the existing Task Workflow.
|
|
110
114
|
- `L1`: Behavior change in a bounded module. Do **not** go straight to PRD/Research. First run:
|
|
111
|
-
1.
|
|
115
|
+
1. `./.cowork-flow/run change create <slug>`
|
|
112
116
|
2. `superpowers:brainstorming` to create or complete `proposal/spec`
|
|
113
|
-
3.
|
|
117
|
+
3. `./.cowork-flow/run change validate <slug>`
|
|
114
118
|
4. `superpowers:writing-plans` to produce the implementation plan
|
|
115
119
|
- `L2`: Same as `L1`, plus required `design.md`. Multi-perspective review happens after implementation in the review gate.
|
|
116
120
|
|
|
@@ -217,7 +221,7 @@ If unclear, ask clarifying questions.
|
|
|
217
221
|
**Step 2: Create Task Directory** `[AI]`
|
|
218
222
|
|
|
219
223
|
```bash
|
|
220
|
-
TASK_DIR=$(
|
|
224
|
+
TASK_DIR=$(./.cowork-flow/run task create "<title>" --slug <name>)
|
|
221
225
|
```
|
|
222
226
|
|
|
223
227
|
**Step 3: Write PRD** `[AI]`
|
|
@@ -290,7 +294,7 @@ Use this output format:
|
|
|
290
294
|
Initialize default context:
|
|
291
295
|
|
|
292
296
|
```bash
|
|
293
|
-
|
|
297
|
+
./.cowork-flow/run task init-context "$TASK_DIR" <type>
|
|
294
298
|
# type: backend | frontend | fullstack
|
|
295
299
|
```
|
|
296
300
|
|
|
@@ -298,25 +302,25 @@ Add specs found in your research pass:
|
|
|
298
302
|
|
|
299
303
|
```bash
|
|
300
304
|
# For each relevant spec and code pattern:
|
|
301
|
-
|
|
302
|
-
|
|
305
|
+
./.cowork-flow/run task add-context "$TASK_DIR" implement "<path>" "<reason>"
|
|
306
|
+
./.cowork-flow/run task add-context "$TASK_DIR" check "<path>" "<reason>"
|
|
303
307
|
```
|
|
304
308
|
|
|
305
309
|
If this task came through the Behavior Change Gate, add the approved artifacts before coding:
|
|
306
310
|
|
|
307
311
|
```bash
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
312
|
+
./.cowork-flow/run task add-context "$TASK_DIR" implement ".cowork-flow/changes/<slug>/proposal.md" "Approved change proposal"
|
|
313
|
+
./.cowork-flow/run task add-context "$TASK_DIR" implement ".cowork-flow/changes/<slug>/spec.md" "Approved behavior spec"
|
|
314
|
+
./.cowork-flow/run task add-context "$TASK_DIR" implement ".cowork-flow/changes/<slug>/design.md" "Approved design for L2 changes"
|
|
315
|
+
./.cowork-flow/run task add-context "$TASK_DIR" implement ".cowork-flow/plans/YYYY-MM-DD-<slug>.md" "Approved implementation plan"
|
|
316
|
+
./.cowork-flow/run task add-context "$TASK_DIR" check ".cowork-flow/changes/<slug>/spec.md" "Check implementation against approved spec"
|
|
317
|
+
./.cowork-flow/run task add-context "$TASK_DIR" check ".cowork-flow/plans/YYYY-MM-DD-<slug>.md" "Check implementation against approved plan"
|
|
314
318
|
```
|
|
315
319
|
|
|
316
320
|
**Step 7: Activate Task** `[AI]`
|
|
317
321
|
|
|
318
322
|
```bash
|
|
319
|
-
|
|
323
|
+
./.cowork-flow/run task start "$TASK_DIR"
|
|
320
324
|
```
|
|
321
325
|
|
|
322
326
|
This sets `.current-task` so hooks can inject context.
|
|
@@ -332,6 +336,7 @@ Implement the task described in `prd.md`.
|
|
|
332
336
|
- Follow all specs injected into implement context
|
|
333
337
|
- Keep changes scoped to requirements
|
|
334
338
|
- Run the project verification commands from `AGENTS.md` or `.cowork-flow/config.yaml` before finishing
|
|
339
|
+
- If executing an approved plan with independent work, use `agent-team-execution`: run `agent-team prepare`, review the dispatch plan, use `agent-team next` for ready assignments, and finish with `agent-team complete`.
|
|
335
340
|
|
|
336
341
|
**Step 9: Check Quality** `[AI]`
|
|
337
342
|
|
|
@@ -369,10 +374,10 @@ If yes, resume from the appropriate step (usually Step 7 or 8).
|
|
|
369
374
|
When a conversation has many rounds, a task runs for a long time, or context was
|
|
370
375
|
compressed, resume with the smallest useful context:
|
|
371
376
|
|
|
372
|
-
1. Run
|
|
377
|
+
1. Run `./.cowork-flow/run resume`.
|
|
373
378
|
2. Follow the `RESUME CHECKLIST` section.
|
|
374
379
|
3. Read the current task `prd.md`.
|
|
375
|
-
4. Run
|
|
380
|
+
4. Run `./.cowork-flow/run task list-context <task-dir>` and read only the jsonl references needed for the current phase.
|
|
376
381
|
5. If a plan is listed, read its current execution status before continuing implementation.
|
|
377
382
|
|
|
378
383
|
Do not bulk-read `.cowork-flow/spec/`, all plans, all tasks, or workspace journals
|
|
@@ -395,14 +400,14 @@ anchor, then load details on demand.
|
|
|
395
400
|
|
|
396
401
|
| Script | Purpose |
|
|
397
402
|
|--------|---------|
|
|
398
|
-
|
|
|
399
|
-
|
|
|
400
|
-
|
|
|
401
|
-
|
|
|
402
|
-
|
|
|
403
|
-
|
|
|
404
|
-
|
|
|
405
|
-
|
|
|
403
|
+
| `./.cowork-flow/run resume` | Resume session with minimal context checklist |
|
|
404
|
+
| `./.cowork-flow/run get-context` | Get session context |
|
|
405
|
+
| `./.cowork-flow/run task create` | Create task directory |
|
|
406
|
+
| `./.cowork-flow/run task init-context` | Initialize jsonl files |
|
|
407
|
+
| `./.cowork-flow/run task add-context` | Add spec to jsonl |
|
|
408
|
+
| `./.cowork-flow/run task start` | Set current task |
|
|
409
|
+
| `./.cowork-flow/run task finish` | Clear current task |
|
|
410
|
+
| `./.cowork-flow/run task archive` | Archive completed task |
|
|
406
411
|
|
|
407
412
|
### Workflow Phases `[AI]`
|
|
408
413
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.5
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Agent Team Adapters
|
|
2
|
+
|
|
3
|
+
default: codex
|
|
4
|
+
fallback: manual
|
|
5
|
+
|
|
6
|
+
adapters:
|
|
7
|
+
codex:
|
|
8
|
+
mode: coordinator-dispatched
|
|
9
|
+
description: 主 agent 使用 Codex 子 agent 工具执行脚本生成的 assignments。
|
|
10
|
+
output_file: adapters/codex.json
|
|
11
|
+
|
|
12
|
+
manual:
|
|
13
|
+
mode: prompt-only
|
|
14
|
+
description: 生成可复制的 assignment prompt,由人或其他宿主执行并回写结果。
|
|
15
|
+
output_file: adapters/manual.json
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Agent Team Registry
|
|
2
|
+
# Project teams may customize this file after initialization.
|
|
3
|
+
|
|
4
|
+
default_adapter: codex
|
|
5
|
+
|
|
6
|
+
agents:
|
|
7
|
+
implementer:
|
|
8
|
+
codex_type: worker
|
|
9
|
+
capabilities:
|
|
10
|
+
- implementation
|
|
11
|
+
- test-writing
|
|
12
|
+
preferred_task_types:
|
|
13
|
+
- code
|
|
14
|
+
- test
|
|
15
|
+
file_patterns:
|
|
16
|
+
- "src/**"
|
|
17
|
+
- "template/**"
|
|
18
|
+
- "tests/**"
|
|
19
|
+
- "test/**"
|
|
20
|
+
risk_limits:
|
|
21
|
+
max_parallel_write_conflicts: 0
|
|
22
|
+
|
|
23
|
+
spec-reviewer:
|
|
24
|
+
codex_type: default
|
|
25
|
+
capabilities:
|
|
26
|
+
- spec-review
|
|
27
|
+
- acceptance-check
|
|
28
|
+
preferred_task_types:
|
|
29
|
+
- review
|
|
30
|
+
- documentation
|
|
31
|
+
file_patterns:
|
|
32
|
+
- ".cowork-flow/changes/**"
|
|
33
|
+
- ".cowork-flow/plans/**"
|
|
34
|
+
- "README.md"
|
|
35
|
+
- "template/**"
|
|
36
|
+
risk_limits:
|
|
37
|
+
max_parallel_write_conflicts: 0
|
|
38
|
+
|
|
39
|
+
quality-reviewer:
|
|
40
|
+
codex_type: default
|
|
41
|
+
capabilities:
|
|
42
|
+
- code-quality-review
|
|
43
|
+
- test-review
|
|
44
|
+
preferred_task_types:
|
|
45
|
+
- review
|
|
46
|
+
- verification
|
|
47
|
+
file_patterns:
|
|
48
|
+
- "src/**"
|
|
49
|
+
- "template/**"
|
|
50
|
+
- "tests/**"
|
|
51
|
+
- "test/**"
|
|
52
|
+
risk_limits:
|
|
53
|
+
max_parallel_write_conflicts: 0
|
|
54
|
+
|
|
55
|
+
docs-agent:
|
|
56
|
+
codex_type: worker
|
|
57
|
+
capabilities:
|
|
58
|
+
- documentation
|
|
59
|
+
- workflow-writing
|
|
60
|
+
preferred_task_types:
|
|
61
|
+
- docs
|
|
62
|
+
file_patterns:
|
|
63
|
+
- "README.md"
|
|
64
|
+
- "AGENTS.md"
|
|
65
|
+
- ".cowork-flow/**/*.md"
|
|
66
|
+
- ".agent/skills/**"
|
|
67
|
+
risk_limits:
|
|
68
|
+
max_parallel_write_conflicts: 0
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Agent Team Policy
|
|
2
|
+
|
|
3
|
+
parallel:
|
|
4
|
+
allow_parallel_batches: true
|
|
5
|
+
disallow_file_write_conflicts: true
|
|
6
|
+
require_coordinator_review: true
|
|
7
|
+
|
|
8
|
+
reviews:
|
|
9
|
+
require_spec_review: true
|
|
10
|
+
require_quality_review: true
|
|
11
|
+
chain:
|
|
12
|
+
- implementer
|
|
13
|
+
- spec-reviewer
|
|
14
|
+
- quality-reviewer
|
|
15
|
+
|
|
16
|
+
retry:
|
|
17
|
+
max_attempts: 3
|
|
18
|
+
retry_on:
|
|
19
|
+
- needs_context
|
|
20
|
+
- failed_verification
|
|
21
|
+
- review_rejected
|
|
22
|
+
- adapter_failed
|
|
23
|
+
escalation: needs-coordinator-decision
|
|
@@ -14,6 +14,15 @@ session_commit_message: "chore: record journal"
|
|
|
14
14
|
# Maximum lines per journal file before rotating to a new one
|
|
15
15
|
max_journal_lines: 2000
|
|
16
16
|
|
|
17
|
+
#-------------------------------------------------------------------------------
|
|
18
|
+
# Agent Team Runtime
|
|
19
|
+
#-------------------------------------------------------------------------------
|
|
20
|
+
|
|
21
|
+
# Disabled by default. Set to true before using agent-team runtime commands such
|
|
22
|
+
# as prepare/status/next/record-result/record-review/retry/complete.
|
|
23
|
+
agent_team:
|
|
24
|
+
enabled: false
|
|
25
|
+
|
|
17
26
|
#-------------------------------------------------------------------------------
|
|
18
27
|
# Task Lifecycle Hooks
|
|
19
28
|
#-------------------------------------------------------------------------------
|