prr-kit 2.0.0 → 2.0.2
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 +4 -10
- package/package.json +1 -1
- package/src/prr/config-template.yaml +0 -5
- package/src/prr/module.yaml +0 -15
- package/src/prr/workflows/1-discover/select-pr/steps/step-01-fetch.md +1 -1
- package/src/prr/workflows/1-discover/select-pr/steps/step-05-confirm.md +1 -1
- package/src/prr/workflows/1-discover/select-pr/workflow.md +4 -2
- package/src/prr/workflows/3-review/architecture-review/workflow.yaml +18 -18
- package/src/prr/workflows/3-review/business-review/workflow.yaml +18 -18
- package/src/prr/workflows/3-review/general-review/workflow.yaml +18 -18
- package/src/prr/workflows/3-review/performance-review/workflow.yaml +18 -18
- package/src/prr/workflows/3-review/security-review/workflow.yaml +19 -19
- package/src/prr/workflows/4-improve/improve-code/workflow.yaml +18 -18
- package/src/prr/workflows/6-report/post-comments/workflow.md +1 -2
- package/src/prr/workflows/quick/workflow.md +66 -19
- package/tools/cli/installers/lib/core/config-collector.js +0 -3
- package/tools/cli/installers/lib/ide/github-copilot.js +1 -1
package/README.md
CHANGED
|
@@ -178,7 +178,7 @@ The framework installs into your project as a `_prr/` folder. Agents and workflo
|
|
|
178
178
|
|
|
179
179
|
## Configuration
|
|
180
180
|
|
|
181
|
-
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,
|
|
181
|
+
The installer handles configuration interactively — no manual file editing required. During `npx prr-kit install`, you'll be prompted for your name, language, and output folder. Platform, repo, and target directory are auto-detected from your git remote.
|
|
182
182
|
|
|
183
183
|
All values are written to `_prr/prr/config.yaml`. Full schema overview:
|
|
184
184
|
|
|
@@ -189,12 +189,6 @@ communication_language: English # Any language: English | Vietnamese | Ja
|
|
|
189
189
|
|
|
190
190
|
# ─── Project ───────────────────────────────────────────────────────────────
|
|
191
191
|
project_name: my-project # Display name in reports (cosmetic only)
|
|
192
|
-
target_repo: . # Path to git repo (. = current dir, or ../other-repo)
|
|
193
|
-
|
|
194
|
-
# ─── Platform ──────────────────────────────────────────────────────────────
|
|
195
|
-
platform: auto # auto | github | gitlab | azure | bitbucket | none
|
|
196
|
-
platform_repo: "owner/repo" # owner/repo slug — required for PR listing + inline comments
|
|
197
|
-
# leave blank for local-only mode (git diff only)
|
|
198
192
|
|
|
199
193
|
# ─── Output ────────────────────────────────────────────────────────────────
|
|
200
194
|
review_output: ./_prr-output/reviews # Where review reports + context files are written
|
|
@@ -297,14 +291,14 @@ Pauses **twice** for user input: once to select the PR/branch, once for review i
|
|
|
297
291
|
|
|
298
292
|
### Selecting a PR (SP step)
|
|
299
293
|
|
|
300
|
-
**
|
|
294
|
+
**When platform is detected** — lists open PRs/MRs via platform CLI:
|
|
301
295
|
```
|
|
302
296
|
#45 "Add OAuth2 login" feature/oauth → main @alice 3h ago
|
|
303
297
|
#44 "Fix memory leak" fix/memory → main @bob 1d ago
|
|
304
298
|
```
|
|
305
299
|
Enter PR number → base and head resolved automatically.
|
|
306
300
|
|
|
307
|
-
**
|
|
301
|
+
**When no platform detected (local mode)** — asks explicitly for both branches:
|
|
308
302
|
```
|
|
309
303
|
🎯 Head branch (the branch to review)?
|
|
310
304
|
• Enter a number from the list (e.g., 1)
|
|
@@ -365,7 +359,7 @@ Either way, the agent pauses once for your instructions before building the know
|
|
|
365
359
|
|
|
366
360
|
## Inline Code Comments
|
|
367
361
|
|
|
368
|
-
When `[PC] Post Comments` is run
|
|
362
|
+
When `[PC] Post Comments` is run, it posts findings as **inline code comments** on the exact file and line — the same experience as a human reviewer. Platform and repo are auto-detected from your git remote.
|
|
369
363
|
|
|
370
364
|
| Platform | Method | Required CLI |
|
|
371
365
|
|----------|--------|-------------|
|
package/package.json
CHANGED
|
@@ -7,11 +7,6 @@ communication_language: English # Language for all review output
|
|
|
7
7
|
|
|
8
8
|
# ─── Project ───────────────────────────────────────────────────────────────
|
|
9
9
|
project_name: my-project
|
|
10
|
-
target_repo: . # Path to git repo (. = current directory)
|
|
11
|
-
|
|
12
|
-
# ─── Platform ──────────────────────────────────────────────────────────────
|
|
13
|
-
platform: github # auto | github | gitlab | azure | bitbucket | none
|
|
14
|
-
platform_repo: "org/repo-name" # Used for gh pr list, gh pr view, etc.
|
|
15
10
|
|
|
16
11
|
# ─── Output ────────────────────────────────────────────────────────────────
|
|
17
12
|
review_output: ./_prr-output/reviews # Where review reports are written
|
package/src/prr/module.yaml
CHANGED
|
@@ -13,21 +13,6 @@ project_name:
|
|
|
13
13
|
default: "{directory_name}"
|
|
14
14
|
result: "{value}"
|
|
15
15
|
|
|
16
|
-
target_repo:
|
|
17
|
-
prompt: "Path to the git repository to review? (relative or absolute, default: current directory)"
|
|
18
|
-
default: "."
|
|
19
|
-
result: "{value}"
|
|
20
|
-
|
|
21
|
-
platform:
|
|
22
|
-
prompt: "Git platform? (auto-detect, github, gitlab, azure, bitbucket, none)"
|
|
23
|
-
default: "auto"
|
|
24
|
-
result: "{value}"
|
|
25
|
-
|
|
26
|
-
platform_repo:
|
|
27
|
-
prompt: "Repository identifier for posting comments? Format: owner/repo (GitHub/GitLab/Bitbucket) or org/project/repo (Azure). Leave blank to skip."
|
|
28
|
-
default: ""
|
|
29
|
-
result: "{value}"
|
|
30
|
-
|
|
31
16
|
review_output:
|
|
32
17
|
prompt: "Where should review reports be stored?"
|
|
33
18
|
default: "{output_folder}/reviews"
|
|
@@ -46,7 +46,7 @@ mkdir -p "{session_output}"
|
|
|
46
46
|
**Store in working context** — all subsequent workflows in this session will use these values:
|
|
47
47
|
- `session_output` = computed above
|
|
48
48
|
- `target_branch` = `selected_branch` ← canonical name used by all downstream workflows
|
|
49
|
-
- `base_branch`, `diff_range`, `pr_number`, `pr_title`, `pr_author`, `pr_body`, `pr_head_sha`, `active_platform`, `
|
|
49
|
+
- `base_branch`, `diff_range`, `pr_number`, `pr_title`, `pr_author`, `pr_body`, `pr_head_sha`, `active_platform`, `active_platform_repo` = from step 3
|
|
50
50
|
|
|
51
51
|
### 0b. Generate Diffs Folder
|
|
52
52
|
|
|
@@ -28,8 +28,10 @@ This uses **step-file architecture** with sequential orchestration:
|
|
|
28
28
|
## INITIALIZATION
|
|
29
29
|
|
|
30
30
|
Load config from `{main_config}` and resolve:
|
|
31
|
-
- `project_name`, `
|
|
32
|
-
- `review_output`, `
|
|
31
|
+
- `project_name`, `user_name`, `communication_language`
|
|
32
|
+
- `review_output`, `date` (system-generated)
|
|
33
|
+
|
|
34
|
+
Set `target_repo` = `.` (the repository containing this config file).
|
|
33
35
|
|
|
34
36
|
## EXECUTION
|
|
35
37
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
name: architecture-review
|
|
2
|
-
description: "Architecture-focused review: SOLID principles, layering, coupling, codebase consistency, etc. — adapted to your architecture"
|
|
3
|
-
author: "PR Review Kit"
|
|
4
|
-
|
|
5
|
-
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
6
|
-
user_name: "{config_source}:user_name"
|
|
7
|
-
communication_language: "{config_source}:communication_language"
|
|
8
|
-
target_repo: "
|
|
9
|
-
review_output: "{config_source}:review_output"
|
|
10
|
-
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
11
|
-
date: system-generated
|
|
12
|
-
|
|
13
|
-
installed_path: "{project-root}/_prr/prr/workflows/3-review/architecture-review"
|
|
14
|
-
instructions: "{installed_path}/instructions.xml"
|
|
15
|
-
validation: "{installed_path}/checklist.md"
|
|
16
|
-
|
|
17
|
-
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
18
|
-
output_file: "{session_output}/architecture-review.md"
|
|
1
|
+
name: architecture-review
|
|
2
|
+
description: "Architecture-focused review: SOLID principles, layering, coupling, codebase consistency, etc. — adapted to your architecture"
|
|
3
|
+
author: "PR Review Kit"
|
|
4
|
+
|
|
5
|
+
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
6
|
+
user_name: "{config_source}:user_name"
|
|
7
|
+
communication_language: "{config_source}:communication_language"
|
|
8
|
+
target_repo: "."
|
|
9
|
+
review_output: "{config_source}:review_output"
|
|
10
|
+
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
11
|
+
date: system-generated
|
|
12
|
+
|
|
13
|
+
installed_path: "{project-root}/_prr/prr/workflows/3-review/architecture-review"
|
|
14
|
+
instructions: "{installed_path}/instructions.xml"
|
|
15
|
+
validation: "{installed_path}/checklist.md"
|
|
16
|
+
|
|
17
|
+
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
18
|
+
output_file: "{session_output}/architecture-review.md"
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
name: business-review
|
|
2
|
-
description: "Business impact review: user impact, business risk, feature completeness, data safety, observability — adapted to your project"
|
|
3
|
-
author: "PR Review Kit"
|
|
4
|
-
|
|
5
|
-
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
6
|
-
user_name: "{config_source}:user_name"
|
|
7
|
-
communication_language: "{config_source}:communication_language"
|
|
8
|
-
target_repo: "
|
|
9
|
-
review_output: "{config_source}:review_output"
|
|
10
|
-
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
11
|
-
date: system-generated
|
|
12
|
-
|
|
13
|
-
installed_path: "{project-root}/_prr/prr/workflows/3-review/business-review"
|
|
14
|
-
instructions: "{installed_path}/instructions.xml"
|
|
15
|
-
validation: "{installed_path}/checklist.md"
|
|
16
|
-
|
|
17
|
-
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base,pr_type,completed_reviews"
|
|
18
|
-
output_file: "{session_output}/business-review.md"
|
|
1
|
+
name: business-review
|
|
2
|
+
description: "Business impact review: user impact, business risk, feature completeness, data safety, observability — adapted to your project"
|
|
3
|
+
author: "PR Review Kit"
|
|
4
|
+
|
|
5
|
+
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
6
|
+
user_name: "{config_source}:user_name"
|
|
7
|
+
communication_language: "{config_source}:communication_language"
|
|
8
|
+
target_repo: "."
|
|
9
|
+
review_output: "{config_source}:review_output"
|
|
10
|
+
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
11
|
+
date: system-generated
|
|
12
|
+
|
|
13
|
+
installed_path: "{project-root}/_prr/prr/workflows/3-review/business-review"
|
|
14
|
+
instructions: "{installed_path}/instructions.xml"
|
|
15
|
+
validation: "{installed_path}/checklist.md"
|
|
16
|
+
|
|
17
|
+
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base,pr_type,completed_reviews"
|
|
18
|
+
output_file: "{session_output}/business-review.md"
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
name: general-review
|
|
2
|
-
description: "General code quality review: logic, naming, readability, error handling, DRY, test coverage, etc. — adapted to your stack"
|
|
3
|
-
author: "PR Review Kit"
|
|
4
|
-
|
|
5
|
-
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
6
|
-
user_name: "{config_source}:user_name"
|
|
7
|
-
communication_language: "{config_source}:communication_language"
|
|
8
|
-
target_repo: "
|
|
9
|
-
review_output: "{config_source}:review_output"
|
|
10
|
-
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
11
|
-
date: system-generated
|
|
12
|
-
|
|
13
|
-
installed_path: "{project-root}/_prr/prr/workflows/3-review/general-review"
|
|
14
|
-
instructions: "{installed_path}/instructions.xml"
|
|
15
|
-
validation: "{installed_path}/checklist.md"
|
|
16
|
-
|
|
17
|
-
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
18
|
-
output_file: "{session_output}/general-review.md"
|
|
1
|
+
name: general-review
|
|
2
|
+
description: "General code quality review: logic, naming, readability, error handling, DRY, test coverage, etc. — adapted to your stack"
|
|
3
|
+
author: "PR Review Kit"
|
|
4
|
+
|
|
5
|
+
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
6
|
+
user_name: "{config_source}:user_name"
|
|
7
|
+
communication_language: "{config_source}:communication_language"
|
|
8
|
+
target_repo: "."
|
|
9
|
+
review_output: "{config_source}:review_output"
|
|
10
|
+
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
11
|
+
date: system-generated
|
|
12
|
+
|
|
13
|
+
installed_path: "{project-root}/_prr/prr/workflows/3-review/general-review"
|
|
14
|
+
instructions: "{installed_path}/instructions.xml"
|
|
15
|
+
validation: "{installed_path}/checklist.md"
|
|
16
|
+
|
|
17
|
+
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
18
|
+
output_file: "{session_output}/general-review.md"
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
name: performance-review
|
|
2
|
-
description: "Performance-focused code review: N+1 queries, memory leaks, async patterns, bundle size, caching, etc. — adapted to your stack"
|
|
3
|
-
author: "PR Review Kit"
|
|
4
|
-
|
|
5
|
-
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
6
|
-
user_name: "{config_source}:user_name"
|
|
7
|
-
communication_language: "{config_source}:communication_language"
|
|
8
|
-
target_repo: "
|
|
9
|
-
review_output: "{config_source}:review_output"
|
|
10
|
-
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
11
|
-
date: system-generated
|
|
12
|
-
|
|
13
|
-
installed_path: "{project-root}/_prr/prr/workflows/3-review/performance-review"
|
|
14
|
-
instructions: "{installed_path}/instructions.xml"
|
|
15
|
-
validation: "{installed_path}/checklist.md"
|
|
16
|
-
|
|
17
|
-
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
18
|
-
output_file: "{session_output}/performance-review.md"
|
|
1
|
+
name: performance-review
|
|
2
|
+
description: "Performance-focused code review: N+1 queries, memory leaks, async patterns, bundle size, caching, etc. — adapted to your stack"
|
|
3
|
+
author: "PR Review Kit"
|
|
4
|
+
|
|
5
|
+
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
6
|
+
user_name: "{config_source}:user_name"
|
|
7
|
+
communication_language: "{config_source}:communication_language"
|
|
8
|
+
target_repo: "."
|
|
9
|
+
review_output: "{config_source}:review_output"
|
|
10
|
+
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
11
|
+
date: system-generated
|
|
12
|
+
|
|
13
|
+
installed_path: "{project-root}/_prr/prr/workflows/3-review/performance-review"
|
|
14
|
+
instructions: "{installed_path}/instructions.xml"
|
|
15
|
+
validation: "{installed_path}/checklist.md"
|
|
16
|
+
|
|
17
|
+
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
18
|
+
output_file: "{session_output}/performance-review.md"
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
name: security-review
|
|
2
|
-
description: "Security-focused code review: OWASP top 10, injection, auth, secrets, dependencies, etc. — adapted to your project"
|
|
3
|
-
author: "PR Review Kit"
|
|
4
|
-
|
|
5
|
-
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
6
|
-
user_name: "{config_source}:user_name"
|
|
7
|
-
communication_language: "{config_source}:communication_language"
|
|
8
|
-
target_repo: "
|
|
9
|
-
review_output: "{config_source}:review_output"
|
|
10
|
-
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
11
|
-
date: system-generated
|
|
12
|
-
|
|
13
|
-
installed_path: "{project-root}/_prr/prr/workflows/3-review/security-review"
|
|
14
|
-
instructions: "{installed_path}/instructions.xml"
|
|
15
|
-
validation: "{installed_path}/checklist.md"
|
|
16
|
-
owasp_data: "{installed_path}/data/owasp-checklist.csv"
|
|
17
|
-
|
|
18
|
-
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
19
|
-
output_file: "{session_output}/security-review.md"
|
|
1
|
+
name: security-review
|
|
2
|
+
description: "Security-focused code review: OWASP top 10, injection, auth, secrets, dependencies, etc. — adapted to your project"
|
|
3
|
+
author: "PR Review Kit"
|
|
4
|
+
|
|
5
|
+
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
6
|
+
user_name: "{config_source}:user_name"
|
|
7
|
+
communication_language: "{config_source}:communication_language"
|
|
8
|
+
target_repo: "."
|
|
9
|
+
review_output: "{config_source}:review_output"
|
|
10
|
+
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
11
|
+
date: system-generated
|
|
12
|
+
|
|
13
|
+
installed_path: "{project-root}/_prr/prr/workflows/3-review/security-review"
|
|
14
|
+
instructions: "{installed_path}/instructions.xml"
|
|
15
|
+
validation: "{installed_path}/checklist.md"
|
|
16
|
+
owasp_data: "{installed_path}/data/owasp-checklist.csv"
|
|
17
|
+
|
|
18
|
+
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
19
|
+
output_file: "{session_output}/security-review.md"
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
name: improve-code
|
|
2
|
-
description: "Generate concrete inline code suggestions with before/after diffs — focused on actionable improvements"
|
|
3
|
-
author: "PR Review Kit"
|
|
4
|
-
|
|
5
|
-
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
6
|
-
user_name: "{config_source}:user_name"
|
|
7
|
-
communication_language: "{config_source}:communication_language"
|
|
8
|
-
target_repo: "
|
|
9
|
-
review_output: "{config_source}:review_output"
|
|
10
|
-
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
11
|
-
date: system-generated
|
|
12
|
-
|
|
13
|
-
installed_path: "{project-root}/_prr/prr/workflows/4-improve/improve-code"
|
|
14
|
-
instructions: "{installed_path}/instructions.xml"
|
|
15
|
-
validation: "{installed_path}/checklist.md"
|
|
16
|
-
|
|
17
|
-
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
18
|
-
output_file: "{session_output}/improve-code.md"
|
|
1
|
+
name: improve-code
|
|
2
|
+
description: "Generate concrete inline code suggestions with before/after diffs — focused on actionable improvements"
|
|
3
|
+
author: "PR Review Kit"
|
|
4
|
+
|
|
5
|
+
config_source: "{project-root}/_prr/prr/config.yaml"
|
|
6
|
+
user_name: "{config_source}:user_name"
|
|
7
|
+
communication_language: "{config_source}:communication_language"
|
|
8
|
+
target_repo: "."
|
|
9
|
+
review_output: "{config_source}:review_output"
|
|
10
|
+
session_output: "working-context:session_output || latest-session-folder-in:{review_output}"
|
|
11
|
+
date: system-generated
|
|
12
|
+
|
|
13
|
+
installed_path: "{project-root}/_prr/prr/workflows/4-improve/improve-code"
|
|
14
|
+
instructions: "{installed_path}/instructions.xml"
|
|
15
|
+
validation: "{installed_path}/checklist.md"
|
|
16
|
+
|
|
17
|
+
pr_context: "working-context:target_branch,base_branch,pr_number,pr_knowledge_base"
|
|
18
|
+
output_file: "{session_output}/improve-code.md"
|
|
@@ -37,9 +37,8 @@ Depends on `{active_platform}`:
|
|
|
37
37
|
## INITIALIZATION
|
|
38
38
|
|
|
39
39
|
Load config from `{main_config}`.
|
|
40
|
-
Use `session_output`, `target_branch`, `base_branch`, `pr_number`, `active_platform` from working context.
|
|
40
|
+
Use `session_output`, `target_branch`, `base_branch`, `pr_number`, `active_platform`, `active_platform_repo` from working context.
|
|
41
41
|
If `session_output` not set: prompt user to run [SS] Select Session or [SP] Select PR first.
|
|
42
|
-
Use `{active_platform}` (or detect from `{platform}` config).
|
|
43
42
|
|
|
44
43
|
Set `{temp_dir}` = `{session_output}/temp`.
|
|
45
44
|
Create it if it doesn't exist:
|
|
@@ -11,8 +11,9 @@ Only pause for user input when selecting the branch. Everything else runs automa
|
|
|
11
11
|
|
|
12
12
|
## INITIALIZATION
|
|
13
13
|
|
|
14
|
-
Load config from {main_config}: `user_name`, `communication_language`, `
|
|
14
|
+
Load config from {main_config}: `user_name`, `communication_language`, `review_output`, `auto_post_comment`.
|
|
15
15
|
|
|
16
|
+
Set `target_repo` = `.` (the repository containing this config file).
|
|
16
17
|
Set `date` = today's date (YYYY-MM-DD).
|
|
17
18
|
|
|
18
19
|
**Note:** Context will be collected dynamically in Phase 2.5 after describing the PR.
|
|
@@ -23,37 +24,83 @@ No pre-collected context file needed. Context is always fresh and PR-specific.
|
|
|
23
24
|
## PHASE 1 — SELECT PR
|
|
24
25
|
*Execute steps 1a–1b automatically. Pause only at 1c.*
|
|
25
26
|
|
|
26
|
-
### 1a.
|
|
27
|
+
### 1a. Detect platform and fetch latest
|
|
28
|
+
|
|
29
|
+
**Step 1 — Detect platform** (mandatory, always run):
|
|
30
|
+
```bash
|
|
31
|
+
git -C {target_repo} remote get-url origin
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Map the remote URL to a platform:
|
|
35
|
+
|
|
36
|
+
| Remote URL pattern | Platform |
|
|
37
|
+
|---|---|
|
|
38
|
+
| `github.com` | `github` |
|
|
39
|
+
| `gitlab.com` or self-hosted GitLab | `gitlab` |
|
|
40
|
+
| `dev.azure.com` or `visualstudio.com` | `azure` |
|
|
41
|
+
| `bitbucket.org` | `bitbucket` |
|
|
42
|
+
| No remote / local only | `none` |
|
|
43
|
+
|
|
44
|
+
Set `{detected_platform}` = detected value.
|
|
45
|
+
|
|
46
|
+
Also extract `{detected_platform_repo}` from the URL:
|
|
47
|
+
- GitHub/GitLab/Bitbucket: extract `owner/repo` (strip `.git` suffix)
|
|
48
|
+
- Azure DevOps: extract `org/project/repo` from `dev.azure.com/{org}/{project}/_git/{repo}` or `{org}.visualstudio.com/{project}/_git/{repo}`
|
|
49
|
+
|
|
50
|
+
Display:
|
|
51
|
+
```
|
|
52
|
+
🔍 Platform detected: {detected_platform}
|
|
53
|
+
Remote: {detected_platform_repo}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
If platform cannot be detected, set `{detected_platform}` = `none` and continue.
|
|
57
|
+
|
|
58
|
+
**Step 2 — Fetch latest:**
|
|
27
59
|
```bash
|
|
28
60
|
git -C {target_repo} fetch origin --prune
|
|
29
61
|
```
|
|
30
|
-
|
|
62
|
+
|
|
63
|
+
**If fetch succeeds:** Show `✓ Fetched latest from remote` and proceed.
|
|
64
|
+
|
|
65
|
+
**If fetch fails:**
|
|
66
|
+
- Show the error message
|
|
67
|
+
- Ask user: Retry / Continue with local state / Cancel
|
|
68
|
+
- Wait for response before proceeding
|
|
31
69
|
|
|
32
70
|
### 1b. List open PRs/MRs (primary) + recent branches (secondary)
|
|
33
71
|
|
|
34
|
-
**
|
|
72
|
+
**Resolve active repo identifier** (before running any CLI):
|
|
73
|
+
- Set `{active_platform}` = `{detected_platform}`
|
|
74
|
+
- Set `{active_platform_repo}` = `{detected_platform_repo}`
|
|
75
|
+
|
|
76
|
+
For **Azure DevOps**, extract from `{active_platform_repo}` (format: `org/project/repo`):
|
|
77
|
+
- `{az_org}` = first segment → `{az_org}.visualstudio.com` as `{org_url}`
|
|
78
|
+
- `{az_project}` = second segment
|
|
79
|
+
- `{az_repo}` = third segment
|
|
80
|
+
|
|
81
|
+
**Primary — Platform PRs/MRs** (if `{active_platform_repo}` is available and `{active_platform}` ≠ `none`):
|
|
35
82
|
|
|
36
|
-
Use the appropriate command based on `{
|
|
83
|
+
Use the appropriate command based on `{active_platform}`:
|
|
37
84
|
|
|
38
85
|
**GitHub:**
|
|
39
86
|
```bash
|
|
40
|
-
gh pr list --repo {
|
|
87
|
+
gh pr list --repo {active_platform_repo} --state open \
|
|
41
88
|
--json number,title,headRefName,baseRefName,author,createdAt,isDraft --limit 20
|
|
42
89
|
```
|
|
43
90
|
|
|
44
91
|
**GitLab:**
|
|
45
92
|
```bash
|
|
46
|
-
glab mr list --repo {
|
|
93
|
+
glab mr list --repo {active_platform_repo} --state opened --output json
|
|
47
94
|
```
|
|
48
95
|
|
|
49
96
|
**Azure DevOps:**
|
|
50
97
|
```bash
|
|
51
|
-
az repos pr list --repository {
|
|
98
|
+
az repos pr list --repository {az_repo} --project {az_project} --org https://{org_url} --status active --output json
|
|
52
99
|
```
|
|
53
100
|
|
|
54
101
|
**Bitbucket:**
|
|
55
102
|
```bash
|
|
56
|
-
curl https://api.bitbucket.org/2.0/repositories/{
|
|
103
|
+
curl https://api.bitbucket.org/2.0/repositories/{active_platform_repo}/pullrequests?state=OPEN
|
|
57
104
|
```
|
|
58
105
|
|
|
59
106
|
Display as a table: `#N | title | head → base | author | age`
|
|
@@ -67,7 +114,7 @@ git -C {target_repo} branch -r --sort=-committerdate \
|
|
|
67
114
|
|
|
68
115
|
### 1c. Select PR/MR ← **ONLY USER INPUT IN THIS WORKFLOW**
|
|
69
116
|
|
|
70
|
-
**If `{
|
|
117
|
+
**If `{active_platform_repo}` is available and `{active_platform}` ≠ `none`** — ask:
|
|
71
118
|
> Select a PR/MR to review:
|
|
72
119
|
> Enter PR/MR number (e.g. `44`) or branch name (e.g. `feature/my-feature`):
|
|
73
120
|
|
|
@@ -77,7 +124,7 @@ Wait for response.
|
|
|
77
124
|
|
|
78
125
|
**GitHub:**
|
|
79
126
|
```bash
|
|
80
|
-
gh pr view {pr_number} --repo {
|
|
127
|
+
gh pr view {pr_number} --repo {active_platform_repo} \
|
|
81
128
|
--json number,title,headRefName,baseRefName,author,headRefOid
|
|
82
129
|
```
|
|
83
130
|
Set `target_branch` = `headRefName`, `base_branch` = `baseRefName` ← **exact from platform, not assumed**.
|
|
@@ -85,20 +132,20 @@ Set `pr_head_sha` = `headRefOid`.
|
|
|
85
132
|
|
|
86
133
|
**GitLab:**
|
|
87
134
|
```bash
|
|
88
|
-
glab mr view {pr_number} --repo {
|
|
135
|
+
glab mr view {pr_number} --repo {active_platform_repo} --output json
|
|
89
136
|
```
|
|
90
137
|
Set `target_branch` = `source_branch`, `base_branch` = `target_branch`.
|
|
91
138
|
Get head SHA: `git -C {target_repo} rev-parse origin/{target_branch}` → `pr_head_sha`.
|
|
92
139
|
|
|
93
140
|
**Azure DevOps:**
|
|
94
141
|
```bash
|
|
95
|
-
az repos pr show --id {pr_number} --output json
|
|
142
|
+
az repos pr show --id {pr_number} --org https://{org_url} --output json
|
|
96
143
|
```
|
|
97
144
|
Set `target_branch` = `sourceRefName` (strip `refs/heads/`), `base_branch` = `targetRefName` (strip `refs/heads/`).
|
|
98
145
|
|
|
99
146
|
**Bitbucket:**
|
|
100
147
|
```bash
|
|
101
|
-
curl https://api.bitbucket.org/2.0/repositories/{
|
|
148
|
+
curl https://api.bitbucket.org/2.0/repositories/{active_platform_repo}/pullrequests/{pr_number}
|
|
102
149
|
```
|
|
103
150
|
Set `target_branch` = `source.branch.name`, `base_branch` = `destination.branch.name`.
|
|
104
151
|
|
|
@@ -107,7 +154,7 @@ Check if a PR/MR exists for it on the platform. If yes: use its base branch. If
|
|
|
107
154
|
|
|
108
155
|
---
|
|
109
156
|
|
|
110
|
-
**If `{
|
|
157
|
+
**If `{active_platform_repo}` is NOT available or `{active_platform}` = `none`** — ask two separate questions:
|
|
111
158
|
|
|
112
159
|
First, display EXACTLY:
|
|
113
160
|
```
|
|
@@ -137,12 +184,12 @@ Use the first available method based on platform:
|
|
|
137
184
|
|
|
138
185
|
**GitHub** (if `active_platform = github` and `pr_number` is set):
|
|
139
186
|
```bash
|
|
140
|
-
gh pr diff {pr_number} --repo {
|
|
187
|
+
gh pr diff {pr_number} --repo {active_platform_repo}
|
|
141
188
|
```
|
|
142
189
|
|
|
143
190
|
**GitLab** (if `active_platform = gitlab` and `pr_number` is set):
|
|
144
191
|
```bash
|
|
145
|
-
glab mr diff {pr_number} --repo {
|
|
192
|
+
glab mr diff {pr_number} --repo {active_platform_repo}
|
|
146
193
|
```
|
|
147
194
|
|
|
148
195
|
**Azure DevOps / Bitbucket / fallback:**
|
|
@@ -182,7 +229,7 @@ Create folder:
|
|
|
182
229
|
mkdir -p "{session_output}"
|
|
183
230
|
```
|
|
184
231
|
|
|
185
|
-
**Store in working context:** `session_output`, `target_branch`, `base_branch`, `pr_number`, `pr_title`, `active_platform`, `
|
|
232
|
+
**Store in working context:** `session_output`, `target_branch`, `base_branch`, `pr_number`, `pr_title`, `active_platform`, `active_platform_repo`.
|
|
186
233
|
|
|
187
234
|
### 1f. Generate Diffs Folder
|
|
188
235
|
|
|
@@ -411,7 +458,7 @@ Report: {session_output}/final-review.md
|
|
|
411
458
|
|
|
412
459
|
**If `auto_post_comment: false`** (default):
|
|
413
460
|
→ Ask:
|
|
414
|
-
> Post these findings as inline comments to the PR/MR? (requires platform CLI
|
|
461
|
+
> Post these findings as inline comments to the PR/MR? (requires platform CLI)
|
|
415
462
|
> Supports: GitHub (`gh`), GitLab (`glab`), Azure DevOps (`az`), Bitbucket (API)
|
|
416
463
|
> Type **PC** to post, or **Enter** to finish.
|
|
417
464
|
|
|
@@ -34,9 +34,6 @@ class ConfigCollector {
|
|
|
34
34
|
const prrConfig = {
|
|
35
35
|
...coreConfig,
|
|
36
36
|
project_name: config.projectName || path.basename(config.projectDir),
|
|
37
|
-
target_repo: config.targetRepo || '.',
|
|
38
|
-
platform: config.platform || 'auto',
|
|
39
|
-
platform_repo: config.platformRepo || config.githubRepo || '',
|
|
40
37
|
review_output: reviewOutput,
|
|
41
38
|
};
|
|
42
39
|
await fs.writeFile(prrConfigPath, yaml.stringify(prrConfig, { indent: 2 }), 'utf8');
|
|
@@ -156,7 +156,7 @@ ${body}
|
|
|
156
156
|
|
|
157
157
|
- **User**: ${config.user_name || 'Dev'}
|
|
158
158
|
- **Communication Language**: ${config.communication_language || 'English'}
|
|
159
|
-
- **Target Repo**:
|
|
159
|
+
- **Target Repo**: . (auto-detected)
|
|
160
160
|
- **Output Folder**: ${config.output_folder || '_prr-output'}
|
|
161
161
|
- **Review Output**: ${config.review_output || '_prr-output/reviews'}
|
|
162
162
|
|