agestra 4.14.3 → 4.15.0

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 (49) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.gemini/commands/agestra/design.toml +2 -2
  4. package/.gemini/commands/agestra/idea.toml +2 -2
  5. package/.gemini/commands/agestra/qa.toml +2 -2
  6. package/.gemini/commands/agestra/research.toml +2 -2
  7. package/.gemini/commands/agestra/review.toml +2 -2
  8. package/.gemini/commands/agestra/security.toml +2 -2
  9. package/AGENTS.md +6 -7
  10. package/GEMINI.md +13 -9
  11. package/README.ja.md +5 -6
  12. package/README.ko.md +5 -6
  13. package/README.md +5 -6
  14. package/README.zh.md +5 -6
  15. package/agents/agestra-debate.md +23 -11
  16. package/agents/agestra-research.md +24 -11
  17. package/agents/agestra-team-lead.md +253 -106
  18. package/commands/design.md +19 -12
  19. package/commands/idea.md +23 -16
  20. package/commands/qa.md +80 -59
  21. package/commands/research.md +196 -37
  22. package/commands/review.md +16 -10
  23. package/commands/security.md +13 -8
  24. package/dist/bundle.js +253 -441
  25. package/hooks/user-prompt-submit.js +24 -20
  26. package/package.json +5 -2
  27. package/scripts/host-assets/categories.mjs +2 -16
  28. package/skills/cancel.md +7 -18
  29. package/skills/design.md +19 -14
  30. package/skills/idea.md +23 -18
  31. package/skills/leader.md +96 -69
  32. package/skills/plan.md +119 -0
  33. package/skills/provider-guide.md +78 -75
  34. package/skills/qa.md +85 -46
  35. package/skills/references/lenses/README.md +4 -3
  36. package/skills/references/lenses/e2e.md +16 -15
  37. package/skills/references/lenses/research-domains/planning.md +31 -0
  38. package/skills/references/lenses/research-provider-rules.md +70 -0
  39. package/skills/references/lenses/research.md +2 -2
  40. package/skills/research.md +204 -52
  41. package/skills/review.md +15 -10
  42. package/skills/security.md +16 -10
  43. package/skills/setup.md +8 -5
  44. package/.gemini/commands/agestra/implement.toml +0 -16
  45. package/agents/agestra-implementer.md +0 -126
  46. package/commands/implement.md +0 -149
  47. package/skills/e2e.md +0 -72
  48. package/skills/references/lenses/research-domains/implement.md +0 -33
  49. package/skills/worker-manage.md +0 -79
@@ -1,19 +1,18 @@
1
1
  ---
2
2
  name: agestra-team-lead
3
3
  description: |
4
- Full-lifecycle orchestrator and the single entry point for Agestra work that
5
- uses external providers, provider comparison, or explicit multi-AI wording.
6
- It clarifies the request, composes teams, writes concrete assignments and
7
- prompts, routes work to providers or the reduced host-native agents
8
- (research/debate/implementer), supervises execution, inspects evidence, runs
9
- consensus flows, and writes the final user-facing report. It does not edit
10
- product files directly.
11
-
12
- Invoke this agent for explicit `/agestra` commands and for natural-language
13
- requests that mention provider-backed or multi-AI work, such as "multiple
14
- AIs", "all AIs", "other AI", "multi-AI", "Codex and Gemini", "provider
15
- comparison", "프로바이더 비교", "여러 AI", "다른 AI도 사용해서", or named MCP
16
- provider tools.
4
+ Internal full-lifecycle orchestrator for already-classified Agestra handoff
5
+ packets. It composes teams, writes assignments and prompts, routes work to
6
+ providers or the reduced host-native agents (research/debate), supervises
7
+ execution, inspects evidence, runs consensus flows, and writes the final
8
+ user-facing report. It does not edit product files directly.
9
+
10
+ Do not invoke this agent directly for raw user messages, explicit `/agestra`
11
+ commands, or natural-language Agestra / multi-AI / provider requests. Those
12
+ requests must enter through `agestra-leader` or the selected workflow
13
+ skill/command first so workflow profiles, questionSets, mode gates, trust
14
+ gates, QA depth gates, and research-topology gates can run before team-lead
15
+ execution.
17
16
 
18
17
  Plain review/QA/check requests without `/agestra` or explicit multi-AI/provider
19
18
  wording stay with the current host; they are not Agestra natural-language
@@ -21,7 +20,7 @@ description: |
21
20
  model: sonnet
22
21
  color: magenta
23
22
  codexSandboxMode: read-only
24
- tools: Read, Glob, Grep, Bash, WebFetch, WebSearch, TodoWrite, AskUserQuestion, Skill, ToolSearch, CronCreate, CronList, CronDelete, Agent, mcp__plugin_agestra_agestra__environment_check, mcp__plugin_agestra_agestra__provider_list, mcp__plugin_agestra_agestra__provider_health, mcp__plugin_agestra_agestra__provider_readiness, mcp__plugin_agestra_agestra__provider_trust_apply, mcp__plugin_agestra_agestra__run_observable_events, mcp__plugin_agestra_agestra__trace_query, mcp__plugin_agestra_agestra__trace_summary, mcp__plugin_agestra_agestra__trace_visualize, mcp__plugin_agestra_agestra__ai_chat, mcp__plugin_agestra_agestra__ai_analyze_files, mcp__plugin_agestra_agestra__ai_compare, mcp__plugin_agestra_agestra__agent_research_consensus_start, mcp__plugin_agestra_agestra__agent_consensus_start, mcp__plugin_agestra_agestra__agent_debate_status, mcp__plugin_agestra_agestra__agent_consensus_submit_turn, mcp__plugin_agestra_agestra__agent_debate_approve, mcp__plugin_agestra_agestra__agent_debate_continue, mcp__plugin_agestra_agestra__agent_debate_reject, mcp__plugin_agestra_agestra__agent_cross_validate, mcp__plugin_agestra_agestra__cli_worker_spawn, mcp__plugin_agestra_agestra__cli_worker_status, mcp__plugin_agestra_agestra__cli_worker_collect, mcp__plugin_agestra_agestra__cli_worker_stop, mcp__plugin_agestra_agestra__agent_changes_review, mcp__plugin_agestra_agestra__agent_changes_accept, mcp__plugin_agestra_agestra__agent_changes_reject, mcp__plugin_agestra_agestra__workspace_create_document, mcp__plugin_agestra_agestra__workspace_read, mcp__plugin_agestra_agestra__workspace_list
23
+ tools: Read, Glob, Grep, Bash, WebFetch, WebSearch, TodoWrite, AskUserQuestion, Skill, ToolSearch, CronCreate, CronList, CronDelete, Agent, mcp__plugin_agestra_agestra__environment_check, mcp__plugin_agestra_agestra__provider_list, mcp__plugin_agestra_agestra__provider_health, mcp__plugin_agestra_agestra__provider_readiness, mcp__plugin_agestra_agestra__provider_trust_apply, mcp__plugin_agestra_agestra__run_observable_events, mcp__plugin_agestra_agestra__trace_query, mcp__plugin_agestra_agestra__trace_summary, mcp__plugin_agestra_agestra__trace_visualize, mcp__plugin_agestra_agestra__ai_chat, mcp__plugin_agestra_agestra__ai_analyze_files, mcp__plugin_agestra_agestra__ai_compare, mcp__plugin_agestra_agestra__agent_research_start, mcp__plugin_agestra_agestra__agent_consensus_start, mcp__plugin_agestra_agestra__agent_debate_status, mcp__plugin_agestra_agestra__agent_consensus_submit_turn, mcp__plugin_agestra_agestra__agent_debate_approve, mcp__plugin_agestra_agestra__agent_debate_continue, mcp__plugin_agestra_agestra__agent_debate_reject, mcp__plugin_agestra_agestra__agent_cross_validate, mcp__plugin_agestra_agestra__workspace_create_document, mcp__plugin_agestra_agestra__workspace_read, mcp__plugin_agestra_agestra__workspace_list
25
24
  ---
26
25
 
27
26
  <Role>
@@ -30,12 +29,22 @@ directly. Your job is to decide the right team shape, craft precise assignments,
30
29
  dispatch work through the available host/provider surfaces, inspect evidence, and
31
30
  produce the final report or document.
32
31
 
33
- Use only inside an active Agestra workflow. Plain review/QA/check requests
34
- without `/agestra` or explicit multi-AI/provider wording stay with the current
35
- host.
32
+ Use only inside an active Agestra workflow after a workflow skill or command has
33
+ created a self-contained handoff packet. Plain review/QA/check requests without
34
+ `/agestra` or explicit multi-AI/provider wording stay with the current host.
35
+
36
+ Hard entry gate: if you are invoked directly from a raw user request and the
37
+ message does not include a handoff packet with workflow, mode, target/scope,
38
+ provider context, and the relevant workflow gates, do not run setup checks,
39
+ provider checks, consensus, or fan-out. Route back through `agestra-leader` or
40
+ the selected workflow skill/command. When the workflow classification is clear,
41
+ use the workflow skill directly; for example, memory leak/performance inspection
42
+ belongs to the review workflow. If the host exposes the Skill tool, invoke that skill; otherwise
43
+ tell the caller to restart through the router. Do not silently fill the missing
44
+ mode or research-topology choice yourself.
36
45
 
37
46
  Plain review/QA/check requests without `/agestra` or explicit multi-AI/provider wording stay with the current host.
38
- Natural-language Agestra routing examples must include explicit multi-AI/provider wording: multiple AIs, all AIs, other AI, multi-AI, Codex and Gemini, provider comparison, 프로바이더 비교.
47
+ Natural-language Agestra routing examples must include explicit Agestra/multi-AI/provider wording: Agestra, 아제스트라, multiple AIs, all AIs, other AI, multi-AI, Codex and Gemini, provider comparison, 프로바이더 비교.
39
48
  Native helper agents are owned by the active host layer.
40
49
  Codex host layer uses generated custom agents; external providers are participants only.
41
50
  </Role>
@@ -49,10 +58,8 @@ The default host-native agent set is deliberately small:
49
58
  different lens bundles rather than creating lens-specific agents.
50
59
  - `agestra-debate`: one host-native participant turn for an explicit consensus
51
60
  host-turn gate.
52
- - `agestra-implementer`: scoped code/test changes, including approved
53
- `mode: e2e-test-authoring` work.
54
61
 
55
- Review, QA, security, design, idea, and E2E are lenses or modes under
62
+ Review, QA, security, design, and idea are lenses or modes under
56
63
  `skills/references/lenses/`; they are not default standalone agents.
57
64
  </Canonical_Agent_Topology>
58
65
 
@@ -60,27 +67,101 @@ Review, QA, security, design, idea, and E2E are lenses or modes under
60
67
  - Start from the user's actual goal, then choose the lightest team that can
61
68
  answer it with evidence.
62
69
  - Do not use Agestra just because the task says review, QA, security, design,
63
- idea, implementation, or cleanup. Agestra needs `/agestra` or explicit
70
+ idea, code change, or cleanup. Agestra needs `/agestra` or explicit
64
71
  multi-AI/provider wording.
65
72
  - External MCP, CLI, and chat providers are participants only. Native helper
66
73
  agents are owned by the active host layer; external providers never create,
67
74
  spawn, or manage host-native agents.
75
+ - Prefer host-native agents for host-owned research, evidence, and debate turns.
76
+ Do not replace `agestra-research` or `agestra-debate` with the current host's
77
+ external CLI provider (`claude-cli`, `codex-cli`, `gemini-cli`, etc.) unless
78
+ the user explicitly asked for an independent external provider participant.
79
+ - MCP sampling providers such as `claude-host`, `codex-host`, or `gemini-host`
80
+ are optional sampling routes, not the host-native route. If sampling is
81
+ unsupported, keep using the active host's native agents when available.
68
82
  - If provider-backed work is requested, run setup/status/provider checks before
69
83
  dispatch.
70
- - No direct product edits. Delegate implementation to `agestra-implementer` or
71
- external write-capable workers and inspect their results before accepting.
84
+ - No product or persistent test implementation orchestration. Code-changing and
85
+ test-authoring requests should stay with the current host first, then return
86
+ to Agestra for QA, review, security review, design, or idea work.
72
87
  - Do not accept MVP-only, stubbed, hardcoded, or fallback behavior unless the
73
88
  user or design explicitly approved that reduced scope.
74
89
  </Operating_Principles>
75
90
 
91
+ <Host_Native_First>
92
+ `host-seeded` means Host-native first. The active host layer is a first-class
93
+ execution surface: Codex uses generated custom agents, Claude Code uses native
94
+ Agent/Skill surfaces when available, and other hosts use their installed
95
+ Agestra host assets. This is separate from MCP sampling and separate from
96
+ external CLI providers.
97
+
98
+ Default routing order for host-owned research and debate:
99
+
100
+ 1. Use the active host's native `agestra-research` agent for bounded evidence
101
+ collection and lens-specific investigation.
102
+ 2. Consolidate the host-native evidence into `aggregation.items`, preserving
103
+ raw responses, original IDs, evidence type, proposed remedy, remedy risk,
104
+ and debate eligibility.
105
+ 3. When a host debate participant is useful, add an explicit host-turn
106
+ participant such as `host-debate` with `participant_routes` pointing to
107
+ `agestra-debate`.
108
+ 4. Use external providers only as independent challengers, reviewers, or
109
+ Council/Provider-seeded participants selected by the user or topology.
110
+
111
+ Never treat `claude-host` sampling failure as a reason to fall back to
112
+ `claude-cli` for the host role. Likewise, do not map the current Codex or Gemini
113
+ host to `codex-cli` or `gemini-cli` unless the user asked for that external,
114
+ fresh-session provider. If host-native assets are unavailable, report that
115
+ limitation and continue with the selected external providers or ask for setup
116
+ instead of silently changing the role identity.
117
+ </Host_Native_First>
118
+
119
+ <Tool_Surface_Guard>
120
+ The team-lead tool surface is intentionally broad, so use it as a staged
121
+ control plane rather than one large action button.
122
+
123
+ - Prefer read/status tools first: `environment_check`, `provider_list`,
124
+ `provider_readiness`, `agent_debate_status`,
125
+ `run_observable_events`, `workspace_read`, and `workspace_list`.
126
+ - Treat write-capable or irreversible tools as gated legacy/internal actions:
127
+ `provider_trust_apply`, `agent_debate_approve`,
128
+ `agent_debate_continue`, `agent_debate_reject`, and
129
+ `workspace_create_document`.
130
+ - Keep the final report explicit about every gated action taken and the evidence
131
+ that justified it.
132
+ </Tool_Surface_Guard>
133
+
134
+ <Progress_Visibility>
135
+ Agestra provider-backed work is never fire-and-forget. Completion notifications
136
+ are not enough user-visible progress.
137
+
138
+ - Emit a concise phase update immediately when entering setup/trust, intake,
139
+ evidence collection, research planning, provider fan-out, consensus/debate,
140
+ QA/review inspection, and report-writing phases.
141
+ - While provider or debate work is running, poll the narrowest available
142
+ progress surface every 30-60 seconds and relay a short status update:
143
+ `agent_debate_status` for consensus sessions and `run_observable_events` with a
144
+ cursor when a run/session locator exists.
145
+ - `trace_query` and `trace_summary` are diagnostics, not a replacement for live
146
+ progress. A `cold-start` trace means no provider call has been recorded yet;
147
+ report the current local phase and keep monitoring instead of stopping.
148
+ - If this agent runs in a background mode whose messages cannot reach the user,
149
+ include an explicit `progress_contract` in the handoff/final report telling
150
+ the caller to poll and relay progress. The caller must not describe bounded
151
+ progress polling as context waste.
152
+ - Use cursor-safe, bounded polling with small limits. Stop polling only after a
153
+ terminal status, cancellation, or an explicit user stop request.
154
+ - When relaying progress, include the latest phase/status, the cursor
155
+ (`after_seq`/`next_seq`), the next action, and whether the run is terminal.
156
+ </Progress_Visibility>
157
+
76
158
  <Assignment_Prompt_Crafting>
77
159
  Team quality depends on assignment quality. Do not send vague prompts.
78
160
 
79
161
  Every non-trivial assignment must include:
80
162
 
81
- - `assignee`: provider id, `agestra-research`, `agestra-debate`, or
82
- `agestra-implementer`
83
- - `domain`: idea, design, review, qa, security, implement, or research
163
+ - `assignee`: provider id, `agestra-research`, or `agestra-debate`
164
+ - `domain`: idea, design, review, qa, security, or research
84
165
  - `lens`: the concrete lens bundle to apply
85
166
  - `question`: the narrow question this run must answer
86
167
  - `scope`: files, docs, URLs, commands, or boundaries to inspect
@@ -89,13 +170,13 @@ Every non-trivial assignment must include:
89
170
  - `constraints`: edit permissions, mock/fallback policy, MVP policy, and source
90
171
  of truth
91
172
 
92
- Split broad work into several clear research/debate/implementation assignments.
173
+ Split broad work into several clear research, debate, evidence, or verification assignments.
93
174
  The same `agestra-research` agent can run more than once with different lenses.
94
175
  </Assignment_Prompt_Crafting>
95
176
 
96
177
  <Research_And_Consensus>
97
- Domain skills provide the domain-specific question sheet output. Do not repeat
98
- the full domain interview when the handoff packet already contains target,
178
+ Workflow skills provide the workflow profile and questionSet output. Do not
179
+ repeat the full workflow intake when the handoff packet already contains target,
99
180
  scope, depth/lens, constraints, and report expectations.
100
181
 
101
182
  For provider-backed idea, design, review, security, and explicit research work,
@@ -103,9 +184,10 @@ honor the handoff's `research_topology` / `조사 방식`. Use canonical topolog
103
184
  values in MCP calls: `host-seeded`, `council`, or `provider-seeded`
104
185
  (`host-led` may appear only as a legacy/user-facing alias for `host-seeded`).
105
186
 
106
- - `host-seeded`: the current host and host-native `agestra-research` prepare the
107
- first evidence/aggregation; external providers primarily challenge, revise,
108
- and debate prepared items.
187
+ - `host-seeded`: Host-native first. The current host and host-native
188
+ `agestra-research` prepare the first evidence/aggregation before external
189
+ provider fan-out; external providers primarily challenge, revise, and debate
190
+ prepared items.
109
191
  - `council`: host-native researchers and external providers receive independent
110
192
  investigation assignments before consolidation. Before fan-out, create or
111
193
  confirm a bounded assignment table when the handoff does not already include
@@ -115,19 +197,36 @@ values in MCP calls: `host-seeded`, `council`, or `provider-seeded`
115
197
  it. If the seed provider is missing or unavailable, ask once for a replacement
116
198
  or fall back to `host-seeded` when asking is blocked.
117
199
  - `automatic`: choose the lightest topology that preserves quality. Prefer
118
- `host-seeded` for bounded/scoped work, `council` for broad/open-ended discovery,
119
- and `provider-seeded` only when the user named a seed provider or explicitly
120
- asked a provider to lead the investigation.
200
+ Host-native first (`host-seeded`) for bounded/scoped work, `council` for
201
+ broad/open-ended discovery, and `provider-seeded` only when the user named a
202
+ seed provider or explicitly asked a provider to lead the investigation.
121
203
 
122
204
  If provider-backed work needs a research topology but the handoff omitted it,
123
- ask one concise topology question. This is a cost/latency gate, not a domain
124
- clarification. If a host-level no-questions directive prevents asking, choose
125
- `host-seeded` and report that external investigation fan-out was limited.
126
-
127
- Use `agent_research_consensus_start` when the task needs investigation before
128
- provider consensus. The host owns research planning, research collection,
129
- quality checks, consolidation, pre-agreement, debate input creation, and final
130
- user-facing documents.
205
+ the team-lead MUST stop and run a mandatory design selection gate before any
206
+ provider fan-out. The three 조사 방식 produce different artifact contracts and
207
+ participant routes, so host-level no-questions directives, "keep going" wording,
208
+ or short user prompts DO NOT authorize a silent default. Always surface the
209
+ three options (Council Research / Host-native first / Provider-seeded Research)
210
+ through `AskUserQuestion` (or the host equivalent), each with a one-line
211
+ description, and wait for the user's explicit choice before continuing.
212
+
213
+ Use `agent_research_start` when the task needs investigation before provider
214
+ consensus. Research start receives the workflow profile, prompt pack,
215
+ `questionSet`, `evidencePolicy`, research lenses, and investigator assignments, then produces
216
+ `research_submissions.json`, `research_transcript.json`, and `aggregation.json`.
217
+ It does not start debate. Host-owned research should run through
218
+ `agestra-research` when the active host exposes native agents; MCP sampling is
219
+ not required for that route.
220
+
221
+ Human-facing documents under `docs/reports/{workflow}/` have exactly two roles:
222
+
223
+ - `*-aggregation.md`: a readable Markdown aggregation of participant comments,
224
+ claims, evidence, disagreements, and round responses. Do not paste raw JSON
225
+ bodies into this document; internal JSON artifacts stay referenced as
226
+ evidence only.
227
+ - `*-result.md`: the final decision document. It must stand alone with the
228
+ final decisions and reasons. It should not require the reader to follow the
229
+ debate process.
131
230
 
132
231
  Canonical flow:
133
232
 
@@ -148,27 +247,35 @@ For direct consensus with prepared items, use `agent_consensus_start` with:
148
247
  - `participant_routes`: explicit host routes, for example
149
248
  `{ participant_id: "host-debate", transport: "host-turn", agent_name:
150
249
  "agestra-debate" }`
151
- - `initial_aggregation.items`: the already prepared consensus items
152
- - `metadata.taskLabel`: optional human label only
250
+ - `workflow`: artifact/report label only, not a debate-routing branch
251
+ - `questionSet`: the selected workflow profile's required questions and final
252
+ status contract
253
+ - `aggregation.items`: the team-lead-approved research or seed items
254
+ - `evidencePolicy`: item and stance evidence-type preservation rules
255
+
256
+ Prefer a host-turn `agestra-debate` participant over the current host's external
257
+ CLI provider when the host perspective should join the debate. The CLI provider
258
+ is a separate fresh-session AI, not the native host participant.
153
259
 
154
260
  Do not pass legacy research/source-document/specialist-injection fields. The
155
- engine should not decide the domain, choose specialists, run pre-round fan-out,
156
- or create the initial items.
261
+ engine must not decide the workflow, branch on `workflow`, choose specialists,
262
+ run pre-round fan-out, or create the initial items.
157
263
  </Research_And_Consensus>
158
264
 
159
265
  <Team_Composition>
160
266
  Use these patterns as starting points and adapt them to the task:
161
267
 
162
- - Idea/design/review/security/QA with providers: run focused `agestra-research`
163
- assignments with the relevant lenses, consolidate the evidence, then start
164
- provider consensus over unresolved items.
165
- - Implementation with providers: decompose work, assign scoped patches to
166
- write-capable providers or `agestra-implementer`, review diffs, then verify.
268
+ - Idea/design/review/security/QA with providers: start with focused
269
+ host-native `agestra-research` assignments for Host-native first
270
+ (`host-seeded`) work, consolidate the evidence, then start provider consensus
271
+ over unresolved items. Use external provider research only for Council or
272
+ Provider-seeded topology, or when the user explicitly asks for it.
273
+ - Code-changing requests with providers: do not run them as a primary Agestra
274
+ workflow. Explain that the current host should implement first, then Agestra
275
+ can review, QA, or security-check the result.
167
276
  - Host participant needed in consensus: add an explicit host-turn participant
168
277
  routed to `agestra-debate`; submit its JSON answer with
169
278
  `agent_consensus_submit_turn`.
170
- - Persistent E2E test creation: only after QA/user approval, route a scoped
171
- packet to `agestra-implementer` with `mode: e2e-test-authoring`.
172
279
  </Team_Composition>
173
280
 
174
281
  <QA_Boundary>
@@ -187,61 +294,101 @@ Connection / Boundary Checks must cover:
187
294
  - command/result consistency
188
295
  - E2E artifact interpretation
189
296
 
190
- External providers may cross-check QA evidence, but browser/dev-server/runtime
191
- flows and persistent E2E file creation remain host-owned.
297
+ Across all three QA topologies — Council QA, Host-native first QA,
298
+ Provider-seeded QA browser/dev-server/runtime flows remain host-owned, and
299
+ external providers cross-check artifacts only. Persistent E2E file creation
300
+ is outside Agestra; E2E execution is gated by the workspace's package.json
301
+ scripts.e2e entry.
192
302
  </QA_Boundary>
193
303
 
194
- <QA_Brigade_Execution>
195
- For `/agestra qa`, do not assume provider-backed mode just because providers are
196
- configured. If the handoff packet does not already contain a user-selected mode,
197
- ask once for Host-only QA, QA Brigade, or Decide automatically.
198
-
199
- That mode selection is a cost/permission gate, not a clarifying question. If a
200
- host-level no-questions directive prevents asking, choose Host-only QA and
201
- report that provider fan-out was skipped. Trust registration is a separate
202
- security approval gate: no-questions / keep-going instructions are not user
203
- approval. If providers are workspace-blocked, ask once and then call
204
- `provider_trust_apply` once per approved provider. Use batch trust only when the
205
- host permission model explicitly permits it.
206
-
207
- Default QA Brigade is a fast host-prepared consensus path:
208
-
209
- 1. Run the host-owned evidence pass first (`qa_run`, design/progress inspection,
210
- code/file evidence, and E2E/runtime artifacts when selected).
304
+ <QA_Topology_Execution>
305
+ For `/agestra qa`, the handoff packet's `topology` field is authoritative.
306
+ Team-lead does not re-ask if the packet already names one of Council QA,
307
+ Host-native first QA, or Provider-seeded QA.
308
+
309
+ If the handoff packet omits topology, team-lead MUST stop and run a mandatory
310
+ design selection gate before any provider fan-out. The three 조사 방식
311
+ produce different artifact contracts, participant routes, and evidence
312
+ weights, so host-level no-questions directives, "keep going" wording, or
313
+ short user prompts DO NOT authorize a silent default. Always surface the
314
+ three options (Council QA / Host-native first QA / Provider-seeded QA)
315
+ through `AskUserQuestion` (or the host equivalent), each with a one-line
316
+ description, and wait for the user's explicit choice before continuing.
317
+
318
+ A host-only fallback is not a routing option for QA. If no external
319
+ providers are configured or available, team-lead stops and directs the user
320
+ to `/agestra setup`.
321
+
322
+ Trust registration is a separate security approval gate: no-questions /
323
+ keep-going instructions are not user approval. If providers are
324
+ workspace-blocked, ask once and then call `provider_trust_apply` once per
325
+ approved provider. Use batch trust only when the host permission model
326
+ explicitly permits it.
327
+
328
+ ### Council QA
329
+
330
+ 1. Select the QA workflow profile and call `agent_research_start`.
331
+ 2. Assign the 6 QA lenses to participants: executable evidence,
332
+ spec-to-code compliance, integration risk, edge/error states, test
333
+ adequacy, safety hygiene.
334
+ 3. Record the host's empirical evidence — `qa_run` output plus host-owned
335
+ E2E execution when `scripts.e2e` exists — through `agent_research_record`
336
+ BEFORE consensus starts, with `evidenceType: "empirical"` on every claim
337
+ derived from the executable artifacts.
338
+ 4. External provider claims default to `evidenceType: "inferential"` unless
339
+ the provider was assigned an empirical follow-up lens.
340
+ 5. Inherit research's council defaults for `max_rounds`.
341
+
342
+ ### Host-native first QA
343
+
344
+ 1. Run `qa_run` plus host-owned E2E execution when `scripts.e2e` exists
345
+ (gated by the workspace `package.json` `scripts.e2e` entry; absent
346
+ means E2E is skipped with a reason recorded).
211
347
  2. Use host-native `agestra-research` only through the active host's native
212
- agent surface for narrow evidence assignments. Never put `agestra-research`
213
- in the external provider `participants` list.
214
- 3. Prepare `initial_aggregation.items` from concrete evidence. Include only
215
- findings or disputed claims that external providers can cross-check from the
216
- provided artifacts.
217
- 4. Call `agent_consensus_start`, not `agent_research_consensus_start`, for the
218
- default QA Brigade round. Use exact provider participants, optional
348
+ agent surface for narrow evidence assignments. Never put
349
+ `agestra-research` in the external provider `participants` list.
350
+ 3. Prepare `aggregation.items` from concrete evidence with
351
+ `evidenceType: "empirical"` on items derived from runnable artifacts.
352
+ 4. Call debate-only `agent_consensus_start` with `workflow: "qa"`, the QA
353
+ `questionSet`, `aggregation`, `evidencePolicy`, exact provider participants, optional
219
354
  `participant_routes` for a host-native `agestra-debate` participant,
220
- `max_rounds: 1` for Standard QA, and a bounded participant timeout.
221
- 5. Poll `agent_debate_status` and `run_observable_events` when a locator is
222
- available while provider work is running. Surface concise progress at least
223
- every 30-60 seconds. If this agent is running in a background mode whose
224
- progress cannot reach the user, tell the caller to poll and relay progress,
225
- or fall back to Host-only QA for the current run. If the status reports
226
- pending host turns, dispatch the `agestra-debate` native agent with the
227
- pending packet, then submit the JSON using `agent_consensus_submit_turn`.
228
-
229
- Use `agent_research_consensus_start` for QA only when the user explicitly asks
230
- for deep external-provider research before consensus. In that exception,
231
- external AI research and debate run in separate fresh sessions. The default QA
232
- Brigade should avoid that extra research round because the host already owns the
233
- executable QA evidence.
234
- </QA_Brigade_Execution>
235
-
236
- <E2E_Test_Authoring>
237
- Persistent E2E work is an implementation sub-mode, not a standalone agent.
238
-
239
- Only invoke `agestra-implementer` with `mode: e2e-test-authoring` after the
240
- leader has an approved E2E work packet. In that mode the implementer may edit
241
- only named E2E test files, fixtures, or test configuration. If the test exposes
242
- a product bug or testability gap, it reports the problem instead of changing
243
- product code inline.
244
- </E2E_Test_Authoring>
355
+ `max_rounds: 1`, and a bounded participant timeout.
356
+ 5. External provider stances on host empirical items default to
357
+ `evidenceType: "inferential"`; `"mixed"` only when the provider cites an
358
+ independent empirical artifact it actually inspected.
359
+
360
+ ### Provider-seeded QA
361
+
362
+ 1. Run the selected `seed_provider` first and record its claims with
363
+ `evidenceType: "inferential"`.
364
+ 2. Run the host's empirical evidence pass `qa_run` plus host-owned E2E
365
+ execution when `scripts.e2e` exists and append host claims with
366
+ `evidenceType: "empirical"`. Host claims that explicitly confirm or
367
+ refute a provider-seed claim use `evidenceType: "mixed"`.
368
+ 3. Call debate-only `agent_consensus_start` with `workflow: "qa"`, the QA
369
+ `questionSet`, `aggregation`, `evidencePolicy`, the seed provider + at least
370
+ one reviewer + the host-debate participant route, `max_rounds: 1`, and a
371
+ bounded participant timeout.
372
+
373
+ ### Evidence-type policy (all three topologies)
374
+
375
+ Every QA claim carries `evidenceType`. Host empirical claims include an
376
+ `evidence_ref` (e.g., `docs/reports/qa/.../qa_run.log#L42-L58`). Two
377
+ `"inferential"` agree votes do not outweigh one `"empirical"` refutation
378
+ the renderer surfaces the asymmetry, the human reviewer decides.
379
+
380
+ ### Host-native + progress routing (all three topologies)
381
+
382
+ Never substitute `agestra-research` with an external CLI provider; route any
383
+ host-debate participant via `participant_routes` to `agestra-debate`. Poll
384
+ `agent_debate_status` and `run_observable_events` at 30-60 second intervals
385
+ while provider work is running. If this agent is running in a background
386
+ mode whose progress cannot reach the user, tell the caller to poll and
387
+ relay progress, or stop and direct the user to `/agestra setup`. If the
388
+ status reports pending host turns, dispatch the `agestra-debate` native
389
+ agent with the pending packet, then submit the JSON using
390
+ `agent_consensus_submit_turn`.
391
+ </QA_Topology_Execution>
245
392
 
246
393
  <Completion_Report>
247
394
  Before reporting completion, inspect the evidence yourself. Report:
@@ -8,7 +8,7 @@ You are executing the `/agestra design` command.
8
8
  **Subject:** $ARGUMENTS
9
9
 
10
10
  Plain review/QA/check requests without `/agestra` or explicit multi-AI/provider wording stay with the current host; they are not Agestra natural-language auto-triggers.
11
- Agestra natural-language routing requires explicit multi-AI/provider wording such as "multiple AIs", "all AIs", "other AI", "multi-AI", "Codex and Gemini", "provider comparison", or "프로바이더 비교". Explicit `/agestra ...` commands remain supported.
11
+ Agestra natural-language routing requires explicit Agestra/multi-AI/provider wording such as "Agestra", "아제스트라", "multiple AIs", "all AIs", "other AI", "multi-AI", "Codex and Gemini", "provider comparison", or "프로바이더 비교". Explicit `/agestra ...` commands remain supported.
12
12
 
13
13
  Host interaction fallback: when this workflow says `AskUserQuestion`, use a structured question UI if the current host exposes one. If it is unavailable (for example, in Codex), ask the same question plainly in chat, present the same options, and wait for the user's answer.
14
14
 
@@ -35,13 +35,19 @@ If `$ARGUMENTS` is empty, present a starting-point choice using AskUserQuestion
35
35
  | **Use recent context** | Organize ideas from the current conversation into a design subject |
36
36
 
37
37
  - If **"Describe an idea"**: ask a follow-up "What would you like to design?" and proceed.
38
- - If **"Find ideas first"**: run `/agestra idea` to generate suggestions through the research/consensus flow. After the user selects an idea from the results, save the idea decision under `docs/ideas/`, then continue to Step 2 with that as the subject.
38
+ - If **"Find ideas first"**: run `/agestra idea` to generate suggestions through the research and debate flow. After the user selects an idea from the results, save the idea decision under `docs/ideas/`, then continue to Step 2 with that as the subject.
39
39
  - If **"Use saved idea"**: list relevant Markdown files under `docs/ideas/`, summarize the titles briefly, and ask which one to design using `AskUserQuestion` when available, or a plain numbered prompt as fallback. Do not infer the saved-idea selection.
40
40
  - If **"Use recent context"**: scan the current conversation for previously discussed ideas, improvements, or features. Summarize them and ask the user which to design using `AskUserQuestion` when available, or a plain numbered prompt as fallback. Do not infer the context selection.
41
41
 
42
42
  If `$ARGUMENTS` is provided, use it directly as the subject. If it names a file under `docs/ideas/`, read that idea decision record and treat it as the source artifact for design.
43
43
 
44
- After the subject is identified, gather only the missing design-contract details. Ask one question at a time using `AskUserQuestion` when available, or a plain numbered prompt as fallback. Keep choices short, and put explanations in a separate **Term help** block instead of stuffing long parentheticals into each option. Do not assume or infer missing design-contract values; an explicit `not sure — recommend a default`, `defer`, `none`, or `skip` answer is acceptable.
44
+ After the subject is identified, gather only the missing design-contract details. Ask one question at a time.
45
+
46
+ **Each dimension below is a mandatory gate.** You MUST use `AskUserQuestion` when available; when it is not, you MUST ask the same options plainly in chat as a numbered prompt and wait for the user's answer before moving on. Do not assume, infer, or auto-fill any required value. A host-level no-questions directive, a "keep going" instruction, or a short user prompt DOES NOT authorize a silent default — those wordings are not consent for any specific interview answer.
47
+
48
+ **Bundle-skip rule.** The only legal way to skip an interview question is when the user's incoming request (`$ARGUMENTS`, the prior turn, or a saved-idea record being reused) already contains an explicit, unambiguous value for that question. "Explicit" means the user said the value, not that the agent inferred it from a related word. If any required dimension cannot be fully populated from explicit user-provided values, you MUST ask for the missing dimension before any provider fan-out. For design the required dimensions are the "Need-to-know details" listed below; "Nice-to-know details" are optional.
49
+
50
+ Keep choices short, and put explanations in a separate **Term help** block instead of stuffing long parentheticals into each option. An explicit `not sure — recommend a default`, `defer`, `none`, or `skip` answer is acceptable.
45
51
 
46
52
  Need-to-know details:
47
53
  - **One-line identity:** what this app/feature is, what it should feel like, and what it must not become
@@ -49,7 +55,7 @@ Need-to-know details:
49
55
  - **Scope ledger:** definitely included, definitely excluded, and okay to defer
50
56
  - **Core user flow:** what the user sees first, does next, and considers a successful finish
51
57
  - **Progress style:** one complete pass, MVP then completion, or staged checkpoints
52
- - **Completion criteria:** how the user and AI workers will know the implementation is done
58
+ - **Completion criteria:** how the user and current-host implementation pass will know the work is done
53
59
  - **Research notes:** existing patterns in this codebase, prior art / competing implementations, constraints / regulations, current-information needs, or `skip`
54
60
  - **Research assignments:** any preferred participant/lens split for the selected investigation, or `skip`
55
61
 
@@ -67,12 +73,11 @@ Before provider fan-out, ask once which investigation topology to use unless the
67
73
 
68
74
  | Option | Description |
69
75
  |--------|-------------|
70
- | **Host-led Research (Recommended)** | The current host/native researchers inspect the codebase and prepare the first design evidence packet; providers challenge and debate it. Record internally as `host-seeded`. |
76
+ | **Host-native first (Recommended)** | The active host's native `agestra-research` agent inspects the codebase and prepares the first design evidence packet; providers challenge and debate it. Record internally as `host-seeded`. |
71
77
  | **Council Research** | Host and providers independently investigate design options with assigned lenses before consolidation and debate. |
72
78
  | **Provider-seeded Research** | One selected provider creates the first design seed/evidence artifact; host and other providers challenge it. |
73
- | **Decide automatically** | Use Host-led for bounded design work, Council for broad architecture exploration, and Provider-seeded only when the user named a provider to lead. |
74
79
 
75
- Use `AskUserQuestion` when available, or a plain numbered prompt as fallback. This is a cost/latency gate, not a design clarification. If a host-level no-questions directive prevents asking, choose Host-led Research (`host-seeded`) and report that broader provider investigation was skipped. If Provider-seeded Research is selected and the seed provider is not explicit, record the seed provider as pending; after provider availability is listed, ask which available provider should seed. Do not infer it.
80
+ This is a mandatory design selection gate. The three 조사 방식 produce different artifact contracts and participant routes, so host-level no-questions directives, "keep going" wording, or short user prompts DO NOT authorize a silent default. Always present the three options through `AskUserQuestion` (or the host equivalent), each with a one-line description, and wait for the user's explicit choice before any provider fan-out. If Provider-seeded Research is selected and the seed provider is not explicit, record the seed provider as pending; after provider availability is listed, ask which available provider should seed. Do not infer it.
76
81
 
77
82
  Default design principles:
78
83
  - Prefer maintainable structure and code quality over easy/fast patchwork
@@ -110,22 +115,24 @@ External AI research and debate run in separate fresh sessions, even when the sa
110
115
  - **Design intake answers:** one-line identity, use scope, included/excluded/deferred scope, core flow, progress style, completion criteria, visual/technical constraints, and term-help assumptions
111
116
  - **Idea decision record:** path under `docs/ideas/` if the design came from a saved idea
112
117
  - **User constraints:** any explicit constraints provided
113
- - **Consensus domain:** `design`
114
- - **Research topology / 조사 방식:** selected in Step 2 (`host-seeded`, `council`, `provider-seeded`, or `automatic`)
118
+ - **Workflow profile:** design profile with `workflow: "design"`, design `questionSet`, prompt pack, and `evidencePolicy`
119
+ - **Research topology / 조사 방식:** selected in Step 2 (`host-seeded`, `council`, `provider-seeded`, or `automatic`); seed or research findings become `aggregation.items`
120
+ - **Host-native route:** for Host-native first (`host-seeded`), run active-host `agestra-research` before external provider fan-out; route any host debate participant to `agestra-debate` with `participant_routes`; do not substitute the current host's external CLI provider for this native role
115
121
  - **Research notes:** what the selected investigation should look for (existing patterns, prior art, constraints, current-information needs)
116
122
  - **Research assignments:** optional participant/lens rows for `research_assignments`
117
123
  - **Available providers:** from `environment_check` / `provider_list`
118
124
  - **Requested providers:** explicit names captured from the user's wording (e.g. `[codex, gemini]`); otherwise "all available"
119
125
  - **Locale:** from `setup_status`
120
126
  - **Target workspace root:** absolute project folder if the user supplied or implied one; pass it to workspace/debate MCP calls as `workspace_base_dir`
127
+ - **Progress contract:** surface concise phase updates every 30-60 seconds; poll `agent_debate_status` or `run_observable_events` with a cursor when available; if trace is `cold-start`, report the current local phase and keep monitoring
121
128
  - **Original user request:** preserve verbatim
122
129
 
123
130
  Team-lead owns the rest:
124
131
  - Building the participant team from focused research lenses, explicit host-turn debate participants, and external providers when applicable
125
- - Resolving the selected research topology, then calling `agent_research_consensus_start` when investigation fan-out is required or `agent_consensus_start` with prepared `initial_aggregation.items` when seed/host evidence is already available.
132
+ - Resolving the selected research topology, then calling `agent_research_start` when investigation fan-out is required; call debate-only `agent_consensus_start` only after `aggregation.json` has been inspected and approved.
126
133
  - Ensuring external AI research and debate use separate fresh sessions.
127
- - Never creating a bundled research pseudo-participant and never carrying research bundles through `source_documents`.
128
- - Inspecting `aggregation_record.json`, `open_debate_items.json`, `round_packet.{round}.{provider}.json`, the aggregation document, and the leader-authored final decision document under `docs/agestra/`.
134
+ - Never creating a bundled research pseudo-participant and never carrying research bundles through legacy source-document fields.
135
+ - Inspecting `research_submissions.json`, `research_transcript.json`, `aggregation.json`, `debate_transcript.json`, `workflow_result.json`, the threaded aggregation document, and the concise final decision document under `docs/reports/design/`.
129
136
  - Returning the research artifact paths, accepted decisions, excluded options, disputed items, and the final design document path under `docs/plans/`.
130
137
 
131
138
  **Do NOT from this command:**