@codedrifters/configulator 0.0.199 → 0.0.201
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.d.mts +21 -1
- package/lib/index.d.ts +21 -1
- package/lib/index.js +874 -73
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +872 -73
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -228,7 +228,9 @@ __export(index_exports, {
|
|
|
228
228
|
meetingAnalysisBundle: () => meetingAnalysisBundle,
|
|
229
229
|
orchestratorBundle: () => orchestratorBundle,
|
|
230
230
|
pnpmBundle: () => pnpmBundle,
|
|
231
|
+
prReviewBundle: () => prReviewBundle,
|
|
231
232
|
projenBundle: () => projenBundle,
|
|
233
|
+
requirementsAnalystBundle: () => requirementsAnalystBundle,
|
|
232
234
|
resolveModelAlias: () => resolveModelAlias,
|
|
233
235
|
resolveTemplateVariables: () => resolveTemplateVariables,
|
|
234
236
|
slackBundle: () => slackBundle,
|
|
@@ -506,55 +508,11 @@ var createRuleSkill = {
|
|
|
506
508
|
"- Use `ruleExtensions` to add project-specific content to existing bundle rules instead of replacing them"
|
|
507
509
|
].join("\n")
|
|
508
510
|
};
|
|
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
511
|
var baseBundle = {
|
|
554
512
|
name: "base",
|
|
555
513
|
description: "Core rules: project overview, interaction style, and general coding conventions",
|
|
556
514
|
appliesWhen: () => true,
|
|
557
|
-
skills: [createRuleSkill
|
|
515
|
+
skills: [createRuleSkill],
|
|
558
516
|
rules: [
|
|
559
517
|
{
|
|
560
518
|
name: "project-overview",
|
|
@@ -1046,21 +1004,7 @@ var githubWorkflowBundle = {
|
|
|
1046
1004
|
"6. **Create the PR** using `gh pr create`:",
|
|
1047
1005
|
" - **Title**: use a conventional commit style title (e.g., `feat(scope): short description`)",
|
|
1048
1006
|
" - **Body**: include `Closes #<issue-number>` (derived from the branch name) and a brief summary of changes",
|
|
1049
|
-
"7. **
|
|
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
|
-
"```",
|
|
1007
|
+
"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
1008
|
"",
|
|
1065
1009
|
"### PR Body Template",
|
|
1066
1010
|
"",
|
|
@@ -1081,7 +1025,7 @@ var githubWorkflowBundle = {
|
|
|
1081
1025
|
"",
|
|
1082
1026
|
"- Always derive the issue number from the branch name (e.g., `feat/42-add-login` \u2192 `#42`)",
|
|
1083
1027
|
"- Use conventional commit format for the PR title",
|
|
1084
|
-
"-
|
|
1028
|
+
"- Delegate merge to the `pr-reviewer` sub-agent \u2014 do not merge manually and do not enable auto-merge directly"
|
|
1085
1029
|
].join("\n"),
|
|
1086
1030
|
tags: ["workflow"]
|
|
1087
1031
|
}
|
|
@@ -1863,8 +1807,7 @@ var orchestratorSubAgent = {
|
|
|
1863
1807
|
" - Verify PR conventions: conventional commit title, closing keyword, summary present",
|
|
1864
1808
|
" - Check CI status: `gh pr checks N`",
|
|
1865
1809
|
"3. If the PR passes review:",
|
|
1866
|
-
" -
|
|
1867
|
-
" - Enable auto-merge: `gh pr merge N --auto --squash`",
|
|
1810
|
+
" - Enable squash auto-merge: `gh pr merge N --auto --squash --subject '<conventional-commit-title>' --body '<extended-description>'`",
|
|
1868
1811
|
"4. If the PR fails review:",
|
|
1869
1812
|
" - Request changes: `gh pr review N --request-changes --body '<findings>'`",
|
|
1870
1813
|
"5. After each PR (whether merged or not):",
|
|
@@ -2124,10 +2067,10 @@ var issueWorkerSubAgent = {
|
|
|
2124
2067
|
'Closes #<issue-number>"',
|
|
2125
2068
|
"```",
|
|
2126
2069
|
"",
|
|
2127
|
-
"
|
|
2128
|
-
"
|
|
2129
|
-
"
|
|
2130
|
-
"
|
|
2070
|
+
"Do **not** enable auto-merge yourself. The `pr-reviewer` sub-agent owns",
|
|
2071
|
+
"review and merge for every PR \u2014 it verifies the diff against the issue's",
|
|
2072
|
+
"acceptance criteria and enables squash auto-merge only when all checks",
|
|
2073
|
+
"pass. Record the new PR number so a reviewer can be invoked next.",
|
|
2131
2074
|
"",
|
|
2132
2075
|
"## Phase 8: Update Status",
|
|
2133
2076
|
"",
|
|
@@ -2138,9 +2081,9 @@ var issueWorkerSubAgent = {
|
|
|
2138
2081
|
"",
|
|
2139
2082
|
"## Phase 9: Branch Cleanup",
|
|
2140
2083
|
"",
|
|
2141
|
-
"
|
|
2142
|
-
"up to 10 times, waiting 30 seconds between polls, until it either
|
|
2143
|
-
"closes, or the timeout is reached:",
|
|
2084
|
+
"The PR will not auto-merge until the `pr-reviewer` enables it. Poll the PR",
|
|
2085
|
+
"state up to 10 times, waiting 30 seconds between polls, until it either",
|
|
2086
|
+
"merges, closes, or the timeout is reached:",
|
|
2144
2087
|
"",
|
|
2145
2088
|
"```bash",
|
|
2146
2089
|
"gh pr view <pr-number> --json state --jq '.state'",
|
|
@@ -2154,8 +2097,8 @@ var issueWorkerSubAgent = {
|
|
|
2154
2097
|
" ```",
|
|
2155
2098
|
"- **If the state becomes `CLOSED` (not merged):** leave the branch in place",
|
|
2156
2099
|
" and report that the PR was closed without merging. Do not delete the branch.",
|
|
2157
|
-
"- **If still `OPEN` after the polling window:** report that
|
|
2158
|
-
"
|
|
2100
|
+
"- **If still `OPEN` after the polling window:** report that the PR is",
|
|
2101
|
+
" awaiting review/merge and stop. Do not delete the branch.",
|
|
2159
2102
|
"",
|
|
2160
2103
|
"---",
|
|
2161
2104
|
"",
|
|
@@ -2336,6 +2279,392 @@ var pnpmBundle = {
|
|
|
2336
2279
|
]
|
|
2337
2280
|
};
|
|
2338
2281
|
|
|
2282
|
+
// src/agent/bundles/pr-review.ts
|
|
2283
|
+
var prReviewerSubAgent = {
|
|
2284
|
+
name: "pr-reviewer",
|
|
2285
|
+
description: "Reviews a pull request against its linked issue's acceptance criteria, then enables squash auto-merge or comments with findings",
|
|
2286
|
+
model: AGENT_MODEL.POWERFUL,
|
|
2287
|
+
maxTurns: 40,
|
|
2288
|
+
platforms: { cursor: { exclude: true } },
|
|
2289
|
+
prompt: [
|
|
2290
|
+
"# PR Reviewer Agent",
|
|
2291
|
+
"",
|
|
2292
|
+
"You review a single pull request in **{{repository.owner}}/{{repository.name}}**",
|
|
2293
|
+
"against its linked issue's acceptance criteria, verify code quality and",
|
|
2294
|
+
"convention compliance, and then either enable squash auto-merge or leave",
|
|
2295
|
+
"a review comment with findings. You handle exactly **one PR per session**",
|
|
2296
|
+
"unless invoked from the multi-PR loop skill (`/review-prs`), in which case",
|
|
2297
|
+
"you process each eligible PR in turn.",
|
|
2298
|
+
"",
|
|
2299
|
+
"---",
|
|
2300
|
+
"",
|
|
2301
|
+
"## Phase 1: Identify the PR",
|
|
2302
|
+
"",
|
|
2303
|
+
"If a PR number was provided in your instructions, use that. Otherwise stop",
|
|
2304
|
+
"and report that you need a PR number \u2014 do not pick one yourself.",
|
|
2305
|
+
"",
|
|
2306
|
+
"## Phase 1.5: Pre-flight Eligibility Filter",
|
|
2307
|
+
"",
|
|
2308
|
+
"Before spending turns on a full review, run a cheap eligibility check:",
|
|
2309
|
+
"",
|
|
2310
|
+
"```bash",
|
|
2311
|
+
"gh pr view <pr-number> --json number,title,body,headRefName,mergeable,mergeStateStatus,statusCheckRollup",
|
|
2312
|
+
"```",
|
|
2313
|
+
"",
|
|
2314
|
+
"The PR is **eligible** only when **all** of the following hold:",
|
|
2315
|
+
"",
|
|
2316
|
+
'1. `mergeable == "MERGEABLE"` (no merge conflicts).',
|
|
2317
|
+
"2. No **failing** required checks in `statusCheckRollup` \u2014 CI must be",
|
|
2318
|
+
" green or still pending. Any `FAILURE`, `TIMED_OUT`, `CANCELLED`, or",
|
|
2319
|
+
" `ERROR` conclusion on a required check disqualifies the PR.",
|
|
2320
|
+
"3. The PR body contains a linked issue via one of the closing keywords:",
|
|
2321
|
+
" `Closes #N`, `Fixes #N`, or `Resolves #N` (case-insensitive).",
|
|
2322
|
+
"",
|
|
2323
|
+
"If **any** check fails, post a short comment explaining the reason and",
|
|
2324
|
+
"stop. Do not proceed to full review.",
|
|
2325
|
+
"",
|
|
2326
|
+
"```bash",
|
|
2327
|
+
"gh pr comment <pr-number> --body '<reason>'",
|
|
2328
|
+
"```",
|
|
2329
|
+
"",
|
|
2330
|
+
"Typical reasons:",
|
|
2331
|
+
"",
|
|
2332
|
+
"- `Not reviewable: merge conflicts \u2014 please rebase onto the default branch.`",
|
|
2333
|
+
"- `Not reviewable: required CI check <name> is failing.`",
|
|
2334
|
+
"- `Not reviewable: PR body is missing a linked issue (Closes #N / Fixes #N / Resolves #N).`",
|
|
2335
|
+
"",
|
|
2336
|
+
"## Phase 2: Gather Context",
|
|
2337
|
+
"",
|
|
2338
|
+
"```bash",
|
|
2339
|
+
"gh pr view <pr-number> --json number,title,body,headRefName,baseRefName,isDraft,state,labels,reviews",
|
|
2340
|
+
"gh pr diff <pr-number>",
|
|
2341
|
+
"gh pr checks <pr-number>",
|
|
2342
|
+
"```",
|
|
2343
|
+
"",
|
|
2344
|
+
"Extract the linked issue number from the PR body using the closing keywords",
|
|
2345
|
+
"(`Closes #N`, `Fixes #N`, or `Resolves #N`) identified in Phase 1.5.",
|
|
2346
|
+
"",
|
|
2347
|
+
"Then fetch the linked issue:",
|
|
2348
|
+
"",
|
|
2349
|
+
"```bash",
|
|
2350
|
+
"gh issue view <issue-number>",
|
|
2351
|
+
"```",
|
|
2352
|
+
"",
|
|
2353
|
+
"## Phase 3: Compare Diff to Acceptance Criteria",
|
|
2354
|
+
"",
|
|
2355
|
+
"Read the issue body for an **Acceptance Criteria** (or equivalent) section.",
|
|
2356
|
+
"Build a checklist from it. For each item:",
|
|
2357
|
+
"",
|
|
2358
|
+
"1. Locate the changes in the diff that satisfy it.",
|
|
2359
|
+
"2. Mark it as `met`, `partial`, or `missing`.",
|
|
2360
|
+
"3. Record the specific files / functions / tests that provide evidence.",
|
|
2361
|
+
"",
|
|
2362
|
+
"Also evaluate:",
|
|
2363
|
+
"",
|
|
2364
|
+
"- **Convention compliance** \u2014 PR title uses a conventional commit prefix,",
|
|
2365
|
+
" body includes a closing keyword, branch name follows project conventions",
|
|
2366
|
+
"- **Test coverage** \u2014 new or changed behavior has tests",
|
|
2367
|
+
"- **CI status** \u2014 `gh pr checks` reports all required checks passing",
|
|
2368
|
+
"- **Scope creep** \u2014 diff stays within the issue's stated scope",
|
|
2369
|
+
"",
|
|
2370
|
+
"## Phase 4: Decide and Act",
|
|
2371
|
+
"",
|
|
2372
|
+
"### If all acceptance criteria are met and CI is green",
|
|
2373
|
+
"",
|
|
2374
|
+
"Enable squash auto-merge with branch deletion. This queues the merge to",
|
|
2375
|
+
"happen once required checks pass; no separate approval review is needed.",
|
|
2376
|
+
"",
|
|
2377
|
+
"```bash",
|
|
2378
|
+
"gh pr merge <pr-number> --auto --squash --delete-branch \\",
|
|
2379
|
+
" --subject '<conventional-commit-title>' \\",
|
|
2380
|
+
" --body '<extended-description>'",
|
|
2381
|
+
"```",
|
|
2382
|
+
"",
|
|
2383
|
+
"The squash-merge subject should follow conventional commit format (e.g.",
|
|
2384
|
+
"`feat(scope): description`). The body should bullet the changes and end",
|
|
2385
|
+
"with `Closes #<issue-number>`.",
|
|
2386
|
+
"",
|
|
2387
|
+
"### If any criterion is missing, partial, or CI is failing",
|
|
2388
|
+
"",
|
|
2389
|
+
"Post a plain comment (not a formal review block) with grouped findings:",
|
|
2390
|
+
"",
|
|
2391
|
+
"```bash",
|
|
2392
|
+
"gh pr comment <pr-number> --body '<grouped findings>'",
|
|
2393
|
+
"```",
|
|
2394
|
+
"",
|
|
2395
|
+
"Group findings by severity (**Blocking** / **Suggested** / **Nitpick**).",
|
|
2396
|
+
"For each blocking finding, cite the unmet acceptance criterion and the",
|
|
2397
|
+
"file or function the gap lives in. Do **not** merge, and do **not** push",
|
|
2398
|
+
"any commits to the PR's branch.",
|
|
2399
|
+
"",
|
|
2400
|
+
"Rationale for using a plain comment rather than `gh pr review",
|
|
2401
|
+
"--request-changes`: it is lighter-weight, doesn't require the author to",
|
|
2402
|
+
"dismiss a formal review, and composes cleanly with the multi-PR loop.",
|
|
2403
|
+
"",
|
|
2404
|
+
"## Phase 5: Branch Cleanup and Issue Closure Verification",
|
|
2405
|
+
"",
|
|
2406
|
+
"Auto-merge may not be immediate. Poll the PR state up to 10 times, waiting",
|
|
2407
|
+
"30 seconds between polls:",
|
|
2408
|
+
"",
|
|
2409
|
+
"```bash",
|
|
2410
|
+
"gh pr view <pr-number> --json state --jq '.state'",
|
|
2411
|
+
"```",
|
|
2412
|
+
"",
|
|
2413
|
+
"- **`MERGED`** \u2014 clean up locally **and** verify the linked issue closed:",
|
|
2414
|
+
" ```bash",
|
|
2415
|
+
" git checkout {{repository.defaultBranch}}",
|
|
2416
|
+
" git pull origin {{repository.defaultBranch}}",
|
|
2417
|
+
" git fetch --prune origin",
|
|
2418
|
+
" git branch -d <branch-name> 2>/dev/null || git branch -D <branch-name> 2>/dev/null || true",
|
|
2419
|
+
" ```",
|
|
2420
|
+
" Then check the linked issue state:",
|
|
2421
|
+
" ```bash",
|
|
2422
|
+
" gh issue view <issue-number> --json state --jq '.state'",
|
|
2423
|
+
" ```",
|
|
2424
|
+
" If the issue is **not** `CLOSED`, close it explicitly (this covers",
|
|
2425
|
+
" malformed or missing closing keywords on the merge commit):",
|
|
2426
|
+
" ```bash",
|
|
2427
|
+
" gh issue close <issue-number> --reason completed",
|
|
2428
|
+
" gh issue comment <issue-number> --body 'PR #<pr-number> merged. Closing issue.'",
|
|
2429
|
+
" ```",
|
|
2430
|
+
"- **`CLOSED` (not merged)** \u2014 leave the branch in place; report the closure.",
|
|
2431
|
+
"- **Still `OPEN`** \u2014 auto-merge is pending; report and stop without deleting.",
|
|
2432
|
+
"",
|
|
2433
|
+
"---",
|
|
2434
|
+
"",
|
|
2435
|
+
"## Output Format",
|
|
2436
|
+
"",
|
|
2437
|
+
"Return a structured report:",
|
|
2438
|
+
"",
|
|
2439
|
+
"```",
|
|
2440
|
+
"PR #<number> \u2014 <title>",
|
|
2441
|
+
"Linked issue: #<issue-number>",
|
|
2442
|
+
"Verdict: AUTO_MERGE_ENABLED | NEEDS_CHANGES | INELIGIBLE | BLOCKED",
|
|
2443
|
+
"",
|
|
2444
|
+
"Acceptance criteria:",
|
|
2445
|
+
" [x] <criterion> \u2014 <evidence>",
|
|
2446
|
+
" [~] <criterion> \u2014 partial: <gap>",
|
|
2447
|
+
" [ ] <criterion> \u2014 missing",
|
|
2448
|
+
"",
|
|
2449
|
+
"Findings:",
|
|
2450
|
+
" - Blocking: <items>",
|
|
2451
|
+
" - Suggested: <items>",
|
|
2452
|
+
" - Nitpick: <items>",
|
|
2453
|
+
"",
|
|
2454
|
+
"Action taken: <enable-auto-merge | commented-on-the-pr | none>",
|
|
2455
|
+
"Branch state: <merged | open | closed>",
|
|
2456
|
+
"Issue state: <closed | open>",
|
|
2457
|
+
"```",
|
|
2458
|
+
"",
|
|
2459
|
+
"---",
|
|
2460
|
+
"",
|
|
2461
|
+
"## Rules",
|
|
2462
|
+
"",
|
|
2463
|
+
"1. **One PR per session** when invoked directly (`/review-pr`). When",
|
|
2464
|
+
" invoked from the multi-PR loop (`/review-prs`), process every eligible",
|
|
2465
|
+
" PR in turn.",
|
|
2466
|
+
"2. **Never merge without a linked issue.** If the PR body has no",
|
|
2467
|
+
" `Closes #N` / `Fixes #N` / `Resolves #N`, comment and stop.",
|
|
2468
|
+
"3. **Never merge with failing CI.** Even if every criterion is met,",
|
|
2469
|
+
" block on red checks.",
|
|
2470
|
+
"4. **Never bypass review conventions.** Always use `--squash`, `--auto`,",
|
|
2471
|
+
" and `--delete-branch` for merges. Do not force-merge.",
|
|
2472
|
+
"5. **Do not implement code.** You review, decide, and orchestrate. If",
|
|
2473
|
+
" the PR needs changes, comment and stop.",
|
|
2474
|
+
"6. **Never push commits to the PR's branch.** If the PR needs changes,",
|
|
2475
|
+
" comment and stop \u2014 do not attempt to fix it yourself. The PR author",
|
|
2476
|
+
" owns the branch; pushing to someone else's branch is out of scope.",
|
|
2477
|
+
"7. **In loop mode (`/review-prs`), never stop early.** If any review",
|
|
2478
|
+
" fails, comment and move to the next PR. Only abort the loop on a",
|
|
2479
|
+
" fatal error (e.g. `gh` auth failure, network outage).",
|
|
2480
|
+
"8. **Follow CLAUDE.md conventions** for all `git` and `gh` operations."
|
|
2481
|
+
].join("\n")
|
|
2482
|
+
};
|
|
2483
|
+
var reviewPrSkill = {
|
|
2484
|
+
name: "review-pr",
|
|
2485
|
+
description: "Review a single pull request against its linked issue's acceptance criteria, then enable squash auto-merge or comment with findings",
|
|
2486
|
+
disableModelInvocation: true,
|
|
2487
|
+
userInvocable: true,
|
|
2488
|
+
context: "fork",
|
|
2489
|
+
agent: "pr-reviewer",
|
|
2490
|
+
platforms: { cursor: { exclude: true } },
|
|
2491
|
+
instructions: [
|
|
2492
|
+
"# Review Pull Request",
|
|
2493
|
+
"",
|
|
2494
|
+
"Run a full PR review against the linked issue's acceptance criteria,",
|
|
2495
|
+
"then either enable squash auto-merge or post a findings comment.",
|
|
2496
|
+
"",
|
|
2497
|
+
"## Usage",
|
|
2498
|
+
"",
|
|
2499
|
+
"/review-pr <pr-number>",
|
|
2500
|
+
"",
|
|
2501
|
+
"## What This Skill Does",
|
|
2502
|
+
"",
|
|
2503
|
+
"1. Runs a pre-flight eligibility filter (mergeable, CI not failing, has linked issue)",
|
|
2504
|
+
"2. Fetches the PR, its diff, CI status, and the linked issue",
|
|
2505
|
+
"3. Builds a checklist from the issue's acceptance criteria",
|
|
2506
|
+
"4. Compares the diff against each criterion",
|
|
2507
|
+
"5. Verifies PR conventions (title, closing keyword, branch name)",
|
|
2508
|
+
"6. Verifies CI is green",
|
|
2509
|
+
"7. **If all checks pass:** enables squash auto-merge (with `--delete-branch`)",
|
|
2510
|
+
"8. **If any check fails:** posts a findings comment via `gh pr comment`",
|
|
2511
|
+
"9. After merge, verifies the linked issue is closed and closes it if not",
|
|
2512
|
+
"10. Cleans up the local branch after merge",
|
|
2513
|
+
"",
|
|
2514
|
+
"## Input",
|
|
2515
|
+
"",
|
|
2516
|
+
"Provide the PR number to review. The skill resolves the linked issue from",
|
|
2517
|
+
"the PR body (`Closes #N` / `Fixes #N` / `Resolves #N`).",
|
|
2518
|
+
"",
|
|
2519
|
+
"## Output",
|
|
2520
|
+
"",
|
|
2521
|
+
"A structured report covering verdict, per-criterion status, findings",
|
|
2522
|
+
"grouped by severity, the action taken, and the final branch / issue state.",
|
|
2523
|
+
"",
|
|
2524
|
+
"## Composability",
|
|
2525
|
+
"",
|
|
2526
|
+
"This skill is generic and can be composed with the `github-workflow`",
|
|
2527
|
+
"bundle. The reviewer never implements code and never pushes to the PR",
|
|
2528
|
+
"branch \u2014 it only reviews, decides, and orchestrates merge or comment."
|
|
2529
|
+
].join("\n")
|
|
2530
|
+
};
|
|
2531
|
+
var reviewPrsSkill = {
|
|
2532
|
+
name: "review-prs",
|
|
2533
|
+
description: "Loop over every eligible open pull request in the repository and review each one through the full pipeline",
|
|
2534
|
+
disableModelInvocation: true,
|
|
2535
|
+
userInvocable: true,
|
|
2536
|
+
context: "fork",
|
|
2537
|
+
agent: "pr-reviewer",
|
|
2538
|
+
platforms: { cursor: { exclude: true } },
|
|
2539
|
+
instructions: [
|
|
2540
|
+
"# Review All Eligible Pull Requests",
|
|
2541
|
+
"",
|
|
2542
|
+
"Run the pr-reviewer pipeline over every eligible open PR in",
|
|
2543
|
+
"**{{repository.owner}}/{{repository.name}}**, one after another, until",
|
|
2544
|
+
"the eligible queue is empty.",
|
|
2545
|
+
"",
|
|
2546
|
+
"## Usage",
|
|
2547
|
+
"",
|
|
2548
|
+
"/review-prs",
|
|
2549
|
+
"",
|
|
2550
|
+
"## What This Skill Does",
|
|
2551
|
+
"",
|
|
2552
|
+
"### Step 1: Enumerate open PRs",
|
|
2553
|
+
"",
|
|
2554
|
+
"```bash",
|
|
2555
|
+
"gh pr list --json number,title,body,headRefName,mergeable,mergeStateStatus,statusCheckRollup --limit 50",
|
|
2556
|
+
"```",
|
|
2557
|
+
"",
|
|
2558
|
+
"### Step 2: Filter to eligible PRs",
|
|
2559
|
+
"",
|
|
2560
|
+
"A PR is **eligible** when all of the following hold:",
|
|
2561
|
+
"",
|
|
2562
|
+
'1. `state == "OPEN"` (implicit from `gh pr list`).',
|
|
2563
|
+
'2. `mergeable == "MERGEABLE"` (no conflicts).',
|
|
2564
|
+
"3. No required check in `statusCheckRollup` has a failing conclusion",
|
|
2565
|
+
" (`FAILURE`, `TIMED_OUT`, `CANCELLED`, `ERROR`). CI green or still",
|
|
2566
|
+
" pending is fine.",
|
|
2567
|
+
"4. The PR body contains a linked issue (`Closes #N` / `Fixes #N` /",
|
|
2568
|
+
" `Resolves #N`, case-insensitive).",
|
|
2569
|
+
"",
|
|
2570
|
+
"Drop any PR that fails the filter from the queue. Do not comment on",
|
|
2571
|
+
"them from this skill \u2014 the individual `/review-pr` invocation handles",
|
|
2572
|
+
"the inline rejection comment when run on a specific PR.",
|
|
2573
|
+
"",
|
|
2574
|
+
"### Step 3: Process each eligible PR",
|
|
2575
|
+
"",
|
|
2576
|
+
"For every eligible PR, invoke the full pr-reviewer pipeline",
|
|
2577
|
+
"(Phases 1 through 5) as if `/review-pr <number>` had been called",
|
|
2578
|
+
"directly:",
|
|
2579
|
+
"",
|
|
2580
|
+
"- Gather context (diff, checks, linked issue)",
|
|
2581
|
+
"- Compare diff to acceptance criteria",
|
|
2582
|
+
"- Decide and act (enable auto-merge **or** post findings comment)",
|
|
2583
|
+
"- Verify branch / issue cleanup after merge",
|
|
2584
|
+
"",
|
|
2585
|
+
"Continue to the next PR after each one completes. Never stop the loop",
|
|
2586
|
+
"early because a single PR's review failed \u2014 comment and move on.",
|
|
2587
|
+
"",
|
|
2588
|
+
"### Step 4: Stop when the queue is empty",
|
|
2589
|
+
"",
|
|
2590
|
+
"When no eligible PRs remain, emit a final summary listing every PR",
|
|
2591
|
+
"processed and the verdict for each, then stop.",
|
|
2592
|
+
"",
|
|
2593
|
+
"## Output",
|
|
2594
|
+
"",
|
|
2595
|
+
"Per-PR structured report (same shape as `/review-pr`), followed by a",
|
|
2596
|
+
"one-line-per-PR summary at the end:",
|
|
2597
|
+
"",
|
|
2598
|
+
"```",
|
|
2599
|
+
"Summary:",
|
|
2600
|
+
" PR #<n>: <verdict>",
|
|
2601
|
+
" PR #<n>: <verdict>",
|
|
2602
|
+
" ...",
|
|
2603
|
+
"Total processed: <count>",
|
|
2604
|
+
"```",
|
|
2605
|
+
"",
|
|
2606
|
+
"## Failure Handling",
|
|
2607
|
+
"",
|
|
2608
|
+
"Only abort the loop on a fatal error (e.g. `gh` authentication failure,",
|
|
2609
|
+
"network outage). A failed review for an individual PR is not fatal \u2014",
|
|
2610
|
+
"comment on that PR and continue with the next."
|
|
2611
|
+
].join("\n")
|
|
2612
|
+
};
|
|
2613
|
+
var prReviewBundle = {
|
|
2614
|
+
name: "pr-review",
|
|
2615
|
+
description: "Pull request review workflow: verifies PRs against their linked issues' acceptance criteria and orchestrates squash-merge, single or looped over all eligible PRs",
|
|
2616
|
+
// Default-apply: the PR review workflow is safe to include everywhere,
|
|
2617
|
+
// and keeping review/merge policy centralised in the pr-reviewer agent
|
|
2618
|
+
// means consumers get consistent behaviour out of the box. Consumers can
|
|
2619
|
+
// still exclude it explicitly via `excludeBundles` if desired.
|
|
2620
|
+
appliesWhen: () => true,
|
|
2621
|
+
rules: [
|
|
2622
|
+
{
|
|
2623
|
+
name: "pr-review-workflow",
|
|
2624
|
+
description: "Describes the /review-pr and /review-prs skills and their delegation to the pr-reviewer sub-agent",
|
|
2625
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
2626
|
+
content: [
|
|
2627
|
+
"# PR Review Workflow",
|
|
2628
|
+
"",
|
|
2629
|
+
"Two skills are available, both backed by the same `pr-reviewer`",
|
|
2630
|
+
"sub-agent:",
|
|
2631
|
+
"",
|
|
2632
|
+
"- **`/review-pr <pr-number>`** \u2014 review a single targeted PR.",
|
|
2633
|
+
"- **`/review-prs`** \u2014 loop over every eligible open PR in the",
|
|
2634
|
+
" repository and review each one in turn.",
|
|
2635
|
+
"",
|
|
2636
|
+
"The `pr-reviewer` sub-agent:",
|
|
2637
|
+
"",
|
|
2638
|
+
"1. Runs a pre-flight eligibility filter (mergeable, CI not failing,",
|
|
2639
|
+
" has a linked issue). Ineligible PRs get a short comment and are",
|
|
2640
|
+
" skipped.",
|
|
2641
|
+
"2. Fetches the PR, its diff, CI status, and the linked issue",
|
|
2642
|
+
"3. Builds a checklist from the issue's acceptance criteria",
|
|
2643
|
+
"4. Verifies the diff satisfies each criterion and that CI is green",
|
|
2644
|
+
"5. **Enables squash auto-merge** (with `--delete-branch`) when all",
|
|
2645
|
+
" checks pass \u2014 no explicit approval review",
|
|
2646
|
+
"6. **Comments with grouped findings** when any check fails (plain",
|
|
2647
|
+
" `gh pr comment`, not a formal `--request-changes` review)",
|
|
2648
|
+
"7. After a successful merge, verifies the linked issue is closed",
|
|
2649
|
+
" and closes it explicitly if the merge commit did not",
|
|
2650
|
+
"8. Cleans up the local branch after merge",
|
|
2651
|
+
"",
|
|
2652
|
+
"The reviewer **never** implements code and **never** pushes commits",
|
|
2653
|
+
"to a PR's branch \u2014 it only reviews, decides, and orchestrates merge",
|
|
2654
|
+
"or comment. In loop mode, a failed review for one PR never stops",
|
|
2655
|
+
"the loop; the reviewer comments and moves on. See the `pr-reviewer`",
|
|
2656
|
+
"agent definition for the full phase-by-phase contract."
|
|
2657
|
+
].join("\n"),
|
|
2658
|
+
platforms: {
|
|
2659
|
+
cursor: { exclude: true }
|
|
2660
|
+
},
|
|
2661
|
+
tags: ["workflow"]
|
|
2662
|
+
}
|
|
2663
|
+
],
|
|
2664
|
+
skills: [reviewPrSkill, reviewPrsSkill],
|
|
2665
|
+
subAgents: [prReviewerSubAgent]
|
|
2666
|
+
};
|
|
2667
|
+
|
|
2339
2668
|
// src/agent/bundles/projen.ts
|
|
2340
2669
|
var projenBundle = {
|
|
2341
2670
|
name: "projen",
|
|
@@ -2605,6 +2934,474 @@ var projenBundle = {
|
|
|
2605
2934
|
]
|
|
2606
2935
|
};
|
|
2607
2936
|
|
|
2937
|
+
// src/agent/bundles/requirements-analyst.ts
|
|
2938
|
+
var requirementsAnalystSubAgent = {
|
|
2939
|
+
name: "requirements-analyst",
|
|
2940
|
+
description: "Discovers requirement gaps from BCM model docs, competitive analysis, product docs, and meeting extracts. Produces scan reports and proposals for the downstream requirements-writer agent. Runs through a 3-phase pipeline (scan \u2192 draft \u2192 trace), one phase per session, tracked by req:* GitHub issue labels.",
|
|
2941
|
+
model: AGENT_MODEL.POWERFUL,
|
|
2942
|
+
maxTurns: 80,
|
|
2943
|
+
platforms: { cursor: { exclude: true } },
|
|
2944
|
+
prompt: [
|
|
2945
|
+
"# Requirements Analyst Agent",
|
|
2946
|
+
"",
|
|
2947
|
+
"Dedicated agent loop for discovering requirement gaps from BCM (Business",
|
|
2948
|
+
"Capability Model) documents, product docs, and competitive analysis \u2014 then",
|
|
2949
|
+
"creating well-formed requirement issues for the downstream",
|
|
2950
|
+
"requirements-writer (BCM writer) agent to draft. Designed for scheduled",
|
|
2951
|
+
"execution downstream of the BCM writer and company research agents.",
|
|
2952
|
+
"",
|
|
2953
|
+
"Follow your project's shared agent conventions (`AGENTS.md`,",
|
|
2954
|
+
"`CLAUDE.md`, or equivalent) for all commit, branch, and PR rules.",
|
|
2955
|
+
"",
|
|
2956
|
+
"## Design Principles",
|
|
2957
|
+
"",
|
|
2958
|
+
"1. **Discover, don't write.** This agent identifies *what requirements are",
|
|
2959
|
+
" missing*. The requirements-writer skill writes the actual documents. The",
|
|
2960
|
+
" boundary keeps this agent fast and the requirements-writer authoritative.",
|
|
2961
|
+
"2. **Trace everything.** Every discovered gap links to the source that",
|
|
2962
|
+
" revealed it (a BCM model doc, competitive analysis, product doc, or",
|
|
2963
|
+
" meeting extract).",
|
|
2964
|
+
"3. **Respect the taxonomy.** Route every discovered requirement to the",
|
|
2965
|
+
" correct BCM category (FR, BR, NFR, SEC, DR, INT, OPS, UX, MT, ADR, TR)",
|
|
2966
|
+
" using the disambiguation rules in the requirements-writer skill.",
|
|
2967
|
+
"4. **Deduplicate.** Before creating an issue, check whether a requirement",
|
|
2968
|
+
" already exists or an issue is already open for it.",
|
|
2969
|
+
"",
|
|
2970
|
+
"---",
|
|
2971
|
+
"",
|
|
2972
|
+
"## State Machine Overview",
|
|
2973
|
+
"",
|
|
2974
|
+
"Requirements synthesis flows through **3 phases**:",
|
|
2975
|
+
"",
|
|
2976
|
+
"```",
|
|
2977
|
+
"\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510",
|
|
2978
|
+
"\u2502 1. SCAN \u2502\u2500\u2500\u2500\u2500\u25B6\u2502 2. DRAFT \u2502\u2500\u2500\u2500\u2500\u25B6\u2502 3. TRACE \u2502",
|
|
2979
|
+
"\u2502 Read docs, \u2502 \u2502 Write gap \u2502 \u2502 Create GH \u2502",
|
|
2980
|
+
"\u2502 identify \u2502 \u2502 report with \u2502 \u2502 issues and \u2502",
|
|
2981
|
+
"\u2502 gaps, check \u2502 \u2502 requirement \u2502 \u2502 update src \u2502",
|
|
2982
|
+
"\u2502 for dupes \u2502 \u2502 proposals \u2502 \u2502 docs with \u2502",
|
|
2983
|
+
"\u2502 \u2502 \u2502 \u2502 \u2502 traceability\u2502",
|
|
2984
|
+
"\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518",
|
|
2985
|
+
"```",
|
|
2986
|
+
"",
|
|
2987
|
+
"**Issue labels encode the phase:**",
|
|
2988
|
+
"",
|
|
2989
|
+
"| Label | Phase | Session work |",
|
|
2990
|
+
"|-------|-------|-------------|",
|
|
2991
|
+
"| `req:scan` | 1. Scan | Read source docs, identify potential requirement gaps, check against existing requirements and open issues, write deduplicated scan report |",
|
|
2992
|
+
"| `req:draft` | 2. Draft | Write gap report with proposed requirements |",
|
|
2993
|
+
"| `req:trace` | 3. Trace | Create GitHub issues for each proposed requirement and update source documents with traceability notes |",
|
|
2994
|
+
"",
|
|
2995
|
+
"All issues also carry `type:requirement` and a `status:*` label.",
|
|
2996
|
+
"",
|
|
2997
|
+
"**Issue count per scan cycle:** 1 scan + 1 draft + 1 trace = **3 sessions**.",
|
|
2998
|
+
"",
|
|
2999
|
+
"**Shortened paths:**",
|
|
3000
|
+
"- No gaps found after scan \u2192 skip draft and trace \u2192 **1 session**",
|
|
3001
|
+
"- No source docs need traceability updates \u2192 still **3 sessions** (trace",
|
|
3002
|
+
" handles both issue creation and doc updates)",
|
|
3003
|
+
"",
|
|
3004
|
+
"---",
|
|
3005
|
+
"",
|
|
3006
|
+
"## Configurable Paths",
|
|
3007
|
+
"",
|
|
3008
|
+
"Projects adopting this bundle must define these paths in their agent",
|
|
3009
|
+
"configuration (`agentConfig.rules` extension or project-level docs):",
|
|
3010
|
+
"",
|
|
3011
|
+
"| Placeholder | Meaning | Typical value |",
|
|
3012
|
+
"|-------------|---------|---------------|",
|
|
3013
|
+
"| `<BCM_DOCS_ROOT>` | Root of BCM model docs (capability models) | `src/content/docs/concepts/` |",
|
|
3014
|
+
"| `<COMPETITIVE_ROOT>` | Competitive analysis docs | `src/content/docs/business-strategy/competitive/` |",
|
|
3015
|
+
"| `<PRODUCT_ROOT>` | Product roadmap / entity taxonomy | `src/content/docs/product/` |",
|
|
3016
|
+
"| `<MEETINGS_ROOT>` | Meeting extracts | `src/content/docs/research/meetings/` |",
|
|
3017
|
+
"| `<RESEARCH_REQUIREMENTS_ROOT>` | Scan reports and proposals | `src/content/docs/research/requirements/` |",
|
|
3018
|
+
"| `<REQUIREMENTS_ROOT>` | Final requirement documents (owned by requirements-writer) | `src/content/docs/requirements/` |",
|
|
3019
|
+
"| `<PREFIX>` | Project-specific requirement ID prefix | e.g. `VRTX`, `ACME` |",
|
|
3020
|
+
"",
|
|
3021
|
+
"If your project stores these in different locations, substitute accordingly",
|
|
3022
|
+
"wherever the phase instructions reference a path.",
|
|
3023
|
+
"",
|
|
3024
|
+
"---",
|
|
3025
|
+
"",
|
|
3026
|
+
"## Agent Loop",
|
|
3027
|
+
"",
|
|
3028
|
+
"Run this loop exactly once per session. Never start a second issue.",
|
|
3029
|
+
"",
|
|
3030
|
+
"1. Claim one open `type:requirement` issue using phase priority:",
|
|
3031
|
+
" `req:scan` > `req:draft` > `req:trace`.",
|
|
3032
|
+
"2. Transition `status:ready` \u2192 `status:in-progress` and create the branch",
|
|
3033
|
+
" per your project's branch-naming convention.",
|
|
3034
|
+
"3. Execute the phase handler that matches the issue's `req:*` label.",
|
|
3035
|
+
"4. Commit, push, open a PR (if applicable), and close the issue per your",
|
|
3036
|
+
" project's PR workflow.",
|
|
3037
|
+
"",
|
|
3038
|
+
"---",
|
|
3039
|
+
"",
|
|
3040
|
+
"## Phase 1: Scan (`req:scan`)",
|
|
3041
|
+
"",
|
|
3042
|
+
"**Goal:** Read source documents, identify where requirements are missing,",
|
|
3043
|
+
"incomplete, or contradictory, then check each potential gap against existing",
|
|
3044
|
+
"requirements and open issues to eliminate duplicates. Produces a single",
|
|
3045
|
+
"deduplicated scan report.",
|
|
3046
|
+
"",
|
|
3047
|
+
"**Budget:** Reading source docs + reading requirement registries + searching",
|
|
3048
|
+
"issues. Write one deduplicated scan output file.",
|
|
3049
|
+
"",
|
|
3050
|
+
"### Scan Sources",
|
|
3051
|
+
"",
|
|
3052
|
+
"The issue specifies which source(s) to scan. Common scan scopes:",
|
|
3053
|
+
"",
|
|
3054
|
+
"| Scope | What to read | What to look for |",
|
|
3055
|
+
"|-------|-------------|-----------------|",
|
|
3056
|
+
"| **BCM model doc** | One `{PREFIX}-NNN` doc under `<BCM_DOCS_ROOT>` | `## Vortex Relevance` (or equivalent project-relevance) section \u2014 gaps where capabilities exist but no FR/BR/INT addresses them |",
|
|
3057
|
+
"| **Competitive analysis** | One `comp-*.md` doc under `<COMPETITIVE_ROOT>` | Feature comparison gaps \u2014 competitor features the product lacks requirements for |",
|
|
3058
|
+
"| **Product roadmap** | `<PRODUCT_ROOT>/prioritized-feature-roadmap.md` | Roadmap items without corresponding FRs |",
|
|
3059
|
+
"| **Entity taxonomy** | `<PRODUCT_ROOT>/entity-taxonomy.md` | Entities without CRUD requirements (FR), data requirements (DR), or security requirements (SEC) |",
|
|
3060
|
+
"| **Meeting extract** | `<MEETINGS_ROOT>/meeting-*.extract.md` | Requirements identified but not yet formalized |",
|
|
3061
|
+
"",
|
|
3062
|
+
"### Steps",
|
|
3063
|
+
"",
|
|
3064
|
+
"1. **Read the source documents** specified in the issue.",
|
|
3065
|
+
"",
|
|
3066
|
+
"2. **Identify potential gaps.** For each potential missing requirement:",
|
|
3067
|
+
" - Classify into the correct BCM category (FR, BR, NFR, SEC, DR, INT,",
|
|
3068
|
+
" OPS, UX, MT, ADR, TR)",
|
|
3069
|
+
" - Apply the disambiguation rules from the requirements-writer skill",
|
|
3070
|
+
" - Note the source that revealed the gap",
|
|
3071
|
+
" - Estimate priority based on the source context",
|
|
3072
|
+
"",
|
|
3073
|
+
"3. **Read the requirements registry.** Scan `_index.md` files in each",
|
|
3074
|
+
" `<REQUIREMENTS_ROOT>/<category>/` directory to know what already exists.",
|
|
3075
|
+
"",
|
|
3076
|
+
"4. **Search for existing issues.** For each potential gap, search open issues:",
|
|
3077
|
+
" ```bash",
|
|
3078
|
+
' gh issue list --label "type:requirement" --state open \\',
|
|
3079
|
+
" --json number,title --limit 100",
|
|
3080
|
+
" ```",
|
|
3081
|
+
"",
|
|
3082
|
+
"5. **Classify each gap:**",
|
|
3083
|
+
" - **New** \u2014 no existing requirement or open issue covers this",
|
|
3084
|
+
" - **Duplicate** \u2014 an existing requirement already addresses this",
|
|
3085
|
+
" - **In progress** \u2014 an open issue already targets this",
|
|
3086
|
+
" - **Partial** \u2014 existing requirement partially covers this; note the gap",
|
|
3087
|
+
"",
|
|
3088
|
+
"6. **Write the deduplicated scan report** to:",
|
|
3089
|
+
" ```",
|
|
3090
|
+
" <RESEARCH_REQUIREMENTS_ROOT>/req-scan-<scope>-<YYYY-MM-DD>.md",
|
|
3091
|
+
" ```",
|
|
3092
|
+
"",
|
|
3093
|
+
" Format:",
|
|
3094
|
+
" ```markdown",
|
|
3095
|
+
" ---",
|
|
3096
|
+
' title: "Requirements Scan: <scope>"',
|
|
3097
|
+
" date: YYYY-MM-DD",
|
|
3098
|
+
" parent_issue: <N>",
|
|
3099
|
+
" status: complete",
|
|
3100
|
+
" ---",
|
|
3101
|
+
"",
|
|
3102
|
+
" # Requirements Scan: <scope>",
|
|
3103
|
+
"",
|
|
3104
|
+
" ## Source Documents Reviewed",
|
|
3105
|
+
" - <path> \u2014 <brief description>",
|
|
3106
|
+
"",
|
|
3107
|
+
" ## Existing Requirements Checked",
|
|
3108
|
+
" - <category>: <count> existing docs, <count> open issues",
|
|
3109
|
+
"",
|
|
3110
|
+
" ## Identified Gaps (New)",
|
|
3111
|
+
" ### Gap 1: <Title>",
|
|
3112
|
+
" - **Category:** FR / BR / NFR / SEC / DR / INT / OPS / UX / MT / ADR / TR",
|
|
3113
|
+
" - **Source:** <path to doc + section that revealed this gap>",
|
|
3114
|
+
" - **Priority:** High / Normal / Low",
|
|
3115
|
+
" - **Rationale:** <why this requirement is needed>",
|
|
3116
|
+
" - **Duplicate check:** No existing requirement or open issue found",
|
|
3117
|
+
" - **Proposed scope:** <1-2 sentences on what the requirement should cover>",
|
|
3118
|
+
"",
|
|
3119
|
+
" ## Already Covered",
|
|
3120
|
+
" <list of potential gaps that turned out to already have requirements>",
|
|
3121
|
+
"",
|
|
3122
|
+
" ## In Progress",
|
|
3123
|
+
" <gaps that already have open issues \u2014 include issue numbers>",
|
|
3124
|
+
"",
|
|
3125
|
+
" ## Ambiguous / Needs Human Decision",
|
|
3126
|
+
" <gaps where the correct category or scope is unclear>",
|
|
3127
|
+
" ```",
|
|
3128
|
+
"",
|
|
3129
|
+
"7. **Create downstream issues based on findings:**",
|
|
3130
|
+
" - If any new gaps were identified \u2192 create `req:draft` issue",
|
|
3131
|
+
" (blocked on this issue via `Depends on: #N`).",
|
|
3132
|
+
" - If **no gaps** were found \u2192 stop (no further phases needed). Comment",
|
|
3133
|
+
" on the issue noting that no gaps were identified, and proceed directly",
|
|
3134
|
+
" to commit and push. The scan issue will be marked done with no",
|
|
3135
|
+
" downstream work needed.",
|
|
3136
|
+
"",
|
|
3137
|
+
"8. **Commit and push.**",
|
|
3138
|
+
"",
|
|
3139
|
+
"---",
|
|
3140
|
+
"",
|
|
3141
|
+
"## Phase 2: Draft (`req:draft`)",
|
|
3142
|
+
"",
|
|
3143
|
+
"**Goal:** Expand each identified gap into a requirement proposal with enough",
|
|
3144
|
+
"detail for the requirements-writer to produce a full document.",
|
|
3145
|
+
"",
|
|
3146
|
+
"**Budget:** No web searches. Reading + writing.",
|
|
3147
|
+
"",
|
|
3148
|
+
"### Steps",
|
|
3149
|
+
"",
|
|
3150
|
+
"1. **Read the scan report** from Phase 1.",
|
|
3151
|
+
"",
|
|
3152
|
+
"2. **For each gap**, write a detailed proposal:",
|
|
3153
|
+
"",
|
|
3154
|
+
" ```markdown",
|
|
3155
|
+
" ## Proposed: <PREFIX>-<NNN> \u2014 <Title>",
|
|
3156
|
+
"",
|
|
3157
|
+
" **Category:** <FR/BR/NFR/SEC/DR/INT/OPS/UX/MT/ADR/TR>",
|
|
3158
|
+
" **Priority:** <High/Normal/Low>",
|
|
3159
|
+
" **Source:** <document path and section>",
|
|
3160
|
+
"",
|
|
3161
|
+
" ### Summary",
|
|
3162
|
+
" <2-3 sentences describing what the requirement should capture>",
|
|
3163
|
+
"",
|
|
3164
|
+
" ### Draft Acceptance Criteria",
|
|
3165
|
+
" - [ ] <testable criterion 1>",
|
|
3166
|
+
" - [ ] <testable criterion 2>",
|
|
3167
|
+
" - [ ] <testable criterion 3>",
|
|
3168
|
+
"",
|
|
3169
|
+
" ### Traceability",
|
|
3170
|
+
" - **Implements:** <BR or parent requirement if applicable>",
|
|
3171
|
+
" - **Related:** <existing requirements that interact with this one>",
|
|
3172
|
+
" - **Source:** <BCM doc, competitive analysis, or meeting that revealed",
|
|
3173
|
+
" the gap \u2014 use a markdown link. If the source is a meeting note, the",
|
|
3174
|
+
" downstream requirement doc must include the same meeting as a link in",
|
|
3175
|
+
" its Traceability `Related:` list.>",
|
|
3176
|
+
"",
|
|
3177
|
+
" ### Decision Authority",
|
|
3178
|
+
' <"Direct write" for BR/FR/NFR/SEC/UX, or "Proposed \u2014 needs human',
|
|
3179
|
+
' decision" for ADR/TR, or "Mixed \u2014 defer technology choices" for',
|
|
3180
|
+
" DR/MT/INT/OPS>",
|
|
3181
|
+
"",
|
|
3182
|
+
" ### Notes for Requirements Writer",
|
|
3183
|
+
" <any context the writer should know \u2014 related ADRs, existing partial",
|
|
3184
|
+
" coverage, relevant competitive features>",
|
|
3185
|
+
" ```",
|
|
3186
|
+
"",
|
|
3187
|
+
"3. **Write the proposals** to:",
|
|
3188
|
+
" ```",
|
|
3189
|
+
" <RESEARCH_REQUIREMENTS_ROOT>/req-proposals-<scope>-<YYYY-MM-DD>.md",
|
|
3190
|
+
" ```",
|
|
3191
|
+
"",
|
|
3192
|
+
"4. **Determine next sequence numbers.** Check each target category",
|
|
3193
|
+
" directory under `<REQUIREMENTS_ROOT>/<category>/` to find the next",
|
|
3194
|
+
" available `NNN` for each proposed requirement.",
|
|
3195
|
+
"",
|
|
3196
|
+
"5. **Create the `req:trace` issue** blocked on this draft issue.",
|
|
3197
|
+
"",
|
|
3198
|
+
"6. **Commit and push.**",
|
|
3199
|
+
"",
|
|
3200
|
+
"---",
|
|
3201
|
+
"",
|
|
3202
|
+
"## Phase 3: Trace (`req:trace`)",
|
|
3203
|
+
"",
|
|
3204
|
+
"**Goal:** Create GitHub issues for each proposed requirement and update",
|
|
3205
|
+
"source documents with traceability notes indicating that requirement issues",
|
|
3206
|
+
"were created.",
|
|
3207
|
+
"",
|
|
3208
|
+
"**Budget:** No web searches. Issue creation + minor edits to source",
|
|
3209
|
+
"documents.",
|
|
3210
|
+
"",
|
|
3211
|
+
"### Steps",
|
|
3212
|
+
"",
|
|
3213
|
+
"1. **Read the proposals** from Phase 2.",
|
|
3214
|
+
"",
|
|
3215
|
+
"2. **Create requirement issues.** For each proposal:",
|
|
3216
|
+
"",
|
|
3217
|
+
" All `type:requirement` issues default to `priority:medium` (override",
|
|
3218
|
+
" only if the proposal's priority was explicitly High or Low).",
|
|
3219
|
+
"",
|
|
3220
|
+
" ```bash",
|
|
3221
|
+
" gh issue create \\",
|
|
3222
|
+
' --title "docs(<category>): <PREFIX>-<NNN> \u2014 <title>" \\',
|
|
3223
|
+
' --label "type:requirement" --label "status:ready" --label "priority:medium" \\',
|
|
3224
|
+
' --body "## Objective',
|
|
3225
|
+
" Write <PREFIX>-<NNN> \u2014 <title>.",
|
|
3226
|
+
"",
|
|
3227
|
+
" ## Context",
|
|
3228
|
+
" - **Gap identified by:** requirements scan of <source>",
|
|
3229
|
+
" - **Proposals file:** <RESEARCH_REQUIREMENTS_ROOT>/req-proposals-<scope>-<date>.md",
|
|
3230
|
+
"",
|
|
3231
|
+
" ## Inputs",
|
|
3232
|
+
" - **Depends on:** (none)",
|
|
3233
|
+
" - **Read:** <RESEARCH_REQUIREMENTS_ROOT>/req-proposals-<scope>-<date>.md, <source docs>",
|
|
3234
|
+
"",
|
|
3235
|
+
" ## Acceptance Criteria",
|
|
3236
|
+
" - [ ] Requirement document follows <category> template",
|
|
3237
|
+
" - [ ] Traceability links to source BCM/competitive/product doc",
|
|
3238
|
+
" - [ ] Registry index updated",
|
|
3239
|
+
" - [ ] Decision authority rules followed (direct write vs. proposed)",
|
|
3240
|
+
"",
|
|
3241
|
+
" ## Scope Size",
|
|
3242
|
+
" small",
|
|
3243
|
+
"",
|
|
3244
|
+
" ## Output Path",
|
|
3245
|
+
' <REQUIREMENTS_ROOT>/<category>/<PREFIX>-<NNN>-<slug>.md"',
|
|
3246
|
+
" ```",
|
|
3247
|
+
"",
|
|
3248
|
+
"3. **Update source documents.** In each BCM model doc or competitive",
|
|
3249
|
+
" analysis that was scanned, add a note in the `## Vortex Relevance` or",
|
|
3250
|
+
" `## Strategic Implications` section indicating that a requirement issue",
|
|
3251
|
+
" was created:",
|
|
3252
|
+
"",
|
|
3253
|
+
" ```markdown",
|
|
3254
|
+
" - Gap addressed: see [<PREFIX>-<NNN>](<relative path to requirement doc>)",
|
|
3255
|
+
" (issue #<N>)",
|
|
3256
|
+
" ```",
|
|
3257
|
+
"",
|
|
3258
|
+
"4. **Comment on the scan issue** with a summary of all issues created and",
|
|
3259
|
+
" all docs updated.",
|
|
3260
|
+
"",
|
|
3261
|
+
"5. **Commit and push.**",
|
|
3262
|
+
"",
|
|
3263
|
+
"---",
|
|
3264
|
+
"",
|
|
3265
|
+
"## Coordination with Other Agents",
|
|
3266
|
+
"",
|
|
3267
|
+
"| Direction | Agent | What |",
|
|
3268
|
+
"|-----------|-------|------|",
|
|
3269
|
+
"| Upstream | BCM Writer | Scans `## Vortex Relevance` sections for capability gaps |",
|
|
3270
|
+
"| Upstream | Company Research | Scans competitive analysis for feature comparison gaps |",
|
|
3271
|
+
"| Upstream | Meeting Analyst | Scans meeting extracts for requirement proposals |",
|
|
3272
|
+
"| Downstream | Requirements Writer (BCM Writer) | Creates `type:requirement` issues for the skill to draft |",
|
|
3273
|
+
"",
|
|
3274
|
+
"**File boundaries:** Writes to `<RESEARCH_REQUIREMENTS_ROOT>/req-*.md` and",
|
|
3275
|
+
"minor traceability edits to `<BCM_DOCS_ROOT>` and `<COMPETITIVE_ROOT>`.",
|
|
3276
|
+
"Never writes to `<REQUIREMENTS_ROOT>/` \u2014 that is owned by the",
|
|
3277
|
+
"requirements-writer agent.",
|
|
3278
|
+
"",
|
|
3279
|
+
"---",
|
|
3280
|
+
"",
|
|
3281
|
+
"## Blocked Issues",
|
|
3282
|
+
"",
|
|
3283
|
+
"Additional block reasons specific to requirements synthesis:",
|
|
3284
|
+
"- Source document has unresolved contradictions",
|
|
3285
|
+
"- Category classification is ambiguous (needs human disambiguation)",
|
|
3286
|
+
"- Dependent BCM documents are still in draft with placeholder content",
|
|
3287
|
+
"",
|
|
3288
|
+
"---",
|
|
3289
|
+
"",
|
|
3290
|
+
"## Rules",
|
|
3291
|
+
"",
|
|
3292
|
+
"- **Discover, don't write requirements.** Create issues for the",
|
|
3293
|
+
" requirements-writer \u2014 don't write requirement documents directly.",
|
|
3294
|
+
"- **Deduplicate rigorously.** Check both existing docs and open issues",
|
|
3295
|
+
" before flagging a gap.",
|
|
3296
|
+
"- **Respect decision authority.** Mark ADR/TR proposals as needing human",
|
|
3297
|
+
" decision. Don't create direct-write issues for technology choices.",
|
|
3298
|
+
"- **Bidirectional traceability.** Every `req-scan-*.md` and",
|
|
3299
|
+
" `req-proposals-*.md` must include a `## Produced` section listing the",
|
|
3300
|
+
" downstream requirement issues (and eventual requirement documents) it",
|
|
3301
|
+
" spawned, as markdown links; each formal requirement document under",
|
|
3302
|
+
" `<REQUIREMENTS_ROOT>/` must include a forward link back to the scan or",
|
|
3303
|
+
" proposal that produced it."
|
|
3304
|
+
].join("\n")
|
|
3305
|
+
};
|
|
3306
|
+
var scanRequirementsSkill = {
|
|
3307
|
+
name: "scan-requirements",
|
|
3308
|
+
description: "Kick off a requirements-analyst scan across BCM model docs, competitive analysis, product docs, or meeting extracts. Creates a req:scan issue and dispatches Phase 1.",
|
|
3309
|
+
disableModelInvocation: true,
|
|
3310
|
+
userInvocable: true,
|
|
3311
|
+
context: "fork",
|
|
3312
|
+
agent: "requirements-analyst",
|
|
3313
|
+
platforms: { cursor: { exclude: true } },
|
|
3314
|
+
instructions: [
|
|
3315
|
+
"# Scan Requirements",
|
|
3316
|
+
"",
|
|
3317
|
+
"Kick off a requirements-analyst scan cycle. Creates a `req:scan` issue",
|
|
3318
|
+
"targeted at the requested scope and dispatches Phase 1 (Scan) in the",
|
|
3319
|
+
"requirements-analyst agent.",
|
|
3320
|
+
"",
|
|
3321
|
+
"## Usage",
|
|
3322
|
+
"",
|
|
3323
|
+
"/scan-requirements <scope>",
|
|
3324
|
+
"",
|
|
3325
|
+
"Where `<scope>` is one of:",
|
|
3326
|
+
"- `bcm:<PREFIX-NNN>` \u2014 a single BCM model doc",
|
|
3327
|
+
"- `competitive:<slug>` \u2014 a single competitive analysis doc",
|
|
3328
|
+
"- `product-roadmap` \u2014 the prioritized feature roadmap",
|
|
3329
|
+
"- `entity-taxonomy` \u2014 the entity taxonomy doc",
|
|
3330
|
+
"- `meeting:<slug>` \u2014 a meeting extract",
|
|
3331
|
+
"- `all-bcm` / `all-competitive` \u2014 full sweep (long-running)",
|
|
3332
|
+
"",
|
|
3333
|
+
"## Steps",
|
|
3334
|
+
"",
|
|
3335
|
+
"1. Create a `req:scan` issue with `type:requirement`, `priority:medium`,",
|
|
3336
|
+
" and `status:ready`. Body must list the files to read and the scan scope.",
|
|
3337
|
+
"2. Execute Phase 1 (Scan) of the requirements-analyst agent.",
|
|
3338
|
+
"3. If gaps are found, a `req:draft` issue is created automatically.",
|
|
3339
|
+
"",
|
|
3340
|
+
"## Output",
|
|
3341
|
+
"",
|
|
3342
|
+
"- A `req-scan-<scope>-<YYYY-MM-DD>.md` file under the project's research",
|
|
3343
|
+
" requirements directory.",
|
|
3344
|
+
"- A `req:draft` issue if any gaps were identified."
|
|
3345
|
+
].join("\n")
|
|
3346
|
+
};
|
|
3347
|
+
var requirementsAnalystBundle = {
|
|
3348
|
+
name: "requirements-analyst",
|
|
3349
|
+
description: "Requirements gap-discovery agent bundle for BCM-driven projects. 3-phase pipeline (scan, draft, trace) with req:* phase labels.",
|
|
3350
|
+
appliesWhen: () => true,
|
|
3351
|
+
rules: [
|
|
3352
|
+
{
|
|
3353
|
+
name: "requirements-analyst-workflow",
|
|
3354
|
+
description: "Describes the 3-phase requirements gap-discovery pipeline, the req:* label taxonomy, and the boundary with the downstream requirements-writer agent.",
|
|
3355
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
3356
|
+
content: [
|
|
3357
|
+
"# Requirements Analyst Workflow",
|
|
3358
|
+
"",
|
|
3359
|
+
"Use `/scan-requirements <scope>` to kick off a requirements gap",
|
|
3360
|
+
"discovery cycle. The pipeline runs in 3 phases \u2014 scan, draft, trace \u2014",
|
|
3361
|
+
"each tracked by its own GitHub issue labeled `req:scan`, `req:draft`,",
|
|
3362
|
+
"or `req:trace`. All issues carry `type:requirement`.",
|
|
3363
|
+
"",
|
|
3364
|
+
"The requirements-analyst *discovers gaps and drafts proposals*; it",
|
|
3365
|
+
"does **not** write final requirement documents. Writing is the job of",
|
|
3366
|
+
"the downstream requirements-writer (BCM writer) agent. Keep that",
|
|
3367
|
+
"boundary clean: proposals land under the research requirements",
|
|
3368
|
+
"directory, not under the authoritative requirements tree.",
|
|
3369
|
+
"",
|
|
3370
|
+
"See the `requirements-analyst` agent definition for full workflow",
|
|
3371
|
+
"details and phase-by-phase instructions."
|
|
3372
|
+
].join("\n"),
|
|
3373
|
+
platforms: {
|
|
3374
|
+
cursor: { exclude: true }
|
|
3375
|
+
},
|
|
3376
|
+
tags: ["workflow"]
|
|
3377
|
+
}
|
|
3378
|
+
],
|
|
3379
|
+
skills: [scanRequirementsSkill],
|
|
3380
|
+
subAgents: [requirementsAnalystSubAgent],
|
|
3381
|
+
labels: [
|
|
3382
|
+
{
|
|
3383
|
+
name: "type:requirement",
|
|
3384
|
+
color: "1D76DB",
|
|
3385
|
+
description: "Work that produces or discovers a requirement document (FR, BR, NFR, etc.)"
|
|
3386
|
+
},
|
|
3387
|
+
{
|
|
3388
|
+
name: "req:scan",
|
|
3389
|
+
color: "C5DEF5",
|
|
3390
|
+
description: "Phase 1: scan source docs for requirement gaps and deduplicate"
|
|
3391
|
+
},
|
|
3392
|
+
{
|
|
3393
|
+
name: "req:draft",
|
|
3394
|
+
color: "BFDADC",
|
|
3395
|
+
description: "Phase 2: draft requirement proposals for the requirements-writer"
|
|
3396
|
+
},
|
|
3397
|
+
{
|
|
3398
|
+
name: "req:trace",
|
|
3399
|
+
color: "D4C5F9",
|
|
3400
|
+
description: "Phase 3: create requirement issues and backfill traceability on source docs"
|
|
3401
|
+
}
|
|
3402
|
+
]
|
|
3403
|
+
};
|
|
3404
|
+
|
|
2608
3405
|
// src/agent/bundles/slack.ts
|
|
2609
3406
|
var slackBundle = {
|
|
2610
3407
|
name: "slack",
|
|
@@ -3253,7 +4050,9 @@ var BUILT_IN_BUNDLES = [
|
|
|
3253
4050
|
githubWorkflowBundle,
|
|
3254
4051
|
slackBundle,
|
|
3255
4052
|
meetingAnalysisBundle,
|
|
3256
|
-
orchestratorBundle
|
|
4053
|
+
orchestratorBundle,
|
|
4054
|
+
prReviewBundle,
|
|
4055
|
+
requirementsAnalystBundle
|
|
3257
4056
|
];
|
|
3258
4057
|
|
|
3259
4058
|
// src/agent/bundles/scope.ts
|
|
@@ -6779,7 +7578,9 @@ var TypeScriptConfig = class extends import_projen22.Component {
|
|
|
6779
7578
|
meetingAnalysisBundle,
|
|
6780
7579
|
orchestratorBundle,
|
|
6781
7580
|
pnpmBundle,
|
|
7581
|
+
prReviewBundle,
|
|
6782
7582
|
projenBundle,
|
|
7583
|
+
requirementsAnalystBundle,
|
|
6783
7584
|
resolveModelAlias,
|
|
6784
7585
|
resolveTemplateVariables,
|
|
6785
7586
|
slackBundle,
|