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.
Files changed (173) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +260 -235
  3. package/docs/assets/banner.svg +33 -165
  4. package/docs/assets/how-it-works.svg +87 -0
  5. package/package.json +60 -60
  6. package/src/core/agents/prr-master.agent.yaml +18 -7
  7. package/src/core/tasks/clear.md +140 -0
  8. package/src/core/tasks/help.md +15 -13
  9. package/src/core/workflows/clear/workflow.md +6 -0
  10. package/src/core/workflows/help/workflow.md +6 -0
  11. package/src/core/workflows/party-mode/steps/step-01-load-reviewers.md +35 -24
  12. package/src/core/workflows/party-mode/steps/step-02-discussion.md +45 -25
  13. package/src/core/workflows/party-mode/workflow.md +2 -2
  14. package/src/prr/agents/architecture-reviewer.agent.yaml +65 -45
  15. package/src/prr/agents/business-reviewer.agent.yaml +66 -0
  16. package/src/prr/agents/general-reviewer.agent.yaml +64 -48
  17. package/src/prr/agents/performance-reviewer.agent.yaml +65 -45
  18. package/src/prr/agents/security-reviewer.agent.yaml +67 -43
  19. package/src/prr/config-template.yaml +97 -0
  20. package/src/prr/data/stacks/actix.md +55 -0
  21. package/src/prr/data/stacks/alpine.md +47 -0
  22. package/src/prr/data/stacks/android.md +53 -0
  23. package/src/prr/data/stacks/angular.md +96 -0
  24. package/src/prr/data/stacks/ansible.md +55 -0
  25. package/src/prr/data/stacks/apollo.md +54 -0
  26. package/src/prr/data/stacks/astro.md +48 -0
  27. package/src/prr/data/stacks/aws-cdk.md +55 -0
  28. package/src/prr/data/stacks/axum.md +56 -0
  29. package/src/prr/data/stacks/babylonjs.md +55 -0
  30. package/src/prr/data/stacks/bash.md +53 -0
  31. package/src/prr/data/stacks/bevy.md +53 -0
  32. package/src/prr/data/stacks/bootstrap.md +52 -0
  33. package/src/prr/data/stacks/bun.md +55 -0
  34. package/src/prr/data/stacks/cpp.md +57 -0
  35. package/src/prr/data/stacks/csharp.md +95 -0
  36. package/src/prr/data/stacks/css.md +55 -0
  37. package/src/prr/data/stacks/cypress.md +53 -0
  38. package/src/prr/data/stacks/d3.md +53 -0
  39. package/src/prr/data/stacks/deno.md +49 -0
  40. package/src/prr/data/stacks/django.md +92 -0
  41. package/src/prr/data/stacks/docker.md +79 -0
  42. package/src/prr/data/stacks/drizzle.md +54 -0
  43. package/src/prr/data/stacks/dynamodb.md +55 -0
  44. package/src/prr/data/stacks/electron.md +44 -0
  45. package/src/prr/data/stacks/elixir.md +53 -0
  46. package/src/prr/data/stacks/expo.md +53 -0
  47. package/src/prr/data/stacks/expressjs.md +82 -0
  48. package/src/prr/data/stacks/fastapi.md +88 -0
  49. package/src/prr/data/stacks/fastify.md +60 -0
  50. package/src/prr/data/stacks/fiber.md +55 -0
  51. package/src/prr/data/stacks/firebase.md +43 -0
  52. package/src/prr/data/stacks/flask.md +46 -0
  53. package/src/prr/data/stacks/flutter.md +75 -0
  54. package/src/prr/data/stacks/gin.md +57 -0
  55. package/src/prr/data/stacks/github-actions.md +71 -0
  56. package/src/prr/data/stacks/go.md +88 -0
  57. package/src/prr/data/stacks/godot.md +56 -0
  58. package/src/prr/data/stacks/graphql.md +76 -0
  59. package/src/prr/data/stacks/grpc.md +56 -0
  60. package/src/prr/data/stacks/haskell.md +48 -0
  61. package/src/prr/data/stacks/helm.md +54 -0
  62. package/src/prr/data/stacks/hono.md +54 -0
  63. package/src/prr/data/stacks/htmx.md +38 -0
  64. package/src/prr/data/stacks/java.md +87 -0
  65. package/src/prr/data/stacks/jest-vitest.md +87 -0
  66. package/src/prr/data/stacks/jquery.md +50 -0
  67. package/src/prr/data/stacks/junit.md +53 -0
  68. package/src/prr/data/stacks/kotlin.md +89 -0
  69. package/src/prr/data/stacks/kubernetes.md +148 -0
  70. package/src/prr/data/stacks/langchain.md +56 -0
  71. package/src/prr/data/stacks/laravel.md +56 -0
  72. package/src/prr/data/stacks/libgdx.md +46 -0
  73. package/src/prr/data/stacks/lit.md +49 -0
  74. package/src/prr/data/stacks/love2d.md +51 -0
  75. package/src/prr/data/stacks/lua.md +51 -0
  76. package/src/prr/data/stacks/mobx.md +54 -0
  77. package/src/prr/data/stacks/mongodb.md +85 -0
  78. package/src/prr/data/stacks/monogame.md +51 -0
  79. package/src/prr/data/stacks/mysql.md +57 -0
  80. package/src/prr/data/stacks/nestjs.md +95 -0
  81. package/src/prr/data/stacks/nextjs.md +88 -0
  82. package/src/prr/data/stacks/nginx.md +55 -0
  83. package/src/prr/data/stacks/node.md +56 -0
  84. package/src/prr/data/stacks/nuxtjs.md +91 -0
  85. package/src/prr/data/stacks/openai-api.md +54 -0
  86. package/src/prr/data/stacks/opengl.md +54 -0
  87. package/src/prr/data/stacks/phaser.md +54 -0
  88. package/src/prr/data/stacks/phoenix.md +55 -0
  89. package/src/prr/data/stacks/php.md +56 -0
  90. package/src/prr/data/stacks/playwright.md +86 -0
  91. package/src/prr/data/stacks/postgresql.md +60 -0
  92. package/src/prr/data/stacks/prisma.md +81 -0
  93. package/src/prr/data/stacks/pygame.md +52 -0
  94. package/src/prr/data/stacks/pytest.md +53 -0
  95. package/src/prr/data/stacks/python.md +94 -0
  96. package/src/prr/data/stacks/pytorch.md +54 -0
  97. package/src/prr/data/stacks/qwik.md +50 -0
  98. package/src/prr/data/stacks/rails.md +48 -0
  99. package/src/prr/data/stacks/react-native.md +77 -0
  100. package/src/prr/data/stacks/react.md +104 -0
  101. package/src/prr/data/stacks/redis.md +76 -0
  102. package/src/prr/data/stacks/redux.md +107 -0
  103. package/src/prr/data/stacks/remix.md +51 -0
  104. package/src/prr/data/stacks/rust.md +88 -0
  105. package/src/prr/data/stacks/sass.md +51 -0
  106. package/src/prr/data/stacks/scala.md +50 -0
  107. package/src/prr/data/stacks/scikit-learn.md +53 -0
  108. package/src/prr/data/stacks/sequelize.md +54 -0
  109. package/src/prr/data/stacks/socket-io.md +54 -0
  110. package/src/prr/data/stacks/solidity.md +53 -0
  111. package/src/prr/data/stacks/solidjs.md +45 -0
  112. package/src/prr/data/stacks/spring-boot.md +92 -0
  113. package/src/prr/data/stacks/sql.md +85 -0
  114. package/src/prr/data/stacks/sqlite.md +55 -0
  115. package/src/prr/data/stacks/styled-components.md +51 -0
  116. package/src/prr/data/stacks/supabase.md +57 -0
  117. package/src/prr/data/stacks/svelte.md +77 -0
  118. package/src/prr/data/stacks/sveltekit.md +54 -0
  119. package/src/prr/data/stacks/swift.md +61 -0
  120. package/src/prr/data/stacks/tailwindcss.md +10 -0
  121. package/src/prr/data/stacks/tanstack-query.md +48 -0
  122. package/src/prr/data/stacks/tauri.md +52 -0
  123. package/src/prr/data/stacks/terraform.md +53 -0
  124. package/src/prr/data/stacks/three.md +53 -0
  125. package/src/prr/data/stacks/trpc.md +49 -0
  126. package/src/prr/data/stacks/typeorm.md +40 -0
  127. package/src/prr/data/stacks/typescript.md +83 -0
  128. package/src/prr/data/stacks/unity.md +61 -0
  129. package/src/prr/data/stacks/unreal.md +58 -0
  130. package/src/prr/data/stacks/vite.md +48 -0
  131. package/src/prr/data/stacks/vue3.md +95 -0
  132. package/src/prr/data/stacks/vulkan.md +53 -0
  133. package/src/prr/data/stacks/wasm.md +49 -0
  134. package/src/prr/data/stacks/webpack.md +48 -0
  135. package/src/prr/data/stacks/zig.md +51 -0
  136. package/src/prr/data/stacks/zustand.md +56 -0
  137. package/src/prr/workflows/1-discover/select-pr/steps/step-05-confirm.md +1 -0
  138. package/src/prr/workflows/1-discover/select-pr/workflow.md +1 -1
  139. package/src/prr/workflows/2-analyze/collect-pr-context/steps/step-01-analyze-files.md +334 -0
  140. package/src/prr/workflows/2-analyze/collect-pr-context/steps/step-02-collect-sources.md +451 -0
  141. package/src/prr/workflows/2-analyze/collect-pr-context/steps/step-03-build-knowledge-base.md +337 -0
  142. package/src/prr/workflows/2-analyze/collect-pr-context/workflow.md +123 -0
  143. package/src/prr/workflows/2-analyze/describe-pr/steps/step-02-classify.md +12 -6
  144. package/src/prr/workflows/2-analyze/describe-pr/steps/step-03-walkthrough.md +59 -1
  145. package/src/prr/workflows/3-review/architecture-review/checklist.md +4 -0
  146. package/src/prr/workflows/3-review/architecture-review/instructions.xml +32 -4
  147. package/src/prr/workflows/3-review/architecture-review/workflow.yaml +17 -18
  148. package/src/prr/workflows/3-review/business-review/checklist.md +27 -0
  149. package/src/prr/workflows/3-review/business-review/instructions.xml +153 -0
  150. package/src/prr/workflows/3-review/business-review/workflow.yaml +17 -0
  151. package/src/prr/workflows/3-review/general-review/checklist.md +5 -1
  152. package/src/prr/workflows/3-review/general-review/instructions.xml +39 -8
  153. package/src/prr/workflows/3-review/general-review/workflow.yaml +17 -18
  154. package/src/prr/workflows/3-review/performance-review/checklist.md +3 -1
  155. package/src/prr/workflows/3-review/performance-review/instructions.xml +10 -3
  156. package/src/prr/workflows/3-review/performance-review/workflow.yaml +17 -18
  157. package/src/prr/workflows/3-review/security-review/checklist.md +2 -1
  158. package/src/prr/workflows/3-review/security-review/instructions.xml +8 -3
  159. package/src/prr/workflows/3-review/security-review/workflow.yaml +18 -19
  160. package/src/prr/workflows/4-improve/improve-code/workflow.yaml +17 -18
  161. package/src/prr/workflows/6-report/generate-report/steps/step-01-collect.md +9 -2
  162. package/src/prr/workflows/6-report/generate-report/steps/step-02-organize.md +28 -7
  163. package/src/prr/workflows/6-report/generate-report/steps/step-03-write.md +6 -4
  164. package/src/prr/workflows/6-report/generate-report/templates/review-report.template.md +124 -78
  165. package/src/prr/workflows/6-report/post-comments/steps/step-01-format.md +104 -13
  166. package/src/prr/workflows/6-report/post-comments/steps/step-02-post.md +92 -21
  167. package/src/prr/workflows/6-report/post-comments/workflow.md +6 -0
  168. package/src/prr/workflows/quick/workflow.md +138 -32
  169. package/src/prr/workflows/0-setup/collect-project-context/steps/step-01-scan-configs.md +0 -106
  170. package/src/prr/workflows/0-setup/collect-project-context/steps/step-02-extract-rules.md +0 -131
  171. package/src/prr/workflows/0-setup/collect-project-context/steps/step-03-ask-context.md +0 -194
  172. package/src/prr/workflows/0-setup/collect-project-context/steps/step-04-save-context.md +0 -161
  173. 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/Critical โ†’ ๐ŸŸก Warnings/High โ†’ ๐ŸŸก Medium โ†’ ๐ŸŸข Suggestions/Low โ†’ ๐Ÿ“Œ Questions
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 3-5 bullet points summarizing the overall review:
27
- - Overall quality assessment (1 sentence)
28
- - Highest priority issues to address
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
- ### 4. Identify Files with Multiple Issues
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
- ### 5. Load Next Step
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-report-{pr_branch}-{date}.md"
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 overall verdict
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: {outputFile}
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}}**GitHub PR #{{pr_number}}** | {{/if}}**Date:** {{date}} | **Reviewer:** {{user_name}}
16
-
17
- ---
18
-
19
- ## Executive Summary
20
-
21
- {{executive_summary}}
22
-
23
- **Verdict:** {{verdict}}
24
-
25
- | Category | ๐Ÿ”ด Blockers | ๐ŸŸก Warnings | ๐ŸŸข Suggestions |
26
- |----------|------------|------------|----------------|
27
- | ๐Ÿ”’ Security | {{security_blockers}} | {{security_warnings}} | {{security_suggestions}} |
28
- | โšก Performance | {{perf_blockers}} | {{perf_warnings}} | {{perf_suggestions}} |
29
- | ๐Ÿ—๏ธ Architecture | {{arch_blockers}} | {{arch_warnings}} | {{arch_suggestions}} |
30
- | ๐Ÿ‘๏ธ General | {{general_blockers}} | {{general_warnings}} | {{general_suggestions}} |
31
- | **Total** | **{{total_blockers}}** | **{{total_warnings}}** | **{{total_suggestions}}** |
32
-
33
- ---
34
-
35
- ## ๐Ÿ”ด Blockers โ€” Must Fix Before Merge
36
-
37
- {{blockers_section}}
38
-
39
- ---
40
-
41
- ## ๐ŸŸก Warnings โ€” Should Fix
42
-
43
- {{warnings_section}}
44
-
45
- ---
46
-
47
- ## ๐ŸŸข Suggestions โ€” Nice to Have
48
-
49
- {{suggestions_section}}
50
-
51
- ---
52
-
53
- ## ๐Ÿ“Œ Questions for Author
54
-
55
- {{questions_section}}
56
-
57
- ---
58
-
59
- ## ๐Ÿ’ก Code Improvement Suggestions
60
-
61
- {{improvements_section}}
62
-
63
- ---
64
-
65
- ## Files with Multiple Issues
66
-
67
- {{files_with_issues}}
68
-
69
- ---
70
-
71
- ## โœ… Positive Observations
72
-
73
- {{positive_observations}}
74
-
75
- ---
76
-
77
- *Generated by PR Review Kit*
78
- *Reviews completed: {{reviews_completed}}*
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/{selected_branch}
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:** `{selected_branch}` โ†’ `{base_branch}` | **Date:** {date} | **Reviewer:** {user_name}
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
- **GitHub** โ€” single JSON file for Reviews API:
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** โ€” separate JSON per inline comment:
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 inline comment:
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** โ€” inline comment per finding:
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