Skills: teach your coding agent something once
A Claude Code skill is a short written procedure the agent reads when a job matches. Write one for anything you have explained twice.
By Nick
On this page
Before you start
The second time you explain to your coding agent how to publish a post on this site, you have found a skill. A skill is a short written procedure, kept in the project, that the agent reads when a job matches it. Explain once, write it down, never again.
What goes in one
The steps, in order, for one job. “Publishing a post: run the content lint, check the hero image exists, set the review status, open a pull request to this branch.” The commands. The things that went wrong last time. Anything you would say to a new colleague doing it.
It is a recipe, not a rulebook. Rules that apply to everything go in CLAUDE.md, which stays short because it is read every time. A skill is read only when it matches, so it can be as long as the job is.
The fastest way to write one
Do the job with the agent once. Then paste this.
We just did a job we will do again. Write it up as a skill: a short name, one line on when
it applies, then the steps in order with the exact commands, and a section for things that
went wrong this time and how we fixed them. Keep it under a page. Show me before you save
it, and tell me where it will live.
Read it. Cut anything that was specific to today. Save it.
Why this compounds
After a few months you have a folder of procedures shaped by your own corrections, and a familiar task comes out right without you walking it through. That is not the model getting cleverer. It is a filing habit, and it is the same reason Hermes gets more useful the longer you run it.
We just fixed a broken contact form with the agent, plus the prompt above
Name: fix-contact-form
When it applies: the contact form submits but no email arrives.
Steps:
- Check the form’s action URL in
contact.html. - Run
npm run test-emailand read the error. - Update the mail key in
.env, then restart the site.
Went wrong this time: the key had expired, and the error only said “failed”.
It will live in .claude/skills/fix-contact-form/SKILL.md. Shall I save it?
The first time it goes wrong, add a line to the skill rather than to the chat.
Common questions
What is the difference between a skill and CLAUDE.md?
Can the agent write its own skills?
Is this only Claude Code?
What to do next
Related reading
Learn
What is an AI agent?