opencode-swarm-plugin 0.22.0 → 0.23.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 (128) hide show
  1. package/.turbo/turbo-build.log +9 -0
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +109 -429
  4. package/dist/agent-mail.d.ts +480 -0
  5. package/dist/agent-mail.d.ts.map +1 -0
  6. package/dist/anti-patterns.d.ts +257 -0
  7. package/dist/anti-patterns.d.ts.map +1 -0
  8. package/dist/beads.d.ts +377 -0
  9. package/dist/beads.d.ts.map +1 -0
  10. package/dist/eval-capture.d.ts +206 -0
  11. package/dist/eval-capture.d.ts.map +1 -0
  12. package/dist/index.d.ts +1299 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +498 -4246
  15. package/dist/learning.d.ts +670 -0
  16. package/dist/learning.d.ts.map +1 -0
  17. package/dist/mandate-promotion.d.ts +93 -0
  18. package/dist/mandate-promotion.d.ts.map +1 -0
  19. package/dist/mandate-storage.d.ts +209 -0
  20. package/dist/mandate-storage.d.ts.map +1 -0
  21. package/dist/mandates.d.ts +230 -0
  22. package/dist/mandates.d.ts.map +1 -0
  23. package/dist/output-guardrails.d.ts +125 -0
  24. package/dist/output-guardrails.d.ts.map +1 -0
  25. package/dist/pattern-maturity.d.ts +246 -0
  26. package/dist/pattern-maturity.d.ts.map +1 -0
  27. package/dist/plugin.d.ts +22 -0
  28. package/dist/plugin.d.ts.map +1 -0
  29. package/dist/plugin.js +493 -4241
  30. package/dist/rate-limiter.d.ts +218 -0
  31. package/dist/rate-limiter.d.ts.map +1 -0
  32. package/dist/repo-crawl.d.ts +146 -0
  33. package/dist/repo-crawl.d.ts.map +1 -0
  34. package/dist/schemas/bead.d.ts +255 -0
  35. package/dist/schemas/bead.d.ts.map +1 -0
  36. package/dist/schemas/evaluation.d.ts +161 -0
  37. package/dist/schemas/evaluation.d.ts.map +1 -0
  38. package/dist/schemas/index.d.ts +34 -0
  39. package/dist/schemas/index.d.ts.map +1 -0
  40. package/dist/schemas/mandate.d.ts +336 -0
  41. package/dist/schemas/mandate.d.ts.map +1 -0
  42. package/dist/schemas/swarm-context.d.ts +131 -0
  43. package/dist/schemas/swarm-context.d.ts.map +1 -0
  44. package/dist/schemas/task.d.ts +188 -0
  45. package/dist/schemas/task.d.ts.map +1 -0
  46. package/dist/skills.d.ts +471 -0
  47. package/dist/skills.d.ts.map +1 -0
  48. package/dist/storage.d.ts +260 -0
  49. package/dist/storage.d.ts.map +1 -0
  50. package/dist/structured.d.ts +196 -0
  51. package/dist/structured.d.ts.map +1 -0
  52. package/dist/swarm-decompose.d.ts +201 -0
  53. package/dist/swarm-decompose.d.ts.map +1 -0
  54. package/dist/swarm-mail.d.ts +240 -0
  55. package/dist/swarm-mail.d.ts.map +1 -0
  56. package/dist/swarm-orchestrate.d.ts +708 -0
  57. package/dist/swarm-orchestrate.d.ts.map +1 -0
  58. package/dist/swarm-prompts.d.ts +292 -0
  59. package/dist/swarm-prompts.d.ts.map +1 -0
  60. package/dist/swarm-strategies.d.ts +100 -0
  61. package/dist/swarm-strategies.d.ts.map +1 -0
  62. package/dist/swarm.d.ts +455 -0
  63. package/dist/swarm.d.ts.map +1 -0
  64. package/dist/tool-availability.d.ts +91 -0
  65. package/dist/tool-availability.d.ts.map +1 -0
  66. package/docs/planning/ADR-001-monorepo-structure.md +171 -0
  67. package/docs/planning/ADR-002-package-extraction.md +393 -0
  68. package/docs/planning/ADR-003-performance-improvements.md +451 -0
  69. package/docs/planning/ADR-004-message-queue-features.md +187 -0
  70. package/docs/planning/ADR-005-devtools-observability.md +202 -0
  71. package/docs/planning/ROADMAP.md +368 -0
  72. package/package.json +13 -24
  73. package/src/agent-mail.ts +1 -1
  74. package/src/beads.ts +1 -2
  75. package/src/index.ts +2 -2
  76. package/src/learning.integration.test.ts +66 -11
  77. package/src/mandate-storage.test.ts +3 -3
  78. package/src/storage.ts +78 -10
  79. package/src/swarm-mail.ts +3 -3
  80. package/src/swarm-orchestrate.ts +7 -7
  81. package/src/tool-availability.ts +1 -1
  82. package/tsconfig.json +1 -1
  83. package/.beads/.local_version +0 -1
  84. package/.beads/README.md +0 -81
  85. package/.beads/analysis/skill-architecture-meta-skills.md +0 -1562
  86. package/.beads/config.yaml +0 -62
  87. package/.beads/issues.jsonl +0 -2197
  88. package/.beads/metadata.json +0 -4
  89. package/.gitattributes +0 -3
  90. package/.github/workflows/ci.yml +0 -30
  91. package/.github/workflows/opencode.yml +0 -31
  92. package/.opencode/skills/tdd/SKILL.md +0 -182
  93. package/INTEGRATION_EXAMPLE.md +0 -66
  94. package/VERIFICATION_QUALITY_PATTERNS.md +0 -565
  95. package/bun.lock +0 -286
  96. package/dist/pglite.data +0 -0
  97. package/dist/pglite.wasm +0 -0
  98. package/src/streams/agent-mail.test.ts +0 -777
  99. package/src/streams/agent-mail.ts +0 -535
  100. package/src/streams/debug.test.ts +0 -500
  101. package/src/streams/debug.ts +0 -727
  102. package/src/streams/effect/ask.integration.test.ts +0 -314
  103. package/src/streams/effect/ask.ts +0 -202
  104. package/src/streams/effect/cursor.integration.test.ts +0 -418
  105. package/src/streams/effect/cursor.ts +0 -288
  106. package/src/streams/effect/deferred.test.ts +0 -357
  107. package/src/streams/effect/deferred.ts +0 -445
  108. package/src/streams/effect/index.ts +0 -17
  109. package/src/streams/effect/layers.ts +0 -73
  110. package/src/streams/effect/lock.test.ts +0 -385
  111. package/src/streams/effect/lock.ts +0 -399
  112. package/src/streams/effect/mailbox.test.ts +0 -260
  113. package/src/streams/effect/mailbox.ts +0 -318
  114. package/src/streams/events.test.ts +0 -924
  115. package/src/streams/events.ts +0 -329
  116. package/src/streams/index.test.ts +0 -229
  117. package/src/streams/index.ts +0 -578
  118. package/src/streams/migrations.test.ts +0 -359
  119. package/src/streams/migrations.ts +0 -362
  120. package/src/streams/projections.test.ts +0 -611
  121. package/src/streams/projections.ts +0 -504
  122. package/src/streams/store.integration.test.ts +0 -658
  123. package/src/streams/store.ts +0 -1075
  124. package/src/streams/swarm-mail.ts +0 -552
  125. package/test-bug-fixes.ts +0 -86
  126. package/vitest.integration.config.ts +0 -19
  127. package/vitest.integration.setup.ts +0 -48
  128. package/workflow-integration-analysis.md +0 -876
@@ -0,0 +1,188 @@
1
+ /**
2
+ * Task decomposition schemas
3
+ *
4
+ * These schemas define the structure for breaking down tasks
5
+ * into parallelizable subtasks for swarm execution.
6
+ */
7
+ import { z } from "zod";
8
+ /**
9
+ * Effort estimation for subtasks.
10
+ *
11
+ * Time ranges:
12
+ * - `trivial`: < 5 minutes (simple rename, typo fix)
13
+ * - `small`: 5-30 minutes (single function, simple feature)
14
+ * - `medium`: 30 min - 2 hours (multi-file change, moderate complexity)
15
+ * - `large`: 2+ hours (significant feature, refactoring)
16
+ */
17
+ export declare const EffortLevelSchema: z.ZodEnum<{
18
+ small: "small";
19
+ trivial: "trivial";
20
+ medium: "medium";
21
+ large: "large";
22
+ }>;
23
+ export type EffortLevel = z.infer<typeof EffortLevelSchema>;
24
+ /**
25
+ * Dependency type between subtasks
26
+ */
27
+ export declare const DependencyTypeSchema: z.ZodEnum<{
28
+ blocks: "blocks";
29
+ related: "related";
30
+ requires: "requires";
31
+ }>;
32
+ export type DependencyType = z.infer<typeof DependencyTypeSchema>;
33
+ /**
34
+ * Subtask in a decomposition
35
+ */
36
+ export declare const DecomposedSubtaskSchema: z.ZodObject<{
37
+ title: z.ZodString;
38
+ description: z.ZodString;
39
+ files: z.ZodArray<z.ZodString>;
40
+ estimated_effort: z.ZodEnum<{
41
+ small: "small";
42
+ trivial: "trivial";
43
+ medium: "medium";
44
+ large: "large";
45
+ }>;
46
+ risks: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
47
+ }, z.core.$strip>;
48
+ export type DecomposedSubtask = z.infer<typeof DecomposedSubtaskSchema>;
49
+ /**
50
+ * Dependency between subtasks
51
+ */
52
+ export declare const SubtaskDependencySchema: z.ZodObject<{
53
+ from: z.ZodNumber;
54
+ to: z.ZodNumber;
55
+ type: z.ZodEnum<{
56
+ blocks: "blocks";
57
+ related: "related";
58
+ requires: "requires";
59
+ }>;
60
+ }, z.core.$strip>;
61
+ export type SubtaskDependency = z.infer<typeof SubtaskDependencySchema>;
62
+ /**
63
+ * Full task decomposition result
64
+ *
65
+ * Returned by the decomposition agent, validated before spawning.
66
+ */
67
+ export declare const TaskDecompositionSchema: z.ZodObject<{
68
+ task: z.ZodString;
69
+ reasoning: z.ZodOptional<z.ZodString>;
70
+ subtasks: z.ZodArray<z.ZodObject<{
71
+ title: z.ZodString;
72
+ description: z.ZodString;
73
+ files: z.ZodArray<z.ZodString>;
74
+ estimated_effort: z.ZodEnum<{
75
+ small: "small";
76
+ trivial: "trivial";
77
+ medium: "medium";
78
+ large: "large";
79
+ }>;
80
+ risks: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
81
+ }, z.core.$strip>>;
82
+ dependencies: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
83
+ from: z.ZodNumber;
84
+ to: z.ZodNumber;
85
+ type: z.ZodEnum<{
86
+ blocks: "blocks";
87
+ related: "related";
88
+ requires: "requires";
89
+ }>;
90
+ }, z.core.$strip>>>>;
91
+ shared_context: z.ZodOptional<z.ZodString>;
92
+ }, z.core.$strip>;
93
+ export type TaskDecomposition = z.infer<typeof TaskDecompositionSchema>;
94
+ /**
95
+ * Arguments for task decomposition
96
+ */
97
+ export declare const DecomposeArgsSchema: z.ZodObject<{
98
+ task: z.ZodString;
99
+ max_subtasks: z.ZodDefault<z.ZodNumber>;
100
+ context: z.ZodOptional<z.ZodString>;
101
+ }, z.core.$strip>;
102
+ export type DecomposeArgs = z.infer<typeof DecomposeArgsSchema>;
103
+ /**
104
+ * Spawn result for a single agent
105
+ */
106
+ export declare const SpawnedAgentSchema: z.ZodObject<{
107
+ bead_id: z.ZodString;
108
+ agent_name: z.ZodString;
109
+ task_id: z.ZodOptional<z.ZodString>;
110
+ status: z.ZodEnum<{
111
+ failed: "failed";
112
+ pending: "pending";
113
+ running: "running";
114
+ completed: "completed";
115
+ }>;
116
+ files: z.ZodArray<z.ZodString>;
117
+ reservation_ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
118
+ }, z.core.$strip>;
119
+ export type SpawnedAgent = z.infer<typeof SpawnedAgentSchema>;
120
+ /**
121
+ * Result of spawning a swarm
122
+ */
123
+ export declare const SwarmSpawnResultSchema: z.ZodObject<{
124
+ epic_id: z.ZodString;
125
+ coordinator_name: z.ZodString;
126
+ thread_id: z.ZodString;
127
+ agents: z.ZodArray<z.ZodObject<{
128
+ bead_id: z.ZodString;
129
+ agent_name: z.ZodString;
130
+ task_id: z.ZodOptional<z.ZodString>;
131
+ status: z.ZodEnum<{
132
+ failed: "failed";
133
+ pending: "pending";
134
+ running: "running";
135
+ completed: "completed";
136
+ }>;
137
+ files: z.ZodArray<z.ZodString>;
138
+ reservation_ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
139
+ }, z.core.$strip>>;
140
+ started_at: z.ZodString;
141
+ }, z.core.$strip>;
142
+ export type SwarmSpawnResult = z.infer<typeof SwarmSpawnResultSchema>;
143
+ /**
144
+ * Progress update from an agent
145
+ */
146
+ export declare const AgentProgressSchema: z.ZodObject<{
147
+ bead_id: z.ZodString;
148
+ agent_name: z.ZodString;
149
+ status: z.ZodEnum<{
150
+ in_progress: "in_progress";
151
+ blocked: "blocked";
152
+ failed: "failed";
153
+ completed: "completed";
154
+ }>;
155
+ progress_percent: z.ZodOptional<z.ZodNumber>;
156
+ message: z.ZodOptional<z.ZodString>;
157
+ files_touched: z.ZodOptional<z.ZodArray<z.ZodString>>;
158
+ blockers: z.ZodOptional<z.ZodArray<z.ZodString>>;
159
+ timestamp: z.ZodString;
160
+ }, z.core.$strip>;
161
+ export type AgentProgress = z.infer<typeof AgentProgressSchema>;
162
+ /**
163
+ * Swarm status summary
164
+ */
165
+ export declare const SwarmStatusSchema: z.ZodObject<{
166
+ epic_id: z.ZodString;
167
+ total_agents: z.ZodNumber;
168
+ running: z.ZodNumber;
169
+ completed: z.ZodNumber;
170
+ failed: z.ZodNumber;
171
+ blocked: z.ZodNumber;
172
+ agents: z.ZodArray<z.ZodObject<{
173
+ bead_id: z.ZodString;
174
+ agent_name: z.ZodString;
175
+ task_id: z.ZodOptional<z.ZodString>;
176
+ status: z.ZodEnum<{
177
+ failed: "failed";
178
+ pending: "pending";
179
+ running: "running";
180
+ completed: "completed";
181
+ }>;
182
+ files: z.ZodArray<z.ZodString>;
183
+ reservation_ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
184
+ }, z.core.$strip>>;
185
+ last_update: z.ZodString;
186
+ }, z.core.$strip>;
187
+ export type SwarmStatus = z.infer<typeof SwarmStatusSchema>;
188
+ //# sourceMappingURL=task.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../src/schemas/task.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB;;;;;EAK5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;EAI/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;iBAOlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;iBAMlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;iBAWlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;iBAI9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;iBAe7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;iBAMjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;iBAe7B,CAAC;AACJ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;iBAS5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,471 @@
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
+ * Set the project directory for skill discovery
67
+ */
68
+ export declare function setSkillsProjectDirectory(dir: string): void;
69
+ /**
70
+ * Parse YAML frontmatter from markdown content using gray-matter
71
+ *
72
+ * Handles the common frontmatter format:
73
+ * ```
74
+ * ---
75
+ * key: value
76
+ * ---
77
+ * body content
78
+ * ```
79
+ */
80
+ export declare function parseFrontmatter(content: string): {
81
+ metadata: Record<string, unknown>;
82
+ body: string;
83
+ };
84
+ /**
85
+ * Discover all skills in the project and global directories
86
+ *
87
+ * Priority order (first match wins):
88
+ * 1. Project: .opencode/skills/
89
+ * 2. Project: .claude/skills/
90
+ * 3. Project: skills/
91
+ * 4. Global: ~/.config/opencode/skills/
92
+ * 5. Global: ~/.claude/skills/
93
+ */
94
+ export declare function discoverSkills(projectDir?: string): Promise<Map<string, Skill>>;
95
+ /**
96
+ * Get a single skill by name
97
+ */
98
+ export declare function getSkill(name: string): Promise<Skill | null>;
99
+ /**
100
+ * List all available skills (lightweight refs only)
101
+ */
102
+ export declare function listSkills(): Promise<SkillRef[]>;
103
+ /**
104
+ * Invalidate the skills cache (call when skills may have changed)
105
+ */
106
+ export declare function invalidateSkillsCache(): void;
107
+ /**
108
+ * List available skills with metadata
109
+ *
110
+ * Returns lightweight skill references for the model to evaluate
111
+ * which skills are relevant to the current task.
112
+ */
113
+ export declare const skills_list: {
114
+ description: string;
115
+ args: {
116
+ tag: import("zod").ZodOptional<import("zod").ZodString>;
117
+ };
118
+ execute(args: {
119
+ tag?: string | undefined;
120
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
121
+ };
122
+ /**
123
+ * Load and activate a skill by name
124
+ *
125
+ * Loads the full skill content for injection into context.
126
+ * The skill's instructions become available for the model to follow.
127
+ */
128
+ export declare const skills_use: {
129
+ description: string;
130
+ args: {
131
+ name: import("zod").ZodString;
132
+ include_scripts: import("zod").ZodOptional<import("zod").ZodBoolean>;
133
+ };
134
+ execute(args: {
135
+ name: string;
136
+ include_scripts?: boolean | undefined;
137
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
138
+ };
139
+ /**
140
+ * Execute a script from a skill
141
+ *
142
+ * Skills can include helper scripts in their scripts/ directory.
143
+ * This tool runs them with appropriate context.
144
+ */
145
+ export declare const skills_execute: {
146
+ description: string;
147
+ args: {
148
+ skill: import("zod").ZodString;
149
+ script: import("zod").ZodString;
150
+ args: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
151
+ };
152
+ execute(args: {
153
+ skill: string;
154
+ script: string;
155
+ args?: string[] | undefined;
156
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
157
+ };
158
+ /**
159
+ * Read a resource file from a skill directory
160
+ *
161
+ * Skills can include additional resources like examples, templates, or reference docs.
162
+ */
163
+ export declare const skills_read: {
164
+ description: string;
165
+ args: {
166
+ skill: import("zod").ZodString;
167
+ file: import("zod").ZodString;
168
+ };
169
+ execute(args: {
170
+ skill: string;
171
+ file: string;
172
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
173
+ };
174
+ /**
175
+ * CSO validation warnings for skill metadata
176
+ */
177
+ export interface CSOValidationWarnings {
178
+ /** Critical warnings (strong indicators of poor discoverability) */
179
+ critical: string[];
180
+ /** Suggestions for improvement */
181
+ suggestions: string[];
182
+ }
183
+ /**
184
+ * Validate skill metadata against Claude Search Optimization best practices
185
+ *
186
+ * Checks:
187
+ * - 'Use when...' format in description
188
+ * - Description length (warn > 500, max 1024)
189
+ * - Third-person voice (no 'I', 'you')
190
+ * - Name conventions (verb-first, gerunds, hyphens)
191
+ *
192
+ * @returns Warnings object with critical issues and suggestions
193
+ */
194
+ export declare function validateCSOCompliance(name: string, description: string): CSOValidationWarnings;
195
+ /**
196
+ * Create a new skill in the project
197
+ *
198
+ * Agents can use this to codify learned patterns, best practices,
199
+ * or domain-specific knowledge into reusable skills.
200
+ */
201
+ export declare const skills_create: {
202
+ description: string;
203
+ args: {
204
+ name: import("zod").ZodString;
205
+ description: import("zod").ZodString;
206
+ body: import("zod").ZodString;
207
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
208
+ tools: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
209
+ directory: import("zod").ZodOptional<import("zod").ZodEnum<{
210
+ ".opencode/skills": ".opencode/skills";
211
+ ".claude/skills": ".claude/skills";
212
+ skills: "skills";
213
+ global: "global";
214
+ "global-claude": "global-claude";
215
+ }>>;
216
+ };
217
+ execute(args: {
218
+ name: string;
219
+ description: string;
220
+ body: string;
221
+ tags?: string[] | undefined;
222
+ tools?: string[] | undefined;
223
+ directory?: ".opencode/skills" | ".claude/skills" | "skills" | "global" | "global-claude" | undefined;
224
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
225
+ };
226
+ /**
227
+ * Update an existing skill
228
+ *
229
+ * Modify a skill's metadata or content based on learned improvements.
230
+ */
231
+ export declare const skills_update: {
232
+ description: string;
233
+ args: {
234
+ name: import("zod").ZodString;
235
+ description: import("zod").ZodOptional<import("zod").ZodString>;
236
+ body: import("zod").ZodOptional<import("zod").ZodString>;
237
+ append_body: import("zod").ZodOptional<import("zod").ZodString>;
238
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
239
+ add_tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
240
+ tools: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
241
+ };
242
+ execute(args: {
243
+ name: string;
244
+ description?: string | undefined;
245
+ body?: string | undefined;
246
+ append_body?: string | undefined;
247
+ tags?: string[] | undefined;
248
+ add_tags?: string[] | undefined;
249
+ tools?: string[] | undefined;
250
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
251
+ };
252
+ /**
253
+ * Delete a skill from the project
254
+ */
255
+ export declare const skills_delete: {
256
+ description: string;
257
+ args: {
258
+ name: import("zod").ZodString;
259
+ confirm: import("zod").ZodBoolean;
260
+ };
261
+ execute(args: {
262
+ name: string;
263
+ confirm: boolean;
264
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
265
+ };
266
+ /**
267
+ * Add a script to a skill
268
+ *
269
+ * Skills can include helper scripts for automation.
270
+ */
271
+ export declare const skills_add_script: {
272
+ description: string;
273
+ args: {
274
+ skill: import("zod").ZodString;
275
+ script_name: import("zod").ZodString;
276
+ content: import("zod").ZodString;
277
+ executable: import("zod").ZodDefault<import("zod").ZodBoolean>;
278
+ };
279
+ execute(args: {
280
+ skill: string;
281
+ script_name: string;
282
+ content: string;
283
+ executable: boolean;
284
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
285
+ };
286
+ /**
287
+ * Initialize a new skill with full directory structure
288
+ *
289
+ * Creates a skill template following best practices from the
290
+ * Anthropic Agent Skills specification and community patterns.
291
+ */
292
+ export declare const skills_init: {
293
+ description: string;
294
+ args: {
295
+ name: import("zod").ZodString;
296
+ description: import("zod").ZodOptional<import("zod").ZodString>;
297
+ directory: import("zod").ZodOptional<import("zod").ZodEnum<{
298
+ ".opencode/skills": ".opencode/skills";
299
+ ".claude/skills": ".claude/skills";
300
+ skills: "skills";
301
+ global: "global";
302
+ }>>;
303
+ include_example_script: import("zod").ZodDefault<import("zod").ZodBoolean>;
304
+ include_reference: import("zod").ZodDefault<import("zod").ZodBoolean>;
305
+ };
306
+ execute(args: {
307
+ name: string;
308
+ include_example_script: boolean;
309
+ include_reference: boolean;
310
+ description?: string | undefined;
311
+ directory?: ".opencode/skills" | ".claude/skills" | "skills" | "global" | undefined;
312
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
313
+ };
314
+ /**
315
+ * All skills tools for plugin registration
316
+ */
317
+ export declare const skillsTools: {
318
+ skills_list: {
319
+ description: string;
320
+ args: {
321
+ tag: import("zod").ZodOptional<import("zod").ZodString>;
322
+ };
323
+ execute(args: {
324
+ tag?: string | undefined;
325
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
326
+ };
327
+ skills_use: {
328
+ description: string;
329
+ args: {
330
+ name: import("zod").ZodString;
331
+ include_scripts: import("zod").ZodOptional<import("zod").ZodBoolean>;
332
+ };
333
+ execute(args: {
334
+ name: string;
335
+ include_scripts?: boolean | undefined;
336
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
337
+ };
338
+ skills_execute: {
339
+ description: string;
340
+ args: {
341
+ skill: import("zod").ZodString;
342
+ script: import("zod").ZodString;
343
+ args: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
344
+ };
345
+ execute(args: {
346
+ skill: string;
347
+ script: string;
348
+ args?: string[] | undefined;
349
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
350
+ };
351
+ skills_read: {
352
+ description: string;
353
+ args: {
354
+ skill: import("zod").ZodString;
355
+ file: import("zod").ZodString;
356
+ };
357
+ execute(args: {
358
+ skill: string;
359
+ file: string;
360
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
361
+ };
362
+ skills_create: {
363
+ description: string;
364
+ args: {
365
+ name: import("zod").ZodString;
366
+ description: import("zod").ZodString;
367
+ body: import("zod").ZodString;
368
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
369
+ tools: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
370
+ directory: import("zod").ZodOptional<import("zod").ZodEnum<{
371
+ ".opencode/skills": ".opencode/skills";
372
+ ".claude/skills": ".claude/skills";
373
+ skills: "skills";
374
+ global: "global";
375
+ "global-claude": "global-claude";
376
+ }>>;
377
+ };
378
+ execute(args: {
379
+ name: string;
380
+ description: string;
381
+ body: string;
382
+ tags?: string[] | undefined;
383
+ tools?: string[] | undefined;
384
+ directory?: ".opencode/skills" | ".claude/skills" | "skills" | "global" | "global-claude" | undefined;
385
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
386
+ };
387
+ skills_update: {
388
+ description: string;
389
+ args: {
390
+ name: import("zod").ZodString;
391
+ description: import("zod").ZodOptional<import("zod").ZodString>;
392
+ body: import("zod").ZodOptional<import("zod").ZodString>;
393
+ append_body: import("zod").ZodOptional<import("zod").ZodString>;
394
+ tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
395
+ add_tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
396
+ tools: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
397
+ };
398
+ execute(args: {
399
+ name: string;
400
+ description?: string | undefined;
401
+ body?: string | undefined;
402
+ append_body?: string | undefined;
403
+ tags?: string[] | undefined;
404
+ add_tags?: string[] | undefined;
405
+ tools?: string[] | undefined;
406
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
407
+ };
408
+ skills_delete: {
409
+ description: string;
410
+ args: {
411
+ name: import("zod").ZodString;
412
+ confirm: import("zod").ZodBoolean;
413
+ };
414
+ execute(args: {
415
+ name: string;
416
+ confirm: boolean;
417
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
418
+ };
419
+ skills_add_script: {
420
+ description: string;
421
+ args: {
422
+ skill: import("zod").ZodString;
423
+ script_name: import("zod").ZodString;
424
+ content: import("zod").ZodString;
425
+ executable: import("zod").ZodDefault<import("zod").ZodBoolean>;
426
+ };
427
+ execute(args: {
428
+ skill: string;
429
+ script_name: string;
430
+ content: string;
431
+ executable: boolean;
432
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
433
+ };
434
+ skills_init: {
435
+ description: string;
436
+ args: {
437
+ name: import("zod").ZodString;
438
+ description: import("zod").ZodOptional<import("zod").ZodString>;
439
+ directory: import("zod").ZodOptional<import("zod").ZodEnum<{
440
+ ".opencode/skills": ".opencode/skills";
441
+ ".claude/skills": ".claude/skills";
442
+ skills: "skills";
443
+ global: "global";
444
+ }>>;
445
+ include_example_script: import("zod").ZodDefault<import("zod").ZodBoolean>;
446
+ include_reference: import("zod").ZodDefault<import("zod").ZodBoolean>;
447
+ };
448
+ execute(args: {
449
+ name: string;
450
+ include_example_script: boolean;
451
+ include_reference: boolean;
452
+ description?: string | undefined;
453
+ directory?: ".opencode/skills" | ".claude/skills" | "skills" | "global" | undefined;
454
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
455
+ };
456
+ };
457
+ /**
458
+ * Get skill context for swarm task decomposition
459
+ *
460
+ * Returns a summary of available skills that can be referenced
461
+ * in subtask prompts for specialized handling.
462
+ */
463
+ export declare function getSkillsContextForSwarm(): Promise<string>;
464
+ /**
465
+ * Find skills relevant to a task description
466
+ *
467
+ * Simple keyword matching to suggest skills for a task.
468
+ * Returns skill names that may be relevant.
469
+ */
470
+ export declare function findRelevantSkills(taskDescription: string): Promise<string[]>;
471
+ //# sourceMappingURL=skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mapp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