cowork-flow 0.0.39 → 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.
Files changed (24) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/template/.cowork-flow/.version +1 -1
  4. package/template/.cowork-flow/scripts/application/task_archive.py +148 -21
  5. package/template/.cowork-flow/scripts/application/task_lifecycle.py +3 -1
  6. package/template/.cowork-flow/scripts/commands/add_session.py +137 -124
  7. package/template/.cowork-flow/scripts/commands/task.py +1 -0
  8. package/template/.cowork-flow/scripts/commands/task_archive_commands.py +135 -49
  9. package/template/.cowork-flow/scripts/commands/task_navigation.py +145 -81
  10. package/template/.cowork-flow/scripts/commands/task_parser.py +1 -0
  11. package/template/.cowork-flow/scripts/common/core/paths.py +4 -1
  12. package/template/.cowork-flow/scripts/common/gates/gates.py +114 -108
  13. package/template/.cowork-flow/scripts/common/gates/validate_implementation.py +50 -28
  14. package/template/.cowork-flow/scripts/common/git/git_snapshot.py +14 -0
  15. package/template/.cowork-flow/spec/protocols/decision-review.md +28 -1
  16. package/template/.cowork-flow/spec/protocols/spec-maintenance.md +19 -0
  17. package/template/.cowork-flow/spec/protocols/tdd.md +13 -0
  18. package/template/.cowork-flow/spec/references/definition-of-done.md +1 -1
  19. package/template/.cowork-flow/spec/runtime/host-assets.json +0 -2
  20. package/template/.cowork-flow/spec/runtime/skill-registry.json +29 -1
  21. package/template/.cowork-flow/workflow.md +6 -2
  22. package/template/.zcode/.zcode-plugin/plugin.json +1 -1
  23. package/template/.zcode/scaffold/.cowork-flow/workflow.md +6 -2
  24. package/template/skills/doubt-review/SKILL.md +125 -0
@@ -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.