agentleFS
nguyenthanhtatnguyenthanhtat/screen1-claude/skills/create-a-skill/SKILL.md

create-a-skill

Skill2 starsChanged 22 days agoMITView on GitHub

Step-by-step tutorial for creating Claude Code skills. Use when creating a new skill, building a SKILL.md file, designing a skill folder structure, or learning how to write effective skill descriptions and frontmatter.

10 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before writing any files, answer these 3 questions:

    line 23
  2. Distinctive:

    Use for: focused single-topic skills (testing, TypeScript, git workflows)

    line 55
  3. Very specific:

    Use for: broad domains needing sub-topic routing (Next.js fullstack, senior-backend)

    line 68
  4. Distinctive:

    Use for: skills that produce artifacts or run code (skill-creator, pdf-editor, code-formatter)

    line 78
  5. Very specific:

    If file > 10k words, add grep search hints in SKILL.md

    line 136
  6. Distinctive:

    Not loaded into context, just copied/referenced

    line 144

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create-A-Skill Tutorial

A guided workflow for building any Claude Code skill from scratch — covering planning, structure, writing, and packaging.

When This Skill Applies

  • "I want to create a skill for X"
  • "Help me build a skill for our team's Y workflow"
  • "Create a new skill that handles Z"
  • "How do I write a SKILL.md?"
  • "What should my skill folder look like?"

Step 1 — Understand What the Skill Does

Before writing any files, answer these 3 questions:

  1. What domain / task does this skill cover?
    • Be specific. Not "frontend" but "React hooks and state management"
    • Not "docs" but "team API documentation lookup"
  2. What would a user say to trigger it?
    • List 3–5 concrete trigger phrases
    • Example: "Build a React component", "optimize my hook", "add state management"
  3. What reusable resources would help Claude every time?
    • Scripts that get rewritten repeatedly → scripts/
    • Documentation Claude needs to reference → references/
    • Templates / assets used in output → assets/

See references/structure-patterns.md for help choosing what to include.


Step 2 — Choose a Structure Pattern

Three patterns cover most skills:

Pattern A — Simple (single domain)

my-skill/
├── SKILL.md
├── references/
│   └── topic.md
└── examples/
    └── example.md

Use for: focused single-topic skills (testing, TypeScript, git workflows)

Pattern B — Complex (multi-domain routing hub)

my-skill/
├── SKILL.md              ← routing only
├── references/
│   ├── topic-a.md
│   ├── topic-b.md
│   └── topic-c.md
└── scripts/
    └── helper.py

Use for: broad domains needing sub-topic routing (Next.js fullstack, senior-backend)

Pattern C — Reference + Automation

my-skill/
├── SKILL.md
├── references/           ← documentation
├── scripts/              ← executable tools
└── assets/               ← templates / files for output

Use for: skills that produce artifacts or run code (skill-creator, pdf-editor, code-formatter)


Step 3 — Create the Folder

# Global skill (available everywhere)
mkdir -p ~/.claude/skills/<skill-name>/references
mkdir -p ~/.claude/skills/<skill-name>/assets
mkdir -p ~/.claude/skills/<skill-name>/scripts

# Project skill (only in this repo)
mkdir -p .claude/skills/<skill-name>/references

Or use the init script if available:

python .claude/skills/skill-creator/scripts/init_skill.py <skill-name> --path ~/.claude/skills/

Copy the template to start:

cp .claude/skills/create-a-skill/assets/SKILL-template.md ~/.claude/skills/<skill-name>/SKILL.md

Step 4 — Write SKILL.md

The description field is the most critical part — it controls when Claude auto-triggers the skill.

Frontmatter rules:

---
name: skill-name-in-kebab-case
description: "Specific action + domain. Use when [concrete trigger scenarios]."
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
---

Body rules:

  • Keep under 500 lines
  • Overview in 2–3 sentences
  • List trigger scenarios
  • Core principles (numbered, concise)
  • Link to references/ — never inline everything
  • Quick example if helpful

See references/frontmatter-guide.md for description writing rules and examples.


Step 5 — Add Supporting Files

references/ files

  • One topic per file (e.g., references/hooks-patterns.md, not references/everything.md)
  • Load only when Claude needs them — keep them detailed
  • If file > 10k words, add grep search hints in SKILL.md

scripts/ files

  • Include when the same code gets rewritten every session
  • Claude can execute without reading into context (token efficient)

assets/ files

  • Templates, boilerplate, icons used in final output
  • Not loaded into context, just copied/referenced

Step 6 — Test the Skill

# Open Claude Code in the skill's directory
claude

# Try natural trigger phrases:
"I want to build a React component for user profiles"
"Help me write tests for this API"

# Verify:
# ✓ Claude announces using the skill
# ✓ Skill guidance appears in response
# ✓ Supporting files load when relevant

Step 7 — Package (optional, for sharing)

python .claude/skills/skill-creator/scripts/package_skill.py .claude/skills/<skill-name>/

This validates structure and creates a distributable .zip.


Quick Reference

File/FolderPurposeSize limit
SKILL.mdEntry point, routing, core guidance< 500 lines
references/*.mdDetailed domain knowledge< 2000 lines each
scripts/*.pyReusable executable codeNo limit
assets/Output templates & filesNo limit

See references/checklist.md for the full creation checklist.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.