opencode-swarm-plugin 0.56.0 → 0.57.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 (186) hide show
  1. package/README.md +21 -0
  2. package/claude-plugin/.claude-plugin/plugin.json +1 -4
  3. package/claude-plugin/agents/background-worker.md +1 -0
  4. package/claude-plugin/agents/coordinator.md +1 -0
  5. package/claude-plugin/agents/worker.md +1 -0
  6. package/claude-plugin/bin/swarm-mcp-server.ts +47 -8
  7. package/claude-plugin/commands/hive.md +1 -1
  8. package/claude-plugin/commands/swarm.md +5 -1
  9. package/claude-plugin/dist/agent-mail.d.ts +480 -0
  10. package/claude-plugin/dist/agent-mail.d.ts.map +1 -0
  11. package/claude-plugin/dist/anti-patterns.d.ts +257 -0
  12. package/claude-plugin/dist/anti-patterns.d.ts.map +1 -0
  13. package/claude-plugin/dist/bin/swarm.js +373128 -0
  14. package/claude-plugin/dist/cass-tools.d.ts +74 -0
  15. package/claude-plugin/dist/cass-tools.d.ts.map +1 -0
  16. package/claude-plugin/dist/claude-plugin/claude-plugin-assets.d.ts +10 -0
  17. package/claude-plugin/dist/claude-plugin/claude-plugin-assets.d.ts.map +1 -0
  18. package/claude-plugin/dist/compaction-hook.d.ts +178 -0
  19. package/claude-plugin/dist/compaction-hook.d.ts.map +1 -0
  20. package/claude-plugin/dist/compaction-observability.d.ts +173 -0
  21. package/claude-plugin/dist/compaction-observability.d.ts.map +1 -0
  22. package/claude-plugin/dist/compaction-prompt-scoring.d.ts +125 -0
  23. package/claude-plugin/dist/compaction-prompt-scoring.d.ts.map +1 -0
  24. package/claude-plugin/dist/compaction-prompt-scoring.js +139 -0
  25. package/claude-plugin/dist/contributor-tools.d.ts +42 -0
  26. package/claude-plugin/dist/contributor-tools.d.ts.map +1 -0
  27. package/claude-plugin/dist/coordinator-guard.d.ts +79 -0
  28. package/claude-plugin/dist/coordinator-guard.d.ts.map +1 -0
  29. package/claude-plugin/dist/dashboard.d.ts +82 -0
  30. package/claude-plugin/dist/dashboard.d.ts.map +1 -0
  31. package/claude-plugin/dist/decision-trace-integration.d.ts +204 -0
  32. package/claude-plugin/dist/decision-trace-integration.d.ts.map +1 -0
  33. package/claude-plugin/dist/error-enrichment.d.ts +49 -0
  34. package/claude-plugin/dist/error-enrichment.d.ts.map +1 -0
  35. package/claude-plugin/dist/eval-capture.d.ts +494 -0
  36. package/claude-plugin/dist/eval-capture.d.ts.map +1 -0
  37. package/claude-plugin/dist/eval-capture.js +12844 -0
  38. package/claude-plugin/dist/eval-gates.d.ts +84 -0
  39. package/claude-plugin/dist/eval-gates.d.ts.map +1 -0
  40. package/claude-plugin/dist/eval-history.d.ts +117 -0
  41. package/claude-plugin/dist/eval-history.d.ts.map +1 -0
  42. package/claude-plugin/dist/eval-learning.d.ts +216 -0
  43. package/claude-plugin/dist/eval-learning.d.ts.map +1 -0
  44. package/claude-plugin/dist/eval-runner.d.ts +134 -0
  45. package/claude-plugin/dist/eval-runner.d.ts.map +1 -0
  46. package/claude-plugin/dist/examples/plugin-wrapper-template.ts +3341 -0
  47. package/claude-plugin/dist/export-tools.d.ts +76 -0
  48. package/claude-plugin/dist/export-tools.d.ts.map +1 -0
  49. package/claude-plugin/dist/hive.d.ts +949 -0
  50. package/claude-plugin/dist/hive.d.ts.map +1 -0
  51. package/claude-plugin/dist/hive.js +15009 -0
  52. package/claude-plugin/dist/hivemind-tools.d.ts +479 -0
  53. package/claude-plugin/dist/hivemind-tools.d.ts.map +1 -0
  54. package/claude-plugin/dist/hooks/atomic-write.d.ts +21 -0
  55. package/claude-plugin/dist/hooks/atomic-write.d.ts.map +1 -0
  56. package/claude-plugin/dist/hooks/constants.d.ts +28 -0
  57. package/claude-plugin/dist/hooks/constants.d.ts.map +1 -0
  58. package/claude-plugin/dist/hooks/index.d.ts +16 -0
  59. package/claude-plugin/dist/hooks/index.d.ts.map +1 -0
  60. package/claude-plugin/dist/hooks/session-start.d.ts +30 -0
  61. package/claude-plugin/dist/hooks/session-start.d.ts.map +1 -0
  62. package/claude-plugin/dist/hooks/tool-complete.d.ts +54 -0
  63. package/claude-plugin/dist/hooks/tool-complete.d.ts.map +1 -0
  64. package/claude-plugin/dist/index.d.ts +2017 -0
  65. package/claude-plugin/dist/index.d.ts.map +1 -0
  66. package/claude-plugin/dist/index.js +73453 -0
  67. package/claude-plugin/dist/learning.d.ts +700 -0
  68. package/claude-plugin/dist/learning.d.ts.map +1 -0
  69. package/claude-plugin/dist/logger.d.ts +38 -0
  70. package/claude-plugin/dist/logger.d.ts.map +1 -0
  71. package/claude-plugin/dist/mandate-promotion.d.ts +93 -0
  72. package/claude-plugin/dist/mandate-promotion.d.ts.map +1 -0
  73. package/claude-plugin/dist/mandate-storage.d.ts +209 -0
  74. package/claude-plugin/dist/mandate-storage.d.ts.map +1 -0
  75. package/claude-plugin/dist/mandates.d.ts +230 -0
  76. package/claude-plugin/dist/mandates.d.ts.map +1 -0
  77. package/claude-plugin/dist/memory-tools.d.ts +281 -0
  78. package/claude-plugin/dist/memory-tools.d.ts.map +1 -0
  79. package/claude-plugin/dist/memory.d.ts +164 -0
  80. package/claude-plugin/dist/memory.d.ts.map +1 -0
  81. package/claude-plugin/dist/model-selection.d.ts +37 -0
  82. package/claude-plugin/dist/model-selection.d.ts.map +1 -0
  83. package/claude-plugin/dist/observability-health.d.ts +87 -0
  84. package/claude-plugin/dist/observability-health.d.ts.map +1 -0
  85. package/claude-plugin/dist/observability-tools.d.ts +184 -0
  86. package/claude-plugin/dist/observability-tools.d.ts.map +1 -0
  87. package/claude-plugin/dist/output-guardrails.d.ts +125 -0
  88. package/claude-plugin/dist/output-guardrails.d.ts.map +1 -0
  89. package/claude-plugin/dist/pattern-maturity.d.ts +246 -0
  90. package/claude-plugin/dist/pattern-maturity.d.ts.map +1 -0
  91. package/claude-plugin/dist/planning-guardrails.d.ts +183 -0
  92. package/claude-plugin/dist/planning-guardrails.d.ts.map +1 -0
  93. package/claude-plugin/dist/plugin.d.ts +22 -0
  94. package/claude-plugin/dist/plugin.d.ts.map +1 -0
  95. package/claude-plugin/dist/plugin.js +72295 -0
  96. package/claude-plugin/dist/post-compaction-tracker.d.ts +133 -0
  97. package/claude-plugin/dist/post-compaction-tracker.d.ts.map +1 -0
  98. package/claude-plugin/dist/query-tools.d.ts +90 -0
  99. package/claude-plugin/dist/query-tools.d.ts.map +1 -0
  100. package/claude-plugin/dist/rate-limiter.d.ts +218 -0
  101. package/claude-plugin/dist/rate-limiter.d.ts.map +1 -0
  102. package/claude-plugin/dist/regression-detection.d.ts +58 -0
  103. package/claude-plugin/dist/regression-detection.d.ts.map +1 -0
  104. package/claude-plugin/dist/replay-tools.d.ts +28 -0
  105. package/claude-plugin/dist/replay-tools.d.ts.map +1 -0
  106. package/claude-plugin/dist/repo-crawl.d.ts +146 -0
  107. package/claude-plugin/dist/repo-crawl.d.ts.map +1 -0
  108. package/claude-plugin/dist/schemas/cell-events.d.ts +1352 -0
  109. package/claude-plugin/dist/schemas/cell-events.d.ts.map +1 -0
  110. package/claude-plugin/dist/schemas/cell.d.ts +413 -0
  111. package/claude-plugin/dist/schemas/cell.d.ts.map +1 -0
  112. package/claude-plugin/dist/schemas/evaluation.d.ts +161 -0
  113. package/claude-plugin/dist/schemas/evaluation.d.ts.map +1 -0
  114. package/claude-plugin/dist/schemas/index.d.ts +46 -0
  115. package/claude-plugin/dist/schemas/index.d.ts.map +1 -0
  116. package/claude-plugin/dist/schemas/mandate.d.ts +336 -0
  117. package/claude-plugin/dist/schemas/mandate.d.ts.map +1 -0
  118. package/claude-plugin/dist/schemas/swarm-context.d.ts +131 -0
  119. package/claude-plugin/dist/schemas/swarm-context.d.ts.map +1 -0
  120. package/claude-plugin/dist/schemas/task.d.ts +189 -0
  121. package/claude-plugin/dist/schemas/task.d.ts.map +1 -0
  122. package/claude-plugin/dist/schemas/worker-handoff.d.ts +78 -0
  123. package/claude-plugin/dist/schemas/worker-handoff.d.ts.map +1 -0
  124. package/claude-plugin/dist/sessions/agent-discovery.d.ts +59 -0
  125. package/claude-plugin/dist/sessions/agent-discovery.d.ts.map +1 -0
  126. package/claude-plugin/dist/sessions/index.d.ts +10 -0
  127. package/claude-plugin/dist/sessions/index.d.ts.map +1 -0
  128. package/claude-plugin/dist/skills.d.ts +490 -0
  129. package/claude-plugin/dist/skills.d.ts.map +1 -0
  130. package/claude-plugin/dist/storage.d.ts +260 -0
  131. package/claude-plugin/dist/storage.d.ts.map +1 -0
  132. package/claude-plugin/dist/structured.d.ts +206 -0
  133. package/claude-plugin/dist/structured.d.ts.map +1 -0
  134. package/claude-plugin/dist/swarm-adversarial-review.d.ts +104 -0
  135. package/claude-plugin/dist/swarm-adversarial-review.d.ts.map +1 -0
  136. package/claude-plugin/dist/swarm-decompose.d.ts +297 -0
  137. package/claude-plugin/dist/swarm-decompose.d.ts.map +1 -0
  138. package/claude-plugin/dist/swarm-insights.d.ts +390 -0
  139. package/claude-plugin/dist/swarm-insights.d.ts.map +1 -0
  140. package/claude-plugin/dist/swarm-mail.d.ts +274 -0
  141. package/claude-plugin/dist/swarm-mail.d.ts.map +1 -0
  142. package/claude-plugin/dist/swarm-orchestrate.d.ts +924 -0
  143. package/claude-plugin/dist/swarm-orchestrate.d.ts.map +1 -0
  144. package/claude-plugin/dist/swarm-prompts.d.ts +467 -0
  145. package/claude-plugin/dist/swarm-prompts.d.ts.map +1 -0
  146. package/claude-plugin/dist/swarm-prompts.js +45283 -0
  147. package/claude-plugin/dist/swarm-research.d.ts +125 -0
  148. package/claude-plugin/dist/swarm-research.d.ts.map +1 -0
  149. package/claude-plugin/dist/swarm-review.d.ts +214 -0
  150. package/claude-plugin/dist/swarm-review.d.ts.map +1 -0
  151. package/claude-plugin/dist/swarm-signature.d.ts +106 -0
  152. package/claude-plugin/dist/swarm-signature.d.ts.map +1 -0
  153. package/claude-plugin/dist/swarm-strategies.d.ts +113 -0
  154. package/claude-plugin/dist/swarm-strategies.d.ts.map +1 -0
  155. package/claude-plugin/dist/swarm-validation.d.ts +127 -0
  156. package/claude-plugin/dist/swarm-validation.d.ts.map +1 -0
  157. package/claude-plugin/dist/swarm-worktree.d.ts +185 -0
  158. package/claude-plugin/dist/swarm-worktree.d.ts.map +1 -0
  159. package/claude-plugin/dist/swarm.d.ts +590 -0
  160. package/claude-plugin/dist/swarm.d.ts.map +1 -0
  161. package/claude-plugin/dist/tool-availability.d.ts +91 -0
  162. package/claude-plugin/dist/tool-availability.d.ts.map +1 -0
  163. package/claude-plugin/dist/utils/tree-renderer.d.ts +61 -0
  164. package/claude-plugin/dist/utils/tree-renderer.d.ts.map +1 -0
  165. package/claude-plugin/dist/validators/index.d.ts +7 -0
  166. package/claude-plugin/dist/validators/index.d.ts.map +1 -0
  167. package/claude-plugin/dist/validators/schema-validator.d.ts +58 -0
  168. package/claude-plugin/dist/validators/schema-validator.d.ts.map +1 -0
  169. package/claude-plugin/skills/always-on-guidance/SKILL.md +44 -0
  170. package/dist/agent-mail.d.ts +4 -4
  171. package/dist/agent-mail.d.ts.map +1 -1
  172. package/dist/bin/swarm.js +477 -22
  173. package/dist/claude-plugin/claude-plugin-assets.d.ts +10 -0
  174. package/dist/claude-plugin/claude-plugin-assets.d.ts.map +1 -0
  175. package/dist/compaction-hook.d.ts +1 -1
  176. package/dist/compaction-hook.d.ts.map +1 -1
  177. package/dist/index.js +375 -265
  178. package/dist/plugin.js +374 -264
  179. package/dist/skills.d.ts +15 -0
  180. package/dist/skills.d.ts.map +1 -1
  181. package/dist/swarm-mail.d.ts.map +1 -1
  182. package/dist/swarm-prompts.d.ts +4 -2
  183. package/dist/swarm-prompts.d.ts.map +1 -1
  184. package/dist/swarm-prompts.js +84 -7
  185. package/global-skills/swarm-coordination/SKILL.md +21 -20
  186. package/package.json +2 -1
@@ -0,0 +1,78 @@
1
+ /**
2
+ * WorkerHandoff schemas - structured contracts replacing prose instructions
3
+ *
4
+ * Replaces the 400-line SUBTASK_PROMPT_V2 with machine-readable contracts.
5
+ * Workers receive typed handoffs with explicit files, criteria, and escalation paths.
6
+ */
7
+ import { z } from "zod";
8
+ /**
9
+ * Contract section - the binding agreement between coordinator and worker
10
+ *
11
+ * Defines:
12
+ * - What task to complete (task_id)
13
+ * - What files to modify (files_owned) vs read (files_readonly)
14
+ * - What's already done (dependencies_completed)
15
+ * - How to know you're done (success_criteria)
16
+ */
17
+ export declare const WorkerHandoffContractSchema: z.ZodObject<{
18
+ task_id: z.ZodString;
19
+ files_owned: z.ZodDefault<z.ZodArray<z.ZodString>>;
20
+ files_readonly: z.ZodDefault<z.ZodArray<z.ZodString>>;
21
+ dependencies_completed: z.ZodDefault<z.ZodArray<z.ZodString>>;
22
+ success_criteria: z.ZodArray<z.ZodString>;
23
+ }, z.core.$strip>;
24
+ export type WorkerHandoffContract = z.infer<typeof WorkerHandoffContractSchema>;
25
+ /**
26
+ * Context section - the narrative explaining the "why"
27
+ *
28
+ * Provides:
29
+ * - Big picture (epic_summary)
30
+ * - This worker's specific role
31
+ * - What's already been done
32
+ * - What comes after
33
+ */
34
+ export declare const WorkerHandoffContextSchema: z.ZodObject<{
35
+ epic_summary: z.ZodString;
36
+ your_role: z.ZodString;
37
+ what_others_did: z.ZodString;
38
+ what_comes_next: z.ZodString;
39
+ }, z.core.$strip>;
40
+ export type WorkerHandoffContext = z.infer<typeof WorkerHandoffContextSchema>;
41
+ /**
42
+ * Escalation section - what to do when things go wrong
43
+ *
44
+ * Defines:
45
+ * - How to report blockers
46
+ * - Protocol for scope changes
47
+ */
48
+ export declare const WorkerHandoffEscalationSchema: z.ZodObject<{
49
+ blocked_contact: z.ZodString;
50
+ scope_change_protocol: z.ZodString;
51
+ }, z.core.$strip>;
52
+ export type WorkerHandoffEscalation = z.infer<typeof WorkerHandoffEscalationSchema>;
53
+ /**
54
+ * Complete WorkerHandoff - combines all three sections
55
+ *
56
+ * This is the full structured contract that replaces prose instructions.
57
+ */
58
+ export declare const WorkerHandoffSchema: z.ZodObject<{
59
+ contract: z.ZodObject<{
60
+ task_id: z.ZodString;
61
+ files_owned: z.ZodDefault<z.ZodArray<z.ZodString>>;
62
+ files_readonly: z.ZodDefault<z.ZodArray<z.ZodString>>;
63
+ dependencies_completed: z.ZodDefault<z.ZodArray<z.ZodString>>;
64
+ success_criteria: z.ZodArray<z.ZodString>;
65
+ }, z.core.$strip>;
66
+ context: z.ZodObject<{
67
+ epic_summary: z.ZodString;
68
+ your_role: z.ZodString;
69
+ what_others_did: z.ZodString;
70
+ what_comes_next: z.ZodString;
71
+ }, z.core.$strip>;
72
+ escalation: z.ZodObject<{
73
+ blocked_contact: z.ZodString;
74
+ scope_change_protocol: z.ZodString;
75
+ }, z.core.$strip>;
76
+ }, z.core.$strip>;
77
+ export type WorkerHandoff = z.infer<typeof WorkerHandoffSchema>;
78
+ //# sourceMappingURL=worker-handoff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker-handoff.d.ts","sourceRoot":"","sources":["../../src/schemas/worker-handoff.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B;;;;;;iBAwCtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B;;;;;iBAwBrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B;;;iBAYxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;iBAI9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Agent Discovery Module
3
+ *
4
+ * Maps file paths to agent types using pattern matching.
5
+ * Supports cross-platform paths (Unix and Windows).
6
+ *
7
+ * @module sessions/agent-discovery
8
+ */
9
+ /**
10
+ * Agent type identifier
11
+ */
12
+ export type AgentType = "opencode-swarm" | "cursor" | "opencode" | "claude" | "aider";
13
+ /**
14
+ * Configuration for custom agent patterns
15
+ */
16
+ interface AgentPatternConfig {
17
+ /** Pattern string (will be converted to RegExp) */
18
+ pattern: string;
19
+ /** Agent type identifier */
20
+ agentType: AgentType;
21
+ }
22
+ /**
23
+ * Load custom agent patterns from config
24
+ *
25
+ * @param patterns - Array of custom pattern configurations
26
+ * @returns Number of patterns loaded
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * loadAgentPatterns([
31
+ * { pattern: "\\.codex[/\\\\]", agentType: "codex" },
32
+ * { pattern: "\\.gemini[/\\\\]", agentType: "gemini" }
33
+ * ]);
34
+ * ```
35
+ */
36
+ export declare function loadAgentPatterns(patterns: AgentPatternConfig[]): number;
37
+ /**
38
+ * Reset agent patterns to defaults
39
+ * Useful for testing
40
+ */
41
+ export declare function resetAgentPatterns(): void;
42
+ /**
43
+ * Detect agent type from file path
44
+ *
45
+ * @param filePath - Absolute or relative file path (Unix or Windows)
46
+ * @returns Agent type identifier, or null if unknown
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * detectAgentType("/home/user/.config/swarm-tools/sessions/ses_123.jsonl")
51
+ * // => "opencode-swarm"
52
+ *
53
+ * detectAgentType("/tmp/random.jsonl")
54
+ * // => null
55
+ * ```
56
+ */
57
+ export declare function detectAgentType(filePath: string): AgentType | null;
58
+ export {};
59
+ //# sourceMappingURL=agent-discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-discovery.d.ts","sourceRoot":"","sources":["../../src/sessions/agent-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,gBAAgB,GAChB,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,OAAO,CAAC;AA0BZ;;GAEG;AACH,UAAU,kBAAkB;IAC1B,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,SAAS,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,MAAM,CAMxE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAQzC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAOlE"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Session Indexing Module
3
+ *
4
+ * Provides agent session discovery and indexing capabilities.
5
+ * Part of the CASS Inhousing initiative (ADR-010).
6
+ *
7
+ * @module sessions
8
+ */
9
+ export { detectAgentType, loadAgentPatterns, resetAgentPatterns, type AgentType, } from "./agent-discovery";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sessions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,SAAS,GACf,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,490 @@
1
+ /**
2
+ * Skills Module for OpenCode
3
+ *
4
+ * Implements Anthropic's Agent Skills specification for OpenCode.
5
+ * Skills are markdown files with YAML frontmatter that provide
6
+ * domain-specific instructions the model can activate when relevant.
7
+ *
8
+ * Discovery locations (in priority order):
9
+ * 1. {projectDir}/.opencode/skills/
10
+ * 2. {projectDir}/.claude/skills/ (compatibility)
11
+ * 3. {projectDir}/skills/ (simple projects)
12
+ *
13
+ * Skill format:
14
+ * ```markdown
15
+ * ---
16
+ * name: my-skill
17
+ * description: What it does. Use when X.
18
+ * ---
19
+ *
20
+ * # Skill Instructions
21
+ * ...
22
+ * ```
23
+ *
24
+ * @module skills
25
+ */
26
+ /**
27
+ * Skill metadata from YAML frontmatter
28
+ */
29
+ export interface SkillMetadata {
30
+ /** Unique skill identifier (lowercase, hyphens) */
31
+ name: string;
32
+ /** Description of what the skill does and when to use it */
33
+ description: string;
34
+ /** Optional list of tools this skill works with */
35
+ tools?: string[];
36
+ /** Optional tags for categorization */
37
+ tags?: string[];
38
+ }
39
+ /**
40
+ * Full skill definition including content
41
+ */
42
+ export interface Skill {
43
+ /** Parsed frontmatter metadata */
44
+ metadata: SkillMetadata;
45
+ /** Raw markdown body (instructions) */
46
+ body: string;
47
+ /** Absolute path to the SKILL.md file */
48
+ path: string;
49
+ /** Directory containing the skill */
50
+ directory: string;
51
+ /** Whether this skill has executable scripts */
52
+ hasScripts: boolean;
53
+ /** List of script files in the skill directory */
54
+ scripts: string[];
55
+ }
56
+ /**
57
+ * Lightweight skill reference for listing
58
+ */
59
+ export interface SkillRef {
60
+ name: string;
61
+ description: string;
62
+ path: string;
63
+ hasScripts: boolean;
64
+ }
65
+ /**
66
+ * Role types for always-on guidance injection.
67
+ */
68
+ export type AlwaysOnGuidanceRole = "coordinator" | "worker";
69
+ /**
70
+ * Options for always-on guidance skill rendering.
71
+ */
72
+ export interface AlwaysOnGuidanceOptions {
73
+ role: AlwaysOnGuidanceRole;
74
+ model?: string;
75
+ }
76
+ /**
77
+ * Get the always-on guidance skill content for a role and model.
78
+ */
79
+ export declare function getAlwaysOnGuidanceSkill(options: AlwaysOnGuidanceOptions): string;
80
+ /**
81
+ * Set the project directory for skill discovery
82
+ */
83
+ export declare function setSkillsProjectDirectory(dir: string): void;
84
+ /**
85
+ * Parse YAML frontmatter from markdown content using gray-matter
86
+ *
87
+ * Handles the common frontmatter format:
88
+ * ```
89
+ * ---
90
+ * key: value
91
+ * ---
92
+ * body content
93
+ * ```
94
+ */
95
+ export declare function parseFrontmatter(content: string): {
96
+ metadata: Record<string, unknown>;
97
+ body: string;
98
+ };
99
+ /**
100
+ * Discover all skills in the project and global directories
101
+ *
102
+ * Priority order (first match wins):
103
+ * 1. Project: .opencode/skills/
104
+ * 2. Project: .claude/skills/
105
+ * 3. Project: skills/
106
+ * 4. Global: ~/.config/opencode/skills/
107
+ * 5. Global: ~/.claude/skills/
108
+ */
109
+ export declare function discoverSkills(projectDir?: string): Promise<Map<string, Skill>>;
110
+ /**
111
+ * Get a single skill by name
112
+ */
113
+ export declare function getSkill(name: string): Promise<Skill | null>;
114
+ /**
115
+ * List all available skills (lightweight refs only)
116
+ */
117
+ export declare function listSkills(): Promise<SkillRef[]>;
118
+ /**
119
+ * Invalidate the skills cache (call when skills may have changed)
120
+ */
121
+ export declare function invalidateSkillsCache(): void;
122
+ /**
123
+ * List available skills with metadata
124
+ *
125
+ * Returns lightweight skill references for the model to evaluate
126
+ * which skills are relevant to the current task.
127
+ */
128
+ export declare const skills_list: {
129
+ description: string;
130
+ args: {
131
+ tag: import("zod").ZodOptional<import("zod").ZodString>;
132
+ };
133
+ execute(args: {
134
+ tag?: string | undefined;
135
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
136
+ };
137
+ /**
138
+ * Load and activate a skill by name
139
+ *
140
+ * Loads the full skill content for injection into context.
141
+ * The skill's instructions become available for the model to follow.
142
+ */
143
+ export declare const skills_use: {
144
+ description: string;
145
+ args: {
146
+ name: import("zod").ZodString;
147
+ include_scripts: import("zod").ZodOptional<import("zod").ZodBoolean>;
148
+ };
149
+ execute(args: {
150
+ name: string;
151
+ include_scripts?: boolean | undefined;
152
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
153
+ };
154
+ /**
155
+ * Execute a script from a skill
156
+ *
157
+ * Skills can include helper scripts in their scripts/ directory.
158
+ * This tool runs them with appropriate context.
159
+ */
160
+ export declare const skills_execute: {
161
+ description: string;
162
+ args: {
163
+ skill: import("zod").ZodString;
164
+ script: import("zod").ZodString;
165
+ args: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
166
+ };
167
+ execute(args: {
168
+ skill: string;
169
+ script: string;
170
+ args?: string[] | undefined;
171
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
172
+ };
173
+ /**
174
+ * Read a resource file from a skill directory
175
+ *
176
+ * Skills can include additional resources like examples, templates, or reference docs.
177
+ */
178
+ export declare const skills_read: {
179
+ description: string;
180
+ args: {
181
+ skill: import("zod").ZodString;
182
+ file: import("zod").ZodString;
183
+ };
184
+ execute(args: {
185
+ skill: string;
186
+ file: string;
187
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
188
+ };
189
+ /**
190
+ * CSO validation warnings for skill metadata
191
+ */
192
+ export interface CSOValidationWarnings {
193
+ /** Critical warnings (strong indicators of poor discoverability) */
194
+ critical: string[];
195
+ /** Suggestions for improvement */
196
+ suggestions: string[];
197
+ }
198
+ /**
199
+ * Validate skill metadata against Claude Search Optimization best practices
200
+ *
201
+ * Checks:
202
+ * - 'Use when...' format in description
203
+ * - Description length (warn > 500, max 1024)
204
+ * - Third-person voice (no 'I', 'you')
205
+ * - Name conventions (verb-first, gerunds, hyphens)
206
+ *
207
+ * @returns Warnings object with critical issues and suggestions
208
+ */
209
+ export declare function validateCSOCompliance(name: string, description: string): CSOValidationWarnings;
210
+ /**
211
+ * Create a new skill in the project
212
+ *
213
+ * Agents can use this to codify learned patterns, best practices,
214
+ * or domain-specific knowledge into reusable skills.
215
+ */
216
+ export declare const skills_create: {
217
+ description: string;
218
+ args: {
219
+ name: import("zod").ZodString;
220
+ description: import("zod").ZodString;
221
+ body: import("zod").ZodString;
222
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
223
+ tools: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
224
+ directory: import("zod").ZodOptional<import("zod").ZodEnum<{
225
+ global: "global";
226
+ ".opencode/skill": ".opencode/skill";
227
+ ".claude/skills": ".claude/skills";
228
+ skill: "skill";
229
+ "global-claude": "global-claude";
230
+ }>>;
231
+ };
232
+ execute(args: {
233
+ name: string;
234
+ description: string;
235
+ body: string;
236
+ tags?: string[] | undefined;
237
+ tools?: string[] | undefined;
238
+ directory?: "global" | ".opencode/skill" | ".claude/skills" | "skill" | "global-claude" | undefined;
239
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
240
+ };
241
+ /**
242
+ * Update an existing skill
243
+ *
244
+ * Modify a skill's metadata or content based on learned improvements.
245
+ */
246
+ export declare const skills_update: {
247
+ description: string;
248
+ args: {
249
+ name: import("zod").ZodString;
250
+ description: import("zod").ZodOptional<import("zod").ZodString>;
251
+ content: import("zod").ZodOptional<import("zod").ZodString>;
252
+ body: import("zod").ZodOptional<import("zod").ZodString>;
253
+ append_body: import("zod").ZodOptional<import("zod").ZodString>;
254
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
255
+ add_tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
256
+ tools: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
257
+ };
258
+ execute(args: {
259
+ name: string;
260
+ description?: string | undefined;
261
+ content?: string | undefined;
262
+ body?: string | undefined;
263
+ append_body?: string | undefined;
264
+ tags?: string[] | undefined;
265
+ add_tags?: string[] | undefined;
266
+ tools?: string[] | undefined;
267
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
268
+ };
269
+ /**
270
+ * Delete a skill from the project
271
+ */
272
+ export declare const skills_delete: {
273
+ description: string;
274
+ args: {
275
+ name: import("zod").ZodString;
276
+ confirm: import("zod").ZodBoolean;
277
+ };
278
+ execute(args: {
279
+ name: string;
280
+ confirm: boolean;
281
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
282
+ };
283
+ /**
284
+ * Add a script to a skill
285
+ *
286
+ * Skills can include helper scripts for automation.
287
+ */
288
+ export declare const skills_add_script: {
289
+ description: string;
290
+ args: {
291
+ skill: import("zod").ZodString;
292
+ script_name: import("zod").ZodString;
293
+ content: import("zod").ZodString;
294
+ executable: import("zod").ZodDefault<import("zod").ZodBoolean>;
295
+ };
296
+ execute(args: {
297
+ skill: string;
298
+ script_name: string;
299
+ content: string;
300
+ executable: boolean;
301
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
302
+ };
303
+ /**
304
+ * Initialize a new skill with full directory structure
305
+ *
306
+ * Creates a skill template following best practices from the
307
+ * Anthropic Agent Skills specification and community patterns.
308
+ */
309
+ export declare const skills_init: {
310
+ description: string;
311
+ args: {
312
+ name: import("zod").ZodString;
313
+ description: import("zod").ZodOptional<import("zod").ZodString>;
314
+ directory: import("zod").ZodOptional<import("zod").ZodEnum<{
315
+ global: "global";
316
+ ".claude/skills": ".claude/skills";
317
+ skills: "skills";
318
+ ".opencode/skills": ".opencode/skills";
319
+ }>>;
320
+ include_example_script: import("zod").ZodDefault<import("zod").ZodBoolean>;
321
+ include_reference: import("zod").ZodDefault<import("zod").ZodBoolean>;
322
+ };
323
+ execute(args: {
324
+ name: string;
325
+ include_example_script: boolean;
326
+ include_reference: boolean;
327
+ description?: string | undefined;
328
+ directory?: "global" | ".claude/skills" | "skills" | ".opencode/skills" | undefined;
329
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
330
+ };
331
+ /**
332
+ * All skills tools for plugin registration
333
+ */
334
+ export declare const skillsTools: {
335
+ skills_list: {
336
+ description: string;
337
+ args: {
338
+ tag: import("zod").ZodOptional<import("zod").ZodString>;
339
+ };
340
+ execute(args: {
341
+ tag?: string | undefined;
342
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
343
+ };
344
+ skills_use: {
345
+ description: string;
346
+ args: {
347
+ name: import("zod").ZodString;
348
+ include_scripts: import("zod").ZodOptional<import("zod").ZodBoolean>;
349
+ };
350
+ execute(args: {
351
+ name: string;
352
+ include_scripts?: boolean | undefined;
353
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
354
+ };
355
+ skills_execute: {
356
+ description: string;
357
+ args: {
358
+ skill: import("zod").ZodString;
359
+ script: import("zod").ZodString;
360
+ args: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
361
+ };
362
+ execute(args: {
363
+ skill: string;
364
+ script: string;
365
+ args?: string[] | undefined;
366
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
367
+ };
368
+ skills_read: {
369
+ description: string;
370
+ args: {
371
+ skill: import("zod").ZodString;
372
+ file: import("zod").ZodString;
373
+ };
374
+ execute(args: {
375
+ skill: string;
376
+ file: string;
377
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
378
+ };
379
+ skills_create: {
380
+ description: string;
381
+ args: {
382
+ name: import("zod").ZodString;
383
+ description: import("zod").ZodString;
384
+ body: import("zod").ZodString;
385
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
386
+ tools: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
387
+ directory: import("zod").ZodOptional<import("zod").ZodEnum<{
388
+ global: "global";
389
+ ".opencode/skill": ".opencode/skill";
390
+ ".claude/skills": ".claude/skills";
391
+ skill: "skill";
392
+ "global-claude": "global-claude";
393
+ }>>;
394
+ };
395
+ execute(args: {
396
+ name: string;
397
+ description: string;
398
+ body: string;
399
+ tags?: string[] | undefined;
400
+ tools?: string[] | undefined;
401
+ directory?: "global" | ".opencode/skill" | ".claude/skills" | "skill" | "global-claude" | undefined;
402
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
403
+ };
404
+ skills_update: {
405
+ description: string;
406
+ args: {
407
+ name: import("zod").ZodString;
408
+ description: import("zod").ZodOptional<import("zod").ZodString>;
409
+ content: import("zod").ZodOptional<import("zod").ZodString>;
410
+ body: import("zod").ZodOptional<import("zod").ZodString>;
411
+ append_body: import("zod").ZodOptional<import("zod").ZodString>;
412
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
413
+ add_tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
414
+ tools: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
415
+ };
416
+ execute(args: {
417
+ name: string;
418
+ description?: string | undefined;
419
+ content?: string | undefined;
420
+ body?: string | undefined;
421
+ append_body?: string | undefined;
422
+ tags?: string[] | undefined;
423
+ add_tags?: string[] | undefined;
424
+ tools?: string[] | undefined;
425
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
426
+ };
427
+ skills_delete: {
428
+ description: string;
429
+ args: {
430
+ name: import("zod").ZodString;
431
+ confirm: import("zod").ZodBoolean;
432
+ };
433
+ execute(args: {
434
+ name: string;
435
+ confirm: boolean;
436
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
437
+ };
438
+ skills_add_script: {
439
+ description: string;
440
+ args: {
441
+ skill: import("zod").ZodString;
442
+ script_name: import("zod").ZodString;
443
+ content: import("zod").ZodString;
444
+ executable: import("zod").ZodDefault<import("zod").ZodBoolean>;
445
+ };
446
+ execute(args: {
447
+ skill: string;
448
+ script_name: string;
449
+ content: string;
450
+ executable: boolean;
451
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
452
+ };
453
+ skills_init: {
454
+ description: string;
455
+ args: {
456
+ name: import("zod").ZodString;
457
+ description: import("zod").ZodOptional<import("zod").ZodString>;
458
+ directory: import("zod").ZodOptional<import("zod").ZodEnum<{
459
+ global: "global";
460
+ ".claude/skills": ".claude/skills";
461
+ skills: "skills";
462
+ ".opencode/skills": ".opencode/skills";
463
+ }>>;
464
+ include_example_script: import("zod").ZodDefault<import("zod").ZodBoolean>;
465
+ include_reference: import("zod").ZodDefault<import("zod").ZodBoolean>;
466
+ };
467
+ execute(args: {
468
+ name: string;
469
+ include_example_script: boolean;
470
+ include_reference: boolean;
471
+ description?: string | undefined;
472
+ directory?: "global" | ".claude/skills" | "skills" | ".opencode/skills" | undefined;
473
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
474
+ };
475
+ };
476
+ /**
477
+ * Get skill context for swarm task decomposition
478
+ *
479
+ * Returns a summary of available skills that can be referenced
480
+ * in subtask prompts for specialized handling.
481
+ */
482
+ export declare function getSkillsContextForSwarm(): Promise<string>;
483
+ /**
484
+ * Find skills relevant to a task description
485
+ *
486
+ * Simple keyword matching to suggest skills for a task.
487
+ * Returns skill names that may be relevant.
488
+ */
489
+ export declare function findRelevantSkills(taskDescription: string): Promise<string[]>;
490
+ //# sourceMappingURL=skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"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"}