@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.mjs
CHANGED
|
@@ -440,55 +440,11 @@ var createRuleSkill = {
|
|
|
440
440
|
"- Use `ruleExtensions` to add project-specific content to existing bundle rules instead of replacing them"
|
|
441
441
|
].join("\n")
|
|
442
442
|
};
|
|
443
|
-
var reviewPrSkill = {
|
|
444
|
-
name: "review-pr",
|
|
445
|
-
description: "Review a pull request for code quality, conventions, and correctness",
|
|
446
|
-
instructions: [
|
|
447
|
-
"# Review Pull Request",
|
|
448
|
-
"",
|
|
449
|
-
"Review the current pull request in **{{repository.owner}}/{{repository.name}}**.",
|
|
450
|
-
"",
|
|
451
|
-
"## Review Checklist",
|
|
452
|
-
"",
|
|
453
|
-
"1. **Read the PR description** \u2014 understand the intent and linked issue",
|
|
454
|
-
"2. **Review the diff** \u2014 check all changed files for:",
|
|
455
|
-
" - Correctness and logic errors",
|
|
456
|
-
" - Adherence to project conventions",
|
|
457
|
-
" - Test coverage for new/changed behavior",
|
|
458
|
-
" - No unintended side effects",
|
|
459
|
-
"3. **Check PR conventions:**",
|
|
460
|
-
" - Title uses conventional commit prefix (`feat:`, `fix:`, `docs:`, etc.)",
|
|
461
|
-
" - Body includes a closing keyword (`Closes #<issue>`)",
|
|
462
|
-
" - Summary of changes is present",
|
|
463
|
-
"4. **Verify build and tests pass**",
|
|
464
|
-
"",
|
|
465
|
-
"## Commands",
|
|
466
|
-
"",
|
|
467
|
-
"```bash",
|
|
468
|
-
"# View the PR details",
|
|
469
|
-
"gh pr view",
|
|
470
|
-
"",
|
|
471
|
-
"# View the diff",
|
|
472
|
-
"gh pr diff",
|
|
473
|
-
"",
|
|
474
|
-
"# Check CI status",
|
|
475
|
-
"gh pr checks",
|
|
476
|
-
"```",
|
|
477
|
-
"",
|
|
478
|
-
"## Output Format",
|
|
479
|
-
"",
|
|
480
|
-
"Provide a structured review with:",
|
|
481
|
-
"- **Summary**: One-line verdict (approve, request changes, or comment)",
|
|
482
|
-
"- **Findings**: Bulleted list of issues or suggestions, grouped by severity",
|
|
483
|
-
"- **Positive notes**: What was done well"
|
|
484
|
-
].join("\n"),
|
|
485
|
-
allowedTools: ["Read", "Glob", "Grep", "Bash(gh *)"]
|
|
486
|
-
};
|
|
487
443
|
var baseBundle = {
|
|
488
444
|
name: "base",
|
|
489
445
|
description: "Core rules: project overview, interaction style, and general coding conventions",
|
|
490
446
|
appliesWhen: () => true,
|
|
491
|
-
skills: [createRuleSkill
|
|
447
|
+
skills: [createRuleSkill],
|
|
492
448
|
rules: [
|
|
493
449
|
{
|
|
494
450
|
name: "project-overview",
|
|
@@ -980,21 +936,7 @@ var githubWorkflowBundle = {
|
|
|
980
936
|
"6. **Create the PR** using `gh pr create`:",
|
|
981
937
|
" - **Title**: use a conventional commit style title (e.g., `feat(scope): short description`)",
|
|
982
938
|
" - **Body**: include `Closes #<issue-number>` (derived from the branch name) and a brief summary of changes",
|
|
983
|
-
"7. **
|
|
984
|
-
"",
|
|
985
|
-
"```",
|
|
986
|
-
"gh pr merge --auto --squash --subject '<conventional-commit-title>' --body '<extended-description>'",
|
|
987
|
-
"```",
|
|
988
|
-
"",
|
|
989
|
-
"The merge commit message should follow this format:",
|
|
990
|
-
"",
|
|
991
|
-
"```",
|
|
992
|
-
"Subject: <conventional-commit-title>",
|
|
993
|
-
"",
|
|
994
|
-
"Body:",
|
|
995
|
-
"- Bullet points summarizing the changes",
|
|
996
|
-
"- Closes #<issue-number>",
|
|
997
|
-
"```",
|
|
939
|
+
"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.",
|
|
998
940
|
"",
|
|
999
941
|
"### PR Body Template",
|
|
1000
942
|
"",
|
|
@@ -1015,7 +957,7 @@ var githubWorkflowBundle = {
|
|
|
1015
957
|
"",
|
|
1016
958
|
"- Always derive the issue number from the branch name (e.g., `feat/42-add-login` \u2192 `#42`)",
|
|
1017
959
|
"- Use conventional commit format for the PR title",
|
|
1018
|
-
"-
|
|
960
|
+
"- Delegate merge to the `pr-reviewer` sub-agent \u2014 do not merge manually and do not enable auto-merge directly"
|
|
1019
961
|
].join("\n"),
|
|
1020
962
|
tags: ["workflow"]
|
|
1021
963
|
}
|
|
@@ -1797,8 +1739,7 @@ var orchestratorSubAgent = {
|
|
|
1797
1739
|
" - Verify PR conventions: conventional commit title, closing keyword, summary present",
|
|
1798
1740
|
" - Check CI status: `gh pr checks N`",
|
|
1799
1741
|
"3. If the PR passes review:",
|
|
1800
|
-
" -
|
|
1801
|
-
" - Enable auto-merge: `gh pr merge N --auto --squash`",
|
|
1742
|
+
" - Enable squash auto-merge: `gh pr merge N --auto --squash --subject '<conventional-commit-title>' --body '<extended-description>'`",
|
|
1802
1743
|
"4. If the PR fails review:",
|
|
1803
1744
|
" - Request changes: `gh pr review N --request-changes --body '<findings>'`",
|
|
1804
1745
|
"5. After each PR (whether merged or not):",
|
|
@@ -2058,10 +1999,10 @@ var issueWorkerSubAgent = {
|
|
|
2058
1999
|
'Closes #<issue-number>"',
|
|
2059
2000
|
"```",
|
|
2060
2001
|
"",
|
|
2061
|
-
"
|
|
2062
|
-
"
|
|
2063
|
-
"
|
|
2064
|
-
"
|
|
2002
|
+
"Do **not** enable auto-merge yourself. The `pr-reviewer` sub-agent owns",
|
|
2003
|
+
"review and merge for every PR \u2014 it verifies the diff against the issue's",
|
|
2004
|
+
"acceptance criteria and enables squash auto-merge only when all checks",
|
|
2005
|
+
"pass. Record the new PR number so a reviewer can be invoked next.",
|
|
2065
2006
|
"",
|
|
2066
2007
|
"## Phase 8: Update Status",
|
|
2067
2008
|
"",
|
|
@@ -2072,9 +2013,9 @@ var issueWorkerSubAgent = {
|
|
|
2072
2013
|
"",
|
|
2073
2014
|
"## Phase 9: Branch Cleanup",
|
|
2074
2015
|
"",
|
|
2075
|
-
"
|
|
2076
|
-
"up to 10 times, waiting 30 seconds between polls, until it either
|
|
2077
|
-
"closes, or the timeout is reached:",
|
|
2016
|
+
"The PR will not auto-merge until the `pr-reviewer` enables it. Poll the PR",
|
|
2017
|
+
"state up to 10 times, waiting 30 seconds between polls, until it either",
|
|
2018
|
+
"merges, closes, or the timeout is reached:",
|
|
2078
2019
|
"",
|
|
2079
2020
|
"```bash",
|
|
2080
2021
|
"gh pr view <pr-number> --json state --jq '.state'",
|
|
@@ -2088,8 +2029,8 @@ var issueWorkerSubAgent = {
|
|
|
2088
2029
|
" ```",
|
|
2089
2030
|
"- **If the state becomes `CLOSED` (not merged):** leave the branch in place",
|
|
2090
2031
|
" and report that the PR was closed without merging. Do not delete the branch.",
|
|
2091
|
-
"- **If still `OPEN` after the polling window:** report that
|
|
2092
|
-
"
|
|
2032
|
+
"- **If still `OPEN` after the polling window:** report that the PR is",
|
|
2033
|
+
" awaiting review/merge and stop. Do not delete the branch.",
|
|
2093
2034
|
"",
|
|
2094
2035
|
"---",
|
|
2095
2036
|
"",
|
|
@@ -2270,6 +2211,392 @@ var pnpmBundle = {
|
|
|
2270
2211
|
]
|
|
2271
2212
|
};
|
|
2272
2213
|
|
|
2214
|
+
// src/agent/bundles/pr-review.ts
|
|
2215
|
+
var prReviewerSubAgent = {
|
|
2216
|
+
name: "pr-reviewer",
|
|
2217
|
+
description: "Reviews a pull request against its linked issue's acceptance criteria, then enables squash auto-merge or comments with findings",
|
|
2218
|
+
model: AGENT_MODEL.POWERFUL,
|
|
2219
|
+
maxTurns: 40,
|
|
2220
|
+
platforms: { cursor: { exclude: true } },
|
|
2221
|
+
prompt: [
|
|
2222
|
+
"# PR Reviewer Agent",
|
|
2223
|
+
"",
|
|
2224
|
+
"You review a single pull request in **{{repository.owner}}/{{repository.name}}**",
|
|
2225
|
+
"against its linked issue's acceptance criteria, verify code quality and",
|
|
2226
|
+
"convention compliance, and then either enable squash auto-merge or leave",
|
|
2227
|
+
"a review comment with findings. You handle exactly **one PR per session**",
|
|
2228
|
+
"unless invoked from the multi-PR loop skill (`/review-prs`), in which case",
|
|
2229
|
+
"you process each eligible PR in turn.",
|
|
2230
|
+
"",
|
|
2231
|
+
"---",
|
|
2232
|
+
"",
|
|
2233
|
+
"## Phase 1: Identify the PR",
|
|
2234
|
+
"",
|
|
2235
|
+
"If a PR number was provided in your instructions, use that. Otherwise stop",
|
|
2236
|
+
"and report that you need a PR number \u2014 do not pick one yourself.",
|
|
2237
|
+
"",
|
|
2238
|
+
"## Phase 1.5: Pre-flight Eligibility Filter",
|
|
2239
|
+
"",
|
|
2240
|
+
"Before spending turns on a full review, run a cheap eligibility check:",
|
|
2241
|
+
"",
|
|
2242
|
+
"```bash",
|
|
2243
|
+
"gh pr view <pr-number> --json number,title,body,headRefName,mergeable,mergeStateStatus,statusCheckRollup",
|
|
2244
|
+
"```",
|
|
2245
|
+
"",
|
|
2246
|
+
"The PR is **eligible** only when **all** of the following hold:",
|
|
2247
|
+
"",
|
|
2248
|
+
'1. `mergeable == "MERGEABLE"` (no merge conflicts).',
|
|
2249
|
+
"2. No **failing** required checks in `statusCheckRollup` \u2014 CI must be",
|
|
2250
|
+
" green or still pending. Any `FAILURE`, `TIMED_OUT`, `CANCELLED`, or",
|
|
2251
|
+
" `ERROR` conclusion on a required check disqualifies the PR.",
|
|
2252
|
+
"3. The PR body contains a linked issue via one of the closing keywords:",
|
|
2253
|
+
" `Closes #N`, `Fixes #N`, or `Resolves #N` (case-insensitive).",
|
|
2254
|
+
"",
|
|
2255
|
+
"If **any** check fails, post a short comment explaining the reason and",
|
|
2256
|
+
"stop. Do not proceed to full review.",
|
|
2257
|
+
"",
|
|
2258
|
+
"```bash",
|
|
2259
|
+
"gh pr comment <pr-number> --body '<reason>'",
|
|
2260
|
+
"```",
|
|
2261
|
+
"",
|
|
2262
|
+
"Typical reasons:",
|
|
2263
|
+
"",
|
|
2264
|
+
"- `Not reviewable: merge conflicts \u2014 please rebase onto the default branch.`",
|
|
2265
|
+
"- `Not reviewable: required CI check <name> is failing.`",
|
|
2266
|
+
"- `Not reviewable: PR body is missing a linked issue (Closes #N / Fixes #N / Resolves #N).`",
|
|
2267
|
+
"",
|
|
2268
|
+
"## Phase 2: Gather Context",
|
|
2269
|
+
"",
|
|
2270
|
+
"```bash",
|
|
2271
|
+
"gh pr view <pr-number> --json number,title,body,headRefName,baseRefName,isDraft,state,labels,reviews",
|
|
2272
|
+
"gh pr diff <pr-number>",
|
|
2273
|
+
"gh pr checks <pr-number>",
|
|
2274
|
+
"```",
|
|
2275
|
+
"",
|
|
2276
|
+
"Extract the linked issue number from the PR body using the closing keywords",
|
|
2277
|
+
"(`Closes #N`, `Fixes #N`, or `Resolves #N`) identified in Phase 1.5.",
|
|
2278
|
+
"",
|
|
2279
|
+
"Then fetch the linked issue:",
|
|
2280
|
+
"",
|
|
2281
|
+
"```bash",
|
|
2282
|
+
"gh issue view <issue-number>",
|
|
2283
|
+
"```",
|
|
2284
|
+
"",
|
|
2285
|
+
"## Phase 3: Compare Diff to Acceptance Criteria",
|
|
2286
|
+
"",
|
|
2287
|
+
"Read the issue body for an **Acceptance Criteria** (or equivalent) section.",
|
|
2288
|
+
"Build a checklist from it. For each item:",
|
|
2289
|
+
"",
|
|
2290
|
+
"1. Locate the changes in the diff that satisfy it.",
|
|
2291
|
+
"2. Mark it as `met`, `partial`, or `missing`.",
|
|
2292
|
+
"3. Record the specific files / functions / tests that provide evidence.",
|
|
2293
|
+
"",
|
|
2294
|
+
"Also evaluate:",
|
|
2295
|
+
"",
|
|
2296
|
+
"- **Convention compliance** \u2014 PR title uses a conventional commit prefix,",
|
|
2297
|
+
" body includes a closing keyword, branch name follows project conventions",
|
|
2298
|
+
"- **Test coverage** \u2014 new or changed behavior has tests",
|
|
2299
|
+
"- **CI status** \u2014 `gh pr checks` reports all required checks passing",
|
|
2300
|
+
"- **Scope creep** \u2014 diff stays within the issue's stated scope",
|
|
2301
|
+
"",
|
|
2302
|
+
"## Phase 4: Decide and Act",
|
|
2303
|
+
"",
|
|
2304
|
+
"### If all acceptance criteria are met and CI is green",
|
|
2305
|
+
"",
|
|
2306
|
+
"Enable squash auto-merge with branch deletion. This queues the merge to",
|
|
2307
|
+
"happen once required checks pass; no separate approval review is needed.",
|
|
2308
|
+
"",
|
|
2309
|
+
"```bash",
|
|
2310
|
+
"gh pr merge <pr-number> --auto --squash --delete-branch \\",
|
|
2311
|
+
" --subject '<conventional-commit-title>' \\",
|
|
2312
|
+
" --body '<extended-description>'",
|
|
2313
|
+
"```",
|
|
2314
|
+
"",
|
|
2315
|
+
"The squash-merge subject should follow conventional commit format (e.g.",
|
|
2316
|
+
"`feat(scope): description`). The body should bullet the changes and end",
|
|
2317
|
+
"with `Closes #<issue-number>`.",
|
|
2318
|
+
"",
|
|
2319
|
+
"### If any criterion is missing, partial, or CI is failing",
|
|
2320
|
+
"",
|
|
2321
|
+
"Post a plain comment (not a formal review block) with grouped findings:",
|
|
2322
|
+
"",
|
|
2323
|
+
"```bash",
|
|
2324
|
+
"gh pr comment <pr-number> --body '<grouped findings>'",
|
|
2325
|
+
"```",
|
|
2326
|
+
"",
|
|
2327
|
+
"Group findings by severity (**Blocking** / **Suggested** / **Nitpick**).",
|
|
2328
|
+
"For each blocking finding, cite the unmet acceptance criterion and the",
|
|
2329
|
+
"file or function the gap lives in. Do **not** merge, and do **not** push",
|
|
2330
|
+
"any commits to the PR's branch.",
|
|
2331
|
+
"",
|
|
2332
|
+
"Rationale for using a plain comment rather than `gh pr review",
|
|
2333
|
+
"--request-changes`: it is lighter-weight, doesn't require the author to",
|
|
2334
|
+
"dismiss a formal review, and composes cleanly with the multi-PR loop.",
|
|
2335
|
+
"",
|
|
2336
|
+
"## Phase 5: Branch Cleanup and Issue Closure Verification",
|
|
2337
|
+
"",
|
|
2338
|
+
"Auto-merge may not be immediate. Poll the PR state up to 10 times, waiting",
|
|
2339
|
+
"30 seconds between polls:",
|
|
2340
|
+
"",
|
|
2341
|
+
"```bash",
|
|
2342
|
+
"gh pr view <pr-number> --json state --jq '.state'",
|
|
2343
|
+
"```",
|
|
2344
|
+
"",
|
|
2345
|
+
"- **`MERGED`** \u2014 clean up locally **and** verify the linked issue closed:",
|
|
2346
|
+
" ```bash",
|
|
2347
|
+
" git checkout {{repository.defaultBranch}}",
|
|
2348
|
+
" git pull origin {{repository.defaultBranch}}",
|
|
2349
|
+
" git fetch --prune origin",
|
|
2350
|
+
" git branch -d <branch-name> 2>/dev/null || git branch -D <branch-name> 2>/dev/null || true",
|
|
2351
|
+
" ```",
|
|
2352
|
+
" Then check the linked issue state:",
|
|
2353
|
+
" ```bash",
|
|
2354
|
+
" gh issue view <issue-number> --json state --jq '.state'",
|
|
2355
|
+
" ```",
|
|
2356
|
+
" If the issue is **not** `CLOSED`, close it explicitly (this covers",
|
|
2357
|
+
" malformed or missing closing keywords on the merge commit):",
|
|
2358
|
+
" ```bash",
|
|
2359
|
+
" gh issue close <issue-number> --reason completed",
|
|
2360
|
+
" gh issue comment <issue-number> --body 'PR #<pr-number> merged. Closing issue.'",
|
|
2361
|
+
" ```",
|
|
2362
|
+
"- **`CLOSED` (not merged)** \u2014 leave the branch in place; report the closure.",
|
|
2363
|
+
"- **Still `OPEN`** \u2014 auto-merge is pending; report and stop without deleting.",
|
|
2364
|
+
"",
|
|
2365
|
+
"---",
|
|
2366
|
+
"",
|
|
2367
|
+
"## Output Format",
|
|
2368
|
+
"",
|
|
2369
|
+
"Return a structured report:",
|
|
2370
|
+
"",
|
|
2371
|
+
"```",
|
|
2372
|
+
"PR #<number> \u2014 <title>",
|
|
2373
|
+
"Linked issue: #<issue-number>",
|
|
2374
|
+
"Verdict: AUTO_MERGE_ENABLED | NEEDS_CHANGES | INELIGIBLE | BLOCKED",
|
|
2375
|
+
"",
|
|
2376
|
+
"Acceptance criteria:",
|
|
2377
|
+
" [x] <criterion> \u2014 <evidence>",
|
|
2378
|
+
" [~] <criterion> \u2014 partial: <gap>",
|
|
2379
|
+
" [ ] <criterion> \u2014 missing",
|
|
2380
|
+
"",
|
|
2381
|
+
"Findings:",
|
|
2382
|
+
" - Blocking: <items>",
|
|
2383
|
+
" - Suggested: <items>",
|
|
2384
|
+
" - Nitpick: <items>",
|
|
2385
|
+
"",
|
|
2386
|
+
"Action taken: <enable-auto-merge | commented-on-the-pr | none>",
|
|
2387
|
+
"Branch state: <merged | open | closed>",
|
|
2388
|
+
"Issue state: <closed | open>",
|
|
2389
|
+
"```",
|
|
2390
|
+
"",
|
|
2391
|
+
"---",
|
|
2392
|
+
"",
|
|
2393
|
+
"## Rules",
|
|
2394
|
+
"",
|
|
2395
|
+
"1. **One PR per session** when invoked directly (`/review-pr`). When",
|
|
2396
|
+
" invoked from the multi-PR loop (`/review-prs`), process every eligible",
|
|
2397
|
+
" PR in turn.",
|
|
2398
|
+
"2. **Never merge without a linked issue.** If the PR body has no",
|
|
2399
|
+
" `Closes #N` / `Fixes #N` / `Resolves #N`, comment and stop.",
|
|
2400
|
+
"3. **Never merge with failing CI.** Even if every criterion is met,",
|
|
2401
|
+
" block on red checks.",
|
|
2402
|
+
"4. **Never bypass review conventions.** Always use `--squash`, `--auto`,",
|
|
2403
|
+
" and `--delete-branch` for merges. Do not force-merge.",
|
|
2404
|
+
"5. **Do not implement code.** You review, decide, and orchestrate. If",
|
|
2405
|
+
" the PR needs changes, comment and stop.",
|
|
2406
|
+
"6. **Never push commits to the PR's branch.** If the PR needs changes,",
|
|
2407
|
+
" comment and stop \u2014 do not attempt to fix it yourself. The PR author",
|
|
2408
|
+
" owns the branch; pushing to someone else's branch is out of scope.",
|
|
2409
|
+
"7. **In loop mode (`/review-prs`), never stop early.** If any review",
|
|
2410
|
+
" fails, comment and move to the next PR. Only abort the loop on a",
|
|
2411
|
+
" fatal error (e.g. `gh` auth failure, network outage).",
|
|
2412
|
+
"8. **Follow CLAUDE.md conventions** for all `git` and `gh` operations."
|
|
2413
|
+
].join("\n")
|
|
2414
|
+
};
|
|
2415
|
+
var reviewPrSkill = {
|
|
2416
|
+
name: "review-pr",
|
|
2417
|
+
description: "Review a single pull request against its linked issue's acceptance criteria, then enable squash auto-merge or comment with findings",
|
|
2418
|
+
disableModelInvocation: true,
|
|
2419
|
+
userInvocable: true,
|
|
2420
|
+
context: "fork",
|
|
2421
|
+
agent: "pr-reviewer",
|
|
2422
|
+
platforms: { cursor: { exclude: true } },
|
|
2423
|
+
instructions: [
|
|
2424
|
+
"# Review Pull Request",
|
|
2425
|
+
"",
|
|
2426
|
+
"Run a full PR review against the linked issue's acceptance criteria,",
|
|
2427
|
+
"then either enable squash auto-merge or post a findings comment.",
|
|
2428
|
+
"",
|
|
2429
|
+
"## Usage",
|
|
2430
|
+
"",
|
|
2431
|
+
"/review-pr <pr-number>",
|
|
2432
|
+
"",
|
|
2433
|
+
"## What This Skill Does",
|
|
2434
|
+
"",
|
|
2435
|
+
"1. Runs a pre-flight eligibility filter (mergeable, CI not failing, has linked issue)",
|
|
2436
|
+
"2. Fetches the PR, its diff, CI status, and the linked issue",
|
|
2437
|
+
"3. Builds a checklist from the issue's acceptance criteria",
|
|
2438
|
+
"4. Compares the diff against each criterion",
|
|
2439
|
+
"5. Verifies PR conventions (title, closing keyword, branch name)",
|
|
2440
|
+
"6. Verifies CI is green",
|
|
2441
|
+
"7. **If all checks pass:** enables squash auto-merge (with `--delete-branch`)",
|
|
2442
|
+
"8. **If any check fails:** posts a findings comment via `gh pr comment`",
|
|
2443
|
+
"9. After merge, verifies the linked issue is closed and closes it if not",
|
|
2444
|
+
"10. Cleans up the local branch after merge",
|
|
2445
|
+
"",
|
|
2446
|
+
"## Input",
|
|
2447
|
+
"",
|
|
2448
|
+
"Provide the PR number to review. The skill resolves the linked issue from",
|
|
2449
|
+
"the PR body (`Closes #N` / `Fixes #N` / `Resolves #N`).",
|
|
2450
|
+
"",
|
|
2451
|
+
"## Output",
|
|
2452
|
+
"",
|
|
2453
|
+
"A structured report covering verdict, per-criterion status, findings",
|
|
2454
|
+
"grouped by severity, the action taken, and the final branch / issue state.",
|
|
2455
|
+
"",
|
|
2456
|
+
"## Composability",
|
|
2457
|
+
"",
|
|
2458
|
+
"This skill is generic and can be composed with the `github-workflow`",
|
|
2459
|
+
"bundle. The reviewer never implements code and never pushes to the PR",
|
|
2460
|
+
"branch \u2014 it only reviews, decides, and orchestrates merge or comment."
|
|
2461
|
+
].join("\n")
|
|
2462
|
+
};
|
|
2463
|
+
var reviewPrsSkill = {
|
|
2464
|
+
name: "review-prs",
|
|
2465
|
+
description: "Loop over every eligible open pull request in the repository and review each one through the full pipeline",
|
|
2466
|
+
disableModelInvocation: true,
|
|
2467
|
+
userInvocable: true,
|
|
2468
|
+
context: "fork",
|
|
2469
|
+
agent: "pr-reviewer",
|
|
2470
|
+
platforms: { cursor: { exclude: true } },
|
|
2471
|
+
instructions: [
|
|
2472
|
+
"# Review All Eligible Pull Requests",
|
|
2473
|
+
"",
|
|
2474
|
+
"Run the pr-reviewer pipeline over every eligible open PR in",
|
|
2475
|
+
"**{{repository.owner}}/{{repository.name}}**, one after another, until",
|
|
2476
|
+
"the eligible queue is empty.",
|
|
2477
|
+
"",
|
|
2478
|
+
"## Usage",
|
|
2479
|
+
"",
|
|
2480
|
+
"/review-prs",
|
|
2481
|
+
"",
|
|
2482
|
+
"## What This Skill Does",
|
|
2483
|
+
"",
|
|
2484
|
+
"### Step 1: Enumerate open PRs",
|
|
2485
|
+
"",
|
|
2486
|
+
"```bash",
|
|
2487
|
+
"gh pr list --json number,title,body,headRefName,mergeable,mergeStateStatus,statusCheckRollup --limit 50",
|
|
2488
|
+
"```",
|
|
2489
|
+
"",
|
|
2490
|
+
"### Step 2: Filter to eligible PRs",
|
|
2491
|
+
"",
|
|
2492
|
+
"A PR is **eligible** when all of the following hold:",
|
|
2493
|
+
"",
|
|
2494
|
+
'1. `state == "OPEN"` (implicit from `gh pr list`).',
|
|
2495
|
+
'2. `mergeable == "MERGEABLE"` (no conflicts).',
|
|
2496
|
+
"3. No required check in `statusCheckRollup` has a failing conclusion",
|
|
2497
|
+
" (`FAILURE`, `TIMED_OUT`, `CANCELLED`, `ERROR`). CI green or still",
|
|
2498
|
+
" pending is fine.",
|
|
2499
|
+
"4. The PR body contains a linked issue (`Closes #N` / `Fixes #N` /",
|
|
2500
|
+
" `Resolves #N`, case-insensitive).",
|
|
2501
|
+
"",
|
|
2502
|
+
"Drop any PR that fails the filter from the queue. Do not comment on",
|
|
2503
|
+
"them from this skill \u2014 the individual `/review-pr` invocation handles",
|
|
2504
|
+
"the inline rejection comment when run on a specific PR.",
|
|
2505
|
+
"",
|
|
2506
|
+
"### Step 3: Process each eligible PR",
|
|
2507
|
+
"",
|
|
2508
|
+
"For every eligible PR, invoke the full pr-reviewer pipeline",
|
|
2509
|
+
"(Phases 1 through 5) as if `/review-pr <number>` had been called",
|
|
2510
|
+
"directly:",
|
|
2511
|
+
"",
|
|
2512
|
+
"- Gather context (diff, checks, linked issue)",
|
|
2513
|
+
"- Compare diff to acceptance criteria",
|
|
2514
|
+
"- Decide and act (enable auto-merge **or** post findings comment)",
|
|
2515
|
+
"- Verify branch / issue cleanup after merge",
|
|
2516
|
+
"",
|
|
2517
|
+
"Continue to the next PR after each one completes. Never stop the loop",
|
|
2518
|
+
"early because a single PR's review failed \u2014 comment and move on.",
|
|
2519
|
+
"",
|
|
2520
|
+
"### Step 4: Stop when the queue is empty",
|
|
2521
|
+
"",
|
|
2522
|
+
"When no eligible PRs remain, emit a final summary listing every PR",
|
|
2523
|
+
"processed and the verdict for each, then stop.",
|
|
2524
|
+
"",
|
|
2525
|
+
"## Output",
|
|
2526
|
+
"",
|
|
2527
|
+
"Per-PR structured report (same shape as `/review-pr`), followed by a",
|
|
2528
|
+
"one-line-per-PR summary at the end:",
|
|
2529
|
+
"",
|
|
2530
|
+
"```",
|
|
2531
|
+
"Summary:",
|
|
2532
|
+
" PR #<n>: <verdict>",
|
|
2533
|
+
" PR #<n>: <verdict>",
|
|
2534
|
+
" ...",
|
|
2535
|
+
"Total processed: <count>",
|
|
2536
|
+
"```",
|
|
2537
|
+
"",
|
|
2538
|
+
"## Failure Handling",
|
|
2539
|
+
"",
|
|
2540
|
+
"Only abort the loop on a fatal error (e.g. `gh` authentication failure,",
|
|
2541
|
+
"network outage). A failed review for an individual PR is not fatal \u2014",
|
|
2542
|
+
"comment on that PR and continue with the next."
|
|
2543
|
+
].join("\n")
|
|
2544
|
+
};
|
|
2545
|
+
var prReviewBundle = {
|
|
2546
|
+
name: "pr-review",
|
|
2547
|
+
description: "Pull request review workflow: verifies PRs against their linked issues' acceptance criteria and orchestrates squash-merge, single or looped over all eligible PRs",
|
|
2548
|
+
// Default-apply: the PR review workflow is safe to include everywhere,
|
|
2549
|
+
// and keeping review/merge policy centralised in the pr-reviewer agent
|
|
2550
|
+
// means consumers get consistent behaviour out of the box. Consumers can
|
|
2551
|
+
// still exclude it explicitly via `excludeBundles` if desired.
|
|
2552
|
+
appliesWhen: () => true,
|
|
2553
|
+
rules: [
|
|
2554
|
+
{
|
|
2555
|
+
name: "pr-review-workflow",
|
|
2556
|
+
description: "Describes the /review-pr and /review-prs skills and their delegation to the pr-reviewer sub-agent",
|
|
2557
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
2558
|
+
content: [
|
|
2559
|
+
"# PR Review Workflow",
|
|
2560
|
+
"",
|
|
2561
|
+
"Two skills are available, both backed by the same `pr-reviewer`",
|
|
2562
|
+
"sub-agent:",
|
|
2563
|
+
"",
|
|
2564
|
+
"- **`/review-pr <pr-number>`** \u2014 review a single targeted PR.",
|
|
2565
|
+
"- **`/review-prs`** \u2014 loop over every eligible open PR in the",
|
|
2566
|
+
" repository and review each one in turn.",
|
|
2567
|
+
"",
|
|
2568
|
+
"The `pr-reviewer` sub-agent:",
|
|
2569
|
+
"",
|
|
2570
|
+
"1. Runs a pre-flight eligibility filter (mergeable, CI not failing,",
|
|
2571
|
+
" has a linked issue). Ineligible PRs get a short comment and are",
|
|
2572
|
+
" skipped.",
|
|
2573
|
+
"2. Fetches the PR, its diff, CI status, and the linked issue",
|
|
2574
|
+
"3. Builds a checklist from the issue's acceptance criteria",
|
|
2575
|
+
"4. Verifies the diff satisfies each criterion and that CI is green",
|
|
2576
|
+
"5. **Enables squash auto-merge** (with `--delete-branch`) when all",
|
|
2577
|
+
" checks pass \u2014 no explicit approval review",
|
|
2578
|
+
"6. **Comments with grouped findings** when any check fails (plain",
|
|
2579
|
+
" `gh pr comment`, not a formal `--request-changes` review)",
|
|
2580
|
+
"7. After a successful merge, verifies the linked issue is closed",
|
|
2581
|
+
" and closes it explicitly if the merge commit did not",
|
|
2582
|
+
"8. Cleans up the local branch after merge",
|
|
2583
|
+
"",
|
|
2584
|
+
"The reviewer **never** implements code and **never** pushes commits",
|
|
2585
|
+
"to a PR's branch \u2014 it only reviews, decides, and orchestrates merge",
|
|
2586
|
+
"or comment. In loop mode, a failed review for one PR never stops",
|
|
2587
|
+
"the loop; the reviewer comments and moves on. See the `pr-reviewer`",
|
|
2588
|
+
"agent definition for the full phase-by-phase contract."
|
|
2589
|
+
].join("\n"),
|
|
2590
|
+
platforms: {
|
|
2591
|
+
cursor: { exclude: true }
|
|
2592
|
+
},
|
|
2593
|
+
tags: ["workflow"]
|
|
2594
|
+
}
|
|
2595
|
+
],
|
|
2596
|
+
skills: [reviewPrSkill, reviewPrsSkill],
|
|
2597
|
+
subAgents: [prReviewerSubAgent]
|
|
2598
|
+
};
|
|
2599
|
+
|
|
2273
2600
|
// src/agent/bundles/projen.ts
|
|
2274
2601
|
var projenBundle = {
|
|
2275
2602
|
name: "projen",
|
|
@@ -2539,6 +2866,474 @@ var projenBundle = {
|
|
|
2539
2866
|
]
|
|
2540
2867
|
};
|
|
2541
2868
|
|
|
2869
|
+
// src/agent/bundles/requirements-analyst.ts
|
|
2870
|
+
var requirementsAnalystSubAgent = {
|
|
2871
|
+
name: "requirements-analyst",
|
|
2872
|
+
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.",
|
|
2873
|
+
model: AGENT_MODEL.POWERFUL,
|
|
2874
|
+
maxTurns: 80,
|
|
2875
|
+
platforms: { cursor: { exclude: true } },
|
|
2876
|
+
prompt: [
|
|
2877
|
+
"# Requirements Analyst Agent",
|
|
2878
|
+
"",
|
|
2879
|
+
"Dedicated agent loop for discovering requirement gaps from BCM (Business",
|
|
2880
|
+
"Capability Model) documents, product docs, and competitive analysis \u2014 then",
|
|
2881
|
+
"creating well-formed requirement issues for the downstream",
|
|
2882
|
+
"requirements-writer (BCM writer) agent to draft. Designed for scheduled",
|
|
2883
|
+
"execution downstream of the BCM writer and company research agents.",
|
|
2884
|
+
"",
|
|
2885
|
+
"Follow your project's shared agent conventions (`AGENTS.md`,",
|
|
2886
|
+
"`CLAUDE.md`, or equivalent) for all commit, branch, and PR rules.",
|
|
2887
|
+
"",
|
|
2888
|
+
"## Design Principles",
|
|
2889
|
+
"",
|
|
2890
|
+
"1. **Discover, don't write.** This agent identifies *what requirements are",
|
|
2891
|
+
" missing*. The requirements-writer skill writes the actual documents. The",
|
|
2892
|
+
" boundary keeps this agent fast and the requirements-writer authoritative.",
|
|
2893
|
+
"2. **Trace everything.** Every discovered gap links to the source that",
|
|
2894
|
+
" revealed it (a BCM model doc, competitive analysis, product doc, or",
|
|
2895
|
+
" meeting extract).",
|
|
2896
|
+
"3. **Respect the taxonomy.** Route every discovered requirement to the",
|
|
2897
|
+
" correct BCM category (FR, BR, NFR, SEC, DR, INT, OPS, UX, MT, ADR, TR)",
|
|
2898
|
+
" using the disambiguation rules in the requirements-writer skill.",
|
|
2899
|
+
"4. **Deduplicate.** Before creating an issue, check whether a requirement",
|
|
2900
|
+
" already exists or an issue is already open for it.",
|
|
2901
|
+
"",
|
|
2902
|
+
"---",
|
|
2903
|
+
"",
|
|
2904
|
+
"## State Machine Overview",
|
|
2905
|
+
"",
|
|
2906
|
+
"Requirements synthesis flows through **3 phases**:",
|
|
2907
|
+
"",
|
|
2908
|
+
"```",
|
|
2909
|
+
"\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",
|
|
2910
|
+
"\u2502 1. SCAN \u2502\u2500\u2500\u2500\u2500\u25B6\u2502 2. DRAFT \u2502\u2500\u2500\u2500\u2500\u25B6\u2502 3. TRACE \u2502",
|
|
2911
|
+
"\u2502 Read docs, \u2502 \u2502 Write gap \u2502 \u2502 Create GH \u2502",
|
|
2912
|
+
"\u2502 identify \u2502 \u2502 report with \u2502 \u2502 issues and \u2502",
|
|
2913
|
+
"\u2502 gaps, check \u2502 \u2502 requirement \u2502 \u2502 update src \u2502",
|
|
2914
|
+
"\u2502 for dupes \u2502 \u2502 proposals \u2502 \u2502 docs with \u2502",
|
|
2915
|
+
"\u2502 \u2502 \u2502 \u2502 \u2502 traceability\u2502",
|
|
2916
|
+
"\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",
|
|
2917
|
+
"```",
|
|
2918
|
+
"",
|
|
2919
|
+
"**Issue labels encode the phase:**",
|
|
2920
|
+
"",
|
|
2921
|
+
"| Label | Phase | Session work |",
|
|
2922
|
+
"|-------|-------|-------------|",
|
|
2923
|
+
"| `req:scan` | 1. Scan | Read source docs, identify potential requirement gaps, check against existing requirements and open issues, write deduplicated scan report |",
|
|
2924
|
+
"| `req:draft` | 2. Draft | Write gap report with proposed requirements |",
|
|
2925
|
+
"| `req:trace` | 3. Trace | Create GitHub issues for each proposed requirement and update source documents with traceability notes |",
|
|
2926
|
+
"",
|
|
2927
|
+
"All issues also carry `type:requirement` and a `status:*` label.",
|
|
2928
|
+
"",
|
|
2929
|
+
"**Issue count per scan cycle:** 1 scan + 1 draft + 1 trace = **3 sessions**.",
|
|
2930
|
+
"",
|
|
2931
|
+
"**Shortened paths:**",
|
|
2932
|
+
"- No gaps found after scan \u2192 skip draft and trace \u2192 **1 session**",
|
|
2933
|
+
"- No source docs need traceability updates \u2192 still **3 sessions** (trace",
|
|
2934
|
+
" handles both issue creation and doc updates)",
|
|
2935
|
+
"",
|
|
2936
|
+
"---",
|
|
2937
|
+
"",
|
|
2938
|
+
"## Configurable Paths",
|
|
2939
|
+
"",
|
|
2940
|
+
"Projects adopting this bundle must define these paths in their agent",
|
|
2941
|
+
"configuration (`agentConfig.rules` extension or project-level docs):",
|
|
2942
|
+
"",
|
|
2943
|
+
"| Placeholder | Meaning | Typical value |",
|
|
2944
|
+
"|-------------|---------|---------------|",
|
|
2945
|
+
"| `<BCM_DOCS_ROOT>` | Root of BCM model docs (capability models) | `src/content/docs/concepts/` |",
|
|
2946
|
+
"| `<COMPETITIVE_ROOT>` | Competitive analysis docs | `src/content/docs/business-strategy/competitive/` |",
|
|
2947
|
+
"| `<PRODUCT_ROOT>` | Product roadmap / entity taxonomy | `src/content/docs/product/` |",
|
|
2948
|
+
"| `<MEETINGS_ROOT>` | Meeting extracts | `src/content/docs/research/meetings/` |",
|
|
2949
|
+
"| `<RESEARCH_REQUIREMENTS_ROOT>` | Scan reports and proposals | `src/content/docs/research/requirements/` |",
|
|
2950
|
+
"| `<REQUIREMENTS_ROOT>` | Final requirement documents (owned by requirements-writer) | `src/content/docs/requirements/` |",
|
|
2951
|
+
"| `<PREFIX>` | Project-specific requirement ID prefix | e.g. `VRTX`, `ACME` |",
|
|
2952
|
+
"",
|
|
2953
|
+
"If your project stores these in different locations, substitute accordingly",
|
|
2954
|
+
"wherever the phase instructions reference a path.",
|
|
2955
|
+
"",
|
|
2956
|
+
"---",
|
|
2957
|
+
"",
|
|
2958
|
+
"## Agent Loop",
|
|
2959
|
+
"",
|
|
2960
|
+
"Run this loop exactly once per session. Never start a second issue.",
|
|
2961
|
+
"",
|
|
2962
|
+
"1. Claim one open `type:requirement` issue using phase priority:",
|
|
2963
|
+
" `req:scan` > `req:draft` > `req:trace`.",
|
|
2964
|
+
"2. Transition `status:ready` \u2192 `status:in-progress` and create the branch",
|
|
2965
|
+
" per your project's branch-naming convention.",
|
|
2966
|
+
"3. Execute the phase handler that matches the issue's `req:*` label.",
|
|
2967
|
+
"4. Commit, push, open a PR (if applicable), and close the issue per your",
|
|
2968
|
+
" project's PR workflow.",
|
|
2969
|
+
"",
|
|
2970
|
+
"---",
|
|
2971
|
+
"",
|
|
2972
|
+
"## Phase 1: Scan (`req:scan`)",
|
|
2973
|
+
"",
|
|
2974
|
+
"**Goal:** Read source documents, identify where requirements are missing,",
|
|
2975
|
+
"incomplete, or contradictory, then check each potential gap against existing",
|
|
2976
|
+
"requirements and open issues to eliminate duplicates. Produces a single",
|
|
2977
|
+
"deduplicated scan report.",
|
|
2978
|
+
"",
|
|
2979
|
+
"**Budget:** Reading source docs + reading requirement registries + searching",
|
|
2980
|
+
"issues. Write one deduplicated scan output file.",
|
|
2981
|
+
"",
|
|
2982
|
+
"### Scan Sources",
|
|
2983
|
+
"",
|
|
2984
|
+
"The issue specifies which source(s) to scan. Common scan scopes:",
|
|
2985
|
+
"",
|
|
2986
|
+
"| Scope | What to read | What to look for |",
|
|
2987
|
+
"|-------|-------------|-----------------|",
|
|
2988
|
+
"| **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 |",
|
|
2989
|
+
"| **Competitive analysis** | One `comp-*.md` doc under `<COMPETITIVE_ROOT>` | Feature comparison gaps \u2014 competitor features the product lacks requirements for |",
|
|
2990
|
+
"| **Product roadmap** | `<PRODUCT_ROOT>/prioritized-feature-roadmap.md` | Roadmap items without corresponding FRs |",
|
|
2991
|
+
"| **Entity taxonomy** | `<PRODUCT_ROOT>/entity-taxonomy.md` | Entities without CRUD requirements (FR), data requirements (DR), or security requirements (SEC) |",
|
|
2992
|
+
"| **Meeting extract** | `<MEETINGS_ROOT>/meeting-*.extract.md` | Requirements identified but not yet formalized |",
|
|
2993
|
+
"",
|
|
2994
|
+
"### Steps",
|
|
2995
|
+
"",
|
|
2996
|
+
"1. **Read the source documents** specified in the issue.",
|
|
2997
|
+
"",
|
|
2998
|
+
"2. **Identify potential gaps.** For each potential missing requirement:",
|
|
2999
|
+
" - Classify into the correct BCM category (FR, BR, NFR, SEC, DR, INT,",
|
|
3000
|
+
" OPS, UX, MT, ADR, TR)",
|
|
3001
|
+
" - Apply the disambiguation rules from the requirements-writer skill",
|
|
3002
|
+
" - Note the source that revealed the gap",
|
|
3003
|
+
" - Estimate priority based on the source context",
|
|
3004
|
+
"",
|
|
3005
|
+
"3. **Read the requirements registry.** Scan `_index.md` files in each",
|
|
3006
|
+
" `<REQUIREMENTS_ROOT>/<category>/` directory to know what already exists.",
|
|
3007
|
+
"",
|
|
3008
|
+
"4. **Search for existing issues.** For each potential gap, search open issues:",
|
|
3009
|
+
" ```bash",
|
|
3010
|
+
' gh issue list --label "type:requirement" --state open \\',
|
|
3011
|
+
" --json number,title --limit 100",
|
|
3012
|
+
" ```",
|
|
3013
|
+
"",
|
|
3014
|
+
"5. **Classify each gap:**",
|
|
3015
|
+
" - **New** \u2014 no existing requirement or open issue covers this",
|
|
3016
|
+
" - **Duplicate** \u2014 an existing requirement already addresses this",
|
|
3017
|
+
" - **In progress** \u2014 an open issue already targets this",
|
|
3018
|
+
" - **Partial** \u2014 existing requirement partially covers this; note the gap",
|
|
3019
|
+
"",
|
|
3020
|
+
"6. **Write the deduplicated scan report** to:",
|
|
3021
|
+
" ```",
|
|
3022
|
+
" <RESEARCH_REQUIREMENTS_ROOT>/req-scan-<scope>-<YYYY-MM-DD>.md",
|
|
3023
|
+
" ```",
|
|
3024
|
+
"",
|
|
3025
|
+
" Format:",
|
|
3026
|
+
" ```markdown",
|
|
3027
|
+
" ---",
|
|
3028
|
+
' title: "Requirements Scan: <scope>"',
|
|
3029
|
+
" date: YYYY-MM-DD",
|
|
3030
|
+
" parent_issue: <N>",
|
|
3031
|
+
" status: complete",
|
|
3032
|
+
" ---",
|
|
3033
|
+
"",
|
|
3034
|
+
" # Requirements Scan: <scope>",
|
|
3035
|
+
"",
|
|
3036
|
+
" ## Source Documents Reviewed",
|
|
3037
|
+
" - <path> \u2014 <brief description>",
|
|
3038
|
+
"",
|
|
3039
|
+
" ## Existing Requirements Checked",
|
|
3040
|
+
" - <category>: <count> existing docs, <count> open issues",
|
|
3041
|
+
"",
|
|
3042
|
+
" ## Identified Gaps (New)",
|
|
3043
|
+
" ### Gap 1: <Title>",
|
|
3044
|
+
" - **Category:** FR / BR / NFR / SEC / DR / INT / OPS / UX / MT / ADR / TR",
|
|
3045
|
+
" - **Source:** <path to doc + section that revealed this gap>",
|
|
3046
|
+
" - **Priority:** High / Normal / Low",
|
|
3047
|
+
" - **Rationale:** <why this requirement is needed>",
|
|
3048
|
+
" - **Duplicate check:** No existing requirement or open issue found",
|
|
3049
|
+
" - **Proposed scope:** <1-2 sentences on what the requirement should cover>",
|
|
3050
|
+
"",
|
|
3051
|
+
" ## Already Covered",
|
|
3052
|
+
" <list of potential gaps that turned out to already have requirements>",
|
|
3053
|
+
"",
|
|
3054
|
+
" ## In Progress",
|
|
3055
|
+
" <gaps that already have open issues \u2014 include issue numbers>",
|
|
3056
|
+
"",
|
|
3057
|
+
" ## Ambiguous / Needs Human Decision",
|
|
3058
|
+
" <gaps where the correct category or scope is unclear>",
|
|
3059
|
+
" ```",
|
|
3060
|
+
"",
|
|
3061
|
+
"7. **Create downstream issues based on findings:**",
|
|
3062
|
+
" - If any new gaps were identified \u2192 create `req:draft` issue",
|
|
3063
|
+
" (blocked on this issue via `Depends on: #N`).",
|
|
3064
|
+
" - If **no gaps** were found \u2192 stop (no further phases needed). Comment",
|
|
3065
|
+
" on the issue noting that no gaps were identified, and proceed directly",
|
|
3066
|
+
" to commit and push. The scan issue will be marked done with no",
|
|
3067
|
+
" downstream work needed.",
|
|
3068
|
+
"",
|
|
3069
|
+
"8. **Commit and push.**",
|
|
3070
|
+
"",
|
|
3071
|
+
"---",
|
|
3072
|
+
"",
|
|
3073
|
+
"## Phase 2: Draft (`req:draft`)",
|
|
3074
|
+
"",
|
|
3075
|
+
"**Goal:** Expand each identified gap into a requirement proposal with enough",
|
|
3076
|
+
"detail for the requirements-writer to produce a full document.",
|
|
3077
|
+
"",
|
|
3078
|
+
"**Budget:** No web searches. Reading + writing.",
|
|
3079
|
+
"",
|
|
3080
|
+
"### Steps",
|
|
3081
|
+
"",
|
|
3082
|
+
"1. **Read the scan report** from Phase 1.",
|
|
3083
|
+
"",
|
|
3084
|
+
"2. **For each gap**, write a detailed proposal:",
|
|
3085
|
+
"",
|
|
3086
|
+
" ```markdown",
|
|
3087
|
+
" ## Proposed: <PREFIX>-<NNN> \u2014 <Title>",
|
|
3088
|
+
"",
|
|
3089
|
+
" **Category:** <FR/BR/NFR/SEC/DR/INT/OPS/UX/MT/ADR/TR>",
|
|
3090
|
+
" **Priority:** <High/Normal/Low>",
|
|
3091
|
+
" **Source:** <document path and section>",
|
|
3092
|
+
"",
|
|
3093
|
+
" ### Summary",
|
|
3094
|
+
" <2-3 sentences describing what the requirement should capture>",
|
|
3095
|
+
"",
|
|
3096
|
+
" ### Draft Acceptance Criteria",
|
|
3097
|
+
" - [ ] <testable criterion 1>",
|
|
3098
|
+
" - [ ] <testable criterion 2>",
|
|
3099
|
+
" - [ ] <testable criterion 3>",
|
|
3100
|
+
"",
|
|
3101
|
+
" ### Traceability",
|
|
3102
|
+
" - **Implements:** <BR or parent requirement if applicable>",
|
|
3103
|
+
" - **Related:** <existing requirements that interact with this one>",
|
|
3104
|
+
" - **Source:** <BCM doc, competitive analysis, or meeting that revealed",
|
|
3105
|
+
" the gap \u2014 use a markdown link. If the source is a meeting note, the",
|
|
3106
|
+
" downstream requirement doc must include the same meeting as a link in",
|
|
3107
|
+
" its Traceability `Related:` list.>",
|
|
3108
|
+
"",
|
|
3109
|
+
" ### Decision Authority",
|
|
3110
|
+
' <"Direct write" for BR/FR/NFR/SEC/UX, or "Proposed \u2014 needs human',
|
|
3111
|
+
' decision" for ADR/TR, or "Mixed \u2014 defer technology choices" for',
|
|
3112
|
+
" DR/MT/INT/OPS>",
|
|
3113
|
+
"",
|
|
3114
|
+
" ### Notes for Requirements Writer",
|
|
3115
|
+
" <any context the writer should know \u2014 related ADRs, existing partial",
|
|
3116
|
+
" coverage, relevant competitive features>",
|
|
3117
|
+
" ```",
|
|
3118
|
+
"",
|
|
3119
|
+
"3. **Write the proposals** to:",
|
|
3120
|
+
" ```",
|
|
3121
|
+
" <RESEARCH_REQUIREMENTS_ROOT>/req-proposals-<scope>-<YYYY-MM-DD>.md",
|
|
3122
|
+
" ```",
|
|
3123
|
+
"",
|
|
3124
|
+
"4. **Determine next sequence numbers.** Check each target category",
|
|
3125
|
+
" directory under `<REQUIREMENTS_ROOT>/<category>/` to find the next",
|
|
3126
|
+
" available `NNN` for each proposed requirement.",
|
|
3127
|
+
"",
|
|
3128
|
+
"5. **Create the `req:trace` issue** blocked on this draft issue.",
|
|
3129
|
+
"",
|
|
3130
|
+
"6. **Commit and push.**",
|
|
3131
|
+
"",
|
|
3132
|
+
"---",
|
|
3133
|
+
"",
|
|
3134
|
+
"## Phase 3: Trace (`req:trace`)",
|
|
3135
|
+
"",
|
|
3136
|
+
"**Goal:** Create GitHub issues for each proposed requirement and update",
|
|
3137
|
+
"source documents with traceability notes indicating that requirement issues",
|
|
3138
|
+
"were created.",
|
|
3139
|
+
"",
|
|
3140
|
+
"**Budget:** No web searches. Issue creation + minor edits to source",
|
|
3141
|
+
"documents.",
|
|
3142
|
+
"",
|
|
3143
|
+
"### Steps",
|
|
3144
|
+
"",
|
|
3145
|
+
"1. **Read the proposals** from Phase 2.",
|
|
3146
|
+
"",
|
|
3147
|
+
"2. **Create requirement issues.** For each proposal:",
|
|
3148
|
+
"",
|
|
3149
|
+
" All `type:requirement` issues default to `priority:medium` (override",
|
|
3150
|
+
" only if the proposal's priority was explicitly High or Low).",
|
|
3151
|
+
"",
|
|
3152
|
+
" ```bash",
|
|
3153
|
+
" gh issue create \\",
|
|
3154
|
+
' --title "docs(<category>): <PREFIX>-<NNN> \u2014 <title>" \\',
|
|
3155
|
+
' --label "type:requirement" --label "status:ready" --label "priority:medium" \\',
|
|
3156
|
+
' --body "## Objective',
|
|
3157
|
+
" Write <PREFIX>-<NNN> \u2014 <title>.",
|
|
3158
|
+
"",
|
|
3159
|
+
" ## Context",
|
|
3160
|
+
" - **Gap identified by:** requirements scan of <source>",
|
|
3161
|
+
" - **Proposals file:** <RESEARCH_REQUIREMENTS_ROOT>/req-proposals-<scope>-<date>.md",
|
|
3162
|
+
"",
|
|
3163
|
+
" ## Inputs",
|
|
3164
|
+
" - **Depends on:** (none)",
|
|
3165
|
+
" - **Read:** <RESEARCH_REQUIREMENTS_ROOT>/req-proposals-<scope>-<date>.md, <source docs>",
|
|
3166
|
+
"",
|
|
3167
|
+
" ## Acceptance Criteria",
|
|
3168
|
+
" - [ ] Requirement document follows <category> template",
|
|
3169
|
+
" - [ ] Traceability links to source BCM/competitive/product doc",
|
|
3170
|
+
" - [ ] Registry index updated",
|
|
3171
|
+
" - [ ] Decision authority rules followed (direct write vs. proposed)",
|
|
3172
|
+
"",
|
|
3173
|
+
" ## Scope Size",
|
|
3174
|
+
" small",
|
|
3175
|
+
"",
|
|
3176
|
+
" ## Output Path",
|
|
3177
|
+
' <REQUIREMENTS_ROOT>/<category>/<PREFIX>-<NNN>-<slug>.md"',
|
|
3178
|
+
" ```",
|
|
3179
|
+
"",
|
|
3180
|
+
"3. **Update source documents.** In each BCM model doc or competitive",
|
|
3181
|
+
" analysis that was scanned, add a note in the `## Vortex Relevance` or",
|
|
3182
|
+
" `## Strategic Implications` section indicating that a requirement issue",
|
|
3183
|
+
" was created:",
|
|
3184
|
+
"",
|
|
3185
|
+
" ```markdown",
|
|
3186
|
+
" - Gap addressed: see [<PREFIX>-<NNN>](<relative path to requirement doc>)",
|
|
3187
|
+
" (issue #<N>)",
|
|
3188
|
+
" ```",
|
|
3189
|
+
"",
|
|
3190
|
+
"4. **Comment on the scan issue** with a summary of all issues created and",
|
|
3191
|
+
" all docs updated.",
|
|
3192
|
+
"",
|
|
3193
|
+
"5. **Commit and push.**",
|
|
3194
|
+
"",
|
|
3195
|
+
"---",
|
|
3196
|
+
"",
|
|
3197
|
+
"## Coordination with Other Agents",
|
|
3198
|
+
"",
|
|
3199
|
+
"| Direction | Agent | What |",
|
|
3200
|
+
"|-----------|-------|------|",
|
|
3201
|
+
"| Upstream | BCM Writer | Scans `## Vortex Relevance` sections for capability gaps |",
|
|
3202
|
+
"| Upstream | Company Research | Scans competitive analysis for feature comparison gaps |",
|
|
3203
|
+
"| Upstream | Meeting Analyst | Scans meeting extracts for requirement proposals |",
|
|
3204
|
+
"| Downstream | Requirements Writer (BCM Writer) | Creates `type:requirement` issues for the skill to draft |",
|
|
3205
|
+
"",
|
|
3206
|
+
"**File boundaries:** Writes to `<RESEARCH_REQUIREMENTS_ROOT>/req-*.md` and",
|
|
3207
|
+
"minor traceability edits to `<BCM_DOCS_ROOT>` and `<COMPETITIVE_ROOT>`.",
|
|
3208
|
+
"Never writes to `<REQUIREMENTS_ROOT>/` \u2014 that is owned by the",
|
|
3209
|
+
"requirements-writer agent.",
|
|
3210
|
+
"",
|
|
3211
|
+
"---",
|
|
3212
|
+
"",
|
|
3213
|
+
"## Blocked Issues",
|
|
3214
|
+
"",
|
|
3215
|
+
"Additional block reasons specific to requirements synthesis:",
|
|
3216
|
+
"- Source document has unresolved contradictions",
|
|
3217
|
+
"- Category classification is ambiguous (needs human disambiguation)",
|
|
3218
|
+
"- Dependent BCM documents are still in draft with placeholder content",
|
|
3219
|
+
"",
|
|
3220
|
+
"---",
|
|
3221
|
+
"",
|
|
3222
|
+
"## Rules",
|
|
3223
|
+
"",
|
|
3224
|
+
"- **Discover, don't write requirements.** Create issues for the",
|
|
3225
|
+
" requirements-writer \u2014 don't write requirement documents directly.",
|
|
3226
|
+
"- **Deduplicate rigorously.** Check both existing docs and open issues",
|
|
3227
|
+
" before flagging a gap.",
|
|
3228
|
+
"- **Respect decision authority.** Mark ADR/TR proposals as needing human",
|
|
3229
|
+
" decision. Don't create direct-write issues for technology choices.",
|
|
3230
|
+
"- **Bidirectional traceability.** Every `req-scan-*.md` and",
|
|
3231
|
+
" `req-proposals-*.md` must include a `## Produced` section listing the",
|
|
3232
|
+
" downstream requirement issues (and eventual requirement documents) it",
|
|
3233
|
+
" spawned, as markdown links; each formal requirement document under",
|
|
3234
|
+
" `<REQUIREMENTS_ROOT>/` must include a forward link back to the scan or",
|
|
3235
|
+
" proposal that produced it."
|
|
3236
|
+
].join("\n")
|
|
3237
|
+
};
|
|
3238
|
+
var scanRequirementsSkill = {
|
|
3239
|
+
name: "scan-requirements",
|
|
3240
|
+
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.",
|
|
3241
|
+
disableModelInvocation: true,
|
|
3242
|
+
userInvocable: true,
|
|
3243
|
+
context: "fork",
|
|
3244
|
+
agent: "requirements-analyst",
|
|
3245
|
+
platforms: { cursor: { exclude: true } },
|
|
3246
|
+
instructions: [
|
|
3247
|
+
"# Scan Requirements",
|
|
3248
|
+
"",
|
|
3249
|
+
"Kick off a requirements-analyst scan cycle. Creates a `req:scan` issue",
|
|
3250
|
+
"targeted at the requested scope and dispatches Phase 1 (Scan) in the",
|
|
3251
|
+
"requirements-analyst agent.",
|
|
3252
|
+
"",
|
|
3253
|
+
"## Usage",
|
|
3254
|
+
"",
|
|
3255
|
+
"/scan-requirements <scope>",
|
|
3256
|
+
"",
|
|
3257
|
+
"Where `<scope>` is one of:",
|
|
3258
|
+
"- `bcm:<PREFIX-NNN>` \u2014 a single BCM model doc",
|
|
3259
|
+
"- `competitive:<slug>` \u2014 a single competitive analysis doc",
|
|
3260
|
+
"- `product-roadmap` \u2014 the prioritized feature roadmap",
|
|
3261
|
+
"- `entity-taxonomy` \u2014 the entity taxonomy doc",
|
|
3262
|
+
"- `meeting:<slug>` \u2014 a meeting extract",
|
|
3263
|
+
"- `all-bcm` / `all-competitive` \u2014 full sweep (long-running)",
|
|
3264
|
+
"",
|
|
3265
|
+
"## Steps",
|
|
3266
|
+
"",
|
|
3267
|
+
"1. Create a `req:scan` issue with `type:requirement`, `priority:medium`,",
|
|
3268
|
+
" and `status:ready`. Body must list the files to read and the scan scope.",
|
|
3269
|
+
"2. Execute Phase 1 (Scan) of the requirements-analyst agent.",
|
|
3270
|
+
"3. If gaps are found, a `req:draft` issue is created automatically.",
|
|
3271
|
+
"",
|
|
3272
|
+
"## Output",
|
|
3273
|
+
"",
|
|
3274
|
+
"- A `req-scan-<scope>-<YYYY-MM-DD>.md` file under the project's research",
|
|
3275
|
+
" requirements directory.",
|
|
3276
|
+
"- A `req:draft` issue if any gaps were identified."
|
|
3277
|
+
].join("\n")
|
|
3278
|
+
};
|
|
3279
|
+
var requirementsAnalystBundle = {
|
|
3280
|
+
name: "requirements-analyst",
|
|
3281
|
+
description: "Requirements gap-discovery agent bundle for BCM-driven projects. 3-phase pipeline (scan, draft, trace) with req:* phase labels.",
|
|
3282
|
+
appliesWhen: () => true,
|
|
3283
|
+
rules: [
|
|
3284
|
+
{
|
|
3285
|
+
name: "requirements-analyst-workflow",
|
|
3286
|
+
description: "Describes the 3-phase requirements gap-discovery pipeline, the req:* label taxonomy, and the boundary with the downstream requirements-writer agent.",
|
|
3287
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
3288
|
+
content: [
|
|
3289
|
+
"# Requirements Analyst Workflow",
|
|
3290
|
+
"",
|
|
3291
|
+
"Use `/scan-requirements <scope>` to kick off a requirements gap",
|
|
3292
|
+
"discovery cycle. The pipeline runs in 3 phases \u2014 scan, draft, trace \u2014",
|
|
3293
|
+
"each tracked by its own GitHub issue labeled `req:scan`, `req:draft`,",
|
|
3294
|
+
"or `req:trace`. All issues carry `type:requirement`.",
|
|
3295
|
+
"",
|
|
3296
|
+
"The requirements-analyst *discovers gaps and drafts proposals*; it",
|
|
3297
|
+
"does **not** write final requirement documents. Writing is the job of",
|
|
3298
|
+
"the downstream requirements-writer (BCM writer) agent. Keep that",
|
|
3299
|
+
"boundary clean: proposals land under the research requirements",
|
|
3300
|
+
"directory, not under the authoritative requirements tree.",
|
|
3301
|
+
"",
|
|
3302
|
+
"See the `requirements-analyst` agent definition for full workflow",
|
|
3303
|
+
"details and phase-by-phase instructions."
|
|
3304
|
+
].join("\n"),
|
|
3305
|
+
platforms: {
|
|
3306
|
+
cursor: { exclude: true }
|
|
3307
|
+
},
|
|
3308
|
+
tags: ["workflow"]
|
|
3309
|
+
}
|
|
3310
|
+
],
|
|
3311
|
+
skills: [scanRequirementsSkill],
|
|
3312
|
+
subAgents: [requirementsAnalystSubAgent],
|
|
3313
|
+
labels: [
|
|
3314
|
+
{
|
|
3315
|
+
name: "type:requirement",
|
|
3316
|
+
color: "1D76DB",
|
|
3317
|
+
description: "Work that produces or discovers a requirement document (FR, BR, NFR, etc.)"
|
|
3318
|
+
},
|
|
3319
|
+
{
|
|
3320
|
+
name: "req:scan",
|
|
3321
|
+
color: "C5DEF5",
|
|
3322
|
+
description: "Phase 1: scan source docs for requirement gaps and deduplicate"
|
|
3323
|
+
},
|
|
3324
|
+
{
|
|
3325
|
+
name: "req:draft",
|
|
3326
|
+
color: "BFDADC",
|
|
3327
|
+
description: "Phase 2: draft requirement proposals for the requirements-writer"
|
|
3328
|
+
},
|
|
3329
|
+
{
|
|
3330
|
+
name: "req:trace",
|
|
3331
|
+
color: "D4C5F9",
|
|
3332
|
+
description: "Phase 3: create requirement issues and backfill traceability on source docs"
|
|
3333
|
+
}
|
|
3334
|
+
]
|
|
3335
|
+
};
|
|
3336
|
+
|
|
2542
3337
|
// src/agent/bundles/slack.ts
|
|
2543
3338
|
var slackBundle = {
|
|
2544
3339
|
name: "slack",
|
|
@@ -3187,7 +3982,9 @@ var BUILT_IN_BUNDLES = [
|
|
|
3187
3982
|
githubWorkflowBundle,
|
|
3188
3983
|
slackBundle,
|
|
3189
3984
|
meetingAnalysisBundle,
|
|
3190
|
-
orchestratorBundle
|
|
3985
|
+
orchestratorBundle,
|
|
3986
|
+
prReviewBundle,
|
|
3987
|
+
requirementsAnalystBundle
|
|
3191
3988
|
];
|
|
3192
3989
|
|
|
3193
3990
|
// src/agent/bundles/scope.ts
|
|
@@ -6725,7 +7522,9 @@ export {
|
|
|
6725
7522
|
meetingAnalysisBundle,
|
|
6726
7523
|
orchestratorBundle,
|
|
6727
7524
|
pnpmBundle,
|
|
7525
|
+
prReviewBundle,
|
|
6728
7526
|
projenBundle,
|
|
7527
|
+
requirementsAnalystBundle,
|
|
6729
7528
|
resolveModelAlias,
|
|
6730
7529
|
resolveTemplateVariables,
|
|
6731
7530
|
slackBundle,
|