@codedrifters/configulator 0.0.198 → 0.0.200

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/lib/index.js CHANGED
@@ -228,6 +228,7 @@ __export(index_exports, {
228
228
  meetingAnalysisBundle: () => meetingAnalysisBundle,
229
229
  orchestratorBundle: () => orchestratorBundle,
230
230
  pnpmBundle: () => pnpmBundle,
231
+ prReviewBundle: () => prReviewBundle,
231
232
  projenBundle: () => projenBundle,
232
233
  resolveModelAlias: () => resolveModelAlias,
233
234
  resolveTemplateVariables: () => resolveTemplateVariables,
@@ -506,55 +507,11 @@ var createRuleSkill = {
506
507
  "- Use `ruleExtensions` to add project-specific content to existing bundle rules instead of replacing them"
507
508
  ].join("\n")
508
509
  };
509
- var reviewPrSkill = {
510
- name: "review-pr",
511
- description: "Review a pull request for code quality, conventions, and correctness",
512
- instructions: [
513
- "# Review Pull Request",
514
- "",
515
- "Review the current pull request in **{{repository.owner}}/{{repository.name}}**.",
516
- "",
517
- "## Review Checklist",
518
- "",
519
- "1. **Read the PR description** \u2014 understand the intent and linked issue",
520
- "2. **Review the diff** \u2014 check all changed files for:",
521
- " - Correctness and logic errors",
522
- " - Adherence to project conventions",
523
- " - Test coverage for new/changed behavior",
524
- " - No unintended side effects",
525
- "3. **Check PR conventions:**",
526
- " - Title uses conventional commit prefix (`feat:`, `fix:`, `docs:`, etc.)",
527
- " - Body includes a closing keyword (`Closes #<issue>`)",
528
- " - Summary of changes is present",
529
- "4. **Verify build and tests pass**",
530
- "",
531
- "## Commands",
532
- "",
533
- "```bash",
534
- "# View the PR details",
535
- "gh pr view",
536
- "",
537
- "# View the diff",
538
- "gh pr diff",
539
- "",
540
- "# Check CI status",
541
- "gh pr checks",
542
- "```",
543
- "",
544
- "## Output Format",
545
- "",
546
- "Provide a structured review with:",
547
- "- **Summary**: One-line verdict (approve, request changes, or comment)",
548
- "- **Findings**: Bulleted list of issues or suggestions, grouped by severity",
549
- "- **Positive notes**: What was done well"
550
- ].join("\n"),
551
- allowedTools: ["Read", "Glob", "Grep", "Bash(gh *)"]
552
- };
553
510
  var baseBundle = {
554
511
  name: "base",
555
512
  description: "Core rules: project overview, interaction style, and general coding conventions",
556
513
  appliesWhen: () => true,
557
- skills: [createRuleSkill, reviewPrSkill],
514
+ skills: [createRuleSkill],
558
515
  rules: [
559
516
  {
560
517
  name: "project-overview",
@@ -1046,21 +1003,7 @@ var githubWorkflowBundle = {
1046
1003
  "6. **Create the PR** using `gh pr create`:",
1047
1004
  " - **Title**: use a conventional commit style title (e.g., `feat(scope): short description`)",
1048
1005
  " - **Body**: include `Closes #<issue-number>` (derived from the branch name) and a brief summary of changes",
1049
- "7. **Enable auto-merge with squash** \u2014 use `gh pr merge --auto --squash` with the merge commit message:",
1050
- "",
1051
- "```",
1052
- "gh pr merge --auto --squash --subject '<conventional-commit-title>' --body '<extended-description>'",
1053
- "```",
1054
- "",
1055
- "The merge commit message should follow this format:",
1056
- "",
1057
- "```",
1058
- "Subject: <conventional-commit-title>",
1059
- "",
1060
- "Body:",
1061
- "- Bullet points summarizing the changes",
1062
- "- Closes #<issue-number>",
1063
- "```",
1006
+ "7. **Delegate review and merge to the `pr-reviewer` sub-agent.** After the PR is created, invoke the `/review-pr <pr-number>` skill (or otherwise hand the new PR number to the `pr-reviewer` sub-agent). The reviewer verifies the diff against the linked issue's acceptance criteria and enables squash auto-merge when all checks pass. Do **not** run `gh pr merge --auto` yourself \u2014 review/merge policy lives solely in the `pr-reviewer` agent.",
1064
1007
  "",
1065
1008
  "### PR Body Template",
1066
1009
  "",
@@ -1081,7 +1024,7 @@ var githubWorkflowBundle = {
1081
1024
  "",
1082
1025
  "- Always derive the issue number from the branch name (e.g., `feat/42-add-login` \u2192 `#42`)",
1083
1026
  "- Use conventional commit format for the PR title",
1084
- "- Always enable auto-merge with squash \u2014 do not merge manually"
1027
+ "- Delegate merge to the `pr-reviewer` sub-agent \u2014 do not merge manually and do not enable auto-merge directly"
1085
1028
  ].join("\n"),
1086
1029
  tags: ["workflow"]
1087
1030
  }
@@ -1863,8 +1806,7 @@ var orchestratorSubAgent = {
1863
1806
  " - Verify PR conventions: conventional commit title, closing keyword, summary present",
1864
1807
  " - Check CI status: `gh pr checks N`",
1865
1808
  "3. If the PR passes review:",
1866
- " - Approve: `gh pr review N --approve --body '<summary>'`",
1867
- " - Enable auto-merge: `gh pr merge N --auto --squash`",
1809
+ " - Enable squash auto-merge: `gh pr merge N --auto --squash --subject '<conventional-commit-title>' --body '<extended-description>'`",
1868
1810
  "4. If the PR fails review:",
1869
1811
  " - Request changes: `gh pr review N --request-changes --body '<findings>'`",
1870
1812
  "5. After each PR (whether merged or not):",
@@ -2124,10 +2066,10 @@ var issueWorkerSubAgent = {
2124
2066
  'Closes #<issue-number>"',
2125
2067
  "```",
2126
2068
  "",
2127
- "Enable auto-merge:",
2128
- "```bash",
2129
- "gh pr merge --auto --squash",
2130
- "```",
2069
+ "Do **not** enable auto-merge yourself. The `pr-reviewer` sub-agent owns",
2070
+ "review and merge for every PR \u2014 it verifies the diff against the issue's",
2071
+ "acceptance criteria and enables squash auto-merge only when all checks",
2072
+ "pass. Record the new PR number so a reviewer can be invoked next.",
2131
2073
  "",
2132
2074
  "## Phase 8: Update Status",
2133
2075
  "",
@@ -2138,9 +2080,9 @@ var issueWorkerSubAgent = {
2138
2080
  "",
2139
2081
  "## Phase 9: Branch Cleanup",
2140
2082
  "",
2141
- "Auto-merge is enabled, so the PR may not be merged yet. Poll the PR state",
2142
- "up to 10 times, waiting 30 seconds between polls, until it either merges,",
2143
- "closes, or the timeout is reached:",
2083
+ "The PR will not auto-merge until the `pr-reviewer` enables it. Poll the PR",
2084
+ "state up to 10 times, waiting 30 seconds between polls, until it either",
2085
+ "merges, closes, or the timeout is reached:",
2144
2086
  "",
2145
2087
  "```bash",
2146
2088
  "gh pr view <pr-number> --json state --jq '.state'",
@@ -2154,8 +2096,8 @@ var issueWorkerSubAgent = {
2154
2096
  " ```",
2155
2097
  "- **If the state becomes `CLOSED` (not merged):** leave the branch in place",
2156
2098
  " and report that the PR was closed without merging. Do not delete the branch.",
2157
- "- **If still `OPEN` after the polling window:** report that auto-merge is",
2158
- " still pending and stop. Do not delete the branch.",
2099
+ "- **If still `OPEN` after the polling window:** report that the PR is",
2100
+ " awaiting review/merge and stop. Do not delete the branch.",
2159
2101
  "",
2160
2102
  "---",
2161
2103
  "",
@@ -2336,6 +2278,392 @@ var pnpmBundle = {
2336
2278
  ]
2337
2279
  };
2338
2280
 
2281
+ // src/agent/bundles/pr-review.ts
2282
+ var prReviewerSubAgent = {
2283
+ name: "pr-reviewer",
2284
+ description: "Reviews a pull request against its linked issue's acceptance criteria, then enables squash auto-merge or comments with findings",
2285
+ model: AGENT_MODEL.POWERFUL,
2286
+ maxTurns: 40,
2287
+ platforms: { cursor: { exclude: true } },
2288
+ prompt: [
2289
+ "# PR Reviewer Agent",
2290
+ "",
2291
+ "You review a single pull request in **{{repository.owner}}/{{repository.name}}**",
2292
+ "against its linked issue's acceptance criteria, verify code quality and",
2293
+ "convention compliance, and then either enable squash auto-merge or leave",
2294
+ "a review comment with findings. You handle exactly **one PR per session**",
2295
+ "unless invoked from the multi-PR loop skill (`/review-prs`), in which case",
2296
+ "you process each eligible PR in turn.",
2297
+ "",
2298
+ "---",
2299
+ "",
2300
+ "## Phase 1: Identify the PR",
2301
+ "",
2302
+ "If a PR number was provided in your instructions, use that. Otherwise stop",
2303
+ "and report that you need a PR number \u2014 do not pick one yourself.",
2304
+ "",
2305
+ "## Phase 1.5: Pre-flight Eligibility Filter",
2306
+ "",
2307
+ "Before spending turns on a full review, run a cheap eligibility check:",
2308
+ "",
2309
+ "```bash",
2310
+ "gh pr view <pr-number> --json number,title,body,headRefName,mergeable,mergeStateStatus,statusCheckRollup",
2311
+ "```",
2312
+ "",
2313
+ "The PR is **eligible** only when **all** of the following hold:",
2314
+ "",
2315
+ '1. `mergeable == "MERGEABLE"` (no merge conflicts).',
2316
+ "2. No **failing** required checks in `statusCheckRollup` \u2014 CI must be",
2317
+ " green or still pending. Any `FAILURE`, `TIMED_OUT`, `CANCELLED`, or",
2318
+ " `ERROR` conclusion on a required check disqualifies the PR.",
2319
+ "3. The PR body contains a linked issue via one of the closing keywords:",
2320
+ " `Closes #N`, `Fixes #N`, or `Resolves #N` (case-insensitive).",
2321
+ "",
2322
+ "If **any** check fails, post a short comment explaining the reason and",
2323
+ "stop. Do not proceed to full review.",
2324
+ "",
2325
+ "```bash",
2326
+ "gh pr comment <pr-number> --body '<reason>'",
2327
+ "```",
2328
+ "",
2329
+ "Typical reasons:",
2330
+ "",
2331
+ "- `Not reviewable: merge conflicts \u2014 please rebase onto the default branch.`",
2332
+ "- `Not reviewable: required CI check <name> is failing.`",
2333
+ "- `Not reviewable: PR body is missing a linked issue (Closes #N / Fixes #N / Resolves #N).`",
2334
+ "",
2335
+ "## Phase 2: Gather Context",
2336
+ "",
2337
+ "```bash",
2338
+ "gh pr view <pr-number> --json number,title,body,headRefName,baseRefName,isDraft,state,labels,reviews",
2339
+ "gh pr diff <pr-number>",
2340
+ "gh pr checks <pr-number>",
2341
+ "```",
2342
+ "",
2343
+ "Extract the linked issue number from the PR body using the closing keywords",
2344
+ "(`Closes #N`, `Fixes #N`, or `Resolves #N`) identified in Phase 1.5.",
2345
+ "",
2346
+ "Then fetch the linked issue:",
2347
+ "",
2348
+ "```bash",
2349
+ "gh issue view <issue-number>",
2350
+ "```",
2351
+ "",
2352
+ "## Phase 3: Compare Diff to Acceptance Criteria",
2353
+ "",
2354
+ "Read the issue body for an **Acceptance Criteria** (or equivalent) section.",
2355
+ "Build a checklist from it. For each item:",
2356
+ "",
2357
+ "1. Locate the changes in the diff that satisfy it.",
2358
+ "2. Mark it as `met`, `partial`, or `missing`.",
2359
+ "3. Record the specific files / functions / tests that provide evidence.",
2360
+ "",
2361
+ "Also evaluate:",
2362
+ "",
2363
+ "- **Convention compliance** \u2014 PR title uses a conventional commit prefix,",
2364
+ " body includes a closing keyword, branch name follows project conventions",
2365
+ "- **Test coverage** \u2014 new or changed behavior has tests",
2366
+ "- **CI status** \u2014 `gh pr checks` reports all required checks passing",
2367
+ "- **Scope creep** \u2014 diff stays within the issue's stated scope",
2368
+ "",
2369
+ "## Phase 4: Decide and Act",
2370
+ "",
2371
+ "### If all acceptance criteria are met and CI is green",
2372
+ "",
2373
+ "Enable squash auto-merge with branch deletion. This queues the merge to",
2374
+ "happen once required checks pass; no separate approval review is needed.",
2375
+ "",
2376
+ "```bash",
2377
+ "gh pr merge <pr-number> --auto --squash --delete-branch \\",
2378
+ " --subject '<conventional-commit-title>' \\",
2379
+ " --body '<extended-description>'",
2380
+ "```",
2381
+ "",
2382
+ "The squash-merge subject should follow conventional commit format (e.g.",
2383
+ "`feat(scope): description`). The body should bullet the changes and end",
2384
+ "with `Closes #<issue-number>`.",
2385
+ "",
2386
+ "### If any criterion is missing, partial, or CI is failing",
2387
+ "",
2388
+ "Post a plain comment (not a formal review block) with grouped findings:",
2389
+ "",
2390
+ "```bash",
2391
+ "gh pr comment <pr-number> --body '<grouped findings>'",
2392
+ "```",
2393
+ "",
2394
+ "Group findings by severity (**Blocking** / **Suggested** / **Nitpick**).",
2395
+ "For each blocking finding, cite the unmet acceptance criterion and the",
2396
+ "file or function the gap lives in. Do **not** merge, and do **not** push",
2397
+ "any commits to the PR's branch.",
2398
+ "",
2399
+ "Rationale for using a plain comment rather than `gh pr review",
2400
+ "--request-changes`: it is lighter-weight, doesn't require the author to",
2401
+ "dismiss a formal review, and composes cleanly with the multi-PR loop.",
2402
+ "",
2403
+ "## Phase 5: Branch Cleanup and Issue Closure Verification",
2404
+ "",
2405
+ "Auto-merge may not be immediate. Poll the PR state up to 10 times, waiting",
2406
+ "30 seconds between polls:",
2407
+ "",
2408
+ "```bash",
2409
+ "gh pr view <pr-number> --json state --jq '.state'",
2410
+ "```",
2411
+ "",
2412
+ "- **`MERGED`** \u2014 clean up locally **and** verify the linked issue closed:",
2413
+ " ```bash",
2414
+ " git checkout {{repository.defaultBranch}}",
2415
+ " git pull origin {{repository.defaultBranch}}",
2416
+ " git fetch --prune origin",
2417
+ " git branch -d <branch-name> 2>/dev/null || git branch -D <branch-name> 2>/dev/null || true",
2418
+ " ```",
2419
+ " Then check the linked issue state:",
2420
+ " ```bash",
2421
+ " gh issue view <issue-number> --json state --jq '.state'",
2422
+ " ```",
2423
+ " If the issue is **not** `CLOSED`, close it explicitly (this covers",
2424
+ " malformed or missing closing keywords on the merge commit):",
2425
+ " ```bash",
2426
+ " gh issue close <issue-number> --reason completed",
2427
+ " gh issue comment <issue-number> --body 'PR #<pr-number> merged. Closing issue.'",
2428
+ " ```",
2429
+ "- **`CLOSED` (not merged)** \u2014 leave the branch in place; report the closure.",
2430
+ "- **Still `OPEN`** \u2014 auto-merge is pending; report and stop without deleting.",
2431
+ "",
2432
+ "---",
2433
+ "",
2434
+ "## Output Format",
2435
+ "",
2436
+ "Return a structured report:",
2437
+ "",
2438
+ "```",
2439
+ "PR #<number> \u2014 <title>",
2440
+ "Linked issue: #<issue-number>",
2441
+ "Verdict: AUTO_MERGE_ENABLED | NEEDS_CHANGES | INELIGIBLE | BLOCKED",
2442
+ "",
2443
+ "Acceptance criteria:",
2444
+ " [x] <criterion> \u2014 <evidence>",
2445
+ " [~] <criterion> \u2014 partial: <gap>",
2446
+ " [ ] <criterion> \u2014 missing",
2447
+ "",
2448
+ "Findings:",
2449
+ " - Blocking: <items>",
2450
+ " - Suggested: <items>",
2451
+ " - Nitpick: <items>",
2452
+ "",
2453
+ "Action taken: <enable-auto-merge | commented-on-the-pr | none>",
2454
+ "Branch state: <merged | open | closed>",
2455
+ "Issue state: <closed | open>",
2456
+ "```",
2457
+ "",
2458
+ "---",
2459
+ "",
2460
+ "## Rules",
2461
+ "",
2462
+ "1. **One PR per session** when invoked directly (`/review-pr`). When",
2463
+ " invoked from the multi-PR loop (`/review-prs`), process every eligible",
2464
+ " PR in turn.",
2465
+ "2. **Never merge without a linked issue.** If the PR body has no",
2466
+ " `Closes #N` / `Fixes #N` / `Resolves #N`, comment and stop.",
2467
+ "3. **Never merge with failing CI.** Even if every criterion is met,",
2468
+ " block on red checks.",
2469
+ "4. **Never bypass review conventions.** Always use `--squash`, `--auto`,",
2470
+ " and `--delete-branch` for merges. Do not force-merge.",
2471
+ "5. **Do not implement code.** You review, decide, and orchestrate. If",
2472
+ " the PR needs changes, comment and stop.",
2473
+ "6. **Never push commits to the PR's branch.** If the PR needs changes,",
2474
+ " comment and stop \u2014 do not attempt to fix it yourself. The PR author",
2475
+ " owns the branch; pushing to someone else's branch is out of scope.",
2476
+ "7. **In loop mode (`/review-prs`), never stop early.** If any review",
2477
+ " fails, comment and move to the next PR. Only abort the loop on a",
2478
+ " fatal error (e.g. `gh` auth failure, network outage).",
2479
+ "8. **Follow CLAUDE.md conventions** for all `git` and `gh` operations."
2480
+ ].join("\n")
2481
+ };
2482
+ var reviewPrSkill = {
2483
+ name: "review-pr",
2484
+ description: "Review a single pull request against its linked issue's acceptance criteria, then enable squash auto-merge or comment with findings",
2485
+ disableModelInvocation: true,
2486
+ userInvocable: true,
2487
+ context: "fork",
2488
+ agent: "pr-reviewer",
2489
+ platforms: { cursor: { exclude: true } },
2490
+ instructions: [
2491
+ "# Review Pull Request",
2492
+ "",
2493
+ "Run a full PR review against the linked issue's acceptance criteria,",
2494
+ "then either enable squash auto-merge or post a findings comment.",
2495
+ "",
2496
+ "## Usage",
2497
+ "",
2498
+ "/review-pr <pr-number>",
2499
+ "",
2500
+ "## What This Skill Does",
2501
+ "",
2502
+ "1. Runs a pre-flight eligibility filter (mergeable, CI not failing, has linked issue)",
2503
+ "2. Fetches the PR, its diff, CI status, and the linked issue",
2504
+ "3. Builds a checklist from the issue's acceptance criteria",
2505
+ "4. Compares the diff against each criterion",
2506
+ "5. Verifies PR conventions (title, closing keyword, branch name)",
2507
+ "6. Verifies CI is green",
2508
+ "7. **If all checks pass:** enables squash auto-merge (with `--delete-branch`)",
2509
+ "8. **If any check fails:** posts a findings comment via `gh pr comment`",
2510
+ "9. After merge, verifies the linked issue is closed and closes it if not",
2511
+ "10. Cleans up the local branch after merge",
2512
+ "",
2513
+ "## Input",
2514
+ "",
2515
+ "Provide the PR number to review. The skill resolves the linked issue from",
2516
+ "the PR body (`Closes #N` / `Fixes #N` / `Resolves #N`).",
2517
+ "",
2518
+ "## Output",
2519
+ "",
2520
+ "A structured report covering verdict, per-criterion status, findings",
2521
+ "grouped by severity, the action taken, and the final branch / issue state.",
2522
+ "",
2523
+ "## Composability",
2524
+ "",
2525
+ "This skill is generic and can be composed with the `github-workflow`",
2526
+ "bundle. The reviewer never implements code and never pushes to the PR",
2527
+ "branch \u2014 it only reviews, decides, and orchestrates merge or comment."
2528
+ ].join("\n")
2529
+ };
2530
+ var reviewPrsSkill = {
2531
+ name: "review-prs",
2532
+ description: "Loop over every eligible open pull request in the repository and review each one through the full pipeline",
2533
+ disableModelInvocation: true,
2534
+ userInvocable: true,
2535
+ context: "fork",
2536
+ agent: "pr-reviewer",
2537
+ platforms: { cursor: { exclude: true } },
2538
+ instructions: [
2539
+ "# Review All Eligible Pull Requests",
2540
+ "",
2541
+ "Run the pr-reviewer pipeline over every eligible open PR in",
2542
+ "**{{repository.owner}}/{{repository.name}}**, one after another, until",
2543
+ "the eligible queue is empty.",
2544
+ "",
2545
+ "## Usage",
2546
+ "",
2547
+ "/review-prs",
2548
+ "",
2549
+ "## What This Skill Does",
2550
+ "",
2551
+ "### Step 1: Enumerate open PRs",
2552
+ "",
2553
+ "```bash",
2554
+ "gh pr list --json number,title,body,headRefName,mergeable,mergeStateStatus,statusCheckRollup --limit 50",
2555
+ "```",
2556
+ "",
2557
+ "### Step 2: Filter to eligible PRs",
2558
+ "",
2559
+ "A PR is **eligible** when all of the following hold:",
2560
+ "",
2561
+ '1. `state == "OPEN"` (implicit from `gh pr list`).',
2562
+ '2. `mergeable == "MERGEABLE"` (no conflicts).',
2563
+ "3. No required check in `statusCheckRollup` has a failing conclusion",
2564
+ " (`FAILURE`, `TIMED_OUT`, `CANCELLED`, `ERROR`). CI green or still",
2565
+ " pending is fine.",
2566
+ "4. The PR body contains a linked issue (`Closes #N` / `Fixes #N` /",
2567
+ " `Resolves #N`, case-insensitive).",
2568
+ "",
2569
+ "Drop any PR that fails the filter from the queue. Do not comment on",
2570
+ "them from this skill \u2014 the individual `/review-pr` invocation handles",
2571
+ "the inline rejection comment when run on a specific PR.",
2572
+ "",
2573
+ "### Step 3: Process each eligible PR",
2574
+ "",
2575
+ "For every eligible PR, invoke the full pr-reviewer pipeline",
2576
+ "(Phases 1 through 5) as if `/review-pr <number>` had been called",
2577
+ "directly:",
2578
+ "",
2579
+ "- Gather context (diff, checks, linked issue)",
2580
+ "- Compare diff to acceptance criteria",
2581
+ "- Decide and act (enable auto-merge **or** post findings comment)",
2582
+ "- Verify branch / issue cleanup after merge",
2583
+ "",
2584
+ "Continue to the next PR after each one completes. Never stop the loop",
2585
+ "early because a single PR's review failed \u2014 comment and move on.",
2586
+ "",
2587
+ "### Step 4: Stop when the queue is empty",
2588
+ "",
2589
+ "When no eligible PRs remain, emit a final summary listing every PR",
2590
+ "processed and the verdict for each, then stop.",
2591
+ "",
2592
+ "## Output",
2593
+ "",
2594
+ "Per-PR structured report (same shape as `/review-pr`), followed by a",
2595
+ "one-line-per-PR summary at the end:",
2596
+ "",
2597
+ "```",
2598
+ "Summary:",
2599
+ " PR #<n>: <verdict>",
2600
+ " PR #<n>: <verdict>",
2601
+ " ...",
2602
+ "Total processed: <count>",
2603
+ "```",
2604
+ "",
2605
+ "## Failure Handling",
2606
+ "",
2607
+ "Only abort the loop on a fatal error (e.g. `gh` authentication failure,",
2608
+ "network outage). A failed review for an individual PR is not fatal \u2014",
2609
+ "comment on that PR and continue with the next."
2610
+ ].join("\n")
2611
+ };
2612
+ var prReviewBundle = {
2613
+ name: "pr-review",
2614
+ description: "Pull request review workflow: verifies PRs against their linked issues' acceptance criteria and orchestrates squash-merge, single or looped over all eligible PRs",
2615
+ // Default-apply: the PR review workflow is safe to include everywhere,
2616
+ // and keeping review/merge policy centralised in the pr-reviewer agent
2617
+ // means consumers get consistent behaviour out of the box. Consumers can
2618
+ // still exclude it explicitly via `excludeBundles` if desired.
2619
+ appliesWhen: () => true,
2620
+ rules: [
2621
+ {
2622
+ name: "pr-review-workflow",
2623
+ description: "Describes the /review-pr and /review-prs skills and their delegation to the pr-reviewer sub-agent",
2624
+ scope: AGENT_RULE_SCOPE.ALWAYS,
2625
+ content: [
2626
+ "# PR Review Workflow",
2627
+ "",
2628
+ "Two skills are available, both backed by the same `pr-reviewer`",
2629
+ "sub-agent:",
2630
+ "",
2631
+ "- **`/review-pr <pr-number>`** \u2014 review a single targeted PR.",
2632
+ "- **`/review-prs`** \u2014 loop over every eligible open PR in the",
2633
+ " repository and review each one in turn.",
2634
+ "",
2635
+ "The `pr-reviewer` sub-agent:",
2636
+ "",
2637
+ "1. Runs a pre-flight eligibility filter (mergeable, CI not failing,",
2638
+ " has a linked issue). Ineligible PRs get a short comment and are",
2639
+ " skipped.",
2640
+ "2. Fetches the PR, its diff, CI status, and the linked issue",
2641
+ "3. Builds a checklist from the issue's acceptance criteria",
2642
+ "4. Verifies the diff satisfies each criterion and that CI is green",
2643
+ "5. **Enables squash auto-merge** (with `--delete-branch`) when all",
2644
+ " checks pass \u2014 no explicit approval review",
2645
+ "6. **Comments with grouped findings** when any check fails (plain",
2646
+ " `gh pr comment`, not a formal `--request-changes` review)",
2647
+ "7. After a successful merge, verifies the linked issue is closed",
2648
+ " and closes it explicitly if the merge commit did not",
2649
+ "8. Cleans up the local branch after merge",
2650
+ "",
2651
+ "The reviewer **never** implements code and **never** pushes commits",
2652
+ "to a PR's branch \u2014 it only reviews, decides, and orchestrates merge",
2653
+ "or comment. In loop mode, a failed review for one PR never stops",
2654
+ "the loop; the reviewer comments and moves on. See the `pr-reviewer`",
2655
+ "agent definition for the full phase-by-phase contract."
2656
+ ].join("\n"),
2657
+ platforms: {
2658
+ cursor: { exclude: true }
2659
+ },
2660
+ tags: ["workflow"]
2661
+ }
2662
+ ],
2663
+ skills: [reviewPrSkill, reviewPrsSkill],
2664
+ subAgents: [prReviewerSubAgent]
2665
+ };
2666
+
2339
2667
  // src/agent/bundles/projen.ts
2340
2668
  var projenBundle = {
2341
2669
  name: "projen",
@@ -3048,6 +3376,11 @@ var VERSION = {
3048
3376
  * Version of Node.js to use in CI workflows at github actions.
3049
3377
  */
3050
3378
  NODE_WORKFLOWS: "24",
3379
+ /**
3380
+ * Version of `pnpm/action-setup` to use in GitHub workflows.
3381
+ * Tracks the version projen currently emits (see node_modules/projen/lib/javascript/node-project.js).
3382
+ */
3383
+ PNPM_ACTION_SETUP_VERSION: "v5",
3051
3384
  /**
3052
3385
  * Version of PNPM to use in workflows at github actions.
3053
3386
  */
@@ -3056,6 +3389,11 @@ var VERSION = {
3056
3389
  * Version of Projen to use.
3057
3390
  */
3058
3391
  PROJEN_VERSION: "0.99.48",
3392
+ /**
3393
+ * Version of `actions/setup-node` to use in GitHub workflows.
3394
+ * Tracks the version projen currently emits (see node_modules/projen/lib/github/workflows.js).
3395
+ */
3396
+ SETUP_NODE_ACTION_VERSION: "v6",
3059
3397
  /**
3060
3398
  * Version of sharp to pin for StarlightProject (required peer for
3061
3399
  * Starlight's image optimization pipeline).
@@ -3243,7 +3581,8 @@ var BUILT_IN_BUNDLES = [
3243
3581
  githubWorkflowBundle,
3244
3582
  slackBundle,
3245
3583
  meetingAnalysisBundle,
3246
- orchestratorBundle
3584
+ orchestratorBundle,
3585
+ prReviewBundle
3247
3586
  ];
3248
3587
 
3249
3588
  // src/agent/bundles/scope.ts
@@ -4904,6 +5243,7 @@ var import_release = require("projen/lib/release");
4904
5243
  var import_ts_deepmerge2 = require("ts-deepmerge");
4905
5244
 
4906
5245
  // src/projects/monorepo-project.ts
5246
+ var import_github2 = require("projen/lib/github");
4907
5247
  var import_javascript3 = require("projen/lib/javascript");
4908
5248
  var import_typescript3 = require("projen/lib/typescript");
4909
5249
  var import_ts_deepmerge = require("ts-deepmerge");
@@ -5533,16 +5873,15 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
5533
5873
  name: "Build Sub Projects",
5534
5874
  run: `npx projen ${ROOT_CI_TASK_NAME}`
5535
5875
  },
5536
- {
5876
+ import_github2.WorkflowSteps.uploadArtifact({
5537
5877
  name: "Upload Turbo runs",
5538
5878
  if: "always()",
5539
- uses: "actions/upload-artifact@v4.6.2",
5879
+ continueOnError: true,
5540
5880
  with: {
5541
5881
  name: "turbo-runs",
5542
5882
  path: ".turbo/runs"
5543
- },
5544
- continueOnError: true
5545
- }
5883
+ }
5884
+ })
5546
5885
  );
5547
5886
  }
5548
5887
  if (options.resetTask !== false) {
@@ -5937,7 +6276,7 @@ var import_ts_deepmerge3 = require("ts-deepmerge");
5937
6276
  var import_utils11 = __toESM(require_lib());
5938
6277
  var import_projen18 = require("projen");
5939
6278
  var import_build = require("projen/lib/build");
5940
- var import_github2 = require("projen/lib/github");
6279
+ var import_github3 = require("projen/lib/github");
5941
6280
  var import_workflows_model5 = require("projen/lib/github/workflows-model");
5942
6281
  var PROD_DEPLOY_NAME = "prod-deploy";
5943
6282
  var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen18.Component {
@@ -5956,7 +6295,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen18.Compone
5956
6295
  return [
5957
6296
  {
5958
6297
  name: "Setup Node",
5959
- uses: "actions/setup-node@v4",
6298
+ uses: `actions/setup-node@${VERSION.SETUP_NODE_ACTION_VERSION}`,
5960
6299
  with: {
5961
6300
  ["node-version"]: VERSION.NODE_WORKFLOWS
5962
6301
  },
@@ -5969,7 +6308,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen18.Compone
5969
6308
  return [
5970
6309
  {
5971
6310
  name: "Setup PNPM",
5972
- uses: "pnpm/action-setup@v3",
6311
+ uses: `pnpm/action-setup@${VERSION.PNPM_ACTION_SETUP_VERSION}`,
5973
6312
  with: {
5974
6313
  version: VERSION.PNPM_VERSION
5975
6314
  }
@@ -6053,7 +6392,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen18.Compone
6053
6392
  );
6054
6393
  }
6055
6394
  this.rootProject = project.root;
6056
- const github = import_github2.GitHub.of(this.rootProject);
6395
+ const github = import_github3.GitHub.of(this.rootProject);
6057
6396
  if (!github) {
6058
6397
  throw new Error(
6059
6398
  "AwsDeployWorkflow requires a GitHub component in the root project"
@@ -6188,16 +6527,15 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen18.Compone
6188
6527
  name: "Build Sub Projects",
6189
6528
  run: `npx projen ${ROOT_CI_TASK_NAME}`
6190
6529
  },
6191
- {
6530
+ import_github3.WorkflowSteps.uploadArtifact({
6192
6531
  name: "Upload Turbo runs",
6193
6532
  if: "always()",
6194
- uses: "actions/upload-artifact@v4.6.2",
6533
+ continueOnError: true,
6195
6534
  with: {
6196
6535
  name: "turbo-runs",
6197
6536
  path: ".turbo/runs"
6198
- },
6199
- continueOnError: true
6200
- }
6537
+ }
6538
+ })
6201
6539
  );
6202
6540
  }
6203
6541
  super.preSynthesize();
@@ -6206,7 +6544,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen18.Compone
6206
6544
 
6207
6545
  // src/workflows/aws-teardown-workflow.ts
6208
6546
  var import_projen19 = require("projen");
6209
- var import_github3 = require("projen/lib/github");
6547
+ var import_github4 = require("projen/lib/github");
6210
6548
  var import_workflows_model6 = require("projen/lib/github/workflows-model");
6211
6549
  var DEFAULT_TEARDOWN_BRANCH_PATTERNS = [
6212
6550
  "feat/*",
@@ -6256,7 +6594,7 @@ var AwsTeardownWorkflow = class extends import_projen19.Component {
6256
6594
  "AwsTeardownWorkflow requires the root project to be a MonorepoProject"
6257
6595
  );
6258
6596
  }
6259
- const github = import_github3.GitHub.of(this.rootProject);
6597
+ const github = import_github4.GitHub.of(this.rootProject);
6260
6598
  if (!github) {
6261
6599
  throw new Error(
6262
6600
  "AwsTeardownWorkflow requires a GitHub component in the root project"
@@ -6266,7 +6604,7 @@ var AwsTeardownWorkflow = class extends import_projen19.Component {
6266
6604
  deleteBranchPatterns,
6267
6605
  awsDestructionTargets
6268
6606
  );
6269
- const workflow = new import_github3.GithubWorkflow(github, "teardown-dev");
6607
+ const workflow = new import_github4.GithubWorkflow(github, "teardown-dev");
6270
6608
  workflow.on({
6271
6609
  workflowDispatch: {},
6272
6610
  schedule: [
@@ -6770,6 +7108,7 @@ var TypeScriptConfig = class extends import_projen22.Component {
6770
7108
  meetingAnalysisBundle,
6771
7109
  orchestratorBundle,
6772
7110
  pnpmBundle,
7111
+ prReviewBundle,
6773
7112
  projenBundle,
6774
7113
  resolveModelAlias,
6775
7114
  resolveTemplateVariables,