Skip to content

Commit 5a48dd3

Browse files
committed
Add skills doc
1 parent a6da1f4 commit 5a48dd3

File tree

1 file changed

+239
-0
lines changed

1 file changed

+239
-0
lines changed

web/src/content/tips/skills.mdx

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
---
2+
title: 'Skills'
3+
section: 'tips'
4+
tags: ['skills', 'customization', 'reusable']
5+
order: 5
6+
---
7+
8+
# Skills
9+
10+
Skills are reusable instruction sets that Codebuff can load on-demand. They let you define domain-specific knowledge, workflows, and behaviors that the agent can invoke when needed.
11+
12+
## Why Use Skills?
13+
14+
- **Reusability** — Define instructions once, use them across multiple conversations
15+
- **On-demand loading** — Skills are only loaded when needed, keeping context clean
16+
- **Shareable** — Store skills globally or per-project, share with your team
17+
- **Slash commands** — Every skill becomes a `/skill:name` command you can trigger directly
18+
19+
## Creating a Skill
20+
21+
### 1. Create the skill directory
22+
23+
Skills live in a `skills` directory inside `.agents/` or `.claude/`:
24+
25+
```
26+
.agents/skills/my-skill/
27+
```
28+
29+
### 2. Create the SKILL.md file
30+
31+
Each skill needs a `SKILL.md` file with YAML frontmatter:
32+
33+
```markdown
34+
---
35+
name: my-skill
36+
description: A short description of what this skill does and when to invoke it
37+
license: MIT
38+
metadata:
39+
category: development
40+
---
41+
42+
# My Skill
43+
44+
Your skill instructions go here...
45+
46+
## Knowledge
47+
48+
Background information and helpful context goes here.
49+
50+
## Instructions
51+
52+
1. Step one
53+
2. Step two
54+
3. Step three
55+
```
56+
57+
### Frontmatter Fields
58+
59+
- **`name`** (required) — Skill name (1-64 chars, lowercase alphanumeric with hyphens)
60+
- **`description`** (required) — Short description (1-1024 chars) shown when browsing skills
61+
- **`metadata`** (optional) — Key-value pairs for additional categorization
62+
63+
### Name Validation Rules
64+
65+
Skill names must:
66+
- Be 1-64 characters long
67+
- Use only lowercase letters, numbers, and hyphens
68+
- Not start or end with a hyphen
69+
- Not contain consecutive hyphens
70+
- Match the directory name exactly
71+
72+
**Valid:** `git-release`, `api-design`, `review2`, `deploy-prod`
73+
74+
**Invalid:** `Git-Release`, `my--skill`, `-skill`, `skill-`
75+
76+
## Discovery Locations
77+
78+
Skills are loaded from these locations, in order of priority (later overrides earlier):
79+
80+
1. `~/.claude/skills/` — Global (Claude Code compatible)
81+
2. `~/.agents/skills/` — Global
82+
3. `.claude/skills/` — Project (Claude Code compatible)
83+
4. `.agents/skills/` — Project (highest priority)
84+
85+
Project skills override global skills with the same name. The `.claude/` paths provide compatibility with Claude Code.
86+
87+
## Using Skills
88+
89+
### Slash Commands
90+
91+
Every skill becomes a slash command. Type `/skill:` to see available skills:
92+
93+
```
94+
/skill:git-release
95+
```
96+
97+
This loads the skill's instructions into the conversation.
98+
99+
### Agent Tool Invocation
100+
101+
Codebuff can also load skills automatically via the `skill` tool when it determines a skill is relevant. The agent sees available skills listed in its tool description and can call:
102+
103+
```typescript
104+
skill({ name: "my-skill" })
105+
```
106+
107+
The full `SKILL.md` content is then loaded into the conversation context.
108+
109+
## Example: Git Release Skill
110+
111+
Here's a practical example of a skill for managing releases:
112+
113+
```markdown
114+
---
115+
name: git-release
116+
description: Guidelines for creating Git releases with semantic versioning
117+
metadata:
118+
category: git
119+
audience: developers
120+
---
121+
122+
# Git Release Workflow
123+
124+
Use this skill when creating a new release.
125+
126+
## Versioning
127+
128+
Follow semantic versioning (semver):
129+
- **MAJOR** (1.0.0) — Breaking changes
130+
- **MINOR** (0.1.0) — New features, backward compatible
131+
- **PATCH** (0.0.1) — Bug fixes, backward compatible
132+
133+
## Release Checklist
134+
135+
1. Ensure all tests pass
136+
2. Update CHANGELOG.md with release notes
137+
3. Bump version in package.json
138+
4. Create a git tag: `git tag v1.2.3`
139+
5. Push with tags: `git push --follow-tags`
140+
141+
## Commit Message Format
142+
143+
Use conventional commits:
144+
- `feat:` — New feature
145+
- `fix:` — Bug fix
146+
- `docs:` — Documentation
147+
- `chore:` — Maintenance
148+
```
149+
150+
## Example: Code Review Skill
151+
152+
```markdown
153+
---
154+
name: review
155+
description: Code review checklist and guidelines
156+
metadata:
157+
category: quality
158+
---
159+
160+
# Code Review Guidelines
161+
162+
## What to Check
163+
164+
1. **Correctness** — Does the code do what it's supposed to?
165+
2. **Tests** — Are there adequate tests?
166+
3. **Security** — Any potential vulnerabilities?
167+
4. **Performance** — Any obvious inefficiencies?
168+
5. **Readability** — Is the code clear and well-documented?
169+
170+
## Feedback Style
171+
172+
- Be constructive and specific
173+
- Suggest alternatives, don't just criticize
174+
- Acknowledge good patterns
175+
```
176+
177+
## Best Practices
178+
179+
### Keep Skills Focused
180+
181+
Each skill should have a single, clear purpose. Instead of one large "development" skill, create separate skills:
182+
183+
- `git-release` — Release workflow
184+
- `api-design` — API design guidelines
185+
- `testing` — Testing conventions
186+
187+
### Write Clear Descriptions
188+
189+
The description is what Codebuff sees when deciding whether to load a skill. Make it specific:
190+
191+
**Good:** `Guidelines for creating Git releases with semantic versioning and changelog updates`
192+
193+
**Bad:** `Git stuff`
194+
195+
### Use Metadata for Organization
196+
197+
Metadata helps categorize skills:
198+
199+
```yaml
200+
metadata:
201+
category: deployment
202+
language: typescript
203+
framework: nextjs
204+
```
205+
206+
## Global vs Project Skills
207+
208+
**Global skills** (`~/.agents/skills/`):
209+
- Personal workflows
210+
- Cross-project tools
211+
- Your coding preferences
212+
213+
**Project skills** (`.agents/skills/`):
214+
- Team conventions
215+
- Project-specific processes
216+
- Codebase-specific knowledge
217+
218+
## Troubleshooting
219+
220+
### Skill Not Appearing
221+
222+
1. Check the directory structure: `project-root/.agents/skills/my-skill/SKILL.md`
223+
2. Verify the name in frontmatter matches the directory name
224+
3. Ensure the name follows validation rules (lowercase, hyphens only)
225+
4. Restart Codebuff to reload skills
226+
227+
### Invalid Frontmatter
228+
229+
Ensure your YAML frontmatter:
230+
- Starts and ends with `---`
231+
- Has required `name` and `description` fields
232+
- Uses valid YAML syntax
233+
234+
```markdown
235+
---
236+
name: my-skill
237+
description: This is required
238+
---
239+
```

0 commit comments

Comments
 (0)