|
| 1 | +--- |
| 2 | +name: capsule-creator |
| 3 | +description: > |
| 4 | + Create AI skill capsules for the IXO Skills Server. Guides you through |
| 5 | + writing SKILL.md files with valid frontmatter, organizing skill resources, |
| 6 | + packaging capsules as tar.gz archives, validating structure, and uploading |
| 7 | + to the skills API at capsules.skills.ixo.earth. |
| 8 | +metadata: |
| 9 | + author: ixoworld |
| 10 | + version: "1.0.0" |
| 11 | + category: developer-tools |
| 12 | +--- |
| 13 | + |
| 14 | +# Capsule Creator |
| 15 | + |
| 16 | +Create and publish AI skill capsules to the IXO Skills Server. |
| 17 | + |
| 18 | +A **capsule** is a gzip-compressed tar archive (`.tar.gz`) containing a skill directory with a `SKILL.md` file and optional supporting resources. Capsules are uploaded to `https://capsules.skills.ixo.earth/` where they receive a content-addressed identifier (CID). |
| 19 | + |
| 20 | +## Capsule Structure |
| 21 | + |
| 22 | +``` |
| 23 | +skill-name/ |
| 24 | +├── SKILL.md # REQUIRED - Skill definition with YAML frontmatter + instructions |
| 25 | +├── scripts/ # Optional - Helper scripts (Python, TypeScript, Bash) |
| 26 | +├── prompts/ # Optional - Additional prompt files |
| 27 | +├── examples/ # Optional - Usage examples |
| 28 | +├── templates/ # Optional - Template files |
| 29 | +└── LICENSE.txt # Optional - Skill-specific license |
| 30 | +``` |
| 31 | + |
| 32 | +The only required file is `SKILL.md`. Everything else is optional. |
| 33 | + |
| 34 | +## SKILL.md Format |
| 35 | + |
| 36 | +Every `SKILL.md` must begin with YAML frontmatter between `---` delimiters, followed by markdown instructions for the AI agent. |
| 37 | + |
| 38 | +### Frontmatter Schema |
| 39 | + |
| 40 | + --- |
| 41 | + name: skill-name # REQUIRED. 1-64 chars. Must match folder name. |
| 42 | + # Pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$ |
| 43 | + # Lowercase alphanumeric with single hyphens only. |
| 44 | + # No leading/trailing hyphens, no consecutive hyphens. |
| 45 | + |
| 46 | + description: > # REQUIRED. 1-1024 chars. |
| 47 | + A clear description of what this skill does and when to use it. |
| 48 | + |
| 49 | + license: Apache-2.0 # OPTIONAL. String. |
| 50 | + |
| 51 | + compatibility: # OPTIONAL. String or list. |
| 52 | + - claude |
| 53 | + |
| 54 | + allowed-tools: # OPTIONAL. List of tool names the skill needs. |
| 55 | + - Bash |
| 56 | + - Read |
| 57 | + - Write |
| 58 | + - Edit |
| 59 | + |
| 60 | + metadata: # OPTIONAL. Key-value pairs (max 20 pairs). |
| 61 | + author: Your Name # Keys: max 64 chars. Values: max 1024 chars. |
| 62 | + version: "1.0.0" # All values must be strings. |
| 63 | + category: productivity |
| 64 | + --- |
| 65 | + |
| 66 | +### Required Fields |
| 67 | + |
| 68 | +| Field | Rules | |
| 69 | +|-------|-------| |
| 70 | +| `name` | 1-64 chars, lowercase kebab-case (`^[a-z0-9]+(?:-[a-z0-9]+)*$`), must match directory name | |
| 71 | +| `description` | 1-1024 chars, describes what the skill does and when to trigger it | |
| 72 | + |
| 73 | +### Optional Fields |
| 74 | + |
| 75 | +| Field | Rules | |
| 76 | +|-------|-------| |
| 77 | +| `license` | Any string (e.g., `MIT`, `Apache-2.0`) | |
| 78 | +| `compatibility` | String or list, max 500 chars | |
| 79 | +| `allowed-tools` | List of tool name strings | |
| 80 | +| `metadata` | Object with max 20 key-value pairs, string values only | |
| 81 | + |
| 82 | +### Markdown Body |
| 83 | + |
| 84 | +After the closing `---`, write markdown instructions that tell the AI agent how to use the skill. This is what gets loaded when the skill is activated. Include: |
| 85 | + |
| 86 | +- Overview of what the skill does |
| 87 | +- Step-by-step usage instructions |
| 88 | +- Script invocation commands (if scripts are included) |
| 89 | +- Examples and templates |
| 90 | + |
| 91 | +## Validation |
| 92 | + |
| 93 | +Before packaging, validate your skill: |
| 94 | + |
| 95 | +```bash |
| 96 | +./scripts/validate-skill.sh skills/your-skill-name |
| 97 | +``` |
| 98 | + |
| 99 | +This checks: |
| 100 | +1. Folder name matches the required pattern |
| 101 | +2. Folder name is 1-64 characters |
| 102 | +3. `SKILL.md` exists and is valid UTF-8 |
| 103 | +4. YAML frontmatter is present and valid |
| 104 | +5. `name` field matches folder name |
| 105 | +6. `description` is present and under 1024 characters |
| 106 | + |
| 107 | +## Packaging a Capsule |
| 108 | + |
| 109 | +Package your skill directory into a tar.gz archive: |
| 110 | + |
| 111 | +```bash |
| 112 | +# From the repository root |
| 113 | +tar -czf skill-name.tar.gz -C skills skill-name |
| 114 | +``` |
| 115 | + |
| 116 | +This creates a gzip-compressed tar archive with the skill directory at the root. |
| 117 | + |
| 118 | +### Verify the archive contents |
| 119 | + |
| 120 | +```bash |
| 121 | +tar -tzf skill-name.tar.gz |
| 122 | +``` |
| 123 | + |
| 124 | +Expected output: |
| 125 | +``` |
| 126 | +skill-name/ |
| 127 | +skill-name/SKILL.md |
| 128 | +skill-name/scripts/ |
| 129 | +skill-name/scripts/helper.py |
| 130 | +... |
| 131 | +``` |
| 132 | + |
| 133 | +## Uploading to the Skills Server |
| 134 | + |
| 135 | +Upload the capsule to the IXO Skills Server API: |
| 136 | + |
| 137 | +```bash |
| 138 | +curl -X POST https://capsules.skills.ixo.earth/capsules \ |
| 139 | + -H "Authorization: Bearer $SKILLS_API_KEY" \ |
| 140 | + -H "Content-Type: application/gzip" \ |
| 141 | + --data-binary @skill-name.tar.gz |
| 142 | +``` |
| 143 | + |
| 144 | +### Response |
| 145 | + |
| 146 | +On success (HTTP 200 or 201), the API returns a JSON response with a content-addressed identifier: |
| 147 | + |
| 148 | +```json |
| 149 | +{ |
| 150 | + "cid": "bafyrei..." |
| 151 | +} |
| 152 | +``` |
| 153 | + |
| 154 | +### Retrieving a Published Capsule |
| 155 | + |
| 156 | +```bash |
| 157 | +curl https://capsules.skills.ixo.earth/capsules/{cid} --output skill.tar.gz |
| 158 | +``` |
| 159 | + |
| 160 | +## Complete Example |
| 161 | + |
| 162 | +Here is a complete example of creating and publishing a skill: |
| 163 | + |
| 164 | +### 1. Create the skill directory |
| 165 | + |
| 166 | +```bash |
| 167 | +mkdir -p skills/my-helper/scripts |
| 168 | +``` |
| 169 | + |
| 170 | +### 2. Write SKILL.md |
| 171 | + |
| 172 | +```markdown |
| 173 | + --- |
| 174 | +name: my-helper |
| 175 | +description: > |
| 176 | + A helper skill that demonstrates the capsule creation process. |
| 177 | + Use this when you need an example of skill packaging. |
| 178 | +license: MIT |
| 179 | +metadata: |
| 180 | + author: Your Name |
| 181 | + version: "1.0.0" |
| 182 | + --- |
| 183 | + |
| 184 | +# My Helper Skill |
| 185 | + |
| 186 | +Instructions for the AI agent go here. |
| 187 | + |
| 188 | +## Usage |
| 189 | + |
| 190 | +Run the helper script: |
| 191 | + |
| 192 | +\`\`\`bash |
| 193 | +python scripts/helper.py <input> |
| 194 | +\`\`\` |
| 195 | +``` |
| 196 | + |
| 197 | +### 3. Add scripts (optional) |
| 198 | + |
| 199 | +```python |
| 200 | +#!/usr/bin/env python3 |
| 201 | +"""Helper script. Usage: python helper.py <input>""" |
| 202 | +import sys |
| 203 | + |
| 204 | +def main(input_text=None, **kwargs): |
| 205 | + return f"Processed: {input_text}" |
| 206 | + |
| 207 | +if __name__ == '__main__': |
| 208 | + if len(sys.argv) < 2: |
| 209 | + print("Usage: python helper.py <input>") |
| 210 | + sys.exit(1) |
| 211 | + print(main(input_text=sys.argv[1])) |
| 212 | +``` |
| 213 | + |
| 214 | +### 4. Validate |
| 215 | + |
| 216 | +```bash |
| 217 | +./scripts/validate-skill.sh skills/my-helper |
| 218 | +``` |
| 219 | + |
| 220 | +### 5. Package |
| 221 | + |
| 222 | +```bash |
| 223 | +tar -czf my-helper.tar.gz -C skills my-helper |
| 224 | +``` |
| 225 | + |
| 226 | +### 6. Upload |
| 227 | + |
| 228 | +```bash |
| 229 | +curl -X POST https://capsules.skills.ixo.earth/capsules \ |
| 230 | + -H "Authorization: Bearer $SKILLS_API_KEY" \ |
| 231 | + -H "Content-Type: application/gzip" \ |
| 232 | + --data-binary @my-helper.tar.gz |
| 233 | +``` |
| 234 | + |
| 235 | +## Publishing via Pull Request |
| 236 | + |
| 237 | +Alternatively, submit skills to the `ixoworld/ixo-agent-skills` repository via pull request: |
| 238 | + |
| 239 | +1. Fork the repository |
| 240 | +2. Add your skill directory under `skills/` |
| 241 | +3. Run validation: `./scripts/validate-skill.sh skills/your-skill-name` |
| 242 | +4. Submit a PR targeting `main` |
| 243 | +5. On merge, the CI pipeline automatically packages and uploads your skill |
0 commit comments