opencode-swarm-plugin 0.44.1 → 0.45.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.
- package/README.md +277 -54
- package/bin/swarm.ts +3 -3
- package/dist/decision-trace-integration.d.ts +204 -0
- package/dist/decision-trace-integration.d.ts.map +1 -0
- package/dist/hive.d.ts.map +1 -1
- package/dist/hive.js +14834 -0
- package/dist/index.d.ts +50 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +640 -27
- package/dist/plugin.js +395 -27
- package/dist/query-tools.d.ts +20 -12
- package/dist/query-tools.d.ts.map +1 -1
- package/dist/swarm-decompose.d.ts +4 -4
- package/dist/swarm-decompose.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/dist/swarm-prompts.js +39605 -0
- package/dist/swarm-review.d.ts.map +1 -1
- package/dist/swarm-signature.d.ts +106 -0
- package/dist/swarm-signature.d.ts.map +1 -0
- package/dist/swarm-strategies.d.ts +16 -3
- package/dist/swarm-strategies.d.ts.map +1 -1
- package/dist/swarm-validation.d.ts +127 -0
- package/dist/swarm-validation.d.ts.map +1 -0
- package/dist/swarm.d.ts +4 -2
- package/dist/swarm.d.ts.map +1 -1
- package/dist/validators/index.d.ts +7 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/validators/schema-validator.d.ts +58 -0
- package/dist/validators/schema-validator.d.ts.map +1 -0
- package/examples/commands/swarm.md +745 -0
- package/examples/plugin-wrapper-template.ts +2611 -0
- package/examples/skills/hive-workflow/SKILL.md +212 -0
- package/examples/skills/skill-creator/SKILL.md +223 -0
- package/examples/skills/swarm-coordination/SKILL.md +292 -0
- package/global-skills/cli-builder/SKILL.md +344 -0
- package/global-skills/cli-builder/references/advanced-patterns.md +244 -0
- package/global-skills/learning-systems/SKILL.md +644 -0
- package/global-skills/skill-creator/LICENSE.txt +202 -0
- package/global-skills/skill-creator/SKILL.md +352 -0
- package/global-skills/skill-creator/references/output-patterns.md +82 -0
- package/global-skills/skill-creator/references/workflows.md +28 -0
- package/global-skills/swarm-coordination/SKILL.md +995 -0
- package/global-skills/swarm-coordination/references/coordinator-patterns.md +235 -0
- package/global-skills/swarm-coordination/references/strategies.md +138 -0
- package/global-skills/system-design/SKILL.md +213 -0
- package/global-skills/testing-patterns/SKILL.md +430 -0
- package/global-skills/testing-patterns/references/dependency-breaking-catalog.md +586 -0
- package/package.json +6 -3
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skill-creator
|
|
3
|
+
description: Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
|
|
4
|
+
license: Complete terms in LICENSE.txt
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Skill Creator
|
|
8
|
+
|
|
9
|
+
This skill provides guidance for creating effective skills.
|
|
10
|
+
|
|
11
|
+
## About Skills
|
|
12
|
+
|
|
13
|
+
Skills are modular, self-contained packages that extend Claude's capabilities by providing
|
|
14
|
+
specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific
|
|
15
|
+
domains or tasks—they transform Claude from a general-purpose agent into a specialized agent
|
|
16
|
+
equipped with procedural knowledge that no model can fully possess.
|
|
17
|
+
|
|
18
|
+
### What Skills Provide
|
|
19
|
+
|
|
20
|
+
1. Specialized workflows - Multi-step procedures for specific domains
|
|
21
|
+
2. Tool integrations - Instructions for working with specific file formats or APIs
|
|
22
|
+
3. Domain expertise - Company-specific knowledge, schemas, business logic
|
|
23
|
+
4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks
|
|
24
|
+
|
|
25
|
+
## Core Principles
|
|
26
|
+
|
|
27
|
+
### Concise is Key
|
|
28
|
+
|
|
29
|
+
The context window is a public good. Skills share the context window with everything else Claude needs: system prompt, conversation history, other Skills' metadata, and the actual user request.
|
|
30
|
+
|
|
31
|
+
**Default assumption: Claude is already very smart.** Only add context Claude doesn't already have. Challenge each piece of information: "Does Claude really need this explanation?" and "Does this paragraph justify its token cost?"
|
|
32
|
+
|
|
33
|
+
Prefer concise examples over verbose explanations.
|
|
34
|
+
|
|
35
|
+
### Set Appropriate Degrees of Freedom
|
|
36
|
+
|
|
37
|
+
Match the level of specificity to the task's fragility and variability:
|
|
38
|
+
|
|
39
|
+
**High freedom (text-based instructions)**: Use when multiple approaches are valid, decisions depend on context, or heuristics guide the approach.
|
|
40
|
+
|
|
41
|
+
**Medium freedom (pseudocode or scripts with parameters)**: Use when a preferred pattern exists, some variation is acceptable, or configuration affects behavior.
|
|
42
|
+
|
|
43
|
+
**Low freedom (specific scripts, few parameters)**: Use when operations are fragile and error-prone, consistency is critical, or a specific sequence must be followed.
|
|
44
|
+
|
|
45
|
+
Think of Claude as exploring a path: a narrow bridge with cliffs needs specific guardrails (low freedom), while an open field allows many routes (high freedom).
|
|
46
|
+
|
|
47
|
+
### Anatomy of a Skill
|
|
48
|
+
|
|
49
|
+
Every skill consists of a required SKILL.md file and optional bundled resources:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
skill-name/
|
|
53
|
+
├── SKILL.md (required)
|
|
54
|
+
│ ├── YAML frontmatter metadata (required)
|
|
55
|
+
│ │ ├── name: (required)
|
|
56
|
+
│ │ └── description: (required)
|
|
57
|
+
│ └── Markdown instructions (required)
|
|
58
|
+
└── Bundled Resources (optional)
|
|
59
|
+
├── scripts/ - Executable code (Python/Bash/etc.)
|
|
60
|
+
├── references/ - Documentation intended to be loaded into context as needed
|
|
61
|
+
└── assets/ - Files used in output (templates, icons, fonts, etc.)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### SKILL.md (required)
|
|
65
|
+
|
|
66
|
+
Every SKILL.md consists of:
|
|
67
|
+
|
|
68
|
+
- **Frontmatter** (YAML): Contains `name` and `description` fields. These are the only fields that Claude reads to determine when the skill gets used, thus it is very important to be clear and comprehensive in describing what the skill is, and when it should be used.
|
|
69
|
+
- **Body** (Markdown): Instructions and guidance for using the skill. Only loaded AFTER the skill triggers (if at all).
|
|
70
|
+
|
|
71
|
+
#### Bundled Resources (optional)
|
|
72
|
+
|
|
73
|
+
##### Scripts (`scripts/`)
|
|
74
|
+
|
|
75
|
+
Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.
|
|
76
|
+
|
|
77
|
+
- **When to include**: When the same code is being rewritten repeatedly or deterministic reliability is needed
|
|
78
|
+
- **Example**: `scripts/rotate_pdf.py` for PDF rotation tasks
|
|
79
|
+
- **Benefits**: Token efficient, deterministic, may be executed without loading into context
|
|
80
|
+
- **Note**: Scripts may still need to be read by Claude for patching or environment-specific adjustments
|
|
81
|
+
|
|
82
|
+
##### References (`references/`)
|
|
83
|
+
|
|
84
|
+
Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking.
|
|
85
|
+
|
|
86
|
+
- **When to include**: For documentation that Claude should reference while working
|
|
87
|
+
- **Examples**: `references/finance.md` for financial schemas, `references/mnda.md` for company NDA template, `references/policies.md` for company policies, `references/api_docs.md` for API specifications
|
|
88
|
+
- **Use cases**: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides
|
|
89
|
+
- **Benefits**: Keeps SKILL.md lean, loaded only when Claude determines it's needed
|
|
90
|
+
- **Best practice**: If files are large (>10k words), include grep search patterns in SKILL.md
|
|
91
|
+
- **Avoid duplication**: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files.
|
|
92
|
+
|
|
93
|
+
##### Assets (`assets/`)
|
|
94
|
+
|
|
95
|
+
Files not intended to be loaded into context, but rather used within the output Claude produces.
|
|
96
|
+
|
|
97
|
+
- **When to include**: When the skill needs files that will be used in the final output
|
|
98
|
+
- **Examples**: `assets/logo.png` for brand assets, `assets/slides.pptx` for PowerPoint templates, `assets/frontend-template/` for HTML/React boilerplate, `assets/font.ttf` for typography
|
|
99
|
+
- **Use cases**: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified
|
|
100
|
+
- **Benefits**: Separates output resources from documentation, enables Claude to use files without loading them into context
|
|
101
|
+
|
|
102
|
+
#### What to Not Include in a Skill
|
|
103
|
+
|
|
104
|
+
A skill should only contain essential files that directly support its functionality. Do NOT create extraneous documentation or auxiliary files, including:
|
|
105
|
+
|
|
106
|
+
- README.md
|
|
107
|
+
- INSTALLATION_GUIDE.md
|
|
108
|
+
- QUICK_REFERENCE.md
|
|
109
|
+
- CHANGELOG.md
|
|
110
|
+
- etc.
|
|
111
|
+
|
|
112
|
+
The skill should only contain the information needed for an AI agent to do the job at hand. It should not contain auxilary context about the process that went into creating it, setup and testing procedures, user-facing documentation, etc. Creating additional documentation files just adds clutter and confusion.
|
|
113
|
+
|
|
114
|
+
### Progressive Disclosure Design Principle
|
|
115
|
+
|
|
116
|
+
Skills use a three-level loading system to manage context efficiently:
|
|
117
|
+
|
|
118
|
+
1. **Metadata (name + description)** - Always in context (~100 words)
|
|
119
|
+
2. **SKILL.md body** - When skill triggers (<5k words)
|
|
120
|
+
3. **Bundled resources** - As needed by Claude (Unlimited because scripts can be executed without reading into context window)
|
|
121
|
+
|
|
122
|
+
#### Progressive Disclosure Patterns
|
|
123
|
+
|
|
124
|
+
Keep SKILL.md body to the essentials and under 500 lines to minimize context bloat. Split content into separate files when approaching this limit. When splitting out content into other files, it is very important to reference them from SKILL.md and describe clearly when to read them, to ensure the reader of the skill knows they exist and when to use them.
|
|
125
|
+
|
|
126
|
+
**Key principle:** When a skill supports multiple variations, frameworks, or options, keep only the core workflow and selection guidance in SKILL.md. Move variant-specific details (patterns, examples, configuration) into separate reference files.
|
|
127
|
+
|
|
128
|
+
**Pattern 1: High-level guide with references**
|
|
129
|
+
|
|
130
|
+
```markdown
|
|
131
|
+
# PDF Processing
|
|
132
|
+
|
|
133
|
+
## Quick start
|
|
134
|
+
|
|
135
|
+
Extract text with pdfplumber:
|
|
136
|
+
[code example]
|
|
137
|
+
|
|
138
|
+
## Advanced features
|
|
139
|
+
|
|
140
|
+
- **Form filling**: See [FORMS.md](FORMS.md) for complete guide
|
|
141
|
+
- **API reference**: See [REFERENCE.md](REFERENCE.md) for all methods
|
|
142
|
+
- **Examples**: See [EXAMPLES.md](EXAMPLES.md) for common patterns
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Claude loads FORMS.md, REFERENCE.md, or EXAMPLES.md only when needed.
|
|
146
|
+
|
|
147
|
+
**Pattern 2: Domain-specific organization**
|
|
148
|
+
|
|
149
|
+
For Skills with multiple domains, organize content by domain to avoid loading irrelevant context:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
bigquery-skill/
|
|
153
|
+
├── SKILL.md (overview and navigation)
|
|
154
|
+
└── reference/
|
|
155
|
+
├── finance.md (revenue, billing metrics)
|
|
156
|
+
├── sales.md (opportunities, pipeline)
|
|
157
|
+
├── product.md (API usage, features)
|
|
158
|
+
└── marketing.md (campaigns, attribution)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
When a user asks about sales metrics, Claude only reads sales.md.
|
|
162
|
+
|
|
163
|
+
Similarly, for skills supporting multiple frameworks or variants, organize by variant:
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
cloud-deploy/
|
|
167
|
+
├── SKILL.md (workflow + provider selection)
|
|
168
|
+
└── references/
|
|
169
|
+
├── aws.md (AWS deployment patterns)
|
|
170
|
+
├── gcp.md (GCP deployment patterns)
|
|
171
|
+
└── azure.md (Azure deployment patterns)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
When the user chooses AWS, Claude only reads aws.md.
|
|
175
|
+
|
|
176
|
+
**Pattern 3: Conditional details**
|
|
177
|
+
|
|
178
|
+
Show basic content, link to advanced content:
|
|
179
|
+
|
|
180
|
+
```markdown
|
|
181
|
+
# DOCX Processing
|
|
182
|
+
|
|
183
|
+
## Creating documents
|
|
184
|
+
|
|
185
|
+
Use docx-js for new documents. See [DOCX-JS.md](DOCX-JS.md).
|
|
186
|
+
|
|
187
|
+
## Editing documents
|
|
188
|
+
|
|
189
|
+
For simple edits, modify the XML directly.
|
|
190
|
+
|
|
191
|
+
**For tracked changes**: See [REDLINING.md](REDLINING.md)
|
|
192
|
+
**For OOXML details**: See [OOXML.md](OOXML.md)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Claude reads REDLINING.md or OOXML.md only when the user needs those features.
|
|
196
|
+
|
|
197
|
+
**Important guidelines:**
|
|
198
|
+
|
|
199
|
+
- **Avoid deeply nested references** - Keep references one level deep from SKILL.md. All reference files should link directly from SKILL.md.
|
|
200
|
+
- **Structure longer reference files** - For files longer than 100 lines, include a table of contents at the top so Claude can see the full scope when previewing.
|
|
201
|
+
|
|
202
|
+
## Skill Creation Process
|
|
203
|
+
|
|
204
|
+
Skill creation involves these steps:
|
|
205
|
+
|
|
206
|
+
1. Understand the skill with concrete examples
|
|
207
|
+
2. Plan reusable skill contents (scripts, references, assets)
|
|
208
|
+
3. Initialize the skill (use `skills_init` tool)
|
|
209
|
+
4. Edit the skill (implement resources and write SKILL.md)
|
|
210
|
+
5. Validate the skill (use `bun scripts/validate-skill.ts`)
|
|
211
|
+
6. Iterate based on real usage
|
|
212
|
+
|
|
213
|
+
Follow these steps in order, skipping only if there is a clear reason why they are not applicable.
|
|
214
|
+
|
|
215
|
+
### Step 1: Understanding the Skill with Concrete Examples
|
|
216
|
+
|
|
217
|
+
Skip this step only when the skill's usage patterns are already clearly understood. It remains valuable even when working with an existing skill.
|
|
218
|
+
|
|
219
|
+
To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback.
|
|
220
|
+
|
|
221
|
+
For example, when building an image-editor skill, relevant questions include:
|
|
222
|
+
|
|
223
|
+
- "What functionality should the image-editor skill support? Editing, rotating, anything else?"
|
|
224
|
+
- "Can you give some examples of how this skill would be used?"
|
|
225
|
+
- "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?"
|
|
226
|
+
- "What would a user say that should trigger this skill?"
|
|
227
|
+
|
|
228
|
+
To avoid overwhelming users, avoid asking too many questions in a single message. Start with the most important questions and follow up as needed for better effectiveness.
|
|
229
|
+
|
|
230
|
+
Conclude this step when there is a clear sense of the functionality the skill should support.
|
|
231
|
+
|
|
232
|
+
### Step 2: Planning the Reusable Skill Contents
|
|
233
|
+
|
|
234
|
+
To turn concrete examples into an effective skill, analyze each example by:
|
|
235
|
+
|
|
236
|
+
1. Considering how to execute on the example from scratch
|
|
237
|
+
2. Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly
|
|
238
|
+
|
|
239
|
+
Example: When building a `pdf-editor` skill to handle queries like "Help me rotate this PDF," the analysis shows:
|
|
240
|
+
|
|
241
|
+
1. Rotating a PDF requires re-writing the same code each time
|
|
242
|
+
2. A `scripts/rotate_pdf.py` script would be helpful to store in the skill
|
|
243
|
+
|
|
244
|
+
Example: When designing a `frontend-webapp-builder` skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:
|
|
245
|
+
|
|
246
|
+
1. Writing a frontend webapp requires the same boilerplate HTML/React each time
|
|
247
|
+
2. An `assets/hello-world/` template containing the boilerplate HTML/React project files would be helpful to store in the skill
|
|
248
|
+
|
|
249
|
+
Example: When building a `big-query` skill to handle queries like "How many users have logged in today?" the analysis shows:
|
|
250
|
+
|
|
251
|
+
1. Querying BigQuery requires re-discovering the table schemas and relationships each time
|
|
252
|
+
2. A `references/schema.md` file documenting the table schemas would be helpful to store in the skill
|
|
253
|
+
|
|
254
|
+
To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.
|
|
255
|
+
|
|
256
|
+
### Step 3: Initializing the Skill
|
|
257
|
+
|
|
258
|
+
At this point, it is time to actually create the skill.
|
|
259
|
+
|
|
260
|
+
Skip this step only if the skill being developed already exists, and iteration or packaging is needed. In this case, continue to the next step.
|
|
261
|
+
|
|
262
|
+
When creating a new skill from scratch, use the `skills_init` tool. This generates a new template skill directory with everything a skill requires.
|
|
263
|
+
|
|
264
|
+
Usage:
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
skills_init(name: "my-skill", directory: ".opencode/skills")
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Or from CLI:
|
|
271
|
+
```bash
|
|
272
|
+
bun scripts/init-skill.ts my-skill --path .opencode/skills
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
The tool:
|
|
276
|
+
|
|
277
|
+
- Creates the skill directory at the specified path
|
|
278
|
+
- Generates a SKILL.md template with proper frontmatter and TODO placeholders
|
|
279
|
+
- Creates `scripts/` and `references/` directories with examples
|
|
280
|
+
- Adds example files that can be customized or deleted
|
|
281
|
+
|
|
282
|
+
After initialization, customize or remove the generated SKILL.md and example files as needed.
|
|
283
|
+
|
|
284
|
+
### Step 4: Edit the Skill
|
|
285
|
+
|
|
286
|
+
When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Include information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively.
|
|
287
|
+
|
|
288
|
+
#### Learn Proven Design Patterns
|
|
289
|
+
|
|
290
|
+
Consult these helpful guides based on your skill's needs:
|
|
291
|
+
|
|
292
|
+
- **Multi-step processes**: See references/workflows.md for sequential workflows and conditional logic
|
|
293
|
+
- **Specific output formats or quality standards**: See references/output-patterns.md for template and example patterns
|
|
294
|
+
|
|
295
|
+
These files contain established best practices for effective skill design.
|
|
296
|
+
|
|
297
|
+
#### Start with Reusable Skill Contents
|
|
298
|
+
|
|
299
|
+
To begin implementation, start with the reusable resources identified above: `scripts/`, `references/`, and `assets/` files. Note that this step may require user input. For example, when implementing a `brand-guidelines` skill, the user may need to provide brand assets or templates to store in `assets/`, or documentation to store in `references/`.
|
|
300
|
+
|
|
301
|
+
Added scripts must be tested by actually running them to ensure there are no bugs and that the output matches what is expected. If there are many similar scripts, only a representative sample needs to be tested to ensure confidence that they all work while balancing time to completion.
|
|
302
|
+
|
|
303
|
+
Any example files and directories not needed for the skill should be deleted. The initialization script creates example files in `scripts/`, `references/`, and `assets/` to demonstrate structure, but most skills won't need all of them.
|
|
304
|
+
|
|
305
|
+
#### Update SKILL.md
|
|
306
|
+
|
|
307
|
+
**Writing Guidelines:** Always use imperative/infinitive form.
|
|
308
|
+
|
|
309
|
+
##### Frontmatter
|
|
310
|
+
|
|
311
|
+
Write the YAML frontmatter with `name` and `description`:
|
|
312
|
+
|
|
313
|
+
- `name`: The skill name
|
|
314
|
+
- `description`: This is the primary triggering mechanism for your skill, and helps Claude understand when to use the skill.
|
|
315
|
+
- Include both what the Skill does and specific triggers/contexts for when to use it.
|
|
316
|
+
- Include all "when to use" information here - Not in the body. The body is only loaded after triggering, so "When to Use This Skill" sections in the body are not helpful to Claude.
|
|
317
|
+
- Example description for a `docx` skill: "Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. Use when Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks"
|
|
318
|
+
|
|
319
|
+
Do not include any other fields in YAML frontmatter.
|
|
320
|
+
|
|
321
|
+
##### Body
|
|
322
|
+
|
|
323
|
+
Write instructions for using the skill and its bundled resources.
|
|
324
|
+
|
|
325
|
+
### Step 5: Validating the Skill
|
|
326
|
+
|
|
327
|
+
Before sharing, validate the skill to ensure it meets requirements:
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
bun scripts/validate-skill.ts .opencode/skills/my-skill
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
The validator checks:
|
|
334
|
+
|
|
335
|
+
- YAML frontmatter format and required fields (name, description)
|
|
336
|
+
- Skill naming conventions match directory name
|
|
337
|
+
- Description completeness (no TODO placeholders, appropriate length)
|
|
338
|
+
- File organization (no extraneous README.md, etc.)
|
|
339
|
+
- Placeholder files that should be removed or customized
|
|
340
|
+
|
|
341
|
+
Fix any validation errors before sharing or committing the skill.
|
|
342
|
+
|
|
343
|
+
### Step 6: Iterate
|
|
344
|
+
|
|
345
|
+
After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.
|
|
346
|
+
|
|
347
|
+
**Iteration workflow:**
|
|
348
|
+
|
|
349
|
+
1. Use the skill on real tasks
|
|
350
|
+
2. Notice struggles or inefficiencies
|
|
351
|
+
3. Identify how SKILL.md or bundled resources should be updated
|
|
352
|
+
4. Implement changes and test again
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Output Patterns
|
|
2
|
+
|
|
3
|
+
Use these patterns when skills need to produce consistent, high-quality output.
|
|
4
|
+
|
|
5
|
+
## Template Pattern
|
|
6
|
+
|
|
7
|
+
Provide templates for output format. Match the level of strictness to your needs.
|
|
8
|
+
|
|
9
|
+
**For strict requirements (like API responses or data formats):**
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
## Report structure
|
|
13
|
+
|
|
14
|
+
ALWAYS use this exact template structure:
|
|
15
|
+
|
|
16
|
+
# [Analysis Title]
|
|
17
|
+
|
|
18
|
+
## Executive summary
|
|
19
|
+
[One-paragraph overview of key findings]
|
|
20
|
+
|
|
21
|
+
## Key findings
|
|
22
|
+
- Finding 1 with supporting data
|
|
23
|
+
- Finding 2 with supporting data
|
|
24
|
+
- Finding 3 with supporting data
|
|
25
|
+
|
|
26
|
+
## Recommendations
|
|
27
|
+
1. Specific actionable recommendation
|
|
28
|
+
2. Specific actionable recommendation
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**For flexible guidance (when adaptation is useful):**
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
## Report structure
|
|
35
|
+
|
|
36
|
+
Here is a sensible default format, but use your best judgment:
|
|
37
|
+
|
|
38
|
+
# [Analysis Title]
|
|
39
|
+
|
|
40
|
+
## Executive summary
|
|
41
|
+
[Overview]
|
|
42
|
+
|
|
43
|
+
## Key findings
|
|
44
|
+
[Adapt sections based on what you discover]
|
|
45
|
+
|
|
46
|
+
## Recommendations
|
|
47
|
+
[Tailor to the specific context]
|
|
48
|
+
|
|
49
|
+
Adjust sections as needed for the specific analysis type.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Examples Pattern
|
|
53
|
+
|
|
54
|
+
For skills where output quality depends on seeing examples, provide input/output pairs:
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
## Commit message format
|
|
58
|
+
|
|
59
|
+
Generate commit messages following these examples:
|
|
60
|
+
|
|
61
|
+
**Example 1:**
|
|
62
|
+
Input: Added user authentication with JWT tokens
|
|
63
|
+
Output:
|
|
64
|
+
```
|
|
65
|
+
feat(auth): implement JWT-based authentication
|
|
66
|
+
|
|
67
|
+
Add login endpoint and token validation middleware
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Example 2:**
|
|
71
|
+
Input: Fixed bug where dates displayed incorrectly in reports
|
|
72
|
+
Output:
|
|
73
|
+
```
|
|
74
|
+
fix(reports): correct date formatting in timezone conversion
|
|
75
|
+
|
|
76
|
+
Use UTC timestamps consistently across report generation
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Follow this style: type(scope): brief description, then detailed explanation.
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Examples help Claude understand the desired style and level of detail more clearly than descriptions alone.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Workflow Patterns
|
|
2
|
+
|
|
3
|
+
## Sequential Workflows
|
|
4
|
+
|
|
5
|
+
For complex tasks, break operations into clear, sequential steps. It is often helpful to give Claude an overview of the process towards the beginning of SKILL.md:
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
Filling a PDF form involves these steps:
|
|
9
|
+
|
|
10
|
+
1. Analyze the form (run analyze_form.py)
|
|
11
|
+
2. Create field mapping (edit fields.json)
|
|
12
|
+
3. Validate mapping (run validate_fields.py)
|
|
13
|
+
4. Fill the form (run fill_form.py)
|
|
14
|
+
5. Verify output (run verify_output.py)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Conditional Workflows
|
|
18
|
+
|
|
19
|
+
For tasks with branching logic, guide Claude through decision points:
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
1. Determine the modification type:
|
|
23
|
+
**Creating new content?** → Follow "Creation workflow" below
|
|
24
|
+
**Editing existing content?** → Follow "Editing workflow" below
|
|
25
|
+
|
|
26
|
+
2. Creation workflow: [steps]
|
|
27
|
+
3. Editing workflow: [steps]
|
|
28
|
+
```
|