Blame

e3f7cf Thai Pangsakulyanont 2026-01-29 08:49:36 1
---
2
name: agent-skills
bc647c Thai Pangsakulyanont 2026-02-17 12:01:29 3
description: 'Use this when: (1) Creating a new project-specific skill to document project patterns, (2) Improving or updating an existing project skill, (3) Writing skill descriptions that will trigger other agents, (4) Organizing skill content for progressive disclosure, or (5) Learning what project-specific skills exist in .claude/skills/. Ensures skills follow project conventions and provide effective progressive disclosure.'
e3f7cf Thai Pangsakulyanont 2026-01-29 08:49:36 4
---
5
bc647c Thai Pangsakulyanont 2026-02-17 12:01:29 6
## What Skills Are
7
8
Skills are **maps, not territory**. They load relevant knowledge into context at the right moment without bloating the initial system prompt. A skill should provide enough context to work effectively without trying to be comprehensive documentation.
9
10
- **Purpose**: Progressive disclosure - load context on demand
11
- **Length**: Usually 60-100 lines of focused content
12
- **Structure**: Minimal front matter, practical content, pointers to where knowledge lives
13
14
## Project-Specific vs Global Skills
15
16
**Project-specific skills** (in repository `.claude/skills/`):
17
- Live in this project's repository
18
- Scope: Document this project's specific patterns, tools, and conventions (not generic best practices)
19
- Freely create, update, and maintain these skills
20
- To see what's available: `ls -la .claude/skills/`
21
22
**Globally-installed skills** (system-wide):
23
- Broader scope: Generic tools and workflows
24
- May be used across different projects and harnesses
25
26
**Finding a skill's base path**: When you invoke any skill, the skill harness prints the base directory at the start (e.g., "Base directory for this skill: /path/to/skill-name"). Use this to navigate to and edit the skill's files.
27
28
**Workflow for improving skills**:
29
- **Project-specific skills**: Update directly as needed to improve the project
30
- **Globally-installed skills**: Suggest improvements to the user and ask for confirmation before modifying, since these skills may be used across different projects and environments
31
32
## When to Create or Update a Project-Specific Skill
33
34
Create a project-specific skill when:
35
- Multiple agents will benefit from the same specialized knowledge
36
- The knowledge is project-specific (not generic tutorials)
37
- It addresses a common workflow or pattern (testing, i18n, deployment, etc.)
38
- It would otherwise be repeated across multiple system prompts
39
40
Update a project-specific skill when:
41
- Important patterns or workflows change
42
- Configuration files are updated
43
- New project conventions are established
44
- Existing guidance is incorrect or outdated
45
46
## Core Principles
47
48
### 1. Point to Real Code, Not Examples
49
50
- **DO**: "Study existing tests in `spec/controllers/` to understand patterns"
51
- **DON'T**: Include code examples that can become outdated
52
- **Exception**: Very short, unchanging snippets (bash commands, command syntax) are OK
53
- **Why**: Live code is authoritative; examples rot
54
55
### 2. Cite Sources with Traceability
56
57
- **DO**: Point to files where patterns are defined (`spec/rails_helper.rb`, `playwright.config.ts`, etc.)
58
- **DO**: Note important configuration details from actual files
59
- **DON'T**: Include line numbers (they change, create false precision)
60
- **Why**: Readers can verify and understand context
61
62
### 3. Verify Against Reality
63
64
- **Before writing**: Read actual configuration files and code
65
- **When uncertain**: Check the implementation rather than making assumptions
66
- **Test claims**: Ensure stated behavior matches actual behavior
67
- **Why**: Misinformation spreads through skills; verification prevents it
68
69
### 4. Accuracy Over Brevity
70
71
- **DO**: Use more words if it increases clarity
72
- **DO**: Distinguish between similar concepts clearly
73
- **DON'T**: Sacrifice precision for snappiness
74
- **Why**: "Queuing without executing" is clearer than "just queuing them"
75
76
### 5. Project-Specific Over Generic
77
78
- **DO**: Document how YOUR project does things ("we access helpers via App getters")
79
- **DON'T**: Include generic best practices ("separate your concerns")
80
- **DO**: Explain implementation details that aren't obvious from code
81
- **Why**: Generic advice is everywhere; project specifics are valuable
82
83
### 6. Scaffold Exploration
84
85
- **DO**: Say "study X to understand conventions"
86
- **DO**: Explain where to find patterns ("study existing files in in `spec/controllers/`")
87
- **DON'T**: Prescribe rules as if they're laws
88
- **Why**: Real learning happens when agents explore actual code
89
90
## Skill Structure
91
92
### Front Matter
93
```yaml
94
---
95
name: skill-name
96
description: 'Description that will be loaded into the system prompt. Must clearly state specific trigger points for when agents should use this skill. The description is the primary mechanism for triggering skill usage, so avoid generic statements like "use this for testing" and instead specify: "Use this when: (1) Running RSpec tests, (2) Debugging test failures, (3) Writing new test files."'
97
---
98
```
99
100
**Important**: The `name` must exactly match the folder name (e.g., folder `playwright-testing` → name `playwright-testing`).
101
102
### Content Organization
103
104
- **Start with context** - What is this skill about? When should it be used? What problems does it solve?
105
- **Organize by workflow or concept** - Use clear section headers, group related information, build from simple to complex
106
- **Point to implementation** - Reference actual files, directories, and where configuration lives
107
- **Suggest what to study** - Direct readers to real code patterns before working
108
- **End with important details** - Configuration notes, common patterns, edge cases, or constraints
109
110
## Common Mistakes to Avoid
111
112
1. **Over-Specification** - Don't include line numbers or overly specific implementation details that will change. Point to files and patterns instead.
113
2. **Stale Examples** - Don't include code examples in the body. Point readers to actual implementations to study.
114
3. **Generic Advice** - Don't include universal best practices. Document domain-specific patterns and conventions.
115
4. **Missing Context** - Always clarify why something is done a certain way, not just what to do.
116
5. **Ignoring Reality** - Verify all claims against actual code before writing. Misinformation spreads through skills.
117
118
## Writing Process
119
120
1. **Study existing skills** - Before creating a new skill, review existing skills in the project to understand conventions, style, and structure. This ensures consistency and prevents duplicating existing content.
121
2. **Understand the domain** - Study existing code, configuration, and patterns in the project
122
3. **Identify scope** - What specific knowledge should this skill contain?
123
4. **Map to sources** - Where in the codebase or documentation does this knowledge live?
124
5. **Write minimally** - What's the smallest amount of context needed?
125
6. **Verify claims** - Check that everything stated matches reality by reading actual code
126
7. **Cite sources** - Point readers to where they can learn more (files, directories, configurations)
127
8. **Study-driven guidance** - Direct people to real implementations, don't prescribe rules
128
129
## Maintenance
130
131
Skills should be updated when:
132
- Configuration files change (update file references, configuration notes)
133
- Patterns evolve (update guidance on how things are done)
134
- New tools or approaches are adopted (add sections for new workflows)
135
- Guidance is found to be incorrect (verify, fix, and understand why it was wrong)
136
137
Always verify changes against actual code before updating a skill.