opencode-swarm 7.58.0 → 7.59.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 (46) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +142 -0
  2. package/.opencode/skills/clarify/SKILL.md +103 -0
  3. package/.opencode/skills/clarify-spec/SKILL.md +58 -0
  4. package/.opencode/skills/codebase-review-swarm/INSTALL.md +75 -0
  5. package/.opencode/skills/codebase-review-swarm/README.md +44 -0
  6. package/.opencode/skills/codebase-review-swarm/SKILL.md +65 -0
  7. package/.opencode/skills/codebase-review-swarm/agents/openai.yaml +6 -0
  8. package/.opencode/skills/codebase-review-swarm/assets/jsonl-schemas.md +239 -0
  9. package/.opencode/skills/codebase-review-swarm/assets/review-report-template.md +244 -0
  10. package/.opencode/skills/codebase-review-swarm/references/compatibility-and-research-notes.md +25 -0
  11. package/.opencode/skills/codebase-review-swarm/references/full-v7-source-prompt.md +2373 -0
  12. package/.opencode/skills/codebase-review-swarm/references/review-protocol-v8.2.md +310 -0
  13. package/.opencode/skills/codebase-review-swarm/scripts/init-review-run.py +134 -0
  14. package/.opencode/skills/codebase-review-swarm/scripts/validate-skill-package.py +62 -0
  15. package/.opencode/skills/consult/SKILL.md +16 -0
  16. package/.opencode/skills/council/SKILL.md +147 -0
  17. package/.opencode/skills/critic-gate/SKILL.md +59 -0
  18. package/.opencode/skills/deep-dive/SKILL.md +142 -0
  19. package/.opencode/skills/design-docs/SKILL.md +81 -0
  20. package/.opencode/skills/discover/SKILL.md +20 -0
  21. package/.opencode/skills/execute/SKILL.md +191 -0
  22. package/.opencode/skills/issue-ingest/SKILL.md +64 -0
  23. package/.opencode/skills/phase-wrap/SKILL.md +123 -0
  24. package/.opencode/skills/plan/SKILL.md +293 -0
  25. package/.opencode/skills/pre-phase-briefing/SKILL.md +69 -0
  26. package/.opencode/skills/resume/SKILL.md +23 -0
  27. package/.opencode/skills/specify/SKILL.md +175 -0
  28. package/.opencode/skills/swarm-pr-feedback/SKILL.md +192 -0
  29. package/.opencode/skills/swarm-pr-review/SKILL.md +884 -0
  30. package/dist/agents/agent-output-schema.d.ts +1 -1
  31. package/dist/cli/index.js +1351 -1159
  32. package/dist/commands/command-dispatch.d.ts +1 -0
  33. package/dist/commands/index.d.ts +1 -0
  34. package/dist/commands/registry.d.ts +15 -14
  35. package/dist/config/bundled-skills.d.ts +25 -0
  36. package/dist/config/constants.d.ts +1 -1
  37. package/dist/config/schema.d.ts +42 -0
  38. package/dist/index.js +3517 -2673
  39. package/dist/memory/schema.d.ts +1 -1
  40. package/dist/tools/lean-turbo-run-phase.d.ts +2 -1
  41. package/dist/turbo/lean/index.d.ts +4 -1
  42. package/dist/turbo/lean/merge-back.d.ts +180 -0
  43. package/dist/turbo/lean/runner.d.ts +47 -1
  44. package/dist/turbo/lean/state.d.ts +10 -0
  45. package/dist/turbo/lean/worktree.d.ts +194 -0
  46. package/package.json +20 -1
@@ -26,6 +26,7 @@ export declare function executeSwarmCommand(args: {
26
26
  agents: Record<string, AgentDefinition>;
27
27
  sessionID: string;
28
28
  tokens: string[];
29
+ packageRoot?: string;
29
30
  includeWelcome?: boolean;
30
31
  buildHelpText?: () => string;
31
32
  policy?: SwarmCommandPolicy;
@@ -52,6 +52,7 @@ export declare function buildHelpText(): string;
52
52
  */
53
53
  export declare function createSwarmCommandHandler(directory: string, agents: Record<string, AgentDefinition>, options?: {
54
54
  getActiveAgentName?: (sessionID: string) => string | undefined;
55
+ packageRoot?: string;
55
56
  registeredAgents?: Record<string, {
56
57
  tools?: Record<string, boolean>;
57
58
  }>;
@@ -8,6 +8,7 @@ export type CommandContext = {
8
8
  args: string[];
9
9
  sessionID: string;
10
10
  agents: Record<string, AgentDefinition>;
11
+ packageRoot?: string;
11
12
  /**
12
13
  * Dispatch path identifier. Issue #890: forensic audit trail for
13
14
  * commands that need to distinguish "user typed /swarm <cmd>" (chat)
@@ -276,89 +277,89 @@ export declare const COMMAND_REGISTRY: {
276
277
  readonly category: "agent";
277
278
  };
278
279
  readonly clarify: {
279
- readonly handler: (ctx: CommandContext) => Promise<string>;
280
+ readonly handler: (ctx: CommandContext) => CommandResult;
280
281
  readonly description: "Clarify and refine an existing feature specification";
281
282
  readonly args: "[description-text]";
282
283
  readonly category: "agent";
283
284
  };
284
285
  readonly specify: {
285
- readonly handler: (ctx: CommandContext) => Promise<string>;
286
+ readonly handler: (ctx: CommandContext) => CommandResult;
286
287
  readonly description: "Generate or import a feature specification [description]";
287
288
  readonly args: "[description-text]";
288
289
  readonly category: "agent";
289
290
  };
290
291
  readonly brainstorm: {
291
- readonly handler: (ctx: CommandContext) => Promise<string>;
292
+ readonly handler: (ctx: CommandContext) => CommandResult;
292
293
  readonly description: "Enter architect MODE: BRAINSTORM — structured seven-phase planning workflow [topic]";
293
294
  readonly args: "[topic-text]";
294
295
  readonly details: "Triggers the architect to run the brainstorm workflow: CONTEXT SCAN, single-question DIALOGUE, APPROACHES, DESIGN SECTIONS, SPEC WRITE + SELF-REVIEW, QA GATE SELECTION, TRANSITION. Use for new plans where requirements need to be drawn out before writing spec.md / plan.md.";
295
296
  readonly category: "agent";
296
297
  };
297
298
  readonly council: {
298
- readonly handler: (ctx: CommandContext) => Promise<string>;
299
+ readonly handler: (ctx: CommandContext) => CommandResult;
299
300
  readonly description: "Enter architect MODE: COUNCIL — multi-model deliberation [question] [--preset <name>] [--spec-review]";
300
301
  readonly args: "<question> [--preset <name>] [--spec-review]";
301
302
  readonly details: string;
302
303
  readonly category: "agent";
303
304
  };
304
305
  readonly 'pr-review': {
305
- readonly handler: (ctx: CommandContext) => Promise<string>;
306
+ readonly handler: (ctx: CommandContext) => CommandResult;
306
307
  readonly description: "Launch deep PR review with multi-lane analysis [url] [--council]";
307
308
  readonly args: "<pr-url|owner/repo#N|N> [--council]";
308
309
  readonly details: "Launches a structured PR review: reconstructs PR intent via obligation extraction cascade, runs 6 parallel explorer lanes (correctness, security, dependencies, docs-intent-vs-actual, tests, performance-architecture), validates findings through independent reviewer confirmation, applies critic challenge to HIGH/CRITICAL findings, synthesizes structured report. --council variant fires adversarial multi-model review. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolves against origin remote).";
309
310
  readonly category: "agent";
310
311
  };
311
312
  readonly 'pr-feedback': {
312
- readonly handler: (ctx: CommandContext) => Promise<string>;
313
+ readonly handler: (ctx: CommandContext) => CommandResult;
313
314
  readonly description: "Ingest and close known PR feedback (review comments, CI failures, conflicts) [pr] [instructions]";
314
315
  readonly args: "[url|owner/repo#N|N] [instructions...]";
315
316
  readonly details: "Triggers MODE: PR_FEEDBACK — ingests existing pull-request feedback (review threads, requested changes, CI/check failures, merge conflicts, stale branch state, pasted notes), verifies every claim against source, clusters related problems, fixes confirmed items, validates the branch, and reports closure status for every ledger item. Distinct from /swarm pr-review, which discovers new findings. The PR reference is optional: with none, the architect builds the ledger from the current PR/branch; text after the reference is forwarded as extra instructions. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolved against origin).";
316
317
  readonly category: "agent";
317
318
  };
318
319
  readonly 'deep-dive': {
319
- readonly handler: (ctx: CommandContext) => Promise<string>;
320
+ readonly handler: (ctx: CommandContext) => CommandResult;
320
321
  readonly description: "Launch deep codebase audit with parallel explorer waves, dual reviewers, and critic challenge [scope]";
321
322
  readonly args: "<scope> [--profile standard|security|ux|architecture|full] [--max-explorers 1..8] [--json] [--skip-update] [--allow-dirty]";
322
323
  readonly details: "Runs a read-only deep audit of the specified scope using parallel explorer waves (8-file cap per mission, ~3500 line guardrail), always 2 parallel reviewers for verification, and sequential critic challenge on HIGH/CRITICAL findings. Profiles select explorer lanes: standard (5 lanes), security, ux, architecture, full (all 8 lanes). Emits a structured findings report without mutating source code.";
323
324
  readonly category: "agent";
324
325
  };
325
326
  readonly 'deep dive': {
326
- readonly handler: (ctx: CommandContext) => Promise<string>;
327
+ readonly handler: (ctx: CommandContext) => CommandResult;
327
328
  readonly description: "Alias for /swarm deep-dive — launch deep codebase audit";
328
329
  readonly args: "<scope> [--profile standard|security|ux|architecture|full] [--max-explorers 1..8] [--json] [--skip-update] [--allow-dirty]";
329
330
  readonly category: "agent";
330
331
  readonly aliasOf: "deep-dive";
331
332
  };
332
333
  readonly 'codebase-review': {
333
- readonly handler: (ctx: CommandContext) => Promise<string>;
334
+ readonly handler: (ctx: CommandContext) => CommandResult;
334
335
  readonly description: "Launch codebase-review-swarm for a quote-grounded full-repo or large-subsystem audit";
335
336
  readonly args: "[scope] [--mode phase0|complete|defect|security|correctness|testing|ui|performance|ai-slop|enhancements|custom] [--tracks <list>] [--continue <run-id>] [--json] [--skip-update] [--allow-dirty]";
336
- readonly details: "Runs the codebase-review-swarm workflow: Phase 0 inventory, selected-track depth planning, non-diluting review passes, coverage closure, reviewer validation, critic challenge, and .swarm/review-v8 artifacts. The command is side-effect free and emits a MODE signal; the architect workflow must not mutate source files.";
337
+ readonly details: "Runs the codebase-review-swarm workflow: Phase 0 inventory, selected-track depth planning, non-diluting review passes, coverage closure, reviewer validation, critic challenge, and .swarm/review-v8 artifacts. Materializes the bundled skill package if missing, then emits a MODE signal; the architect workflow must not mutate source files.";
337
338
  readonly category: "agent";
338
339
  };
339
340
  readonly 'codebase review': {
340
- readonly handler: (ctx: CommandContext) => Promise<string>;
341
+ readonly handler: (ctx: CommandContext) => CommandResult;
341
342
  readonly description: "Alias for /swarm codebase-review - launch codebase-review-swarm";
342
343
  readonly args: "[scope] [--mode phase0|complete|defect|security|correctness|testing|ui|performance|ai-slop|enhancements|custom] [--tracks <list>] [--continue <run-id>] [--json] [--skip-update] [--allow-dirty]";
343
344
  readonly category: "agent";
344
345
  readonly aliasOf: "codebase-review";
345
346
  };
346
347
  readonly 'design-docs': {
347
- readonly handler: (ctx: CommandContext) => Promise<string>;
348
+ readonly handler: (ctx: CommandContext) => CommandResult;
348
349
  readonly description: "Generate or sync language-agnostic design docs (domain, technical-spec, behavior-spec, reference/) for the project under build [description]";
349
350
  readonly args: "<description> [--out <dir>] [--lang <name>] [--update]";
350
351
  readonly details: "Triggers the architect to enter MODE: DESIGN_DOCS — delegates to the docs_design agent to author/sync docs/domain.md, docs/technical-spec.md, docs/behavior-spec.md, and docs/reference/* (plus reference/traceability.json and design-changelog.md). Normative docs are 100% language-agnostic; all framework-specific material is quarantined under reference/. --update syncs existing docs to current code/spec instead of generating fresh. Requires design_docs.enabled: true.";
351
352
  readonly category: "agent";
352
353
  };
353
354
  readonly 'design docs': {
354
- readonly handler: (ctx: CommandContext) => Promise<string>;
355
+ readonly handler: (ctx: CommandContext) => CommandResult;
355
356
  readonly description: "Alias for /swarm design-docs — generate or sync design docs";
356
357
  readonly args: "<description> [--out <dir>] [--lang <name>] [--update]";
357
358
  readonly category: "agent";
358
359
  readonly aliasOf: "design-docs";
359
360
  };
360
361
  readonly issue: {
361
- readonly handler: (ctx: CommandContext) => Promise<string>;
362
+ readonly handler: (ctx: CommandContext) => CommandResult;
362
363
  readonly description: "Ingest a GitHub issue into the swarm workflow [url] [--plan] [--trace] [--no-repro]";
363
364
  readonly args: "<issue-url|owner/repo#N|N> [--plan] [--trace] [--no-repro]";
364
365
  readonly details: "Triggers the architect to enter MODE: ISSUE_INGEST — ingests a GitHub issue, restructures it into a normalized intake note, localizes root cause through hypothesis-driven tracing, and outputs a resolution spec. --plan transitions to plan creation after spec generation. --trace runs the full fix-and-PR workflow (implies --plan). --no-repro skips the reproduction step. Supports full GitHub URL, owner/repo#N shorthand, or bare issue number (resolves against origin remote).";
@@ -0,0 +1,25 @@
1
+ export declare const BUNDLED_PROJECT_SKILLS: readonly ["brainstorm", "specify", "clarify-spec", "resume", "clarify", "discover", "consult", "pre-phase-briefing", "council", "deep-dive", "codebase-review-swarm", "design-docs", "swarm-pr-review", "swarm-pr-feedback", "issue-ingest", "plan", "critic-gate", "execute", "phase-wrap"];
2
+ interface CopyState {
3
+ files: number;
4
+ bytes: number;
5
+ }
6
+ interface BundledSkillFile {
7
+ relativePath: string;
8
+ }
9
+ declare function getSyncCacheKey(projectDirectory: string, packageRoot: string): string;
10
+ declare function collectBundledSkillFilesBounded(sourceDir: string, state: CopyState, relativeDir?: string): BundledSkillFile[];
11
+ /**
12
+ * Materialize missing built-in mode skills into the target project so architect
13
+ * MODE dispatch can load SKILL.md files in repositories that do not already
14
+ * vendor the latest opencode-swarm skill tree.
15
+ *
16
+ * This is intentionally missing-only and fail-open: custom project skills are
17
+ * never overwritten, and any filesystem error leaves command execution fail-open.
18
+ */
19
+ export declare function syncBundledProjectSkillsIfMissing(projectDirectory: string, packageRoot: string, quiet?: boolean): void;
20
+ export declare const _test_exports: {
21
+ collectBundledSkillFilesBounded: typeof collectBundledSkillFilesBounded;
22
+ getSyncCacheKey: typeof getSyncCacheKey;
23
+ resetBundledProjectSkillSyncCache: () => void;
24
+ };
25
+ export {};
@@ -74,7 +74,7 @@ export declare const FULL_AUTO_BANNER = "## \u26A1 FULL-AUTO MODE ACTIVE\n\nYou
74
74
  /**
75
75
  * Canonical default Lean Turbo configuration.
76
76
  *
77
- * This is the single source of truth for all 9 LeanTurboConfig fields.
77
+ * This is the single source of truth for all LeanTurboConfig fields.
78
78
  * Consumers MUST reference this constant instead of hardcoding their own
79
79
  * defaults — see v7.4.x config-drift fix (3 of 9 fields disagreed across
80
80
  * runner.ts, lean-turbo-plan-lanes.ts, lean-turbo-status.ts, and the
@@ -835,6 +835,12 @@ export declare const LeanTurboConfigSchema: z.ZodObject<{
835
835
  integrated_diff_required: z.ZodDefault<z.ZodBoolean>;
836
836
  allow_docs_only_without_reviewer: z.ZodDefault<z.ZodBoolean>;
837
837
  worktree_isolation: z.ZodDefault<z.ZodBoolean>;
838
+ merge_strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
839
+ merge: "merge";
840
+ rebase: "rebase";
841
+ "cherry-pick": "cherry-pick";
842
+ }>>>;
843
+ worktree_dir: z.ZodOptional<z.ZodString>;
838
844
  }, z.core.$strip>;
839
845
  export type LeanTurboConfig = z.infer<typeof LeanTurboConfigSchema>;
840
846
  export declare const StandardTurboConfigSchema: z.ZodObject<{
@@ -852,6 +858,12 @@ export declare const StandardTurboConfigSchema: z.ZodObject<{
852
858
  integrated_diff_required: z.ZodDefault<z.ZodBoolean>;
853
859
  allow_docs_only_without_reviewer: z.ZodDefault<z.ZodBoolean>;
854
860
  worktree_isolation: z.ZodDefault<z.ZodBoolean>;
861
+ merge_strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
862
+ merge: "merge";
863
+ rebase: "rebase";
864
+ "cherry-pick": "cherry-pick";
865
+ }>>>;
866
+ worktree_dir: z.ZodOptional<z.ZodString>;
855
867
  }, z.core.$strip>>;
856
868
  }, z.core.$strip>;
857
869
  export declare const LeanTurboStrategyConfigSchema: z.ZodObject<{
@@ -869,6 +881,12 @@ export declare const LeanTurboStrategyConfigSchema: z.ZodObject<{
869
881
  integrated_diff_required: z.ZodDefault<z.ZodBoolean>;
870
882
  allow_docs_only_without_reviewer: z.ZodDefault<z.ZodBoolean>;
871
883
  worktree_isolation: z.ZodDefault<z.ZodBoolean>;
884
+ merge_strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
885
+ merge: "merge";
886
+ rebase: "rebase";
887
+ "cherry-pick": "cherry-pick";
888
+ }>>>;
889
+ worktree_dir: z.ZodOptional<z.ZodString>;
872
890
  }, z.core.$strip>;
873
891
  }, z.core.$strip>;
874
892
  export declare const TurboConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -886,6 +904,12 @@ export declare const TurboConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
886
904
  integrated_diff_required: z.ZodDefault<z.ZodBoolean>;
887
905
  allow_docs_only_without_reviewer: z.ZodDefault<z.ZodBoolean>;
888
906
  worktree_isolation: z.ZodDefault<z.ZodBoolean>;
907
+ merge_strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
908
+ merge: "merge";
909
+ rebase: "rebase";
910
+ "cherry-pick": "cherry-pick";
911
+ }>>>;
912
+ worktree_dir: z.ZodOptional<z.ZodString>;
889
913
  }, z.core.$strip>>;
890
914
  }, z.core.$strip>, z.ZodObject<{
891
915
  strategy: z.ZodLiteral<"lean">;
@@ -902,6 +926,12 @@ export declare const TurboConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
902
926
  integrated_diff_required: z.ZodDefault<z.ZodBoolean>;
903
927
  allow_docs_only_without_reviewer: z.ZodDefault<z.ZodBoolean>;
904
928
  worktree_isolation: z.ZodDefault<z.ZodBoolean>;
929
+ merge_strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
930
+ merge: "merge";
931
+ rebase: "rebase";
932
+ "cherry-pick": "cherry-pick";
933
+ }>>>;
934
+ worktree_dir: z.ZodOptional<z.ZodString>;
905
935
  }, z.core.$strip>;
906
936
  }, z.core.$strip>], "strategy">;
907
937
  export type TurboConfig = z.infer<typeof TurboConfigSchema>;
@@ -1466,6 +1496,12 @@ export declare const PluginConfigSchema: z.ZodObject<{
1466
1496
  integrated_diff_required: z.ZodDefault<z.ZodBoolean>;
1467
1497
  allow_docs_only_without_reviewer: z.ZodDefault<z.ZodBoolean>;
1468
1498
  worktree_isolation: z.ZodDefault<z.ZodBoolean>;
1499
+ merge_strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1500
+ merge: "merge";
1501
+ rebase: "rebase";
1502
+ "cherry-pick": "cherry-pick";
1503
+ }>>>;
1504
+ worktree_dir: z.ZodOptional<z.ZodString>;
1469
1505
  }, z.core.$strip>>;
1470
1506
  }, z.core.$strip>, z.ZodObject<{
1471
1507
  strategy: z.ZodLiteral<"lean">;
@@ -1482,6 +1518,12 @@ export declare const PluginConfigSchema: z.ZodObject<{
1482
1518
  integrated_diff_required: z.ZodDefault<z.ZodBoolean>;
1483
1519
  allow_docs_only_without_reviewer: z.ZodDefault<z.ZodBoolean>;
1484
1520
  worktree_isolation: z.ZodDefault<z.ZodBoolean>;
1521
+ merge_strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1522
+ merge: "merge";
1523
+ rebase: "rebase";
1524
+ "cherry-pick": "cherry-pick";
1525
+ }>>>;
1526
+ worktree_dir: z.ZodOptional<z.ZodString>;
1485
1527
  }, z.core.$strip>;
1486
1528
  }, z.core.$strip>], "strategy">>;
1487
1529
  turbo_mode: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;