prr-kit 1.2.3 → 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.
- package/README.md +66 -16
- package/package.json +1 -1
- package/src/core/agents/prr-master.agent.yaml +5 -5
- package/src/core/tasks/help.md +5 -5
- package/src/core/workflows/party-mode/steps/step-01-load-reviewers.md +5 -5
- package/src/core/workflows/party-mode/steps/step-02-discussion.md +5 -5
- 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/config-template.yaml +3 -0
- 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 +88 -0
- package/src/prr/workflows/2-analyze/collect-pr-context/steps/{step-03-build-knowledge-base.md → step-04-build-knowledge-base.md} +18 -2
- package/src/prr/workflows/2-analyze/collect-pr-context/workflow.md +3 -2
- package/src/prr/workflows/3-review/architecture-review/workflow.yaml +1 -1
- package/src/prr/workflows/3-review/business-review/instructions.xml +2 -0
- package/src/prr/workflows/3-review/business-review/workflow.yaml +1 -1
- package/src/prr/workflows/3-review/general-review/instructions.xml +7 -0
- package/src/prr/workflows/3-review/general-review/workflow.yaml +1 -1
- package/src/prr/workflows/3-review/performance-review/workflow.yaml +1 -1
- package/src/prr/workflows/3-review/security-review/workflow.yaml +1 -1
- package/src/prr/workflows/quick/workflow.md +2 -2
package/README.md
CHANGED
|
@@ -48,25 +48,75 @@ The framework installs into your project as a `_prr/` folder. Agents and workflo
|
|
|
48
48
|
|
|
49
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.
|
|
50
50
|
|
|
51
|
-
All values are written
|
|
51
|
+
All values are written to `_prr/prr/config.yaml`. Full schema overview:
|
|
52
52
|
|
|
53
53
|
```yaml
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
platform: auto # auto-detect from git remote
|
|
58
|
-
platform_repo: "owner/repo" # optional — needed for PR listing and inline comments
|
|
59
|
-
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 | …
|
|
60
57
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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)
|
|
64
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.
|
|
65
88
|
external_sources:
|
|
66
|
-
enabled: false
|
|
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
|
|
67
117
|
```
|
|
68
118
|
|
|
69
|
-
> See **[CONFIGURATION.md](CONFIGURATION.md)** for
|
|
119
|
+
> See **[CONFIGURATION.md](CONFIGURATION.md)** for detailed explanations, examples, and FAQs.
|
|
70
120
|
|
|
71
121
|
## Platform Support
|
|
72
122
|
|
|
@@ -101,11 +151,11 @@ Only pauses once to ask which PR/branch to review.
|
|
|
101
151
|
|------|---------|-------------|
|
|
102
152
|
| `SP` | Select PR | Fetch latest → list open PRs (via `gh`) or branches → select head + base → load diff |
|
|
103
153
|
| `DP` | Describe PR | Classify PR type, generate summary, file-by-file walkthrough |
|
|
104
|
-
| `GR` | General Review | Logic, naming, readability, DRY, best practices |
|
|
154
|
+
| `GR` | General Review | Logic, naming, readability, DRY, best practices, etc. — adapted to your stack |
|
|
105
155
|
| `SR` | Security Review | OWASP Top 10, secrets, auth, rate limits, injection, etc. — adapted to your project |
|
|
106
156
|
| `PR` | Performance Review | N+1 queries, memory leaks, async patterns, caching, etc. — adapted to your stack |
|
|
107
157
|
| `AR` | Architecture Review | SOLID, layers, coupling, consistency with codebase, etc. — adapted to your architecture |
|
|
108
|
-
| `BR` | Business Review | User impact, business risk, feature completeness, data safety, observability |
|
|
158
|
+
| `BR` | Business Review | User impact, business risk, feature completeness, data safety, observability — adapted to your project |
|
|
109
159
|
| `IC` | Improve Code | Concrete BEFORE/AFTER code suggestions |
|
|
110
160
|
| `AK` | Ask Code | Q&A about specific changes in this PR |
|
|
111
161
|
| `RR` | Generate Report | Compile all findings → Markdown report in `_prr-output/reviews/` |
|
|
@@ -147,11 +197,11 @@ Specialist reviewer agents are orchestrated internally by the master agent and p
|
|
|
147
197
|
|
|
148
198
|
| Reviewer | Focus | Key questions |
|
|
149
199
|
|---|---|---|
|
|
150
|
-
| 👁️ General (GR) | Code quality | Is the logic correct? Naming clear? DRY? Tests present? |
|
|
200
|
+
| 👁️ General (GR) | Code quality + stack practices | Is the logic correct? Naming clear? DRY? Tests present? *(adapted to your stack)* |
|
|
151
201
|
| 🔒 Security (SR) | OWASP Top 10 + stack threats | XSS? Injection? Secrets exposed? Auth correct? *(adapted to your stack)* |
|
|
152
202
|
| ⚡ Performance (PR) | Efficiency + stack patterns | N+1 queries? Memory leaks? Missing await? *(adapted to your stack)* |
|
|
153
203
|
| 🏗️ Architecture (AR) | Structure + conventions | Layer violations? Coupling? Consistent with codebase? *(adapted to your architecture)* |
|
|
154
|
-
| 💼 Business (BR) | Real-world impact | User impact? Business risk? Feature completeness? Data safe? Observability? |
|
|
204
|
+
| 💼 Business (BR) | Real-world impact | User impact? Business risk? Feature completeness? Data safe? Observability? *(adapted to your project)* |
|
|
155
205
|
|
|
156
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.
|
|
157
207
|
|
package/package.json
CHANGED
|
@@ -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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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"
|
package/src/core/tasks/help.md
CHANGED
|
@@ -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,
|
|
26
|
-
- **[PR] Performance Reviewer** ⚡ — N+1 queries, memory leaks, async patterns,
|
|
27
|
-
- **[AR] Architecture Reviewer** 🏗️ — SOLID, layering, coupling, consistency,
|
|
28
|
-
- **[BR] Business Reviewer** 💼 — User impact, business risk, feature completeness, data safety,
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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-
|
|
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-
|
|
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,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
|
-
|
|
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). 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
|
|
|
@@ -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"
|
|
@@ -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"
|
|
@@ -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"
|
|
@@ -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"
|
|
@@ -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
|
|
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
|
|