cowork-flow 0.0.2 → 0.0.4
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 +23 -11
- package/package.json +2 -2
- package/src/lib/copy-template.js +56 -2
- package/template/.agent/skills/record-session/SKILL.md +8 -8
- package/template/.agent/skills/start/SKILL.md +75 -38
- package/template/.cowork-flow/.version +1 -1
- package/template/.cowork-flow/run +162 -0
- package/template/.cowork-flow/run.cmd +191 -0
- package/template/.cowork-flow/scripts/add_session.py +2 -2
- package/template/.cowork-flow/scripts/change.py +5 -11
- package/template/.cowork-flow/scripts/common/developer.py +1 -1
- package/template/.cowork-flow/scripts/common/git_context.py +142 -5
- 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/resume.py +21 -0
- package/template/.cowork-flow/scripts/task.py +116 -42
- package/template/.cowork-flow/spec/guides/pre-implementation-checklist.md +1 -1
- package/template/.cowork-flow/workflow.md +43 -19
- package/template/.cowork-flow/workspace/index.md +3 -3
- package/template/.superpowers/brainstorming/SKILL.md +5 -2
- package/template/.superpowers/brainstorming/spec-document-reviewer-prompt.md +1 -1
- package/template/.superpowers/requesting-code-review/SKILL.md +1 -1
- package/template/.superpowers/subagent-driven-development/SKILL.md +1 -1
- package/template/.superpowers/writing-plans/SKILL.md +2 -2
- package/template/AGENTS.md +13 -3
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
Task Management Script for cowork-flow workflow.
|
|
5
5
|
|
|
6
6
|
Usage:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
./.cowork-flow/run task create "<title>" [--slug <name>] [--assignee <dev>] [--priority P0|P1|P2|P3] [--parent <dir>]
|
|
8
|
+
./.cowork-flow/run task init-context <dir> <type> # Initialize jsonl files
|
|
9
|
+
./.cowork-flow/run task add-context <dir> <file> <path> [reason] # Add jsonl entry
|
|
10
|
+
./.cowork-flow/run task validate <dir> # Validate jsonl files
|
|
11
|
+
./.cowork-flow/run task list-context <dir> # List jsonl entries
|
|
12
|
+
./.cowork-flow/run task start <dir> # Set as current task
|
|
13
|
+
./.cowork-flow/run task finish # Clear current task
|
|
14
|
+
./.cowork-flow/run task archive <task-name> # Archive completed task
|
|
15
|
+
./.cowork-flow/run task list # List active tasks
|
|
16
|
+
./.cowork-flow/run task list-archive [month] # List archived tasks
|
|
17
|
+
./.cowork-flow/run task add-subtask <parent-dir> <child-dir> # Link child to parent
|
|
18
|
+
./.cowork-flow/run task remove-subtask <parent-dir> <child-dir> # Unlink child from parent
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
from __future__ import annotations
|
|
@@ -382,7 +382,10 @@ def _resolve_task_dir(target_dir: str, repo_root: Path) -> Path:
|
|
|
382
382
|
def get_implement_base() -> list[dict]:
|
|
383
383
|
"""Get base implement context entries."""
|
|
384
384
|
return [
|
|
385
|
+
{"file": "AGENTS.md", "reason": "Project collaboration rules and workflow gates"},
|
|
385
386
|
{"file": f"{DIR_WORKFLOW}/workflow.md", "reason": "Project workflow and conventions"},
|
|
387
|
+
{"file": f"{DIR_WORKFLOW}/{DIR_SPEC}/guides/index.md", "reason": "Pre-implementation thinking guides"},
|
|
388
|
+
{"file": f"{DIR_WORKFLOW}/{DIR_SPEC}/guides/pre-implementation-checklist.md", "reason": "Mandatory pre-coding checklist"},
|
|
386
389
|
]
|
|
387
390
|
|
|
388
391
|
|
|
@@ -408,6 +411,7 @@ def get_check_context(dev_type: str, repo_root: Path) -> list[dict]:
|
|
|
408
411
|
"""Get check context entries."""
|
|
409
412
|
entries = [
|
|
410
413
|
{"file": _skill_path("finish-work"), "reason": "Finish work checklist"},
|
|
414
|
+
{"file": _skill_path("record-session"), "reason": "Session recording and state sync"},
|
|
411
415
|
]
|
|
412
416
|
|
|
413
417
|
if dev_type in ("backend", "frontend", "fullstack"):
|
|
@@ -420,6 +424,7 @@ def get_debug_context(dev_type: str, repo_root: Path) -> list[dict]:
|
|
|
420
424
|
"""Get debug context entries."""
|
|
421
425
|
entries: list[dict] = [
|
|
422
426
|
{"file": _skill_path("break-loop"), "reason": "Deep bug analysis workflow"},
|
|
427
|
+
{"file": _skill_path("update-spec"), "reason": "Capture implementation lessons and contracts"},
|
|
423
428
|
]
|
|
424
429
|
|
|
425
430
|
if dev_type in ("backend", "frontend", "fullstack"):
|
|
@@ -434,6 +439,53 @@ def _write_jsonl(path: Path, entries: list[dict]) -> None:
|
|
|
434
439
|
path.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
|
435
440
|
|
|
436
441
|
|
|
442
|
+
def _read_text_if_present(path: Path) -> str:
|
|
443
|
+
"""读取文本文件并返回去空白后的内容;不存在或读取失败时返回空字符串。"""
|
|
444
|
+
if not path.is_file():
|
|
445
|
+
return ""
|
|
446
|
+
|
|
447
|
+
try:
|
|
448
|
+
return path.read_text(encoding="utf-8").strip()
|
|
449
|
+
except (OSError, IOError):
|
|
450
|
+
return ""
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
def _task_start_blockers(task_dir: Path) -> list[str]:
|
|
454
|
+
"""返回启动任务前必须处理的准备阻塞项。"""
|
|
455
|
+
blockers: list[str] = []
|
|
456
|
+
|
|
457
|
+
task_json = task_dir / FILE_TASK_JSON
|
|
458
|
+
if not task_json.is_file():
|
|
459
|
+
blockers.append("task.json is missing")
|
|
460
|
+
|
|
461
|
+
prd_file = task_dir / "prd.md"
|
|
462
|
+
if not _read_text_if_present(prd_file):
|
|
463
|
+
blockers.append("prd.md is missing or empty")
|
|
464
|
+
|
|
465
|
+
for jsonl_name in CONTEXT_JSONL_FILES:
|
|
466
|
+
jsonl_file = task_dir / jsonl_name
|
|
467
|
+
if not _read_text_if_present(jsonl_file):
|
|
468
|
+
blockers.append(f"{jsonl_name} is missing or empty")
|
|
469
|
+
|
|
470
|
+
return blockers
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
def _task_context_validation_issues(task_dir: Path, repo_root: Path) -> list[str]:
|
|
474
|
+
"""返回任务上下文文件的校验问题。"""
|
|
475
|
+
issues: list[str] = []
|
|
476
|
+
|
|
477
|
+
for jsonl_name in CONTEXT_JSONL_FILES:
|
|
478
|
+
jsonl_file = task_dir / jsonl_name
|
|
479
|
+
if not _read_text_if_present(jsonl_file):
|
|
480
|
+
continue
|
|
481
|
+
|
|
482
|
+
error_count = _validate_jsonl(jsonl_file, repo_root)
|
|
483
|
+
if error_count > 0:
|
|
484
|
+
issues.append(f"{jsonl_name} has {error_count} validation error(s)")
|
|
485
|
+
|
|
486
|
+
return issues
|
|
487
|
+
|
|
488
|
+
|
|
437
489
|
def _iter_jsonl_lines(path: Path):
|
|
438
490
|
"""Yield line number and content from a JSONL file."""
|
|
439
491
|
with path.open("r", encoding="utf-8") as f:
|
|
@@ -578,8 +630,8 @@ def cmd_create(args: argparse.Namespace) -> int:
|
|
|
578
630
|
print("", file=sys.stderr)
|
|
579
631
|
print(colored("Next steps:", Colors.BLUE), file=sys.stderr)
|
|
580
632
|
print(" 1. Create prd.md with requirements", file=sys.stderr)
|
|
581
|
-
print(" 2. Run:
|
|
582
|
-
print(" 3. Run:
|
|
633
|
+
print(" 2. Run: ./.cowork-flow/run task init-context <dir> <dev_type>", file=sys.stderr)
|
|
634
|
+
print(" 3. Run: ./.cowork-flow/run task start <dir>", file=sys.stderr)
|
|
583
635
|
print("", file=sys.stderr)
|
|
584
636
|
|
|
585
637
|
# Output relative path for script chaining
|
|
@@ -601,7 +653,7 @@ def cmd_init_context(args: argparse.Namespace) -> int:
|
|
|
601
653
|
|
|
602
654
|
if not dev_type:
|
|
603
655
|
print(colored("Error: Missing arguments", Colors.RED))
|
|
604
|
-
print("Usage:
|
|
656
|
+
print("Usage: ./.cowork-flow/run task init-context <task-dir> <dev_type>")
|
|
605
657
|
print(" dev_type: backend | frontend | fullstack | test | docs")
|
|
606
658
|
return 1
|
|
607
659
|
|
|
@@ -647,8 +699,8 @@ def cmd_init_context(args: argparse.Namespace) -> int:
|
|
|
647
699
|
print(colored("[OK] All context files created", Colors.GREEN))
|
|
648
700
|
print()
|
|
649
701
|
print(colored("Next steps:", Colors.BLUE))
|
|
650
|
-
print(" 1. Add task-specific specs:
|
|
651
|
-
print(" 2. Set as current:
|
|
702
|
+
print(" 1. Add task-specific specs: ./.cowork-flow/run task add-context <dir> <jsonl> <path>")
|
|
703
|
+
print(" 2. Set as current: ./.cowork-flow/run task start <dir>")
|
|
652
704
|
|
|
653
705
|
return 0
|
|
654
706
|
|
|
@@ -856,6 +908,28 @@ def cmd_start(args: argparse.Namespace) -> int:
|
|
|
856
908
|
print(f"Hint: Use task name (e.g., 'my-task') or full path (e.g., '{DIR_WORKFLOW}/tasks/01-31-my-task')")
|
|
857
909
|
return 1
|
|
858
910
|
|
|
911
|
+
blockers = _task_start_blockers(full_path)
|
|
912
|
+
if blockers:
|
|
913
|
+
print(colored("Error: Task is not ready to start yet", Colors.RED), file=sys.stderr)
|
|
914
|
+
for blocker in blockers:
|
|
915
|
+
print(f" - {blocker}", file=sys.stderr)
|
|
916
|
+
print(
|
|
917
|
+
"Hint: write prd.md, run ./.cowork-flow/run task init-context <dir> <dev_type>, then retry",
|
|
918
|
+
file=sys.stderr,
|
|
919
|
+
)
|
|
920
|
+
return 1
|
|
921
|
+
|
|
922
|
+
validation_issues = _task_context_validation_issues(full_path, repo_root)
|
|
923
|
+
if validation_issues:
|
|
924
|
+
print(colored("Error: Task context validation failed", Colors.RED), file=sys.stderr)
|
|
925
|
+
for issue in validation_issues:
|
|
926
|
+
print(f" - {issue}", file=sys.stderr)
|
|
927
|
+
print(
|
|
928
|
+
"Hint: run ./.cowork-flow/run task validate <dir> and fix the reported issues",
|
|
929
|
+
file=sys.stderr,
|
|
930
|
+
)
|
|
931
|
+
return 1
|
|
932
|
+
|
|
859
933
|
# Convert to relative path for storage
|
|
860
934
|
try:
|
|
861
935
|
task_dir = str(full_path.relative_to(repo_root))
|
|
@@ -1237,19 +1311,19 @@ def show_usage() -> None:
|
|
|
1237
1311
|
print("""Task Management Script for cowork-flow workflow
|
|
1238
1312
|
|
|
1239
1313
|
Usage:
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1314
|
+
./.cowork-flow/run task create <title> Create new task directory
|
|
1315
|
+
./.cowork-flow/run task create <title> --parent <dir> Create task as child of parent
|
|
1316
|
+
./.cowork-flow/run task init-context <dir> <dev_type> Initialize jsonl files
|
|
1317
|
+
./.cowork-flow/run task add-context <dir> <jsonl> <path> [reason] Add entry to jsonl
|
|
1318
|
+
./.cowork-flow/run task validate <dir> Validate jsonl files
|
|
1319
|
+
./.cowork-flow/run task list-context <dir> List jsonl entries
|
|
1320
|
+
./.cowork-flow/run task start <dir> Set as current task
|
|
1321
|
+
./.cowork-flow/run task finish Clear current task
|
|
1322
|
+
./.cowork-flow/run task archive <task-name> Archive completed task
|
|
1323
|
+
./.cowork-flow/run task add-subtask <parent> <child> Link child task to parent
|
|
1324
|
+
./.cowork-flow/run task remove-subtask <parent> <child> Unlink child from parent
|
|
1325
|
+
./.cowork-flow/run task list [--mine] [--status <status>] List tasks
|
|
1326
|
+
./.cowork-flow/run task list-archive [YYYY-MM] List archived tasks
|
|
1253
1327
|
|
|
1254
1328
|
Arguments:
|
|
1255
1329
|
dev_type: backend | frontend | fullstack | test | docs
|
|
@@ -1259,18 +1333,18 @@ List options:
|
|
|
1259
1333
|
--status, -s <s> Filter by status (planning, in_progress, review, completed)
|
|
1260
1334
|
|
|
1261
1335
|
Examples:
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1336
|
+
./.cowork-flow/run task create "Add login feature" --slug add-login
|
|
1337
|
+
./.cowork-flow/run task create "Child task" --slug child --parent .cowork-flow/tasks/01-21-parent
|
|
1338
|
+
./.cowork-flow/run task init-context .cowork-flow/tasks/01-21-add-login backend
|
|
1339
|
+
./.cowork-flow/run task add-context <dir> implement .cowork-flow/spec/backend/auth.md "Auth guidelines"
|
|
1340
|
+
./.cowork-flow/run task start .cowork-flow/tasks/01-21-add-login
|
|
1341
|
+
./.cowork-flow/run task finish
|
|
1342
|
+
./.cowork-flow/run task archive add-login
|
|
1343
|
+
./.cowork-flow/run task add-subtask parent-task child-task # Link existing tasks
|
|
1344
|
+
./.cowork-flow/run task remove-subtask parent-task child-task
|
|
1345
|
+
./.cowork-flow/run task list # List all active tasks
|
|
1346
|
+
./.cowork-flow/run task list --mine # List my tasks only
|
|
1347
|
+
./.cowork-flow/run task list --mine --status in_progress # List my in-progress tasks
|
|
1274
1348
|
""")
|
|
1275
1349
|
|
|
1276
1350
|
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
所有任务都应先明确目标和验收标准,再进入实现;所有完成结论都必须有验证证据支撑。
|
|
12
12
|
|
|
13
|
+
命令示例默认使用 macOS / Linux / Git Bash / WSL 写法;Windows cmd / PowerShell 中使用 `.\.cowork-flow\run.cmd <command>` 替代 `./.cowork-flow/run <command>`。
|
|
14
|
+
|
|
13
15
|
---
|
|
14
16
|
|
|
15
17
|
## 2. 职责边界
|
|
@@ -70,8 +72,8 @@
|
|
|
70
72
|
首次进入项目时执行:
|
|
71
73
|
|
|
72
74
|
```bash
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
./.cowork-flow/run get-developer
|
|
76
|
+
./.cowork-flow/run init-developer <developer-name>
|
|
75
77
|
```
|
|
76
78
|
|
|
77
79
|
如果已经存在开发者身份,只需读取当前身份。
|
|
@@ -81,8 +83,8 @@ python3 ./.cowork-flow/scripts/init_developer.py <developer-name>
|
|
|
81
83
|
每次开始工作先执行:
|
|
82
84
|
|
|
83
85
|
```bash
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
./.cowork-flow/run resume
|
|
87
|
+
./.cowork-flow/run task list
|
|
86
88
|
git status
|
|
87
89
|
git log --oneline -10
|
|
88
90
|
```
|
|
@@ -167,8 +169,8 @@ cowork-flow change -> brainstorming -> design.md -> writing-plans -> 任务上
|
|
|
167
169
|
### 6.1 创建或选择任务
|
|
168
170
|
|
|
169
171
|
```bash
|
|
170
|
-
|
|
171
|
-
|
|
172
|
+
./.cowork-flow/run task list
|
|
173
|
+
./.cowork-flow/run task create "<title>" --slug <task-name>
|
|
172
174
|
```
|
|
173
175
|
|
|
174
176
|
### 6.2 写入任务 PRD
|
|
@@ -184,7 +186,7 @@ python3 ./.cowork-flow/scripts/task.py create "<title>" --slug <task-name>
|
|
|
184
186
|
### 6.3 初始化任务上下文
|
|
185
187
|
|
|
186
188
|
```bash
|
|
187
|
-
|
|
189
|
+
./.cowork-flow/run task init-context <task-dir> <type>
|
|
188
190
|
```
|
|
189
191
|
|
|
190
192
|
`<type>` 按任务选择:
|
|
@@ -200,14 +202,14 @@ python3 ./.cowork-flow/scripts/task.py init-context <task-dir> <type>
|
|
|
200
202
|
把任务相关规范、代码模式、计划文件加入上下文:
|
|
201
203
|
|
|
202
204
|
```bash
|
|
203
|
-
|
|
204
|
-
|
|
205
|
+
./.cowork-flow/run task add-context <task-dir> implement <path> "<reason>"
|
|
206
|
+
./.cowork-flow/run task add-context <task-dir> check <path> "<reason>"
|
|
205
207
|
```
|
|
206
208
|
|
|
207
209
|
### 6.5 激活任务并执行
|
|
208
210
|
|
|
209
211
|
```bash
|
|
210
|
-
|
|
212
|
+
./.cowork-flow/run task start <task-dir>
|
|
211
213
|
```
|
|
212
214
|
|
|
213
215
|
执行要求:
|
|
@@ -225,7 +227,7 @@ python3 ./.cowork-flow/scripts/task.py start <task-dir>
|
|
|
225
227
|
### 7.1 创建 cowork-flow change
|
|
226
228
|
|
|
227
229
|
```bash
|
|
228
|
-
|
|
230
|
+
./.cowork-flow/run change create <slug>
|
|
229
231
|
```
|
|
230
232
|
|
|
231
233
|
### 7.2 使用 brainstorming 形成方案
|
|
@@ -233,13 +235,13 @@ python3 ./.cowork-flow/scripts/change.py create <slug>
|
|
|
233
235
|
使用 `superpowers:brainstorming` 澄清需求、比较方案,并补齐:
|
|
234
236
|
|
|
235
237
|
- `.cowork-flow/changes/<slug>/proposal.md`
|
|
236
|
-
- `.cowork-flow/changes/<slug>/
|
|
238
|
+
- `.cowork-flow/changes/<slug>/spec.md`
|
|
237
239
|
- L2 任务需要 `.cowork-flow/changes/<slug>/design.md`
|
|
238
240
|
|
|
239
241
|
### 7.3 校验 cowork-flow change
|
|
240
242
|
|
|
241
243
|
```bash
|
|
242
|
-
|
|
244
|
+
./.cowork-flow/run change validate <slug>
|
|
243
245
|
```
|
|
244
246
|
|
|
245
247
|
### 7.4 使用 writing-plans 形成计划
|
|
@@ -345,8 +347,8 @@ L2 任务完成前需要多视角审阅:
|
|
|
345
347
|
### 9.2 记录 session
|
|
346
348
|
|
|
347
349
|
```bash
|
|
348
|
-
|
|
349
|
-
|
|
350
|
+
./.cowork-flow/run get-context --mode record
|
|
351
|
+
./.cowork-flow/run add-session \
|
|
350
352
|
--title "<session-title>" \
|
|
351
353
|
--commit "<commit-or-handoff-ref>" \
|
|
352
354
|
--summary "<summary>"
|
|
@@ -357,13 +359,13 @@ python3 ./.cowork-flow/scripts/add_session.py \
|
|
|
357
359
|
仅在任务真实完成后归档:
|
|
358
360
|
|
|
359
361
|
```bash
|
|
360
|
-
|
|
362
|
+
./.cowork-flow/run task archive <task-name>
|
|
361
363
|
```
|
|
362
364
|
|
|
363
365
|
行为变更任务还需要归档 cowork-flow change:
|
|
364
366
|
|
|
365
367
|
```bash
|
|
366
|
-
|
|
368
|
+
./.cowork-flow/run change archive <slug>
|
|
367
369
|
```
|
|
368
370
|
|
|
369
371
|
---
|
|
@@ -387,7 +389,29 @@ python3 ./.cowork-flow/scripts/change.py archive <slug>
|
|
|
387
389
|
|
|
388
390
|
---
|
|
389
391
|
|
|
390
|
-
## 11.
|
|
392
|
+
## 11. 恢复与上下文压缩
|
|
393
|
+
|
|
394
|
+
多轮对话、长任务、中断恢复或上下文压缩后,必须先走最小恢复层,再按需读取细节。
|
|
395
|
+
|
|
396
|
+
| 层级 | 读取内容 | 使用时机 |
|
|
397
|
+
|------|----------|----------|
|
|
398
|
+
| 最小恢复层 | `resume.py` 输出中的 `RESUME CHECKLIST` | 每次恢复、压缩后、重新接手任务 |
|
|
399
|
+
| 任务执行层 | 当前任务 `prd.md`、当前 plan 状态、`task.py list-context <task-dir>` | 准备继续实现或检查前 |
|
|
400
|
+
| 细节规范层 | jsonl 指向的具体 spec、代码模式或计划段落 | 当前修改确实需要该细节时 |
|
|
401
|
+
|
|
402
|
+
恢复规则:
|
|
403
|
+
|
|
404
|
+
- 先执行 `./.cowork-flow/run resume`。
|
|
405
|
+
- 按 `RESUME CHECKLIST` 读取当前 PRD、当前 plan 和 `list-context` 输出。
|
|
406
|
+
- 不要全量重读 `.cowork-flow/spec/`、所有 plan、所有 task 或 workspace journal。
|
|
407
|
+
- 如果 plan 有 `Current Execution Status`,先读该段以确定下一步。
|
|
408
|
+
- 如果 jsonl 指向的规范过多,先根据当前阶段选择最小相关集合。
|
|
409
|
+
|
|
410
|
+
恢复目标是重建“现在该做什么”和“当前门禁是否满足”,不是把全部历史重新塞进上下文。
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
## 12. 禁止事项
|
|
391
415
|
|
|
392
416
|
- 不跳过上下文读取直接编码。
|
|
393
417
|
- 不在未验证时声称完成。
|
|
@@ -398,7 +422,7 @@ python3 ./.cowork-flow/scripts/change.py archive <slug>
|
|
|
398
422
|
|
|
399
423
|
---
|
|
400
424
|
|
|
401
|
-
##
|
|
425
|
+
## 13. 完成定义
|
|
402
426
|
|
|
403
427
|
一个任务只有在以下条件同时满足时,才算完成:
|
|
404
428
|
|
|
@@ -33,14 +33,14 @@ workspace/
|
|
|
33
33
|
### 新开发者
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
|
|
36
|
+
./.cowork-flow/run init-developer <your-name>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
### 已初始化开发者
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
|
|
43
|
-
cat .cowork-flow/workspace/$(
|
|
42
|
+
./.cowork-flow/run get-developer
|
|
43
|
+
cat .cowork-flow/workspace/$(./.cowork-flow/run get-developer)/index.md
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
---
|
|
@@ -26,7 +26,7 @@ You MUST create a task for each of these items and complete them in order:
|
|
|
26
26
|
3. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
|
|
27
27
|
4. **Propose 2-3 approaches** — with trade-offs and your recommendation
|
|
28
28
|
5. **Present design** — in sections scaled to their complexity, get user approval after each section
|
|
29
|
-
6. **Write
|
|
29
|
+
6. **Write change artifacts** — save proposal/spec/design in `.cowork-flow/changes/<slug>/` and commit
|
|
30
30
|
7. **Spec self-review** — quick inline check for placeholders, contradictions, ambiguity, scope (see below)
|
|
31
31
|
8. **User reviews written spec** — ask user to review the spec file before proceeding
|
|
32
32
|
9. **Transition to implementation** — invoke writing-plans skill to create implementation plan
|
|
@@ -108,7 +108,10 @@ digraph brainstorming {
|
|
|
108
108
|
|
|
109
109
|
**Documentation:**
|
|
110
110
|
|
|
111
|
-
- Write the validated
|
|
111
|
+
- Write the validated change artifacts under `.cowork-flow/changes/<slug>/`
|
|
112
|
+
- `proposal.md` explains why the behavior should change
|
|
113
|
+
- `spec.md` defines external behavior and acceptance criteria
|
|
114
|
+
- `design.md` records important design trade-offs for L2 work
|
|
112
115
|
- (User preferences for spec location override this default)
|
|
113
116
|
- Use elements-of-style:writing-clearly-and-concisely skill if available
|
|
114
117
|
- Commit the design document to git
|
|
@@ -4,7 +4,7 @@ Use this template when dispatching a spec document reviewer subagent.
|
|
|
4
4
|
|
|
5
5
|
**Purpose:** Verify the spec is complete, consistent, and ready for implementation planning.
|
|
6
6
|
|
|
7
|
-
**Dispatch after:** Spec document is written
|
|
7
|
+
**Dispatch after:** Spec or design document is written under `.cowork-flow/changes/<slug>/`
|
|
8
8
|
|
|
9
9
|
```
|
|
10
10
|
Task tool (general-purpose):
|
|
@@ -57,7 +57,7 @@ HEAD_SHA=$(git rev-parse HEAD)
|
|
|
57
57
|
|
|
58
58
|
[Dispatch code reviewer subagent]
|
|
59
59
|
DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
|
|
60
|
-
PLAN_OR_REQUIREMENTS: Task 2 from
|
|
60
|
+
PLAN_OR_REQUIREMENTS: Task 2 from .cowork-flow/plans/deployment-plan.md
|
|
61
61
|
BASE_SHA: a7981ec
|
|
62
62
|
HEAD_SHA: 3df7661
|
|
63
63
|
|
|
@@ -130,7 +130,7 @@ Implementer subagents report one of four statuses. Handle each appropriately:
|
|
|
130
130
|
```
|
|
131
131
|
You: I'm using Subagent-Driven Development to execute this plan.
|
|
132
132
|
|
|
133
|
-
[Read plan file once:
|
|
133
|
+
[Read plan file once: .cowork-flow/plans/feature-plan.md]
|
|
134
134
|
[Extract all 5 tasks with full text and context]
|
|
135
135
|
[Create TodoWrite with all tasks]
|
|
136
136
|
|
|
@@ -15,7 +15,7 @@ Assume they are a skilled developer, but know almost nothing about our toolset o
|
|
|
15
15
|
|
|
16
16
|
**Context:** If working in an isolated worktree, it should have been created via the `superpowers:using-git-worktrees` skill at execution time.
|
|
17
17
|
|
|
18
|
-
**Save plans to:**
|
|
18
|
+
**Save plans to:** `.cowork-flow/plans/YYYY-MM-DD-<feature-name>.md`
|
|
19
19
|
- (User preferences for plan location override this default)
|
|
20
20
|
|
|
21
21
|
## Scope Check
|
|
@@ -135,7 +135,7 @@ If you find issues, fix them inline. No need to re-review — just fix and move
|
|
|
135
135
|
|
|
136
136
|
After saving the plan, offer execution choice:
|
|
137
137
|
|
|
138
|
-
**"Plan complete and saved to
|
|
138
|
+
**"Plan complete and saved to `.cowork-flow/plans/<filename>.md`. Two execution options:**
|
|
139
139
|
|
|
140
140
|
**1. Subagent-Driven (recommended)** - I dispatch a fresh subagent per task, review between tasks, fast iteration
|
|
141
141
|
|
package/template/AGENTS.md
CHANGED
|
@@ -95,14 +95,24 @@
|
|
|
95
95
|
- 如果跟丢上下文,先停下来重新整理。
|
|
96
96
|
|
|
97
97
|
<!-- COWORK-FLOW:START -->
|
|
98
|
-
# cowork-flow
|
|
98
|
+
# cowork-flow 强门禁
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
若与项目自定义说明冲突,以项目说明和用户明确指令为准。
|
|
101
|
+
|
|
102
|
+
命令示例默认使用 macOS / Linux / Git Bash / WSL 写法;Windows cmd / PowerShell 中使用 `.\.cowork-flow\run.cmd <command>` 替代 `./.cowork-flow/run <command>`。
|
|
103
|
+
|
|
104
|
+
1. 每次新会话、重新接手任务、或上下文明显丢失时,先执行 `./.cowork-flow/run resume`,再进入 `.agent/skills/start`。
|
|
105
|
+
2. 执行 `start` 时,先读 `AGENTS.md`、`.cowork-flow/workflow.md` 和 `resume.py` 的输出,不要直接编码。
|
|
106
|
+
3. 任何会修改仓库文件的请求,都必须先分级为 `L0` / `L1` / `L2`,再进入对应流程;不要把“很小”当成可以绕过流程的理由。
|
|
107
|
+
4. `L1` / `L2` 行为变更必须先有 `change -> spec -> plan`;`L2` 还必须有 `design.md`,然后才能进入实现。
|
|
108
|
+
5. 实现前必须把任务上下文写入 `.cowork-flow/tasks/<task>/implement.jsonl`、`check.jsonl`、`debug.jsonl`,并在 `start` 之后再改代码。
|
|
109
|
+
6. 收尾前必须跑验证、同步 plan / task / change 状态,完成 `finish-work` 检查,再按项目策略记录 session。
|
|
110
|
+
7. 多轮对话、长任务恢复或上下文压缩后,先运行 `./.cowork-flow/run resume` 并查看 `RESUME CHECKLIST`;只读取清单列出的 PRD、当前 plan 和 jsonl 引用,不要全量重读 `.cowork-flow/spec/` 或历史 journal。
|
|
101
111
|
|
|
102
112
|
Use the `.agent/skills/start` skill when starting a new session to:
|
|
103
113
|
- Initialize your developer identity
|
|
104
114
|
- Understand current project context
|
|
105
|
-
-
|
|
115
|
+
- Enforce the task workflow gates before any implementation
|
|
106
116
|
|
|
107
117
|
Use `@/.cowork-flow/` to learn:
|
|
108
118
|
- Development workflow (`workflow.md`)
|