@codedrifters/configulator 0.0.202 → 0.0.204

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.mjs CHANGED
@@ -1025,6 +1025,89 @@ var jestBundle = {
1025
1025
  }
1026
1026
  };
1027
1027
 
1028
+ // src/agent/bundles/project-context.ts
1029
+ var PROJECT_CONTEXT_PATH = "docs/project-context.md";
1030
+ var PROJECT_CONTEXT_READER_SECTION = [
1031
+ "## Project Context",
1032
+ "",
1033
+ `Before doing any work, read \`${PROJECT_CONTEXT_PATH}\` at the`,
1034
+ 'repository root. It is the canonical answer to "what is this project',
1035
+ 'about?" \u2014 mission, domain vocabulary, in/out-of-scope capabilities, and',
1036
+ "key stakeholders. Use it to frame judgment calls in this session.",
1037
+ "",
1038
+ `If \`${PROJECT_CONTEXT_PATH}\` does not exist, proceed with the current`,
1039
+ "task and note the absence in your session log \u2014 the meeting-analyst and",
1040
+ "requirements-analyst agents seed the file on their next run.",
1041
+ "",
1042
+ "You are a **read-only consumer** of this file. Do not edit it.",
1043
+ "",
1044
+ "---",
1045
+ ""
1046
+ ];
1047
+ var PROJECT_CONTEXT_MAINTAINER_SECTION = [
1048
+ "## Project Context",
1049
+ "",
1050
+ `Before starting any phase, read \`${PROJECT_CONTEXT_PATH}\` at the`,
1051
+ 'repository root. It is the canonical answer to "what is this project',
1052
+ 'about?" \u2014 mission, domain vocabulary, in/out-of-scope capabilities, and',
1053
+ "key stakeholders. Use it to judge relevance when scanning source",
1054
+ "material in this session.",
1055
+ "",
1056
+ "### Seed on first use",
1057
+ "",
1058
+ `If \`${PROJECT_CONTEXT_PATH}\` does not exist, create it from this`,
1059
+ "template and commit it alongside this phase's other outputs:",
1060
+ "",
1061
+ "```markdown",
1062
+ "# Project Context",
1063
+ "",
1064
+ "> Canonical description of this project. Read by all agents before",
1065
+ "> work. Updated by meeting-analyst and requirements-analyst when new",
1066
+ "> scope, vocabulary, or stakeholders emerge.",
1067
+ "",
1068
+ "## Mission",
1069
+ "TODO: one or two sentences on what this project exists to do.",
1070
+ "",
1071
+ "## Target Users",
1072
+ "TODO: who uses this, in what role.",
1073
+ "",
1074
+ "## In-Scope Capabilities",
1075
+ "TODO: bullet list of the capabilities this project owns.",
1076
+ "",
1077
+ "## Out-of-Scope",
1078
+ "TODO: capabilities or concerns that are explicitly not this project's.",
1079
+ "",
1080
+ "## Domain Vocabulary",
1081
+ "TODO: short glossary of domain terms, acronyms, and their definitions.",
1082
+ "",
1083
+ "## Key Stakeholders",
1084
+ "TODO: named people or teams and what they care about.",
1085
+ "",
1086
+ "## References",
1087
+ "TODO: links to BCM docs, competitive analysis, product roadmap, and",
1088
+ "other authoritative sources.",
1089
+ "```",
1090
+ "",
1091
+ "Fill whatever you can infer from the source material you are already",
1092
+ "reading in this phase; leave `TODO:` placeholders for the rest.",
1093
+ "",
1094
+ "### Update on new facts",
1095
+ "",
1096
+ "When the source material you process reveals new project-scope",
1097
+ "information \u2014 a new capability, a vocabulary term, an entity, a",
1098
+ "stakeholder, an in/out-of-scope decision, or a shift in mission \u2014",
1099
+ `append or revise the relevant section in \`${PROJECT_CONTEXT_PATH}\``,
1100
+ "before closing the phase. Commit those edits with the phase's other",
1101
+ "outputs.",
1102
+ "",
1103
+ "Keep edits surgical: short bullet additions, brief clarifications, or",
1104
+ "single-line vocabulary entries. Treat the file as an accreting",
1105
+ "reference, not a document you reshape every session.",
1106
+ "",
1107
+ "---",
1108
+ ""
1109
+ ];
1110
+
1028
1111
  // src/agent/bundles/meeting-analysis.ts
1029
1112
  var meetingAnalystSubAgent = {
1030
1113
  name: "meeting-analyst",
@@ -1066,6 +1149,7 @@ var meetingAnalystSubAgent = {
1066
1149
  "",
1067
1150
  "---",
1068
1151
  "",
1152
+ ...PROJECT_CONTEXT_MAINTAINER_SECTION,
1069
1153
  "## Traceability",
1070
1154
  "",
1071
1155
  "All outputs must be bi-directionally linked so any artifact can be traced",
@@ -1715,6 +1799,7 @@ var orchestratorSubAgent = {
1715
1799
  "",
1716
1800
  "---",
1717
1801
  "",
1802
+ ...PROJECT_CONTEXT_READER_SECTION,
1718
1803
  "## Phase A: Startup",
1719
1804
  "",
1720
1805
  "```bash",
@@ -1881,6 +1966,9 @@ var issueWorkerSubAgent = {
1881
1966
  "doubt, treat the session as interactive \u2014 pausing for approval is always",
1882
1967
  "safe; committing without approval is not.",
1883
1968
  "",
1969
+ "---",
1970
+ "",
1971
+ ...PROJECT_CONTEXT_READER_SECTION,
1884
1972
  "## Phase 1: Select an Issue",
1885
1973
  "",
1886
1974
  "If an issue number was provided in your instructions, use that issue.",
@@ -2230,6 +2318,7 @@ var prReviewerSubAgent = {
2230
2318
  "",
2231
2319
  "---",
2232
2320
  "",
2321
+ ...PROJECT_CONTEXT_READER_SECTION,
2233
2322
  "## Phase 1: Identify the PR",
2234
2323
  "",
2235
2324
  "If a PR number was provided in your instructions, use that. Otherwise stop",
@@ -2885,6 +2974,9 @@ var requirementsAnalystSubAgent = {
2885
2974
  "Follow your project's shared agent conventions (`AGENTS.md`,",
2886
2975
  "`CLAUDE.md`, or equivalent) for all commit, branch, and PR rules.",
2887
2976
  "",
2977
+ "---",
2978
+ "",
2979
+ ...PROJECT_CONTEXT_MAINTAINER_SECTION,
2888
2980
  "## Design Principles",
2889
2981
  "",
2890
2982
  "1. **Discover, don't write.** This agent identifies *what requirements are",
@@ -2985,7 +3077,7 @@ var requirementsAnalystSubAgent = {
2985
3077
  "",
2986
3078
  "| Scope | What to read | What to look for |",
2987
3079
  "|-------|-------------|-----------------|",
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 |",
3080
+ "| **BCM model doc** | One `{PREFIX}-NNN` doc under `<BCM_DOCS_ROOT>` | The doc's project-relevance section (commonly `## <Project> Relevance` or `## Strategic Implications`) \u2014 gaps where capabilities exist but no FR/BR/INT addresses them. Use `docs/project-context.md` to judge what is relevant. |",
2989
3081
  "| **Competitive analysis** | One `comp-*.md` doc under `<COMPETITIVE_ROOT>` | Feature comparison gaps \u2014 competitor features the product lacks requirements for |",
2990
3082
  "| **Product roadmap** | `<PRODUCT_ROOT>/prioritized-feature-roadmap.md` | Roadmap items without corresponding FRs |",
2991
3083
  "| **Entity taxonomy** | `<PRODUCT_ROOT>/entity-taxonomy.md` | Entities without CRUD requirements (FR), data requirements (DR), or security requirements (SEC) |",
@@ -3178,9 +3270,9 @@ var requirementsAnalystSubAgent = {
3178
3270
  " ```",
3179
3271
  "",
3180
3272
  "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:",
3273
+ " analysis that was scanned, add a note in the project-relevance /",
3274
+ " strategic-implications section (whichever heading the source doc uses)",
3275
+ " indicating that a requirement issue was created:",
3184
3276
  "",
3185
3277
  " ```markdown",
3186
3278
  " - Gap addressed: see [<PREFIX>-<NNN>](<relative path to requirement doc>)",
@@ -3198,7 +3290,7 @@ var requirementsAnalystSubAgent = {
3198
3290
  "",
3199
3291
  "| Direction | Agent | What |",
3200
3292
  "|-----------|-------|------|",
3201
- "| Upstream | BCM Writer | Scans `## Vortex Relevance` sections for capability gaps |",
3293
+ "| Upstream | BCM Writer | Scans capability-model docs for project-relevance gaps (judged against `docs/project-context.md`) |",
3202
3294
  "| Upstream | Company Research | Scans competitive analysis for feature comparison gaps |",
3203
3295
  "| Upstream | Meeting Analyst | Scans meeting extracts for requirement proposals |",
3204
3296
  "| Downstream | Requirements Writer (BCM Writer) | Creates `type:requirement` issues for the skill to draft |",
@@ -3334,6 +3426,481 @@ var requirementsAnalystBundle = {
3334
3426
  ]
3335
3427
  };
3336
3428
 
3429
+ // src/agent/bundles/research-pipeline.ts
3430
+ var researchAnalystSubAgent = {
3431
+ name: "research-analyst",
3432
+ description: "Runs a generic research micro-task pipeline (scope, slice search/synthesize, verify). One phase per session, tracked by research:* GitHub issue labels with filesystem-based durability between phases.",
3433
+ model: AGENT_MODEL.POWERFUL,
3434
+ maxTurns: 80,
3435
+ platforms: { cursor: { exclude: true } },
3436
+ prompt: [
3437
+ "# Research Analyst Agent",
3438
+ "",
3439
+ "Generic research micro-task pipeline. Given a research question, you",
3440
+ "break it into a scope, a fixed number of focused search/synthesize",
3441
+ "slices, and a verification pass that reconciles the slice outputs into",
3442
+ "a single deliverable. Each phase runs as its **own agent session**,",
3443
+ "triggered by a GitHub issue with a `research:*` phase label. You",
3444
+ "handle exactly **one phase per session** \u2014 read the issue to determine",
3445
+ "which phase to execute.",
3446
+ "",
3447
+ "This agent is **domain-neutral**. It makes no assumptions about what",
3448
+ "is being researched (companies, products, people, markets, technical",
3449
+ "topics, academic literature, etc.). All domain-specific vocabulary,",
3450
+ "output locations, and acceptance criteria come from the invoking",
3451
+ "issue body or the consuming project's configuration.",
3452
+ "",
3453
+ "Follow your project's shared agent conventions (`AGENTS.md`,",
3454
+ "`CLAUDE.md`, or equivalent) for all commit, branch, and PR rules.",
3455
+ "",
3456
+ "---",
3457
+ "",
3458
+ ...PROJECT_CONTEXT_READER_SECTION,
3459
+ "## Design Principles",
3460
+ "",
3461
+ "1. **Micro-tasks, not mega-prompts.** Split work into small slices so",
3462
+ " each session has a bounded context window and a single deliverable.",
3463
+ "2. **Filesystem durability.** Every phase persists its output to a",
3464
+ " file on disk before closing its issue. Downstream phases read those",
3465
+ " files \u2014 never rely on session memory.",
3466
+ "3. **Issue graph = state machine.** Phase ordering is encoded with",
3467
+ " `Depends on: #N` links between phase issues. A phase runs only",
3468
+ " after its predecessor is closed.",
3469
+ "4. **Generic over specific.** No hardcoded domains, companies, source",
3470
+ " projects, or proprietary taxonomies. Use placeholders that the",
3471
+ " skill invocation or consuming project fills in.",
3472
+ "5. **Verifiable synthesis.** The verify phase re-reads every slice",
3473
+ " output and produces a single deliverable whose claims can each be",
3474
+ " traced back to a slice.",
3475
+ "",
3476
+ "---",
3477
+ "",
3478
+ "## State Machine Overview",
3479
+ "",
3480
+ "```",
3481
+ "\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510",
3482
+ "\u2502 1. SCOPE \u2502\u2500\u2500\u2500\u2500\u25B6\u2502 2. SLICE (\xD7N) \u2502\u2500\u2500\u2500\u2500\u25B6\u2502 3. VERIFY \u2502",
3483
+ "\u2502 Turn the \u2502 \u2502 For each slice: \u2502 \u2502 Read every \u2502",
3484
+ "\u2502 question \u2502 \u2502 search sources, \u2502 \u2502 slice \u2502",
3485
+ "\u2502 into N \u2502 \u2502 synthesize a \u2502 \u2502 output, \u2502",
3486
+ "\u2502 focused \u2502 \u2502 bounded note file \u2502 \u2502 reconcile, \u2502",
3487
+ "\u2502 slices \u2502 \u2502 \u2502 \u2502 deliverable \u2502",
3488
+ "\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518",
3489
+ "```",
3490
+ "",
3491
+ "**Issue labels encode the phase:**",
3492
+ "",
3493
+ "| Label | Phase | Session work |",
3494
+ "|-------|-------|-------------|",
3495
+ "| `research:scope` | 1. Scope | Decompose the research question into N focused slices. Write a scope file. Create N `research:slice` issues. |",
3496
+ "| `research:slice` | 2. Slice | Execute one slice: search authorized sources, synthesize, write a single slice note file. |",
3497
+ "| `research:verify` | 3. Verify | Read every slice note, reconcile findings, produce the final deliverable and a verification report. |",
3498
+ "",
3499
+ "All issues also carry `type:research` and a `status:*` label.",
3500
+ "",
3501
+ "**Issue count per research cycle:** 1 scope + N slice + 1 verify =",
3502
+ "**N + 2 sessions**. Typical N is 3\u20136.",
3503
+ "",
3504
+ "**Shortened paths:**",
3505
+ "- Scope phase determines the question is unanswerable or out of scope",
3506
+ " \u2192 scope issue closes with a justification and no downstream issues",
3507
+ " are created \u2192 **1 session**.",
3508
+ "- Single-slice research (N = 1) \u2192 **3 sessions**. Never skip verify,",
3509
+ " even with one slice \u2014 verify is where the deliverable lands.",
3510
+ "",
3511
+ "---",
3512
+ "",
3513
+ "## Configurable Paths",
3514
+ "",
3515
+ "The pipeline uses these placeholders. Consuming projects override the",
3516
+ "defaults by passing paths in the `/research` skill invocation or by",
3517
+ "extending this rule in their own `agentConfig.rules`.",
3518
+ "",
3519
+ "| Placeholder | Meaning | Default |",
3520
+ "|-------------|---------|---------|",
3521
+ "| `<RESEARCH_ROOT>` | Root folder for all research outputs | `docs/research/` |",
3522
+ "| `<SCOPE_DIR>` | Scope files | `<RESEARCH_ROOT>/scopes/` |",
3523
+ "| `<SLICES_DIR>` | Slice note files | `<RESEARCH_ROOT>/slices/` |",
3524
+ "| `<DELIVERABLES_DIR>` | Final verified deliverables | `<RESEARCH_ROOT>/deliverables/` |",
3525
+ "| `<RESEARCH_SLUG>` | Short kebab-case slug identifying one research cycle | derived from the question |",
3526
+ "| `<N>` | Number of slices (default 4, max 8) | `4` |",
3527
+ "",
3528
+ "If `docs/project-context.md` specifies a different research tree,",
3529
+ "prefer that. Otherwise fall back to the defaults above.",
3530
+ "",
3531
+ "---",
3532
+ "",
3533
+ "## Agent Loop",
3534
+ "",
3535
+ "Run this loop exactly once per session. Never start a second issue.",
3536
+ "",
3537
+ "1. Claim one open `type:research` issue using phase priority:",
3538
+ " `research:scope` > `research:slice` > `research:verify`.",
3539
+ "2. Transition `status:ready` \u2192 `status:in-progress` and create the",
3540
+ " branch per your project's branch-naming convention.",
3541
+ "3. Execute the phase handler that matches the issue's `research:*`",
3542
+ " label.",
3543
+ "4. Commit, push, open a PR (if applicable), and close the issue per",
3544
+ " your project's PR workflow.",
3545
+ "",
3546
+ "---",
3547
+ "",
3548
+ "## Phase 1: Scope (`research:scope`)",
3549
+ "",
3550
+ "**Goal:** Turn a natural-language research question into a bounded",
3551
+ "scope file and `N` focused slice issues.",
3552
+ "",
3553
+ "**Budget:** No web searches in this phase. Read the question, the",
3554
+ "project context, and any cited source material already on disk. Write",
3555
+ "one scope file. Create N slice issues.",
3556
+ "",
3557
+ "### Steps",
3558
+ "",
3559
+ "1. **Read the research question** from the issue body. The body should",
3560
+ " include:",
3561
+ " - The question itself",
3562
+ " - Authorized source categories (e.g. public web, vendor docs, a",
3563
+ " cited local file path) \u2014 if absent, default to public web only",
3564
+ " - Output acceptance criteria for the final deliverable",
3565
+ " - Optional: `<N>` override, `<RESEARCH_SLUG>` override, custom",
3566
+ " output paths",
3567
+ "",
3568
+ "2. **Derive `<RESEARCH_SLUG>`** if not supplied \u2014 a 3\u20135 word kebab-case",
3569
+ " summary of the question. Ensure the slug is not already in use",
3570
+ " under `<SCOPE_DIR>/`.",
3571
+ "",
3572
+ "3. **Decompose the question into N slices.** Each slice must:",
3573
+ " - Be answerable independently of the others",
3574
+ " - Fit inside a single agent session's context budget",
3575
+ " - Have a clearly scoped set of sources to consult",
3576
+ " - Produce a bounded note file (target: under 1500 words)",
3577
+ "",
3578
+ "4. **Write the scope file** to",
3579
+ " `<SCOPE_DIR>/<RESEARCH_SLUG>.scope.md`:",
3580
+ "",
3581
+ " ```markdown",
3582
+ " ---",
3583
+ ' title: "Research Scope: <question>"',
3584
+ " slug: <RESEARCH_SLUG>",
3585
+ " date: YYYY-MM-DD",
3586
+ " parent_issue: <N>",
3587
+ " slice_count: <N>",
3588
+ " ---",
3589
+ "",
3590
+ " # Research Scope: <question>",
3591
+ "",
3592
+ " ## Question",
3593
+ " <verbatim question from the issue>",
3594
+ "",
3595
+ " ## Authorized Sources",
3596
+ " - <source category or path>",
3597
+ "",
3598
+ " ## Acceptance Criteria",
3599
+ " - [ ] <criterion for the final deliverable>",
3600
+ "",
3601
+ " ## Slices",
3602
+ " ### Slice 1: <title>",
3603
+ " - **Focus:** <what this slice answers>",
3604
+ " - **Sources:** <the subset of authorized sources this slice uses>",
3605
+ " - **Output:** <SLICES_DIR>/<RESEARCH_SLUG>-01-<slug>.slice.md",
3606
+ "",
3607
+ " ### Slice 2: <title>",
3608
+ " ...",
3609
+ "",
3610
+ " ## Out of Scope",
3611
+ " <sub-questions deliberately excluded from this cycle>",
3612
+ "",
3613
+ " ## Deliverable",
3614
+ " <DELIVERABLES_DIR>/<RESEARCH_SLUG>.md",
3615
+ " ```",
3616
+ "",
3617
+ "5. **Create N `research:slice` issues**, one per slice, each with",
3618
+ " `Depends on: #<scope-issue>`. Each slice issue body references the",
3619
+ " scope file and names the exact slice (by number and title).",
3620
+ "",
3621
+ "6. **Create one `research:verify` issue** that depends on all N slice",
3622
+ " issues. Its body references the scope file and lists every slice",
3623
+ " output path that verify must read.",
3624
+ "",
3625
+ "7. **Commit and push** the scope file. Close the scope issue.",
3626
+ "",
3627
+ "---",
3628
+ "",
3629
+ "## Phase 2: Slice (`research:slice`)",
3630
+ "",
3631
+ "**Goal:** Answer one slice by searching the authorized sources and",
3632
+ "writing a single slice note file.",
3633
+ "",
3634
+ "**Budget:** Search budget is one slice \u2014 do not expand scope. Write",
3635
+ "one slice note. Do not create downstream issues.",
3636
+ "",
3637
+ "### Steps",
3638
+ "",
3639
+ "1. **Read the scope file** referenced in the issue body.",
3640
+ "",
3641
+ "2. **Identify your slice** by number and title. Re-read the slice's",
3642
+ " focus, sources, and output path.",
3643
+ "",
3644
+ "3. **Search the authorized sources.** Stay within the source list for",
3645
+ " your slice \u2014 do not broaden to the full scope's source list unless",
3646
+ " the slice explicitly permits it.",
3647
+ "",
3648
+ "4. **Synthesize a slice note** and write it to the slice's output",
3649
+ " path (e.g. `<SLICES_DIR>/<RESEARCH_SLUG>-NN-<slug>.slice.md`):",
3650
+ "",
3651
+ " ```markdown",
3652
+ " ---",
3653
+ ' title: "Slice NN: <title>"',
3654
+ " slug: <RESEARCH_SLUG>",
3655
+ " slice: NN",
3656
+ " date: YYYY-MM-DD",
3657
+ " parent_scope: <SCOPE_DIR>/<RESEARCH_SLUG>.scope.md",
3658
+ " parent_issue: <N>",
3659
+ " ---",
3660
+ "",
3661
+ " # Slice NN: <title>",
3662
+ "",
3663
+ " ## Question",
3664
+ " <the slice-level question>",
3665
+ "",
3666
+ " ## Key Findings",
3667
+ " - <finding> \u2014 source: <citation>",
3668
+ "",
3669
+ " ## Evidence",
3670
+ " <short quotations, paraphrases, or structured data with citations>",
3671
+ "",
3672
+ " ## Gaps / Open Questions",
3673
+ " <anything the slice could not answer inside its budget>",
3674
+ "",
3675
+ " ## Sources",
3676
+ " - <source URL or file path> \u2014 <date accessed>",
3677
+ " ```",
3678
+ "",
3679
+ "5. **Stay within the word budget** (default 1500 words). If the slice",
3680
+ " cannot fit, add an `## Overflow` section at the end noting what was",
3681
+ " cut and flag it for the verify phase \u2014 do not expand into other",
3682
+ " slices' territory.",
3683
+ "",
3684
+ "6. **Commit and push** the slice note. Close the slice issue.",
3685
+ "",
3686
+ "---",
3687
+ "",
3688
+ "## Phase 3: Verify (`research:verify`)",
3689
+ "",
3690
+ "**Goal:** Reconcile every slice into a single verified deliverable.",
3691
+ "",
3692
+ "**Budget:** No new web searches. Read the scope, read every slice",
3693
+ "note, reconcile contradictions, write the deliverable and a short",
3694
+ "verification report.",
3695
+ "",
3696
+ "### Steps",
3697
+ "",
3698
+ "1. **Read the scope file** and every slice note listed in the issue",
3699
+ " body. If any slice file is missing, stop and re-open the",
3700
+ " corresponding slice issue with `status:needs-attention`.",
3701
+ "",
3702
+ "2. **Build a claim index.** For every assertion in any slice, note",
3703
+ " which slice(s) support it and which sources back it.",
3704
+ "",
3705
+ "3. **Reconcile contradictions.** When slices disagree:",
3706
+ " - Prefer the slice with stronger sources",
3707
+ " - Flag unresolved contradictions in the verification report",
3708
+ " - Do not silently pick a side",
3709
+ "",
3710
+ "4. **Write the deliverable** to",
3711
+ " `<DELIVERABLES_DIR>/<RESEARCH_SLUG>.md`. The structure is dictated",
3712
+ " by the acceptance criteria in the scope file. Every factual claim",
3713
+ " in the deliverable must cite at least one slice note.",
3714
+ "",
3715
+ "5. **Write a verification report** to",
3716
+ " `<DELIVERABLES_DIR>/<RESEARCH_SLUG>.verify.md`:",
3717
+ "",
3718
+ " ```markdown",
3719
+ " ---",
3720
+ ' title: "Verification Report: <question>"',
3721
+ " slug: <RESEARCH_SLUG>",
3722
+ " date: YYYY-MM-DD",
3723
+ " parent_issue: <N>",
3724
+ " slices_read: <count>",
3725
+ " ---",
3726
+ "",
3727
+ " # Verification Report: <question>",
3728
+ "",
3729
+ " ## Acceptance Criteria Coverage",
3730
+ " - [x] <criterion> \u2014 covered by slice(s) <NN, NN>",
3731
+ " - [ ] <criterion> \u2014 **not covered**; gap noted in deliverable",
3732
+ "",
3733
+ " ## Slice Coverage",
3734
+ " | Slice | Claims | Reused in deliverable | Notes |",
3735
+ " |-------|--------|-----------------------|-------|",
3736
+ " | 01 | <count> | <count> | |",
3737
+ "",
3738
+ " ## Reconciled Contradictions",
3739
+ " - <short summary of each reconciled contradiction and why>",
3740
+ "",
3741
+ " ## Unresolved Contradictions",
3742
+ " - <contradiction the verifier could not resolve>",
3743
+ "",
3744
+ " ## Gaps",
3745
+ " - <question the pipeline could not answer>",
3746
+ " ```",
3747
+ "",
3748
+ "6. **Comment on the scope issue** with a summary linking to the",
3749
+ " deliverable and verification report.",
3750
+ "",
3751
+ "7. **Commit and push.** Close the verify issue.",
3752
+ "",
3753
+ "---",
3754
+ "",
3755
+ "## Output Boundaries",
3756
+ "",
3757
+ "This agent writes **only** to:",
3758
+ "",
3759
+ "- `<SCOPE_DIR>/` \u2014 scope files (Phase 1)",
3760
+ "- `<SLICES_DIR>/` \u2014 slice notes (Phase 2)",
3761
+ "- `<DELIVERABLES_DIR>/` \u2014 deliverables and verification reports",
3762
+ " (Phase 3)",
3763
+ "",
3764
+ "The pipeline produces **notes and deliverables only**. It does not",
3765
+ "open downstream `type:requirement`, profile, or comparison issues \u2014",
3766
+ "those are the responsibility of specialized downstream agents (e.g.",
3767
+ "`requirements-analyst`, `meeting-analyst`) that consume the",
3768
+ "deliverables produced here. Keep this boundary clean so the research",
3769
+ "pipeline stays generic.",
3770
+ "",
3771
+ "---",
3772
+ "",
3773
+ "## Rules",
3774
+ "",
3775
+ "- **One phase per session.** Never run two phases back-to-back in a",
3776
+ " single session.",
3777
+ "- **Persist before closing.** Every phase must write its output file",
3778
+ " before closing its issue.",
3779
+ "- **Do not expand scope mid-slice.** Overflow goes into the slice's",
3780
+ " overflow section and is flagged for verify \u2014 not into another",
3781
+ " slice's territory.",
3782
+ "- **Cite everything.** Claims without a source citation do not belong",
3783
+ " in a slice note or deliverable.",
3784
+ "- **Produce notes, not downstream work.** Do not create",
3785
+ " `type:requirement`, profile, or comparison issues from this",
3786
+ " pipeline. Emit deliverables under `<DELIVERABLES_DIR>/` and let",
3787
+ " downstream agents decide what to do with them."
3788
+ ].join("\n")
3789
+ };
3790
+ var researchSkill = {
3791
+ name: "research",
3792
+ description: "Kick off a generic research micro-task pipeline. Creates a research:scope issue and dispatches Phase 1 (Scope) in the research-analyst agent.",
3793
+ disableModelInvocation: true,
3794
+ userInvocable: true,
3795
+ context: "fork",
3796
+ agent: "research-analyst",
3797
+ platforms: { cursor: { exclude: true } },
3798
+ instructions: [
3799
+ "# Research",
3800
+ "",
3801
+ "Kick off a generic research micro-task pipeline. Creates a",
3802
+ "`research:scope` issue carrying the research question and dispatches",
3803
+ "Phase 1 (Scope) in the research-analyst agent.",
3804
+ "",
3805
+ "## Usage",
3806
+ "",
3807
+ "/research <question>",
3808
+ "",
3809
+ "Optional extensions in the question body:",
3810
+ "- `sources: <list>` \u2014 authorized source categories or file paths",
3811
+ "- `slices: <N>` \u2014 override the default slice count (default 4, max 8)",
3812
+ "- `slug: <kebab-case>` \u2014 override the derived research slug",
3813
+ "- `acceptance: <list>` \u2014 explicit acceptance criteria for the",
3814
+ " deliverable",
3815
+ "",
3816
+ "## Default Paths",
3817
+ "",
3818
+ "If the project has no override in `docs/project-context.md` or",
3819
+ "`agentConfig.rules`, outputs land under:",
3820
+ "",
3821
+ "- `docs/research/scopes/<slug>.scope.md`",
3822
+ "- `docs/research/slices/<slug>-NN-<slice-slug>.slice.md`",
3823
+ "- `docs/research/deliverables/<slug>.md`",
3824
+ "- `docs/research/deliverables/<slug>.verify.md`",
3825
+ "",
3826
+ "## Steps",
3827
+ "",
3828
+ "1. Create a `research:scope` issue with `type:research`,",
3829
+ " `priority:medium`, and `status:ready`. Body must include the",
3830
+ " verbatim question, authorized sources, and any overrides.",
3831
+ "2. Execute Phase 1 (Scope) of the research-analyst agent.",
3832
+ "3. Phase 1 creates `research:slice` issues (one per slice) and a",
3833
+ " single `research:verify` issue. Each downstream issue declares",
3834
+ " its `Depends on:` predecessor.",
3835
+ "",
3836
+ "## Output",
3837
+ "",
3838
+ "- A scope file under the project's research scope directory",
3839
+ "- One slice note per slice under the slices directory",
3840
+ "- A single deliverable plus verification report under the deliverables",
3841
+ " directory",
3842
+ "- This pipeline produces **notes and deliverables only** \u2014 it does",
3843
+ " not open downstream `type:requirement` or profile issues."
3844
+ ].join("\n")
3845
+ };
3846
+ var researchPipelineBundle = {
3847
+ name: "research-pipeline",
3848
+ description: "Generic research micro-task pipeline: scope, N-way slice search/synthesize, and verify. Opt-in only; domain-neutral; filesystem-durable between phases.",
3849
+ appliesWhen: () => false,
3850
+ rules: [
3851
+ {
3852
+ name: "research-pipeline-workflow",
3853
+ description: "Describes the 3-phase generic research pipeline, the research:* label taxonomy, and the boundary against downstream specialized agents.",
3854
+ scope: AGENT_RULE_SCOPE.ALWAYS,
3855
+ content: [
3856
+ "# Research Pipeline Workflow",
3857
+ "",
3858
+ "Use `/research <question>` to kick off a generic research",
3859
+ "micro-task pipeline. The pipeline runs in 3 phases \u2014 scope, slice,",
3860
+ "verify \u2014 each tracked by its own GitHub issue labeled",
3861
+ "`research:scope`, `research:slice`, or `research:verify`. All",
3862
+ "issues carry `type:research`.",
3863
+ "",
3864
+ "The pipeline produces **notes and deliverables only**. It does",
3865
+ "not open downstream `type:requirement` or profile issues \u2014 those",
3866
+ "belong to specialized downstream agents that consume the",
3867
+ "deliverables.",
3868
+ "",
3869
+ "See the `research-analyst` agent definition for full workflow",
3870
+ "details, default paths, and phase-by-phase instructions."
3871
+ ].join("\n"),
3872
+ platforms: {
3873
+ cursor: { exclude: true }
3874
+ },
3875
+ tags: ["workflow"]
3876
+ }
3877
+ ],
3878
+ skills: [researchSkill],
3879
+ subAgents: [researchAnalystSubAgent],
3880
+ labels: [
3881
+ {
3882
+ name: "type:research",
3883
+ color: "5319E7",
3884
+ description: "Work that produces or consumes a research note, slice, or deliverable"
3885
+ },
3886
+ {
3887
+ name: "research:scope",
3888
+ color: "C5DEF5",
3889
+ description: "Phase 1: decompose a research question into N focused slice issues"
3890
+ },
3891
+ {
3892
+ name: "research:slice",
3893
+ color: "BFDADC",
3894
+ description: "Phase 2: execute one research slice \u2014 search authorized sources and write a slice note"
3895
+ },
3896
+ {
3897
+ name: "research:verify",
3898
+ color: "D4C5F9",
3899
+ description: "Phase 3: reconcile slice notes into a verified deliverable"
3900
+ }
3901
+ ]
3902
+ };
3903
+
3337
3904
  // src/agent/bundles/slack.ts
3338
3905
  var slackBundle = {
3339
3906
  name: "slack",
@@ -3984,7 +4551,8 @@ var BUILT_IN_BUNDLES = [
3984
4551
  meetingAnalysisBundle,
3985
4552
  orchestratorBundle,
3986
4553
  prReviewBundle,
3987
- requirementsAnalystBundle
4554
+ requirementsAnalystBundle,
4555
+ researchPipelineBundle
3988
4556
  ];
3989
4557
 
3990
4558
  // src/agent/bundles/scope.ts
@@ -7525,6 +8093,7 @@ export {
7525
8093
  prReviewBundle,
7526
8094
  projenBundle,
7527
8095
  requirementsAnalystBundle,
8096
+ researchPipelineBundle,
7528
8097
  resolveModelAlias,
7529
8098
  resolveTemplateVariables,
7530
8099
  slackBundle,