compound-workflow 1.3.1 → 1.4.1

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
@@ -57,6 +57,10 @@ flowchart LR
57
57
 
58
58
  ---
59
59
 
60
+ If docs conflict: follow [docs/principles/workflow-baseline-principles.md](docs/principles/workflow-baseline-principles.md), then [src/AGENTS.md](src/AGENTS.md), then command docs under [src/.agents/commands/](src/.agents/commands/).
61
+
62
+ ---
63
+
60
64
  ## Step-by-step: intent and commands
61
65
 
62
66
  | Step | Intent | Command | Output / note |
@@ -64,8 +68,8 @@ flowchart LR
64
68
  | Clarify what to build | Dialogue only; no code | `/workflow:brainstorm [topic]` | `docs/brainstorms/` |
65
69
  | Define how (fidelity + confidence) | Plan only; no code; include agentic access + validation contract | `/workflow:plan [description or brainstorm path]` | `docs/plans/` |
66
70
  | Ready the queue | Priority/dependencies + executable agentic contract checks for pending todos | `/workflow:triage` | — |
67
- | Execute | File-based todos; risk-tier testing; evidence-backed completion; no auto-ship | `/workflow:work <plan-path>` | `todos/` |
68
- | Validate quality | Evidence-based review + agentic executability checks; no fixes by default | `/workflow:review [PR, branch, or current]` | pass / pass-with-notes / fail |
71
+ | Execute | File-based todos; risk-tier testing; evidence-backed implementation; no auto-ship | `/workflow:work <plan-path>` | `todos/` |
72
+ | Validate quality | Independent, evidence-based review for code/config changes (docs-only exempt); no fixes by default | `/workflow:review [PR, branch, or current]` | pass / pass-with-notes / fail |
69
73
  | Capture learnings | One solution doc for future use | `/workflow:compound [context]` | `docs/solutions/` |
70
74
  | Log and improve | Session log + optional aggregate review | `/metrics` + `/assess weekly 7` (or monthly) | `docs/metrics/daily/`, weekly/monthly |
71
75
 
@@ -87,9 +91,11 @@ flowchart LR
87
91
 
88
92
  `/workflow:work` must not run until `/workflow:triage` has approved executable ready todos.
89
93
 
94
+ For code/config changes, `/workflow:work` ends at implementation-complete and requires `/workflow:review` before workflow completion. Docs-only work can close without `/workflow:review`.
95
+
90
96
  #### 5. Validate quality (review)
91
97
 
92
- **Intent:** Evidence-based review + agentic validation coverage checks; no fixes by default. **Command:** `/workflow:review [PR|branch|current]`. **Output:** pass / pass-with-notes / fail.
98
+ **Intent:** Independent, evidence-based review with explicit independence mode (`independent|degraded`) and evidence disclosure; no fixes by default. **Command:** `/workflow:review [PR|branch|current]`. **Output:** pass / pass-with-notes / fail.
93
99
 
94
100
  #### 6. Capture learnings (compound)
95
101
 
@@ -137,7 +143,7 @@ Commands are the public API. Skills and agents are invoked by commands; you don
137
143
  - **State orchestration:** Use a state-orchestration skill when complexity exceeds simple local state (e.g. `xstate-actor-orchestration` per Skill Index)—UI container-as-orchestrator flows, backend/internal actor orchestration, receptionist/child-actor patterns, retries/timeouts/cancellation, or boolean-flag sprawl.
138
144
  - **Skill-local metadata:** Some skills may include tool-specific metadata under `src/.agents/skills/<skill>/agents/` (for example `openai.yaml`) when required by skill validation/runtime.
139
145
  - **Guardrail standards:** `data-foundations`, `pii-protection-prisma`, `financial-workflow-integrity`, `audit-traceability` — applied when work touches multi-tenant data, PII, money, or audit.
140
- - **Agents:** Used by plan, review, and work for research, lint, and validation (e.g. `repo-research-analyst`, `learnings-researcher`, `git-history-analyzer`, `agent-native-reviewer`).
146
+ - **Agents:** Used by plan, review, and work for research, lint, and validation (e.g. `repo-research-analyst`, `learnings-researcher`, `git-history-analyzer`, `agent-native-reviewer`, `planning-technical-reviewer`).
141
147
 
142
148
  Full “when to use what” and reference standards: [src/AGENTS.md](src/AGENTS.md).
143
149
 
@@ -151,8 +157,12 @@ Full “when to use what” and reference standards: [src/AGENTS.md](src/AGENTS.
151
157
 
152
158
  - **Todo completion requires evidence:** acceptance/success criteria plus quality gates must be recorded before `complete`.
153
159
 
160
+ - **Independent review policy:** code/config changes require `/workflow:review` before workflow completion; docs-only changes are exempt.
161
+
154
162
  - **Quality gate fallback:** if `lint_command` or `typecheck_command` is missing from repo config, workflow asks once for run-provided commands and continues only if they pass.
155
163
 
164
+ - **Artifact policy:** do not create ad-hoc artifacts outside canonical outputs (`docs/plans`, `todos`, `docs/solutions`, `docs/metrics`) unless explicitly requested.
165
+
156
166
  - Add a separate shipping command if you want automated commit/PR and quality gates.
157
167
 
158
168
  ---
@@ -176,4 +186,5 @@ If your project does not already have `.cursor/`, run `npx compound-workflow ins
176
186
  **Source of truth**
177
187
 
178
188
  - Workflows and commands: [src/.agents/](src/.agents/)
189
+ - Baseline principles (tie-breaker): [docs/principles/workflow-baseline-principles.md](docs/principles/workflow-baseline-principles.md)
179
190
  - Principles and skill index: [src/AGENTS.md](src/AGENTS.md)
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"compound-workflow","version":"1.3.1","description":"Clarify → plan → execute → verify → capture. One Install action for Cursor, Claude, and OpenCode.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/cjerochim/compound-workflow.git"},"bin":{"compound-workflow":"scripts/install-cli.mjs"},"files":["src","scripts",".cursor-plugin",".claude-plugin","skills"],"scripts":{"check:pack-readme":"node scripts/check-pack-readme.mjs"},"engines":{"node":">=18"},"devDependencies":{"@semantic-release/git":"^10.0.1","@semantic-release/npm":"^13.1.4","semantic-release":"^25.0.3"}}
1
+ {"name":"compound-workflow","version":"1.4.1","description":"Clarify → plan → execute → verify → capture. One Install action for Cursor, Claude, and OpenCode.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/cjerochim/compound-workflow.git"},"bin":{"compound-workflow":"scripts/install-cli.mjs"},"files":["src","scripts",".cursor-plugin",".claude-plugin","skills"],"scripts":{"check:pack-readme":"node scripts/check-pack-readme.mjs"},"engines":{"node":">=18"},"devDependencies":{"@semantic-release/git":"^10.0.1","@semantic-release/npm":"^13.1.4","semantic-release":"^25.0.3"}}
@@ -0,0 +1,136 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+
6
+ const root = process.cwd();
7
+
8
+ const requiredChecks = [
9
+ {
10
+ file: "docs/principles/workflow-baseline-principles.md",
11
+ pattern: "tie-breaker",
12
+ description: "baseline principles tie-breaker rule",
13
+ },
14
+ {
15
+ file: "src/AGENTS.md",
16
+ pattern: "## Contract Precedence",
17
+ description: "AGENTS contract precedence section",
18
+ },
19
+ {
20
+ file: "src/AGENTS.md",
21
+ pattern: "No ad-hoc artifacts outside canonical outputs",
22
+ description: "canonical artifact policy in AGENTS",
23
+ },
24
+ {
25
+ file: "README.md",
26
+ pattern: "If docs conflict:",
27
+ description: "README conflict resolution note",
28
+ },
29
+ {
30
+ file: "README.md",
31
+ pattern: "code/config changes require `/workflow:review`",
32
+ description: "README review gate policy",
33
+ },
34
+ {
35
+ file: "src/.agents/commands/workflow/plan.md",
36
+ pattern: "Contract precedence:",
37
+ description: "plan command precedence note",
38
+ },
39
+ {
40
+ file: "src/.agents/commands/workflow/triage.md",
41
+ pattern: "Contract precedence:",
42
+ description: "triage command precedence note",
43
+ },
44
+ {
45
+ file: "src/.agents/commands/workflow/work.md",
46
+ pattern: "Contract precedence:",
47
+ description: "work command precedence note",
48
+ },
49
+ {
50
+ file: "src/.agents/commands/workflow/work.md",
51
+ pattern: "HARD GATE - WORKTREE FIRST",
52
+ description: "worktree hard-gate wording in work command",
53
+ },
54
+ {
55
+ file: "src/.agents/commands/workflow/work.md",
56
+ pattern:
57
+ "No file writes, implementation commands, test/lint/typecheck commands, or dependency-install commands may run before this gate passes.",
58
+ description: "pre-gate write/command prohibition in work command",
59
+ },
60
+ {
61
+ file: "src/.agents/commands/workflow/work.md",
62
+ pattern: "workflow_complete: false (pending /workflow:review current)",
63
+ description: "implementation-complete pending-review status in work command",
64
+ },
65
+ {
66
+ file: "src/.agents/commands/workflow/review.md",
67
+ pattern: "Contract precedence:",
68
+ description: "review command precedence note",
69
+ },
70
+ {
71
+ file: "src/.agents/commands/workflow/review.md",
72
+ pattern: "Independent Reviewer Pass (REQUIRED)",
73
+ description: "required independent reviewer pass in review command",
74
+ },
75
+ {
76
+ file: "src/.agents/commands/workflow/review.md",
77
+ pattern: "review_independence_mode: independent|degraded",
78
+ description: "explicit review independence mode in review command",
79
+ },
80
+ {
81
+ file: "src/.agents/commands/workflow/review.md",
82
+ pattern: "what was skipped and why",
83
+ description: "review skipped-pass disclosure requirement",
84
+ },
85
+ ];
86
+
87
+ const forbiddenChecks = [
88
+ {
89
+ file: "src/.agents/commands/workflow/work.md",
90
+ pattern: "## When to Use Reviewer Agents",
91
+ description: "legacy optional reviewer section in work command",
92
+ },
93
+ {
94
+ file: "src/.agents/commands/workflow/work.md",
95
+ pattern: "**Don't use by default.**",
96
+ description: "legacy skip-by-default reviewer wording in work command",
97
+ },
98
+ {
99
+ file: "src/.agents/commands/workflow/work.md",
100
+ pattern: "skip specialist reviewers by default",
101
+ description: "legacy skip-by-default specialist reviewer wording",
102
+ },
103
+ ];
104
+
105
+ const failures = [];
106
+
107
+ const readFile = (relativePath) => {
108
+ const absolutePath = path.join(root, relativePath);
109
+ if (!fs.existsSync(absolutePath)) {
110
+ failures.push(`Missing file: ${relativePath}`);
111
+ return "";
112
+ }
113
+ return fs.readFileSync(absolutePath, "utf8");
114
+ };
115
+
116
+ for (const check of requiredChecks) {
117
+ const contents = readFile(check.file);
118
+ if (!contents.includes(check.pattern)) {
119
+ failures.push(`Missing required contract text (${check.description}) in ${check.file}`);
120
+ }
121
+ }
122
+
123
+ for (const check of forbiddenChecks) {
124
+ const contents = readFile(check.file);
125
+ if (contents.includes(check.pattern)) {
126
+ failures.push(`Found forbidden contract text (${check.description}) in ${check.file}`);
127
+ }
128
+ }
129
+
130
+ if (failures.length > 0) {
131
+ console.error("Workflow contract drift check failed:");
132
+ for (const failure of failures) console.error(`- ${failure}`);
133
+ process.exit(1);
134
+ }
135
+
136
+ console.log("Workflow contract check passed.");
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: planning-technical-reviewer
3
+ description: "Independent technical reviewer for brainstorm/plan outputs before execution."
4
+ model: inherit
5
+ ---
6
+
7
+ <examples>
8
+ <example>
9
+ Context: A plan was written after a long brainstorm and needs an independent check.
10
+ user: "Run technical review on this plan before we start work."
11
+ assistant: "I'll use the planning-technical-reviewer to run an independent plan check first, then return a build approval verdict."
12
+ <commentary>Use this reviewer when you need a second opinion not anchored to the original planning chain.</commentary>
13
+ </example>
14
+ <example>
15
+ Context: Plan confidence is low and there are open spikes.
16
+ user: "Can we trust this plan or does it need rework?"
17
+ assistant: "I'll run planning-technical-reviewer to stress-test assumptions and identify blocking gaps."
18
+ <commentary>The reviewer should prioritize disconfirming evidence and feasibility risks before build starts.</commentary>
19
+ </example>
20
+ </examples>
21
+
22
+ # Planning Technical Reviewer
23
+
24
+ You are an independent technical reviewer for plan documents. Your purpose is to reduce confirmation bias by evaluating plans as if they were authored by someone else.
25
+
26
+ ## Inputs
27
+
28
+ - Plan document path (required)
29
+ - Repo conventions from `AGENTS.md`
30
+ - Relevant local references cited by the plan
31
+
32
+ ## Independence Rules
33
+
34
+ 1. Treat prior recommendations as untrusted until verified.
35
+ 2. Look for disconfirming evidence first, then supporting evidence.
36
+ 3. Do not preserve weak assumptions for momentum.
37
+ 4. If feasibility is unclear, do not approve for build.
38
+
39
+ ## What to Evaluate
40
+
41
+ 1. Direction integrity
42
+ - Does the plan stay inside the declared problem boundary?
43
+ - Are non-goals respected?
44
+ - Is scope expansion explicit and justified?
45
+ 2. Technical correctness
46
+ - Alignment with repository architecture and conventions
47
+ - Plausibility of implementation path and dependencies
48
+ 3. Validation realism
49
+ - Are acceptance criteria testable?
50
+ - Are validation and quality gate commands executable?
51
+ - Is evidence required for completion clear?
52
+ 4. Execution readiness
53
+ - Are blockers, discussion points, and spikes explicit where needed?
54
+ - Is ordering/dependency logic deterministic?
55
+ 5. Risk handling
56
+ - Are failure modes and rollback expectations appropriate for risk level?
57
+
58
+ ## Required Output
59
+
60
+ ```markdown
61
+ ## Fresh Context Plan Review
62
+
63
+ - Risk level: low | medium | high
64
+ - Build approval: yes | no
65
+ - Confidence in verdict: high | medium | low
66
+
67
+ ### Blocking Findings
68
+ 1. [Issue]
69
+ - Why it blocks
70
+ - Where found (file:line)
71
+ - Required fix
72
+
73
+ ### Non-Blocking Findings
74
+ 1. [Issue]
75
+ - Impact
76
+ - Suggested improvement
77
+
78
+ ### Direction Drift Check
79
+ - In-scope: yes|no
80
+ - Drift signals found: [none | list]
81
+
82
+ ### Recommendation
83
+ - Option A: proceed as-is
84
+ - Option B: proceed with specific changes
85
+ - Option C: rework or spike before build
86
+ - Preferred option + why
87
+ ```
88
+
89
+ ## Guardrails
90
+
91
+ - Do not edit the plan in this agent.
92
+ - Do not add new product scope.
93
+ - Do not approve when blocking findings exist.
94
+ - When uncertain, choose non-approval and require clarification or spike.
@@ -13,6 +13,8 @@ argument-hint: "[feature description, bug report, improvement idea, or brainstor
13
13
 
14
14
  Transform feature descriptions, bug reports, or improvement ideas into well-structured markdown plan files that follow project conventions and best practices. This command provides flexible detail levels to match your needs.
15
15
 
16
+ Contract precedence: if this command conflicts with other workflow docs, follow `docs/principles/workflow-baseline-principles.md`, then `src/AGENTS.md`, then this command.
17
+
16
18
  This workflow MUST choose a planning fidelity and confidence level before final plan construction:
17
19
 
18
20
  - Fidelity: `Low | Medium | High`
@@ -9,6 +9,8 @@ argument-hint: "[PR number, GitHub URL, branch name, or 'current']"
9
9
 
10
10
  Run a structured, evidence-based **code** review. This command produces findings and recommendations; it does not implement fixes by default.
11
11
 
12
+ Contract precedence: if this command conflicts with other workflow docs, follow `docs/principles/workflow-baseline-principles.md`, then `src/AGENTS.md`, then this command.
13
+
12
14
  **If the user provides a document path** (e.g. a plan or spec): redirect to the `technical-review` skill for technical correctness (no edits), and/or the `document-review` skill to refine the document. This command does not review documents.
13
15
 
14
16
  Guardrails (unless explicitly requested):
@@ -115,6 +117,19 @@ Protected artifacts:
115
117
  - If changes touch existing behavior and risk is medium/high: `Task git-history-analyzer(<target context>)`
116
118
  - If changes depend on framework/library behavior and version constraints: `Task framework-docs-researcher(<topic>)`
117
119
 
120
+ ### Phase 3.5: Independent Reviewer Pass (REQUIRED)
121
+
122
+ Before final verdict, run an explicit independent pass and record:
123
+
124
+ - `review_independence_mode: independent|degraded`
125
+ - `independence_evidence`: what independent pass ran
126
+ - `skipped_passes`: what was skipped and why
127
+
128
+ Mode rules:
129
+
130
+ - `independent` (default): run a distinct fresh-context reviewer pass (separate reviewer/agent perspective from the main synthesis).
131
+ - `degraded`: only when independent reviewer tooling/path is unavailable. Must include explicit disclosure that confidence is reduced and why fallback was used.
132
+
118
133
  Then perform the main review synthesis across:
119
134
 
120
135
  - change summary (surface area, high-risk files)
@@ -130,11 +145,16 @@ Then perform the main review synthesis across:
130
145
  Provide:
131
146
 
132
147
  - Review recommendation: `pass | pass-with-notes | fail`
148
+ - `review_independence_mode: independent|degraded`
149
+ - `verdict_confidence: normal|degraded` (use `degraded` only when `review_independence_mode=degraded`)
133
150
  - Top risks (1–5 bullets)
134
151
  - Findings list:
135
152
  - severity (`critical | high | medium | low`)
136
153
  - evidence (file references or commands/output)
137
154
  - recommended action (concise)
155
+ - Independence evidence summary:
156
+ - what independent pass ran
157
+ - what was skipped and why
138
158
  - What ran vs skipped (selected agents/passes)
139
159
  - Validation coverage summary:
140
160
  - tests: pass|fail|not-run
@@ -12,6 +12,8 @@ Turn todo items into a prioritized executable queue.
12
12
  This command does not implement fixes. It approves and organizes work so `/workflow:work` can execute without ambiguity.
13
13
  Output of this command is the only executable queue for `/workflow:work`.
14
14
 
15
+ Contract precedence: if this command conflicts with other workflow docs, follow `docs/principles/workflow-baseline-principles.md`, then `src/AGENTS.md`, then this command.
16
+
15
17
  ## Inputs
16
18
 
17
19
  - Default: triage all active todos under `todos/` (`pending` + `ready`)
@@ -13,6 +13,8 @@ Execute a work plan efficiently while maintaining quality and finishing features
13
13
 
14
14
  This command takes a plan file and executes it systematically. The focus is on completing the work while understanding requirements quickly, following existing patterns, and maintaining quality throughout.
15
15
 
16
+ Contract precedence: if this command conflicts with other workflow docs, follow `docs/principles/workflow-baseline-principles.md`, then `src/AGENTS.md`, then this command.
17
+
16
18
  Non-goals (unless explicitly requested):
17
19
 
18
20
  - Creating commits
@@ -89,22 +91,7 @@ The input must be a plan file path.
89
91
  - Prefer `test_command` and optional `test_fast_command` from `AGENTS.md`.
90
92
  - If missing, ask once for the repo's test command and suggest adding it to `AGENTS.md`.
91
93
 
92
- 1.6. **Agentic Access + Validation Preflight (HARD GATE)**
93
-
94
- Contract checksum (MUST all be true before implementation):
95
-
96
- - triage completed for this plan
97
- - isolation gate recorded (`worktree_decision`, context, `gate_status: passed`)
98
- - blocking spikes execute before dependent build todos
99
-
100
- Before any implementation commands:
101
-
102
- - Verify each `ready` todo has an executable Agentic Execution Contract:
103
- - access preconditions are explicit
104
- - validation path is explicit (commands/routes/checks)
105
- - evidence expectations are explicit
106
- - quality gate commands are explicit or marked for ask-once fallback
107
- - If a todo lacks this contract, move it to `pending` for triage before coding.
94
+ 1.6. **Run-Scoped Quality Gate Fallback Setup (PREP STEP)**
108
95
 
109
96
  Ask-once fallback policy for missing lint/typecheck config:
110
97
 
@@ -113,6 +100,8 @@ The input must be a plan file path.
113
100
  - Continue only when provided commands run successfully.
114
101
  - If commands are not provided or fail, do not mark related todos complete.
115
102
 
103
+ Note: full execution preflight (triage + contract checks + isolation checks) runs after todo creation/triage in Step 3.5.
104
+
116
105
  1.75. **Resolve Plan Scope Contract (REQUIRED)**
117
106
 
118
107
  Before any environment setup or implementation, resolve the plan's scope contract:
@@ -132,11 +121,15 @@ The input must be a plan file path.
132
121
  - `migration`: identify migration verification + rollback checks before executing todos.
133
122
  - `full_remediation`: complete all known gaps in the scoped area before completion.
134
123
 
135
- 2. **Setup Environment (HARD GATE)**
124
+ 2. **Setup Environment (HARD GATE - WORKTREE FIRST)**
136
125
 
137
126
  Determine how to isolate the work for this plan.
138
127
 
139
- No implementation commands or code edits may run before this gate passes.
128
+ This gate MUST run immediately after Step 1.75.
129
+
130
+ No file writes, implementation commands, test/lint/typecheck commands, or dependency-install commands may run before this gate passes.
131
+
132
+ Allowed before gate: read-only inspection only (e.g., `ls`, `rg`, `cat`, `git status`, `git branch`).
140
133
 
141
134
  Default: use a worktree. Opt-out requires explicit user confirmation.
142
135
 
@@ -154,6 +147,8 @@ The input must be a plan file path.
154
147
 
155
148
  If Yes: ask for the new branch name (e.g., `feat/<slug>`, `fix/<slug>`).
156
149
 
150
+ If the user does not explicitly choose "No", proceed with "Yes" by default.
151
+
157
152
  3) If worktree is chosen, run:
158
153
 
159
154
  ```bash
@@ -231,6 +226,23 @@ The input must be a plan file path.
231
226
  - Do not proceed to Phase 2 until triage completes and execution order is explicit.
232
227
  - If triage leaves no unblocked `ready` todos, stop and report pending/deferred/blocked items.
233
228
 
229
+ 3.5. **Execution Preflight (HARD GATE before Phase 2)**
230
+
231
+ Contract checksum (MUST all be true before implementation):
232
+
233
+ - triage completed for this plan
234
+ - isolation gate recorded (`worktree_decision`, execution context, `gate_status: passed`)
235
+ - blocking spikes execute before dependent build todos
236
+
237
+ Before any implementation commands:
238
+
239
+ - Verify each `ready` todo has an executable Agentic Execution Contract:
240
+ - access preconditions are explicit
241
+ - validation path is explicit (commands/routes/checks)
242
+ - evidence expectations are explicit
243
+ - quality gate commands are explicit or marked for ask-once fallback
244
+ - If a todo lacks this contract, move it to `pending` for triage before coding.
245
+
234
246
  ### Phase 2: Execute
235
247
 
236
248
  1. **Task Execution Loop**
@@ -431,13 +443,15 @@ The input must be a plan file path.
431
443
  - If `test_command` is not configured, ask once for the project's test command and suggest adding it to `AGENTS.md`.
432
444
  - If `lint_command` or `typecheck_command` is not configured, ask once for run-provided commands and use them for this run.
433
445
 
434
- 2. **Consider Reviewer Agents** (Optional)
446
+ 2. **Prepare Review Handoff (REQUIRED for code/config changes)**
435
447
 
436
- Use for complex, risky, or large changes.
448
+ If this run changed code or configuration, prepare an explicit `/workflow:review current` handoff summary:
437
449
 
438
- If this repo defines preferred review agents in `AGENTS.md`, follow that.
450
+ - files changed
451
+ - validations run and outcomes
452
+ - known risks or unresolved notes
439
453
 
440
- If not configured, skip specialist reviewers by default.
454
+ Docs-only runs may skip this handoff using the docs-only review exemption.
441
455
 
442
456
  3. **Final Validation**
443
457
  - All todo files created for this plan are marked complete
@@ -463,9 +477,14 @@ The input must be a plan file path.
463
477
  - Note any follow-up work needed
464
478
  - Suggest next steps if applicable
465
479
 
466
- Risk-based recommendation:
480
+ Completion policy:
467
481
 
468
- - If the plan fidelity is `high` or confidence is `low`, recommend running `/workflow:review current` before considering the work complete.
482
+ - If this run changed code or configuration, report status as:
483
+ - `implementation_complete: true`
484
+ - `workflow_complete: false (pending /workflow:review current)`
485
+ - If this run is docs-only (no code/config changes), report status as:
486
+ - `implementation_complete: true`
487
+ - `workflow_complete: true (docs-only review exemption)`
469
488
 
470
489
  Stop here by default.
471
490
 
@@ -475,11 +494,11 @@ If the user wants to ship (commits/PR/screenshots), handle that as a separate ex
475
494
 
476
495
  ## Key Principles
477
496
 
478
- ### Start Fast, Execute Faster
497
+ ### Execute with Deterministic Gates
479
498
 
480
- - Get clarification once at the start, then execute
481
- - Don't wait for perfect understanding - ask questions and move
482
- - The goal is to **finish the feature**, not create perfect process
499
+ - Resolve unclear requirements early, then execute decisively
500
+ - Keep hard gates explicit and non-skippable
501
+ - Optimize for correct, verifiable completion
483
502
 
484
503
  ### The Plan is Your Guide
485
504
 
@@ -498,7 +517,7 @@ If the user wants to ship (commits/PR/screenshots), handle that as a separate ex
498
517
  - Follow existing patterns
499
518
  - Write tests for new code
500
519
  - Run linting/typechecking/formatting as configured in `AGENTS.md` (or run-provided via ask-once fallback)
501
- - Use reviewer agents for complex/risky changes only
520
+ - For code/config changes, require `/workflow:review current` before declaring workflow completion
502
521
 
503
522
  ### Ship Complete Features
504
523
 
@@ -521,25 +540,23 @@ Before marking work complete, verify:
521
540
  - [ ] For `partial_fix`, unresolved work is captured as `pending/deferred` todos
522
541
  - [ ] If shipping is requested, capture any required artifacts (screenshots, release notes) per repo conventions
523
542
 
524
- ## When to Use Reviewer Agents
543
+ ## Review Completion Gate
525
544
 
526
- **Don't use by default.** Use reviewer agents only when:
545
+ For code/config changes, completion of `/workflow:work` is implementation-complete only. Workflow completion requires `/workflow:review current`.
527
546
 
528
- - Large refactor affecting many files (10+)
529
- - Security-sensitive changes (authentication, permissions, data access)
530
- - Performance-critical code paths
531
- - Complex algorithms or business logic
532
- - User explicitly requests thorough review
547
+ Docs-only exception:
533
548
 
534
- For most features: tests + linting + following patterns is sufficient.
549
+ - If no code/config files changed, `/workflow:work` may close as workflow-complete without `/workflow:review`.
550
+ - When taking this exemption, explicitly state "docs-only review exemption" in the final summary.
535
551
 
536
552
  ## Common Pitfalls to Avoid
537
553
 
538
554
  - **Analysis paralysis** - Don't overthink, read the plan and execute
539
555
  - **Skipping clarifying questions** - Ask now, not after building wrong thing
540
556
  - **Skipping the worktree hard gate** - No implementation before Step 2 gate passes
557
+ - **Starting writes before isolation gate** - no file writes or run commands before Step 2
541
558
  - **Ignoring plan references** - The plan has links for a reason
542
559
  - **Testing at the end** - Test continuously or suffer later
543
560
  - **Forgetting todo updates** - Update todo files and plan checkboxes or lose track of progress
544
561
  - **80% done syndrome** - Finish the feature, don't move on early
545
- - **Over-reviewing simple changes** - Save reviewer agents for complex work
562
+ - **Skipping required review on code/config changes** - workflow completion requires `/workflow:review current`
@@ -7,6 +7,8 @@ description: Use when a feature approach or plan doc has passed document review
7
7
 
8
8
  Review a feature approach or plan document for technical alignment with architecture, code standards, and quality. Output risk level, three options with justifications, and a recommendation. Do not approve for build until the plan is updated via a second document review.
9
9
 
10
+ Primary execution model: run an independent planning-phase pass first using `planning-technical-reviewer` (when available), then synthesize final technical review verdict.
11
+
10
12
  ## When to Use
11
13
 
12
14
  - After **document review** on a feature approach doc (pre-build gate flow).
@@ -19,6 +21,12 @@ Review a feature approach or plan document for technical alignment with architec
19
21
 
20
22
  **If no document is specified:** Use the doc just reviewed in document review, or look for the most recent feature approach/plan in `docs/brainstorms/` or `docs/plans/` (e.g. by date prefix).
21
23
 
24
+ ## Step 1.5: Independent Fresh-Context Pass (Required)
25
+
26
+ - If `planning-technical-reviewer` exists under `.agents/agents/review/`, run it on the plan first.
27
+ - Treat its blocking findings as pre-build blockers.
28
+ - If the agent is not available, explicitly state: "planning-technical-reviewer unavailable; running direct technical review (degraded bias resistance)".
29
+
22
30
  ## Step 2: Assess Against Technical Criteria
23
31
 
24
32
  Evaluate the plan against:
@@ -66,6 +74,7 @@ State the **preferred option** and clear rationale (e.g. "Recommend Option B bec
66
74
  End every technical review with:
67
75
 
68
76
  - `Risk level:` low | medium | high (plus one-line rationale)
77
+ - `Fresh-context pass:` ran | unavailable (degraded)
69
78
  - `Options A/B/C:` 2–3 sentences each
70
79
  - `Recommendation:` preferred option and rationale
71
80
  - `Approved for build:` yes | no
package/src/AGENTS.md CHANGED
@@ -44,6 +44,15 @@ This workspace currently implements `brainstorm`, `plan`, `triage`, `work`, `rev
44
44
 
45
45
  Use the canonical command names (`/workflow:plan`, `/workflow:work`, `/workflow:review`, etc.). This template does not ship aliases.
46
46
 
47
+ ## Contract Precedence
48
+
49
+ If workflow documents conflict, resolve them in this order:
50
+
51
+ 1. `docs/principles/workflow-baseline-principles.md`
52
+ 2. This file (`src/AGENTS.md`) non-negotiables and repo config
53
+ 3. Workflow command specs (`src/.agents/commands/workflow/*.md`)
54
+ 4. Skill docs (`src/.agents/skills/*/SKILL.md`)
55
+
47
56
  ## Non-negotiables (Structure Integrity)
48
57
 
49
58
  - **Commands are the public API.** Keep `/workflow:*` command docs stable; add capability via skills/agents, not new command variants.
@@ -56,11 +65,12 @@ Use the canonical command names (`/workflow:plan`, `/workflow:work`, `/workflow:
56
65
  - **Triage before execution is mandatory.** `/workflow:work` must not execute todos until a `/workflow:triage` pass has prioritized the queue and validated dependencies/ready state for the current plan.
57
66
  - **Spike governance is explicit and ordered.** Risky plans must evaluate spike need, spike candidates must declare initial priority/dependencies/unblocks/timebox/deliverable, triage confirms those assumptions, and `/workflow:work` executes blocking spikes before dependent build todos.
58
67
  - **Agentic access/testability is mandatory in planning.** Every plan must include an executable access + validation contract so work/review can run deterministically.
68
+ - **Independent review is required for code/config changes.** `/workflow:review` must emit `review_independence_mode: independent|degraded`, plus independence evidence and skipped-pass disclosure.
59
69
  - **Todo completion requires evidence.** A todo may move to `complete` only after success criteria evidence and quality gate evidence are recorded in Work Log.
60
70
  - **Blockers change todo state immediately.** Blocked work must move from `ready` back to `pending` with `tags: [blocker]` and an options+recommendation decision record.
61
71
  - **Quality gates are enforced with ask-once fallback.** If `lint_command` or `typecheck_command` is missing, ask once per run and continue only when commands are provided and pass.
62
72
  - **Skills are invoked only by trigger.** `document-review` only when user selects "Review and refine" (or explicit request); guardrail skills (PII/financial/audit/data) only when the feature touches that domain.
63
- - **No new files/directories by default** beyond `docs/plans/...` for planning output.
73
+ - **No ad-hoc artifacts outside canonical outputs** (`docs/plans`, `todos`, `docs/solutions`, `docs/metrics`) unless explicitly requested.
64
74
  - **Plan file is the artifact.** Post-generation options are actions on the artifact; they do not change the workflow shape.
65
75
  - **Tighten over expand.** Resolve ambiguity, standardize naming, enforce sections—avoid adding new process steps unless they reduce rework.
66
76
 
@@ -166,6 +176,7 @@ worktree_bootstrap_notes:
166
176
  - `lint`
167
177
  - `bug-reproduction-validator`
168
178
  - `agent-native-reviewer`
179
+ - `planning-technical-reviewer`
169
180
 
170
181
  ## Skill Index (When to Use What)
171
182