How to Create a Claude Code Skill, With a Game Example
To create a Claude Code skill, make a folder inside .claude/skills/ in your game's project, put a file named SKILL.md in it, and write two things: a short header that says what the skill is for, and the steps Claude should follow. Claude Code then uses it when a request matches, or when you type a slash and its name.
What is a skill?
The Claude Code docs, as we read them on 25 November 2026, describe a skill as a SKILL.md file with instructions that Claude adds to its toolkit. Claude uses it when it is relevant, or you start it with /skill-name. Make one when you keep pasting the same instructions into the chat, or when a part of CLAUDE.md, the notes file Claude Code reads in every session, "has grown into a procedure rather than a fact". Unlike those notes, a skill is only loaded when it is used.
To see which ready-made skill packs exist for games, read Claude Code game development skills.
Where does the file go?
| Kind | Path | Works in |
|---|---|---|
| Project skill | .claude/skills/<name>/SKILL.md in your game's folder |
This game only, and it travels with the project |
| Personal skill | ~/.claude/skills/<name>/SKILL.md, where ~ is your home folder |
Every project on your computer |
A rule about one game's story belongs in the project.
The folder name becomes the command: check-story-first gives you /check-story-first. Anthropic's authoring guide asks for lowercase letters, numbers and hyphens, at most 64 characters, and no claude or anthropic in a name. The Claude Code page calls every header field optional, and we could not tell from it whether Claude Code enforces this, so follow it anyway.
What goes in SKILL.md?
A header between two lines of ---, then the instructions in plain Markdown. A first skill needs few header fields:
description: what the skill does and when to use it. Claude decides by this, so use the words you would type, such as "scene", "choice" and "ending". The authoring guide asks for the third person ("Checks the story", not "I can help you") and allows 1,024 characters; the Claude Code page cuts at 1,536. Two sentences are plenty.name: optional. Without it, the folder name is used.disable-model-invocation: true: only you can start the skill. The docs suggest it for jobs with side effects, such as deploying.
Keep SKILL.md under 500 lines, and put long reference material in extra files next to it, linked from SKILL.md. Write steps that hold for the whole task: Claude Code adds the skill to the conversation once and does not read the file again on later turns, so "run the check after every change" works where "run the check" may happen once.
How does Claude Code pick it up?
In a normal session Claude sees each skill's description, not its body. When your request matches a description, Claude loads that skill. You can also start it by putting /check-story-first at the very beginning of your message.
No restart is needed. The docs say Claude Code watches the skill folders and picks up a new or changed skill within the current session. If yours does not show up, type /reload-skills.
A complete example: check the story before building it
Fernhill Letters is an invented story game: you sort the post of a small village, and your choices decide which letters arrive. The story keeps promises, such as "a burned letter is never read", and with each new scene it gets harder to see whether some path breaks one.
This skill makes Claude write the story down as a model, let a checker walk every path, and only then build. The checker is Spielerando's plot hole finder: it tests your rules at every step of every path and prints the exact order of scenes that breaks one.
Once, before the skill: put the plot hole finder into your project, for example into tools/story-check/. The copy button on its page takes the tested code along. It is TypeScript, so have your AI set up one command that runs it on story/model.json, here npm run story:check; if it picks another, use that in step 3.
Then save this as .claude/skills/check-story-first/SKILL.md:
---
description: Models the Fernhill Letters story as data and runs the story check before any scene, choice or ending is written or changed. Use when adding, changing or removing a scene, a choice, a character's fate or an ending.
---
Follow these steps every time the story changes in this session.
1. Read story/model.json: the story as facts, scenes with their choices, rules and goals, in the shape tools/story-check/ expects.
2. Change the model first, not the game. Give each new scene and choice what it needs and what it changes. A new promise, such as "a burned letter is never read", becomes a rule. An ending that must stay reachable becomes a goal.
3. Run `npm run story:check` and show me its report exactly as printed. Do not summarise it and do not judge the story yourself.
4. If a rule breaks or a goal is lost, show me the path from the report, fix the model and run the check again, until nothing breaks or I decide.
5. Only then change the scene files to match the model, and list the scenes you touched.
6. If the check is missing or does not run, stop and tell me. Never say the story was checked when the check did not run.
Step 3 asks for the report as printed, because you want the checker's word, not Claude's summary of it. Step 6 is for the day the check breaks: a skill that quietly skips its check is worse than none, because you believe you are covered.
If you would rather use TLA+, the TLA+ guide shows how to write such rules for its checker, TLC, and step 3 runs TLC instead.
A skill is guidance that Claude applies with judgement. For a rule that must hold every single time, the docs point to hooks, which Claude Code runs itself.
Paste this to your AI
Copy the plot hole finder from its page and the example skill above into your chat, then send this:
Above are the plot hole finder and an example skill. Give this project a skill like it.
1. Find where this project keeps its scenes, choices and endings, and name the files.
2. Put the finder's code in tools/story-check/ with one command that runs it on story/model.json. Run it on the finder's own example, which has a planted plot hole, and show me the report that catches it.
3. Write story/model.json from my current story. For every rule, name the line of my story it comes from. A rule you think is wise but did not find stays out; list it separately.
4. Run the check on my story and show me the report as printed.
5. Save the skill in .claude/skills/check-story-first/SKILL.md, with my game's name, files and command in place of the example's.
Then give me two requests that should start the skill and one that should not.
How to check that it loads
- List it. Type
/skills, or ask "What skills are available?". Yours should be there. - Start it by hand. Type
/check-story-first. If the command is not recognized, the docs say to check whether Claude Code refused the skill's name. - Ask in plain words. "Add a scene where the miller burns the letter" should start with the model and the check.
- Ask for something else. "Make the menu font bigger" should leave the skill quiet.
- Plant a mistake. Break one of your rules on purpose in the model, for example by letting someone read the burned letter. The report must show the broken rule and its path. If it says all is well, the skill or the checker is not doing its job.
Common mistakes
- Anything above the first
---, even an empty line. Claude Code reads the header only when---is the very first line. Otherwise the whole file counts as instructions, and your description is lost. - A misspelled field. Claude Code ignores a field it does not know, without an error.
descripton:simply does nothing. - A header that is not valid YAML. The skill still loads, with no fields set:
/check-story-firstworks, but Claude can no longer match your description.claude --debugshows the error. - It fades in a long session. When the conversation is shortened to make room, Claude Code keeps at most the first 5,000 tokens of each skill used. Put the key steps at the top, and start the skill again if Claude drifts.
- Uploading it to the Claude app as it is. The docs say claude.ai and the Skills API accept only
name,description,license,compatibility,metadataandallowed-toolsin the header. Any other field makes the upload fail.