prr-kit 1.2.3 → 1.4.0
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 +200 -24
- package/package.json +1 -1
- package/src/core/agents/prr-master.agent.yaml +10 -6
- package/src/core/tasks/clear.md +36 -71
- package/src/core/tasks/help.md +7 -6
- package/src/core/tasks/select-session.md +94 -0
- package/src/core/workflows/party-mode/steps/step-00-user-instructions.md +125 -0
- package/src/core/workflows/party-mode/steps/step-01-load-reviewers.md +27 -19
- package/src/core/workflows/party-mode/steps/step-02-discussion.md +13 -11
- package/src/core/workflows/party-mode/workflow.md +7 -7
- package/src/prr/agents/architecture-reviewer.agent.yaml +2 -2
- package/src/prr/agents/business-reviewer.agent.yaml +2 -2
- package/src/prr/agents/general-reviewer.agent.yaml +2 -2
- package/src/prr/agents/performance-reviewer.agent.yaml +2 -2
- package/src/prr/agents/security-reviewer.agent.yaml +2 -2
- package/src/prr/workflows/1-discover/select-pr/steps/step-05-confirm.md +96 -25
- package/src/prr/workflows/1-discover/select-pr/workflow.md +1 -1
- package/src/prr/workflows/2-analyze/collect-pr-context/steps/step-02-collect-sources.md +2 -1
- package/src/prr/workflows/2-analyze/collect-pr-context/steps/step-03-manual-context-input.md +102 -0
- package/src/prr/workflows/2-analyze/collect-pr-context/steps/{step-03-build-knowledge-base.md → step-04-build-knowledge-base.md} +32 -22
- package/src/prr/workflows/2-analyze/collect-pr-context/workflow.md +5 -6
- package/src/prr/workflows/2-analyze/describe-pr/steps/step-01-load-context.md +3 -3
- package/src/prr/workflows/2-analyze/describe-pr/steps/step-04-output.md +6 -7
- package/src/prr/workflows/2-analyze/describe-pr/workflow.md +2 -2
- package/src/prr/workflows/3-review/architecture-review/checklist.md +1 -2
- package/src/prr/workflows/3-review/architecture-review/workflow.yaml +4 -3
- package/src/prr/workflows/3-review/business-review/checklist.md +1 -2
- package/src/prr/workflows/3-review/business-review/instructions.xml +2 -0
- package/src/prr/workflows/3-review/business-review/workflow.yaml +4 -3
- package/src/prr/workflows/3-review/general-review/checklist.md +1 -2
- package/src/prr/workflows/3-review/general-review/instructions.xml +7 -0
- package/src/prr/workflows/3-review/general-review/workflow.yaml +4 -3
- package/src/prr/workflows/3-review/performance-review/checklist.md +1 -2
- package/src/prr/workflows/3-review/performance-review/workflow.yaml +4 -3
- package/src/prr/workflows/3-review/security-review/checklist.md +1 -2
- package/src/prr/workflows/3-review/security-review/workflow.yaml +4 -3
- package/src/prr/workflows/4-improve/improve-code/checklist.md +1 -2
- package/src/prr/workflows/4-improve/improve-code/workflow.yaml +3 -2
- package/src/prr/workflows/5-ask/ask-code/steps/step-01-load-context.md +2 -2
- package/src/prr/workflows/6-report/generate-report/steps/step-01-collect.md +13 -9
- package/src/prr/workflows/6-report/generate-report/steps/step-03-write.md +2 -2
- package/src/prr/workflows/6-report/generate-report/workflow.md +2 -1
- package/src/prr/workflows/6-report/post-comments/steps/step-01-format.md +4 -5
- package/src/prr/workflows/6-report/post-comments/workflow.md +3 -2
- package/src/prr/workflows/quick/workflow.md +86 -28
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "step-03-manual-context-input"
|
|
3
|
+
description: "Collect user instructions, requirements, and context for this review session"
|
|
4
|
+
nextStepFile: "./step-04-build-knowledge-base.md"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Step 3: User Instructions & Context
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
Let the user guide the review — they can restrict scope, set focus areas, add mandatory requirements, or provide background context. Their input directly controls which reviews run and what each reviewer prioritizes.
|
|
11
|
+
|
|
12
|
+
## Sequence of Instructions
|
|
13
|
+
|
|
14
|
+
### 1. Show Collection Summary
|
|
15
|
+
|
|
16
|
+
Print a brief summary of what was automatically collected so far:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
20
|
+
✅ Auto-collection complete.
|
|
21
|
+
|
|
22
|
+
📊 Collected:
|
|
23
|
+
🗂️ Files changed: {files_count}
|
|
24
|
+
🎯 Domains: {domains_list}
|
|
25
|
+
🧩 Stacks: {stacks_list or "none"}
|
|
26
|
+
📘 Primary docs: {primary_docs_found}
|
|
27
|
+
⚙️ Config files: {config_files_found}
|
|
28
|
+
💬 Annotations: {annotations_count}
|
|
29
|
+
🔌 External: {mcp_and_rag_summary or "none"}
|
|
30
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. Prompt User
|
|
34
|
+
|
|
35
|
+
Display EXACTLY:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
💬 Any instructions for this review?
|
|
39
|
+
Press Enter to run a full standard review, or type your instructions below.
|
|
40
|
+
|
|
41
|
+
You can specify:
|
|
42
|
+
• Scope "only security" / "security and architecture" / "skip performance"
|
|
43
|
+
• Focus "focus on SQL injection and rate limiting"
|
|
44
|
+
• Requirements "all API endpoints must have auth middleware"
|
|
45
|
+
• Context "hotfix — ignore refactoring suggestions"
|
|
46
|
+
• Mix freely "security only, focus on JWT handling, context: auth rewrite in progress"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**HALT — wait for user response before continuing.**
|
|
50
|
+
|
|
51
|
+
### 3. Parse Response
|
|
52
|
+
|
|
53
|
+
**If user pressed Enter / left empty:**
|
|
54
|
+
- Set `user_instructions.provided` = `false`
|
|
55
|
+
- Set `user_instructions.review_scope` = `"all"`
|
|
56
|
+
- Set all other fields to `null`
|
|
57
|
+
|
|
58
|
+
**If user typed something**, parse the free-form text and extract:
|
|
59
|
+
|
|
60
|
+
**`review_scope`** — which reviews to run:
|
|
61
|
+
- Parse for scope signals: "only X", "just X", "X only", "skip X", "no X review", "X and Y"
|
|
62
|
+
- Map to codes: `GR` (general), `SR` (security), `PR` (performance), `AR` (architecture), `BR` (business), `IC` (improve code)
|
|
63
|
+
- Examples:
|
|
64
|
+
- "only security" → `[SR]`
|
|
65
|
+
- "security and architecture" → `[SR, AR]`
|
|
66
|
+
- "skip performance" → `[GR, SR, AR, BR]`
|
|
67
|
+
- "security, focus on JWT" → `[SR]` (scope signal found)
|
|
68
|
+
- "focus on SQL injection" (no scope signal) → `"all"` (focus only, all reviews still run)
|
|
69
|
+
- If no scope restriction found → `"all"`
|
|
70
|
+
|
|
71
|
+
**`focus_areas`** — specific things reviewers must prioritize (list of strings), or `null` if none mentioned.
|
|
72
|
+
|
|
73
|
+
**`custom_requirements`** — mandatory checks user specified (list of strings), or `null`.
|
|
74
|
+
|
|
75
|
+
**`context_notes`** — background info, trade-offs, constraints (list of strings), or `null`.
|
|
76
|
+
|
|
77
|
+
**`raw`** — full original text from user.
|
|
78
|
+
|
|
79
|
+
Set `user_instructions.provided` = `true`.
|
|
80
|
+
|
|
81
|
+
### 4. Acknowledge
|
|
82
|
+
|
|
83
|
+
**If user provided instructions**, print a confirmation of what was parsed:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
✅ Instructions captured — driving all downstream review steps.
|
|
87
|
+
|
|
88
|
+
📋 Scope: {scope_list joined with ", " OR "all reviews (standard)"}
|
|
89
|
+
🎯 Focus: {focus_areas joined with ", " OR "standard coverage"}
|
|
90
|
+
✅ Requirements: {custom_requirements joined with ", " OR "none"}
|
|
91
|
+
📝 Context: {context_notes joined with "; " OR "none"}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**If user left empty:**
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
▶️ Full standard review — all reviewers, standard focus.
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 5. Load Next Step
|
|
101
|
+
|
|
102
|
+
Add `step-03-manual-context-input` to `stepsCompleted`. Load: `{nextStepFile}`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: "step-
|
|
2
|
+
name: "step-04-build-knowledge-base"
|
|
3
3
|
description: "Build structured PR-specific knowledge base for reviewers"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Step
|
|
6
|
+
# Step 4: Build PR-Specific Knowledge Base
|
|
7
7
|
|
|
8
8
|
## Goal
|
|
9
9
|
Transform collected data into structured knowledge base optimized for reviewers.
|
|
@@ -32,6 +32,20 @@ pr_metadata:
|
|
|
32
32
|
files_changed: {n}
|
|
33
33
|
collected_at: {ISO timestamp}
|
|
34
34
|
|
|
35
|
+
# ⚠️ IMPORTANT — Human-provided instructions from the user.
|
|
36
|
+
# All reviewers MUST read this section before starting any review.
|
|
37
|
+
# review_scope controls which reviews run. focus_areas, custom_requirements, and context_notes
|
|
38
|
+
# are highest-priority guidance — align all findings against them.
|
|
39
|
+
user_instructions:
|
|
40
|
+
# Populated only when the user provided input in step-03-manual-context-input.
|
|
41
|
+
# If provided: true — treat this content as the highest-priority context in this file.
|
|
42
|
+
provided: {true|false}
|
|
43
|
+
review_scope: {"all" | [SR] | [SR, AR] | ...} # "all" = run all reviews; list = only those codes
|
|
44
|
+
focus_areas: {list of strings, or null} # specific things every reviewer must prioritize
|
|
45
|
+
custom_requirements: {list of strings, or null} # mandatory checks the user specified
|
|
46
|
+
context_notes: {list of strings, or null} # background info, trade-offs, constraints
|
|
47
|
+
raw: {original text from user, or null} # verbatim input
|
|
48
|
+
|
|
35
49
|
files_analysis:
|
|
36
50
|
changed_files:
|
|
37
51
|
- path: src/stores/todoStore.js
|
|
@@ -235,6 +249,7 @@ external_context:
|
|
|
235
249
|
|
|
236
250
|
review_priorities:
|
|
237
251
|
# Guide reviewers on what to focus on
|
|
252
|
+
# ⚠️ If user_instructions.provided is true — reviewers MUST check findings against user_instructions first.
|
|
238
253
|
critical:
|
|
239
254
|
- "Verify no v-html with user input (security requirement)"
|
|
240
255
|
- "Check ESLint error-level rules compliance"
|
|
@@ -250,6 +265,10 @@ review_priorities:
|
|
|
250
265
|
- "Optional optimizations"
|
|
251
266
|
|
|
252
267
|
reviewer_guidance:
|
|
268
|
+
# ⚠️ If user_instructions.provided is true:
|
|
269
|
+
# PREPEND each reviewer's list with user_instructions.focus_areas (if any)
|
|
270
|
+
# APPEND each reviewer's list with user_instructions.custom_requirements prefixed "MANDATORY: "
|
|
271
|
+
# Example: if focus_areas = ["JWT handling"], add "FOCUS: JWT handling" as first item
|
|
253
272
|
general_review:
|
|
254
273
|
- "Check for ESLint rule violations (no-var, prefer-const)"
|
|
255
274
|
- "Verify component naming follows standards"
|
|
@@ -275,28 +294,21 @@ context_sources:
|
|
|
275
294
|
config_files: [.eslintrc.js, .prettierrc]
|
|
276
295
|
standards_docs: [CONTRIBUTING.md, ARCHITECTURE.md]
|
|
277
296
|
inline_annotations: yes
|
|
297
|
+
user_instructions: {true|false} # true if user provided input in step-03
|
|
278
298
|
mcp_tools: [] # list of MCP tools actually used
|
|
279
299
|
rag_systems: [] # list of RAG systems queried
|
|
280
300
|
url_sources: [] # list of plain URLs fetched
|
|
281
301
|
```
|
|
282
302
|
|
|
283
|
-
### 3.
|
|
303
|
+
### 3. Output Filename
|
|
284
304
|
|
|
285
|
-
|
|
286
|
-
if (pr_number_available) {
|
|
287
|
-
filename = `pr-${pr_number}-context.yaml`
|
|
288
|
-
} else {
|
|
289
|
-
// Use sanitized branch name
|
|
290
|
-
const safeBranchName = branch_name.replace(/[^a-zA-Z0-9-]/g, '-')
|
|
291
|
-
filename = `pr-${safeBranchName}-context.yaml`
|
|
292
|
-
}
|
|
293
|
-
```
|
|
305
|
+
Always: `pr-context.yaml` — the session folder already identifies the PR uniquely.
|
|
294
306
|
|
|
295
307
|
### 4. Write Knowledge Base to File
|
|
296
308
|
|
|
297
|
-
Write to: `{
|
|
309
|
+
Write to: `{session_output}/pr-context.yaml`
|
|
298
310
|
|
|
299
|
-
Example: `_prr-output/pr-
|
|
311
|
+
Example: `_prr-output/reviews/2026-03-02-1430-pr123-feature-auth/pr-context.yaml`
|
|
300
312
|
|
|
301
313
|
### 5. Report Completion
|
|
302
314
|
|
|
@@ -309,6 +321,9 @@ Example: `_prr-output/pr-123-context.yaml`
|
|
|
309
321
|
• ESLint rules: {n}
|
|
310
322
|
• Guidelines: {m}
|
|
311
323
|
• Inline annotations: {k}
|
|
324
|
+
• User instructions: ⚠️ YES — scope: {scope}, focus: {focus_count} areas, requirements: {req_count}
|
|
325
|
+
OR
|
|
326
|
+
• User instructions: none — full standard review
|
|
312
327
|
• MCP tools used: {mcp_list or "none"}
|
|
313
328
|
• RAG patterns: {rag_count}
|
|
314
329
|
• Issue context: {issue_key or "none"}
|
|
@@ -321,16 +336,11 @@ Example: `_prr-output/pr-123-context.yaml`
|
|
|
321
336
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
322
337
|
```
|
|
323
338
|
|
|
324
|
-
### 6. Store
|
|
325
|
-
|
|
326
|
-
Update PR context file to include knowledge base path:
|
|
339
|
+
### 6. Store Knowledge Base Path in Working Context
|
|
327
340
|
|
|
328
|
-
|
|
329
|
-
# {review_output}/current-pr-context.yaml
|
|
330
|
-
pr_knowledge_base: "{review_output}/{filename}"
|
|
331
|
-
```
|
|
341
|
+
Store `pr_knowledge_base` = `{session_output}/pr-context.yaml` in working context.
|
|
332
342
|
|
|
333
|
-
|
|
343
|
+
Review workflows (GR, SR, PR, AR, BR) find the knowledge base via working context or directly at `{session_output}/pr-context.yaml`.
|
|
334
344
|
|
|
335
345
|
### 7. Workflow Complete
|
|
336
346
|
|
|
@@ -3,7 +3,7 @@ name: collect-pr-context
|
|
|
3
3
|
description: "Collect fresh, PR-specific context from multiple sources after describing the PR"
|
|
4
4
|
main_config: "{project-root}/_prr/prr/config.yaml"
|
|
5
5
|
nextStep: "./steps/step-01-analyze-files.md"
|
|
6
|
-
output_file: "{
|
|
6
|
+
output_file: "{session_output}/pr-context.yaml"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Collect PR-Specific Context Workflow
|
|
@@ -105,18 +105,17 @@ If a stack has no matching data file, skip it silently and proceed with general
|
|
|
105
105
|
|
|
106
106
|
## WORKFLOW ARCHITECTURE
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
4-step process:
|
|
109
109
|
1. **Analyze files** changed in PR — extract metadata, domains, and **detect technology stacks**
|
|
110
110
|
2. **Collect context** from all sources: primary docs, config files, standards docs, inline annotations, **stack-specific rules**, MCP tools, RAG systems
|
|
111
|
-
3. **
|
|
111
|
+
3. **Manual context input** — prompt the user for any additional context (business rationale, focus areas, known trade-offs). **Always runs — user must respond before continuing.** If the user provides input, it is marked **⚠️ IMPORTANT** and reviewers treat it as highest-priority context
|
|
112
|
+
4. **Build PR-specific knowledge base** — structured YAML with all context, stack rules, manual context, and reviewer guidance
|
|
112
113
|
|
|
113
114
|
## INITIALIZATION
|
|
114
115
|
|
|
115
116
|
Load config from `{main_config}`.
|
|
116
117
|
|
|
117
|
-
|
|
118
|
-
- If available: use `pr-{pr_number}-context.yaml`
|
|
119
|
-
- If not: use `pr-{branch_name}-context.yaml`
|
|
118
|
+
Output filename is always `pr-context.yaml` — the session folder already identifies the PR uniquely.
|
|
120
119
|
|
|
121
120
|
## EXECUTION
|
|
122
121
|
|
|
@@ -14,11 +14,11 @@ Load the PR context file and the actual code diff for analysis.
|
|
|
14
14
|
|
|
15
15
|
### 1. Load PR Context
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Use `session_output`, `target_branch`, `base_branch`, `pr_number` from working context.
|
|
18
18
|
|
|
19
|
-
If
|
|
19
|
+
If not set:
|
|
20
20
|
```
|
|
21
|
-
❌ No
|
|
21
|
+
❌ No active session. Run [SS] Select Session to resume a past session, or [SP] Select PR to start a new one.
|
|
22
22
|
```
|
|
23
23
|
Stop workflow.
|
|
24
24
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "step-04-output"
|
|
3
3
|
description: "Write PR description to file and display summary"
|
|
4
|
-
outputFile: "{
|
|
4
|
+
outputFile: "{session_output}/pr-description.md"
|
|
5
5
|
templateFile: "../templates/pr-description.template.md"
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -24,14 +24,13 @@ Using the template at `{templateFile}`, generate the PR description with:
|
|
|
24
24
|
|
|
25
25
|
### 2. Write to File
|
|
26
26
|
|
|
27
|
-
Write to `{outputFile}
|
|
27
|
+
Write to `{outputFile}`.
|
|
28
28
|
|
|
29
|
-
### 3. Update
|
|
29
|
+
### 3. Update Working Context
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
- Add `risk_level: "{risk_level}"`
|
|
31
|
+
Store in working context:
|
|
32
|
+
- `pr_type` = `{classified_type}`
|
|
33
|
+
- `risk_level` = `{risk_level}`
|
|
35
34
|
|
|
36
35
|
### 4. Display Summary
|
|
37
36
|
|
|
@@ -20,8 +20,8 @@ nextStep: "./steps/step-01-load-context.md"
|
|
|
20
20
|
## INITIALIZATION
|
|
21
21
|
|
|
22
22
|
Load config from `{main_config}`.
|
|
23
|
-
|
|
24
|
-
If
|
|
23
|
+
Use `session_output`, `target_branch`, `base_branch`, `pr_number` from working context.
|
|
24
|
+
If not set: prompt user to run [SS] Select Session (to resume a past session) or [SP] Select PR (to start a new one).
|
|
25
25
|
|
|
26
26
|
## EXECUTION
|
|
27
27
|
|
|
@@ -22,5 +22,4 @@ validation-target: "Architecture review output file"
|
|
|
22
22
|
- [ ] ❓ QUESTION findings include: specific question + list of potentially affected files outside the diff
|
|
23
23
|
|
|
24
24
|
## Output
|
|
25
|
-
- [ ] Findings written to `{
|
|
26
|
-
- [ ] PR context updated with `architecture-review` in completed list
|
|
25
|
+
- [ ] Findings written to `{session_output}/architecture-review.md`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: architecture-review
|
|
2
|
-
description: "Architecture-focused review: SOLID principles, layering, coupling, codebase consistency"
|
|
2
|
+
description: "Architecture-focused review: SOLID principles, layering, coupling, codebase consistency, etc. — adapted to your architecture"
|
|
3
3
|
author: "PR Review Kit"
|
|
4
4
|
|
|
5
5
|
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
@@ -7,11 +7,12 @@ user_name: "{config_source}:user_name"
|
|
|
7
7
|
communication_language: "{config_source}:communication_language"
|
|
8
8
|
target_repo: "{config_source}:target_repo"
|
|
9
9
|
review_output: "{config_source}:review_output"
|
|
10
|
+
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
10
11
|
date: system-generated
|
|
11
12
|
|
|
12
13
|
installed_path: "{project-root}/_prr/prr/workflows/3-review/architecture-review"
|
|
13
14
|
instructions: "{installed_path}/instructions.xml"
|
|
14
15
|
validation: "{installed_path}/checklist.md"
|
|
15
16
|
|
|
16
|
-
pr_context: "
|
|
17
|
-
output_file: "{
|
|
17
|
+
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
18
|
+
output_file: "{session_output}/architecture-review.md"
|
|
@@ -23,5 +23,4 @@ validation-target: "Business review output file"
|
|
|
23
23
|
- [ ] Post-ship monitoring noted: what to watch after deploy
|
|
24
24
|
|
|
25
25
|
## Output
|
|
26
|
-
- [ ] Findings written to `{
|
|
27
|
-
- [ ] PR context updated with `business-review` in completed list
|
|
26
|
+
- [ ] Findings written to `{session_output}/business-review.md`
|
|
@@ -127,6 +127,8 @@ PR type: {pr_type} | Prior reviews loaded: {completed_reviews}
|
|
|
127
127
|
MINIMAL = additive feature, no regressions, low risk changes
|
|
128
128
|
</risk-matrix>
|
|
129
129
|
|
|
130
|
+
<action>Apply any business-specific guidance from knowledge_base.reviewer_guidance.business_review and knowledge_base.relevant_guidelines to generate additional business checks beyond the default categories above. If no project-specific business guidance exists, skip silently.</action>
|
|
131
|
+
|
|
130
132
|
<action>Structure the output by category, ordered by severity within each section:
|
|
131
133
|
- Feature Completeness gaps (🔴 first, then 🟡, 🟢, ❓)
|
|
132
134
|
- User Impact issues
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: business-review
|
|
2
|
-
description: "Business impact review: user impact, business risk, feature completeness, data safety, observability"
|
|
2
|
+
description: "Business impact review: user impact, business risk, feature completeness, data safety, observability — adapted to your project"
|
|
3
3
|
author: "PR Review Kit"
|
|
4
4
|
|
|
5
5
|
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
@@ -7,11 +7,12 @@ user_name: "{config_source}:user_name"
|
|
|
7
7
|
communication_language: "{config_source}:communication_language"
|
|
8
8
|
target_repo: "{config_source}:target_repo"
|
|
9
9
|
review_output: "{config_source}:review_output"
|
|
10
|
+
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
10
11
|
date: system-generated
|
|
11
12
|
|
|
12
13
|
installed_path: "{project-root}/_prr/prr/workflows/3-review/business-review"
|
|
13
14
|
instructions: "{installed_path}/instructions.xml"
|
|
14
15
|
validation: "{installed_path}/checklist.md"
|
|
15
16
|
|
|
16
|
-
pr_context: "
|
|
17
|
-
output_file: "{
|
|
17
|
+
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
18
|
+
output_file: "{session_output}/business-review.md"
|
|
@@ -22,6 +22,5 @@ validation-target: "General review output file"
|
|
|
22
22
|
- [ ] Side effect findings include: the affected location OUTSIDE the diff (not just the changed file)
|
|
23
23
|
|
|
24
24
|
## Output
|
|
25
|
-
- [ ] Findings written to `{
|
|
26
|
-
- [ ] PR context updated with `general-review` in completed list
|
|
25
|
+
- [ ] Findings written to `{session_output}/general-review.md`
|
|
27
26
|
- [ ] At least one positive observation included (balanced review)
|
|
@@ -89,6 +89,13 @@ For side effect findings, include the AFFECTED LOCATION (the file outside the di
|
|
|
89
89
|
</output-format>
|
|
90
90
|
</step>
|
|
91
91
|
|
|
92
|
+
<step n="5b" goal="Stack-specific and project-specific code quality checks">
|
|
93
|
+
<action>Apply all code quality and common bug rules from knowledge_base.stack_context.rules for each detected stack</action>
|
|
94
|
+
<action>Apply code quality guidelines from knowledge_base.relevant_guidelines</action>
|
|
95
|
+
<action>Apply guidance from knowledge_base.reviewer_guidance.general_review</action>
|
|
96
|
+
<note>Generate additional checks specific to this project's technology and domain that go beyond the default categories above. If knowledge_base contains no stack-specific code quality rules, skip this step silently.</note>
|
|
97
|
+
</step>
|
|
98
|
+
|
|
92
99
|
<step n="6" goal="Compile and write findings">
|
|
93
100
|
<action>Group all findings by severity: 🔴 Blockers first, then 🟡 Warnings, then 🟢 Suggestions, then ❓ Questions</action>
|
|
94
101
|
<action>Add positive observations: acknowledge good practices found</action>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: general-review
|
|
2
|
-
description: "General code quality review: logic, naming, readability, error handling, DRY, test coverage"
|
|
2
|
+
description: "General code quality review: logic, naming, readability, error handling, DRY, test coverage, etc. — adapted to your stack"
|
|
3
3
|
author: "PR Review Kit"
|
|
4
4
|
|
|
5
5
|
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
@@ -7,11 +7,12 @@ user_name: "{config_source}:user_name"
|
|
|
7
7
|
communication_language: "{config_source}:communication_language"
|
|
8
8
|
target_repo: "{config_source}:target_repo"
|
|
9
9
|
review_output: "{config_source}:review_output"
|
|
10
|
+
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
10
11
|
date: system-generated
|
|
11
12
|
|
|
12
13
|
installed_path: "{project-root}/_prr/prr/workflows/3-review/general-review"
|
|
13
14
|
instructions: "{installed_path}/instructions.xml"
|
|
14
15
|
validation: "{installed_path}/checklist.md"
|
|
15
16
|
|
|
16
|
-
pr_context: "
|
|
17
|
-
output_file: "{
|
|
17
|
+
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
18
|
+
output_file: "{session_output}/general-review.md"
|
|
@@ -20,5 +20,4 @@ validation-target: "Performance review output file"
|
|
|
20
20
|
- [ ] ❓ QUESTION findings include: specific concern + context needed to assess severity (e.g., "Is this in a hot path?", "What is the expected data volume?")
|
|
21
21
|
|
|
22
22
|
## Output
|
|
23
|
-
- [ ] Findings written to `{
|
|
24
|
-
- [ ] PR context updated with `performance-review` in completed list
|
|
23
|
+
- [ ] Findings written to `{session_output}/performance-review.md`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: performance-review
|
|
2
|
-
description: "Performance-focused code review: N+1 queries, memory leaks, async patterns, bundle size, caching"
|
|
2
|
+
description: "Performance-focused code review: N+1 queries, memory leaks, async patterns, bundle size, caching, etc. — adapted to your stack"
|
|
3
3
|
author: "PR Review Kit"
|
|
4
4
|
|
|
5
5
|
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
@@ -7,11 +7,12 @@ user_name: "{config_source}:user_name"
|
|
|
7
7
|
communication_language: "{config_source}:communication_language"
|
|
8
8
|
target_repo: "{config_source}:target_repo"
|
|
9
9
|
review_output: "{config_source}:review_output"
|
|
10
|
+
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
10
11
|
date: system-generated
|
|
11
12
|
|
|
12
13
|
installed_path: "{project-root}/_prr/prr/workflows/3-review/performance-review"
|
|
13
14
|
instructions: "{installed_path}/instructions.xml"
|
|
14
15
|
validation: "{installed_path}/checklist.md"
|
|
15
16
|
|
|
16
|
-
pr_context: "
|
|
17
|
-
output_file: "{
|
|
17
|
+
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
18
|
+
output_file: "{session_output}/performance-review.md"
|
|
@@ -22,5 +22,4 @@ validation-target: "Security review output file"
|
|
|
22
22
|
- [ ] ❓ QUESTION findings include: specific concern + exact question to ask author (e.g., "Was this auth check intentionally removed?")
|
|
23
23
|
|
|
24
24
|
## Output
|
|
25
|
-
- [ ] Findings written to `{
|
|
26
|
-
- [ ] PR context updated with `security-review` in completed list
|
|
25
|
+
- [ ] Findings written to `{session_output}/security-review.md`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: security-review
|
|
2
|
-
description: "Security-focused code review: OWASP top 10, injection, auth, secrets, dependencies"
|
|
2
|
+
description: "Security-focused code review: OWASP top 10, injection, auth, secrets, dependencies, etc. — adapted to your project"
|
|
3
3
|
author: "PR Review Kit"
|
|
4
4
|
|
|
5
5
|
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
@@ -7,6 +7,7 @@ user_name: "{config_source}:user_name"
|
|
|
7
7
|
communication_language: "{config_source}:communication_language"
|
|
8
8
|
target_repo: "{config_source}:target_repo"
|
|
9
9
|
review_output: "{config_source}:review_output"
|
|
10
|
+
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
10
11
|
date: system-generated
|
|
11
12
|
|
|
12
13
|
installed_path: "{project-root}/_prr/prr/workflows/3-review/security-review"
|
|
@@ -14,5 +15,5 @@ instructions: "{installed_path}/instructions.xml"
|
|
|
14
15
|
validation: "{installed_path}/checklist.md"
|
|
15
16
|
owasp_data: "{installed_path}/data/owasp-checklist.csv"
|
|
16
17
|
|
|
17
|
-
pr_context: "
|
|
18
|
-
output_file: "{
|
|
18
|
+
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
19
|
+
output_file: "{session_output}/security-review.md"
|
|
@@ -13,6 +13,5 @@ validation-target: "Improve code output file"
|
|
|
13
13
|
- [ ] Suggestions are correct — the AFTER code actually works
|
|
14
14
|
|
|
15
15
|
## Output
|
|
16
|
-
- [ ] All suggestions written to `{
|
|
16
|
+
- [ ] All suggestions written to `{session_output}/improve-code.md`
|
|
17
17
|
- [ ] Suggestions grouped by category (Bugs | Quality | Performance | Best Practices)
|
|
18
|
-
- [ ] PR context updated with `improve-code` in completed list
|
|
@@ -7,11 +7,12 @@ user_name: "{config_source}:user_name"
|
|
|
7
7
|
communication_language: "{config_source}:communication_language"
|
|
8
8
|
target_repo: "{config_source}:target_repo"
|
|
9
9
|
review_output: "{config_source}:review_output"
|
|
10
|
+
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
10
11
|
date: system-generated
|
|
11
12
|
|
|
12
13
|
installed_path: "{project-root}/_prr/prr/workflows/4-improve/improve-code"
|
|
13
14
|
instructions: "{installed_path}/instructions.xml"
|
|
14
15
|
validation: "{installed_path}/checklist.md"
|
|
15
16
|
|
|
16
|
-
pr_context: "
|
|
17
|
-
output_file: "{
|
|
17
|
+
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
18
|
+
output_file: "{session_output}/improve-code.md"
|
|
@@ -10,9 +10,9 @@ nextStepFile: "./step-02-answer.md"
|
|
|
10
10
|
|
|
11
11
|
### 1. Load PR Context
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Use `session_output`, `target_branch`, `base_branch` from working context.
|
|
14
14
|
|
|
15
|
-
If not
|
|
15
|
+
If not set, prompt user to run [SS] Select Session or [SP] Select PR first.
|
|
16
16
|
|
|
17
17
|
### 2. Load the Diff
|
|
18
18
|
|
|
@@ -8,19 +8,23 @@ nextStepFile: "./step-02-organize.md"
|
|
|
8
8
|
|
|
9
9
|
## Sequence of Instructions
|
|
10
10
|
|
|
11
|
-
### 1.
|
|
11
|
+
### 1. Detect Completed Reviews
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Check which review files exist in `{session_output}/`:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ls "{session_output}/"
|
|
17
|
+
```
|
|
14
18
|
|
|
15
19
|
### 2. Collect Review Output Files
|
|
16
20
|
|
|
17
|
-
For each
|
|
18
|
-
- `general-review` → `{
|
|
19
|
-
- `security-review` → `{
|
|
20
|
-
- `performance-review` → `{
|
|
21
|
-
- `architecture-review` → `{
|
|
22
|
-
- `business-review` → `{
|
|
23
|
-
- `improve-code` → `{
|
|
21
|
+
For each review file that exists, read it:
|
|
22
|
+
- `general-review` → `{session_output}/general-review.md`
|
|
23
|
+
- `security-review` → `{session_output}/security-review.md`
|
|
24
|
+
- `performance-review` → `{session_output}/performance-review.md`
|
|
25
|
+
- `architecture-review` → `{session_output}/architecture-review.md`
|
|
26
|
+
- `business-review` → `{session_output}/business-review.md`
|
|
27
|
+
- `improve-code` → `{session_output}/improve-code.md`
|
|
24
28
|
|
|
25
29
|
### 3. Parse All Findings
|
|
26
30
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "step-03-write"
|
|
3
3
|
description: "Write the final review report to file"
|
|
4
|
-
outputFile: "{
|
|
4
|
+
outputFile: "{session_output}/final-review.md"
|
|
5
5
|
templateFile: "../templates/review-report.template.md"
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -27,7 +27,7 @@ The report includes:
|
|
|
27
27
|
```
|
|
28
28
|
✅ Review Report Generated!
|
|
29
29
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
30
|
-
📄 File: {
|
|
30
|
+
📄 File: {session_output}/final-review.md
|
|
31
31
|
|
|
32
32
|
Summary:
|
|
33
33
|
🔴 Blockers: {blocker_count}
|
|
@@ -19,7 +19,8 @@ nextStep: "./steps/step-01-collect.md"
|
|
|
19
19
|
## INITIALIZATION
|
|
20
20
|
|
|
21
21
|
Load config from `{main_config}`.
|
|
22
|
-
|
|
22
|
+
Use `session_output` from working context.
|
|
23
|
+
If not set: prompt user to run [SS] Select Session or [SP] Select PR first.
|
|
23
24
|
|
|
24
25
|
## EXECUTION
|
|
25
26
|
|
|
@@ -10,9 +10,9 @@ nextStepFile: "./step-02-post.md"
|
|
|
10
10
|
|
|
11
11
|
### 1. Check Prerequisites
|
|
12
12
|
|
|
13
|
-
Verify
|
|
14
|
-
- `pr_number` — if missing, show: `❌ No PR number found. Run [SP] Select PR first.`
|
|
15
|
-
- `target_branch`, `base_branch`
|
|
13
|
+
Verify working context contains:
|
|
14
|
+
- `pr_number` — if missing, show: `❌ No PR number found. Run [SS] Select Session or [SP] Select PR first.`
|
|
15
|
+
- `target_branch`, `base_branch`, `session_output`
|
|
16
16
|
|
|
17
17
|
Verify platform CLI is available:
|
|
18
18
|
|
|
@@ -54,8 +54,7 @@ Store as `{commit_sha}`.
|
|
|
54
54
|
|
|
55
55
|
### 3. Load Review Report
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
Sort by modification time, take the most recent.
|
|
57
|
+
Read the report at `{session_output}/final-review.md`.
|
|
59
58
|
|
|
60
59
|
### 4. Parse All Findings
|
|
61
60
|
|
|
@@ -37,10 +37,11 @@ Depends on `{active_platform}`:
|
|
|
37
37
|
## INITIALIZATION
|
|
38
38
|
|
|
39
39
|
Load config from `{main_config}`.
|
|
40
|
-
|
|
40
|
+
Use `session_output`, `target_branch`, `base_branch`, `pr_number`, `active_platform` from working context.
|
|
41
|
+
If `session_output` not set: prompt user to run [SS] Select Session or [SP] Select PR first.
|
|
41
42
|
Use `{active_platform}` (or detect from `{platform}` config).
|
|
42
43
|
|
|
43
|
-
Set `{temp_dir}` = `{
|
|
44
|
+
Set `{temp_dir}` = `{session_output}/temp`.
|
|
44
45
|
Create it if it doesn't exist:
|
|
45
46
|
```bash
|
|
46
47
|
mkdir -p "{temp_dir}"
|