@zenobius/opencode-skillful 1.0.0-next.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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +205 -0
  3. package/dist/index.js +16730 -0
  4. package/package.json +42 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 zenobi.us
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,205 @@
1
+ # OpenCode Skills Plugin
2
+
3
+ An interpretation of the [Anthropic Agent Skills Specification](https://github.com/anthropics/skills) for OpenCode, providing lazy-loaded skill discovery and injection.
4
+
5
+ Differenator is :
6
+
7
+ - Conversationally the agent uses `skill_find words, words words` to discover skills
8
+ - The agent uses `skill_use fully_resolved_skill_name` and,
9
+ - The agent can use `skill_resource skill_relative/resource/path` to read reference material
10
+
11
+ ## Installation
12
+
13
+ Create or edit your OpenCode configuration file (typically `~/.config/opencode/config.json`):
14
+
15
+ ```json
16
+ {
17
+ "plugins": ["@zenobius/opencode-skillful"]
18
+ }
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ### Example 1: Finding and Loading Skills
24
+
25
+ ```
26
+ I need to write a commit message. Can you find any relevant skills and load them?
27
+
28
+ 1. Use skill_find to search for "commit" or "git" related skills
29
+ 2. Load the most relevant skill using skill_use
30
+ 3. Apply the loaded skill guidance to write my commit message
31
+ ```
32
+
33
+ **Demonstrates:**
34
+
35
+ - Searching for skills by keyword
36
+ - Loading skills into the chat context
37
+ - Applying skill guidance to tasks
38
+
39
+ ### Example 2: Browsing Available Skills
40
+
41
+ ```
42
+ What skills are available? Show me everything under the "experts" category.
43
+
44
+ 1. List all skills with skill_find "*"
45
+ 2. Filter to a specific path with skill_find "experts"
46
+ 3. Load a specific expert skill for deep guidance
47
+ ```
48
+
49
+ **Demonstrates:**
50
+
51
+ - Listing all available skills
52
+ - Path prefix filtering (e.g., "experts", "superpowers/writing")
53
+ - Hierarchical skill organization
54
+
55
+ ### Example 3: Advanced Search with Exclusions
56
+
57
+ ```
58
+ Find testing-related skills but exclude anything about performance testing.
59
+
60
+ skill_find "testing -performance"
61
+ ```
62
+
63
+ **Demonstrates:**
64
+
65
+ - Natural language query syntax
66
+ - Negation with `-term`
67
+ - AND logic for multiple terms
68
+
69
+ ## Features
70
+
71
+ - :mag: Discover SKILL.md files from multiple locations
72
+ - :zap: Lazy loading - skills only inject when explicitly requested
73
+ - :file_folder: Path prefix matching for organized skill browsing
74
+ - :abc: Natural query syntax with negation and quoted phrases
75
+ - :label: Skill ranking by relevance (name matches weighted higher)
76
+ - :recycle: Silent message insertion (noReply pattern)
77
+
78
+ ## Skill Discovery Paths
79
+
80
+ Skills are discovered from these locations (in priority order, last wins on duplicates):
81
+
82
+ 1. `~/.opencode/skills/` - User global skills (lowest priority)
83
+ 2. `~/.config/opencode/skills/` - Standard XDG config location
84
+ 3. `.opencode/skills/` - Project-local skills (highest priority)
85
+
86
+ ## Usage in OpenCode
87
+
88
+ ### Finding Skills
89
+
90
+ ```
91
+ # List all available skills
92
+ skill_find
93
+ query="*"
94
+
95
+ # Search by keyword
96
+ skill_find
97
+ query="git commit"
98
+
99
+ # Path prefix matching
100
+ skill_find
101
+ query="experts/data-ai"
102
+
103
+ # Exclude terms
104
+ skill_find
105
+ query="testing -performance"
106
+ ```
107
+
108
+ ### Loading Skills
109
+
110
+ ```
111
+ # Load a single skill
112
+ skill_use
113
+ skill_names=["writing-git-commits"]
114
+
115
+ # Load multiple skills
116
+ skill_use
117
+ skill_names=["writing-git-commits", "code-review"]
118
+ ```
119
+
120
+ ### Reading Skill Resources
121
+
122
+ ```
123
+ # Read a resource file from a skill's directory
124
+ skill_resource
125
+ skill_name="brand-guidelines"
126
+ relative_path="templates/logo-usage.md"
127
+ ```
128
+
129
+ ## Plugin Tools
130
+
131
+ ### `skill_find`
132
+
133
+ Search for skills using natural query syntax.
134
+
135
+ - `query`: Search string supporting:
136
+ - `*` or empty: List all skills
137
+ - Path prefixes: `experts`, `superpowers/writing`
138
+ - Keywords: `git commit`
139
+ - Negation: `-term`
140
+ - Quoted phrases: `"exact match"`
141
+
142
+ ### `skill_use`
143
+
144
+ Load one or more skills into the chat context.
145
+
146
+ - `skill_names`: Array of skill names to load (by toolName or short name)
147
+
148
+ ### `skill_resource`
149
+
150
+ Read a resource file from a skill's directory.
151
+
152
+ - `skill_name`: The skill containing the resource
153
+ - `relative_path`: Path to the resource relative to the skill directory
154
+
155
+ ## Creating Skills
156
+
157
+ Skills follow the [Anthropic Agent Skills Specification](https://github.com/anthropics/skills). Each skill is a directory containing a `SKILL.md` file:
158
+
159
+ ```
160
+ skills/
161
+ my-skill/
162
+ SKILL.md
163
+ resources/
164
+ template.md
165
+ ```
166
+
167
+ ### SKILL.md Format
168
+
169
+ ```yaml
170
+ ---
171
+ name: my-skill
172
+ description: A brief description of what this skill does (min 20 chars)
173
+ license: MIT
174
+ allowed-tools:
175
+ - bash
176
+ - read
177
+ metadata:
178
+ author: Your Name
179
+ ---
180
+ # My Skill
181
+
182
+ Instructions for the AI agent when this skill is loaded...
183
+ ```
184
+
185
+ **Requirements:**
186
+
187
+ - `name` must match the directory name (lowercase, alphanumeric, hyphens only)
188
+ - `description` must be at least 20 characters
189
+ - Directory name and frontmatter `name` must match exactly
190
+
191
+ ## Considerations
192
+
193
+ - Skills are discovered at plugin initialization (requires restart to reload)
194
+ - Duplicate skill names are logged and skipped (last path wins)
195
+ - Tool restrictions in `allowed-tools` are informational (enforced at agent level)
196
+ - Skill content is injected as user messages (persists in conversation)
197
+ - Base directory context is provided for relative path resolution in skills
198
+
199
+ ## Contributing
200
+
201
+ Contributions are welcome! Please file issues or submit pull requests on the GitHub repository.
202
+
203
+ ## License
204
+
205
+ MIT License. See the [LICENSE](LICENSE) file for details.