@cluesmith/codev 3.0.0-rc.10 → 3.0.0-rc.12

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.
Files changed (32) hide show
  1. package/dashboard-dist/dist/assets/index-Coe88ldB.css +32 -0
  2. package/dashboard-dist/dist/assets/index-JRKA6Mfr.js +195 -0
  3. package/dashboard-dist/dist/assets/index-JRKA6Mfr.js.map +1 -0
  4. package/dashboard-dist/dist/index.html +2 -2
  5. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
  6. package/dist/agent-farm/servers/tower-instances.js +3 -2
  7. package/dist/agent-farm/servers/tower-instances.js.map +1 -1
  8. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  9. package/dist/agent-farm/servers/tower-routes.js +10 -0
  10. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  11. package/dist/commands/consult/index.d.ts +31 -1
  12. package/dist/commands/consult/index.d.ts.map +1 -1
  13. package/dist/commands/consult/index.js +53 -14
  14. package/dist/commands/consult/index.js.map +1 -1
  15. package/dist/lib/team-github.d.ts +47 -0
  16. package/dist/lib/team-github.d.ts.map +1 -1
  17. package/dist/lib/team-github.js +111 -2
  18. package/dist/lib/team-github.js.map +1 -1
  19. package/package.json +4 -3
  20. package/scripts/postinstall.mjs +51 -0
  21. package/skeleton/protocols/air/prompts/pr.md +15 -3
  22. package/skeleton/protocols/aspir/prompts/review.md +11 -0
  23. package/skeleton/protocols/bugfix/prompts/pr.md +15 -3
  24. package/skeleton/protocols/experiment/builder-prompt.md +15 -0
  25. package/skeleton/protocols/maintain/prompts/review.md +12 -0
  26. package/skeleton/protocols/research/builder-prompt.md +85 -0
  27. package/skeleton/protocols/research/protocol.json +118 -0
  28. package/skeleton/protocols/research/protocol.md +169 -0
  29. package/skeleton/protocols/spir/prompts/review.md +11 -0
  30. package/skeleton/templates/AGENTS.md +1 -0
  31. package/skeleton/templates/CLAUDE.md +1 -0
  32. package/skeleton/templates/cheatsheet.md +1 -0
@@ -181,11 +181,22 @@ Before PR:
181
181
  porch consultation reviews the actual PR, and the architect can review a real PR
182
182
  when the pr gate fires.
183
183
 
184
+ **PR body requirements**: The PR body MUST include `Closes #<N>` (for feature issues)
185
+ or `Fixes #<N>` (for bug issues) for the driving GitHub issue. If the PR closes
186
+ multiple issues (e.g. duplicates consolidated), include one keyword per issue.
187
+ Without this, GitHub will not auto-close the issue on merge.
188
+
189
+ **Exception**: if this PR only partially addresses the issue (e.g. one phase of a
190
+ multi-PR effort), DO NOT use `Closes`/`Fixes` — reference the issue with `Refs #<N>`
191
+ or `Part of #<N>` instead. The issue stays open until the follow-up PR closes it.
192
+
184
193
  ```bash
185
194
  gh pr create --title "[Spec {{project_id}}] {{title}}" --body "$(cat <<'EOF'
186
195
  ## Summary
187
196
  [Brief description of the implementation]
188
197
 
198
+ Closes #<N> <!-- Replace <N> with the driving issue number, or use "Refs #<N>" for partial fixes -->
199
+
189
200
  ## Changes
190
201
  - [Change 1]
191
202
  - [Change 2]
@@ -15,15 +15,27 @@ Create a pull request, run CMAP review, and address feedback.
15
15
 
16
16
  ### 1. Create the Pull Request
17
17
 
18
- Create a PR that links to the issue:
18
+ Create a PR that links to the issue.
19
+
20
+ **PR body requirements**: The PR body MUST include `Fixes #<N>` (where `<N>` is
21
+ the driving issue number) so GitHub auto-closes the issue on merge. If the PR
22
+ fixes multiple issues (e.g. duplicates consolidated), include one `Fixes #<N>`
23
+ per issue. Without this, GitHub will not auto-close the issue.
24
+
25
+ **Exception**: if this PR only partially addresses the issue, use `Refs #<N>`
26
+ or `Part of #<N>` instead of `Fixes` — the issue stays open until a
27
+ follow-up PR closes it.
28
+
29
+ **Note**: substitute the real issue number for `<N>` — do not leave the
30
+ placeholder or any `{{...}}` template tag in the committed PR body.
19
31
 
20
32
  ```bash
21
- gh pr create --title "Fix #{{issue.number}}: <brief description>" --body "$(cat <<'EOF'
33
+ gh pr create --title "Fix #<N>: <brief description>" --body "$(cat <<'EOF'
22
34
  ## Summary
23
35
 
24
36
  <1-2 sentence description of the bug and fix>
25
37
 
26
- Fixes #{{issue.number}}
38
+ Fixes #<N> <!-- Substitute <N> with the real issue number -->
27
39
 
28
40
  ## Root Cause
29
41
 
@@ -46,6 +46,21 @@ The EXPERIMENT protocol ensures disciplined experimentation:
46
46
  - Document findings regardless of outcome
47
47
  - Separate experiment artifacts from production code
48
48
 
49
+ ## If You Open a PR
50
+
51
+ Most experiments are committed to a branch without a PR, but if you do open one
52
+ to integrate findings and the experiment was triggered by a GitHub issue:
53
+
54
+ **PR body requirements**: The PR body MUST include `Closes #<N>` (for feature
55
+ issues) or `Fixes #<N>` (for bug issues) for the driving issue so GitHub
56
+ auto-closes it on merge. If the PR closes multiple issues, include one keyword
57
+ per issue.
58
+
59
+ **Exception**: if this PR only partially addresses the issue (e.g. experiment
60
+ validates an approach but production implementation is deferred), use
61
+ `Refs #<N>` or `Part of #<N>` instead — the issue stays open until a follow-up
62
+ PR closes it.
63
+
49
64
  ## Handling Flaky Tests
50
65
 
51
66
  If you encounter **pre-existing flaky tests** (intermittent failures unrelated to your changes):
@@ -33,6 +33,16 @@ Update `codev/maintain/NNNN.md` with:
33
33
 
34
34
  ### 4. Create PR
35
35
 
36
+ **PR body requirements**: If this maintenance run was triggered by a GitHub issue
37
+ (e.g. "track down dead X", "clean up Y module"), the PR body MUST include
38
+ `Closes #<N>` for that issue so GitHub auto-closes it on merge. If multiple
39
+ issues are addressed in one run, include one `Closes #<N>` per issue.
40
+
41
+ **Exception**: if this PR only partially addresses a tracking issue (e.g. more
42
+ cleanup passes are planned), use `Refs #<N>` or `Part of #<N>` instead.
43
+
44
+ If the run was not tied to any issue, the `Closes` line can be omitted.
45
+
36
46
  ```bash
37
47
  git push origin HEAD
38
48
 
@@ -41,6 +51,8 @@ gh pr create --title "[Maintain] Codebase maintenance run NNNN" --body "$(cat <<
41
51
 
42
52
  <2-3 bullet points of what was done>
43
53
 
54
+ Closes #<N> <!-- Only if this run was triggered by a GitHub issue. Use "Refs #<N>" for partial cleanup. -->
55
+
44
56
  ## Changes
45
57
 
46
58
  - Dead code removed: X items
@@ -0,0 +1,85 @@
1
+ # {{protocol_name}} Builder ({{mode}} mode)
2
+
3
+ You are conducting multi-agent research.
4
+
5
+ {{#if mode_soft}}
6
+ ## Mode: SOFT
7
+ You are running in SOFT mode. This means:
8
+ - You follow the RESEARCH protocol yourself (no porch orchestration)
9
+ - The architect monitors your work and verifies you're adhering to the protocol
10
+ - Use `consult` for the 3-way investigation and critique phases
11
+ {{/if}}
12
+
13
+ {{#if mode_strict}}
14
+ ## Mode: STRICT
15
+ You are running in STRICT mode. This means:
16
+ - Porch orchestrates your work
17
+ - Run: `porch next` to get your next tasks
18
+ - Follow porch signals and gate approvals
19
+
20
+ ### ABSOLUTE RESTRICTIONS (STRICT MODE)
21
+ - **NEVER edit `status.yaml` directly** — only porch commands may modify project state
22
+ - **NEVER call `porch approve` without explicit human approval** — only run it after the architect says to
23
+ - **NEVER skip the 3-way consultation** — always follow porch next → porch done cycle
24
+ {{/if}}
25
+
26
+ ## Protocol
27
+ Follow the RESEARCH protocol: `codev/protocols/research/protocol.md`
28
+
29
+ ## RESEARCH Overview
30
+
31
+ The RESEARCH protocol produces a high-confidence research report through triangulation:
32
+
33
+ 1. **Scope** — Define the precise question, scope, and acceptance criteria. Write a research brief. Gate: architect approval before proceeding.
34
+ 2. **Investigate** — Dispatch the brief to 3 models (Gemini, Codex, Claude) in parallel. Each investigates independently. No anchoring — they don't see each other's work.
35
+ 3. **Synthesize** — Read all 3 reports. Identify consensus, disagreements, and unique contributions. Write a single synthesis report organized by topic (not by model).
36
+ 4. **Critique** — Send the synthesis back to all 3 models for critique. Incorporate valid feedback. Document rejected critique. Finalize the report.
37
+
38
+ ## Output Location
39
+
40
+ All artifacts go to `codev/research/`:
41
+ - `<topic>-brief.md` — the scoped question (Phase 1)
42
+ - `<topic>-gemini.md`, `<topic>-codex.md`, `<topic>-claude.md` — individual investigations (Phase 2)
43
+ - `<topic>.md` — the final synthesis report (Phase 3+4, this is the deliverable)
44
+ - `<topic>-critique-rebuttals.md` — critique responses (Phase 4)
45
+
46
+ {{#if task}}
47
+ ## Research Topic
48
+ {{task_text}}
49
+ {{/if}}
50
+
51
+ ## Key Principles
52
+
53
+ - **Triangulate**: consensus across 3 models > any single model's claim
54
+ - **Cite sources**: tell investigators to provide sources where possible
55
+ - **Be candid about uncertainty**: "I don't know" > confabulation
56
+ - **Organize by topic, not by model**: the synthesis is a standalone document
57
+ - **Note surprises**: the most valuable findings are often unexpected
58
+ - **Keep it concise**: the synthesis should be shorter than the sum of the investigations
59
+
60
+ ## Using consult for 3-way Investigation
61
+
62
+ For the investigate phase, use the `consult` CLI to dispatch to each model:
63
+
64
+ ```bash
65
+ # Phase 2: parallel investigation
66
+ consult -m gemini --prompt-file codev/research/<topic>-brief.md --output codev/research/<topic>-gemini.md &
67
+ consult -m codex --prompt-file codev/research/<topic>-brief.md --output codev/research/<topic>-codex.md &
68
+ consult -m claude --prompt-file codev/research/<topic>-brief.md --output codev/research/<topic>-claude.md &
69
+ wait
70
+ ```
71
+
72
+ For the critique phase:
73
+ ```bash
74
+ # Phase 4: parallel critique
75
+ consult -m gemini --prompt "Critique this research synthesis for gaps, errors, and bias:" --prompt-file codev/research/<topic>.md --output codev/research/<topic>-critique-gemini.md &
76
+ consult -m codex --prompt "Critique this research synthesis for gaps, errors, and bias:" --prompt-file codev/research/<topic>.md --output codev/research/<topic>-critique-codex.md &
77
+ consult -m claude --prompt "Critique this research synthesis for gaps, errors, and bias:" --prompt-file codev/research/<topic>.md --output codev/research/<topic>-critique-claude.md &
78
+ wait
79
+ ```
80
+
81
+ ## Getting Started
82
+ 1. Read the RESEARCH protocol document
83
+ 2. Understand the research question from the architect
84
+ 3. Write the research brief (Phase 1)
85
+ 4. Wait for scope-approval before proceeding to investigation
@@ -0,0 +1,118 @@
1
+ {
2
+ "$schema": "../../protocol-schema.json",
3
+ "name": "research",
4
+ "version": "1.0.0",
5
+ "description": "Multi-agent research with 3-way investigation, synthesis, and critique",
6
+ "input": {
7
+ "type": "none",
8
+ "required": false,
9
+ "default_for": []
10
+ },
11
+ "hooks": {
12
+ "pre-spawn": {}
13
+ },
14
+ "phases": [
15
+ {
16
+ "id": "scope",
17
+ "name": "Scope",
18
+ "description": "Define the research question, scope, and acceptance criteria",
19
+ "type": "once",
20
+ "steps": [
21
+ "clarify_question",
22
+ "define_scope",
23
+ "define_acceptance_criteria",
24
+ "create_research_brief"
25
+ ],
26
+ "gate": {
27
+ "name": "scope-approval",
28
+ "description": "Architect confirms the research question is correctly scoped",
29
+ "requires": ["research_brief_exists"],
30
+ "next": "investigate"
31
+ }
32
+ },
33
+ {
34
+ "id": "investigate",
35
+ "name": "Investigate",
36
+ "description": "3-way parallel investigation — each model researches independently",
37
+ "type": "once",
38
+ "steps": [
39
+ "dispatch_gemini_investigation",
40
+ "dispatch_codex_investigation",
41
+ "dispatch_claude_investigation",
42
+ "collect_all_reports"
43
+ ],
44
+ "consultation": {
45
+ "enabled": true,
46
+ "models": ["codex"],
47
+ "parallel": true,
48
+ "type": "investigation"
49
+ },
50
+ "transition": {
51
+ "on_complete": "synthesize"
52
+ }
53
+ },
54
+ {
55
+ "id": "synthesize",
56
+ "name": "Synthesize",
57
+ "description": "Merge the 3 investigation reports into a single coherent research document",
58
+ "type": "once",
59
+ "steps": [
60
+ "read_all_investigation_reports",
61
+ "identify_consensus_and_disagreements",
62
+ "resolve_conflicts",
63
+ "write_synthesis_report"
64
+ ],
65
+ "transition": {
66
+ "on_complete": "critique"
67
+ }
68
+ },
69
+ {
70
+ "id": "critique",
71
+ "name": "Critique",
72
+ "description": "3-way review of the synthesis — each model critiques for gaps, errors, and bias",
73
+ "type": "once",
74
+ "steps": [
75
+ "dispatch_gemini_critique",
76
+ "dispatch_codex_critique",
77
+ "dispatch_claude_critique",
78
+ "incorporate_feedback",
79
+ "finalize_report"
80
+ ],
81
+ "consultation": {
82
+ "enabled": true,
83
+ "models": ["codex"],
84
+ "parallel": true,
85
+ "type": "critique"
86
+ },
87
+ "gate": {
88
+ "name": "research-complete",
89
+ "description": "Research report finalized",
90
+ "requires": ["report_finalized"],
91
+ "next": null
92
+ }
93
+ }
94
+ ],
95
+ "signals": {
96
+ "PHASE_COMPLETE": {
97
+ "description": "Signal current phase is complete",
98
+ "transitions_to": "next_phase"
99
+ },
100
+ "BLOCKED": {
101
+ "description": "Signal research is blocked",
102
+ "requires": "reason"
103
+ },
104
+ "SCOPE_REJECTED": {
105
+ "description": "Architect rejects the scope — rework needed",
106
+ "transitions_to": "scope"
107
+ }
108
+ },
109
+ "defaults": {
110
+ "mode": "strict",
111
+ "consultation": {
112
+ "enabled": true,
113
+ "models": ["codex"],
114
+ "parallel": true
115
+ },
116
+ "checks": {}
117
+ }
118
+ }
@@ -0,0 +1,169 @@
1
+ # RESEARCH Protocol
2
+
3
+ ## Overview
4
+
5
+ Multi-agent research with 3-way investigation, synthesis, and critique. Three AI models independently investigate a question, their findings are synthesized into a single report, and then all three models critique the synthesis for gaps, errors, and bias.
6
+
7
+ **Core Principle**: Triangulate. No single model's knowledge is authoritative. Consensus across models is more reliable than any individual output.
8
+
9
+ ## When to Use
10
+
11
+ **Use for**: Competitive analysis, technology evaluation, market research, architectural decision support, "what's the state of X?" questions, exploring unfamiliar domains.
12
+
13
+ **Skip for**: Implementation work (use SPIR/ASPIR), quick questions (just ask), experiments (use EXPERIMENT), known-answer lookups (just search).
14
+
15
+ ## Output
16
+
17
+ All research artifacts go to `codev/research/`. The final deliverable is a single synthesis report at `codev/research/<topic>.md`.
18
+
19
+ ## Phases
20
+
21
+ ### Phase 1: Scope
22
+
23
+ **Purpose**: Make sure we're asking the right question before spending 3 models' worth of compute on answering it.
24
+
25
+ The builder:
26
+ 1. Reads the architect's research request
27
+ 2. Clarifies the question — what specifically are we trying to learn?
28
+ 3. Defines the scope — what's in, what's out, what depth is needed
29
+ 4. Defines acceptance criteria — what does a good answer look like?
30
+ 5. Writes a **research brief** (`codev/research/<topic>-brief.md`) with:
31
+ - The precise question(s)
32
+ - Scope boundaries
33
+ - **Required targets** (when applicable — not all research questions have them). When the user names specific projects, products, or systems, those are exemplars of a CLASS, not an exhaustive list. The brief should:
34
+ - List the named targets as required coverage (each gets a dedicated section)
35
+ - Identify the CLASS they represent (e.g., "open-source always-on agent frameworks")
36
+ - Instruct investigators to find OTHER members of that class the user didn't name — discovering what the user SHOULD be thinking about is often the most valuable part of the research
37
+ - If an investigator cannot find information about a required target, they must say so explicitly — not silently skip it
38
+ - **Optional context** — additional sources that may be useful but are not required
39
+ - What a useful answer looks like
40
+ - Suggested sources or angles for the investigators
41
+ 6. Sends the brief to the architect for approval
42
+
43
+ **Gate**: `scope-approval` — the architect confirms the question is correctly scoped before the 3-way investigation begins. This prevents wasting compute on a badly-framed question.
44
+
45
+ ### Phase 2: Investigate (3-way parallel)
46
+
47
+ **Purpose**: Get three independent perspectives on the question.
48
+
49
+ The builder dispatches the research brief to three models (Gemini, Codex, Claude) via `consult`. Each model:
50
+ 1. Receives the scoped research brief
51
+ 2. Independently investigates using web search, its training knowledge, and reasoning
52
+ 3. Produces a standalone investigation report with:
53
+ - **A dedicated section for each required target** from the brief. Every required target gets its own heading with specific findings — not mentioned in passing, not substituted with an easier target. If a required target yields no findings, the section must say "No information found" rather than being omitted.
54
+ - Findings (with sources where possible)
55
+ - Confidence levels on key claims
56
+ - Gaps it couldn't fill
57
+ - Surprises or things that contradicted expectations
58
+
59
+ The investigations run in **parallel** — each model works independently without seeing the others' output. This prevents anchoring bias.
60
+
61
+ Investigation reports are saved to:
62
+ - `codev/research/<topic>-gemini.md`
63
+ - `codev/research/<topic>-codex.md`
64
+ - `codev/research/<topic>-claude.md`
65
+
66
+ ### Phase 3: Synthesize
67
+
68
+ **Purpose**: Merge three independent reports into one coherent document.
69
+
70
+ The builder:
71
+ 1. Reads all three investigation reports
72
+ 2. Identifies **consensus** — what all three agree on (highest confidence)
73
+ 3. Identifies **disagreements** — where models contradict each other
74
+ 4. Resolves conflicts — picks the best-supported position, notes the disagreement
75
+ 5. Identifies **unique contributions** — things only one model found that the others missed
76
+ 6. Writes the **synthesis report** (`codev/research/<topic>.md`) with:
77
+ - **Scope summary** — a short section (before the executive summary) restating the research question, required targets, and scope boundaries from the brief. A reader should understand what was asked without needing to read the brief separately.
78
+ - Executive summary
79
+ - Findings (organized by topic, not by model)
80
+ - Confidence annotations (consensus vs. single-source)
81
+ - Gaps and limitations
82
+ - Recommendations (if the research brief asked for them)
83
+
84
+ The synthesis is written as a **standalone document** — a reader should never need to reference the individual investigation reports. Those are kept as appendices for traceability.
85
+
86
+ ### Phase 4: Critique (3-way review)
87
+
88
+ **Purpose**: Pressure-test the synthesis for gaps, errors, and bias.
89
+
90
+ The builder dispatches the synthesis report back to all three models for critique. Each model:
91
+ 1. Reads the synthesis
92
+ 2. **Checks coverage against the brief** — does every required target from the research brief have dedicated coverage in the synthesis? Lists any required targets that were named in the brief but have zero or minimal coverage. This is the #1 critique check.
93
+ 3. Checks for factual errors or unsupported claims
94
+ 4. Identifies gaps — important aspects the synthesis missed
95
+ 5. Flags potential bias — did the synthesis over-weight one model's perspective?
96
+ 6. Suggests specific improvements
97
+
98
+ The builder then:
99
+ 1. Incorporates valid critique
100
+ 2. Documents rejected critique with rationale
101
+ 3. Finalizes the report
102
+ 4. Commits to `codev/research/<topic>.md`
103
+
104
+ ## File Structure
105
+
106
+ Only the brief and final report are checked in. Individual investigation reports and full critique outputs are working artifacts — useful during the process but not committed to the repo.
107
+
108
+ ```
109
+ codev/research/
110
+ ├── <topic>-brief.md # Phase 1: scoped research question (checked in)
111
+ └── <topic>.md # Phase 3+4: final synthesis (the deliverable, checked in)
112
+ ```
113
+
114
+ The final report includes:
115
+ - A **"Disagreements and resolution"** section documenting where the three investigators disagreed and how the synthesis resolved each disagreement
116
+ - A **"Changes from critique"** section summarizing what the critique phase changed (not the full critique — just what was added, removed, or corrected and why)
117
+
118
+ Individual investigation reports (`<topic>-gemini.md`, `<topic>-codex.md`, `<topic>-claude.md`) and raw critique outputs are kept locally during the research process but NOT committed. The final report is the deliverable; the process artifacts are disposable.
119
+
120
+ ## Best Practices
121
+
122
+ ### Scoping
123
+ - A good research question is specific enough to answer in 1500-3000 words per model
124
+ - "What's the state of X?" is too broad — "What are the top 5 players in X, their strengths/weaknesses, and the structural gaps?" is better
125
+ - Include the "so what" — why are we researching this? What decision does it inform?
126
+
127
+ ### Investigation
128
+ - Tell each model to cite sources where possible
129
+ - Tell each model to be candid about uncertainty — "I don't know" is better than confabulation
130
+ - Tell each model to note surprises — the most valuable findings are often the unexpected ones
131
+
132
+ ### Synthesis
133
+ - Organize by topic, not by model ("here's what we found about X" not "here's what Gemini said")
134
+ - Weight consensus over single-model claims
135
+ - Don't smooth over disagreements — note them explicitly
136
+ - Keep the synthesis shorter than the sum of the investigations
137
+
138
+ ### Critique
139
+ - Critiquers should focus on gaps and errors, not style
140
+ - A critique that says "add more about X" is useful; "rewrite the intro" is not
141
+ - The builder should reject critique that's outside the original scope
142
+
143
+ ## Integration with Other Protocols
144
+
145
+ ### Research → SPIR
146
+ When research informs a feature decision:
147
+ 1. Reference the research report in the spec
148
+ 2. Link specific findings as evidence for design choices
149
+
150
+ ### Research → EXPERIMENT
151
+ When research identifies something worth testing:
152
+ 1. Create an experiment to validate the research finding
153
+ 2. Reference the research report as motivation
154
+
155
+ ## Git Workflow
156
+
157
+ ### Commits
158
+ ```
159
+ [Research: topic] Scoped research brief
160
+ [Research: topic] 3-way investigation complete
161
+ [Research: topic] Synthesis report
162
+ [Research: topic] Final report (post-critique)
163
+ ```
164
+
165
+ ### What to Commit
166
+ - All investigation reports (for traceability)
167
+ - The final synthesis (the deliverable)
168
+ - The critique rebuttals (for process transparency)
169
+ - Do NOT commit raw web search results or intermediate notes
@@ -181,11 +181,22 @@ Before PR:
181
181
  porch consultation reviews the actual PR, and the architect can review a real PR
182
182
  when the pr gate fires.
183
183
 
184
+ **PR body requirements**: The PR body MUST include `Closes #<N>` (for feature issues)
185
+ or `Fixes #<N>` (for bug issues) for the driving GitHub issue. If the PR closes
186
+ multiple issues (e.g. duplicates consolidated), include one keyword per issue.
187
+ Without this, GitHub will not auto-close the issue on merge.
188
+
189
+ **Exception**: if this PR only partially addresses the issue (e.g. one phase of a
190
+ multi-PR effort), DO NOT use `Closes`/`Fixes` — reference the issue with `Refs #<N>`
191
+ or `Part of #<N>` instead. The issue stays open until the follow-up PR closes it.
192
+
184
193
  ```bash
185
194
  gh pr create --title "[Spec {{project_id}}] {{title}}" --body "$(cat <<'EOF'
186
195
  ## Summary
187
196
  [Brief description of the implementation]
188
197
 
198
+ Closes #<N> <!-- Replace <N> with the driving issue number, or use "Refs #<N>" for partial fixes -->
199
+
189
200
  ## Changes
190
201
  - [Change 1]
191
202
  - [Change 2]
@@ -14,6 +14,7 @@ This project uses **Codev** for AI-assisted development.
14
14
  - **BUGFIX**: Bug fixes from GitHub issues (`codev/protocols/bugfix/protocol.md`)
15
15
  - **EXPERIMENT**: Disciplined experimentation (`codev/protocols/experiment/protocol.md`)
16
16
  - **MAINTAIN**: Codebase maintenance (`codev/protocols/maintain/protocol.md`)
17
+ - **RESEARCH**: Multi-agent research with 3-way investigation, synthesis, and critique (`codev/protocols/research/protocol.md`)
17
18
 
18
19
  ## Key Locations
19
20
 
@@ -12,6 +12,7 @@ This project uses **Codev** for AI-assisted development.
12
12
  - **BUGFIX**: Bug fixes from GitHub issues (`codev/protocols/bugfix/protocol.md`)
13
13
  - **EXPERIMENT**: Disciplined experimentation (`codev/protocols/experiment/protocol.md`)
14
14
  - **MAINTAIN**: Codebase maintenance (`codev/protocols/maintain/protocol.md`)
15
+ - **RESEARCH**: Multi-agent research with 3-way investigation, synthesis, and critique (`codev/protocols/research/protocol.md`)
15
16
 
16
17
  ## Key Locations
17
18
 
@@ -63,6 +63,7 @@ A **protocol** is a structured workflow that defines how work progresses from id
63
63
  | **SPIR** | New features | Specify → Plan → Implement → Review |
64
64
  | **MAINTAIN** | Codebase hygiene | Dead code removal, documentation sync |
65
65
  | **EXPERIMENT** | Research & prototyping | Hypothesis → Experiment → Conclude |
66
+ | **RESEARCH** | Multi-agent research | Scope → Investigate (3-way) → Synthesize → Critique (3-way) |
66
67
 
67
68
  ### Roles
68
69