prr-kit 1.1.2 โ 1.2.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/LICENSE +1 -1
- package/README.md +260 -235
- package/docs/assets/banner.svg +33 -165
- package/docs/assets/how-it-works.svg +87 -0
- package/package.json +60 -60
- package/src/core/agents/prr-master.agent.yaml +18 -7
- package/src/core/tasks/clear.md +140 -0
- package/src/core/tasks/help.md +15 -13
- package/src/core/workflows/clear/workflow.md +6 -0
- package/src/core/workflows/help/workflow.md +6 -0
- package/src/core/workflows/party-mode/steps/step-01-load-reviewers.md +35 -24
- package/src/core/workflows/party-mode/steps/step-02-discussion.md +45 -25
- package/src/core/workflows/party-mode/workflow.md +2 -2
- package/src/prr/agents/architecture-reviewer.agent.yaml +65 -45
- package/src/prr/agents/business-reviewer.agent.yaml +66 -0
- package/src/prr/agents/general-reviewer.agent.yaml +64 -48
- package/src/prr/agents/performance-reviewer.agent.yaml +65 -45
- package/src/prr/agents/security-reviewer.agent.yaml +67 -43
- package/src/prr/config-template.yaml +97 -0
- package/src/prr/data/stacks/actix.md +55 -0
- package/src/prr/data/stacks/alpine.md +47 -0
- package/src/prr/data/stacks/android.md +53 -0
- package/src/prr/data/stacks/angular.md +96 -0
- package/src/prr/data/stacks/ansible.md +55 -0
- package/src/prr/data/stacks/apollo.md +54 -0
- package/src/prr/data/stacks/astro.md +48 -0
- package/src/prr/data/stacks/aws-cdk.md +55 -0
- package/src/prr/data/stacks/axum.md +56 -0
- package/src/prr/data/stacks/babylonjs.md +55 -0
- package/src/prr/data/stacks/bash.md +53 -0
- package/src/prr/data/stacks/bevy.md +53 -0
- package/src/prr/data/stacks/bootstrap.md +52 -0
- package/src/prr/data/stacks/bun.md +55 -0
- package/src/prr/data/stacks/cpp.md +57 -0
- package/src/prr/data/stacks/csharp.md +95 -0
- package/src/prr/data/stacks/css.md +55 -0
- package/src/prr/data/stacks/cypress.md +53 -0
- package/src/prr/data/stacks/d3.md +53 -0
- package/src/prr/data/stacks/deno.md +49 -0
- package/src/prr/data/stacks/django.md +92 -0
- package/src/prr/data/stacks/docker.md +79 -0
- package/src/prr/data/stacks/drizzle.md +54 -0
- package/src/prr/data/stacks/dynamodb.md +55 -0
- package/src/prr/data/stacks/electron.md +44 -0
- package/src/prr/data/stacks/elixir.md +53 -0
- package/src/prr/data/stacks/expo.md +53 -0
- package/src/prr/data/stacks/expressjs.md +82 -0
- package/src/prr/data/stacks/fastapi.md +88 -0
- package/src/prr/data/stacks/fastify.md +60 -0
- package/src/prr/data/stacks/fiber.md +55 -0
- package/src/prr/data/stacks/firebase.md +43 -0
- package/src/prr/data/stacks/flask.md +46 -0
- package/src/prr/data/stacks/flutter.md +75 -0
- package/src/prr/data/stacks/gin.md +57 -0
- package/src/prr/data/stacks/github-actions.md +71 -0
- package/src/prr/data/stacks/go.md +88 -0
- package/src/prr/data/stacks/godot.md +56 -0
- package/src/prr/data/stacks/graphql.md +76 -0
- package/src/prr/data/stacks/grpc.md +56 -0
- package/src/prr/data/stacks/haskell.md +48 -0
- package/src/prr/data/stacks/helm.md +54 -0
- package/src/prr/data/stacks/hono.md +54 -0
- package/src/prr/data/stacks/htmx.md +38 -0
- package/src/prr/data/stacks/java.md +87 -0
- package/src/prr/data/stacks/jest-vitest.md +87 -0
- package/src/prr/data/stacks/jquery.md +50 -0
- package/src/prr/data/stacks/junit.md +53 -0
- package/src/prr/data/stacks/kotlin.md +89 -0
- package/src/prr/data/stacks/kubernetes.md +148 -0
- package/src/prr/data/stacks/langchain.md +56 -0
- package/src/prr/data/stacks/laravel.md +56 -0
- package/src/prr/data/stacks/libgdx.md +46 -0
- package/src/prr/data/stacks/lit.md +49 -0
- package/src/prr/data/stacks/love2d.md +51 -0
- package/src/prr/data/stacks/lua.md +51 -0
- package/src/prr/data/stacks/mobx.md +54 -0
- package/src/prr/data/stacks/mongodb.md +85 -0
- package/src/prr/data/stacks/monogame.md +51 -0
- package/src/prr/data/stacks/mysql.md +57 -0
- package/src/prr/data/stacks/nestjs.md +95 -0
- package/src/prr/data/stacks/nextjs.md +88 -0
- package/src/prr/data/stacks/nginx.md +55 -0
- package/src/prr/data/stacks/node.md +56 -0
- package/src/prr/data/stacks/nuxtjs.md +91 -0
- package/src/prr/data/stacks/openai-api.md +54 -0
- package/src/prr/data/stacks/opengl.md +54 -0
- package/src/prr/data/stacks/phaser.md +54 -0
- package/src/prr/data/stacks/phoenix.md +55 -0
- package/src/prr/data/stacks/php.md +56 -0
- package/src/prr/data/stacks/playwright.md +86 -0
- package/src/prr/data/stacks/postgresql.md +60 -0
- package/src/prr/data/stacks/prisma.md +81 -0
- package/src/prr/data/stacks/pygame.md +52 -0
- package/src/prr/data/stacks/pytest.md +53 -0
- package/src/prr/data/stacks/python.md +94 -0
- package/src/prr/data/stacks/pytorch.md +54 -0
- package/src/prr/data/stacks/qwik.md +50 -0
- package/src/prr/data/stacks/rails.md +48 -0
- package/src/prr/data/stacks/react-native.md +77 -0
- package/src/prr/data/stacks/react.md +104 -0
- package/src/prr/data/stacks/redis.md +76 -0
- package/src/prr/data/stacks/redux.md +107 -0
- package/src/prr/data/stacks/remix.md +51 -0
- package/src/prr/data/stacks/rust.md +88 -0
- package/src/prr/data/stacks/sass.md +51 -0
- package/src/prr/data/stacks/scala.md +50 -0
- package/src/prr/data/stacks/scikit-learn.md +53 -0
- package/src/prr/data/stacks/sequelize.md +54 -0
- package/src/prr/data/stacks/socket-io.md +54 -0
- package/src/prr/data/stacks/solidity.md +53 -0
- package/src/prr/data/stacks/solidjs.md +45 -0
- package/src/prr/data/stacks/spring-boot.md +92 -0
- package/src/prr/data/stacks/sql.md +85 -0
- package/src/prr/data/stacks/sqlite.md +55 -0
- package/src/prr/data/stacks/styled-components.md +51 -0
- package/src/prr/data/stacks/supabase.md +57 -0
- package/src/prr/data/stacks/svelte.md +77 -0
- package/src/prr/data/stacks/sveltekit.md +54 -0
- package/src/prr/data/stacks/swift.md +61 -0
- package/src/prr/data/stacks/tailwindcss.md +10 -0
- package/src/prr/data/stacks/tanstack-query.md +48 -0
- package/src/prr/data/stacks/tauri.md +52 -0
- package/src/prr/data/stacks/terraform.md +53 -0
- package/src/prr/data/stacks/three.md +53 -0
- package/src/prr/data/stacks/trpc.md +49 -0
- package/src/prr/data/stacks/typeorm.md +40 -0
- package/src/prr/data/stacks/typescript.md +83 -0
- package/src/prr/data/stacks/unity.md +61 -0
- package/src/prr/data/stacks/unreal.md +58 -0
- package/src/prr/data/stacks/vite.md +48 -0
- package/src/prr/data/stacks/vue3.md +95 -0
- package/src/prr/data/stacks/vulkan.md +53 -0
- package/src/prr/data/stacks/wasm.md +49 -0
- package/src/prr/data/stacks/webpack.md +48 -0
- package/src/prr/data/stacks/zig.md +51 -0
- package/src/prr/data/stacks/zustand.md +56 -0
- package/src/prr/workflows/1-discover/select-pr/steps/step-05-confirm.md +1 -0
- package/src/prr/workflows/1-discover/select-pr/workflow.md +1 -1
- package/src/prr/workflows/2-analyze/collect-pr-context/steps/step-01-analyze-files.md +334 -0
- package/src/prr/workflows/2-analyze/collect-pr-context/steps/step-02-collect-sources.md +451 -0
- package/src/prr/workflows/2-analyze/collect-pr-context/steps/step-03-build-knowledge-base.md +337 -0
- package/src/prr/workflows/2-analyze/collect-pr-context/workflow.md +123 -0
- package/src/prr/workflows/2-analyze/describe-pr/steps/step-02-classify.md +12 -6
- package/src/prr/workflows/2-analyze/describe-pr/steps/step-03-walkthrough.md +59 -1
- package/src/prr/workflows/3-review/architecture-review/checklist.md +4 -0
- package/src/prr/workflows/3-review/architecture-review/instructions.xml +32 -4
- package/src/prr/workflows/3-review/architecture-review/workflow.yaml +17 -18
- package/src/prr/workflows/3-review/business-review/checklist.md +27 -0
- package/src/prr/workflows/3-review/business-review/instructions.xml +153 -0
- package/src/prr/workflows/3-review/business-review/workflow.yaml +17 -0
- package/src/prr/workflows/3-review/general-review/checklist.md +5 -1
- package/src/prr/workflows/3-review/general-review/instructions.xml +39 -8
- package/src/prr/workflows/3-review/general-review/workflow.yaml +17 -18
- package/src/prr/workflows/3-review/performance-review/checklist.md +3 -1
- package/src/prr/workflows/3-review/performance-review/instructions.xml +10 -3
- package/src/prr/workflows/3-review/performance-review/workflow.yaml +17 -18
- package/src/prr/workflows/3-review/security-review/checklist.md +2 -1
- package/src/prr/workflows/3-review/security-review/instructions.xml +8 -3
- package/src/prr/workflows/3-review/security-review/workflow.yaml +18 -19
- package/src/prr/workflows/4-improve/improve-code/workflow.yaml +17 -18
- package/src/prr/workflows/6-report/generate-report/steps/step-01-collect.md +9 -2
- package/src/prr/workflows/6-report/generate-report/steps/step-02-organize.md +28 -7
- package/src/prr/workflows/6-report/generate-report/steps/step-03-write.md +6 -4
- package/src/prr/workflows/6-report/generate-report/templates/review-report.template.md +124 -78
- package/src/prr/workflows/6-report/post-comments/steps/step-01-format.md +104 -13
- package/src/prr/workflows/6-report/post-comments/steps/step-02-post.md +92 -21
- package/src/prr/workflows/6-report/post-comments/workflow.md +6 -0
- package/src/prr/workflows/quick/workflow.md +138 -32
- package/src/prr/workflows/0-setup/collect-project-context/steps/step-01-scan-configs.md +0 -106
- package/src/prr/workflows/0-setup/collect-project-context/steps/step-02-extract-rules.md +0 -131
- package/src/prr/workflows/0-setup/collect-project-context/steps/step-03-ask-context.md +0 -194
- package/src/prr/workflows/0-setup/collect-project-context/steps/step-04-save-context.md +0 -161
- package/src/prr/workflows/0-setup/collect-project-context/workflow.md +0 -58
|
@@ -19,17 +19,24 @@ For each completed review in `review.completed` list, read the corresponding out
|
|
|
19
19
|
- `security-review` โ `{review_output}/security-review-*.md` (latest)
|
|
20
20
|
- `performance-review` โ `{review_output}/performance-review-*.md` (latest)
|
|
21
21
|
- `architecture-review` โ `{review_output}/architecture-review-*.md` (latest)
|
|
22
|
+
- `business-review` โ `{review_output}/business-review-*.md` (latest)
|
|
22
23
|
- `improve-code` โ `{review_output}/improve-code-*.md` (latest)
|
|
23
24
|
|
|
24
25
|
### 3. Parse All Findings
|
|
25
26
|
|
|
26
27
|
From each file, extract all findings with their:
|
|
27
|
-
- Severity (๐ด Blocker / ๐ก Warning / ๐ข Suggestion / Critical/High/Medium/Low)
|
|
28
|
-
- Category (general/security/performance/architecture/improvement)
|
|
28
|
+
- Severity (๐ด Blocker / ๐ก Warning / ๐ข Suggestion / โ Question / Critical/High/Medium/Low)
|
|
29
|
+
- Category (general/security/performance/architecture/business/improvement)
|
|
29
30
|
- File + line reference
|
|
30
31
|
- Description
|
|
31
32
|
- Suggested fix
|
|
32
33
|
|
|
34
|
+
**Severity mapping:**
|
|
35
|
+
- `๐ด` or `Critical`/`High` โ Blocker
|
|
36
|
+
- `๐ก` or `Medium` โ Warning
|
|
37
|
+
- `๐ข` or `Low` โ Suggestion
|
|
38
|
+
- `โ` โ Question (collect separately โ do not count as blocker/warning/suggestion)
|
|
39
|
+
|
|
33
40
|
### 4. Count Statistics
|
|
34
41
|
|
|
35
42
|
Count:
|
|
@@ -10,7 +10,7 @@ nextStepFile: "./step-03-write.md"
|
|
|
10
10
|
|
|
11
11
|
### 1. Sort by Severity
|
|
12
12
|
|
|
13
|
-
Order: ๐ด Blockers/
|
|
13
|
+
Order: ๐ด Blockers (Critical/High) โ ๐ก Warnings (Medium) โ ๐ข Suggestions (Low) โ โ Questions
|
|
14
14
|
|
|
15
15
|
### 2. Group by Category
|
|
16
16
|
|
|
@@ -19,20 +19,41 @@ Within each severity level, group by review category:
|
|
|
19
19
|
- โก Performance
|
|
20
20
|
- ๐๏ธ Architecture
|
|
21
21
|
- ๐๏ธ General Quality
|
|
22
|
+
- ๐ผ Business Impact
|
|
22
23
|
- ๐ก Improvements
|
|
23
24
|
|
|
24
25
|
### 3. Create Executive Summary
|
|
25
26
|
|
|
26
|
-
Write
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
Write a two-part summary:
|
|
28
|
+
|
|
29
|
+
**Technical part:**
|
|
30
|
+
- Overall code quality assessment (1 sentence)
|
|
31
|
+
- Highest priority technical issues
|
|
29
32
|
- Positive findings (good practices found)
|
|
30
|
-
- Recommendation: approved / needs changes / request changes
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
**Business part (if business-review was completed):**
|
|
35
|
+
- Overall business risk level: CRITICAL / HIGH / MEDIUM / LOW / MINIMAL
|
|
36
|
+
- Top business concern (1 sentence): what is the biggest real-world risk?
|
|
37
|
+
- Deployment recommendation from business perspective
|
|
38
|
+
|
|
39
|
+
**Combined verdict:**
|
|
40
|
+
- โ
APPROVE โ no blockers, low business risk, safe to ship
|
|
41
|
+
- โ ๏ธ APPROVE WITH NOTES โ warnings only, medium business risk, monitor post-ship
|
|
42
|
+
- ๐ซ REQUEST CHANGES โ blockers present OR high/critical business risk
|
|
43
|
+
|
|
44
|
+
### 4. Compile Business Risk Summary
|
|
45
|
+
|
|
46
|
+
If business-review findings exist:
|
|
47
|
+
- Extract overall business risk level
|
|
48
|
+
- List top 3 business concerns with their severity
|
|
49
|
+
- List any data/migration risks
|
|
50
|
+
- Note observability gaps
|
|
51
|
+
- Note deployment concerns
|
|
52
|
+
|
|
53
|
+
### 5. Identify Files with Multiple Issues
|
|
33
54
|
|
|
34
55
|
List files that have 3+ findings โ these may need more significant rework.
|
|
35
56
|
|
|
36
|
-
###
|
|
57
|
+
### 6. Load Next Step
|
|
37
58
|
|
|
38
59
|
Add `step-02-organize` to `stepsCompleted`. Load: `{nextStepFile}`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "step-03-write"
|
|
3
3
|
description: "Write the final review report to file"
|
|
4
|
-
outputFile: "{review_output}/review-
|
|
4
|
+
outputFile: "{review_output}/review-{target_branch_slug}-{date}.md"
|
|
5
5
|
templateFile: "../templates/review-report.template.md"
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -15,17 +15,19 @@ Using `{templateFile}`, write the complete review report to `{outputFile}`.
|
|
|
15
15
|
|
|
16
16
|
The report includes:
|
|
17
17
|
- PR metadata and review summary
|
|
18
|
-
- Executive summary with
|
|
18
|
+
- Executive summary with technical verdict + business risk level
|
|
19
|
+
- Business Impact section (if business-review was completed)
|
|
19
20
|
- All findings organized by severity and category
|
|
20
21
|
- Files with multiple issues highlighted
|
|
21
22
|
- Recommended actions (must-fix vs nice-to-have)
|
|
23
|
+
- Post-ship monitoring checklist (if business-review completed)
|
|
22
24
|
|
|
23
25
|
### 2. Display Completion
|
|
24
26
|
|
|
25
27
|
```
|
|
26
28
|
โ
Review Report Generated!
|
|
27
29
|
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
28
|
-
๐ File: {
|
|
30
|
+
๐ File: {review_output}/review-{target_branch_slug}-{date}.md
|
|
29
31
|
|
|
30
32
|
Summary:
|
|
31
33
|
๐ด Blockers: {blocker_count}
|
|
@@ -37,7 +39,7 @@ Verdict: {verdict}
|
|
|
37
39
|
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
38
40
|
|
|
39
41
|
Next steps:
|
|
40
|
-
[PC] Post Comments โ post these findings to GitHub PR
|
|
42
|
+
[PC] Post Comments โ post these findings to GitHub / GitLab / Azure / Bitbucket PR/MR
|
|
41
43
|
or share the report file directly with the PR author
|
|
42
44
|
```
|
|
43
45
|
|
|
@@ -1,78 +1,124 @@
|
|
|
1
|
-
---
|
|
2
|
-
pr_branch: "{{target_branch}}"
|
|
3
|
-
base_branch: "{{base_branch}}"
|
|
4
|
-
pr_number: "{{pr_number}}"
|
|
5
|
-
date: "{{date}}"
|
|
6
|
-
verdict: "{{verdict}}"
|
|
7
|
-
reviews_completed:
|
|
8
|
-
{{reviews_completed_list}}
|
|
9
|
-
stepsCompleted: []
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# Code Review Report: {{pr_title}}
|
|
13
|
-
|
|
14
|
-
**PR:** `{{target_branch}}` โ `{{base_branch}}`
|
|
15
|
-
{{#if pr_number}}**
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Executive Summary
|
|
20
|
-
|
|
21
|
-
{{executive_summary}}
|
|
22
|
-
|
|
23
|
-
**Verdict:** {{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
|
29
|
-
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
{{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
{{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
1
|
+
---
|
|
2
|
+
pr_branch: "{{target_branch}}"
|
|
3
|
+
base_branch: "{{base_branch}}"
|
|
4
|
+
pr_number: "{{pr_number}}"
|
|
5
|
+
date: "{{date}}"
|
|
6
|
+
verdict: "{{verdict}}"
|
|
7
|
+
reviews_completed:
|
|
8
|
+
{{reviews_completed_list}}
|
|
9
|
+
stepsCompleted: []
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Code Review Report: {{pr_title}}
|
|
13
|
+
|
|
14
|
+
**PR:** `{{target_branch}}` โ `{{base_branch}}`
|
|
15
|
+
{{#if pr_number}}**PR/MR #{{pr_number}}** | {{/if}}**Date:** {{date}} | **Reviewer:** {{user_name}}
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Executive Summary
|
|
20
|
+
|
|
21
|
+
{{executive_summary}}
|
|
22
|
+
|
|
23
|
+
**Technical Verdict:** {{technical_verdict}}
|
|
24
|
+
**Business Risk:** {{business_risk_level}} โ {{business_risk_summary}}
|
|
25
|
+
|
|
26
|
+
**Overall Verdict:** {{verdict}}
|
|
27
|
+
|
|
28
|
+
| Category | ๐ด Blockers | ๐ก Warnings | ๐ข Suggestions |
|
|
29
|
+
|----------|------------|------------|----------------|
|
|
30
|
+
| ๐ Security | {{security_blockers}} | {{security_warnings}} | {{security_suggestions}} |
|
|
31
|
+
| โก Performance | {{perf_blockers}} | {{perf_warnings}} | {{perf_suggestions}} |
|
|
32
|
+
| ๐๏ธ Architecture | {{arch_blockers}} | {{arch_warnings}} | {{arch_suggestions}} |
|
|
33
|
+
| ๐๏ธ General | {{general_blockers}} | {{general_warnings}} | {{general_suggestions}} |
|
|
34
|
+
| ๐ผ Business | {{business_blockers}} | {{business_warnings}} | {{business_suggestions}} |
|
|
35
|
+
| **Total** | **{{total_blockers}}** | **{{total_warnings}}** | **{{total_suggestions}}** |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## ๐ผ Business Impact
|
|
40
|
+
|
|
41
|
+
> *This section translates technical findings into real-world consequences for users and the business.*
|
|
42
|
+
|
|
43
|
+
### Overall Business Risk: {{business_risk_level}}
|
|
44
|
+
|
|
45
|
+
{{business_risk_overview}}
|
|
46
|
+
|
|
47
|
+
### Feature Completeness
|
|
48
|
+
|
|
49
|
+
{{feature_completeness_section}}
|
|
50
|
+
|
|
51
|
+
### User Impact
|
|
52
|
+
|
|
53
|
+
{{user_impact_section}}
|
|
54
|
+
|
|
55
|
+
### Business Risk Breakdown
|
|
56
|
+
|
|
57
|
+
{{business_risk_breakdown}}
|
|
58
|
+
|
|
59
|
+
### Data & Migration Risk
|
|
60
|
+
|
|
61
|
+
{{data_migration_section}}
|
|
62
|
+
|
|
63
|
+
### Observability & Measurability
|
|
64
|
+
|
|
65
|
+
{{observability_section}}
|
|
66
|
+
|
|
67
|
+
### Cross-cutting Concerns
|
|
68
|
+
|
|
69
|
+
{{cross_cutting_section}}
|
|
70
|
+
|
|
71
|
+
### Deployment Recommendation
|
|
72
|
+
|
|
73
|
+
{{deployment_recommendation}}
|
|
74
|
+
|
|
75
|
+
### Post-Ship Monitoring
|
|
76
|
+
|
|
77
|
+
{{post_ship_monitoring}}
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## ๐ด Blockers โ Must Fix Before Merge
|
|
82
|
+
|
|
83
|
+
{{blockers_section}}
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## ๐ก Warnings โ Should Fix
|
|
88
|
+
|
|
89
|
+
{{warnings_section}}
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## ๐ข Suggestions โ Nice to Have
|
|
94
|
+
|
|
95
|
+
{{suggestions_section}}
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## ๐ Questions for Author
|
|
100
|
+
|
|
101
|
+
{{questions_section}}
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## ๐ก Code Improvement Suggestions
|
|
106
|
+
|
|
107
|
+
{{improvements_section}}
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Files with Multiple Issues
|
|
112
|
+
|
|
113
|
+
{{files_with_issues}}
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## โ
Positive Observations
|
|
118
|
+
|
|
119
|
+
{{positive_observations}}
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
*Generated by PR Review Kit*
|
|
124
|
+
*Reviews completed: {{reviews_completed}}*
|
|
@@ -24,11 +24,24 @@ Verify platform CLI is available:
|
|
|
24
24
|
| bitbucket | check env `BB_TOKEN` or `~/.config/bb` | `โ Set Bitbucket credentials` |
|
|
25
25
|
| none | โ | show: `โน๏ธ No platform configured โ findings saved to report only.` then stop |
|
|
26
26
|
|
|
27
|
+
**โ ๏ธ GitHub CLI path detection** โ `gh` may not be in `PATH` even if installed. If `gh auth status` fails, probe common locations before giving up:
|
|
28
|
+
```bash
|
|
29
|
+
# Windows
|
|
30
|
+
"/c/Program Files/GitHub CLI/gh" auth status
|
|
31
|
+
# macOS Homebrew
|
|
32
|
+
/opt/homebrew/bin/gh auth status
|
|
33
|
+
/usr/local/bin/gh auth status
|
|
34
|
+
# Linux
|
|
35
|
+
/usr/bin/gh auth status
|
|
36
|
+
~/.local/bin/gh auth status
|
|
37
|
+
```
|
|
38
|
+
Store the working path as `{gh_path}` (e.g. `"/c/Program Files/GitHub CLI/gh"`). Use `{gh_path}` for **all** subsequent `gh` calls in this workflow instead of bare `gh`.
|
|
39
|
+
|
|
27
40
|
### 2. Get Head Commit SHA
|
|
28
41
|
|
|
29
42
|
**GitHub / GitLab / Bitbucket:**
|
|
30
43
|
```bash
|
|
31
|
-
git -C {target_repo} rev-parse origin/{
|
|
44
|
+
git -C {target_repo} rev-parse origin/{target_branch}
|
|
32
45
|
```
|
|
33
46
|
Or use `{pr_head_sha}` if already stored from select-pr step.
|
|
34
47
|
|
|
@@ -47,8 +60,8 @@ Sort by modification time, take the most recent.
|
|
|
47
60
|
### 4. Parse All Findings
|
|
48
61
|
|
|
49
62
|
Scan the report and extract every finding:
|
|
50
|
-
- `severity`: ๐ด Blocker / ๐ก Warning / ๐ข Suggestion / ๐ Question
|
|
51
|
-
- `category`: security / performance / architecture / general
|
|
63
|
+
- `severity`: ๐ด Blocker / ๐ก Warning / ๐ข Suggestion / โ Question (also accept ๐ as alias for Question)
|
|
64
|
+
- `category`: security / performance / architecture / general / business
|
|
52
65
|
- `file_path`: relative path (e.g. `src/auth/login.js`) โ null if not specified
|
|
53
66
|
- `line_number`: integer โ null if not specified
|
|
54
67
|
- `description`: the issue text
|
|
@@ -82,14 +95,14 @@ Limit inline comments to 30 max: include all ๐ด Blockers first, then ๐ก Warn
|
|
|
82
95
|
{suggested_fix}
|
|
83
96
|
```
|
|
84
97
|
|
|
85
|
-
Category emojis: ๐ security ยท โก performance ยท ๐๏ธ architecture ยท ๐๏ธ general
|
|
98
|
+
Category emojis: ๐ security ยท โก performance ยท ๐๏ธ architecture ยท ๐๏ธ general ยท ๐ผ business
|
|
86
99
|
|
|
87
100
|
### 6. Build Summary Body
|
|
88
101
|
|
|
89
102
|
```markdown
|
|
90
103
|
## ๐ AI Code Review
|
|
91
104
|
|
|
92
|
-
**PR:** `{
|
|
105
|
+
**PR:** `{target_branch}` โ `{base_branch}` | **Date:** {date} | **Reviewer:** {user_name}
|
|
93
106
|
|
|
94
107
|
**Verdict:** {verdict}
|
|
95
108
|
|
|
@@ -99,12 +112,15 @@ Category emojis: ๐ security ยท โก performance ยท ๐๏ธ architecture ยท
|
|
|
99
112
|
| โก Performance | {n} | {n} | {n} |
|
|
100
113
|
| ๐๏ธ Architecture | {n} | {n} | {n} |
|
|
101
114
|
| ๐๏ธ General | {n} | {n} | {n} |
|
|
115
|
+
| ๐ผ Business | {n} | {n} | {n} |
|
|
102
116
|
|
|
103
117
|
### Executive Summary
|
|
104
118
|
{bullets}
|
|
105
119
|
|
|
106
120
|
{fallback_findings_section}
|
|
107
121
|
|
|
122
|
+
โ {question_count} questions for author
|
|
123
|
+
|
|
108
124
|
---
|
|
109
125
|
*{inline_count} inline comments on code lines*
|
|
110
126
|
```
|
|
@@ -113,7 +129,86 @@ Verdict logic: any ๐ด โ `REQUEST_CHANGES` / only ๐ก โ `COMMENT` / none
|
|
|
113
129
|
|
|
114
130
|
### 7. Build Platform Payload
|
|
115
131
|
|
|
116
|
-
|
|
132
|
+
**โ ๏ธ CRITICAL โ Use Write tool + runtime script. NEVER use bash heredoc.**
|
|
133
|
+
|
|
134
|
+
Bash heredoc breaks with Unicode characters, emojis, backticks, and nested quotes โ all of which appear in review comment bodies. The only reliable approach is:
|
|
135
|
+
|
|
136
|
+
1. **Write** the build script to `{temp_dir}/build-payload.mjs` using the Write tool
|
|
137
|
+
2. **Execute** it with `node`
|
|
138
|
+
3. Script writes the final JSON to `{temp_dir}/prr-payload.json`
|
|
139
|
+
|
|
140
|
+
**Step A โ Detect available runtime:**
|
|
141
|
+
```bash
|
|
142
|
+
node --version 2>/dev/null && echo "use-node" || (python3 --version 2>/dev/null && echo "use-python3") || echo "no-runtime"
|
|
143
|
+
```
|
|
144
|
+
Prefer `node`. Fallback: `python3`, then `python`.
|
|
145
|
+
|
|
146
|
+
**Step B โ Write the build script using the Write tool** (NOT echo/heredoc/Bash):
|
|
147
|
+
|
|
148
|
+
Use the Write tool to create `{temp_dir}/build-payload.mjs` (Node.js) or `{temp_dir}/build-payload.py` (Python).
|
|
149
|
+
|
|
150
|
+
The script must:
|
|
151
|
+
- Define all string values (comment bodies, summary) as native string variables โ no manual JSON escaping needed, the runtime handles it
|
|
152
|
+
- Build the payload object in memory
|
|
153
|
+
- Write to `{temp_dir}/prr-payload.json` using native JSON serialization:
|
|
154
|
+
- Node.js: `JSON.stringify(payload, null, 2)`
|
|
155
|
+
- Python: `json.dumps(payload, ensure_ascii=False, indent=2)`
|
|
156
|
+
|
|
157
|
+
**Node.js template** (`build-payload.mjs`):
|
|
158
|
+
```js
|
|
159
|
+
import { writeFileSync } from 'fs'
|
|
160
|
+
|
|
161
|
+
const payload = {
|
|
162
|
+
commit_id: "COMMIT_SHA",
|
|
163
|
+
body: "SUMMARY BODY โ full markdown here, no escaping needed",
|
|
164
|
+
event: "REQUEST_CHANGES", // or "COMMENT" or "APPROVE"
|
|
165
|
+
comments: [
|
|
166
|
+
{ path: "src/file.js", line: 42, side: "RIGHT", body: "๐ด **[BLOCKER]** ..." },
|
|
167
|
+
// ... more comments
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
writeFileSync("{temp_dir}/prr-payload.json", JSON.stringify(payload, null, 2), "utf-8")
|
|
172
|
+
console.log(`OK: ${payload.comments.length} comments`)
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Python template** (`build-payload.py`):
|
|
176
|
+
```python
|
|
177
|
+
import json
|
|
178
|
+
|
|
179
|
+
payload = {
|
|
180
|
+
"commit_id": "COMMIT_SHA",
|
|
181
|
+
"body": "SUMMARY BODY",
|
|
182
|
+
"event": "REQUEST_CHANGES",
|
|
183
|
+
"comments": [
|
|
184
|
+
{"path": "src/file.js", "line": 42, "side": "RIGHT", "body": "๐ด **[BLOCKER]** ..."},
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
with open("{temp_dir}/prr-payload.json", "w", encoding="utf-8") as f:
|
|
189
|
+
json.dump(payload, f, ensure_ascii=False, indent=2)
|
|
190
|
+
print(f"OK: {len(payload['comments'])} comments")
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**Step C โ Execute:**
|
|
194
|
+
```bash
|
|
195
|
+
node "{temp_dir}/build-payload.mjs"
|
|
196
|
+
# or: python3 "{temp_dir}/build-payload.py"
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Step D โ Verify output (optional sanity check):**
|
|
200
|
+
```bash
|
|
201
|
+
# Node.js
|
|
202
|
+
node -e "const p=require('{temp_dir}/prr-payload.json'); console.log('OK:', p.comments.length, 'comments')"
|
|
203
|
+
# Python
|
|
204
|
+
python3 -c "import json; p=json.load(open('{temp_dir}/prr-payload.json')); print('OK:', len(p['comments']), 'comments')"
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
**Payload schema reference:**
|
|
210
|
+
|
|
211
|
+
**GitHub** โ `{temp_dir}/prr-payload.json`:
|
|
117
212
|
```json
|
|
118
213
|
{
|
|
119
214
|
"commit_id": "{commit_sha}",
|
|
@@ -124,17 +219,15 @@ Verdict logic: any ๐ด โ `REQUEST_CHANGES` / only ๐ก โ `COMMENT` / none
|
|
|
124
219
|
]
|
|
125
220
|
}
|
|
126
221
|
```
|
|
127
|
-
Write to `{review_output}/.prr-payload.json`.
|
|
128
222
|
|
|
129
|
-
**GitLab** โ
|
|
223
|
+
**GitLab** โ one file per comment `{temp_dir}/prr-payload-{n}.json` + `{temp_dir}/prr-summary.md`:
|
|
130
224
|
```json
|
|
131
225
|
{ "body": "{body}", "position": { "base_sha": "{base_sha}", "head_sha": "{commit_sha}",
|
|
132
226
|
"start_sha": "{base_sha}", "position_type": "text",
|
|
133
227
|
"new_path": "{file_path}", "new_line": {line_number} } }
|
|
134
228
|
```
|
|
135
|
-
Write each as `{review_output}/.prr-payload-{n}.json`. Write summary as `.prr-summary.md`.
|
|
136
229
|
|
|
137
|
-
**Azure DevOps** โ thread per
|
|
230
|
+
**Azure DevOps** โ `{temp_dir}/prr-thread-{n}.json` per comment:
|
|
138
231
|
```json
|
|
139
232
|
{ "comments": [{ "parentCommentId": 0, "content": "{body}", "commentType": 1 }],
|
|
140
233
|
"threadContext": { "filePath": "{file_path}",
|
|
@@ -142,14 +235,12 @@ Write each as `{review_output}/.prr-payload-{n}.json`. Write summary as `.prr-su
|
|
|
142
235
|
"rightFileEnd": { "line": {line_number}, "offset": 1 } },
|
|
143
236
|
"status": "active" }
|
|
144
237
|
```
|
|
145
|
-
Write each as `{review_output}/.prr-thread-{n}.json`.
|
|
146
238
|
|
|
147
|
-
**Bitbucket** โ
|
|
239
|
+
**Bitbucket** โ `{temp_dir}/prr-bb-{n}.json` per comment:
|
|
148
240
|
```json
|
|
149
241
|
{ "content": { "raw": "{body}" },
|
|
150
242
|
"inline": { "to": {line_number}, "path": "{file_path}" } }
|
|
151
243
|
```
|
|
152
|
-
Write each as `{review_output}/.prr-bb-{n}.json`.
|
|
153
244
|
|
|
154
245
|
### 8. Display Preview
|
|
155
246
|
|