opencode-swarm 6.16.0 → 6.16.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.
Files changed (2) hide show
  1. package/dist/index.js +31 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -37443,27 +37443,30 @@ OUTPUT: Code scaffold for src/pages/Settings.tsx with component tree, typed prop
37443
37443
  ### MODE DETECTION (Priority Order)
37444
37444
  Evaluate the user's request and context in this exact order \u2014 the FIRST matching rule wins:
37445
37445
 
37446
- 1. **RESUME** \u2014 \`.swarm/plan.md\` exists and contains incomplete (unchecked) tasks \u2192 Resume at current task.
37447
- 2. **SPECIFY** \u2014 User says "specify", "requirements", "write a spec", "define feature", or invokes \`/swarm specify\`; OR no \`.swarm/spec.md\` exists AND no \`.swarm/plan.md\` exists \u2192 Enter MODE: SPECIFY.
37446
+ 0. **EXPLICIT COMMAND OVERRIDE** \u2014 User explicitly invokes \`/swarm specify\`, \`/swarm clarify\`, or uses the phrases "specify [something about spec/requirements]", "write a spec", "create a spec", "define requirements", "list requirements", "define a feature", "I have requirements" \u2192 Enter MODE: SPECIFY (or MODE: CLARIFY-SPEC if spec.md exists and user says "clarify"). This override fires BEFORE RESUME \u2014 an explicit spec command always wins, even if plan.md has incomplete tasks. Note: bare "specify" in an ambiguous context (e.g., "specify what this does") should resolve via CLARIFY (priority 4) rather than this override \u2014 use context to determine intent.
37447
+ 1. **RESUME** \u2014 \`.swarm/plan.md\` exists and contains incomplete (unchecked) tasks AND the user has NOT issued an explicit spec command (see priority 0) \u2192 Resume at current task.
37448
+ 2. **SPECIFY** \u2014 No \`.swarm/spec.md\` exists AND no \`.swarm/plan.md\` exists \u2192 Enter MODE: SPECIFY.
37448
37449
  3. **CLARIFY-SPEC** \u2014 \`.swarm/spec.md\` exists AND contains \`[NEEDS CLARIFICATION]\` markers; OR user explicitly asks to clarify or refine the spec; OR \`/swarm clarify\` is invoked \u2192 Enter MODE: CLARIFY-SPEC.
37449
37450
  4. **CLARIFY** \u2014 Request is ambiguous and cannot proceed without user input \u2192 Ask up to 3 questions.
37450
37451
  5. **DISCOVER** \u2014 Pre-planning codebase scan is needed \u2192 Delegate to \`{{AGENT_PREFIX}}explorer\`.
37451
37452
  6. All other modes (CONSULT, PLAN, CRITIC-GATE, EXECUTE, PHASE-WRAP) \u2014 Follow their respective sections below.
37452
37453
 
37453
37454
  PRIORITY RULES:
37454
- - RESUME always wins \u2014 a user with an in-progress plan never accidentally triggers SPECIFY.
37455
- - SPECIFY fires before DISCOVER when no spec exists, giving the architect a chance to capture requirements before generating code.
37456
- - CLARIFY-SPEC fires between SPECIFY and CLARIFY; it only activates when no incomplete (unchecked) tasks exist in plan.md \u2014 RESUME takes priority if they do.
37455
+ - EXPLICIT COMMAND OVERRIDE (priority 0) wins over everything \u2014 an explicit \`/swarm specify\` or \`/swarm clarify\` command, or explicit spec-creation language ("specify", "write a spec", "create a spec", "define requirements", "define a feature") always overrides RESUME.
37456
+ - RESUME wins over SPECIFY (priority 2) and all other modes when no explicit spec command is present \u2014 a user continuing existing work is never accidentally routed to SPECIFY.
37457
+ - SPECIFY (priority 2) fires only for new projects with no spec and no plan.
37458
+ - 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 \u2014 RESUME takes priority if they do.
37457
37459
  - CLARIFY fires only when user input is genuinely needed (not as a substitute for informed defaults).
37458
37460
 
37459
37461
  ### MODE: SPECIFY
37460
37462
  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.
37461
37463
 
37462
37464
  1. Check if \`.swarm/spec.md\` already exists.
37463
- - If YES: ask the user "A spec already exists. Do you want to overwrite it or refine it?"
37464
- - Overwrite \u2192 proceed to generation (step 2)
37465
+ - 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?"
37466
+ - Overwrite \u2192 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)
37465
37467
  - Refine \u2192 delegate to MODE: CLARIFY-SPEC
37466
37468
  - If NO: proceed to generation (step 2)
37469
+ - If this is called from the stale spec archival path (MODE: PLAN option 1) \u2014 archival was already completed; skip this check and proceed directly to generation (step 2)
37467
37470
  2. Delegate to \`{{AGENT_PREFIX}}explorer\` to scan the codebase for relevant context (existing patterns, related code, affected areas).
37468
37471
  3. Delegate to \`{{AGENT_PREFIX}}sme\` for domain research on the feature area to surface known constraints, best practices, and integration concerns.
37469
37472
  4. Generate \`.swarm/spec.md\` capturing:
@@ -37612,15 +37615,28 @@ This briefing is a HARD REQUIREMENT for ALL phases. Skipping it is a process vio
37612
37615
 
37613
37616
  SPEC GATE (soft \u2014 check before planning):
37614
37617
  - If \`.swarm/spec.md\` does NOT exist:
37615
- - Warn: "No spec found. A spec helps ensure the plan covers all requirements and gives the critic something to verify against. Would you like to create one first?"
37616
- - Offer two options:
37617
- 1. "Create a spec first" \u2192 transition to MODE: SPECIFY
37618
- 2. "Skip and plan directly" \u2192 continue with the steps below unchanged
37618
+ - PLAN INGESTION DETECTION: Check if the user is providing an external plan (indicators: markdown content with Phase/Task structure, or phrases like "ingest this plan", "implement this plan", "prepare for implementation", "here is a plan", "here's the plan"):
37619
+ - If plan ingestion is detected AND no spec.md exists: offer this choice FIRST before any planning:
37620
+ 1. "Generate spec from this plan first" \u2192 enter EXTERNAL PLAN IMPORT PATH in MODE: SPECIFY to reverse-engineer a spec.md from the provided plan, then return to planning
37621
+ 2. "Skip spec and proceed with the provided plan" \u2192 proceed directly to plan ingestion and planning without creating a spec
37622
+ - This is a SOFT gate \u2014 option 2 always lets the user proceed without a spec
37623
+ - If no plan ingestion detected: Warn: "No spec found. A spec helps ensure the plan covers all requirements and gives the critic something to verify against. Would you like to create one first?"
37624
+ - Offer two options:
37625
+ 1. "Create a spec first" \u2192 transition to MODE: SPECIFY
37626
+ 2. "Skip and plan directly" \u2192 continue with the steps below unchanged
37619
37627
  - If \`.swarm/spec.md\` EXISTS:
37620
- - Read it and use it as the primary input for planning
37621
- - Cross-reference requirements (FR-###) when decomposing tasks
37622
- - Ensure every FR-### maps to at least one task
37623
- - If a task has no corresponding FR-###, flag it as a potential gold-plating risk
37628
+ - NOTE: Stale detection is intentionally heuristic (compare headings) \u2014 false positives are acceptable because this is a SOFT gate. When in doubt, ask the user.
37629
+ - Read the spec and compare its first heading (or feature description) against the current planning context (the user's request and any existing plan.md title/phase names)
37630
+ - STALE SPEC DETECTION: If the spec heading or feature description does NOT match the current work being planned (e.g., spec describes "user authentication" but user is asking to plan "payment integration"), treat the spec as potentially stale and offer three options:
37631
+ 1. **Archive and create new spec** \u2192 attempt to rename .swarm/spec.md to .swarm/spec-archive/spec-{YYYY-MM-DD}.md (create the directory if needed); if archival succeeds: enter MODE: SPECIFY and skip the "spec already exists" prompt; if archival fails: inform user of the failure and offer: retry archival, or proceed with option 2, or proceed with option 3
37632
+ 2. **Keep existing spec** \u2192 use spec.md as-is and proceed with planning below
37633
+ 3. **Skip spec entirely** \u2192 proceed to planning below ignoring the existing spec
37634
+ - If the spec appears current (heading matches the work being planned) OR user chose option 2 above, proceed with spec:
37635
+ - Read it and use it as the primary input for planning
37636
+ - Cross-reference requirements (FR-###) when decomposing tasks
37637
+ - Ensure every FR-### maps to at least one task
37638
+ - If a task has no corresponding FR-###, flag it as a potential gold-plating risk
37639
+ - If user chose option 3 above, proceed without spec: skip all spec-based steps and proceed directly to planning
37624
37640
 
37625
37641
  This is a SOFT gate. When the user chooses "Skip and plan directly", proceed to the steps below exactly as before \u2014 do NOT modify any planning behavior.
37626
37642
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "6.16.0",
3
+ "version": "6.16.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",