prr-kit 1.2.2 → 1.3.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.
Files changed (27) hide show
  1. package/README.md +77 -23
  2. package/package.json +1 -1
  3. package/src/core/agents/prr-master.agent.yaml +5 -5
  4. package/src/core/tasks/help.md +5 -5
  5. package/src/core/workflows/party-mode/steps/step-01-load-reviewers.md +5 -5
  6. package/src/core/workflows/party-mode/steps/step-02-discussion.md +5 -5
  7. package/src/prr/agents/architecture-reviewer.agent.yaml +2 -2
  8. package/src/prr/agents/business-reviewer.agent.yaml +2 -2
  9. package/src/prr/agents/general-reviewer.agent.yaml +2 -2
  10. package/src/prr/agents/performance-reviewer.agent.yaml +2 -2
  11. package/src/prr/agents/security-reviewer.agent.yaml +2 -2
  12. package/src/prr/config-template.yaml +3 -0
  13. package/src/prr/workflows/2-analyze/collect-pr-context/steps/step-02-collect-sources.md +2 -1
  14. package/src/prr/workflows/2-analyze/collect-pr-context/steps/step-03-manual-context-input.md +88 -0
  15. package/src/prr/workflows/2-analyze/collect-pr-context/steps/{step-03-build-knowledge-base.md → step-04-build-knowledge-base.md} +18 -2
  16. package/src/prr/workflows/2-analyze/collect-pr-context/workflow.md +3 -2
  17. package/src/prr/workflows/3-review/architecture-review/instructions.xml +16 -3
  18. package/src/prr/workflows/3-review/architecture-review/workflow.yaml +1 -1
  19. package/src/prr/workflows/3-review/business-review/instructions.xml +3 -0
  20. package/src/prr/workflows/3-review/business-review/workflow.yaml +1 -1
  21. package/src/prr/workflows/3-review/general-review/instructions.xml +8 -0
  22. package/src/prr/workflows/3-review/general-review/workflow.yaml +1 -1
  23. package/src/prr/workflows/3-review/performance-review/instructions.xml +14 -1
  24. package/src/prr/workflows/3-review/performance-review/workflow.yaml +1 -1
  25. package/src/prr/workflows/3-review/security-review/instructions.xml +14 -2
  26. package/src/prr/workflows/3-review/security-review/workflow.yaml +1 -1
  27. package/src/prr/workflows/quick/workflow.md +2 -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">
@@ -46,25 +48,75 @@ The framework installs into your project as a `_prr/` folder. Agents and workflo
46
48
 
47
49
  The installer handles configuration interactively — no manual file editing required. During `npx prr-kit install`, you'll be prompted for your name, language, output folder, target repo, and platform.
48
50
 
49
- All values are written automatically to `_prr/prr/config.yaml`:
51
+ All values are written to `_prr/prr/config.yaml`. Full schema overview:
50
52
 
51
53
  ```yaml
52
- user_name: YourName
53
- communication_language: English
54
- target_repo: .
55
- platform: auto # auto-detect from git remote
56
- platform_repo: "owner/repo" # optional — needed for PR listing and inline comments
57
- review_output: /abs/path/_prr-output/reviews
54
+ # ─── Identity ──────────────────────────────────────────────────────────────
55
+ user_name: YourName # Your name — used in review reports
56
+ communication_language: English # Any language: English | Vietnamese | Japanese | French | …
58
57
 
59
- context_collection:
60
- enabled: true
61
- mode: pr-specific # always fresh, never cached
58
+ # ─── Project ───────────────────────────────────────────────────────────────
59
+ project_name: my-project # Display name in reports (cosmetic only)
60
+ target_repo: . # Path to git repo (. = current dir, or ../other-repo)
61
+
62
+ # ─── Platform ──────────────────────────────────────────────────────────────
63
+ platform: auto # auto | github | gitlab | azure | bitbucket | none
64
+ platform_repo: "owner/repo" # owner/repo slug — required for PR listing + inline comments
65
+ # leave blank for local-only mode (git diff only)
62
66
 
67
+ # ─── Output ────────────────────────────────────────────────────────────────
68
+ review_output: ./_prr-output/reviews # Where review reports + context files are written
69
+ auto_post_comment: false # true → auto-post findings after every review (skips PC prompt)
70
+
71
+ # ─── Context Collection ────────────────────────────────────────────────────
72
+ context_collection:
73
+ enabled: true # false → disable context collection entirely
74
+ skip_manual_input_context: false # true → skip the manual context input prompt
75
+ # false (default) → agent asks user for additional context
76
+ # before building the knowledge base; input is marked ⚠️ IMPORTANT
77
+ mode: pr-specific # only value: pr-specific (always fresh, never cached)
78
+
79
+ # Sources below are auto-detected — override only if needed:
80
+ # primary_sources: [CLAUDE.md, AGENTS.md, .github/CLAUDE_CODE_RULES.md, .clauderules]
81
+ # config_files: [.eslintrc*, .prettierrc*, tsconfig.json, vite.config.*, webpack.config.*, …]
82
+ # standards_docs: [CONTRIBUTING.md, ARCHITECTURE.md, docs/**/*.md]
83
+ # inline_annotations: { enabled: true, patterns: [@context:, @security:, @pattern:, @rule:] }
84
+
85
+ # ─── External Sources ──────────────────────────────────────────────────────
86
+ # MCP tools + RAG systems available in your AI IDE session.
87
+ # Agent auto-discovers tools and maps them to declared intents.
63
88
  external_sources:
64
- enabled: false # set true to activate MCP + RAG enrichment
89
+ enabled: false # true activate MCP + RAG enrichment
90
+
91
+ mcp:
92
+ enabled: true # toggle MCP independently of master switch
93
+ intents: # what kinds of context to fetch via MCP tools
94
+ - knowledge_base # Confluence, Notion → team standards, ADRs
95
+ - project_management # Jira, Linear → linked issue + acceptance criteria
96
+ - design # Figma, Zeplin → design specs (UI PRs only)
97
+ # - code_intelligence # Sourcegraph → similar patterns
98
+ hints:
99
+ branch_issue_pattern: "([A-Z]+-\\d+)" # regex to extract issue key from branch name
100
+ # e.g. feature/ENG-123-auth → ENG-123
101
+
102
+ rag:
103
+ enabled: false # true → query RAG systems (vector DB, embeddings)
104
+ intents:
105
+ - similar_patterns # find similar code in the codebase
106
+ - past_decisions # previous review decisions for similar code
107
+ # - architecture_examples # embedded architecture docs
108
+
109
+ sources: [] # plain URL sources — always fetched via WebFetch
110
+ # sources:
111
+ # - type: url
112
+ # name: Shared ESLint config
113
+ # url: https://raw.githubusercontent.com/org/standards/main/eslint.md
114
+ # - type: url
115
+ # name: Security guidelines
116
+ # url: https://wiki.company.com/public/security-standards
65
117
  ```
66
118
 
67
- > See **[CONFIGURATION.md](CONFIGURATION.md)** for the full schema reference — including MCP tool intents, RAG systems, inline annotations, and URL sources.
119
+ > See **[CONFIGURATION.md](CONFIGURATION.md)** for detailed explanations, examples, and FAQs.
68
120
 
69
121
  ## Platform Support
70
122
 
@@ -99,11 +151,11 @@ Only pauses once to ask which PR/branch to review.
99
151
  |------|---------|-------------|
100
152
  | `SP` | Select PR | Fetch latest → list open PRs (via `gh`) or branches → select head + base → load diff |
101
153
  | `DP` | Describe PR | Classify PR type, generate summary, file-by-file walkthrough |
102
- | `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 |
106
- | `BR` | Business Review | User impact, business risk, feature completeness, data safety, observability |
154
+ | `GR` | General Review | Logic, naming, readability, DRY, best practices, etc. — adapted to your stack |
155
+ | `SR` | Security Review | OWASP Top 10, secrets, auth, rate limits, injection, etc. — adapted to your project |
156
+ | `PR` | Performance Review | N+1 queries, memory leaks, async patterns, caching, etc. — adapted to your stack |
157
+ | `AR` | Architecture Review | SOLID, layers, coupling, consistency with codebase, etc. — adapted to your architecture |
158
+ | `BR` | Business Review | User impact, business risk, feature completeness, data safety, observability — adapted to your project |
107
159
  | `IC` | Improve Code | Concrete BEFORE/AFTER code suggestions |
108
160
  | `AK` | Ask Code | Q&A about specific changes in this PR |
109
161
  | `RR` | Generate Report | Compile all findings → Markdown report in `_prr-output/reviews/` |
@@ -145,11 +197,13 @@ Specialist reviewer agents are orchestrated internally by the master agent and p
145
197
 
146
198
  | Reviewer | Focus | Key questions |
147
199
  |---|---|---|
148
- | 👁️ 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? |
152
- | 💼 Business (BR) | Real-world impact | User impact? Business risk? Feature completeness? Data safe? Observability? |
200
+ | 👁️ General (GR) | Code quality + stack practices | Is the logic correct? Naming clear? DRY? Tests present? *(adapted to your stack)* |
201
+ | 🔒 Security (SR) | OWASP Top 10 + stack threats | XSS? Injection? Secrets exposed? Auth correct? *(adapted to your stack)* |
202
+ | ⚡ Performance (PR) | Efficiency + stack patterns | N+1 queries? Memory leaks? Missing await? *(adapted to your stack)* |
203
+ | 🏗️ Architecture (AR) | Structure + conventions | Layer violations? Coupling? Consistent with codebase? *(adapted to your architecture)* |
204
+ | 💼 Business (BR) | Real-world impact | User impact? Business risk? Feature completeness? Data safe? Observability? *(adapted to your project)* |
205
+
206
+ > 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.
153
207
 
154
208
  **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
209
 
@@ -160,7 +214,7 @@ All findings use a standard format:
160
214
  - 🔴 **[BLOCKER]** — Must fix before merge
161
215
  - 🟡 **[WARNING]** — Should fix (with explanation)
162
216
  - 🟢 **[SUGGESTION]** — Nice-to-have improvement
163
- - 📌 **[QUESTION]** — Needs clarification from author
217
+ - **[QUESTION]** — Needs clarification from author
164
218
 
165
219
  ## Context Collection
166
220
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prr-kit",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "AI-driven Pull Request Review Kit — structured agent workflows for thorough, consistent code review",
5
5
  "main": "tools/cli/prr-cli.js",
6
6
  "bin": {
@@ -48,23 +48,23 @@ agent:
48
48
 
49
49
  - trigger: "GR or fuzzy match on general-review"
50
50
  workflow: "{project-root}/_prr/prr/workflows/3-review/general-review/workflow.yaml"
51
- description: "[GR] General Review: Logic, naming, readability, best practices"
51
+ description: "[GR] General Review: Code quality analysis adapted to your stack"
52
52
 
53
53
  - trigger: "SR or fuzzy match on security-review"
54
54
  workflow: "{project-root}/_prr/prr/workflows/3-review/security-review/workflow.yaml"
55
- description: "[SR] Security Review: OWASP top 10, injection, auth, API key exposure"
55
+ description: "[SR] Security Review: Security analysis adapted to your project"
56
56
 
57
57
  - trigger: "PR or fuzzy match on performance-review"
58
58
  workflow: "{project-root}/_prr/prr/workflows/3-review/performance-review/workflow.yaml"
59
- description: "[PR] Performance Review: N+1 queries, memory leaks, async patterns, bundle size"
59
+ description: "[PR] Performance Review: Performance analysis adapted to your stack"
60
60
 
61
61
  - trigger: "AR or fuzzy match on architecture-review"
62
62
  workflow: "{project-root}/_prr/prr/workflows/3-review/architecture-review/workflow.yaml"
63
- description: "[AR] Architecture Review: SOLID, layering, coupling, consistency with codebase"
63
+ description: "[AR] Architecture Review: Architecture analysis adapted to your codebase"
64
64
 
65
65
  - trigger: "BR or fuzzy match on business-review"
66
66
  workflow: "{project-root}/_prr/prr/workflows/3-review/business-review/workflow.yaml"
67
- description: "[BR] Business Review: User impact, business risk, feature completeness, data safety, observability"
67
+ description: "[BR] Business Review: Business impact analysis adapted to your project"
68
68
 
69
69
  - trigger: "IC or fuzzy match on improve-code"
70
70
  workflow: "{project-root}/_prr/prr/workflows/4-improve/improve-code/workflow.yaml"
@@ -21,11 +21,11 @@ Use `/prr-help` anytime for guidance on what to do.
21
21
 
22
22
  ### Available Reviews
23
23
 
24
- - **[GR] General Reviewer** 👁️ — Logic, naming, readability, DRY, best practices
25
- - **[SR] Security Reviewer** 🔒 — OWASP Top 10, injection, auth, secrets, API key exposure
26
- - **[PR] Performance Reviewer** ⚡ — N+1 queries, memory leaks, async patterns, bundle size
27
- - **[AR] Architecture Reviewer** 🏗️ — SOLID, layering, coupling, consistency, blast radius
28
- - **[BR] Business Reviewer** 💼 — User impact, business risk, feature completeness, data safety, observability
24
+ - **[GR] General Reviewer** 👁️ — Logic, naming, readability, DRY, best practices, etc. — adapted to your stack
25
+ - **[SR] Security Reviewer** 🔒 — OWASP Top 10, injection, auth, secrets, etc. adapted to your project
26
+ - **[PR] Performance Reviewer** ⚡ — N+1 queries, memory leaks, async patterns, etc. — adapted to your stack
27
+ - **[AR] Architecture Reviewer** 🏗️ — SOLID, layering, coupling, consistency, etc. — adapted to your architecture
28
+ - **[BR] Business Reviewer** 💼 — User impact, business risk, feature completeness, data safety, etc. — adapted to your project
29
29
 
30
30
  ### Finding Severity Levels
31
31
 
@@ -39,27 +39,27 @@ If no knowledge base exists (DP was not run), proceed with local context only
39
39
  Internally adopt all reviewer personas simultaneously. All reviewers apply rules from the PR knowledge base in their respective areas.
40
40
 
41
41
  **👁️ Alex (General Reviewer)**
42
- - Focus: code logic, naming, readability, DRY, best practices, test coverage, side effects
42
+ - Focus: code logic, naming, readability, DRY, best practices, test coverage, side effects, and stack-specific best practices from knowledge base
43
43
  - Style: pragmatic, balances perfection with practicality
44
44
  - Output format: 🔴/🟡/🟢/❓ with file:line references + suggested fix
45
45
 
46
46
  **🔒 Sam (Security Reviewer)**
47
- - Focus: OWASP Top 10, secrets, auth, injection, rate limiting, input validation
47
+ - Focus: OWASP Top 10, secrets, auth, injection, rate limiting, input validation, and stack-specific security threats from knowledge base
48
48
  - Style: paranoid-but-practical, every finding is a risk statement
49
49
  - Output format: WHAT / WHERE (file:line) / HOW exploitable / HOW TO FIX
50
50
 
51
51
  **⚡ Petra (Performance Reviewer)**
52
- - Focus: N+1 queries, async patterns, memory leaks, caching, payload size, bundle bloat
52
+ - Focus: N+1 queries, async patterns, memory leaks, caching, payload size, bundle bloat, and stack-specific performance patterns from knowledge base
53
53
  - Style: data-driven, quantifies impact when possible ("adds ~Xms per request")
54
54
  - Output format: impact estimate + root cause + fix
55
55
 
56
56
  **🏗️ Arch (Architecture Reviewer)**
57
- - Focus: SOLID, layering, coupling, consistency with codebase, shared module blast radius
57
+ - Focus: SOLID, layering, coupling, consistency with codebase, shared module blast radius, and stack-specific architectural patterns from knowledge base
58
58
  - Style: big-picture thinker, values consistency over theoretical purity
59
59
  - Output format: pattern analysis + reference to existing pattern + recommendation
60
60
 
61
61
  **💼 Biz (Business Reviewer)**
62
- - Focus: user impact, feature completeness vs acceptance criteria, business risk, data safety, observability
62
+ - Focus: user impact, feature completeness vs acceptance criteria, business risk, data safety, observability, and project-specific business concerns from knowledge base
63
63
  - Style: speaks in business terms — revenue impact, user churn, compliance risk
64
64
  - Runs last, references findings from Alex/Sam/Petra/Arch and translates them to business consequences
65
65
  - Output format: risk level (CRITICAL/HIGH/MEDIUM/LOW) + user impact + deployment recommendation
@@ -15,7 +15,7 @@ Go through the diff once per reviewer. Each reviewer applies rules from the PR k
15
15
 
16
16
  **👁️ Alex says:**
17
17
 
18
- [Alex reviews for: logic correctness, naming, readability, DRY violations, missing error handling, test coverage, side effects, resource cleanup]
18
+ [Alex reviews for: logic correctness, naming, readability, DRY violations, missing error handling, test coverage, side effects, resource cleanup, and stack-specific code quality issues from knowledge base]
19
19
 
20
20
  Format each finding as:
21
21
  ```
@@ -27,7 +27,7 @@ Format each finding as:
27
27
 
28
28
  **🔒 Sam says:**
29
29
 
30
- [Sam reviews for: secrets/credentials, SQL injection, XSS, authentication checks, authorization, rate limiting, error message exposure, OWASP Top 10]
30
+ [Sam reviews for: secrets/credentials, SQL injection, XSS, authentication checks, authorization, rate limiting, error message exposure, OWASP Top 10, and stack-specific security threats from knowledge base]
31
31
 
32
32
  Format each finding as:
33
33
  ```
@@ -40,7 +40,7 @@ Format each finding as:
40
40
 
41
41
  **⚡ Petra says:**
42
42
 
43
- [Petra reviews for: N+1 queries, missing indexes, sync I/O on hot paths, unbound queries, missing caching, large payloads, memory leaks, inefficient loops]
43
+ [Petra reviews for: N+1 queries, missing indexes, sync I/O on hot paths, unbound queries, missing caching, large payloads, memory leaks, inefficient loops, and stack-specific performance issues from knowledge base]
44
44
 
45
45
  Format each finding as:
46
46
  ```
@@ -53,7 +53,7 @@ Format each finding as:
53
53
 
54
54
  **🏗️ Arch says:**
55
55
 
56
- [Arch reviews for: layer violations, circular dependencies, tight coupling, inconsistent patterns, shared module blast radius, backward compatibility breaks]
56
+ [Arch reviews for: layer violations, circular dependencies, tight coupling, inconsistent patterns, shared module blast radius, backward compatibility breaks, and stack-specific architecture concerns from knowledge base]
57
57
 
58
58
  Format each finding as:
59
59
  ```
@@ -68,7 +68,7 @@ Format each finding as:
68
68
 
69
69
  **💼 Biz speaks last** — synthesizes findings from Alex/Sam/Petra/Arch into business impact:
70
70
 
71
- [Biz reviews for: user-facing regressions, feature completeness, data safety, deployment risk, observability gaps, compliance issues]
71
+ [Biz reviews for: user-facing regressions, feature completeness, data safety, deployment risk, observability gaps, compliance issues, and project-specific business concerns from knowledge base]
72
72
 
73
73
  For each 🔴 finding from prior reviewers, Biz adds business consequence:
74
74
  ```
@@ -5,7 +5,7 @@ agent:
5
5
  title: "Architecture Code Reviewer"
6
6
  icon: "🏗️"
7
7
  module: prr
8
- capabilities: "SOLID principles, design patterns, layered architecture, coupling and cohesion, API design, consistency with existing codebase patterns"
8
+ capabilities: "SOLID principles, design patterns, layered architecture, coupling and cohesion, API design, consistency with existing codebase patterns, and stack-specific architectural patterns"
9
9
  hasSidecar: false
10
10
  no_launcher: true
11
11
 
@@ -38,7 +38,7 @@ agent:
38
38
 
39
39
  - trigger: "AR or fuzzy match on architecture-review"
40
40
  workflow: "{project-root}/_prr/prr/workflows/3-review/architecture-review/workflow.yaml"
41
- description: "[AR] Architecture Review: SOLID, layering, coupling, codebase consistency"
41
+ description: "[AR] Architecture Review: Architecture analysis adapted to your codebase"
42
42
 
43
43
  - trigger: "IC or fuzzy match on improve-code"
44
44
  workflow: "{project-root}/_prr/prr/workflows/4-improve/improve-code/workflow.yaml"
@@ -5,7 +5,7 @@ agent:
5
5
  title: "Business Impact Reviewer"
6
6
  icon: "💼"
7
7
  module: prr
8
- capabilities: "user impact, feature completeness, business risk, data safety, observability, deployment risk, acceptance criteria validation"
8
+ capabilities: "user impact, feature completeness, business risk, data safety, observability, deployment risk, acceptance criteria validation, and project-specific business concerns"
9
9
  hasSidecar: false
10
10
  no_launcher: true
11
11
 
@@ -39,7 +39,7 @@ agent:
39
39
 
40
40
  - trigger: "BR or fuzzy match on business-review"
41
41
  workflow: "{project-root}/_prr/prr/workflows/3-review/business-review/workflow.yaml"
42
- description: "[BR] Business Review: User impact, business risk, feature completeness, data safety"
42
+ description: "[BR] Business Review: Business impact analysis adapted to your project"
43
43
 
44
44
  - trigger: "IC or fuzzy match on improve-code"
45
45
  workflow: "{project-root}/_prr/prr/workflows/4-improve/improve-code/workflow.yaml"
@@ -5,7 +5,7 @@ agent:
5
5
  title: "General Code Reviewer"
6
6
  icon: "👁️"
7
7
  module: prr
8
- capabilities: "code logic, naming conventions, readability, DRY principles, error handling, test coverage, code smells"
8
+ capabilities: "code logic, naming conventions, readability, DRY principles, error handling, test coverage, code smells, and stack-specific best practices"
9
9
  hasSidecar: false
10
10
  no_launcher: true
11
11
 
@@ -37,7 +37,7 @@ agent:
37
37
 
38
38
  - trigger: "GR or fuzzy match on general-review"
39
39
  workflow: "{project-root}/_prr/prr/workflows/3-review/general-review/workflow.yaml"
40
- description: "[GR] General Review: Comprehensive code quality analysis"
40
+ description: "[GR] General Review: Code quality analysis — adapted to your stack"
41
41
 
42
42
  - trigger: "IC or fuzzy match on improve-code"
43
43
  workflow: "{project-root}/_prr/prr/workflows/4-improve/improve-code/workflow.yaml"
@@ -5,7 +5,7 @@ agent:
5
5
  title: "Performance Code Reviewer"
6
6
  icon: "⚡"
7
7
  module: prr
8
- capabilities: "N+1 query detection, memory leak analysis, async/await patterns, bundle size, caching strategies, database query optimization"
8
+ capabilities: "N+1 query detection, memory leak analysis, async/await patterns, bundle size, caching strategies, database query optimization, and stack-specific performance patterns"
9
9
  hasSidecar: false
10
10
  no_launcher: true
11
11
 
@@ -38,7 +38,7 @@ agent:
38
38
 
39
39
  - trigger: "PR or fuzzy match on performance-review"
40
40
  workflow: "{project-root}/_prr/prr/workflows/3-review/performance-review/workflow.yaml"
41
- description: "[PR] Performance Review: N+1, memory, async, bundle size analysis"
41
+ description: "[PR] Performance Review: Performance analysis adapted to your stack"
42
42
 
43
43
  - trigger: "IC or fuzzy match on improve-code"
44
44
  workflow: "{project-root}/_prr/prr/workflows/4-improve/improve-code/workflow.yaml"
@@ -5,7 +5,7 @@ agent:
5
5
  title: "Security Code Reviewer"
6
6
  icon: "🔒"
7
7
  module: prr
8
- capabilities: "OWASP top 10, SQL injection, XSS, auth vulnerabilities, API key exposure, dependency vulnerabilities, cryptography misuse"
8
+ capabilities: "OWASP top 10, SQL injection, XSS, auth vulnerabilities, API key exposure, dependency vulnerabilities, cryptography misuse, and stack-specific security threats"
9
9
  hasSidecar: false
10
10
  no_launcher: true
11
11
 
@@ -40,7 +40,7 @@ agent:
40
40
 
41
41
  - trigger: "SR or fuzzy match on security-review"
42
42
  workflow: "{project-root}/_prr/prr/workflows/3-review/security-review/workflow.yaml"
43
- description: "[SR] Security Review: Full OWASP-based security analysis"
43
+ description: "[SR] Security Review: Security analysis adapted to your project"
44
44
 
45
45
  - trigger: "IC or fuzzy match on improve-code"
46
46
  workflow: "{project-root}/_prr/prr/workflows/4-improve/improve-code/workflow.yaml"
@@ -21,6 +21,9 @@ auto_post_comment: false # Set to true to auto-post findings to GitH
21
21
  # ─── Context Collection ────────────────────────────────────────────────────
22
22
  context_collection:
23
23
  enabled: true
24
+ skip_manual_input_context: false # Set to true to skip the manual context input prompt
25
+ # (default: false — agent will ask the user for additional context
26
+ # before building the knowledge base. User input is marked ⚠️ IMPORTANT)
24
27
  mode: pr-specific # Always fresh, never cached
25
28
 
26
29
  # Local primary sources (read if file exists)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: "step-02-collect-sources"
3
3
  description: "Collect context from all identified sources"
4
- nextStepFile: "./step-03-build-knowledge-base.md"
4
+ nextStepFile: "./step-03-manual-context-input.md"
5
5
  ---
6
6
 
7
7
  # Step 2: Collect Context from Sources
@@ -449,3 +449,4 @@ collected_data:
449
449
  ### 9. Load Next Step
450
450
 
451
451
  Add `step-02-collect-sources` to `stepsCompleted`. Load: `{nextStepFile}`
452
+
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: "step-03-manual-context-input"
3
+ description: "Collect additional context manually from the user"
4
+ nextStepFile: "./step-04-build-knowledge-base.md"
5
+ ---
6
+
7
+ # Step 3: Manual Context Input
8
+
9
+ ## Goal
10
+ Give the user the opportunity to provide additional context that automated collection cannot capture — such as business rationale, known trade-offs, special constraints, or specific areas to focus on.
11
+
12
+ ## Sequence of Instructions
13
+
14
+ ### 1. Check Config
15
+
16
+ Read `context_collection.skip_manual_input_context` from the loaded config.
17
+
18
+ If `skip_manual_input_context: true`:
19
+
20
+ ```
21
+ ⏭️ Manual context input skipped (skip_manual_input_context: true in config)
22
+ ```
23
+
24
+ Set `manual_context: null`. Add `step-03-manual-context-input` to `stepsCompleted`. Load: `{nextStepFile}`
25
+
26
+ **STOP — do not read further.**
27
+
28
+ ---
29
+
30
+ ### 2. Show Collection Summary
31
+
32
+ Print a brief summary of what was automatically collected so far:
33
+
34
+ ```
35
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
36
+ 💬 Auto-collection complete. Anything to add?
37
+
38
+ 📊 Collected so far:
39
+ 🗂️ Files changed: {files_count}
40
+ 🎯 Domains: {domains_list}
41
+ 🧩 Stacks detected: {stacks_list or "none"}
42
+ 📘 Primary docs: {primary_docs_found}
43
+ ⚙️ Config files: {config_files_found}
44
+ 📚 Standards docs: {standards_docs_found}
45
+ 💬 Inline annotations: {annotations_count}
46
+ 🔌 External tools: {mcp_and_rag_summary or "none"}
47
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
48
+ ```
49
+
50
+ ### 3. Prompt User
51
+
52
+ Ask the user:
53
+
54
+ ```
55
+ 💬 Do you have any additional context for the reviewers?
56
+
57
+ You can share:
58
+ • Business context or requirements behind this PR
59
+ • Known trade-offs or constraints you accepted
60
+ • Specific areas you'd like reviewers to focus on
61
+ • Known issues or technical debt to be aware of
62
+ • Links to related tickets, designs, or decisions
63
+
64
+ Type your notes and press Enter, or type "skip" to continue without adding context.
65
+ ```
66
+
67
+ ### 4. Capture Input
68
+
69
+ Wait for the user's response.
70
+
71
+ - If the user enters empty input, `skip`, `s`, `done`, or `no` → set `manual_context: null`, announce skip
72
+ - Otherwise → store the full text as `manual_context`
73
+
74
+ ### 5. Acknowledge
75
+
76
+ **If user provided context:**
77
+ ```
78
+ ✅ Context noted — reviewers will treat this as ⚠️ high-priority input.
79
+ ```
80
+
81
+ **If user skipped:**
82
+ ```
83
+ ⏩ Skipped — continuing with auto-collected context only.
84
+ ```
85
+
86
+ ### 6. Load Next Step
87
+
88
+ Add `step-03-manual-context-input` to `stepsCompleted`. Load: `{nextStepFile}`
@@ -1,9 +1,9 @@
1
1
  ---
2
- name: "step-03-build-knowledge-base"
2
+ name: "step-04-build-knowledge-base"
3
3
  description: "Build structured PR-specific knowledge base for reviewers"
4
4
  ---
5
5
 
6
- # Step 3: Build PR-Specific Knowledge Base
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,16 @@ pr_metadata:
32
32
  files_changed: {n}
33
33
  collected_at: {ISO timestamp}
34
34
 
35
+ # ⚠️ IMPORTANT — Human-provided context from the PR author.
36
+ # All reviewers MUST read this section before starting any review.
37
+ # Align all findings and focus areas against this input.
38
+ manual_context:
39
+ # Populated only when the user provided input in step-03-manual-context-input.
40
+ # If provided: true — treat this content as the highest-priority context in this file.
41
+ provided: {true|false}
42
+ content: |
43
+ {manual_context text, or null if not provided}
44
+
35
45
  files_analysis:
36
46
  changed_files:
37
47
  - path: src/stores/todoStore.js
@@ -235,6 +245,7 @@ external_context:
235
245
 
236
246
  review_priorities:
237
247
  # Guide reviewers on what to focus on
248
+ # ⚠️ If manual_context.provided is true — reviewers MUST check findings against it first.
238
249
  critical:
239
250
  - "Verify no v-html with user input (security requirement)"
240
251
  - "Check ESLint error-level rules compliance"
@@ -250,6 +261,7 @@ review_priorities:
250
261
  - "Optional optimizations"
251
262
 
252
263
  reviewer_guidance:
264
+ # ⚠️ If manual_context.provided is true — read manual_context BEFORE starting any review.
253
265
  general_review:
254
266
  - "Check for ESLint rule violations (no-var, prefer-const)"
255
267
  - "Verify component naming follows standards"
@@ -275,6 +287,7 @@ context_sources:
275
287
  config_files: [.eslintrc.js, .prettierrc]
276
288
  standards_docs: [CONTRIBUTING.md, ARCHITECTURE.md]
277
289
  inline_annotations: yes
290
+ manual_context: {true|false} # true if user provided input in step-03
278
291
  mcp_tools: [] # list of MCP tools actually used
279
292
  rag_systems: [] # list of RAG systems queried
280
293
  url_sources: [] # list of plain URLs fetched
@@ -309,6 +322,9 @@ Example: `_prr-output/pr-123-context.yaml`
309
322
  • ESLint rules: {n}
310
323
  • Guidelines: {m}
311
324
  • Inline annotations: {k}
325
+ • Manual context: ⚠️ YES — reviewers will prioritize this ({char_count} chars)
326
+ OR
327
+ • Manual context: none
312
328
  • MCP tools used: {mcp_list or "none"}
313
329
  • RAG patterns: {rag_count}
314
330
  • Issue context: {issue_key or "none"}
@@ -105,10 +105,11 @@ If a stack has no matching data file, skip it silently and proceed with general
105
105
 
106
106
  ## WORKFLOW ARCHITECTURE
107
107
 
108
- 3-step process:
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. **Build PR-specific knowledge base** — structured YAML with all context, stack rules, and reviewer guidance
111
+ 3. **Manual context input** — prompt the user for any additional context (business rationale, focus areas, known trade-offs). Skip automatically if `context_collection.skip_manual_input_context: true` in config. 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
 
@@ -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
- Focus: Layer violations | Coupling | SOLID | Codebase consistency
21
- Context: Loaded architectural patterns & ADRs from ARCHITECTURE.md
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>A change to any shared/common/generic module is high-risk because it affects all consumers not just the code in this PR. This step must always run when any such file is changed.</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>
@@ -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"
@@ -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
 
@@ -126,6 +127,8 @@ PR type: {pr_type} | Prior reviews loaded: {completed_reviews}
126
127
  MINIMAL = additive feature, no regressions, low risk changes
127
128
  </risk-matrix>
128
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
+
129
132
  <action>Structure the output by category, ordered by severity within each section:
130
133
  - Feature Completeness gaps (🔴 first, then 🟡, 🟢, ❓)
131
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"
@@ -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
 
@@ -88,6 +89,13 @@ For side effect findings, include the AFFECTED LOCATION (the file outside the di
88
89
  </output-format>
89
90
  </step>
90
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
+
91
99
  <step n="6" goal="Compile and write findings">
92
100
  <action>Group all findings by severity: 🔴 Blockers first, then 🟡 Warnings, then 🟢 Suggestions, then ❓ Questions</action>
93
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"
@@ -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
- Focus: N+1 queries | Memory | Async | Bundle size | Caching
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>
@@ -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"
@@ -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
- OWASP Top 10 scan + secrets detection + auth review
21
- Context: Loaded security guidelines from CLAUDE.md/CONTRIBUTING.md
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>
@@ -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"
@@ -202,12 +202,12 @@ Print to screen:
202
202
  ---
203
203
 
204
204
  ## PHASE 2.5 — COLLECT PR-SPECIFIC CONTEXT
205
- *Execute automatically, no user input.*
205
+ *Execute automatically. May pause once to ask the user for additional context (unless `skip_manual_input_context: true` in config).*
206
206
 
207
207
  Execute the collect-pr-context workflow in full:
208
208
  `{project-root}/_prr/prr/workflows/2-analyze/collect-pr-context/workflow.md`
209
209
 
210
- This workflow analyzes changed files, detects technology stacks, collects relevant context from all sources (primary docs, config files, standards docs, inline annotations, stack-specific rules, external MCP/RAG tools), and builds a structured PR-specific knowledge base at `{review_output}/pr-{pr_number}-context.yaml`.
210
+ This workflow analyzes changed files, detects technology stacks, collects relevant context from all sources (primary docs, config files, standards docs, inline annotations, stack-specific rules, external MCP/RAG tools), asks the user for any additional context (marked ⚠️ IMPORTANT if provided), and builds a structured PR-specific knowledge base at `{review_output}/pr-{pr_number}-context.yaml`.
211
211
 
212
212
  On completion, store `pr_knowledge_base` = path to the generated context file.
213
213