@paw-workflow/cli 0.0.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.
Files changed (38) hide show
  1. package/README.md +124 -0
  2. package/bin/paw.js +82 -0
  3. package/dist/agents/PAW-Review.agent.md +86 -0
  4. package/dist/agents/PAW.agent.md +171 -0
  5. package/dist/skills/paw-code-research/SKILL.md +209 -0
  6. package/dist/skills/paw-docs-guidance/SKILL.md +163 -0
  7. package/dist/skills/paw-git-operations/SKILL.md +196 -0
  8. package/dist/skills/paw-impl-review/SKILL.md +178 -0
  9. package/dist/skills/paw-implement/SKILL.md +153 -0
  10. package/dist/skills/paw-init/SKILL.md +118 -0
  11. package/dist/skills/paw-plan-review/SKILL.md +117 -0
  12. package/dist/skills/paw-planning/SKILL.md +217 -0
  13. package/dist/skills/paw-pr/SKILL.md +157 -0
  14. package/dist/skills/paw-review-baseline/SKILL.md +268 -0
  15. package/dist/skills/paw-review-correlation/SKILL.md +307 -0
  16. package/dist/skills/paw-review-critic/SKILL.md +373 -0
  17. package/dist/skills/paw-review-feedback/SKILL.md +437 -0
  18. package/dist/skills/paw-review-gap/SKILL.md +639 -0
  19. package/dist/skills/paw-review-github/SKILL.md +336 -0
  20. package/dist/skills/paw-review-impact/SKILL.md +569 -0
  21. package/dist/skills/paw-review-response/SKILL.md +118 -0
  22. package/dist/skills/paw-review-understanding/SKILL.md +372 -0
  23. package/dist/skills/paw-review-workflow/SKILL.md +239 -0
  24. package/dist/skills/paw-spec/SKILL.md +257 -0
  25. package/dist/skills/paw-spec-research/SKILL.md +138 -0
  26. package/dist/skills/paw-spec-review/SKILL.md +101 -0
  27. package/dist/skills/paw-status/SKILL.md +160 -0
  28. package/dist/skills/paw-transition/SKILL.md +134 -0
  29. package/dist/skills/paw-work-shaping/SKILL.md +99 -0
  30. package/dist/skills/paw-workflow/SKILL.md +142 -0
  31. package/lib/commands/install.js +103 -0
  32. package/lib/commands/list.js +18 -0
  33. package/lib/commands/uninstall.js +95 -0
  34. package/lib/commands/upgrade.js +119 -0
  35. package/lib/manifest.js +42 -0
  36. package/lib/paths.js +42 -0
  37. package/lib/registry.js +41 -0
  38. package/package.json +40 -0
@@ -0,0 +1,372 @@
1
+ ---
2
+ name: paw-review-understanding
3
+ description: Analyzes PR changes to create ReviewContext.md and DerivedSpec.md artifacts. Handles both initial analysis and resumption after baseline research.
4
+ metadata:
5
+ version: "0.0.1"
6
+ ---
7
+
8
+ # Understanding Activity Skill
9
+
10
+ Analyze pull request changes to create comprehensive understanding artifacts. This activity handles both initial context gathering and specification derivation after baseline research.
11
+
12
+ > **Reference**: Follow Core Review Principles from `paw-review-workflow` skill.
13
+
14
+ ## Responsibilities
15
+
16
+ - Gather PR metadata (GitHub API or git diff) and document changed files
17
+ - Generate research prompt for baseline codebase analysis
18
+ - Derive specification from PR description, code analysis, and baseline understanding
19
+ - Create ReviewContext.md as authoritative parameter source
20
+ - Validate all artifacts meet quality standards
21
+
22
+ ## Non-Responsibilities
23
+
24
+ - Quality evaluation or gap identification (Evaluation stage skills)
25
+ - Review comment generation (Output stage skills)
26
+ - Git operations for checkout/restore (handled by paw-review-baseline)
27
+ - Workflow orchestration and stage transitions (handled by workflow skill)
28
+
29
+ ## Execution Modes
30
+
31
+ This skill operates in two modes based on artifact state:
32
+
33
+ ### Initial Mode (No ReviewContext.md)
34
+
35
+ Execute Steps 1-3: Context gathering, research prompt generation, signal for baseline research.
36
+
37
+ **Detection**: ReviewContext.md not found at `.paw/reviews/<identifier>/`
38
+
39
+ ### Resumption Mode (ReviewContext.md + CodeResearch.md exist)
40
+
41
+ Execute Step 4 only: Derive specification from baseline research.
42
+
43
+ **Detection**: Both ReviewContext.md AND CodeResearch.md exist at artifact path.
44
+
45
+ ## Context Detection
46
+
47
+ Determine context type before proceeding:
48
+
49
+ **GitHub Context**: PR URL or number provided
50
+ - Use GitHub MCP tools for metadata retrieval
51
+ - Extract commits, files, description from API
52
+
53
+ **Non-GitHub Context**: No PR reference
54
+ - Verify current branch is checked out
55
+ - Request base branch name from user
56
+ - Use git commands for metadata
57
+
58
+ ## Multi-Repository Mode
59
+
60
+ **Detection**: Any of these conditions triggers multi-repo mode:
61
+ - Multiple PR URLs/numbers in input (e.g., `PR-123 PR-456`)
62
+ - Multiple workspace folders open (detected via multiple `.git` directories)
63
+ - PR links reference different repositories
64
+
65
+ **Per-PR Processing**:
66
+ - Create separate artifact directories for each PR
67
+ - Run Steps 1-4 independently for each repository
68
+ - Cross-reference related PRs in each ReviewContext.md
69
+
70
+ **Identifier Scheme**:
71
+ - Single PR: `PR-<number>` (e.g., `PR-123`)
72
+ - Multi-repo PR: `PR-<number>-<repo-slug>` (e.g., `PR-123-my-api`)
73
+ - Repo-slug: Last segment of repository name, lowercase, special chars removed
74
+
75
+ **ReviewContext.md Extension** (for multi-repo):
76
+ ```yaml
77
+ repository: owner/repo-name
78
+ related_prs:
79
+ - number: 456
80
+ repository: owner/other-repo
81
+ relationship: "depends-on" # or "related-to", "blocks"
82
+ ```
83
+
84
+ ## Step 1: Context Gathering & ReviewContext.md Creation
85
+
86
+ 1. **Determine Remote Name**:
87
+ - Check ReviewContext.md for `Remote` field (if resuming)
88
+ - Default to `origin` if not specified
89
+
90
+ 2. **Fetch PR Metadata**:
91
+ - **GitHub**: Use GitHub tools to retrieve PR details (number, title, author, state, description, labels, reviewers, CI status, changed files)
92
+ - **Non-GitHub**: Use git to determine commits and changed files between base and head
93
+
94
+ 3. **Resolve Base Commit** (Non-GitHub only):
95
+ - Prefer the remote tracking branch reference
96
+ - Record source (remote|local|github-api) in ReviewContext.md
97
+
98
+ 4. **Create ReviewContext.md**:
99
+ - Write to `.paw/reviews/<identifier>/ReviewContext.md`
100
+ - Use template structure below
101
+ - Include all metadata and flags
102
+
103
+ ## Step 2: Research Questions Generation
104
+
105
+ 1. **Identify Research Needs** for each changed file:
106
+ - How did the module function before changes?
107
+ - What were integration points and dependencies?
108
+ - What patterns and conventions were used?
109
+ - What test coverage was present?
110
+
111
+ 2. **Create ResearchQuestions.md**:
112
+ - Write to `.paw/reviews/<identifier>/ResearchQuestions.md`
113
+ - YAML frontmatter with metadata
114
+ - Research questions organized by changed file/module
115
+ - Clear investigation targets with file:line references
116
+
117
+ ## Step 3: Signal for Research
118
+
119
+ Report completion of initial phase:
120
+ ```
121
+ Research Questions Ready
122
+
123
+ Created ResearchQuestions.md with questions about pre-change behavior.
124
+
125
+ Files to investigate at base commit <sha>:
126
+ - [list files]
127
+
128
+ Waiting for CodeResearch.md from baseline research.
129
+ ```
130
+
131
+ **Activity Status**: Partial (awaiting baseline research)
132
+
133
+ ## Step 4: Derive Specification
134
+
135
+ Execute only when CodeResearch.md exists.
136
+
137
+ 1. **Read All Source Material**:
138
+ - ReviewContext.md (PR description, changed files)
139
+ - CodeResearch.md (pre-change system behavior)
140
+ - Git diffs for all changes
141
+
142
+ 2. **Identify Explicit Goals**:
143
+ - Goals stated in PR description
144
+ - Requirements from linked issues
145
+ - Commit messages describing intent
146
+ - Mark as "Explicit" in DerivedSpec.md
147
+
148
+ 3. **Identify Inferred Goals**:
149
+ - Observable behavior changes from code analysis
150
+ - New functionality added
151
+ - Modified logic or control flow
152
+ - Mark as "Inferred" in DerivedSpec.md
153
+
154
+ 4. **Document Baseline Context** (from CodeResearch.md):
155
+ - How system worked before changes
156
+ - Existing patterns and conventions
157
+ - Integration points affected
158
+
159
+ 5. **Characterize Before/After Behavior**:
160
+ - Specific observable differences
161
+ - Changed APIs, endpoints, interfaces
162
+ - Modified data flows
163
+
164
+ 6. **Flag Discrepancies**:
165
+ - PR description contradicts code changes → BLOCK
166
+ - Intent unclear → document as inferred with evidence
167
+ - **CRITICAL**: If open questions remain, report blocked status
168
+
169
+ 7. **Create DerivedSpec.md**:
170
+ - Write to `.paw/reviews/<identifier>/DerivedSpec.md`
171
+ - Use template structure below
172
+ - **Zero open questions allowed**
173
+
174
+ ## Artifact Directory Structure
175
+
176
+ **GitHub Context**: `.paw/reviews/PR-<number>/`
177
+ **Non-GitHub Context**: `.paw/reviews/<branch-slug>/`
178
+
179
+ Branch slug: lowercase, `/` → `-`, remove invalid chars.
180
+
181
+ ## Validation Criteria
182
+
183
+ ### ReviewContext.md
184
+ - All metadata fields populated
185
+ - Flags section identifies applicable conditions
186
+ - Base and head commit SHAs recorded
187
+
188
+ ### ResearchQuestions.md
189
+ - Questions are specific and answerable
190
+ - All changed files covered
191
+ - Clear investigation targets with file:line references
192
+
193
+ ### DerivedSpec.md
194
+ - Explicit vs inferred goals distinguished
195
+ - Baseline behavior documented from CodeResearch.md
196
+ - Observable before/after behavior characterized
197
+ - All file:line references accurate
198
+ - **Zero open questions**
199
+
200
+ ## Completion Response
201
+
202
+ ### After Initial Mode (Steps 1-3):
203
+ ```
204
+ Activity complete.
205
+ Artifact saved: .paw/reviews/<identifier>/ReviewContext.md
206
+ Artifact saved: .paw/reviews/<identifier>/ResearchQuestions.md
207
+ Status: Partial
208
+ Summary: Context gathered, awaiting baseline research.
209
+ ```
210
+
211
+ ### After Resumption Mode (Step 4):
212
+ ```
213
+ Activity complete.
214
+ Artifact saved: .paw/reviews/<identifier>/DerivedSpec.md
215
+ Status: Success
216
+ Summary: Specification derived with [N] explicit and [M] inferred goals.
217
+ ```
218
+
219
+ ---
220
+
221
+ ## ReviewContext.md Template
222
+
223
+ ```markdown
224
+ ---
225
+ date: <YYYY-MM-DD HH:MM:SS TZ>
226
+ git_commit: <head commit SHA>
227
+ branch: <head branch>
228
+ repository: <owner/repo OR local>
229
+ topic: "Review Context for <PR Title or Branch>"
230
+ tags: [review, context, metadata]
231
+ status: complete
232
+ ---
233
+
234
+ # ReviewContext
235
+
236
+ **PR Number**: <number> (GitHub) OR **Branch**: <branch-slug> (non-GitHub)
237
+ **Remote**: <remote-name> (default: origin, or "No remote configured")
238
+ **Base Branch**: <base-branch>
239
+ **Head Branch**: <head-branch>
240
+ **Base Commit**: <sha>
241
+ **Base Commit Source**: remote|local|github-api
242
+ **Head Commit**: <sha>
243
+ **Repository**: <owner>/<repo> OR "Local repository"
244
+ **Author**: <username or git author>
245
+ **Title**: <pr-title or derived from commits>
246
+ **State**: open|closed|draft (GitHub) OR active (non-GitHub)
247
+ **Created**: <date> (GitHub only)
248
+ **CI Status**: <passing|failing|pending> (GitHub) OR "Not available" (non-GitHub)
249
+ **Labels**: <label-list> (GitHub) OR "N/A" (non-GitHub)
250
+ **Reviewers**: <reviewer-list> (GitHub) OR "N/A" (non-GitHub)
251
+ **Linked Issues**: <issue-urls> (GitHub) OR "Inferred from commits" (non-GitHub)
252
+ **Changed Files**: <count> files, +<additions> -<deletions>
253
+ **Artifact Paths**: .paw/reviews/<identifier>/
254
+
255
+ ## Description
256
+
257
+ <PR description text or commit message summary>
258
+
259
+ ## Flags
260
+
261
+ - [x/] CI Failures present
262
+ - [x/] Breaking changes suspected
263
+
264
+ ## Artifacts
265
+
266
+ - [x/] ReviewContext.md - This file
267
+ - [x/] ResearchQuestions.md - Research questions for baseline analysis
268
+ - [x/] CodeResearch.md - Baseline understanding (paw-review-baseline)
269
+ - [x/] DerivedSpec.md - Derived specification
270
+
271
+ ## Metadata
272
+
273
+ **Created**: <timestamp>
274
+ **Git Commit**: <current HEAD SHA>
275
+ **Reviewer**: <current git user>
276
+ **Analysis Tool**: PAW Review Understanding
277
+ ```
278
+
279
+ ---
280
+
281
+ ## DerivedSpec.md Template
282
+
283
+ ```markdown
284
+ ---
285
+ date: <YYYY-MM-DD HH:MM:SS TZ>
286
+ git_commit: <head commit SHA>
287
+ branch: <head branch>
288
+ repository: <owner/repo OR local>
289
+ topic: "Derived Specification for <PR Title or Branch>"
290
+ tags: [review, specification, analysis]
291
+ status: complete
292
+ ---
293
+
294
+ # Derived Specification: <PR Title or Branch>
295
+
296
+ ## Intent Summary
297
+
298
+ <1-2 sentence summary of what this PR accomplishes>
299
+
300
+ ## Explicit Goals (Stated in PR/Issues)
301
+
302
+ Goals explicitly mentioned in PR description, linked issues, or commit messages:
303
+
304
+ 1. <Goal from PR description>
305
+ 2. <Goal from linked issue #X>
306
+
307
+ *Source: PR description, Issue #X, commits <sha>...<sha>*
308
+
309
+ ## Inferred Goals (Observed from Code)
310
+
311
+ Goals derived from code analysis that weren't explicitly stated:
312
+
313
+ 1. <Observable behavior change with file:line reference>
314
+ 2. <New functionality added with file:line reference>
315
+
316
+ *Source: Code analysis of changed files*
317
+
318
+ ## Baseline Behavior (Pre-Change)
319
+
320
+ How the system worked before changes (from CodeResearch.md):
321
+
322
+ **Module**: `path/to/module.ext`
323
+ - **Before**: <behavior description>
324
+ - **Integration**: <connections to other components>
325
+ - **Patterns**: <conventions used>
326
+
327
+ *Source: CodeResearch.md at base commit <sha>*
328
+
329
+ ## Observable Changes (Before → After)
330
+
331
+ ### Changed Interfaces
332
+
333
+ | Component | Before | After | Breaking? |
334
+ |-----------|--------|-------|-----------|
335
+ | `module.func()` | params: (a, b) | params: (a, b, c) | Yes |
336
+
337
+ ### Changed Behavior
338
+
339
+ **Feature**: <feature name>
340
+ - **Before**: <from CodeResearch.md>
341
+ - **After**: <from code analysis>
342
+ - **Impact**: <observable difference>
343
+
344
+ [file:line references for each claim]
345
+
346
+ ## Scope Boundaries
347
+
348
+ **In Scope**: <What this PR changes>
349
+ **Out of Scope**: <What this PR does NOT change>
350
+
351
+ ## Assumptions
352
+
353
+ <Document only when necessary to resolve ambiguity>
354
+
355
+ ## Open Questions
356
+
357
+ **CRITICAL**: This section must be empty before completion.
358
+
359
+ ## Discrepancies Flagged
360
+
361
+ [Only if conflicts exist]
362
+
363
+ **PR Description States**: <quote>
364
+ **Code Analysis Shows**: <evidence with file:line>
365
+ **Resolution**: [Pending | Resolved: <how>]
366
+
367
+ ## References
368
+
369
+ - **ReviewContext.md**: Metadata and changed file summary
370
+ - **CodeResearch.md**: Pre-change baseline understanding
371
+ - **Commits**: <base-sha>..<head-sha>
372
+ ```
@@ -0,0 +1,239 @@
1
+ ---
2
+ name: paw-review-workflow
3
+ description: Orchestrates the PAW Review workflow, coordinating activity skills to analyze PRs and generate comprehensive review feedback.
4
+ metadata:
5
+ version: "0.0.1"
6
+ ---
7
+
8
+ # PAW Review Workflow Skill
9
+
10
+ This workflow skill orchestrates the complete PAW Review process, coordinating activity skills through subagent execution to analyze pull requests and generate comprehensive review feedback.
11
+
12
+ ## Core Review Principles
13
+
14
+ These principles apply to ALL review stages. Activity skills reference these principles rather than duplicating them.
15
+
16
+ ### 1. Evidence-Based Documentation
17
+
18
+ Every observation, finding, or claim MUST be supported by:
19
+ - Specific file:line references
20
+ - Concrete code patterns or test results
21
+ - Direct evidence from the codebase
22
+
23
+ **NEVER** include speculation, assumptions, or subjective preferences without evidence.
24
+
25
+ ### 2. File:Line Reference Requirement
26
+
27
+ All code-related claims require specific file:line citations:
28
+ - `[src/module.ts:45](src/module.ts#L45)` for single lines
29
+ - `[src/module.ts:45-52](src/module.ts#L45-L52)` for ranges
30
+ - Multiple locations should be listed explicitly
31
+
32
+ ### 3. No Fabrication Guardrail
33
+
34
+ **CRITICAL**: Do not fabricate, invent, or assume information:
35
+ - If information is unavailable, state "Not found" or "Unable to determine"
36
+ - Do not hallucinate file contents, function behaviors, or patterns
37
+ - When uncertain, document the uncertainty explicitly
38
+
39
+ ### 4. Document, Don't Critique (Early Stages)
40
+
41
+ Understanding and baseline research stages document what exists—they do NOT:
42
+ - Evaluate quality or suggest improvements
43
+ - Identify issues or bugs
44
+ - Make recommendations
45
+ - Critique implementation decisions
46
+
47
+ Evaluation and critique happen in designated later stages only.
48
+
49
+ ### 5. Human Control Principle
50
+
51
+ The review workflow assists human reviewers—it does NOT replace their judgment:
52
+ - Pending reviews are NEVER auto-submitted
53
+ - Final decisions on all comments rest with the human reviewer
54
+ - Generated feedback is advisory, not prescriptive
55
+ - Humans can modify, skip, or override any recommendation
56
+
57
+ ### 6. Artifact Completeness
58
+
59
+ Each stage produces complete, well-structured artifacts:
60
+ - No placeholders or "TBD" markers
61
+ - No unresolved questions blocking downstream stages
62
+ - Each artifact is self-contained and traceable to sources
63
+
64
+ ## Subagent Contract
65
+
66
+ Activity skills are executed via delegated agent sessions.
67
+
68
+ ### Skill Loading (CRITICAL)
69
+
70
+ **Every subagent MUST load their skill FIRST before executing any work**:
71
+
72
+
73
+
74
+ 1. Read the skill file at `skills/paw-review-<skill-name>/SKILL.md`
75
+ 2. Read and internalize the skill instructions
76
+ 3. Only then begin executing the activity
77
+
78
+ **Delegation prompt must include**: "First read your skill from `skills/paw-review-<skill-name>/SKILL.md`, then execute the activity."
79
+
80
+
81
+ ### Response Format
82
+
83
+ Upon completion, respond with artifact path and status (Success, Partial, or Blocked).
84
+
85
+ ### Artifact Path Confirmation
86
+
87
+ Always confirm the exact path where artifacts were written. Downstream stages depend on this.
88
+
89
+ ## Artifact Directory Structure
90
+
91
+ All review artifacts are stored in a consistent directory structure:
92
+
93
+ ```
94
+ .paw/reviews/<identifier>/
95
+ ├── ReviewContext.md # Stage: Understanding (initial)
96
+ ├── ResearchQuestions.md # Stage: Understanding (initial)
97
+ ├── CodeResearch.md # Stage: Baseline Research
98
+ ├── DerivedSpec.md # Stage: Understanding (after research)
99
+ ├── ImpactAnalysis.md # Stage: Evaluation (impact)
100
+ ├── GapAnalysis.md # Stage: Evaluation (gaps)
101
+ ├── CrossRepoAnalysis.md # Stage: Correlation (multi-repo only)
102
+ └── ReviewComments.md # Stage: Output (evolves: draft → assessed → finalized → posted)
103
+ ```
104
+
105
+ **ReviewComments.md Evolution:**
106
+ 1. **Draft**: Initial comments generated by feedback skill
107
+ 2. **Assessed**: Assessment sections added by critic skill
108
+ 3. **Finalized**: `**Final**:` markers added by feedback skill (critique response)
109
+ 4. **Posted**: `**Posted**:` status added by github skill
110
+
111
+ ### Identifier Derivation
112
+
113
+ - **Single GitHub PR**: `PR-<number>` (e.g., `PR-123`)
114
+ - **Multi-repo GitHub PRs**: `PR-<number>-<repo-slug>` per PR (e.g., `PR-123-my-api/`, `PR-456-my-frontend/`)
115
+ - **Local branch**: Slugified branch name (e.g., `feature-new-auth`)
116
+
117
+ **Repo-slug derivation**: Last path segment of repository name, lowercase, special chars removed.
118
+ Example: `acme-corp/my-api-service` → `my-api-service`
119
+
120
+ **Multi-repo detection**: Use when multiple workspace folders are open in VS Code OR multiple PRs provided.
121
+
122
+ ## Workflow Orchestration
123
+
124
+ The workflow executes stages in sequence, with each stage producing artifacts consumed by downstream stages.
125
+
126
+ ### Understanding Stage
127
+
128
+ **Skills**: `paw-review-understanding`, `paw-review-baseline`
129
+
130
+ **Sequence**:
131
+ 1. Run `paw-review-understanding` activity
132
+ - Input: PR number/URL or branch context
133
+ - Output: `ReviewContext.md`, `ResearchQuestions.md`
134
+
135
+ 2. Run `paw-review-baseline` activity
136
+ - Input: ReviewContext.md, ResearchQuestions.md
137
+ - Output: `CodeResearch.md`
138
+
139
+ 3. Run `paw-review-understanding` activity (resume)
140
+ - Input: ReviewContext.md, CodeResearch.md
141
+ - Detects CodeResearch.md exists → skips to specification derivation
142
+ - Output: `DerivedSpec.md`
143
+
144
+ **Stage Gate**: Verify ReviewContext.md, CodeResearch.md, DerivedSpec.md exist before proceeding.
145
+
146
+ ### Evaluation Stage
147
+
148
+ **Skills**: `paw-review-impact`, `paw-review-gap`
149
+
150
+ **Sequence**:
151
+ 1. Run `paw-review-impact` activity
152
+ - Input: All understanding artifacts
153
+ - Output: `ImpactAnalysis.md`
154
+
155
+ 2. Run `paw-review-gap` activity
156
+ - Input: All understanding + impact artifacts
157
+ - Output: `GapAnalysis.md`
158
+
159
+ **Stage Gate**: Verify ImpactAnalysis.md, GapAnalysis.md exist before proceeding.
160
+
161
+ ### Cross-Repository Correlation Stage (Multi-Repo Only)
162
+
163
+ **Skill**: `paw-review-correlation`
164
+
165
+ **Condition**: Only run when multiple PRs/repositories detected. Skip for single-repo reviews.
166
+
167
+ **Detection Criteria** (any of):
168
+ - Multiple PR artifact directories exist (e.g., `PR-123-repo-a/`, `PR-456-repo-b/`)
169
+ - Multiple workspace folders open (detected via multiple `.git` directories)
170
+ - ReviewContext.md contains `related_prs` entries
171
+
172
+ **Sequence**:
173
+ 1. Run `paw-review-correlation` activity
174
+ - Input: All per-repo ImpactAnalysis.md and GapAnalysis.md files
175
+ - Output: `CrossRepoAnalysis.md` (in primary repo's artifact directory)
176
+
177
+ **Stage Gate**: Verify CrossRepoAnalysis.md exists before proceeding to Output stage.
178
+
179
+ **Skip Behavior**: For single-repo reviews, proceed directly to Output stage without running correlation.
180
+
181
+ ### Output Stage
182
+
183
+ **Skills**: `paw-review-feedback`, `paw-review-critic`, `paw-review-github`
184
+
185
+ The Output stage uses an iterative feedback-critique pattern to refine comments before posting to GitHub.
186
+
187
+ **Sequence**:
188
+
189
+ 1. **Run `paw-review-feedback` activity (Initial Pass)**
190
+ - Input: All prior artifacts (ReviewContext, CodeResearch, DerivedSpec, ImpactAnalysis, GapAnalysis, optionally CrossRepoAnalysis)
191
+ - Output: `ReviewComments.md` with draft comments (status: draft)
192
+ - Does NOT post to GitHub in this pass
193
+
194
+ 2. **Run `paw-review-critic` activity**
195
+ - Input: ReviewComments.md + all prior artifacts
196
+ - Output: Assessment sections added to `ReviewComments.md`
197
+ - Generates Iteration Summary with Include/Modify/Skip recommendations
198
+
199
+ 3. **Run `paw-review-feedback` activity (Critique Response)**
200
+ - Input: ReviewComments.md (with assessments) + all prior artifacts
201
+ - Detects Assessment sections → enters Critique Response Mode
202
+ - Output: Updated comments with `**Final**:` markers (status: finalized)
203
+ - Comments marked: "Ready for GitHub posting" or "Skipped per critique"
204
+
205
+ 4. **Run `paw-review-github` activity (GitHub PRs only)**
206
+ - Input: ReviewComments.md with finalized comments
207
+ - Output: Pending review created on GitHub, ReviewComments.md updated with post status
208
+ - Only posts comments marked "Ready for GitHub posting"
209
+ - Skipped comments remain in artifact but NOT posted
210
+ - **Skipped for non-GitHub contexts** (provides manual posting instructions instead)
211
+
212
+ **Stage Gate**: Verify all comments have `**Final**:` markers before GitHub posting.
213
+
214
+ **Human Control Point**: The pending review is created but NOT submitted. Human reviewer:
215
+ - Reviews generated comments in GitHub UI
216
+ - Can see full comment history in ReviewComments.md (original → assessment → updated)
217
+ - Can manually add skipped comments if they disagree with critique
218
+ - Modifies, adds, or removes comments as needed
219
+ - Submits review when satisfied
220
+
221
+ ## Terminal Behavior
222
+
223
+ Upon workflow completion, report:
224
+ - Artifact locations (all generated files in `.paw/reviews/<identifier>/`)
225
+ - **GitHub PRs**: Pending review ID and comment counts (e.g., "Pending review created: Review ID 12345678, 6 comments posted, 2 skipped per critique")
226
+ - **Non-GitHub**: Manual posting instructions location
227
+ - **Multi-repo reviews**: Cross-repo findings summary (interface contracts analyzed, mismatches found, deployment order)
228
+ - Comment evolution summary: original comments generated, modified per critique, skipped per critique
229
+ - Next steps for the human reviewer (review comments in GitHub UI, edit as needed, submit when ready)
230
+
231
+ ## Cross-Repository Support
232
+
233
+ If multiple repositories or PRs are detected:
234
+ 1. Identify which repositories have changes
235
+ 2. Determine the primary repository (where changes originate)
236
+ 3. For each repository, run the Understanding and Evaluation stages independently
237
+ 4. Run Cross-Repository Correlation stage to synthesize findings across repos
238
+ 5. In the Output stage, incorporate cross-repo findings into review comments
239
+ 6. Note cross-repo dependencies in comments using notation: `(See also: owner/other-repo#NNN)`