prr-kit 1.2.2 → 1.2.3
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 +11 -7
- package/package.json +1 -1
- package/src/prr/workflows/3-review/architecture-review/instructions.xml +16 -3
- package/src/prr/workflows/3-review/business-review/instructions.xml +1 -0
- package/src/prr/workflows/3-review/general-review/instructions.xml +1 -0
- package/src/prr/workflows/3-review/performance-review/instructions.xml +14 -1
- package/src/prr/workflows/3-review/security-review/instructions.xml +14 -2
package/README.md
CHANGED
|
@@ -34,6 +34,8 @@ Then open your IDE in the installed project and use one of these commands to sta
|
|
|
34
34
|
- `/prr-quick` — one command, full pipeline (select PR → review → report)
|
|
35
35
|
- `/prr-master` — full menu with all options
|
|
36
36
|
|
|
37
|
+
> **Note:** The exact command depends on your IDE. See [IDE Support](https://prrkit.sitenow.cloud/docs/ide-support) for the command specific to your IDE.
|
|
38
|
+
|
|
37
39
|
## How It Works
|
|
38
40
|
|
|
39
41
|
<p align="center">
|
|
@@ -100,9 +102,9 @@ Only pauses once to ask which PR/branch to review.
|
|
|
100
102
|
| `SP` | Select PR | Fetch latest → list open PRs (via `gh`) or branches → select head + base → load diff |
|
|
101
103
|
| `DP` | Describe PR | Classify PR type, generate summary, file-by-file walkthrough |
|
|
102
104
|
| `GR` | General Review | Logic, naming, readability, DRY, best practices |
|
|
103
|
-
| `SR` | Security Review | OWASP Top 10, secrets, auth, rate limits, injection |
|
|
104
|
-
| `PR` | Performance Review | N+1 queries, memory leaks, async patterns, caching |
|
|
105
|
-
| `AR` | Architecture Review | SOLID, layers, coupling, consistency with codebase |
|
|
105
|
+
| `SR` | Security Review | OWASP Top 10, secrets, auth, rate limits, injection, etc. — adapted to your project |
|
|
106
|
+
| `PR` | Performance Review | N+1 queries, memory leaks, async patterns, caching, etc. — adapted to your stack |
|
|
107
|
+
| `AR` | Architecture Review | SOLID, layers, coupling, consistency with codebase, etc. — adapted to your architecture |
|
|
106
108
|
| `BR` | Business Review | User impact, business risk, feature completeness, data safety, observability |
|
|
107
109
|
| `IC` | Improve Code | Concrete BEFORE/AFTER code suggestions |
|
|
108
110
|
| `AK` | Ask Code | Q&A about specific changes in this PR |
|
|
@@ -146,11 +148,13 @@ Specialist reviewer agents are orchestrated internally by the master agent and p
|
|
|
146
148
|
| Reviewer | Focus | Key questions |
|
|
147
149
|
|---|---|---|
|
|
148
150
|
| 👁️ General (GR) | Code quality | Is the logic correct? Naming clear? DRY? Tests present? |
|
|
149
|
-
| 🔒 Security (SR) | OWASP Top 10 | XSS? Injection? Secrets exposed? Auth correct? |
|
|
150
|
-
| ⚡ Performance (PR) | Efficiency | N+1 queries? Memory leaks? Missing await? |
|
|
151
|
-
| 🏗️ Architecture (AR) | Structure | Layer violations? Coupling? Consistent with codebase? |
|
|
151
|
+
| 🔒 Security (SR) | OWASP Top 10 + stack threats | XSS? Injection? Secrets exposed? Auth correct? *(adapted to your stack)* |
|
|
152
|
+
| ⚡ Performance (PR) | Efficiency + stack patterns | N+1 queries? Memory leaks? Missing await? *(adapted to your stack)* |
|
|
153
|
+
| 🏗️ Architecture (AR) | Structure + conventions | Layer violations? Coupling? Consistent with codebase? *(adapted to your architecture)* |
|
|
152
154
|
| 💼 Business (BR) | Real-world impact | User impact? Business risk? Feature completeness? Data safe? Observability? |
|
|
153
155
|
|
|
156
|
+
> Checks are adaptive — each reviewer skips categories not relevant to your project and generates additional checks based on detected stacks, project guidelines, and inline annotations.
|
|
157
|
+
|
|
154
158
|
**Business Review (BR)** runs last and translates technical findings into business language — user impact, GDPR risk, migration safety, deployment recommendations, and post-ship monitoring checklist.
|
|
155
159
|
|
|
156
160
|
## Severity Levels
|
|
@@ -160,7 +164,7 @@ All findings use a standard format:
|
|
|
160
164
|
- 🔴 **[BLOCKER]** — Must fix before merge
|
|
161
165
|
- 🟡 **[WARNING]** — Should fix (with explanation)
|
|
162
166
|
- 🟢 **[SUGGESTION]** — Nice-to-have improvement
|
|
163
|
-
-
|
|
167
|
+
- ❓ **[QUESTION]** — Needs clarification from author
|
|
164
168
|
|
|
165
169
|
## Context Collection
|
|
166
170
|
|
package/package.json
CHANGED
|
@@ -14,15 +14,18 @@
|
|
|
14
14
|
<action>Load PR-specific knowledge base from {pr_knowledge_base}</action>
|
|
15
15
|
<action>Extract architectural patterns from knowledge_base.relevant_guidelines (ARCHITECTURE.md sections, ADRs)</action>
|
|
16
16
|
<action>Check pattern annotations from knowledge_base.inline_context (@pattern:)</action>
|
|
17
|
+
<action>Adapt review scope: use knowledge_base.stack_context, knowledge_base.files_analysis, and knowledge_base.reviewer_guidance.architecture_review to evaluate which of the default check categories below are relevant to this project and this PR. Categories that have no applicability to the project's architectural style should be skipped or reduced.</action>
|
|
18
|
+
<action>Identify stack-specific architecture rules from knowledge_base.stack_context.rules — these will be applied as additional checks in the dedicated step below.</action>
|
|
17
19
|
<action>Also examine surrounding non-changed files to understand existing patterns</action>
|
|
18
20
|
<output>🏗️ Starting Architecture Review
|
|
19
21
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
20
|
-
|
|
21
|
-
Context: Loaded architectural patterns & ADRs from
|
|
22
|
+
Scope: Adapted to project architecture and detected stack
|
|
23
|
+
Context: Loaded architectural patterns & ADRs from project docs
|
|
22
24
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</output>
|
|
23
25
|
</step>
|
|
24
26
|
|
|
25
27
|
<step n="2" goal="Check layer/separation of concerns violations">
|
|
28
|
+
<note>Run only if relevant to the project type and the changes in this PR. Skip entirely if this category has no applicability.</note>
|
|
26
29
|
<check-list id="layers">
|
|
27
30
|
<item>Business logic in controllers/routes (should be in services)</item>
|
|
28
31
|
<item>Database queries in wrong layer (direct DB access from controller bypassing service)</item>
|
|
@@ -33,6 +36,7 @@ Context: Loaded architectural patterns & ADRs from ARCHITECTURE.md
|
|
|
33
36
|
</step>
|
|
34
37
|
|
|
35
38
|
<step n="3" goal="Check coupling and cohesion">
|
|
39
|
+
<note>Run only if relevant to the project type and the changes in this PR. Skip entirely if this category has no applicability.</note>
|
|
36
40
|
<check-list id="coupling">
|
|
37
41
|
<item>Tight coupling: does this change force changes in many unrelated files?</item>
|
|
38
42
|
<item>New module dependencies: are new imports appropriate? circular dependencies introduced?</item>
|
|
@@ -42,6 +46,7 @@ Context: Loaded architectural patterns & ADRs from ARCHITECTURE.md
|
|
|
42
46
|
</step>
|
|
43
47
|
|
|
44
48
|
<step n="4" goal="Check consistency with existing codebase patterns">
|
|
49
|
+
<note>Run only if relevant to the project type and the changes in this PR. Skip entirely if this category has no applicability.</note>
|
|
45
50
|
<check-list id="consistency">
|
|
46
51
|
<item>Naming conventions: matches existing naming style (camelCase vs snake_case, etc.)?</item>
|
|
47
52
|
<item>File/folder structure: new files placed where convention dictates?</item>
|
|
@@ -52,7 +57,7 @@ Context: Loaded architectural patterns & ADRs from ARCHITECTURE.md
|
|
|
52
57
|
</step>
|
|
53
58
|
|
|
54
59
|
<step n="5" goal="Shared module blast radius and backward compatibility">
|
|
55
|
-
<note>
|
|
60
|
+
<note>Skip if no shared/common/generic modules are changed in this PR. When shared modules ARE changed, always run this step — it is high-risk because it affects all consumers, not just the code in this PR.</note>
|
|
56
61
|
<check-list id="blast-radius">
|
|
57
62
|
<item>Identify: is the changed file a shared/common/generic resource? (utility modules, shared libraries, base classes, common interfaces/headers, core services, shared data models, global state)</item>
|
|
58
63
|
<item>Consumer count: search for all files importing or using this module and list them. Any breaking change is a 🔴 BLOCKER regardless of consumer count — high consumer count amplifies urgency but is not the deciding factor.</item>
|
|
@@ -74,6 +79,7 @@ Context: Loaded architectural patterns & ADRs from ARCHITECTURE.md
|
|
|
74
79
|
</step>
|
|
75
80
|
|
|
76
81
|
<step n="6" goal="SOLID principles (only flag real violations, not theoretical ones)">
|
|
82
|
+
<note>Run only if relevant to the project type and the changes in this PR. Skip entirely if this category has no applicability.</note>
|
|
77
83
|
<check-list id="solid">
|
|
78
84
|
<item>SRP: class/module doing more than one thing AND causing maintenance problems?</item>
|
|
79
85
|
<item>OCP: existing code modified instead of extended (when extension was clearly better)?</item>
|
|
@@ -84,6 +90,13 @@ Context: Loaded architectural patterns & ADRs from ARCHITECTURE.md
|
|
|
84
90
|
<note>Only flag SOLID violations when they cause REAL maintainability or extensibility problems — not theoretical purity</note>
|
|
85
91
|
</step>
|
|
86
92
|
|
|
93
|
+
<step n="6b" goal="Stack-specific and project-specific architecture checks">
|
|
94
|
+
<action>Apply all architecture rules from knowledge_base.stack_context.rules for each detected stack</action>
|
|
95
|
+
<action>Apply architecture-related guidelines from knowledge_base.relevant_guidelines and any ADRs found</action>
|
|
96
|
+
<action>Apply guidance from knowledge_base.reviewer_guidance.architecture_review</action>
|
|
97
|
+
<note>Generate additional checks specific to this project's architectural patterns and domain that go beyond the default categories above. If knowledge_base contains no stack-specific architecture rules, skip this step silently.</note>
|
|
98
|
+
</step>
|
|
99
|
+
|
|
87
100
|
<step n="7" goal="Compile and write findings">
|
|
88
101
|
<action>Group findings: Layer Violations | Coupling Issues | Consistency Problems | SOLID Violations | ❓ Questions for Author</action>
|
|
89
102
|
<action>For each finding: reference the EXISTING pattern that should be followed instead</action>
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
<action>Read {pr_context} to get: target_branch, base_branch, pr_type, pr_knowledge_base, completed_reviews</action>
|
|
16
16
|
<action>Load PR-specific knowledge base from {pr_knowledge_base} — extract issue_context (acceptance criteria) if available from MCP tools</action>
|
|
17
|
+
<action>Adapt review scope: use knowledge_base.stack_context, knowledge_base.files_analysis, and knowledge_base.reviewer_guidance.business_review to adjust business focus based on detected project type and domain.</action>
|
|
17
18
|
<action>Load findings already collected from completed reviews (GR, SR, PR, AR) to translate them into business impact</action>
|
|
18
19
|
<action>Run: git diff {base_branch}...{target_branch} --stat in {target_repo} for file scope</action>
|
|
19
20
|
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
<action>Read {pr_context} to get: target_branch, base_branch, diff_strategy, files_changed, pr_knowledge_base</action>
|
|
15
15
|
<action>Load PR-specific knowledge base from {pr_knowledge_base} (e.g., pr-123-context.yaml)</action>
|
|
16
16
|
<note>Knowledge base contains: relevant ESLint rules, guidelines from CLAUDE.md/CONTRIBUTING.md/ARCHITECTURE.md, inline annotations, external rules</note>
|
|
17
|
+
<action>Adapt review scope: use knowledge_base.stack_context, knowledge_base.files_analysis, and knowledge_base.reviewer_guidance.general_review to adjust focus based on detected technology and project patterns.</action>
|
|
17
18
|
<action>Run: git diff {base_branch}...{target_branch} in {target_repo}</action>
|
|
18
19
|
<action>Note diff_strategy: if 'chunked', process file by file</action>
|
|
19
20
|
|
|
@@ -13,14 +13,17 @@
|
|
|
13
13
|
<action>Read {pr_context} and load git diff</action>
|
|
14
14
|
<action>Load PR-specific knowledge base from {pr_knowledge_base}</action>
|
|
15
15
|
<action>Extract performance guidelines from knowledge_base.relevant_guidelines</action>
|
|
16
|
+
<action>Adapt review scope: use knowledge_base.stack_context, knowledge_base.files_analysis, and knowledge_base.reviewer_guidance.performance_review to evaluate which of the default check categories below are relevant to this project and this PR. Categories that have no applicability to the detected project type should be skipped entirely.</action>
|
|
17
|
+
<action>Identify stack-specific performance rules from knowledge_base.stack_context.rules — these will be applied as additional checks in the dedicated step below.</action>
|
|
16
18
|
<output>⚡ Starting Performance Review
|
|
17
19
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
18
|
-
|
|
20
|
+
Scope: Adapted to detected stack and project context
|
|
19
21
|
Context: Loaded performance best practices from docs
|
|
20
22
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</output>
|
|
21
23
|
</step>
|
|
22
24
|
|
|
23
25
|
<step n="2" goal="Database and query performance">
|
|
26
|
+
<note>Run only if relevant to the project type and the changes in this PR. Skip entirely if this category has no applicability.</note>
|
|
24
27
|
<check-list id="database">
|
|
25
28
|
<item>N+1 queries: DB call inside a loop? Should use batch/join instead</item>
|
|
26
29
|
<item>Missing pagination: queries that could return unbounded result sets</item>
|
|
@@ -32,6 +35,7 @@ Context: Loaded performance best practices from docs
|
|
|
32
35
|
</step>
|
|
33
36
|
|
|
34
37
|
<step n="3" goal="Async and concurrency patterns">
|
|
38
|
+
<note>Run only if relevant to the project type and the changes in this PR. Skip entirely if this category has no applicability.</note>
|
|
35
39
|
<check-list id="async">
|
|
36
40
|
<item>Sequential awaits in loop: `for (x of arr) { await fn(x) }` should be Promise.all</item>
|
|
37
41
|
<item>Unnecessary await: async function that doesn't need to be async</item>
|
|
@@ -42,6 +46,7 @@ Context: Loaded performance best practices from docs
|
|
|
42
46
|
</step>
|
|
43
47
|
|
|
44
48
|
<step n="4" goal="Memory management">
|
|
49
|
+
<note>Run only if relevant to the project type and the changes in this PR. Skip entirely if this category has no applicability.</note>
|
|
45
50
|
<check-list id="memory">
|
|
46
51
|
<item>Event listener cleanup: listeners added but not removed (memory leak pattern)</item>
|
|
47
52
|
<item>Large objects held in closure/module scope unnecessarily</item>
|
|
@@ -52,6 +57,7 @@ Context: Loaded performance best practices from docs
|
|
|
52
57
|
</step>
|
|
53
58
|
|
|
54
59
|
<step n="5" goal="Frontend performance (if applicable)">
|
|
60
|
+
<note>Run only if relevant to the project type and the changes in this PR. Skip entirely if this category has no applicability.</note>
|
|
55
61
|
<check-list id="frontend">
|
|
56
62
|
<item>Bundle size: large new dependencies imported? Is tree-shaking possible?</item>
|
|
57
63
|
<item>Unnecessary re-renders: state changes causing full component re-renders</item>
|
|
@@ -61,6 +67,13 @@ Context: Loaded performance best practices from docs
|
|
|
61
67
|
</check-list>
|
|
62
68
|
</step>
|
|
63
69
|
|
|
70
|
+
<step n="5b" goal="Stack-specific and project-specific performance checks">
|
|
71
|
+
<action>Apply all performance rules from knowledge_base.stack_context.rules for each detected stack</action>
|
|
72
|
+
<action>Apply performance-related guidelines from knowledge_base.relevant_guidelines</action>
|
|
73
|
+
<action>Apply guidance from knowledge_base.reviewer_guidance.performance_review</action>
|
|
74
|
+
<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 performance rules, skip this step silently.</note>
|
|
75
|
+
</step>
|
|
76
|
+
|
|
64
77
|
<step n="6" goal="Compile and write findings">
|
|
65
78
|
<action>Distinguish: impactful issues vs micro-optimizations — only include impactful ones</action>
|
|
66
79
|
<action>For each finding: assign severity based on impact scope — 🔴 if causes measurable regression or data integrity risk, 🟡 if significant but not blocking, 🟢 if low-impact optimization, ❓ if impact cannot be determined without author context</action>
|
|
@@ -14,11 +14,13 @@
|
|
|
14
14
|
<action>Load PR-specific knowledge base from {pr_knowledge_base}</action>
|
|
15
15
|
<action>Extract security guidelines from knowledge_base.relevant_guidelines</action>
|
|
16
16
|
<action>Check for security annotations from knowledge_base.inline_context (@security:)</action>
|
|
17
|
+
<action>Adapt review scope: use knowledge_base.stack_context, knowledge_base.files_analysis, and knowledge_base.reviewer_guidance.security_review to evaluate which of the default check categories below are relevant to this project and this PR. Step 2 (hardcoded secrets) always runs. Other categories should be evaluated for relevance before running.</action>
|
|
18
|
+
<action>Identify stack-specific security rules from knowledge_base.stack_context.rules — these will be applied as additional checks in the dedicated step below.</action>
|
|
17
19
|
<action>Run: git diff {base_branch}...{target_branch} in {target_repo}</action>
|
|
18
20
|
<output>🔒 Starting Security Review — Thinking like an attacker
|
|
19
21
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
20
|
-
|
|
21
|
-
Context: Loaded security guidelines from
|
|
22
|
+
Scope: Secrets scan (always) + adapted checks for detected stack
|
|
23
|
+
Context: Loaded security guidelines from project docs
|
|
22
24
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</output>
|
|
23
25
|
</step>
|
|
24
26
|
|
|
@@ -35,6 +37,7 @@ Context: Loaded security guidelines from CLAUDE.md/CONTRIBUTING.md
|
|
|
35
37
|
</step>
|
|
36
38
|
|
|
37
39
|
<step n="3" goal="OWASP A01-A05: Broken Access Control, Crypto, Injection, Insecure Design, Misconfiguration">
|
|
40
|
+
<note>Run only if relevant to the project type and the changes in this PR. Skip entirely if this category has no applicability.</note>
|
|
38
41
|
<check-list id="owasp-1-5">
|
|
39
42
|
<item>A01 Broken Access Control: authorization checks present? role-based? privilege escalation possible?</item>
|
|
40
43
|
<item>A02 Cryptographic Failures: weak hashing (MD5/SHA1)? HTTP instead of HTTPS? key management?</item>
|
|
@@ -45,6 +48,7 @@ Context: Loaded security guidelines from CLAUDE.md/CONTRIBUTING.md
|
|
|
45
48
|
</step>
|
|
46
49
|
|
|
47
50
|
<step n="4" goal="OWASP A06-A10: Vulnerable Components, Auth, Integrity, Logging, SSRF">
|
|
51
|
+
<note>Run only if relevant to the project type and the changes in this PR. Skip entirely if this category has no applicability.</note>
|
|
48
52
|
<check-list id="owasp-6-10">
|
|
49
53
|
<item>A06 Vulnerable Components: new dependencies added? check for known CVEs</item>
|
|
50
54
|
<item>A07 Auth Failures: session management? password policies? brute force protection? JWT validation?</item>
|
|
@@ -55,6 +59,7 @@ Context: Loaded security guidelines from CLAUDE.md/CONTRIBUTING.md
|
|
|
55
59
|
</step>
|
|
56
60
|
|
|
57
61
|
<step n="5" goal="Rate limiting and input validation">
|
|
62
|
+
<note>Run only if relevant to the project type and the changes in this PR. Skip entirely if this category has no applicability.</note>
|
|
58
63
|
<check-list id="input-rate">
|
|
59
64
|
<item>Rate limiting on auth endpoints (login, register, password reset)</item>
|
|
60
65
|
<item>Input length limits enforced server-side</item>
|
|
@@ -63,6 +68,13 @@ Context: Loaded security guidelines from CLAUDE.md/CONTRIBUTING.md
|
|
|
63
68
|
</check-list>
|
|
64
69
|
</step>
|
|
65
70
|
|
|
71
|
+
<step n="5b" goal="Stack-specific and project-specific security checks">
|
|
72
|
+
<action>Apply all security rules from knowledge_base.stack_context.rules for each detected stack</action>
|
|
73
|
+
<action>Apply security-related guidelines from knowledge_base.relevant_guidelines</action>
|
|
74
|
+
<action>Apply guidance from knowledge_base.reviewer_guidance.security_review</action>
|
|
75
|
+
<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 security rules, skip this step silently.</note>
|
|
76
|
+
</step>
|
|
77
|
+
|
|
66
78
|
<step n="6" goal="Compile and write security findings">
|
|
67
79
|
<action>Group findings by severity: 🔴 Critical/High → 🟡 Medium → 🟢 Low/Info → ❓ Questions for Author</action>
|
|
68
80
|
<action>For each finding include: WHAT, WHERE (file+line), IMPACT (how exploitable), HOW TO FIX</action>
|