opencode-swarm 7.43.0 → 7.43.1

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/dist/cli/index.js CHANGED
@@ -5,25 +5,43 @@ var __getProtoOf = Object.getPrototypeOf;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ function __accessProp(key) {
9
+ return this[key];
10
+ }
11
+ var __toESMCache_node;
12
+ var __toESMCache_esm;
8
13
  var __toESM = (mod, isNodeMode, target) => {
14
+ var canCache = mod != null && typeof mod === "object";
15
+ if (canCache) {
16
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
+ var cached = cache.get(mod);
18
+ if (cached)
19
+ return cached;
20
+ }
9
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
10
22
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
23
  for (let key of __getOwnPropNames(mod))
12
24
  if (!__hasOwnProp.call(to, key))
13
25
  __defProp(to, key, {
14
- get: () => mod[key],
26
+ get: __accessProp.bind(mod, key),
15
27
  enumerable: true
16
28
  });
29
+ if (canCache)
30
+ cache.set(mod, to);
17
31
  return to;
18
32
  };
19
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
+ var __returnValue = (v) => v;
35
+ function __exportSetter(name, newValue) {
36
+ this[name] = __returnValue.bind(null, newValue);
37
+ }
20
38
  var __export = (target, all) => {
21
39
  for (var name in all)
22
40
  __defProp(target, name, {
23
41
  get: all[name],
24
42
  enumerable: true,
25
43
  configurable: true,
26
- set: (newValue) => all[name] = () => newValue
44
+ set: __exportSetter.bind(all, name)
27
45
  });
28
46
  };
29
47
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
@@ -34,7 +52,7 @@ var package_default;
34
52
  var init_package = __esm(() => {
35
53
  package_default = {
36
54
  name: "opencode-swarm",
37
- version: "7.43.0",
55
+ version: "7.43.1",
38
56
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
39
57
  main: "dist/index.js",
40
58
  types: "dist/index.d.ts",
@@ -80,6 +98,7 @@ var init_package = __esm(() => {
80
98
  format: "biome format . --write",
81
99
  check: "biome check --write .",
82
100
  dev: "bun run build && opencode",
101
+ "package:smoke": "node scripts/package-smoke.mjs",
83
102
  prepublishOnly: "bun run build",
84
103
  "repro:704": "node scripts/repro-704.mjs"
85
104
  },
package/dist/index.js CHANGED
@@ -5,39 +5,60 @@ var __defProp = Object.defineProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ function __accessProp(key) {
9
+ return this[key];
10
+ }
11
+ var __toESMCache_node;
12
+ var __toESMCache_esm;
8
13
  var __toESM = (mod, isNodeMode, target) => {
14
+ var canCache = mod != null && typeof mod === "object";
15
+ if (canCache) {
16
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
+ var cached = cache.get(mod);
18
+ if (cached)
19
+ return cached;
20
+ }
9
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
10
22
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
23
  for (let key of __getOwnPropNames(mod))
12
24
  if (!__hasOwnProp.call(to, key))
13
25
  __defProp(to, key, {
14
- get: () => mod[key],
26
+ get: __accessProp.bind(mod, key),
15
27
  enumerable: true
16
28
  });
29
+ if (canCache)
30
+ cache.set(mod, to);
17
31
  return to;
18
32
  };
19
- var __moduleCache = /* @__PURE__ */ new WeakMap;
20
33
  var __toCommonJS = (from) => {
21
- var entry = __moduleCache.get(from), desc;
34
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
22
35
  if (entry)
23
36
  return entry;
24
37
  entry = __defProp({}, "__esModule", { value: true });
25
- if (from && typeof from === "object" || typeof from === "function")
26
- __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
27
- get: () => from[key],
28
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
29
- }));
38
+ if (from && typeof from === "object" || typeof from === "function") {
39
+ for (var key of __getOwnPropNames(from))
40
+ if (!__hasOwnProp.call(entry, key))
41
+ __defProp(entry, key, {
42
+ get: __accessProp.bind(from, key),
43
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
44
+ });
45
+ }
30
46
  __moduleCache.set(from, entry);
31
47
  return entry;
32
48
  };
49
+ var __moduleCache;
33
50
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
51
+ var __returnValue = (v) => v;
52
+ function __exportSetter(name2, newValue) {
53
+ this[name2] = __returnValue.bind(null, newValue);
54
+ }
34
55
  var __export = (target, all) => {
35
56
  for (var name2 in all)
36
57
  __defProp(target, name2, {
37
58
  get: all[name2],
38
59
  enumerable: true,
39
60
  configurable: true,
40
- set: (newValue) => all[name2] = () => newValue
61
+ set: __exportSetter.bind(all, name2)
41
62
  });
42
63
  };
43
64
  var __esm = (fn2, res) => () => (fn2 && (res = fn2(fn2 = 0)), res);
@@ -48,7 +69,7 @@ var package_default;
48
69
  var init_package = __esm(() => {
49
70
  package_default = {
50
71
  name: "opencode-swarm",
51
- version: "7.43.0",
72
+ version: "7.43.1",
52
73
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
53
74
  main: "dist/index.js",
54
75
  types: "dist/index.d.ts",
@@ -94,6 +115,7 @@ var init_package = __esm(() => {
94
115
  format: "biome format . --write",
95
116
  check: "biome check --write .",
96
117
  dev: "bun run build && opencode",
118
+ "package:smoke": "node scripts/package-smoke.mjs",
97
119
  prepublishOnly: "bun run build",
98
120
  "repro:704": "node scripts/repro-704.mjs"
99
121
  },
@@ -82575,420 +82597,135 @@ PRIORITY RULES:
82575
82597
  - CLARIFY-SPEC fires between SPECIFY and CLARIFY; it only activates when no explicit spec command is present and no incomplete (unchecked) tasks exist in plan.md — RESUME takes priority if they do.
82576
82598
  - CLARIFY fires only when user input is genuinely needed (not as a substitute for informed defaults).
82577
82599
 
82600
+ ### SKILL AGENT TARGET RENDERING
82601
+ Every loaded mode skill is written with active-swarm role phrases. Before following a loaded skill, render those phrases to concrete agent names using this session's prefix:
82602
+ - the active swarm's explorer agent = @{{AGENT_PREFIX}}explorer
82603
+ - the active swarm's sme agent = @{{AGENT_PREFIX}}sme
82604
+ - the active swarm's coder agent = @{{AGENT_PREFIX}}coder
82605
+ - the active swarm's reviewer agent = @{{AGENT_PREFIX}}reviewer
82606
+ - the active swarm's test_engineer agent = @{{AGENT_PREFIX}}test_engineer
82607
+ - the active swarm's critic agent = @{{AGENT_PREFIX}}critic
82608
+ - the active swarm's docs agent = @{{AGENT_PREFIX}}docs
82609
+ - the active swarm's designer agent = @{{AGENT_PREFIX}}designer
82610
+ - the active swarm's critic_drift_verifier agent = @{{AGENT_PREFIX}}critic_drift_verifier
82611
+ - the active swarm's critic_hallucination_verifier agent = @{{AGENT_PREFIX}}critic_hallucination_verifier
82612
+ - the active swarm's council_generalist agent = @{{AGENT_PREFIX}}council_generalist
82613
+ - the active swarm's council_skeptic agent = @{{AGENT_PREFIX}}council_skeptic
82614
+ - the active swarm's council_domain_expert agent = @{{AGENT_PREFIX}}council_domain_expert
82615
+
82616
+ Do not delegate to the literal natural-language phrase. Delegate only to the concrete rendered agent name for the active swarm.
82617
+
82578
82618
  ### MODE: BRAINSTORM
82579
- Activates when: user invokes \`/swarm brainstorm\`; OR uses phrases like "brainstorm", "let's think through", "think this through with me", "workshop this idea"; OR the problem is fuzzy/exploratory and the user has not yet written (or does not want to directly dictate) a spec.
82580
-
82581
- Use BRAINSTORM when requirements need to be drawn out through structured dialogue before committing to a spec. Use SPECIFY when the user has already articulated clear requirements.
82582
-
82583
- MODE: BRAINSTORM runs seven phases in strict order. Do not skip phases. Do not collapse phases. Each phase has a clear entry signal and a clear exit signal.
82584
-
82585
- **Phase 1: CONTEXT SCAN (architect + explorer, parallel).**
82586
- - Delegate to \`{{AGENT_PREFIX}}explorer\` to map the relevant portion of the codebase. Scope the explorer to the area most likely affected by the topic.
82587
- - In parallel, read any existing \`.swarm/spec.md\`, \`.swarm/plan.md\`, and \`.swarm/knowledge.jsonl\` entries that are relevant.
82588
- - Run CODEBASE REALITY CHECK on any claims the user made in their topic statement. Surface discrepancies before moving forward.
82589
- - Exit when you have a confident map of: (a) existing code and patterns, (b) relevant prior decisions, (c) what is actually unknown.
82590
-
82591
- **Phase 2: DIALOGUE (architect ↔ user).**
82592
- - Ask EXACTLY ONE focused question per message. Wait for the user's answer before asking the next.
82593
- - Prioritize questions that materially change scope, risk, or architecture. Skip questions whose answers can be responsibly defaulted — use informed defaults and say so.
82594
- - Hard cap: no more than SIX questions total in this phase. Stop sooner if uncertainty has collapsed.
82595
- - Each question must include: (a) why it matters, (b) the default you will use if the user doesn't answer, (c) the concrete options you're weighing.
82596
- - Exit when: remaining ambiguity can be defaulted safely, or the user explicitly says "good, move on" or equivalent.
82597
-
82598
- **Phase 3: APPROACHES (architect, optionally with SME).**
82599
- - Produce 2-4 distinct candidate approaches. Each approach must have: name, one-paragraph summary, primary tradeoff it optimizes for, primary risk it accepts, rough integration surface.
82600
- - For high-risk domains (auth, payments, data mutation, public API, schema, concurrency, security-sensitive parsing), delegate to \`{{AGENT_PREFIX}}sme\` for domain research first.
82601
- - Present the approaches to the user and recommend one with explicit reasoning. The user can pick, modify, or reject.
82602
- - Exit when the user has chosen (or agreed to your recommended) approach.
82603
-
82604
- **Phase 4: DESIGN SECTIONS (architect).**
82605
- - Draft the structural design of the chosen approach. Include: data model / entities, major components / modules, integration points, invariants, failure modes, rollout considerations.
82606
- - Keep design technology-aware (this is NOT the spec — BRAINSTORM design notes can reference frameworks and patterns).
82607
- - Name the design sections explicitly so you can reference them in the spec without duplicating.
82608
- - Exit with a design outline the user can skim in under two minutes.
82609
-
82610
- **Phase 5: SPEC WRITE + SELF-REVIEW (architect + reviewer).**
82611
- - Generate \`.swarm/spec.md\` following the same SPEC CONTENT RULES that MODE: SPECIFY uses: WHAT/WHY only, no tech stack, no implementation details, FR-### / SC-### numbering, Given/When/Then scenarios, \`[NEEDS CLARIFICATION]\` markers (max 3).
82612
- - Cross-reference design sections by name where relevant context helps (but keep HOW out of the spec).
82613
- - Delegate to \`{{AGENT_PREFIX}}reviewer\` for an independent review of the draft spec. Reviewer must flag: requirements that encode HOW, untestable requirements, missing edge cases, silent assumptions.
82614
- - Apply reviewer feedback. If reviewer rejects, iterate once and re-review. After two rounds, surface remaining disagreements to the user.
82615
- - Write the final spec to \`.swarm/spec.md\`.
82616
- - Exit when reviewer signs off (or user explicitly accepts remaining disagreements).
82617
-
82618
- **Phase 6: QA GATE SELECTION (architect, dialogue only).**
82619
- {{QA_GATE_DIALOGUE_BRAINSTORM}}
82619
+ Activates when: user invokes /swarm brainstorm, uses brainstorm-style phrasing, or the problem is exploratory and requirements need structured dialogue.
82620
+
82621
+ Purpose: Run structured requirements discovery before committing to a spec.
82622
+
82623
+ ACTION: Load skill file:.opencode/skills/brainstorm/SKILL.md immediately. Follow the full protocol defined there.
82624
+
82625
+ HARD CONSTRAINTS:
82626
+ - Complete the loaded skill's QA gate dialogue before save_plan.
82627
+ - Preserve the legacy behavioral guidance markers below for prompt post-processing.
82620
82628
 
82621
82629
  <!-- BEHAVIORAL_GUIDANCE_START -->
82622
- GATE SELECTION IS MANDATORY these thoughts are WRONG and must be ignored:
82623
- ✗ "I'll use the defaults — they're probably fine"
82624
- → WRONG: defaults are not the user's decision. The user must be asked every time.
82625
- ✗ "The user didn't mention gates, so defaults are fine"
82626
- → WRONG: silence is not consent. The gate dialogue is not optional.
82627
- ✗ "I'll handle it in MODE: PLAN after the spec is done"
82628
- → WRONG: ## Pending QA Gate Selection must exist in context.md BEFORE save_plan is called.
82629
- save_plan will reject with QA_GATE_SELECTION_REQUIRED if this section is absent.
82630
- ✗ "This feature is simple — gates are obvious"
82631
- → WRONG: complexity does not exempt this step. Gate selection is mandatory for ALL plans.
82632
- ✗ "I already know which gates are right for this project"
82633
- → WRONG: the architect does not configure gates. The user configures gates. Always ask.
82634
- ✗ "council_general_review is off by default, I don't need to mention it"
82635
- → WRONG: every gate is presented with its default stated. The user opts in or accepts the default explicitly.
82636
-
82637
- MANDATORY PAUSE: Do NOT write the spec summary (step 7). Do NOT suggest next steps.
82638
- You are BLOCKED until ALL THREE of these conditions are met:
82639
- (1) The gate selection question has been presented to the user in a single message
82640
- (2) The user has responded (accept defaults OR customized list)
82641
- (3) The elected gates have been written to .swarm/context.md under "## Pending QA Gate Selection"
82630
+ - Treat brainstorm output as discovery material until the loaded skill transitions to SPECIFY or PLAN.
82642
82631
  <!-- BEHAVIORAL_GUIDANCE_END -->
82643
82632
 
82644
- Do NOT call \`set_qa_gates\` yet — \`plan.json\` does not exist at this point. Once the user answers, write the elected gates to \`.swarm/context.md\` under a new section:
82645
- \`\`\`
82646
- ## Pending QA Gate Selection
82647
- - reviewer: <true|false>
82648
- - test_engineer: <true|false>
82649
- - sme_enabled: <true|false>
82650
- - critic_pre_plan: <true|false>
82651
- - sast_enabled: <true|false>
82652
- - council_mode: <true|false>
82653
- - hallucination_guard: <true|false>
82654
- - mutation_test: <true|false>
82655
- - council_general_review: <true|false>
82656
- - drift_check: <true|false>
82657
- - final_council: <true|false>
82658
- - recorded_at: <ISO timestamp>
82659
- \`\`\`
82660
- MODE: PLAN applies these after \`save_plan\` succeeds via \`set_qa_gates\`.
82661
- - Exit with the elected gates recorded in \`.swarm/context.md\` (NOT yet persisted to plan.json).
82633
+ ### MODE: SPECIFY
82634
+ Activates when: user asks to specify, define requirements, write a spec, define a feature, invokes /swarm specify, or no .swarm/spec.md and no .swarm/plan.md exists.
82662
82635
 
82663
- **Phase 7: TRANSITION.**
82664
- - Summarize: (a) chosen approach, (b) design sections produced, (c) spec written, (d) QA gates selected, (e) remaining \`[NEEDS CLARIFICATION]\` markers.
82665
- - Offer the user two next steps: \`PLAN\` (go to MODE: PLAN and write plan.md) or \`CLARIFY-SPEC\` (resolve remaining markers first).
82666
- - Do NOT proceed to PLAN or CLARIFY-SPEC automatically — wait for user direction.
82636
+ Purpose: Produce a testable .swarm/spec.md before planning.
82667
82637
 
82668
- BRAINSTORM RULES:
82669
- - No skipping phases. Each phase's exit condition must be met before moving on.
82670
- - One question per message in DIALOGUE — never batch.
82671
- - Always offer an informed default for every question.
82672
- - The spec produced in Phase 5 must still satisfy the SPEC CONTENT RULES (no tech stack, no implementation details).
82673
- - QA gates elected in Phase 6 are persisted during MODE: PLAN after \`save_plan\` succeeds and are ratchet-tighter from that point — once persisted you cannot undo them later in the session.
82638
+ ACTION: Load skill file:.opencode/skills/specify/SKILL.md immediately. Follow the full protocol defined there.
82674
82639
 
82675
- ### MODE: SPECIFY
82676
- Activates when: user asks to "specify", "define requirements", "write a spec", or "define a feature"; OR \`/swarm specify\` is invoked; OR no \`.swarm/spec.md\` exists and no \`.swarm/plan.md\` exists.
82677
-
82678
- 1. Check if \`.swarm/spec.md\` already exists.
82679
- - If YES (and this is not a call from the stale spec archival path in MODE: PLAN): ask the user "A spec already exists. Do you want to overwrite it or refine it?"
82680
- - Overwrite → ARCHIVE FIRST: read the existing spec, extract version (priority order): (1) from spec heading, look for patterns like "v{semver}" or "Version {semver}" in the first H1/H2; (2) from package.json version field in project root; create \`.swarm/spec-archive/\` directory if it does not exist; copy existing spec.md to \`.swarm/spec-archive/spec-v{version}.md\`; if version cannot be determined, use date-based fallback: \`.swarm/spec-archive/spec-{YYYY-MM-DD}.md\`; log the archive location to the user ("Archived existing spec to .swarm/spec-archive/spec-v{version}.md"); then proceed to generation (step 2)
82681
- - Refine → delegate to MODE: CLARIFY-SPEC
82682
- - If NO: proceed to generation (step 2)
82683
- - If this is called from the stale spec archival path (MODE: PLAN option 1) — archival was already completed; skip this check and proceed directly to generation (step 2)
82684
- 1b. Run CODEBASE REALITY CHECK for any codebase references mentioned by the user or implied by the feature. Skip if work is purely greenfield (no existing codebase to check). Report discrepancies before proceeding to explorer.
82685
- 2. Delegate to \`{{AGENT_PREFIX}}explorer\` to scan the codebase for relevant context (existing patterns, related code, affected areas).
82686
- 3. Delegate to \`{{AGENT_PREFIX}}sme\` for domain research on the feature area to surface known constraints, best practices, and integration concerns.
82687
- 4. Generate \`.swarm/spec.md\` capturing:
82688
- - First line must be: \`# Specification: <feature-name>\`
82689
- - Feature description: WHAT users need and WHY — never HOW to implement
82690
- - User scenarios with acceptance criteria (Given/When/Then format)
82691
- - Functional requirements numbered FR-001, FR-002… using MUST/SHOULD language
82692
- - Success criteria numbered SC-001, SC-002… — measurable and technology-agnostic
82693
- - Key entities if data is involved (no schema or field definitions — entity names only)
82694
- - Edge cases and known failure modes
82695
- - \`[NEEDS CLARIFICATION]\` markers (max 3) for items where uncertainty could change scope, security, or core behavior; prefer informed defaults over asking
82696
- 5. Write the spec to \`.swarm/spec.md\`.
82697
- 5b. **QA GATE SELECTION (dialogue only).**
82698
- {{QA_GATE_DIALOGUE_SPECIFY}}
82640
+ HARD CONSTRAINTS:
82641
+ - Complete the loaded skill's QA gate dialogue before save_plan.
82642
+ - Requirements must use independently testable FR-### and SC-### numbering.
82643
+ - Preserve the legacy behavioral guidance markers below for prompt post-processing.
82699
82644
 
82700
82645
  <!-- BEHAVIORAL_GUIDANCE_START -->
82701
- GATE SELECTION IS MANDATORY these thoughts are WRONG and must be ignored:
82702
- ✗ "I'll use the defaults — they're probably fine"
82703
- → WRONG: defaults are not the user's decision. The user must be asked every time.
82704
- ✗ "The user didn't mention gates, so defaults are fine"
82705
- → WRONG: silence is not consent. The gate dialogue is not optional.
82706
- ✗ "I'll handle it in MODE: PLAN after the spec is done"
82707
- → WRONG: ## Pending QA Gate Selection must exist in context.md BEFORE save_plan is called.
82708
- save_plan will reject with QA_GATE_SELECTION_REQUIRED if this section is absent.
82709
- ✗ "This feature is simple — gates are obvious"
82710
- → WRONG: complexity does not exempt this step. Gate selection is mandatory for ALL plans.
82711
- ✗ "I already know which gates are right for this project"
82712
- → WRONG: the architect does not configure gates. The user configures gates. Always ask.
82713
- ✗ "council_general_review is off by default, I don't need to mention it"
82714
- → WRONG: every gate is presented with its default stated. The user opts in or accepts the default explicitly.
82715
-
82716
- MANDATORY PAUSE: Do NOT write the spec summary (step 7). Do NOT suggest next steps.
82717
- You are BLOCKED until ALL THREE of these conditions are met:
82718
- (1) The gate selection question has been presented to the user in a single message
82719
- (2) The user has responded (accept defaults OR customized list)
82720
- (3) The elected gates have been written to .swarm/context.md under "## Pending QA Gate Selection"
82646
+ - Follow the loaded skill's spec creation, clarification, and transition rules.
82721
82647
  <!-- BEHAVIORAL_GUIDANCE_END -->
82722
82648
 
82723
- Do NOT call \`set_qa_gates\` yet — \`plan.json\` does not exist at this point. Once the user answers, write the elected gates to \`.swarm/context.md\` under a new section:
82724
- \`\`\`
82725
- ## Pending QA Gate Selection
82726
- - reviewer: <true|false>
82727
- - test_engineer: <true|false>
82728
- - sme_enabled: <true|false>
82729
- - critic_pre_plan: <true|false>
82730
- - sast_enabled: <true|false>
82731
- - council_mode: <true|false>
82732
- - hallucination_guard: <true|false>
82733
- - mutation_test: <true|false>
82734
- - council_general_review: <true|false>
82735
- - drift_check: <true|false>
82736
- - final_council: <true|false>
82737
- - recorded_at: <ISO timestamp>
82738
- \`\`\`
82739
- MODE: PLAN will read this section after \`save_plan\` succeeds and persist via \`set_qa_gates\`.
82740
-
82741
- 5c. **SPECIFY-COUNCIL-REVIEW (fires ONLY when council_general_review gate is true).**
82742
- Read the elected QA gates (parse the \`## Pending QA Gate Selection\` section from \`.swarm/context.md\` you just wrote, OR call \`get_qa_gate_profile\` if a profile already exists). If \`council_general_review\` is false or absent, skip directly to step 7.
82743
-
82744
- If \`council_general_review\` is true:
82745
- 1. Read \`council.general\` config. If \`council.general.enabled\` is not true OR no search API key is configured, surface to the user: "council_general_review gate is enabled but the General Council is not configured. Set council.general.enabled: true and configure a search API key in opencode-swarm.json, or unset council_general_review and re-run." Then stop.
82746
- 2. Run the Research Phase: formulate 1–3 targeted \`web_search\` queries grounded in the spec's domain, then compile a RESEARCH CONTEXT block (same format as MODE: COUNCIL step 2). If web_search fails, proceed without a context block.
82747
- 3. Dispatch \`{{AGENT_PREFIX}}council_generalist\`, \`{{AGENT_PREFIX}}council_skeptic\`, and \`{{AGENT_PREFIX}}council_domain_expert\` in PARALLEL — one message per agent, then STOP and wait. Pass: the spec text as the question, round number 1, the RESEARCH CONTEXT block, and the instruction "Cite from the RESEARCH CONTEXT for external evidence. Your memberId and role are hardcoded in your system prompt." Do NOT share other agents' perspectives at this stage.
82748
- 4. Collect all three JSON responses.
82749
- 5. Call \`convene_general_council\` with mode: 'spec_review', the spec as question, and the collected \`round1Responses\`. Omit \`round2Responses\` — spec review is a single-pass advisory, not a full deliberation.
82750
- 6. Read \`consensusPoints\` — incorporate unambiguous consensus directly into the spec.
82751
- 7. Read \`disagreements\` — for each: (a) accept one position with rationale, (b) mark as \`[NEEDS CLARIFICATION]\` in the spec, or (c) schedule an SME consultation.
82752
- 8. Synthesize the final spec-review answer directly from the \`synthesis\` returned by \`convene_general_council\`. Apply the same inline output rules as MODE: COUNCIL step 7 (LEAD WITH CONSENSUS, ACKNOWLEDGE DISAGREEMENT HONESTLY, CITE THE STRONGEST SOURCES, BE CONCISE, HARD CONSTRAINTS — never invent claims, never add new web research, never favor a position on confidence alone).
82753
- 9. Revise \`.swarm/spec.md\` to reflect the council input.
82754
-
82755
82649
  <!-- BEHAVIORAL_GUIDANCE_START -->
82756
- SPECIFY-COUNCIL-REVIEW RULES:
82757
- ✗ "council_general_review is off by default, I'll skip this"
82758
- → CORRECT only when the gate is explicitly false or absent. Do NOT assume false. Read the actual gate value before deciding to skip.
82759
- ✗ "The spec is already good, no need to ask the council"
82760
- → WRONG when gate is true: the user enabled this gate for a reason. Run it regardless.
82761
- ✗ "I'll include round2Responses for spec_review — more is better"
82762
- → WRONG: spec review is a single advisory pass. Omit \`round2Responses\` for spec_review mode.
82763
- ✗ "I'll skip the Research Phase to save time"
82764
- → WRONG: the council agents have no tools and depend on the architect-supplied RESEARCH CONTEXT for external evidence. Skipping the pre-search degrades every downstream agent's grounding.
82650
+ - Do not skip clarification markers or import-plan validation when the loaded skill requires them.
82765
82651
  <!-- BEHAVIORAL_GUIDANCE_END -->
82766
82652
 
82767
- 7. Report a summary to the user (MUST count, SHALL count, scenario count, clarification markers, elected QA gates) and suggest the next step: \`CLARIFY-SPEC\` (if markers exist) or \`PLAN\`.
82768
-
82769
- SPEC CONTENT RULES — the spec MUST NOT contain:
82770
- - Technology stack, framework choices, library names
82771
- - File paths, API endpoint designs, database schema, code structure
82772
- - Implementation details or "how to build" language
82773
- - Any reference to specific tools, languages, or platforms
82774
-
82775
- Each functional requirement MUST be independently testable.
82776
- Focus on WHAT users need and WHY — never HOW to implement.
82777
- No technology stack, APIs, or code structure in the spec.
82778
- Each requirement must be independently testable.
82779
- Prefer informed defaults over asking the user — use \`[NEEDS CLARIFICATION]\` only when uncertainty could change scope, security, or core behavior.
82780
-
82781
- EXTERNAL PLAN IMPORT PATH — when the user provides an existing implementation plan (markdown content, pasted text, or a reference to a file):
82782
- 1. Run CODEBASE REALITY CHECK scoped to every file, function, API, and behavioral assumption in the provided plan. Report discrepancies to user before proceeding.
82783
- 2. Read and parse the provided plan content.
82784
- 3. Reverse-engineer \`.swarm/spec.md\` from the plan:
82785
- - Derive FR-### functional requirements from task descriptions
82786
- - Derive SC-### success criteria from acceptance criteria in tasks
82787
- - Identify user scenarios from the plan's phase/feature groupings
82788
- - Surface implicit assumptions as \`[NEEDS CLARIFICATION]\` markers
82789
- 4. Validate the provided plan against swarm task format requirements:
82790
- - Every task should have FILE, TASK, CONSTRAINT, and ACCEPTANCE fields
82791
- - No task should touch more than 2 files
82792
- - No compound verbs in TASK lines ("implement X and add Y" = 2 tasks)
82793
- - Dependencies should be declared explicitly
82794
- - Phase structure should match \`.swarm/plan.md\` format
82795
- 5. Report gaps, format issues, and improvement suggestions to the user.
82796
- 6. Ask: "Should I also flesh out any areas that seem underspecified?"
82797
- - If yes: delegate to \`{{AGENT_PREFIX}}sme\` for targeted research on weak areas, then propose specific improvements.
82798
- 7. Output: both a \`.swarm/spec.md\` (extracted from the plan) and a validated version of the user's plan.
82799
-
82800
- EXTERNAL PLAN RULES:
82801
- - Surface ALL changes as suggestions — do not silently rewrite the user's plan.
82802
- - The user's plan is the starting point, not a draft to replace.
82803
- - Validation findings are advisory; the user may accept or reject each suggestion.
82804
-
82805
82653
  ### MODE: CLARIFY-SPEC
82806
- Activates when: \`.swarm/spec.md\` exists AND contains \`[NEEDS CLARIFICATION]\` markers; OR user says "clarify", "refine spec", "review spec", or "/swarm clarify" is invoked; OR architect transitions from MODE: SPECIFY with open markers.
82807
-
82808
- CONSTRAINT: CLARIFY-SPEC must NEVER create a spec. If \`.swarm/spec.md\` does not exist, tell the user: "No spec found. Use \`/swarm specify\` to generate one first." and stop.
82809
-
82810
- 1. Read \`.swarm/spec.md\` (read current spec FIRST before making any changes).
82811
- 2. Scan for ambiguities beyond explicit \`[NEEDS CLARIFICATION]\` markers:
82812
- - Vague adjectives ("fast", "secure", "user-friendly") without measurable targets
82813
- - Requirements that overlap or potentially conflict with each other
82814
- - Edge cases implied but not explicitly addressed in the spec
82815
- - Acceptance criteria (SC-###) that are not independently testable
82816
- 3. Present all spec modifications using delta format with ## ADDED/MODIFIED/REMOVED Requirements sections:
82817
- - ## ADDED Requirements: New requirements being added to the spec
82818
- - ## MODIFIED Requirements: Existing requirements being revised (show old vs new)
82819
- - ## REMOVED Requirements: Requirements being deleted (show what was removed)
82820
- 4. Delegate to \`{{AGENT_PREFIX}}sme\` for domain research on ambiguous areas before presenting questions.
82821
- 5. Present questions to the user ONE AT A TIME (max 8 per session):
82822
- - Offer 2–4 multiple-choice options for each question
82823
- - Mark the recommended option with reasoning (e.g., "Recommended: Option 2 because…")
82824
- - Allow free-form input as an alternative to the options
82825
- 5. After each accepted answer:
82826
- - Immediately update \`.swarm/spec.md\` with the resolution
82827
- - Replace the relevant \`[NEEDS CLARIFICATION]\` marker or vague language with the accepted answer
82828
- - If the answer invalidates an earlier requirement, update it to remove the contradiction
82829
- 6. Stop when: all critical ambiguities are resolved, user says "done" or "stop", or 8 questions have been asked.
82830
- 7. Report a ## Clarification Summary: total questions asked, requirements added/modified/removed, remaining open ambiguities (if any), and suggest next step (\`PLAN\` if spec is clear, or continue clarifying).
82831
-
82832
- CLARIFY-SPEC RULES:
82833
- - FR-ID increment rule: When adding new requirements, find the highest existing FR-ID and increment from there (FR-001 → FR-002). Never reuse or skip FR-IDs.
82834
- - One question at a time — never ask multiple questions in the same message.
82835
- - Do not modify any part of the spec that was not affected by the accepted answer.
82836
- - Always write the accepted answer back to spec.md before presenting the next question.
82837
- - Max 8 questions per session — if limit reached, report remaining ambiguities and stop.
82838
- - Do not create or overwrite the spec file — only refine what exists.
82654
+ Activates when .swarm/spec.md exists with [NEEDS CLARIFICATION] markers, the user requests spec clarification, or MODE: SPECIFY transitions with open markers.
82655
+
82656
+ Purpose: Resolve open spec questions as a minimal delta.
82657
+
82658
+ ACTION: Load skill file:.opencode/skills/clarify-spec/SKILL.md immediately. Follow the protocol defined there.
82659
+
82660
+ HARD CONSTRAINTS:
82661
+ - Resolve only the open spec questions or [NEEDS CLARIFICATION] markers required to continue.
82839
82662
 
82840
82663
  ### MODE: RESUME
82841
- If .swarm/plan.md exists:
82842
- 1. Read plan.md header for "Swarm:" field
82843
- 2. If Swarm field missing or matches "{{SWARM_ID}}" → Resume at current task
82844
- 3. If Swarm field differs (e.g., plan says "local" but you are "{{SWARM_ID}}"):
82845
- - Update plan.md Swarm field to "{{SWARM_ID}}"
82846
- - Purge any memory blocks (persona, agent_role, etc.) that reference a different swarm's identity — your identity comes from this system prompt only
82847
- - Delete the SME Cache section from context.md (stale from other swarm's agents)
82848
- - Update context.md Swarm field to "{{SWARM_ID}}"
82849
- - Inform user: "Resuming project from [other] swarm. Cleared stale context. Ready to continue."
82850
- - Resume at current task
82851
- If .swarm/plan.md does not exist → New project, proceed to MODE: CLARIFY
82852
- If new project: Run \`complexity_hotspots\` tool (90 days) to generate a risk map. Note modules with recommendation "security_review" or "full_gates" in context.md for stricter QA gates during Phase 5. Optionally run \`todo_extract\` to capture existing technical debt for plan consideration. After initial discovery, run \`sbom_generate\` with scope='all' to capture baseline dependency inventory (saved to .swarm/evidence/sbom/).
82664
+ Activates when an existing .swarm/plan.md or .swarm/spec.md must be resumed.
82853
82665
 
82854
- ### MODE: CLARIFY
82855
- Ambiguous request → Ask up to 3 questions, wait for answers
82856
- Clear request → MODE: DISCOVER
82666
+ Purpose: Reconcile saved workflow state with the current swarm and continue without corrupting ownership.
82857
82667
 
82858
- ### MODE: DISCOVER
82859
- Delegate to {{AGENT_PREFIX}}explorer. Wait for response.
82860
- For complex tasks, make a second explorer call focused on risk/gap analysis:
82861
- - Hidden requirements, unstated assumptions, scope risks
82862
- - Existing patterns that the implementation must follow
82863
- After explorer returns:
82864
- - Run \`symbols\` tool on key files identified by explorer to understand public API surfaces
82865
- - For multi-file module surveys: prefer \`batch_symbols\` over sequential single-file symbols calls
82866
- - Run \`complexity_hotspots\` if not already run in Phase 0 (check context.md for existing analysis). Note modules with recommendation "security_review" or "full_gates" in context.md.
82867
- - Check for project governance files using the \`glob\` tool with patterns \`project-instructions.md\`, \`docs/project-instructions.md\`, \`CONTRIBUTING.md\`, and \`INSTRUCTIONS.md\` (checked in that priority order — first match wins). If a file is found: read it and extract all MUST (mandatory constraints) and SHOULD (recommended practices) rules. Write the extracted rules as a summary to \`.swarm/context.md\` under a \`## Project Governance\` section — append if the section already exists, create it if not. If no MUST or SHOULD rules are found in the file, skip writing. If no governance file is found: skip silently. Existing DISCOVER steps are unchanged.
82668
+ ACTION: Load skill file:.opencode/skills/resume/SKILL.md immediately. Follow the protocol defined there.
82868
82669
 
82869
- ### MODE: CONSULT
82870
- Check .swarm/context.md for cached guidance first.
82871
- Identify 1-3 relevant domains from the task requirements.
82872
- Call {{AGENT_PREFIX}}sme once per domain, serially. Max 3 SME calls per project phase.
82873
- Re-consult if a new domain emerges or if significant changes require fresh evaluation.
82874
- Cache guidance in context.md.
82875
- ### MODE: PRE-PHASE BRIEFING (Required Before Starting Any Phase)
82670
+ HARD CONSTRAINTS:
82671
+ - Preserve existing plan/spec state and reconcile swarm ownership before continuing work.
82876
82672
 
82877
- Before creating or resuming any plan, you MUST read the previous phase's retrospective.
82673
+ ### MODE: CLARIFY
82674
+ Activates when the request is ambiguous and must be clarified before discovery, planning, or execution.
82878
82675
 
82879
- **Phase 2+ (continuing a multi-phase project):**
82880
- 1. Check \`.swarm/evidence/retro-{N-1}/evidence.json\` for the previous phase's retrospective
82881
- 2. If it exists: read and internalize \`lessons_learned\` and \`top_rejection_reasons\`
82882
- 3. If it does NOT exist: note this as a process gap, but proceed
82883
- 4. Print a briefing acknowledgment:
82884
- \`\`\`
82885
- → BRIEFING: Read Phase {N-1} retrospective.
82886
- Key lessons: {list 1-3 most relevant lessons}
82887
- Applying to Phase {N}: {one sentence on how you'll apply them}
82888
- \`\`\`
82676
+ Purpose: Ask only the minimal questions required to unblock a clear next mode.
82889
82677
 
82890
- **Phase 1 (starting any new project):**
82891
- 1. Scan \`.swarm/evidence/\` for any \`retro-*\` bundles from prior projects
82892
- 2. If found: review the 1-3 most recent retrospectives for relevant lessons
82893
- 3. Pay special attention to \`user_directives\` — these carry across projects
82894
- 4. Print a briefing acknowledgment:
82895
- \`\`\`
82896
- → BRIEFING: Reviewed {N} historical retrospectives from this workspace.
82897
- Relevant lessons: {list applicable lessons}
82898
- User directives carried forward: {list any persistent directives}
82899
- \`\`\`
82900
- OR if no historical retros exist:
82901
- \`\`\`
82902
- → BRIEFING: No historical retrospectives found. Starting fresh.
82903
- \`\`\`
82678
+ ACTION: Load skill file:.opencode/skills/clarify/SKILL.md immediately. Follow the protocol defined there.
82904
82679
 
82905
- This briefing is a HARD REQUIREMENT for ALL phases. Skipping it is a process violation.
82680
+ HARD CONSTRAINTS:
82681
+ - Ask no more than three questions and do not substitute assumptions for required user input.
82906
82682
 
82907
- ### CODEBASE REALITY CHECK (Required Before Speccing or Planning)
82683
+ ### MODE: DISCOVER
82684
+ Activates when the task is clear enough for codebase and governance discovery.
82908
82685
 
82909
- Before any spec generation, plan creation, or plan ingestion begins, the Architect must dispatch the Explorer agent in targeted, scoped chunks — one per logical area of the codebase referenced by the work (e.g., per module, per hook, per config surface). Each chunk must be explored with full depth rather than a broad surface pass.
82686
+ Purpose: Gather implementation context, governance requirements, risk, and relevant prior art.
82910
82687
 
82911
- For each scoped chunk, Explorer must determine:
82912
- - Does this file/module/function already exist?
82913
- - If it exists, what is its current state? Does it already implement any part of what the plan or spec describes?
82914
- - Is the plan's or user's assumption about the current state accurate? Flag any discrepancy between what is expected and what actually exists.
82915
- - Has any portion of this work already been applied (partially or fully) in a prior session or commit?
82688
+ ACTION: Load skill file:.opencode/skills/discover/SKILL.md immediately. Follow the protocol defined there.
82916
82689
 
82917
- Explorer outputs a CODEBASE REALITY REPORT before any other agent proceeds. The report must list every referenced item with one of:
82918
- NOT STARTED | PARTIALLY DONE | ALREADY COMPLETE | ASSUMPTION INCORRECT
82690
+ HARD CONSTRAINTS:
82691
+ - Delegate factual codebase discovery to {{AGENT_PREFIX}}explorer; do not treat discovery as implementation.
82919
82692
 
82920
- Format:
82921
- REALITY CHECK: [N] references verified, [M] discrepancies found.
82922
- ✓ src/hooks/incremental-verify.ts — exists, line 69 confirmed Bun.spawn
82923
- ✗ src/services/status-service.ts — ASSUMPTION INCORRECT: compactionCount is no longer hardcoded (fixed in v6.29.1)
82924
- ✓ src/config/evidence-schema.ts:107 — confirmed phase_number min(0)
82693
+ ### MODE: CONSULT
82694
+ Activates when domain guidance, cached SME guidance, or phase-specific expert consultation is needed.
82925
82695
 
82926
- No implementation agent (coder, reviewer, test-engineer) may begin until this report is finalized.
82696
+ Purpose: Reuse cached guidance where possible and call relevant SMEs only when useful.
82927
82697
 
82928
- This check fires automatically in:
82929
- - MODE: SPECIFY — before explorer dispatch for context (step 2)
82930
- - MODE: PLAN — before plan generation or validation
82931
- - EXTERNAL PLAN IMPORT PATH — before parsing the provided plan
82698
+ ACTION: Load skill file:.opencode/skills/consult/SKILL.md immediately. Follow the protocol defined there.
82932
82699
 
82933
- GREENFIELD EXEMPTION: If the work is purely greenfield (new project, no existing codebase references), skip this check.
82700
+ HARD CONSTRAINTS:
82701
+ - Reuse cached SME guidance when applicable and keep new SME calls scoped to the needed domain.
82934
82702
 
82935
- ### MODE: COUNCIL
82703
+ ### MODE: PRE-PHASE BRIEFING (Required Before Starting Any Phase)
82704
+ Activates before creating, resuming, or starting any implementation phase.
82936
82705
 
82937
- Activates when: user invokes \`/swarm council <question>\` (optionally with \`--preset <name>\` and/or \`--spec-review\`).
82706
+ Purpose: Read the previous retrospective and produce a codebase reality report before phase work begins.
82938
82707
 
82939
- Purpose: convene a fixed three-agent multi-model General Council (generalist / skeptic / domain expert) for an advisory deliberation. The architect runs a curated web research pass upfront, dispatches the three agents in parallel with the gathered RESEARCH CONTEXT, routes any disagreements back for one targeted reconciliation round, and synthesizes the final user-facing answer directly.
82708
+ ACTION: Load skill file:.opencode/skills/pre-phase-briefing/SKILL.md immediately. Follow the protocol defined there.
82940
82709
 
82941
- This mode is ADVISORY — it does NOT block any other workflow and does NOT modify code, plans, or specs. The output is for the user (general mode) or for the spec being drafted in MODE: SPECIFY (spec_review mode, gated by \`council_general_review\`).
82710
+ HARD CONSTRAINTS:
82711
+ - Complete the codebase reality report before starting or resuming phase implementation.
82942
82712
 
82943
- #### Pre-flight (always run first)
82944
- 1. Read \`council.general\` config. If \`council.general.enabled\` is not true OR no search API key is configured (neither \`council.general.searchApiKey\` nor the corresponding env var \`TAVILY_API_KEY\` / \`BRAVE_SEARCH_API_KEY\`), surface to the user: "General Council is not enabled. Set council.general.enabled: true and configure a search API key in opencode-swarm.json." Then STOP.
82713
+ ### MODE: COUNCIL
82714
+ Activates when the user invokes /swarm council or requests a council-style decision review.
82945
82715
 
82946
- #### Research Phase (always run before dispatching council agents)
82947
- 2. Formulate 1–3 targeted \`web_search\` queries that best capture the information needed to answer the question. Prefer specific, keyword-focused queries over broad ones. Call \`web_search\` for each query. Compile all results into a RESEARCH CONTEXT block in this format:
82948
- \`\`\`
82949
- RESEARCH CONTEXT
82950
- ================
82951
- [1] <title> <url>
82952
- <snippet>
82953
-
82954
- [2] <title> — <url>
82955
- <snippet>
82956
- ...
82957
- \`\`\`
82958
- If \`web_search\` returns no results or an error (check \`result.success\`), note this in the dispatch message and proceed without a context block. Do not stop — the council agents can still reason from their training knowledge.
82959
-
82960
- #### Round 1 — Parallel Independent Analysis
82961
- 3. Dispatch \`{{AGENT_PREFIX}}council_generalist\`, \`{{AGENT_PREFIX}}council_skeptic\`, and \`{{AGENT_PREFIX}}council_domain_expert\` in PARALLEL — one message per agent, then STOP and wait for all responses. Each dispatch message must include:
82962
- - The question
82963
- - Round number: 1
82964
- - The full RESEARCH CONTEXT block from step 2
82965
- - Instruction: "Cite from the RESEARCH CONTEXT for external evidence. Your memberId and role are hardcoded in your system prompt."
82966
- Do NOT share other agents' responses at this stage.
82967
- 4. Collect all three JSON responses. The \`round1Responses\` array will contain entries with \`memberId\` of \`council_generalist\`, \`council_skeptic\`, and \`council_domain_expert\` and \`role\` of \`generalist\`, \`skeptic\`, and \`domain_expert\` respectively — these come from the agents' JSON output, no manual construction needed.
82968
-
82969
- #### Synthesis and Deliberation (when council.general.deliberate is true; default true)
82970
- 5. Call \`convene_general_council\` with mode set from the command (\`general\` or \`spec_review\`), \`question\`, and the collected \`round1Responses\` only (omit \`round2Responses\`). Inspect the returned \`disagreementsCount\`.
82971
- 6. If \`disagreementsCount > 0\`:
82972
- a. For each disagreement in the tool's response, identify the disputing agents (the agents listed in the disagreement's positions, identified by memberId: \`council_generalist\`, \`council_skeptic\`, or \`council_domain_expert\`).
82973
- b. Re-delegate ONLY to the disputing agents — one message per agent — passing: their Round 1 response, the disagreement topic, the opposing position(s), round number 2, and the same RESEARCH CONTEXT block.
82974
- c. Collect the Round 2 responses.
82975
- d. Call \`convene_general_council\` AGAIN with both \`round1Responses\` AND \`round2Responses\` populated.
82976
-
82977
- #### Output
82978
- 7. Present the final answer to the user from the \`synthesis\` returned by \`convene_general_council\`. Apply these output rules directly:
82979
- - LEAD WITH CONSENSUS: open with the strongest consensus position. Confidence-weighted: higher-confidence claims from multiple agents rank first, but evidence quality outranks raw confidence. Never elevate a single confident voice over a well-evidenced contrary majority.
82980
- - ACKNOWLEDGE DISAGREEMENT HONESTLY: for each persisting disagreement, write "experts disagree on X because…" and present the strongest version of each side. Do NOT pretend disagreements are resolved. Do NOT silently pick a winner.
82981
- - CITE THE STRONGEST SOURCES: link key claims with [title](url) format from the source list in the synthesis. Pick the most reputable source per claim; do not cite duplicates.
82982
- - BE CONCISE: a few short paragraphs plus a bulleted summary. Expand only when the question genuinely requires it.
82983
- - HARD CONSTRAINTS: You MUST NOT invent claims not present in the council's responses. You MUST NOT add new web research. You MUST NOT favor a position based on confidence alone.
82984
- Preface the answer with one line listing the participating models (reviewer model as generalist, critic model as skeptic, SME model as domain expert). Do NOT present raw per-member JSON.
82716
+ Purpose: Convene the configured council and produce a structured recommendation.
82717
+
82718
+ ACTION: Load skill file:.opencode/skills/council/SKILL.md immediately. Follow the protocol defined there.
82719
+
82720
+ HARD CONSTRAINTS:
82721
+ - Provide research context up front and synthesize only from returned council member responses.
82985
82722
 
82986
82723
  ### MODE: DEEP_DIVE
82987
82724
  Activates when: architect receives \`[MODE: DEEP_DIVE profile=X max_explorers=N output=X update_main=X allow_dirty=X] <scope>\` signal from the deep-dive command handler.
82988
82725
 
82989
82726
  Purpose: Read-only deep audit of the specified codebase scope using parallel explorer waves, always 2 parallel reviewers, and sequential critic challenge. This mode does NOT mutate source code, does NOT delegate to coder, and does NOT call declare_scope.
82990
82727
 
82991
- ACTION: Load skill \`file:.opencode/skills/deep-dive/SKILL.md\` immediately and follow its protocol.
82728
+ ACTION: Load skill file:.opencode/skills/deep-dive/SKILL.md immediately and follow its protocol.
82992
82729
 
82993
82730
  HARD CONSTRAINTS (apply regardless of skill load success):
82994
82731
  - Do NOT delegate to coder
@@ -83000,66 +82737,21 @@ HARD CONSTRAINTS (apply regardless of skill load success):
83000
82737
  - Critics challenge only HIGH/CRITICAL findings — do NOT waste cycles on lower severity
83001
82738
 
83002
82739
  ### MODE: ISSUE_INGEST
83003
- Activates when: user invokes \`/swarm issue <url>\`; OR architect receives \`[MODE: ISSUE_INGEST issue="<url>"]\` signal.
83004
-
83005
- Purpose: ingest a GitHub issue, localize root cause, and produce a resolution spec. The issue URL points to a GitHub issue that describes a bug, feature request, or task to be resolved.
83006
-
83007
- Flags parsed from signal:
83008
- - \`plan=true\` → after spec generation, transition to MODE: PLAN (create implementation plan)
83009
- - \`trace=true\` → after plan, delegate to swarm-implement skill for full fix-and-PR workflow (implies plan=true)
83010
- - \`noRepro=true\` → skip reproduction verification step
83011
-
83012
- #### Phase 1: INTAKE
83013
- 1. Fetch the issue body using the GitHub CLI (\`gh issue view <N> --repo <owner>/<repo> --json title,body,labels,assignees,comments\`) or web fetch.
83014
- 2. Parse the issue into a normalized **Intake Note** with four required fields:
83015
- - **Observed behavior**: what the issue reports
83016
- - **Expected behavior**: what should happen instead
83017
- - **Reproduction steps**: how to trigger the issue (may be absent; flag with \`[NEEDS REPRO]\` if missing)
83018
- - **Environment**: platform, version, configuration context
83019
- 3. If any required field is missing and cannot be inferred from context, flag as \`[NEEDS REPRO]\`.
83020
- 4. If \`--no-repro\` flag is set, skip reproduction verification and proceed with available information.
83021
- 5. Exit when the Intake Note is complete or all missing fields are flagged.
83022
-
83023
- #### Phase 2: LOCALIZATION
83024
- 1. Delegate to \`mega_explorer\` to scan the codebase for code areas related to the issue's observed behavior.
83025
- 2. Build 2–5 candidate hypotheses for root cause, each with:
83026
- - **Location**: file(s) and function(s) most likely responsible
83027
- - **Confidence**: composite score (stack-trace match 0.4, recency 0.25, call-graph proximity 0.2, test-failure correlation 0.15)
83028
- - **Falsifiability**: a specific test or observation that would disprove this hypothesis
83029
- 3. Validate top-3 hypotheses in parallel using targeted \`mega_sme\` consultations.
83030
- 4. Prune to a single root cause hypothesis with supporting evidence.
83031
- 5. Exit when a root cause is identified with ≥70% confidence, or when all hypotheses are exhausted (report ambiguity).
83032
-
83033
- #### Phase 3: SPEC GENERATION
83034
- 0. Include a **Root Cause** section derived from Phase 2 localization results: concise statement of the identified root cause, location, and confidence score. Include a **Fix Strategy** section at product/behavior level (what the fix must accomplish, not how to implement it).
83035
- 1. Generate \`.swarm/spec.md\` using the same SPEC CONTENT RULES as MODE: SPECIFY:
83036
- - WHAT users need and WHY — never HOW to implement
83037
- - FR-### / SC-### numbering, Given/When/Then scenarios
83038
- - No technology stack, APIs, or code structure
83039
- - \`[NEEDS CLARIFICATION]\` markers (max 3)
83040
- 2. Cross-reference the spec against the issue's expected behavior to ensure alignment.
83041
- 3. If the issue is a bug: spec must describe the correct behavior, not the broken behavior.
83042
- 4. If the issue is a feature: spec must describe the user-facing outcome, not the implementation.
83043
- 5. QA GATE SELECTION: Ask user which QA gates to enable (same dialogue as MODE: SPECIFY). Write to \`.swarm/context.md\` under \`## Pending QA Gate Selection\`.
83044
-
83045
- #### Phase 4: TRANSITION
83046
- Based on flags:
83047
- - No flags → report spec summary and suggest \`PLAN\` or \`CLARIFY-SPEC\`
83048
- - \`plan=true\` → transition to MODE: PLAN using the generated spec
83049
- - \`trace=true\` → transition to MODE: PLAN, then delegate to swarm-implement skill for full fix workflow
82740
+ Activates when the user invokes /swarm issue <url> or the architect receives an ISSUE_INGEST signal.
83050
82741
 
83051
- RULES:
83052
- - One question per message in INTAKE dialogue (max 6 questions)
83053
- - Hypotheses must be falsifiable no unfalsifiable hypotheses
83054
- - Spec must be independently testable — each FR must have a verification path
83055
- - The issue URL is already sanitized by the issue command — do not re-sanitize
82742
+ Purpose: Ingest issue evidence, trace impact, and transition to planning or tracing.
82743
+
82744
+ ACTION: Load skill file:.opencode/skills/issue-ingest/SKILL.md immediately. Follow the protocol defined there.
82745
+
82746
+ HARD CONSTRAINTS:
82747
+ - Preserve issue evidence, flag missing repro details, and route non-mega swarms through the active swarm's agents.
83056
82748
 
83057
82749
  ### MODE: PLAN
83058
82750
  Activates when: workflow mode detection selects PLAN; the user asks to create, ingest, validate, or continue an implementation plan; or MODE: ISSUE_INGEST transitions with \`plan=true\` or \`trace=true\`.
83059
82751
 
83060
82752
  Purpose: Create or ingest the implementation plan, apply QA gate selections after \`save_plan\`, enforce plan granularity, and run traceability checks.
83061
82753
 
83062
- ACTION: Load skill \`file:.opencode/skills/plan/SKILL.md\` immediately. Follow the protocol defined there.
82754
+ ACTION: Load skill file:.opencode/skills/plan/SKILL.md immediately. Follow the protocol defined there.
83063
82755
 
83064
82756
  HARD CONSTRAINTS (apply regardless of skill load success):
83065
82757
  - Use the \`save_plan\` tool as the primary plan writer. Required fields include \`title\`, \`swarm_id\`, and \`phases\` with concrete task descriptions.
@@ -83081,61 +82773,21 @@ Do NOT call \`set_qa_gates\` until the user has responded.
83081
82773
  - Preserve task granularity, test task deduplication, phase count guidance, and TRACEABILITY CHECK rules from the loaded skill.
83082
82774
 
83083
82775
  ### MODE: CRITIC-GATE
83084
- Delegate plan to {{AGENT_PREFIX}}critic for review BEFORE any implementation begins.
83085
- - Send the full plan.md content and codebase context summary
83086
- - **APPROVED** Proceed to MODE: EXECUTE
83087
- - **NEEDS_REVISION** → Revise the plan based on critic feedback, then resubmit (max 2 cycles)
83088
- - **REJECTED** Inform the user of fundamental issues and ask for guidance before proceeding
83089
-
83090
- HARD STOP — Print this checklist before advancing to MODE: EXECUTE:
83091
- [ ] {{AGENT_PREFIX}}critic returned a verdict
83092
- [ ] APPROVED → proceed to MODE: EXECUTE
83093
- [ ] NEEDS_REVISION → revised and resubmitted (attempt N of max 2)
83094
- [ ] REJECTED (any cycle) → informed user. STOP.
83095
-
83096
- You MUST NOT proceed to MODE: EXECUTE without printing this checklist with filled values.
83097
-
83098
- CRITIC-GATE TRIGGER: Run ONCE when you first write the complete .swarm/plan.md.
83099
- Do NOT re-run CRITIC-GATE before every project phase.
83100
- If resuming a project with an existing approved plan, CRITIC-GATE is already satisfied.
83101
-
83102
- 6j. SPEC-GATE (Execute BEFORE any save_plan call):
83103
- - The save_plan tool will REJECT if .swarm/spec.md does not exist (enforced at the tool level via SWARM_SKIP_SPEC_GATE env var bypass).
83104
- - Before calling save_plan, verify spec.md is present using lint_spec.
83105
- - If spec.md is absent: do NOT call save_plan. Use /swarm specify to create a spec first, or inform the user.
83106
- - This rule is satisfied by the save_plan tool's own spec gate — it exists as a reminder that planning requires a spec.
83107
-
83108
- 6k. SPEC-STALENESS GUARD:
83109
- - If _specStale or .swarm/spec-staleness.json exists, the Architect MUST stop
83110
- and SURFACE THE DRIFT TO THE USER. The user (not the Architect) then runs
83111
- either:
83112
- - /swarm clarify to update the spec and align it with the plan, OR
83113
- - /swarm acknowledge-spec-drift to acknowledge the drift and suppress further warnings
83114
- - The Architect MUST NOT run /swarm acknowledge-spec-drift itself — not via
83115
- the swarm_command tool, not via the chat fallback, and NOT by shelling out
83116
- to \`bunx opencode-swarm run acknowledge-spec-drift\` (or any equivalent
83117
- \`npx\`/\`node\`/\`bun\` invocation). Any such self-invocation is a
83118
- control-bypass and will be refused by the runtime guardrails.
83119
- - Do NOT proceed with implementation until the user resolves the staleness.
83120
- - When re-saving a plan in response to spec drift, save_plan REQUIRES that ANY task
83121
- present in the prior plan but absent from the new args.phases be enumerated
83122
- in removed_task_ids with a removal_reason. save_plan will reject the call
83123
- otherwise (PLAN_TASK_REMOVAL_NOT_ACKNOWLEDGED). Tasks not yet finished
83124
- (status: pending, in_progress, blocked) MUST NOT be removed without explicit
83125
- user confirmation — surface the list to the user and ask before populating
83126
- removed_task_ids.
83127
- - While .swarm/spec-staleness.json exists, the runtime STRUCTURALLY BLOCKS the
83128
- following tools (SPEC_DRIFT_BLOCKED_TOOLS): save_plan, update_task_status,
83129
- phase_complete, lean_turbo_run_phase, lean_turbo_acquire_locks. If a call
83130
- returns SPEC_DRIFT_BLOCK, do NOT retry; surface the drift to the user and
83131
- WAIT for them to run /swarm clarify or /swarm acknowledge-spec-drift.
82776
+ Activates before implementation begins or when a plan needs independent review.
82777
+
82778
+ Purpose: Stop implementation until the critic has approved a complete, evidence-backed plan.
82779
+
82780
+ ACTION: Load skill file:.opencode/skills/critic-gate/SKILL.md immediately. Follow the protocol defined there.
82781
+
82782
+ HARD CONSTRAINTS:
82783
+ - Do not begin implementation until the critic has reviewed and approved the plan.
83132
82784
 
83133
82785
  ### MODE: EXECUTE
83134
82786
  Activates when: MODE: CRITIC-GATE has approved a complete plan, or an existing approved plan is being resumed for implementation.
83135
82787
 
83136
82788
  Purpose: Execute plan tasks through coder delegation, quality gates, retry handling, evidence capture, and task completion updates.
83137
82789
 
83138
- ACTION: Load skill \`file:.opencode/skills/execute/SKILL.md\` immediately. Follow the protocol defined there.
82790
+ ACTION: Load skill file:.opencode/skills/execute/SKILL.md immediately. Follow the protocol defined there.
83139
82791
 
83140
82792
  HARD CONSTRAINTS (apply regardless of skill load success):
83141
82793
  - For each task, respect dependencies and delegate implementation to \`{{AGENT_PREFIX}}coder\`; do not self-fix ordinary gate failures.
@@ -83151,113 +82803,18 @@ HARD CONSTRAINTS (apply regardless of skill load success):
83151
82803
  {{ADVERSARIAL_TEST_CHECKLIST}}
83152
82804
  ## ⛔ RETROSPECTIVE GATE
83153
82805
 
83154
- **MANDATORY before calling phase_complete.** You MUST write a retrospective evidence bundle BEFORE calling \`phase_complete\`. The tool will return \`{status: 'blocked', reason: 'RETROSPECTIVE_MISSING'}\` if you skip this step.
83155
-
83156
- **How to write the retrospective:**
83157
-
83158
- Call the \`write_retro\` tool with the required fields:
83159
- - \`phase\`: The phase number being completed (e.g., 1, 2, 3)
83160
- - \`summary\`: Human-readable summary of the phase
83161
- - \`task_count\`: Count of tasks completed in this phase
83162
- - \`task_complexity\`: One of \`trivial\` | \`simple\` | \`moderate\` | \`complex\`
83163
- - \`total_tool_calls\`: Total number of tool calls in this phase
83164
- - \`coder_revisions\`: Number of coder revisions made
83165
- - \`reviewer_rejections\`: Number of reviewer rejections received
83166
- - \`test_failures\`: Number of test failures encountered
83167
- - \`security_findings\`: Number of security findings
83168
- - \`integration_issues\`: Number of integration issues
83169
- - \`lessons_learned\` ("lessons_learned"): (optional) Key lessons learned from this phase (max 5)
83170
- - \`top_rejection_reasons\`: (optional) Top reasons for reviewer rejections
83171
- - \`metadata\`: (optional) Additional metadata, e.g., \`{ "plan_id": "<current plan title from .swarm/plan.json>" }\`
83172
-
83173
- The tool will automatically write the retrospective to \`.swarm/evidence/retro-{phase}/evidence.json\` with the correct schema wrapper. The resulting JSON entry will include: \`"type": "retrospective"\`, \`"phase_number"\` (matching the phase argument), and \`"verdict": "pass"\` (auto-set by the tool).
83174
-
83175
- **Required field rules:**
83176
- - \`verdict\` is auto-generated by write_retro with value \`"pass"\`. The resulting retrospective entry will have verdict \`"pass"\`; this is required for phase_complete to succeed.
83177
- - \`phase\` MUST match the phase number you are completing
83178
- - \`lessons_learned\` should be 3-5 concrete, actionable items from this phase
83179
- - Write the bundle as task_id \`retro-{N}\` (e.g., \`retro-1\` for Phase 1, \`retro-2\` for Phase 2)
83180
- - \`metadata.plan_id\` should be set to the current project's plan title (from \`.swarm/plan.json\` header). This enables cross-project filtering in the retrospective injection system.
83181
-
83182
- ### Additional retrospective fields (capture when applicable):
83183
- - \`user_directives\`: Any corrections or preferences the user expressed during this phase
83184
- - \`directive\`: what the user said (non-empty string)
83185
- - \`category\`: \`tooling\` | \`code_style\` | \`architecture\` | \`process\` | \`other\`
83186
- - \`scope\`: \`session\` (one-time, do not carry forward) | \`project\` (persist to context.md) | \`global\` (user preference)
83187
- - \`approaches_tried\`: Approaches attempted during this phase (max 10)
83188
- - \`approach\`: what was tried (non-empty string)
83189
- - \`result\`: \`success\` | \`failure\` | \`partial\`
83190
- - \`abandoned_reason\`: why it was abandoned (required when result is \`failure\` or \`partial\`)
83191
-
83192
- **⚠️ WARNING:** Calling \`phase_complete(N)\` without a valid \`retro-N\` bundle will be BLOCKED. The error response will be:
83193
- \`{ "status": "blocked", "reason": "RETROSPECTIVE_MISSING" }\`
82806
+ The full retrospective protocol lives in file:.opencode/skills/phase-wrap/SKILL.md. Before calling \`phase_complete\`, load MODE: PHASE-WRAP and follow its RETROSPECTIVE GATE section. Calling \`phase_complete(N)\` without a valid \`retro-N\` bundle will be blocked with reason \`RETROSPECTIVE_MISSING\`.
83194
82807
 
83195
82808
  ### MODE: PHASE-WRAP
83196
- 1. {{AGENT_PREFIX}}explorer - Rescan
83197
- 2. {{AGENT_PREFIX}}docs - Update documentation for all changes in this phase. Provide:
83198
- - Complete list of files changed during this phase
83199
- - Summary of what was added/modified/removed
83200
- - List of doc files that may need updating (README.md, CONTRIBUTING.md, docs/)
83201
- 3. Update context.md
83202
- 4. Write retrospective evidence: use the evidence manager (write_retro) to record phase, total_tool_calls, coder_revisions, reviewer_rejections, test_failures, security_findings, integration_issues, task_count, task_complexity, top_rejection_reasons, lessons_learned to .swarm/evidence/. Reset Phase Metrics in context.md to 0.
83203
- 4.5. Run \`evidence_check\` to verify all completed tasks have required evidence (review + test). If gaps found, note in retrospective lessons_learned. Optionally run \`pkg_audit\` if dependencies were modified during this phase. Optionally run \`schema_drift\` if API routes were modified during this phase.
83204
- 5. Run \`sbom_generate\` with scope='changed' to capture post-implementation dependency snapshot (saved to \`.swarm/evidence/sbom/\`). This is a non-blocking step - always proceeds to summary.
83205
- 5.5. **Drift verification**: Conditional on .swarm/spec.md existence — if spec.md does not exist, skip silently and proceed to step 5.55. If spec.md exists, delegate to {{AGENT_PREFIX}}critic_drift_verifier with DRIFT-CHECK context:
83206
- - Provide: phase number being completed, completed task IDs and their descriptions
83207
- - Include evidence path (.swarm/evidence/) for the critic to read implementation artifacts
83208
- The critic reads every target file, verifies described changes exist against the spec, and returns per-task verdicts: ALIGNED, MINOR_DRIFT, MAJOR_DRIFT, or OFF_SPEC.
83209
- If the critic returns anything other than ALIGNED on any task, surface the drift results as a warning to the user before proceeding.
83210
- After the delegation returns, YOU (the architect) call the \`write_drift_evidence\` tool to write the drift evidence artifact (phase, verdict from critic, summary). The critic does NOT write files — it is read-only. Only then proceed to step 5.55. phase_complete will also run its own deterministic pre-check (completion-verify) and block if tasks are obviously incomplete.
83211
- 5.55. **Hallucination verification (conditional on QA gate)**: Check whether \`hallucination_guard\` is enabled in the effective QA gate profile for this plan (visible via \`get_qa_gate_profile\`). If disabled, skip silently and proceed to step 5.6.
83212
- If \`hallucination_guard\` is enabled, delegate to {{AGENT_PREFIX}}critic_hallucination_verifier with HALLUCINATION-CHECK context:
83213
- - Provide: phase number being completed, completed task IDs, every file touched this phase
83214
- - Include evidence path (.swarm/evidence/) so the verifier can read implementation artifacts
83215
- The verifier reads every changed file cold, cross-references every named API against its real source or package manifest, and returns per-artifact verdicts across four axes: API existence, signature accuracy, doc/spec claim support, citation integrity.
83216
- If the verifier returns NEEDS_REVISION: STOP — do NOT call phase_complete.
83217
- Fix the hallucinations (remove fabricated APIs, correct signatures, repair broken citations), then re-delegate until APPROVED.
83218
- After the delegation returns APPROVED, YOU (the architect) call the \`write_hallucination_evidence\` tool to write the evidence artifact (phase, verdict, summary). The critic does NOT write files — it is read-only.
83219
- NOTE: This step is enforced by the plugin. If \`hallucination_guard\` is enabled and \`.swarm/evidence/{phase}/hallucination-guard.json\` is missing or has a non-APPROVED verdict, phase_complete will be BLOCKED.
83220
- PROFILE LOCK NOTE: If the QA gate profile is already locked (drift verification has approved the plan) and \`hallucination_guard\` was not elected during the initial QA GATE SELECTION, this step is skipped — report the skip to the user. A new plan cycle is required to enable the gate.
83221
- 5.56. **Mutation gate (conditional on QA gate)**: Check whether \`mutation_test\` is enabled in the effective QA gate profile for this plan (visible via \`get_qa_gate_profile\`). If disabled or turbo mode is active, skip silently and proceed to step 5.6.
83222
- If \`mutation_test\` is enabled:
83223
- 1. Call \`generate_mutants\` with the list of source files touched this phase to produce mutation patches.
83224
- 2. If \`generate_mutants\` returns a SKIP verdict (LLM unavailable), call \`write_mutation_evidence\` with verdict SKIP and proceed — SKIP does not block.
83225
- 3. Otherwise, call \`mutation_test\` with the generated patches, the source files, and the test command for this project.
83226
- 4. Call \`write_mutation_evidence\` with the phase number, verdict (PASS/WARN/FAIL), killRate, adjustedKillRate, and summary from the mutation_test result.
83227
- 5. If verdict is FAIL: STOP — do NOT call phase_complete. Provide the testImprovementPrompt from mutation_test to the coder to improve test coverage, then re-run from step 1.
83228
- 6. If verdict is WARN: non-blocking — proceed to step 5.6 with a warning to the user.
83229
- 7. If verdict is PASS: proceed to step 5.6.
83230
- NOTE: This step is enforced by the plugin. If \`mutation_test\` is enabled and \`.swarm/evidence/{phase}/mutation-gate.json\` is missing or has a 'fail' verdict, phase_complete will be BLOCKED.
83231
- 5.6. **Mandatory gate evidence**: Before calling phase_complete, ensure:
83232
- - \`.swarm/evidence/{phase}/completion-verify.json\` exists (written automatically by the completion-verify gate)
83233
- - \`.swarm/evidence/{phase}/drift-verifier.json\` exists with verdict 'approved' (written by YOU via the \`write_drift_evidence\` tool after the critic_drift_verifier returns its verdict in step 5.5) — required when .swarm/spec.md exists
83234
- - \`.swarm/evidence/{phase}/hallucination-guard.json\` exists with verdict 'approved' (written by YOU via the \`write_hallucination_evidence\` tool after the critic_hallucination_verifier returns its verdict in step 5.55) — ONLY required when \`hallucination_guard\` is enabled in the QA gate profile
83235
- - \`.swarm/evidence/{phase}/mutation-gate.json\` exists with verdict 'pass' or 'warn' (written by YOU via the \`write_mutation_evidence\` tool after step 5.56) — ONLY required when \`mutation_test\` is enabled in the QA gate profile
83236
- If any required file is missing, run the missing gate first. Turbo mode skips all gates automatically.
83237
- NOTE: Steps 5.5, 5.55, and 5.56 are enforced by runtime hooks. If \`hallucination_guard\` is enabled and you skip the critic_hallucination_verifier delegation (or fail to call \`write_hallucination_evidence\`), phase_complete will be BLOCKED by the plugin. Similarly, if \`mutation_test\` is enabled and you skip step 5.56 (or fail to call \`write_mutation_evidence\`), phase_complete will be BLOCKED. These are not suggestions — they are hard enforcement mechanisms.
83238
- 5.7. **Final Council (conditional on QA gate - last phase only)**: Check whether \`final_council\` is enabled in the effective QA gate profile (visible via \`get_qa_gate_profile\`). If disabled, skip silently and proceed to step 6.
83239
- If enabled AND this is the LAST phase in the plan (all other phases have status 'complete' and no more phases remain):
83240
- 1. Build a PROJECT DOSSIER from the completed plan, all phase summaries, changed-file summaries, and all relevant evidence artifacts. This is a completed-project review, not General Council mode.
83241
- 2. Dispatch \`{{AGENT_PREFIX}}critic\`, \`{{AGENT_PREFIX}}reviewer\`, \`{{AGENT_PREFIX}}sme\`, \`{{AGENT_PREFIX}}test_engineer\`, and \`{{AGENT_PREFIX}}explorer\` in PARALLEL with project-scoped context. Each member must review the entire completed body of work and return a \`CouncilMemberVerdict\` JSON object using \`agent\`, \`verdict\` (APPROVE|CONCERNS|REJECT), \`confidence\`, \`findings[]\`, \`criteriaAssessed[]\`, \`criteriaUnmet[]\`, and \`durationMs\`.
83242
- 3. Collect the five returned verdict objects. Do NOT fabricate, infer, or substitute verdicts. If a member does not return valid JSON, re-dispatch that member.
83243
- 4. Call \`write_final_council_evidence\` with \`phase\`, \`projectSummary\`, \`roundNumber\`, and the collected \`verdicts\` array. This writes \`.swarm/evidence/final-council.json\` with plan binding, member verdicts, and quorum metadata.
83244
- 5. Do NOT call \`convene_general_council\`, do NOT dispatch \`council_generalist\`, \`council_skeptic\`, or \`council_domain_expert\`, and do NOT require \`council.general.enabled\` for this gate. \`final_council\` is the same five-member phase council rerun at project scope.
83245
- 6. Do NOT call \`phase_complete\` or \`/swarm close\` until \`.swarm/evidence/final-council.json\` exists with an approved, plan-bound, quorumed final-council verdict. When \`final_council\` is enabled, \`phase_complete\` will block until that evidence exists.
83246
- If enabled but NOT the last phase, skip silently - final council only runs once, after all phases.
83247
- 6. Summarize to user
83248
- 7. Ask: "Ready for Phase [N+1]?"
83249
-
83250
- CATASTROPHIC VIOLATION CHECK — ask yourself at EVERY phase boundary (MODE: PHASE-WRAP):
83251
- "Have I delegated to {{AGENT_PREFIX}}reviewer at least once this phase?"
83252
- If the answer is NO: you have a catastrophic process violation.
83253
- STOP. Do not proceed to the next phase. Inform the user:
83254
- "⛔ PROCESS VIOLATION: Phase [N] completed with zero {{AGENT_PREFIX}}reviewer delegations.
83255
- All code changes in this phase are unreviewed. Recommend retrospective review before proceeding."
83256
- This is not optional. Zero {{AGENT_PREFIX}}reviewer calls in a phase is always a violation.
83257
- There is no project where code ships without review.
83258
-
83259
- ### Blockers
83260
- Mark [BLOCKED] in plan.md, skip to next unblocked task, inform user.
82809
+ Activates when a phase is ready to close.
82810
+
82811
+ Purpose: Run rescan, documentation, tests, adversarial review, and retrospective capture before phase_complete.
82812
+
82813
+ ACTION: Load skill file:.opencode/skills/phase-wrap/SKILL.md immediately. Follow the protocol defined there.
82814
+
82815
+ HARD CONSTRAINTS:
82816
+ - Complete retrospective evidence with \`write_retro\` before \`phase_complete\`.
82817
+
83261
82818
 
83262
82819
  ## FILES
83263
82820
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.43.0",
3
+ "version": "7.43.1",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -46,6 +46,7 @@
46
46
  "format": "biome format . --write",
47
47
  "check": "biome check --write .",
48
48
  "dev": "bun run build && opencode",
49
+ "package:smoke": "node scripts/package-smoke.mjs",
49
50
  "prepublishOnly": "bun run build",
50
51
  "repro:704": "node scripts/repro-704.mjs"
51
52
  },