prr-kit 1.2.3 → 1.4.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 +200 -24
- package/package.json +1 -1
- package/src/core/agents/prr-master.agent.yaml +10 -6
- package/src/core/tasks/clear.md +36 -71
- package/src/core/tasks/help.md +7 -6
- package/src/core/tasks/select-session.md +94 -0
- package/src/core/workflows/party-mode/steps/step-00-user-instructions.md +125 -0
- package/src/core/workflows/party-mode/steps/step-01-load-reviewers.md +27 -19
- package/src/core/workflows/party-mode/steps/step-02-discussion.md +13 -11
- package/src/core/workflows/party-mode/workflow.md +7 -7
- 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/workflows/1-discover/select-pr/steps/step-05-confirm.md +96 -25
- package/src/prr/workflows/1-discover/select-pr/workflow.md +1 -1
- 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 +102 -0
- package/src/prr/workflows/2-analyze/collect-pr-context/steps/{step-03-build-knowledge-base.md → step-04-build-knowledge-base.md} +32 -22
- package/src/prr/workflows/2-analyze/collect-pr-context/workflow.md +5 -6
- package/src/prr/workflows/2-analyze/describe-pr/steps/step-01-load-context.md +3 -3
- package/src/prr/workflows/2-analyze/describe-pr/steps/step-04-output.md +6 -7
- package/src/prr/workflows/2-analyze/describe-pr/workflow.md +2 -2
- package/src/prr/workflows/3-review/architecture-review/checklist.md +1 -2
- package/src/prr/workflows/3-review/architecture-review/workflow.yaml +4 -3
- package/src/prr/workflows/3-review/business-review/checklist.md +1 -2
- package/src/prr/workflows/3-review/business-review/instructions.xml +2 -0
- package/src/prr/workflows/3-review/business-review/workflow.yaml +4 -3
- package/src/prr/workflows/3-review/general-review/checklist.md +1 -2
- package/src/prr/workflows/3-review/general-review/instructions.xml +7 -0
- package/src/prr/workflows/3-review/general-review/workflow.yaml +4 -3
- package/src/prr/workflows/3-review/performance-review/checklist.md +1 -2
- package/src/prr/workflows/3-review/performance-review/workflow.yaml +4 -3
- package/src/prr/workflows/3-review/security-review/checklist.md +1 -2
- package/src/prr/workflows/3-review/security-review/workflow.yaml +4 -3
- package/src/prr/workflows/4-improve/improve-code/checklist.md +1 -2
- package/src/prr/workflows/4-improve/improve-code/workflow.yaml +3 -2
- package/src/prr/workflows/5-ask/ask-code/steps/step-01-load-context.md +2 -2
- package/src/prr/workflows/6-report/generate-report/steps/step-01-collect.md +13 -9
- package/src/prr/workflows/6-report/generate-report/steps/step-03-write.md +2 -2
- package/src/prr/workflows/6-report/generate-report/workflow.md +2 -1
- package/src/prr/workflows/6-report/post-comments/steps/step-01-format.md +4 -5
- package/src/prr/workflows/6-report/post-comments/workflow.md +3 -2
- package/src/prr/workflows/quick/workflow.md +86 -28
package/README.md
CHANGED
|
@@ -38,9 +38,137 @@ Then open your IDE in the installed project and use one of these commands to sta
|
|
|
38
38
|
|
|
39
39
|
## How It Works
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
```
|
|
42
|
+
┌─────────────────────────────────────────────────────────┐
|
|
43
|
+
│ /prr-quick │
|
|
44
|
+
│ Load config.yaml │
|
|
45
|
+
└───────────────────────┬─────────────────────────────────┘
|
|
46
|
+
│
|
|
47
|
+
╔═══════════════▼════════════════╗
|
|
48
|
+
║ PHASE 1 — SELECT PR ║
|
|
49
|
+
╚═══════════════╤════════════════╝
|
|
50
|
+
│
|
|
51
|
+
┌──────────▼──────────┐
|
|
52
|
+
│ 1a. git fetch origin │
|
|
53
|
+
└──────────┬──────────┘
|
|
54
|
+
│
|
|
55
|
+
┌──────────▼───────────────┐
|
|
56
|
+
│ 1b. List open PRs/MRs │
|
|
57
|
+
│ + recent branches │
|
|
58
|
+
└──────────┬───────────────┘
|
|
59
|
+
│
|
|
60
|
+
┌──────────▼───────────────┐
|
|
61
|
+
│ 1c. ⌨️ Select PR/branch │ ← USER INPUT
|
|
62
|
+
│ Enter PR# or name │
|
|
63
|
+
└──────────┬───────────────┘
|
|
64
|
+
│
|
|
65
|
+
┌──────────▼──────────┐
|
|
66
|
+
│ 1d. Load diff │
|
|
67
|
+
│ count files/lines│
|
|
68
|
+
└──────────┬──────────┘
|
|
69
|
+
│
|
|
70
|
+
┌──────────▼──────────────────────────┐
|
|
71
|
+
│ 1e. Create session folder │
|
|
72
|
+
│ {output}/{date}-{slug}/ │
|
|
73
|
+
└──────────┬──────────────────────────┘
|
|
74
|
+
│
|
|
75
|
+
┌──────────▼──────────────────────────┐
|
|
76
|
+
│ 1f. Generate diffs/ folder │
|
|
77
|
+
│ one .md per changed file │
|
|
78
|
+
└──────────┬──────────────────────────┘
|
|
79
|
+
│
|
|
80
|
+
╔═══════════════▼════════════════╗
|
|
81
|
+
║ PHASE 2 — DESCRIBE PR ║
|
|
82
|
+
╚═══════════════╤════════════════╝
|
|
83
|
+
│
|
|
84
|
+
┌──────────▼──────────────┐
|
|
85
|
+
│ 2a. Classify PR type │
|
|
86
|
+
│ bugfix/feature/... │
|
|
87
|
+
└──────────┬──────────────┘
|
|
88
|
+
│
|
|
89
|
+
┌──────────▼──────────────┐
|
|
90
|
+
│ 2b. File-by-file │
|
|
91
|
+
│ walkthrough │
|
|
92
|
+
└──────────┬──────────────┘
|
|
93
|
+
│
|
|
94
|
+
┌──────────▼──────────────┐
|
|
95
|
+
│ 2c. Print PR description │
|
|
96
|
+
└──────────┬──────────────┘
|
|
97
|
+
│
|
|
98
|
+
╔═══════════════▼═══════════════════════╗
|
|
99
|
+
║ PHASE 2.5 — COLLECT PR CONTEXT ║
|
|
100
|
+
╚═══════════════╤═══════════════════════╝
|
|
101
|
+
│
|
|
102
|
+
┌──────────▼──────────────────────────┐
|
|
103
|
+
│ Step 1. Analyze changed files │
|
|
104
|
+
│ detect stacks, domains, file types │
|
|
105
|
+
└──────────┬──────────────────────────┘
|
|
106
|
+
│
|
|
107
|
+
┌──────────▼──────────────────────────┐
|
|
108
|
+
│ Step 2. Collect context from: │
|
|
109
|
+
│ CLAUDE.md · CONTRIBUTING.md │
|
|
110
|
+
│ .eslintrc · tsconfig · pyproject │
|
|
111
|
+
│ ARCHITECTURE.md · docs/** │
|
|
112
|
+
│ @context/@security annotations │
|
|
113
|
+
│ stack rules (vue3/react/django/...) │
|
|
114
|
+
│ MCP tools · RAG · URL sources │
|
|
115
|
+
└──────────┬──────────────────────────┘
|
|
116
|
+
│
|
|
117
|
+
┌──────────▼──────────────────────────┐
|
|
118
|
+
│ Step 3. ⌨️ User instructions │ ← USER INPUT
|
|
119
|
+
│ scope / focus / requirements / │
|
|
120
|
+
│ context — or Enter for full review │
|
|
121
|
+
└──────────┬──────────────────────────┘
|
|
122
|
+
│
|
|
123
|
+
┌────────┴────────┐
|
|
124
|
+
▼ ▼
|
|
125
|
+
[provided] [empty]
|
|
126
|
+
parse scope & scope = "all"
|
|
127
|
+
focus/req/ctx full standard
|
|
128
|
+
│ │
|
|
129
|
+
└────────┬────────┘
|
|
130
|
+
│
|
|
131
|
+
┌──────────▼──────────────────────────┐
|
|
132
|
+
│ Step 4. Build pr-context.yaml │
|
|
133
|
+
│ all collected context + user_instr │
|
|
134
|
+
│ → {session_output}/pr-context.yaml │
|
|
135
|
+
└──────────┬──────────────────────────┘
|
|
136
|
+
│
|
|
137
|
+
╔═══════════════▼════════════════╗
|
|
138
|
+
║ PHASE 3 — REVIEW ║
|
|
139
|
+
╚═══════════════╤════════════════╝
|
|
140
|
+
│
|
|
141
|
+
┌──────────▼──────────────────────────┐
|
|
142
|
+
│ Scope gate │
|
|
143
|
+
│ read user_instructions.review_scope │
|
|
144
|
+
└──────┬───────────────────────────────┘
|
|
145
|
+
│
|
|
146
|
+
┌──────────┴──────────┐
|
|
147
|
+
[in scope] [not in scope]
|
|
148
|
+
│ │
|
|
149
|
+
▼ ▼
|
|
150
|
+
┌─────────────┐ ⏭️ skipped
|
|
151
|
+
│ GR · SR │ (no output file)
|
|
152
|
+
│ PR · AR │
|
|
153
|
+
│ BR │
|
|
154
|
+
└──────┬──────┘
|
|
155
|
+
│
|
|
156
|
+
╔▼════════════════════════╗
|
|
157
|
+
║ PHASE 4 — REPORT ║
|
|
158
|
+
╚╤════════════════════════╝
|
|
159
|
+
│
|
|
160
|
+
│ Compile findings → sort by severity
|
|
161
|
+
│ 🔴 Blockers → 🟡 Warnings
|
|
162
|
+
│ 🟢 Suggestions → ❓ Questions
|
|
163
|
+
│ Write → final-review.md
|
|
164
|
+
│
|
|
165
|
+
╔▼════════════════════════╗
|
|
166
|
+
║ PHASE 5 — DONE ║
|
|
167
|
+
╚╤════════════════════════╝
|
|
168
|
+
│
|
|
169
|
+
├── auto_post_comment: true → post inline comments automatically
|
|
170
|
+
└── auto_post_comment: false → ⌨️ type PC to post, Enter to finish
|
|
171
|
+
```
|
|
44
172
|
|
|
45
173
|
The framework installs into your project as a `_prr/` folder. Agents and workflows are Markdown/YAML files that your AI IDE reads and executes — no server, no background process, no API keys required beyond your IDE's AI.
|
|
46
174
|
|
|
@@ -48,25 +176,72 @@ The framework installs into your project as a `_prr/` folder. Agents and workflo
|
|
|
48
176
|
|
|
49
177
|
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
178
|
|
|
51
|
-
All values are written
|
|
179
|
+
All values are written to `_prr/prr/config.yaml`. Full schema overview:
|
|
52
180
|
|
|
53
181
|
```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
|
|
182
|
+
# ─── Identity ──────────────────────────────────────────────────────────────
|
|
183
|
+
user_name: YourName # Your name — used in review reports
|
|
184
|
+
communication_language: English # Any language: English | Vietnamese | Japanese | French | …
|
|
60
185
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
186
|
+
# ─── Project ───────────────────────────────────────────────────────────────
|
|
187
|
+
project_name: my-project # Display name in reports (cosmetic only)
|
|
188
|
+
target_repo: . # Path to git repo (. = current dir, or ../other-repo)
|
|
189
|
+
|
|
190
|
+
# ─── Platform ──────────────────────────────────────────────────────────────
|
|
191
|
+
platform: auto # auto | github | gitlab | azure | bitbucket | none
|
|
192
|
+
platform_repo: "owner/repo" # owner/repo slug — required for PR listing + inline comments
|
|
193
|
+
# leave blank for local-only mode (git diff only)
|
|
64
194
|
|
|
195
|
+
# ─── Output ────────────────────────────────────────────────────────────────
|
|
196
|
+
review_output: ./_prr-output/reviews # Where review reports + context files are written
|
|
197
|
+
auto_post_comment: false # true → auto-post findings after every review (skips PC prompt)
|
|
198
|
+
|
|
199
|
+
# ─── Context Collection ────────────────────────────────────────────────────
|
|
200
|
+
context_collection:
|
|
201
|
+
enabled: true # false → disable context collection entirely
|
|
202
|
+
mode: pr-specific # only value: pr-specific (always fresh, never cached)
|
|
203
|
+
|
|
204
|
+
# Sources below are auto-detected — override only if needed:
|
|
205
|
+
# primary_sources: [CLAUDE.md, AGENTS.md, .github/CLAUDE_CODE_RULES.md, .clauderules]
|
|
206
|
+
# config_files: [.eslintrc*, .prettierrc*, tsconfig.json, vite.config.*, webpack.config.*, …]
|
|
207
|
+
# standards_docs: [CONTRIBUTING.md, ARCHITECTURE.md, docs/**/*.md]
|
|
208
|
+
# inline_annotations: { enabled: true, patterns: [@context:, @security:, @pattern:, @rule:] }
|
|
209
|
+
|
|
210
|
+
# ─── External Sources ──────────────────────────────────────────────────────
|
|
211
|
+
# MCP tools + RAG systems available in your AI IDE session.
|
|
212
|
+
# Agent auto-discovers tools and maps them to declared intents.
|
|
65
213
|
external_sources:
|
|
66
|
-
enabled: false
|
|
214
|
+
enabled: false # true → activate MCP + RAG enrichment
|
|
215
|
+
|
|
216
|
+
mcp:
|
|
217
|
+
enabled: true # toggle MCP independently of master switch
|
|
218
|
+
intents: # what kinds of context to fetch via MCP tools
|
|
219
|
+
- knowledge_base # Confluence, Notion → team standards, ADRs
|
|
220
|
+
- project_management # Jira, Linear → linked issue + acceptance criteria
|
|
221
|
+
- design # Figma, Zeplin → design specs (UI PRs only)
|
|
222
|
+
# - code_intelligence # Sourcegraph → similar patterns
|
|
223
|
+
hints:
|
|
224
|
+
branch_issue_pattern: "([A-Z]+-\\d+)" # regex to extract issue key from branch name
|
|
225
|
+
# e.g. feature/ENG-123-auth → ENG-123
|
|
226
|
+
|
|
227
|
+
rag:
|
|
228
|
+
enabled: false # true → query RAG systems (vector DB, embeddings)
|
|
229
|
+
intents:
|
|
230
|
+
- similar_patterns # find similar code in the codebase
|
|
231
|
+
- past_decisions # previous review decisions for similar code
|
|
232
|
+
# - architecture_examples # embedded architecture docs
|
|
233
|
+
|
|
234
|
+
sources: [] # plain URL sources — always fetched via WebFetch
|
|
235
|
+
# sources:
|
|
236
|
+
# - type: url
|
|
237
|
+
# name: Shared ESLint config
|
|
238
|
+
# url: https://raw.githubusercontent.com/org/standards/main/eslint.md
|
|
239
|
+
# - type: url
|
|
240
|
+
# name: Security guidelines
|
|
241
|
+
# url: https://wiki.company.com/public/security-standards
|
|
67
242
|
```
|
|
68
243
|
|
|
69
|
-
> See **[CONFIGURATION.md](CONFIGURATION.md)** for
|
|
244
|
+
> See **[CONFIGURATION.md](CONFIGURATION.md)** for detailed explanations, examples, and FAQs.
|
|
70
245
|
|
|
71
246
|
## Platform Support
|
|
72
247
|
|
|
@@ -89,11 +264,11 @@ external_sources:
|
|
|
89
264
|
### Quick mode — one command, full pipeline
|
|
90
265
|
|
|
91
266
|
```
|
|
92
|
-
/prr-quick
|
|
267
|
+
/prr-quick
|
|
93
268
|
```
|
|
94
269
|
|
|
95
|
-
Runs automatically: **select PR → describe → collect context →
|
|
96
|
-
|
|
270
|
+
Runs automatically: **select PR → describe → collect context → review → report**
|
|
271
|
+
Pauses **twice** for user input: once to select the PR/branch, once for review instructions (scope, focus, requirements — or Enter for a full standard review).
|
|
97
272
|
|
|
98
273
|
### Manual mode — step by step
|
|
99
274
|
|
|
@@ -101,11 +276,11 @@ Only pauses once to ask which PR/branch to review.
|
|
|
101
276
|
|------|---------|-------------|
|
|
102
277
|
| `SP` | Select PR | Fetch latest → list open PRs (via `gh`) or branches → select head + base → load diff |
|
|
103
278
|
| `DP` | Describe PR | Classify PR type, generate summary, file-by-file walkthrough |
|
|
104
|
-
| `GR` | General Review | Logic, naming, readability, DRY, best practices |
|
|
279
|
+
| `GR` | General Review | Logic, naming, readability, DRY, best practices, etc. — adapted to your stack |
|
|
105
280
|
| `SR` | Security Review | OWASP Top 10, secrets, auth, rate limits, injection, etc. — adapted to your project |
|
|
106
281
|
| `PR` | Performance Review | N+1 queries, memory leaks, async patterns, caching, etc. — adapted to your stack |
|
|
107
282
|
| `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 |
|
|
283
|
+
| `BR` | Business Review | User impact, business risk, feature completeness, data safety, observability — adapted to your project |
|
|
109
284
|
| `IC` | Improve Code | Concrete BEFORE/AFTER code suggestions |
|
|
110
285
|
| `AK` | Ask Code | Q&A about specific changes in this PR |
|
|
111
286
|
| `RR` | Generate Report | Compile all findings → Markdown report in `_prr-output/reviews/` |
|
|
@@ -147,11 +322,11 @@ Specialist reviewer agents are orchestrated internally by the master agent and p
|
|
|
147
322
|
|
|
148
323
|
| Reviewer | Focus | Key questions |
|
|
149
324
|
|---|---|---|
|
|
150
|
-
| 👁️ General (GR) | Code quality | Is the logic correct? Naming clear? DRY? Tests present? |
|
|
325
|
+
| 👁️ General (GR) | Code quality + stack practices | Is the logic correct? Naming clear? DRY? Tests present? *(adapted to your stack)* |
|
|
151
326
|
| 🔒 Security (SR) | OWASP Top 10 + stack threats | XSS? Injection? Secrets exposed? Auth correct? *(adapted to your stack)* |
|
|
152
327
|
| ⚡ Performance (PR) | Efficiency + stack patterns | N+1 queries? Memory leaks? Missing await? *(adapted to your stack)* |
|
|
153
328
|
| 🏗️ 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? |
|
|
329
|
+
| 💼 Business (BR) | Real-world impact | User impact? Business risk? Feature completeness? Data safe? Observability? *(adapted to your project)* |
|
|
155
330
|
|
|
156
331
|
> 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
332
|
|
|
@@ -168,13 +343,14 @@ All findings use a standard format:
|
|
|
168
343
|
|
|
169
344
|
## Context Collection
|
|
170
345
|
|
|
171
|
-
After [DP] Describe PR, context is collected **automatically** —
|
|
346
|
+
After [DP] Describe PR, context is collected **automatically** — then the agent pauses once for your instructions:
|
|
172
347
|
|
|
173
348
|
1. Analyzes changed files to detect domains (`authentication`, `state-management`, etc.)
|
|
174
349
|
2. Reads relevant config files (`.eslintrc`, `.prettierrc`, `tsconfig.json`) and standards docs (`CONTRIBUTING.md`, `ARCHITECTURE.md`)
|
|
175
350
|
3. Extracts inline `@context:` / `@security:` / `@pattern:` annotations from the diff
|
|
176
351
|
4. Optionally queries **MCP tools** (Confluence, Jira, Figma) and **RAG systems** if configured
|
|
177
|
-
5.
|
|
352
|
+
5. Asks for **review instructions** — scope (`only security`), focus, requirements, or context. Press Enter for a full standard review
|
|
353
|
+
6. Writes `pr-context.yaml` inside the session folder — loaded by all reviewers
|
|
178
354
|
|
|
179
355
|
> See [CONFIGURATION.md](CONFIGURATION.md) for MCP intents, RAG setup, and URL sources.
|
|
180
356
|
|
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"
|
|
@@ -82,10 +82,14 @@ agent:
|
|
|
82
82
|
exec: "{project-root}/_prr/prr/workflows/6-report/post-comments/workflow.md"
|
|
83
83
|
description: "[PC] Post Comments: Post inline review comments to GitHub/GitLab/Azure/Bitbucket PR"
|
|
84
84
|
|
|
85
|
+
- trigger: "SS or fuzzy match on select-session or resume-session"
|
|
86
|
+
exec: "{project-root}/_prr/core/tasks/select-session.md"
|
|
87
|
+
description: "[SS] Select Session: List past review sessions and resume one"
|
|
88
|
+
|
|
85
89
|
- trigger: "HH or fuzzy match on help"
|
|
86
90
|
exec: "{project-root}/_prr/core/tasks/help.md"
|
|
87
91
|
description: "[HH] Help: Show review workflow guide and available commands"
|
|
88
92
|
|
|
89
93
|
- trigger: "CL or fuzzy match on clear or clean or reset"
|
|
90
94
|
exec: "{project-root}/_prr/core/tasks/clear.md"
|
|
91
|
-
description: "[CL] Clear:
|
|
95
|
+
description: "[CL] Clear: Delete one or more past review sessions"
|
package/src/core/tasks/clear.md
CHANGED
|
@@ -8,58 +8,41 @@
|
|
|
8
8
|
|
|
9
9
|
Read `{project-root}/_prr/prr/config.yaml` to get `review_output` path.
|
|
10
10
|
|
|
11
|
-
### 2. Scan
|
|
11
|
+
### 2. Scan Session Folders
|
|
12
12
|
|
|
13
|
-
List all
|
|
13
|
+
List all session folders in `{review_output}` (datetime-slug subdirectories):
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
ls "{review_output}
|
|
16
|
+
ls -d "{review_output}"/*/
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Each session folder is named `{YYYY-MM-DD-HHmm}-{slug}` (e.g. `2026-03-02-1430-pr44-feature-auth`).
|
|
20
|
+
Inside each folder are: `pr-context.yaml` (knowledge base) and review `.md` files.
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
- `current-pr-context.yaml` — active session state (which PR is selected)
|
|
23
|
-
- `pr-*-context.yaml` — per-PR knowledge bases built during context collection
|
|
24
|
-
|
|
25
|
-
**Intermediate review files** (individual review output, used by [RR] and [PC]):
|
|
26
|
-
- `general-review-*.md`
|
|
27
|
-
- `security-review-*.md`
|
|
28
|
-
- `performance-review-*.md`
|
|
29
|
-
- `architecture-review-*.md`
|
|
30
|
-
- `business-review-*.md`
|
|
31
|
-
- `improve-code-*.md`
|
|
32
|
-
- `pr-description-*.md`
|
|
33
|
-
|
|
34
|
-
**Review reports** (final compiled reports):
|
|
35
|
-
- `review-*.md` — final review reports generated by [RR]
|
|
22
|
+
Also detect any legacy flat files still directly in `{review_output}/` (pre-session-folder format).
|
|
36
23
|
|
|
37
24
|
### 3. Display What Exists
|
|
38
25
|
|
|
39
|
-
Show the user
|
|
26
|
+
Show the user a summary of each session:
|
|
40
27
|
|
|
41
28
|
```
|
|
42
29
|
🗂️ PRR Output — {review_output}
|
|
43
30
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Review reports ({m}):
|
|
57
|
-
• review-feature-auth-indexeddb-migration-2026-02-21.md
|
|
58
|
-
• review-feature-add-search-functionality-2026-02-21.md
|
|
59
|
-
... (list all review-*.md)
|
|
31
|
+
Session folders ({n}):
|
|
32
|
+
|
|
33
|
+
📁 2026-03-02-1430-pr44-feature-auth/
|
|
34
|
+
Branch: feature/auth | PR #44 | 2026-03-02
|
|
35
|
+
Files: pr-context.yaml, pr-description.md,
|
|
36
|
+
general-review.md, security-review.md, final-review.md
|
|
37
|
+
|
|
38
|
+
📁 2026-03-01-0915-fix-null-pointer/
|
|
39
|
+
Branch: fix/null-pointer | no PR | 2026-03-01
|
|
40
|
+
Files: general-review.md
|
|
41
|
+
|
|
42
|
+
... (list all session folders)
|
|
60
43
|
```
|
|
61
44
|
|
|
62
|
-
If
|
|
45
|
+
If no session folders exist:
|
|
63
46
|
```
|
|
64
47
|
✅ Nothing to clear — output folder is already empty.
|
|
65
48
|
```
|
|
@@ -72,49 +55,32 @@ Ask the user what to clear:
|
|
|
72
55
|
```
|
|
73
56
|
What would you like to clear?
|
|
74
57
|
|
|
75
|
-
[1] All
|
|
76
|
-
[2]
|
|
77
|
-
[3]
|
|
78
|
-
[4] Cancel — do nothing
|
|
58
|
+
[1] All sessions — delete all session folders
|
|
59
|
+
[2] Select sessions — choose specific session(s) to delete
|
|
60
|
+
[3] Cancel — do nothing
|
|
79
61
|
```
|
|
80
62
|
|
|
81
63
|
Wait for user input.
|
|
82
64
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
rm -f "{review_output}/current-pr-context.yaml"
|
|
88
|
-
rm -f "{review_output}"/pr-*-context.yaml
|
|
89
|
-
rm -f "{review_output}"/general-review-*.md
|
|
90
|
-
rm -f "{review_output}"/security-review-*.md
|
|
91
|
-
rm -f "{review_output}"/performance-review-*.md
|
|
92
|
-
rm -f "{review_output}"/architecture-review-*.md
|
|
93
|
-
rm -f "{review_output}"/business-review-*.md
|
|
94
|
-
rm -f "{review_output}"/improve-code-*.md
|
|
95
|
-
rm -f "{review_output}"/pr-description-*.md
|
|
96
|
-
rm -f "{review_output}"/review-*.md
|
|
65
|
+
**If [2] Select sessions:** List sessions numbered and ask:
|
|
66
|
+
```
|
|
67
|
+
Which session(s) to delete? (e.g. 1, 3 or 1-3)
|
|
97
68
|
```
|
|
69
|
+
Wait for response.
|
|
70
|
+
|
|
71
|
+
### 5. Execute Deletion
|
|
98
72
|
|
|
99
|
-
**If [
|
|
73
|
+
**If [1] All sessions:**
|
|
100
74
|
```bash
|
|
101
|
-
rm -
|
|
102
|
-
rm -f "{review_output}"/pr-*-context.yaml
|
|
75
|
+
rm -rf "{review_output}"/*/
|
|
103
76
|
```
|
|
104
77
|
|
|
105
|
-
**If [
|
|
78
|
+
**If [2] Selected sessions:** For each chosen session folder:
|
|
106
79
|
```bash
|
|
107
|
-
rm -
|
|
108
|
-
rm -f "{review_output}"/security-review-*.md
|
|
109
|
-
rm -f "{review_output}"/performance-review-*.md
|
|
110
|
-
rm -f "{review_output}"/architecture-review-*.md
|
|
111
|
-
rm -f "{review_output}"/business-review-*.md
|
|
112
|
-
rm -f "{review_output}"/improve-code-*.md
|
|
113
|
-
rm -f "{review_output}"/pr-description-*.md
|
|
114
|
-
rm -f "{review_output}"/review-*.md
|
|
80
|
+
rm -rf "{review_output}/{selected_session_folder}/"
|
|
115
81
|
```
|
|
116
82
|
|
|
117
|
-
**If [
|
|
83
|
+
**If [3] Cancel:**
|
|
118
84
|
```
|
|
119
85
|
❌ Cancelled — nothing was deleted.
|
|
120
86
|
```
|
|
@@ -122,15 +88,14 @@ Stop.
|
|
|
122
88
|
|
|
123
89
|
### 6. Confirm Deletion
|
|
124
90
|
|
|
125
|
-
Verify
|
|
91
|
+
Verify folders are gone and report:
|
|
126
92
|
|
|
127
93
|
```
|
|
128
94
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
129
95
|
✅ Clear complete
|
|
130
96
|
|
|
131
97
|
Deleted:
|
|
132
|
-
🗑️
|
|
133
|
-
🗑️ Review reports: {n_rpt} file(s) removed
|
|
98
|
+
🗑️ Sessions removed: {n} folder(s)
|
|
134
99
|
|
|
135
100
|
Output folder: {review_output}
|
|
136
101
|
Status: clean
|
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
|
|
|
@@ -36,4 +36,5 @@ Use `/prr-help` anytime for guidance on what to do.
|
|
|
36
36
|
|
|
37
37
|
### Utilities
|
|
38
38
|
|
|
39
|
-
- **[
|
|
39
|
+
- **[SS] Select Session** — List past review sessions and resume one. Use this at the start of a new conversation to pick up where you left off.
|
|
40
|
+
- **[CL] Clear** — Delete one or more past review session folders. Choose specific sessions or clear all.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Select Session
|
|
2
|
+
|
|
3
|
+
**Goal:** List all past PR review sessions and let the user resume one by restoring `session_output` into working context.
|
|
4
|
+
|
|
5
|
+
## EXECUTION
|
|
6
|
+
|
|
7
|
+
### 1. Load Config
|
|
8
|
+
|
|
9
|
+
Read `{project-root}/_prr/prr/config.yaml` to get `review_output` path.
|
|
10
|
+
|
|
11
|
+
### 2. Scan Session Folders
|
|
12
|
+
|
|
13
|
+
List all session folders in `{review_output}`:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ls -d "{review_output}"/*/
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
For each session folder, read its contents to build a summary:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
ls "{review_output}/{session_folder}/"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
From the files present, determine:
|
|
26
|
+
- **Branch / PR** — from folder name (e.g. `2026-03-02-1430-pr44-feature-auth` → PR #44, branch `feature/auth`)
|
|
27
|
+
- **Date / Time** — from folder name prefix (`2026-03-02-1430`)
|
|
28
|
+
- **Reviews done** — which `*-review.md` files exist
|
|
29
|
+
- **Has final report** — `final-review.md` exists
|
|
30
|
+
- **Has description** — `pr-description.md` exists
|
|
31
|
+
|
|
32
|
+
### 3. Display Sessions
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
36
|
+
📂 Review Sessions — {review_output}
|
|
37
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
38
|
+
|
|
39
|
+
[1] 2026-03-02 14:30 — PR #44 feature/auth-login
|
|
40
|
+
Reviews: DP ✓ GR ✓ SR ✓ RR ✓
|
|
41
|
+
Report: final-review.md ✓
|
|
42
|
+
|
|
43
|
+
[2] 2026-03-01 09:15 — fix/null-pointer-checkout
|
|
44
|
+
Reviews: DP ✓ GR ✓
|
|
45
|
+
Report: —
|
|
46
|
+
|
|
47
|
+
[3] 2026-02-28 17:00 — PR #41 chore/upgrade-deps
|
|
48
|
+
Reviews: DP ✓ GR ✓ AR ✓ RR ✓
|
|
49
|
+
Report: final-review.md ✓
|
|
50
|
+
|
|
51
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
If no sessions exist:
|
|
55
|
+
```
|
|
56
|
+
✅ No sessions found in {review_output}.
|
|
57
|
+
Run [SP] Select PR or [QR] Quick Review to start a new session.
|
|
58
|
+
```
|
|
59
|
+
Then stop.
|
|
60
|
+
|
|
61
|
+
### 4. Ask User to Select
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
Select a session to resume (enter number):
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**HALT — wait for user response.**
|
|
68
|
+
|
|
69
|
+
### 5. Restore Session
|
|
70
|
+
|
|
71
|
+
Set `session_output` = full path of the selected session folder.
|
|
72
|
+
|
|
73
|
+
Load PR metadata from working context sources available in the session folder:
|
|
74
|
+
- Parse `session_output` folder name to extract: `datetime_prefix`, `pr_number` (if `prN-` prefix), `branch_slug`
|
|
75
|
+
- Read `pr-context.yaml` if it exists — extract `pr_metadata.pr_number`, `pr_metadata.branch`, `pr_metadata.base_branch`
|
|
76
|
+
- Derive `target_branch` and `base_branch` from knowledge base or folder name
|
|
77
|
+
|
|
78
|
+
**Store in working context:**
|
|
79
|
+
- `session_output` = selected folder path
|
|
80
|
+
- `target_branch`, `base_branch`, `pr_number` = from above
|
|
81
|
+
|
|
82
|
+
Display:
|
|
83
|
+
```
|
|
84
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
85
|
+
✅ Session restored
|
|
86
|
+
|
|
87
|
+
📁 {session_output}
|
|
88
|
+
Branch: {target_branch} → {base_branch}
|
|
89
|
+
PR #: {pr_number} (if applicable)
|
|
90
|
+
|
|
91
|
+
Reviews completed: {list or "none"}
|
|
92
|
+
Ready to continue — run any command from the menu.
|
|
93
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
94
|
+
```
|