/writing-skills:writing-skillsfrom writing-skills
Creates well-structured Agent Skills for Claude Code. Guides through SKILL.md structure, naming conventions, and best practices. Use when creating new skills, improving existing ones, or when the user asks about skill authoring.
Ships in writing-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Initialize a new skill:
python ~/.claude/skills/writing-skills/scripts/init_skill.py my-skill-name
Or copy this template manually:
---
name: your-skill-name
description: What this skill does and when to use it. Write in third person.
---
# Your Skill Name
## Quick Start
[Minimal working example]
## Instructions
[Clear, step-by-step guidance]
Save as SKILL.md in ~/.claude/skills/your-skill/ or .claude/skills/your-skill/.
Note: Custom slash commands (.claude/commands/) have been merged into skills. Both work identically, but skills support additional features like bundled files and frontmatter options.
Skills follow the agentskills.io open specification, adopted by 25+ AI tools including Claude Code, Cursor, GitHub Copilot, VS Code, and others.
Key concepts:
Platform deployment:
| Platform | Discovery | Installation |
|---|---|---|
| Claude Code | Filesystem (~/.claude/skills/) | Manual or plugin marketplace |
| Claude Apps | Skills UI | Upload or marketplace |
| API | Skills API | Programmatic registration |
Plugin installation (Claude Code):
/plugin marketplace add anthropics/skills
Example skills: github.com/anthropics/skills
Before building, gather examples of how the skill will be used:
For each example, identify what would help Claude execute repeatedly:
python ~/.claude/skills/writing-skills/scripts/init_skill.py skill-name --path ~/.claude/skills
Write SKILL.md and create necessary resources. Delete unused example files.
python ~/.claude/skills/writing-skills/scripts/quick_validate.py ~/.claude/skills/skill-name
Use the skill, notice inefficiencies, improve, repeat.
Skills can contain different types of instructions:
Adds knowledge Claude applies to your current work. Runs inline with conversation context.
---
name: api-conventions
description: API design patterns for this codebase
---
When writing API endpoints:
- Use RESTful naming conventions
- Return consistent error formats
- Include request validation
Step-by-step instructions for specific actions. Often triggered manually.
---
name: deploy
description: Deploy the application to production
context: fork
disable-model-invocation: true
---
Deploy the application:
1. Run the test suite
2. Build the application
3. Push to the deployment target
Tip: If you use context: fork on a guideline-only skill, the subagent gets guidelines but no task, and returns without meaningful output.
The context window is shared. Only add information Claude doesn't already know.
Good (~50 tokens):
## Extract PDF text
Use pdfplumber:
import pdfplumber
with pdfplumber.open("file.pdf") as pdf:
text = pdf.pages[0].extract_text()
Bad (~150 tokens):
## Extract PDF text
PDF (Portable Document Format) files are a common file format...
[Claude already knows what PDFs are]
Claude matches skills by analyzing the description field. Include specific
trigger words that users would naturally say:
Good (specific triggers):
description: Extracts text from PDF files, fills PDF forms, merges PDFs.
Use when working with PDF documents or when user mentions "PDF", "form filling",
or "document extraction".
Bad (vague, no triggers):
description: Helps with documents.
Think: "What would a user say that should activate this skill?"
Match specificity to task fragility:
| Freedom Level | Use When | Example |
|---|---|---|
| High (text instructions) | Multiple valid approaches, context-dependent | "Use your judgment for formatting" |
| Medium (templates with params) | Preferred pattern exists, some variation OK | "Follow this template, adapt sections as needed" |
| Low (exact scripts) | Fragile operations, consistency critical | "Run this exact script with these parameters" |
Keep SKILL.md under 500 lines. Split detailed content into separate files:
my-skill/
├── SKILL.md # Overview, quick start (<500 lines)
├── scripts/ # Executable code
├── references/ # Detailed docs (loaded on-demand)
└── assets/ # Templates, images (not loaded into context)
Reference with: See [REFERENCE.md](references/reference.md) for details
Skills should only contain essential files. Do NOT create:
See STRUCTURE.md for complete requirements:
writing-skills, processing-pdfs)See PATTERNS.md for detailed examples:
context: fork!command`` syntaxValidate your skill:
python ~/.claude/skills/writing-skills/scripts/quick_validate.py path/to/skill
See CHECKLIST.md for the complete validation checklist.
Quick checks:
# Bad: Confusing
"You can use pypdf, or pdfplumber, or PyMuPDF, or..."
# Good: Default with escape hatch
"Use pdfplumber for text extraction. For scanned PDFs requiring OCR, use pdf2image with pytesseract instead."
# Bad: Too deep
SKILL.md → advanced.md → details.md → actual info
# Good: One level deep
SKILL.md → reference.md (contains actual info)
# Bad: Will become wrong
"If you're doing this before August 2025, use the old API."
# Good: Use "old patterns" section
## Current method
Use the v2 API endpoint.
## Old patterns
<details>
<summary>Legacy v1 API (deprecated)</summary>
[Historical context]
</details>
# Bad: Just fails
def process_file(path):
return open(path).read()
# Good: Handles errors explicitly
def process_file(path):
try:
with open(path) as f:
return f.read()
except FileNotFoundError:
print(f"File {path} not found")
return None
If publishing a skill publicly, sanitize examples and references:
# Bad: Leaks internal details
curl "https://api.internal-company.com/v2/users"
SPACE_KEY="CompanySecrets"
> "As John from Engineering explained in the Q3 review..."
# Good: Generic examples
curl "https://api.example.com/v2/users"
SPACE_KEY="MYSPACE"
> "As the presenter explained..."
Check for:
Skills in Claude Code are filesystem-based:
~/.claude/skills/ (personal - all projects).claude/skills/ (project-specific)packages/frontend/ also finds packages/frontend/.claude/skills/allowed-tools to reduce approval promptscontext: fork with agent field for isolated execution.claude/commands/ files work as skills (skills take precedence on name conflict)For cross-platform design, keep SKILL.md self-contained and avoid platform-specific tool references in core instructions.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mdsakalu/agent-plugins --plugin writing-skills