cowork-flow 0.0.40 → 0.0.41

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/README.md CHANGED
@@ -68,7 +68,7 @@ Skills 维护在 `template/skills/` 唯一源码,`init` 时按平台分发到
68
68
  | `codex` / `opencode` | `.agents/skills/` |
69
69
  | `claude-code` | `.claude/skills/` |
70
70
 
71
- 分发动作:`batch-mode`、`brainstorming`、`break-loop`、`cowork-flow`、`party-mode`、`writing-plans`
71
+ 分发动作:`batch-mode`、`brainstorming`、`break-loop`、`cowork-flow`、`doubt-review`、`game-design`、`party-mode`、`writing-plans`
72
72
 
73
73
  ## CLI 命令
74
74
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cowork-flow",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
4
4
  "description": "CLI for installing and maintaining cowork-flow collaboration templates.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1 +1 @@
1
- 0.0.40
1
+ 0.0.41
@@ -2,18 +2,39 @@
2
2
 
3
3
  > Internal protocol enforced by workflow readiness; it is not a public Skill.
4
4
 
5
+ ## Purpose
6
+
7
+ `decision-review` is the mandatory L2 evidence gate for non-trivial decisions.
8
+ It preserves the adversarial doubt cycle from `doubt-review` while keeping the
9
+ runtime authority in `decision-review.jsonl`.
10
+
5
11
  ## Enforcement
6
12
 
7
13
  - L2 tasks: mandatory before task start.
8
14
  - L0/L1 tasks: advisory and never blocked by missing decision review evidence.
9
15
  - The runtime authority is `decision-review.jsonl`; prose notes do not satisfy the gate.
10
16
 
17
+ ## Doubt Cycle
18
+
19
+ Every accepted L2 decision review must be derived from this bounded cycle:
20
+
21
+ 1. CLAIM: state the decision and why being wrong would be costly.
22
+ 2. EXTRACT: isolate the minimal reviewable artifact or design statement.
23
+ 3. DOUBT: ask a fresh context to find problems in ARTIFACT + CONTRACT, not CLAIM.
24
+ 4. RECONCILE: classify each finding as contract misunderstanding, actionable,
25
+ accepted trade-off, or noise.
26
+ 5. STOP: stop after trivial or already-considered findings, three cycles, or the
27
+ user explicitly says enough.
28
+
29
+ The reviewer receives ARTIFACT + CONTRACT, not CLAIM. CLAIM is recorded for
30
+ traceability, but it must not bias the adversarial review prompt.
31
+
11
32
  ## Evidence
12
33
 
13
34
  Write one UTF-8 JSON object per line to `<task>/decision-review.jsonl`:
14
35
 
15
36
  ```json
16
- {"acceptanceId":"AC-007A","claim":"The selected direction is safe.","contract":"The invariant that must hold.","reviewerContext":"fresh","findings":[],"resolution":"accepted"}
37
+ {"acceptanceId":"AC-007A","claim":"The selected direction is safe.","contract":"The invariant that must hold.","reviewerContext":"fresh","findings":[],"resolution":"accepted","artifact":"Focused diff or design statement reviewed via ARTIFACT + CONTRACT.","reconciliation":[],"cycleCount":1}
17
38
  ```
18
39
 
19
40
  Required fields:
@@ -25,4 +46,10 @@ Required fields:
25
46
  - `findings`: JSON array
26
47
  - `resolution`: exactly `accepted`
27
48
 
49
+ Recommended fields:
50
+
51
+ - `artifact`: minimal EXTRACT artifact reviewed.
52
+ - `reconciliation`: how each finding was classified.
53
+ - `cycleCount`: number of completed doubt cycles, never greater than 3.
54
+
28
55
  Missing, malformed, stale-context, or unaccepted records block L2 task start.
@@ -8,6 +8,25 @@ Update `.cowork-flow/spec/` when a change introduces or changes a reusable comma
8
8
 
9
9
  Do not add one-off implementation narration. Prefer the narrowest existing spec and update its index when a new topic is introduced.
10
10
 
11
+ ## Choose Location
12
+
13
+ - `backend/` or `frontend/`: implementation contracts, signatures, examples, validation behavior, and test points.
14
+ - `guides/`: short thinking checklists and pointers to deeper specs.
15
+ - `contracts/`: cross-agent, runtime, host-adapter, or persisted-state contracts.
16
+ - `runtime/` or `schemas/`: machine-readable rules, registries, and schema-owned metadata.
17
+ - `workflow.md` or `AGENTS.md`: process rules, phase gates, collaboration rules, or task routing behavior.
18
+
19
+ ## Write
20
+
21
+ Keep each update concrete:
22
+
23
+ - State the trigger and scope.
24
+ - Show the contract or command shape.
25
+ - Include good/bad cases when useful.
26
+ - State tests or checks that protect the behavior.
27
+ - Update the matching `index.md` when adding a new topic.
28
+ - Check for duplicate guidance and remove stale wording before finishing.
29
+
11
30
  ## Output
12
31
 
13
32
  Every Host reports `specUpdates` as one of:
@@ -28,3 +28,16 @@ Write one JSON object per line to `<task>/tdd.jsonl` with:
28
28
  - `greenCommand`, `greenExitCode`, `broaderVerification`
29
29
 
30
30
  Only docs/comment/format-only work may use a documented `exemption`.
31
+
32
+ ## Anti-Rationalization
33
+
34
+ The following excuses do not exempt the TDD evidence requirement:
35
+
36
+ | Excuse | Why It Fails | Required Alternative |
37
+ |---|---|---|
38
+ | "This logic is simple, no test needed" | Simple logic still breaks on edge cases and later edits. | Write the smallest behavior test for the acceptance ID. |
39
+ | "Other tests already cover this" | Invisible coverage is not red-green evidence. | Point to the exact redCommand and acceptanceId in `tdd.jsonl`. |
40
+ | "I'll add tests after implementation" | Post-implementation tests are not a red-green cycle. | Red first, then green; record both commands. |
41
+ | "It looks correct" | Visual inspection misses scenarios that tests can pin down. | Turn the expected behavior and edge case into assertions. |
42
+ | "I've written similar tests" | Similar structure is not the same behavior. | Re-run the redCommand for this acceptanceId. |
43
+ | "This is internal only" | Internal behavior still affects callers and workflow state. | Test through the public entry point, or directly test the internal contract when that is the narrowest stable surface. |
@@ -190,7 +190,6 @@
190
190
  ".agents/skills/before-dev",
191
191
  ".agents/skills/check",
192
192
  ".agents/skills/continue",
193
- ".agents/skills/doubt-review",
194
193
  ".agents/skills/entry-boundary",
195
194
  ".agents/skills/finish-work",
196
195
  ".agents/skills/party-mode-v2",
@@ -201,7 +200,6 @@
201
200
  ".claude/skills/before-dev",
202
201
  ".claude/skills/check",
203
202
  ".claude/skills/continue",
204
- ".claude/skills/doubt-review",
205
203
  ".claude/skills/entry-boundary",
206
204
  ".claude/skills/finish-work",
207
205
  ".claude/skills/party-mode-v2",
@@ -149,12 +149,40 @@
149
149
  "source": ".cowork-flow/spec/protocols/decision-review.md",
150
150
  "managedPaths": []
151
151
  },
152
+ {
153
+ "id": "doubt-review",
154
+ "displayName": "Doubt Review",
155
+ "aliases": [
156
+ "adversarial-review"
157
+ ],
158
+ "kind": "protocol",
159
+ "visibility": "public",
160
+ "status": "active",
161
+ "statuses": [
162
+ "planning",
163
+ "in_progress",
164
+ "review",
165
+ "delegated_subtask"
166
+ ],
167
+ "intents": [
168
+ "doubt_review"
169
+ ],
170
+ "enforcement": "advisory",
171
+ "runtimeGate": null,
172
+ "runtimeCommand": null,
173
+ "evidenceArtifact": "decision-review.jsonl",
174
+ "source": "skills/doubt-review/SKILL.md",
175
+ "managedPaths": [
176
+ ".agents/skills/doubt-review/",
177
+ ".claude/skills/doubt-review/"
178
+ ]
179
+ },
152
180
  {
153
181
  "id": "game-design",
154
182
  "displayName": "Game Design",
155
183
  "aliases": [],
156
184
  "kind": "domain",
157
- "visibility": "internal",
185
+ "visibility": "public",
158
186
  "status": "active",
159
187
  "statuses": [
160
188
  "planning",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cowork-flow",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
4
4
  "description": "AI 协作工作流引擎:任务生命周期、子代理调度、门禁与状态注入。将 cowork-flow 的完整工作流带入 ZCode。",
5
5
  "author": {
6
6
  "name": "fisklikewater"
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: doubt-review
3
+ description: Use when the user asks for adversarial review, doubt review, or a fresh skeptical pass on a non-trivial implementation decision, design direction, or correctness claim. Use when correctness matters more than speed, the code is unfamiliar, or hidden assumptions could break the work.
4
+ ---
5
+
6
+ # Doubt Review
7
+
8
+ Use this Skill to stress-test a decision while course correction is still cheap. It is the public, user-callable companion to the internal `decision-review` protocol; it does not replace runtime gates or final implementation review.
9
+
10
+ ## Apply When
11
+
12
+ - The user explicitly asks for doubt review, adversarial review, or a skeptical pass.
13
+ - A decision changes branching logic, module boundaries, shared state, ordering, idempotency, or other invariants the type system cannot verify.
14
+ - You are about to claim behavioral correctness for unfamiliar or high-stakes code.
15
+ - An L2 task needs `decision-review.jsonl` evidence before implementation starts.
16
+
17
+ ## Skip When
18
+
19
+ - The change is mechanical: formatting, file moves, or obvious one-line edits.
20
+ - You are only reading or summarizing existing code.
21
+ - The user explicitly prioritizes speed over verification.
22
+
23
+ ## The 5-Step Doubt Cycle
24
+
25
+ ### 1. CLAIM
26
+
27
+ Write a clear 2-3 line decision:
28
+
29
+ ```text
30
+ CLAIM: "<one-sentence decision>"
31
+ WHY THIS MATTERS: <why this being wrong would be costly>
32
+ ```
33
+
34
+ If you cannot state the claim briefly, keep researching until the decision is concrete.
35
+
36
+ ### 2. EXTRACT
37
+
38
+ Create the smallest reviewable artifact:
39
+
40
+ - Code: a focused diff, function, or test case, not a whole file.
41
+ - Design: 3-5 sentences plus the constraints that must hold.
42
+ - Remove author reasoning; the reviewer should see the input, not the conclusion.
43
+
44
+ ### 3. DOUBT
45
+
46
+ Ask for problems, not confirmation:
47
+
48
+ ```text
49
+ Find problems with this artifact. Assume the author is overconfident. Look for:
50
+ - Undeclared assumptions
51
+ - Unhandled edge cases
52
+ - Hidden coupling or shared state
53
+ - Violated contract scenarios
54
+ - Broken existing conventions
55
+ - Failure modes under unexpected input
56
+
57
+ Do not confirm. Do not summarize. Find problems, or explicitly state that no problems were found after review.
58
+
59
+ ARTIFACT: <paste artifact>
60
+ CONTRACT: <paste constraints>
61
+ ```
62
+
63
+ Pass only ARTIFACT + CONTRACT, not CLAIM. Including CLAIM biases the reviewer toward agreement.
64
+
65
+ You cannot spawn a fresh-context reviewer from within a subagent context. If doubt is required while inside a subagent, surface back to the main session so the review can run from a genuinely fresh context.
66
+
67
+ ### 4. RECONCILE
68
+
69
+ Classify every finding in this order:
70
+
71
+ 1. Contract misunderstanding: fix the contract, then reclassify.
72
+ 2. Valid and actionable: modify the artifact, then restart the doubt cycle.
73
+ 3. Valid but accepted trade-off: record the trade-off explicitly.
74
+ 4. Noise: record and exclude it.
75
+
76
+ ### 5. STOP
77
+
78
+ Stop when one condition is met:
79
+
80
+ - The next round produces only trivial or already-considered findings.
81
+ - Three cycles complete; report remaining substantive findings instead of starting a fourth cycle.
82
+ - The user says enough.
83
+
84
+ Substantive findings after three cycles mean the artifact is too large or immature. Return to EXTRACT and split it.
85
+
86
+ ## Evidence
87
+
88
+ For L2 readiness, record accepted decisions in `<task>/decision-review.jsonl` using the internal `decision-review` protocol. At minimum, evidence must include `acceptanceId`, `claim`, `contract`, `reviewerContext`, `findings`, and `resolution`.
89
+
90
+ ## Common Rationalizations
91
+
92
+ | Excuse | Why It Fails | Better Approach |
93
+ |---|---|---|
94
+ | "I'm confident, skip doubt" | Confidence is where blind spots hide. | Write a 2-line CLAIM and pass the artifact to fresh-context review. |
95
+ | "Spawning a reviewer is expensive" | Debugging a bad decision after implementation costs more. | Run one bounded doubt cycle now. |
96
+ | "Review will catch it later" | Final review catches completed artifacts; doubt catches direction errors while they are cheap. | Run doubt before committing to the direction. |
97
+ | "Doubting every step causes delay" | Doubt only applies to non-trivial decisions. | Use the Apply When / Skip When sections to decide. |
98
+ | "Reviewer disagrees, so I am wrong" | Reviewer output is information, not authority. | Classify each finding through RECONCILE. |
99
+
100
+ ## Relationship to Current Workflow
101
+
102
+ - `decision-review`: internal mandatory L2 gate; write accepted evidence to `decision-review.jsonl`.
103
+ - `review-protocol`: final implementation review; it does not replace in-flight doubt.
104
+ - `cowork-flow`: public router; it decides whether to load this Skill or the internal protocol.
105
+ - `TDD`: a failing test is doubt made concrete when the risk is executable behavior.
106
+ - `break-loop`: use when doubt exposes a real failure mode but the fix path keeps looping.
107
+
108
+ ## Red Flags
109
+
110
+ - Skipping doubt because you feel confident.
111
+ - Passing CLAIM to the reviewer.
112
+ - Treating reviewer output as authoritative instead of reconciling it.
113
+ - Looping past three cycles.
114
+ - Calling the review adversarial while asking whether the artifact "looks good".
115
+ - Running another cycle against an unchanged artifact.
116
+ - Getting substantive findings twice but classifying none as actionable.
117
+ - Treating this Skill as a replacement for `decision-review.jsonl` or final review.
118
+
119
+ ## Verification
120
+
121
+ - Every non-trivial decision has a CLAIM record.
122
+ - Every non-trivial artifact receives at least one fresh-context review.
123
+ - Reviewer receives ARTIFACT + CONTRACT (not CLAIM).
124
+ - Findings are classified instead of rubber-stamped.
125
+ - Stop conditions are satisfied before proceeding.