How to Create Claude Code Skills with PyTorch's skill-writer
Want to create a Claude Code skill but unsure where to start? Confused about SKILL.md formatting or frontmatter requirements?
This article explains how to efficiently create Agent Skills for Claude Code using the skill-writer skill from the PyTorch repository.
What This Skill Does
skill-writer provides step-by-step guidance for creating Claude Code Agent Skills:
- Scope definition and storage location selection
- SKILL.md frontmatter writing (name/description fields)
- Effective description authoring (directly impacts trigger accuracy)
- Directory structure and supporting file design
- Validation checklist and debugging procedures
Useful for both first-time skill creators and developers improving existing skills.
Installation
Prerequisites
- Claude Code installed
Install Command
claude mcp add github.com/pytorch/pytorch/tree/main/.claude/skills/skill-writer
Usage
Basic Usage
To create a new skill:
I want to create a new Claude Code skill
skill-writer guides you through a 10-step process.
Skill Locations
- Personal:
~/.claude/skills/- individual workflows and experiments - Project:
.claude/skills/- team sharing, committable to git
Writing Effective Descriptions
The description directly determines trigger accuracy. Use this formula:
[What it does] + [When to use it] + [Key triggers]
Good example:
description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
Validation
After creation, verify:
- SKILL.md exists with valid frontmatter
- Name follows conventions (lowercase, hyphens, max 64 chars)
- Description is specific (under 1024 chars)
- Skill triggers on relevant queries
Important Considerations
Name Must Match Directory
The frontmatter name must match the skill directory name. Uppercase letters and underscores are not allowed.
Permission Control with allowed-tools
For read-only skills (like code review), set allowed-tools: Read, Grep, Glob to restrict write access.
When Skills Don't Trigger
Add file extensions (.pdf, .xlsx) and common user phrases to the description. Use claude --debug for troubleshooting.
Summary
skill-writer enables validated Claude Code skill creation with step-by-step guidance. Writing specific trigger conditions in the description is the most important factor for skill usability.
For full specifications, visit the skill detail page.