Claude Skill from Scratch

Skill DevelopmentPublished 2026-12-01Author: SkillKey Skills Marketplace
claude-skill-from-scratchclaude-skillsskill-developmentskill-mdagent-skills
Build a Claude skill from scratch with a minimal SKILL.md, required frontmatter, the folder layout Claude Code reads, and a trigger test.

Building a Claude skill from scratch starts with one decision: pick a task that repeats and has a recognizable result. A skill is not a general assistant prompt. It is a folder with a SKILL.md entry file and optional scripts, references and assets. The narrower the task, the easier it is to write a description that triggers correctly and instructions that finish the job.

Claude Skill from Scratch: Start with a Real Task

Choose a task you have already completed more than once. Good first skills are small and observable: converting a CSV into a summary table, drafting release notes from merged pull requests, checking a frontend page at three screen sizes, or applying a document format to a Word file. Each has a clear input, a clear output and a short list of steps.

Avoid starting with a skill that covers a whole department. "Help with marketing" has no stable input and no testable result, so the description becomes vague and the body becomes a collection of unrelated advice. A skill that handles one report, one file type or one review checklist is easier to test and easier to maintain.

A useful first-skill checklist:

  • One input type
  • One output format
  • One verification step

Write the task as a sentence before you write any code:

text
Given <input>, produce <output> by following <steps>, and stop when <condition>.

If you cannot fill in the input, the output or the stop condition, the task is still too broad. Split it until each part is concrete. The overview of Claude skills explains why this narrow scope is the unit that Claude can match.

Where Should the SKILL.md File Live?

Create a directory whose name matches the skill name. Use lowercase letters, numbers and hyphens. Inside it, create SKILL.md and only the supporting folders the task needs:

text
release-notes/
├── SKILL.md
├── scripts/
│   └── collect-prs.sh
└── references/
    └── format-guide.md

The folder name and the name field must agree. A folder called Release_Notes with name: release-notes fails the naming rule even if the instructions are correct. The same rule applies in Claude Code, Codex and any other client that follows the Agent Skills format.

Do not copy a large official skill as your first version. Anthropic's repository includes production document skills and a skill-creator reference, but those folders solve much larger problems. Use them to study structure, then return to your smaller task. The official catalog is a reference library, not a template you must clone.

Write the Frontmatter First

The frontmatter carries the fields that decide discovery. Start with two required fields and add optional metadata only when you need it:

markdown
---
name: release-notes
description: Draft release notes from merged pull requests. Use when the user asks for release notes, a changelog summary, or a version announcement.
---

Follow these steps:
1. Read merged pull requests since the last tag.
2. Group changes into features, fixes and breaking changes.
3. Write one sentence per user-visible change.

The name field must be 1 to 64 characters, use lowercase letters, numbers and hyphens only, and match the directory. The description field must be 1 to 1,024 characters and should state both what the skill does and when to use it. Put the trigger words in the first sentence; the client cuts the combined description and invocation text in its listing, and Codex shortens descriptions when many skills are installed.

A description that says "helps with releases" is not enough. A description that says "Draft release notes from merged pull requests" gives the client a task, an object and a reason to load the skill. If you later add a second skill for changelogs, the boundary between the two descriptions decides which one wins.

Write Instructions That Claude Can Follow

The body should be a procedure, not an essay. Use numbered steps, name the files or commands the skill expects, and show one example input and one example output. State the stop condition so the skill does not keep expanding the task after the result is ready.

Keep the main SKILL.md under 500 lines and move long material into references/. Put reusable scripts in scripts/ and templates or static data in assets/. Reference those files with paths relative to the skill root and load them only when the procedure reaches that step. This is the same progressive-disclosure pattern the loading guide describes.

Write commands exactly as they should run. Do not invent flags, version numbers or file paths that you have not checked. If the skill depends on a tool such as gh, python or a package manager, say so in the instructions and in the description when the dependency changes whether the skill applies.

Keep secrets out of the skill folder. A skill is a set of instructions and helpers, not a credential store. If the task needs an API key, read it from the environment and document the variable name. If the task needs live data, connect through MCP and let the skill explain when to call that server.

Test the Skill Before You Share It

Place the skill in a directory Claude Code scans. Personal skills live under ~/.claude/skills/<skill-name>/SKILL.md; project skills live under .claude/skills/<skill-name>/SKILL.md. Claude Code watches directories that existed when the session started, so a brand-new top-level skills directory usually needs a restart before it is noticed. The not-loading checklist covers the path failures.

Run the reference validator before you test in the client:

bash
skills-ref validate ./release-notes

Then test with two prompts. One should name the task and its input; the other should describe neighboring work that the skill should not handle. If both trigger, tighten the description. If neither triggers, add the nouns and verbs the user actually typed. Repeat until the positive prompt loads the skill and the negative prompt does not.

Finally, ask a teammate to run the same two prompts on a clean checkout. A skill that works only on your machine is usually relying on an unstated file, a local alias or a package that is not in the repository. Fix that dependency before you call the skill finished.

For the file layout, see Claude skill structure. For team rules around descriptions, scripts and versions, see Claude skills best practices.

FAQ

How do I build a Claude skill from scratch?

Start with one repeatable task, create a folder whose name matches the skill name, add a SKILL.md file with name and description frontmatter, then write the smallest instruction set that completes the task.

Does the folder name have to match the skill name?

Yes. The Agent Skills specification requires the name field to match the parent directory name, use lowercase letters, numbers and hyphens, and avoid leading, trailing or consecutive hyphens.

How long should a new SKILL.md be?

Keep the main SKILL.md under 500 lines and move long references into supporting files. A first version should be short enough that you can test every instruction against a real task.

How do I test whether the skill triggers?

Write one prompt that should match the skill and one that should not. If both match, narrow the description. If neither matches, add the concrete nouns and verbs from the prompt you expected to work.

Related Terms

SKILL.md
The required entry file of a skill, containing YAML frontmatter plus the Markdown instructions the agent follows.— Agent Skills specification
Frontmatter
The YAML block between --- markers at the top of SKILL.md that declares fields such as name and description.— Agent Skills specification
Description
The short frontmatter field that tells the client what the skill does and when it should be used.— Agent Skills specification
Progressive disclosure
A loading model that keeps skill metadata in context first and reads the full instructions only when the skill is selected.— Agent Skills specification

Sources