Agent skill
new-skill
Create a new Claude Code skill with proper structure and effective description. Use when creating a new skill, or when the /done skill proposes a new skill and the user approves. Also use when refactoring CLAUDE.md content into a skill.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/new-skill-musserlab-lab-claude-skills
SKILL.md
Creating a New Skill
Follow these steps when creating a new skill, whether proposed during /done or requested directly.
1. Confirm Scope
Before creating, verify the pattern actually warrants a skill (not just a CLAUDE.md entry):
- Too detailed for CLAUDE.md — needs code examples, decision trees, or multi-section docs
- Reusable across sessions — will be needed repeatedly
- Complex enough to get wrong — without it, Claude might make mistakes or ask the same questions each session
If it's a simple one-liner convention, put it in the project CLAUDE.md instead.
2. Determine Level
Ask the user if not already decided:
- Project-level (
{project}/.claude/skills/{name}/SKILL.md) — Specific to one project. Examples: gene naming conventions, project-specific data formats, project-specific workflows. - User-level (
~/.claude/skills/{name}/SKILL.md) — Applies across multiple projects. Examples: plotting conventions, environment management, export formats.
3. Write an Effective Description
The description field in YAML frontmatter is the single most important part of a skill — it determines whether the skill gets activated. Follow these rules:
Front-load trigger conditions
The first sentence should say WHEN to use the skill, not just WHAT it does.
# BAD — describes what, not when:
description: R ggplot2 plotting conventions and theme.
# GOOD — front-loads triggers:
description: R ggplot2 plotting conventions and theme. Use when creating, modifying, or styling ggplot2 plots in R, or when adjusting plot themes, colors, labels, or formatting.
List concrete triggers
Be specific about what actions or contexts should activate the skill. Use verbs: "creating", "modifying", "saving", "debugging", "exporting".
# BAD — too vague:
description: Use when working with files.
# GOOD — specific actions:
description: Use when overwriting existing files, deleting files, or writing to directories that contain important data (data/, outs/).
Add explicit exclusions when needed
If the skill could be confused with similar skills, add "Do NOT load for" clauses.
description: >
Quarto document conventions for data science analysis scripts (.qmd).
Use when creating or rendering .qmd analysis scripts in data science projects.
Do NOT load for Quarto books, websites, or documentation projects.
Cover edge cases in triggers
Think about variations of the task that should also trigger the skill:
| Core trigger | Edge cases to include |
|---|---|
| "creating plots" | modifying, styling, fixing, adjusting themes |
| "saving figures" | choosing formats, setting DPI, export dimensions |
| "committing changes" | writing commit messages, creating branches, making PRs |
Keep it scannable
The description should be 1-3 sentences. If it needs more, use the multi-line > YAML syntax. Put the most important trigger first.
4. YAML Frontmatter Template
---
name: skill-name
description: >
One-sentence summary of what the skill covers.
Use when [specific trigger 1], [specific trigger 2], or [specific trigger 3].
Do NOT load for [exclusion 1] or [exclusion 2].
user-invocable: false
---
Fields:
name— kebab-case, matches the directory namedescription— trigger-focused (see rules above)user-invocable—trueonly if the user triggers it with/name(like/done,/publish). Most skills arefalse(auto-loaded based on context).
5. Skill Content Structure
After the frontmatter, organize the skill body:
- Title —
# Skill Name - Context/purpose — 1-2 sentences on why this skill exists
- Rules/conventions — The actual content, organized with
##sections - Code examples — When patterns need to be shown, include both R and Python if applicable
- Common mistakes — What goes wrong without this skill (helps justify its existence)
Keep it focused. A skill should cover one coherent topic, not be a grab-bag.
6. File Workflow
- Create/edit in
~/.claude/skills/{name}/SKILL.md - Use generic paths (e.g.,
~/miniconda3, not/Users/username/miniconda3) so skills are portable across machines
7. Register in User CLAUDE.md
After creating a new user-level skill, add it to the appropriate table in ~/.claude/CLAUDE.md under "Available Skills":
- General skills table — if it applies to all project types
- Data Science skills table — if it only applies to data science projects
Project-level skills don't need registration in the user CLAUDE.md — they're discovered automatically from the project's .claude/skills/ directory.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?