@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.js CHANGED
@@ -231,6 +231,7 @@ __export(index_exports, {
231
231
  prReviewBundle: () => prReviewBundle,
232
232
  projenBundle: () => projenBundle,
233
233
  requirementsAnalystBundle: () => requirementsAnalystBundle,
234
+ researchPipelineBundle: () => researchPipelineBundle,
234
235
  resolveModelAlias: () => resolveModelAlias,
235
236
  resolveTemplateVariables: () => resolveTemplateVariables,
236
237
  slackBundle: () => slackBundle,
@@ -1093,6 +1094,89 @@ var jestBundle = {
1093
1094
  }
1094
1095
  };
1095
1096
 
1097
+ // src/agent/bundles/project-context.ts
1098
+ var PROJECT_CONTEXT_PATH = "docs/project-context.md";
1099
+ var PROJECT_CONTEXT_READER_SECTION = [
1100
+ "## Project Context",
1101
+ "",
1102
+ `Before doing any work, read \`${PROJECT_CONTEXT_PATH}\` at the`,
1103
+ 'repository root. It is the canonical answer to "what is this project',
1104
+ 'about?" \u2014 mission, domain vocabulary, in/out-of-scope capabilities, and',
1105
+ "key stakeholders. Use it to frame judgment calls in this session.",
1106
+ "",
1107
+ `If \`${PROJECT_CONTEXT_PATH}\` does not exist, proceed with the current`,
1108
+ "task and note the absence in your session log \u2014 the meeting-analyst and",
1109
+ "requirements-analyst agents seed the file on their next run.",
1110
+ "",
1111
+ "You are a **read-only consumer** of this file. Do not edit it.",
1112
+ "",
1113
+ "---",
1114
+ ""
1115
+ ];
1116
+ var PROJECT_CONTEXT_MAINTAINER_SECTION = [
1117
+ "## Project Context",
1118
+ "",
1119
+ `Before starting any phase, read \`${PROJECT_CONTEXT_PATH}\` at the`,
1120
+ 'repository root. It is the canonical answer to "what is this project',
1121
+ 'about?" \u2014 mission, domain vocabulary, in/out-of-scope capabilities, and',
1122
+ "key stakeholders. Use it to judge relevance when scanning source",
1123
+ "material in this session.",
1124
+ "",
1125
+ "### Seed on first use",
1126
+ "",
1127
+ `If \`${PROJECT_CONTEXT_PATH}\` does not exist, create it from this`,
1128
+ "template and commit it alongside this phase's other outputs:",
1129
+ "",
1130
+ "```markdown",
1131
+ "# Project Context",
1132
+ "",
1133
+ "> Canonical description of this project. Read by all agents before",
1134
+ "> work. Updated by meeting-analyst and requirements-analyst when new",
1135
+ "> scope, vocabulary, or stakeholders emerge.",
1136
+ "",
1137
+ "## Mission",
1138
+ "TODO: one or two sentences on what this project exists to do.",
1139
+ "",
1140
+ "## Target Users",
1141
+ "TODO: who uses this, in what role.",
1142
+ "",
1143
+ "## In-Scope Capabilities",
1144
+ "TODO: bullet list of the capabilities this project owns.",
1145
+ "",
1146
+ "## Out-of-Scope",
1147
+ "TODO: capabilities or concerns that are explicitly not this project's.",
1148
+ "",
1149
+ "## Domain Vocabulary",
1150
+ "TODO: short glossary of domain terms, acronyms, and their definitions.",
1151
+ "",
1152
+ "## Key Stakeholders",
1153
+ "TODO: named people or teams and what they care about.",
1154
+ "",
1155
+ "## References",
1156
+ "TODO: links to BCM docs, competitive analysis, product roadmap, and",
1157
+ "other authoritative sources.",
1158
+ "```",
1159
+ "",
1160
+ "Fill whatever you can infer from the source material you are already",
1161
+ "reading in this phase; leave `TODO:` placeholders for the rest.",
1162
+ "",
1163
+ "### Update on new facts",
1164
+ "",
1165
+ "When the source material you process reveals new project-scope",
1166
+ "information \u2014 a new capability, a vocabulary term, an entity, a",
1167
+ "stakeholder, an in/out-of-scope decision, or a shift in mission \u2014",
1168
+ `append or revise the relevant section in \`${PROJECT_CONTEXT_PATH}\``,
1169
+ "before closing the phase. Commit those edits with the phase's other",
1170
+ "outputs.",
1171
+ "",
1172
+ "Keep edits surgical: short bullet additions, brief clarifications, or",
1173
+ "single-line vocabulary entries. Treat the file as an accreting",
1174
+ "reference, not a document you reshape every session.",
1175
+ "",
1176
+ "---",
1177
+ ""
1178
+ ];
1179
+
1096
1180
  // src/agent/bundles/meeting-analysis.ts
1097
1181
  var meetingAnalystSubAgent = {
1098
1182
  name: "meeting-analyst",
@@ -1134,6 +1218,7 @@ var meetingAnalystSubAgent = {
1134
1218
  "",
1135
1219
  "---",
1136
1220
  "",
1221
+ ...PROJECT_CONTEXT_MAINTAINER_SECTION,
1137
1222
  "## Traceability",
1138
1223
  "",
1139
1224
  "All outputs must be bi-directionally linked so any artifact can be traced",
@@ -1783,6 +1868,7 @@ var orchestratorSubAgent = {
1783
1868
  "",
1784
1869
  "---",
1785
1870
  "",
1871
+ ...PROJECT_CONTEXT_READER_SECTION,
1786
1872
  "## Phase A: Startup",
1787
1873
  "",
1788
1874
  "```bash",
@@ -1949,6 +2035,9 @@ var issueWorkerSubAgent = {
1949
2035
  "doubt, treat the session as interactive \u2014 pausing for approval is always",
1950
2036
  "safe; committing without approval is not.",
1951
2037
  "",
2038
+ "---",
2039
+ "",
2040
+ ...PROJECT_CONTEXT_READER_SECTION,
1952
2041
  "## Phase 1: Select an Issue",
1953
2042
  "",
1954
2043
  "If an issue number was provided in your instructions, use that issue.",
@@ -2298,6 +2387,7 @@ var prReviewerSubAgent = {
2298
2387
  "",
2299
2388
  "---",
2300
2389
  "",
2390
+ ...PROJECT_CONTEXT_READER_SECTION,
2301
2391
  "## Phase 1: Identify the PR",
2302
2392
  "",
2303
2393
  "If a PR number was provided in your instructions, use that. Otherwise stop",
@@ -2953,6 +3043,9 @@ var requirementsAnalystSubAgent = {
2953
3043
  "Follow your project's shared agent conventions (`AGENTS.md`,",
2954
3044
  "`CLAUDE.md`, or equivalent) for all commit, branch, and PR rules.",
2955
3045
  "",
3046
+ "---",
3047
+ "",
3048
+ ...PROJECT_CONTEXT_MAINTAINER_SECTION,
2956
3049
  "## Design Principles",
2957
3050
  "",
2958
3051
  "1. **Discover, don't write.** This agent identifies *what requirements are",
@@ -3053,7 +3146,7 @@ var requirementsAnalystSubAgent = {
3053
3146
  "",
3054
3147
  "| Scope | What to read | What to look for |",
3055
3148
  "|-------|-------------|-----------------|",
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 |",
3149
+ "| **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. |",
3057
3150
  "| **Competitive analysis** | One `comp-*.md` doc under `<COMPETITIVE_ROOT>` | Feature comparison gaps \u2014 competitor features the product lacks requirements for |",
3058
3151
  "| **Product roadmap** | `<PRODUCT_ROOT>/prioritized-feature-roadmap.md` | Roadmap items without corresponding FRs |",
3059
3152
  "| **Entity taxonomy** | `<PRODUCT_ROOT>/entity-taxonomy.md` | Entities without CRUD requirements (FR), data requirements (DR), or security requirements (SEC) |",
@@ -3246,9 +3339,9 @@ var requirementsAnalystSubAgent = {
3246
3339
  " ```",
3247
3340
  "",
3248
3341
  "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:",
3342
+ " analysis that was scanned, add a note in the project-relevance /",
3343
+ " strategic-implications section (whichever heading the source doc uses)",
3344
+ " indicating that a requirement issue was created:",
3252
3345
  "",
3253
3346
  " ```markdown",
3254
3347
  " - Gap addressed: see [<PREFIX>-<NNN>](<relative path to requirement doc>)",
@@ -3266,7 +3359,7 @@ var requirementsAnalystSubAgent = {
3266
3359
  "",
3267
3360
  "| Direction | Agent | What |",
3268
3361
  "|-----------|-------|------|",
3269
- "| Upstream | BCM Writer | Scans `## Vortex Relevance` sections for capability gaps |",
3362
+ "| Upstream | BCM Writer | Scans capability-model docs for project-relevance gaps (judged against `docs/project-context.md`) |",
3270
3363
  "| Upstream | Company Research | Scans competitive analysis for feature comparison gaps |",
3271
3364
  "| Upstream | Meeting Analyst | Scans meeting extracts for requirement proposals |",
3272
3365
  "| Downstream | Requirements Writer (BCM Writer) | Creates `type:requirement` issues for the skill to draft |",
@@ -3402,6 +3495,481 @@ var requirementsAnalystBundle = {
3402
3495
  ]
3403
3496
  };
3404
3497
 
3498
+ // src/agent/bundles/research-pipeline.ts
3499
+ var researchAnalystSubAgent = {
3500
+ name: "research-analyst",
3501
+ 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.",
3502
+ model: AGENT_MODEL.POWERFUL,
3503
+ maxTurns: 80,
3504
+ platforms: { cursor: { exclude: true } },
3505
+ prompt: [
3506
+ "# Research Analyst Agent",
3507
+ "",
3508
+ "Generic research micro-task pipeline. Given a research question, you",
3509
+ "break it into a scope, a fixed number of focused search/synthesize",
3510
+ "slices, and a verification pass that reconciles the slice outputs into",
3511
+ "a single deliverable. Each phase runs as its **own agent session**,",
3512
+ "triggered by a GitHub issue with a `research:*` phase label. You",
3513
+ "handle exactly **one phase per session** \u2014 read the issue to determine",
3514
+ "which phase to execute.",
3515
+ "",
3516
+ "This agent is **domain-neutral**. It makes no assumptions about what",
3517
+ "is being researched (companies, products, people, markets, technical",
3518
+ "topics, academic literature, etc.). All domain-specific vocabulary,",
3519
+ "output locations, and acceptance criteria come from the invoking",
3520
+ "issue body or the consuming project's configuration.",
3521
+ "",
3522
+ "Follow your project's shared agent conventions (`AGENTS.md`,",
3523
+ "`CLAUDE.md`, or equivalent) for all commit, branch, and PR rules.",
3524
+ "",
3525
+ "---",
3526
+ "",
3527
+ ...PROJECT_CONTEXT_READER_SECTION,
3528
+ "## Design Principles",
3529
+ "",
3530
+ "1. **Micro-tasks, not mega-prompts.** Split work into small slices so",
3531
+ " each session has a bounded context window and a single deliverable.",
3532
+ "2. **Filesystem durability.** Every phase persists its output to a",
3533
+ " file on disk before closing its issue. Downstream phases read those",
3534
+ " files \u2014 never rely on session memory.",
3535
+ "3. **Issue graph = state machine.** Phase ordering is encoded with",
3536
+ " `Depends on: #N` links between phase issues. A phase runs only",
3537
+ " after its predecessor is closed.",
3538
+ "4. **Generic over specific.** No hardcoded domains, companies, source",
3539
+ " projects, or proprietary taxonomies. Use placeholders that the",
3540
+ " skill invocation or consuming project fills in.",
3541
+ "5. **Verifiable synthesis.** The verify phase re-reads every slice",
3542
+ " output and produces a single deliverable whose claims can each be",
3543
+ " traced back to a slice.",
3544
+ "",
3545
+ "---",
3546
+ "",
3547
+ "## State Machine Overview",
3548
+ "",
3549
+ "```",
3550
+ "\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",
3551
+ "\u2502 1. SCOPE \u2502\u2500\u2500\u2500\u2500\u25B6\u2502 2. SLICE (\xD7N) \u2502\u2500\u2500\u2500\u2500\u25B6\u2502 3. VERIFY \u2502",
3552
+ "\u2502 Turn the \u2502 \u2502 For each slice: \u2502 \u2502 Read every \u2502",
3553
+ "\u2502 question \u2502 \u2502 search sources, \u2502 \u2502 slice \u2502",
3554
+ "\u2502 into N \u2502 \u2502 synthesize a \u2502 \u2502 output, \u2502",
3555
+ "\u2502 focused \u2502 \u2502 bounded note file \u2502 \u2502 reconcile, \u2502",
3556
+ "\u2502 slices \u2502 \u2502 \u2502 \u2502 deliverable \u2502",
3557
+ "\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",
3558
+ "```",
3559
+ "",
3560
+ "**Issue labels encode the phase:**",
3561
+ "",
3562
+ "| Label | Phase | Session work |",
3563
+ "|-------|-------|-------------|",
3564
+ "| `research:scope` | 1. Scope | Decompose the research question into N focused slices. Write a scope file. Create N `research:slice` issues. |",
3565
+ "| `research:slice` | 2. Slice | Execute one slice: search authorized sources, synthesize, write a single slice note file. |",
3566
+ "| `research:verify` | 3. Verify | Read every slice note, reconcile findings, produce the final deliverable and a verification report. |",
3567
+ "",
3568
+ "All issues also carry `type:research` and a `status:*` label.",
3569
+ "",
3570
+ "**Issue count per research cycle:** 1 scope + N slice + 1 verify =",
3571
+ "**N + 2 sessions**. Typical N is 3\u20136.",
3572
+ "",
3573
+ "**Shortened paths:**",
3574
+ "- Scope phase determines the question is unanswerable or out of scope",
3575
+ " \u2192 scope issue closes with a justification and no downstream issues",
3576
+ " are created \u2192 **1 session**.",
3577
+ "- Single-slice research (N = 1) \u2192 **3 sessions**. Never skip verify,",
3578
+ " even with one slice \u2014 verify is where the deliverable lands.",
3579
+ "",
3580
+ "---",
3581
+ "",
3582
+ "## Configurable Paths",
3583
+ "",
3584
+ "The pipeline uses these placeholders. Consuming projects override the",
3585
+ "defaults by passing paths in the `/research` skill invocation or by",
3586
+ "extending this rule in their own `agentConfig.rules`.",
3587
+ "",
3588
+ "| Placeholder | Meaning | Default |",
3589
+ "|-------------|---------|---------|",
3590
+ "| `<RESEARCH_ROOT>` | Root folder for all research outputs | `docs/research/` |",
3591
+ "| `<SCOPE_DIR>` | Scope files | `<RESEARCH_ROOT>/scopes/` |",
3592
+ "| `<SLICES_DIR>` | Slice note files | `<RESEARCH_ROOT>/slices/` |",
3593
+ "| `<DELIVERABLES_DIR>` | Final verified deliverables | `<RESEARCH_ROOT>/deliverables/` |",
3594
+ "| `<RESEARCH_SLUG>` | Short kebab-case slug identifying one research cycle | derived from the question |",
3595
+ "| `<N>` | Number of slices (default 4, max 8) | `4` |",
3596
+ "",
3597
+ "If `docs/project-context.md` specifies a different research tree,",
3598
+ "prefer that. Otherwise fall back to the defaults above.",
3599
+ "",
3600
+ "---",
3601
+ "",
3602
+ "## Agent Loop",
3603
+ "",
3604
+ "Run this loop exactly once per session. Never start a second issue.",
3605
+ "",
3606
+ "1. Claim one open `type:research` issue using phase priority:",
3607
+ " `research:scope` > `research:slice` > `research:verify`.",
3608
+ "2. Transition `status:ready` \u2192 `status:in-progress` and create the",
3609
+ " branch per your project's branch-naming convention.",
3610
+ "3. Execute the phase handler that matches the issue's `research:*`",
3611
+ " label.",
3612
+ "4. Commit, push, open a PR (if applicable), and close the issue per",
3613
+ " your project's PR workflow.",
3614
+ "",
3615
+ "---",
3616
+ "",
3617
+ "## Phase 1: Scope (`research:scope`)",
3618
+ "",
3619
+ "**Goal:** Turn a natural-language research question into a bounded",
3620
+ "scope file and `N` focused slice issues.",
3621
+ "",
3622
+ "**Budget:** No web searches in this phase. Read the question, the",
3623
+ "project context, and any cited source material already on disk. Write",
3624
+ "one scope file. Create N slice issues.",
3625
+ "",
3626
+ "### Steps",
3627
+ "",
3628
+ "1. **Read the research question** from the issue body. The body should",
3629
+ " include:",
3630
+ " - The question itself",
3631
+ " - Authorized source categories (e.g. public web, vendor docs, a",
3632
+ " cited local file path) \u2014 if absent, default to public web only",
3633
+ " - Output acceptance criteria for the final deliverable",
3634
+ " - Optional: `<N>` override, `<RESEARCH_SLUG>` override, custom",
3635
+ " output paths",
3636
+ "",
3637
+ "2. **Derive `<RESEARCH_SLUG>`** if not supplied \u2014 a 3\u20135 word kebab-case",
3638
+ " summary of the question. Ensure the slug is not already in use",
3639
+ " under `<SCOPE_DIR>/`.",
3640
+ "",
3641
+ "3. **Decompose the question into N slices.** Each slice must:",
3642
+ " - Be answerable independently of the others",
3643
+ " - Fit inside a single agent session's context budget",
3644
+ " - Have a clearly scoped set of sources to consult",
3645
+ " - Produce a bounded note file (target: under 1500 words)",
3646
+ "",
3647
+ "4. **Write the scope file** to",
3648
+ " `<SCOPE_DIR>/<RESEARCH_SLUG>.scope.md`:",
3649
+ "",
3650
+ " ```markdown",
3651
+ " ---",
3652
+ ' title: "Research Scope: <question>"',
3653
+ " slug: <RESEARCH_SLUG>",
3654
+ " date: YYYY-MM-DD",
3655
+ " parent_issue: <N>",
3656
+ " slice_count: <N>",
3657
+ " ---",
3658
+ "",
3659
+ " # Research Scope: <question>",
3660
+ "",
3661
+ " ## Question",
3662
+ " <verbatim question from the issue>",
3663
+ "",
3664
+ " ## Authorized Sources",
3665
+ " - <source category or path>",
3666
+ "",
3667
+ " ## Acceptance Criteria",
3668
+ " - [ ] <criterion for the final deliverable>",
3669
+ "",
3670
+ " ## Slices",
3671
+ " ### Slice 1: <title>",
3672
+ " - **Focus:** <what this slice answers>",
3673
+ " - **Sources:** <the subset of authorized sources this slice uses>",
3674
+ " - **Output:** <SLICES_DIR>/<RESEARCH_SLUG>-01-<slug>.slice.md",
3675
+ "",
3676
+ " ### Slice 2: <title>",
3677
+ " ...",
3678
+ "",
3679
+ " ## Out of Scope",
3680
+ " <sub-questions deliberately excluded from this cycle>",
3681
+ "",
3682
+ " ## Deliverable",
3683
+ " <DELIVERABLES_DIR>/<RESEARCH_SLUG>.md",
3684
+ " ```",
3685
+ "",
3686
+ "5. **Create N `research:slice` issues**, one per slice, each with",
3687
+ " `Depends on: #<scope-issue>`. Each slice issue body references the",
3688
+ " scope file and names the exact slice (by number and title).",
3689
+ "",
3690
+ "6. **Create one `research:verify` issue** that depends on all N slice",
3691
+ " issues. Its body references the scope file and lists every slice",
3692
+ " output path that verify must read.",
3693
+ "",
3694
+ "7. **Commit and push** the scope file. Close the scope issue.",
3695
+ "",
3696
+ "---",
3697
+ "",
3698
+ "## Phase 2: Slice (`research:slice`)",
3699
+ "",
3700
+ "**Goal:** Answer one slice by searching the authorized sources and",
3701
+ "writing a single slice note file.",
3702
+ "",
3703
+ "**Budget:** Search budget is one slice \u2014 do not expand scope. Write",
3704
+ "one slice note. Do not create downstream issues.",
3705
+ "",
3706
+ "### Steps",
3707
+ "",
3708
+ "1. **Read the scope file** referenced in the issue body.",
3709
+ "",
3710
+ "2. **Identify your slice** by number and title. Re-read the slice's",
3711
+ " focus, sources, and output path.",
3712
+ "",
3713
+ "3. **Search the authorized sources.** Stay within the source list for",
3714
+ " your slice \u2014 do not broaden to the full scope's source list unless",
3715
+ " the slice explicitly permits it.",
3716
+ "",
3717
+ "4. **Synthesize a slice note** and write it to the slice's output",
3718
+ " path (e.g. `<SLICES_DIR>/<RESEARCH_SLUG>-NN-<slug>.slice.md`):",
3719
+ "",
3720
+ " ```markdown",
3721
+ " ---",
3722
+ ' title: "Slice NN: <title>"',
3723
+ " slug: <RESEARCH_SLUG>",
3724
+ " slice: NN",
3725
+ " date: YYYY-MM-DD",
3726
+ " parent_scope: <SCOPE_DIR>/<RESEARCH_SLUG>.scope.md",
3727
+ " parent_issue: <N>",
3728
+ " ---",
3729
+ "",
3730
+ " # Slice NN: <title>",
3731
+ "",
3732
+ " ## Question",
3733
+ " <the slice-level question>",
3734
+ "",
3735
+ " ## Key Findings",
3736
+ " - <finding> \u2014 source: <citation>",
3737
+ "",
3738
+ " ## Evidence",
3739
+ " <short quotations, paraphrases, or structured data with citations>",
3740
+ "",
3741
+ " ## Gaps / Open Questions",
3742
+ " <anything the slice could not answer inside its budget>",
3743
+ "",
3744
+ " ## Sources",
3745
+ " - <source URL or file path> \u2014 <date accessed>",
3746
+ " ```",
3747
+ "",
3748
+ "5. **Stay within the word budget** (default 1500 words). If the slice",
3749
+ " cannot fit, add an `## Overflow` section at the end noting what was",
3750
+ " cut and flag it for the verify phase \u2014 do not expand into other",
3751
+ " slices' territory.",
3752
+ "",
3753
+ "6. **Commit and push** the slice note. Close the slice issue.",
3754
+ "",
3755
+ "---",
3756
+ "",
3757
+ "## Phase 3: Verify (`research:verify`)",
3758
+ "",
3759
+ "**Goal:** Reconcile every slice into a single verified deliverable.",
3760
+ "",
3761
+ "**Budget:** No new web searches. Read the scope, read every slice",
3762
+ "note, reconcile contradictions, write the deliverable and a short",
3763
+ "verification report.",
3764
+ "",
3765
+ "### Steps",
3766
+ "",
3767
+ "1. **Read the scope file** and every slice note listed in the issue",
3768
+ " body. If any slice file is missing, stop and re-open the",
3769
+ " corresponding slice issue with `status:needs-attention`.",
3770
+ "",
3771
+ "2. **Build a claim index.** For every assertion in any slice, note",
3772
+ " which slice(s) support it and which sources back it.",
3773
+ "",
3774
+ "3. **Reconcile contradictions.** When slices disagree:",
3775
+ " - Prefer the slice with stronger sources",
3776
+ " - Flag unresolved contradictions in the verification report",
3777
+ " - Do not silently pick a side",
3778
+ "",
3779
+ "4. **Write the deliverable** to",
3780
+ " `<DELIVERABLES_DIR>/<RESEARCH_SLUG>.md`. The structure is dictated",
3781
+ " by the acceptance criteria in the scope file. Every factual claim",
3782
+ " in the deliverable must cite at least one slice note.",
3783
+ "",
3784
+ "5. **Write a verification report** to",
3785
+ " `<DELIVERABLES_DIR>/<RESEARCH_SLUG>.verify.md`:",
3786
+ "",
3787
+ " ```markdown",
3788
+ " ---",
3789
+ ' title: "Verification Report: <question>"',
3790
+ " slug: <RESEARCH_SLUG>",
3791
+ " date: YYYY-MM-DD",
3792
+ " parent_issue: <N>",
3793
+ " slices_read: <count>",
3794
+ " ---",
3795
+ "",
3796
+ " # Verification Report: <question>",
3797
+ "",
3798
+ " ## Acceptance Criteria Coverage",
3799
+ " - [x] <criterion> \u2014 covered by slice(s) <NN, NN>",
3800
+ " - [ ] <criterion> \u2014 **not covered**; gap noted in deliverable",
3801
+ "",
3802
+ " ## Slice Coverage",
3803
+ " | Slice | Claims | Reused in deliverable | Notes |",
3804
+ " |-------|--------|-----------------------|-------|",
3805
+ " | 01 | <count> | <count> | |",
3806
+ "",
3807
+ " ## Reconciled Contradictions",
3808
+ " - <short summary of each reconciled contradiction and why>",
3809
+ "",
3810
+ " ## Unresolved Contradictions",
3811
+ " - <contradiction the verifier could not resolve>",
3812
+ "",
3813
+ " ## Gaps",
3814
+ " - <question the pipeline could not answer>",
3815
+ " ```",
3816
+ "",
3817
+ "6. **Comment on the scope issue** with a summary linking to the",
3818
+ " deliverable and verification report.",
3819
+ "",
3820
+ "7. **Commit and push.** Close the verify issue.",
3821
+ "",
3822
+ "---",
3823
+ "",
3824
+ "## Output Boundaries",
3825
+ "",
3826
+ "This agent writes **only** to:",
3827
+ "",
3828
+ "- `<SCOPE_DIR>/` \u2014 scope files (Phase 1)",
3829
+ "- `<SLICES_DIR>/` \u2014 slice notes (Phase 2)",
3830
+ "- `<DELIVERABLES_DIR>/` \u2014 deliverables and verification reports",
3831
+ " (Phase 3)",
3832
+ "",
3833
+ "The pipeline produces **notes and deliverables only**. It does not",
3834
+ "open downstream `type:requirement`, profile, or comparison issues \u2014",
3835
+ "those are the responsibility of specialized downstream agents (e.g.",
3836
+ "`requirements-analyst`, `meeting-analyst`) that consume the",
3837
+ "deliverables produced here. Keep this boundary clean so the research",
3838
+ "pipeline stays generic.",
3839
+ "",
3840
+ "---",
3841
+ "",
3842
+ "## Rules",
3843
+ "",
3844
+ "- **One phase per session.** Never run two phases back-to-back in a",
3845
+ " single session.",
3846
+ "- **Persist before closing.** Every phase must write its output file",
3847
+ " before closing its issue.",
3848
+ "- **Do not expand scope mid-slice.** Overflow goes into the slice's",
3849
+ " overflow section and is flagged for verify \u2014 not into another",
3850
+ " slice's territory.",
3851
+ "- **Cite everything.** Claims without a source citation do not belong",
3852
+ " in a slice note or deliverable.",
3853
+ "- **Produce notes, not downstream work.** Do not create",
3854
+ " `type:requirement`, profile, or comparison issues from this",
3855
+ " pipeline. Emit deliverables under `<DELIVERABLES_DIR>/` and let",
3856
+ " downstream agents decide what to do with them."
3857
+ ].join("\n")
3858
+ };
3859
+ var researchSkill = {
3860
+ name: "research",
3861
+ description: "Kick off a generic research micro-task pipeline. Creates a research:scope issue and dispatches Phase 1 (Scope) in the research-analyst agent.",
3862
+ disableModelInvocation: true,
3863
+ userInvocable: true,
3864
+ context: "fork",
3865
+ agent: "research-analyst",
3866
+ platforms: { cursor: { exclude: true } },
3867
+ instructions: [
3868
+ "# Research",
3869
+ "",
3870
+ "Kick off a generic research micro-task pipeline. Creates a",
3871
+ "`research:scope` issue carrying the research question and dispatches",
3872
+ "Phase 1 (Scope) in the research-analyst agent.",
3873
+ "",
3874
+ "## Usage",
3875
+ "",
3876
+ "/research <question>",
3877
+ "",
3878
+ "Optional extensions in the question body:",
3879
+ "- `sources: <list>` \u2014 authorized source categories or file paths",
3880
+ "- `slices: <N>` \u2014 override the default slice count (default 4, max 8)",
3881
+ "- `slug: <kebab-case>` \u2014 override the derived research slug",
3882
+ "- `acceptance: <list>` \u2014 explicit acceptance criteria for the",
3883
+ " deliverable",
3884
+ "",
3885
+ "## Default Paths",
3886
+ "",
3887
+ "If the project has no override in `docs/project-context.md` or",
3888
+ "`agentConfig.rules`, outputs land under:",
3889
+ "",
3890
+ "- `docs/research/scopes/<slug>.scope.md`",
3891
+ "- `docs/research/slices/<slug>-NN-<slice-slug>.slice.md`",
3892
+ "- `docs/research/deliverables/<slug>.md`",
3893
+ "- `docs/research/deliverables/<slug>.verify.md`",
3894
+ "",
3895
+ "## Steps",
3896
+ "",
3897
+ "1. Create a `research:scope` issue with `type:research`,",
3898
+ " `priority:medium`, and `status:ready`. Body must include the",
3899
+ " verbatim question, authorized sources, and any overrides.",
3900
+ "2. Execute Phase 1 (Scope) of the research-analyst agent.",
3901
+ "3. Phase 1 creates `research:slice` issues (one per slice) and a",
3902
+ " single `research:verify` issue. Each downstream issue declares",
3903
+ " its `Depends on:` predecessor.",
3904
+ "",
3905
+ "## Output",
3906
+ "",
3907
+ "- A scope file under the project's research scope directory",
3908
+ "- One slice note per slice under the slices directory",
3909
+ "- A single deliverable plus verification report under the deliverables",
3910
+ " directory",
3911
+ "- This pipeline produces **notes and deliverables only** \u2014 it does",
3912
+ " not open downstream `type:requirement` or profile issues."
3913
+ ].join("\n")
3914
+ };
3915
+ var researchPipelineBundle = {
3916
+ name: "research-pipeline",
3917
+ description: "Generic research micro-task pipeline: scope, N-way slice search/synthesize, and verify. Opt-in only; domain-neutral; filesystem-durable between phases.",
3918
+ appliesWhen: () => false,
3919
+ rules: [
3920
+ {
3921
+ name: "research-pipeline-workflow",
3922
+ description: "Describes the 3-phase generic research pipeline, the research:* label taxonomy, and the boundary against downstream specialized agents.",
3923
+ scope: AGENT_RULE_SCOPE.ALWAYS,
3924
+ content: [
3925
+ "# Research Pipeline Workflow",
3926
+ "",
3927
+ "Use `/research <question>` to kick off a generic research",
3928
+ "micro-task pipeline. The pipeline runs in 3 phases \u2014 scope, slice,",
3929
+ "verify \u2014 each tracked by its own GitHub issue labeled",
3930
+ "`research:scope`, `research:slice`, or `research:verify`. All",
3931
+ "issues carry `type:research`.",
3932
+ "",
3933
+ "The pipeline produces **notes and deliverables only**. It does",
3934
+ "not open downstream `type:requirement` or profile issues \u2014 those",
3935
+ "belong to specialized downstream agents that consume the",
3936
+ "deliverables.",
3937
+ "",
3938
+ "See the `research-analyst` agent definition for full workflow",
3939
+ "details, default paths, and phase-by-phase instructions."
3940
+ ].join("\n"),
3941
+ platforms: {
3942
+ cursor: { exclude: true }
3943
+ },
3944
+ tags: ["workflow"]
3945
+ }
3946
+ ],
3947
+ skills: [researchSkill],
3948
+ subAgents: [researchAnalystSubAgent],
3949
+ labels: [
3950
+ {
3951
+ name: "type:research",
3952
+ color: "5319E7",
3953
+ description: "Work that produces or consumes a research note, slice, or deliverable"
3954
+ },
3955
+ {
3956
+ name: "research:scope",
3957
+ color: "C5DEF5",
3958
+ description: "Phase 1: decompose a research question into N focused slice issues"
3959
+ },
3960
+ {
3961
+ name: "research:slice",
3962
+ color: "BFDADC",
3963
+ description: "Phase 2: execute one research slice \u2014 search authorized sources and write a slice note"
3964
+ },
3965
+ {
3966
+ name: "research:verify",
3967
+ color: "D4C5F9",
3968
+ description: "Phase 3: reconcile slice notes into a verified deliverable"
3969
+ }
3970
+ ]
3971
+ };
3972
+
3405
3973
  // src/agent/bundles/slack.ts
3406
3974
  var slackBundle = {
3407
3975
  name: "slack",
@@ -4052,7 +4620,8 @@ var BUILT_IN_BUNDLES = [
4052
4620
  meetingAnalysisBundle,
4053
4621
  orchestratorBundle,
4054
4622
  prReviewBundle,
4055
- requirementsAnalystBundle
4623
+ requirementsAnalystBundle,
4624
+ researchPipelineBundle
4056
4625
  ];
4057
4626
 
4058
4627
  // src/agent/bundles/scope.ts
@@ -7581,6 +8150,7 @@ var TypeScriptConfig = class extends import_projen22.Component {
7581
8150
  prReviewBundle,
7582
8151
  projenBundle,
7583
8152
  requirementsAnalystBundle,
8153
+ researchPipelineBundle,
7584
8154
  resolveModelAlias,
7585
8155
  resolveTemplateVariables,
7586
8156
  slackBundle,