writing-skills
Skill864 starsChanged 8 days agoMITView on GitHub
How to write, structure, and maintain Claude skill files. Covers the three-level progressive disclosure model, all YAML frontmatter fields (context:fork, allowed-tools, disable-model-invocation, user-invocable, hooks, argument-hint), invocation control patterns, string substitutions ($ARGUMENTS, ${CLAUDE_SKILL_DIR}), shell preprocessing with backtick syntax, and the Maintenance section contract. Use when creating a new skill file, rewriting an existing one, or reviewing a skill for quality. Trigger phrases: "add a skill", "write a skill", "create a skill file", "update skill", "skill quality", "skill review", "context fork", "allowed-tools", "user-invocable".
191 other projects use a version of this.
Adopted by
Most recently taken up by
- justincordova/agentstheir own version, first seen Nov 29, 2026
- gromov0737/skillstheir own version, first seen Nov 29, 2026
- Powercademy/powercademy-skillstheir own version, first seen Nov 29, 2026
- Docyrus/agent-skillstheir own version, first seen Nov 29, 2026
- autohandai/community-skillstheir own version, first seen Nov 29, 2026
- Firna-AI/skillstheir own version, first seen Nov 29, 2026
Used with
Projects with it also use chinese-code-review, chinese-commit-conventions and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Leodorareluctant259Skillchinese-code-review
中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈
Also in 8 projects that use this
Leodorareluctant259Skillchinese-commit-conventions
中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化
Also in 8 projects that use this
obraSkilldiagnosing-superpowers
Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.
Also in 22 projects that use this
aaddrickSkillwriting-agents
Use when creating new agents, editing existing agents, or defining specialized subagent roles for the Task tool
Also in 3 projects that use this
AWSSkillcondition-based-waiting
Replace arbitrary sleeps in tests with polling for the ACTUAL condition — a waitFor(() => predicate, description, timeoutMs) helper that polls every 10 ms, calls the getter inside the loop (no stale cache), and throws a clear error on timeout. Use when a test uses setTimeout / sleep / time.sleep, is flaky (passes on fast machines, fails under load or in CI), times out when run in parallel, or waits for an async operation, event, state, count, or file to appear. Do NOT use when the test genuinely exercises timing behavior (debounce / throttle) — then wait for the triggering condition FIRST and comment WHY the timed wait is justified. Trigger on "flaky test", "race condition in tests", "why does this pass locally and fail in CI", or any `await new Promise(r => setTimeout(r, N))` in a test.
Also in 3 projects that use this
MicrosoftSkillusing-skills
Describes how to use abilities. Read before any conversation.
Also in 4 projects that use this
- +3 more from Leodorareluctant259
Other versions191 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 191
- obra/superpowers★ 314ksame name
- PostHog/posthog★ 41ksame name
- mdiri-ai/SoduWork★ 9.1ksame name
- jnMetaCode/superpowers-zh★ 8.6ksame name
- openai/plugins★ 8.4ksame name
- farm-fe/farm★ 5.6ksame name
- compozy/compozy★ 2.9ksame name
- crbnos/carbon★ 2.9ksame name
- lingyired/status-trio★ 2.2ksame name
- GanyuanRan/Aegis★ 1.5ksame name
181 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- apps/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/expressive-code.mdcCursor rule
- audio-nodesSkill
- build-compilation-dependenciesSkill
- expressive-codeSkill
- flowSkill
- host-objectsSkill
- post-work-checksSkill
- thread-safety-itcSkill
- turbo-modulesSkill
- utilitiesSkill
- web-audio-apiSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 2 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 181 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 86
No XML angle brackets (< or >) anywhere in frontmatter — security restriction.
- Distinctive: line 216
Critical first: MUST NOT lists, common pitfalls, and hard constraints go in the FIRST section, not buried at the bottom.
- Very specific: line 217
No scope blockquotes: do not add > Scope: ... / > What this skill covers: ...
- Very specific: line 218
Escape hatches: add "If unsure → [do X]" guidance wherever a wrong choice causes hard-to-debug bugs (e.g.
- Very specific: line 261
Use glob-style patterns (*, ``) for directories.
- Distinctive: line 263
Add a row whenever you add a new documented pattern to the skill.
- Very specific: line 281
Place supporting files in the same directory as SKILL.md:
- Very specific: line 302
Create SKILL.md with YAML frontmatter (name, description with what + when + trigger phrases, ≤1024 chars)
- Very specific: line 307
Create maintenance.md with path → what-to-check table.
- Very specific: line 308
If supporting files created: their maintenance rows go into maintenance.md (not in the supporting files)
- Very specific: line 309
Add the skill directory to the table in CLAUDE.md and the tree in .claude/README.md
“Common” is measured: kept by at least 6 in 10 of the 181 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.
Files
Skill: Writing Skills
A skill file is a scoped knowledge document that Claude loads on demand. Good skills are concise, trigger reliably, and stay accurate over time.
Three-Level Model
Level 1 — YAML frontmatter always loaded, ~100 tokens
Level 2 — skill body (SKILL.md) loaded on trigger, < 500 lines / ~5 k tokens
Level 3 — supporting .md files loaded explicitly when more detail is neededClaude sees the description field in every conversation. It reads the skill body only when the topic is relevant. It reads a supporting file only when the skill body links to it and more detail is needed.
Design each level independently. The frontmatter alone must be enough to trigger the skill. The skill body must be useful without any supporting file. Supporting files are supplementary.
File Structure
Each skill lives in its own directory:
.claude/skills/<skill-name>/
├── SKILL.md # Required — main skill body with YAML frontmatter
└── <supporting-file>.md # Optional — verbose reference material linked from SKILL.mdSupporting files (e.g. gainnode-example.md, api.md, build-details.md) live alongside SKILL.md in the same directory. They are plain .md files (not SKILL.md). Alternatively group them under an optional references/ subdirectory when you have several related documents, or scripts/ for executable code Claude can run.
Link from the parent skill:
See [gainnode-example.md](gainnode-example.md) for a complete header + .cpp.YAML Frontmatter
Required: name and description. Everything else is optional.
---
name: kebab-case-name # matches the directory name; no claude/anthropic prefix
description: >
What the skill covers. When to use it.
Trigger phrases: "phrase one", "phrase two".
# — optional fields —
context: fork # run as isolated subagent (see below)
agent: Explore # subagent type: Explore / Plan / general-purpose / custom
allowed-tools: 'Read Grep Glob' # tools available without per-use approval
model: claude-sonnet-4-6 # model override for this skill
disable-model-invocation: true # user can /invoke; Claude won't auto-load
user-invocable: false # Claude auto-loads; hidden from the /menu
argument-hint: '[node-name]' # shown in slash-command autocomplete
hooks: # hooks scoped to this skill's lifecycle
metadata:
author: team
version: 1.0.0
---Rules
name: kebab-case, matches directory name. Forbidden prefixes:claude,anthropic.description: max 1024 characters. Include what, when, and trigger phrases (quoted, comma-separated at the end).- Trigger phrases must match how developers actually speak:
"add a node","processNode","shadow state"— not"audio processing implementation". - No XML angle brackets (
<or>) anywhere in frontmatter — security restriction.
Anti-patterns
# BAD — vague, no trigger phrases
description: This skill covers audio node implementation details.
# BAD — too long (gets cut at 1024 chars)
description: >
This skill covers every aspect of ... [500 words] ...
# BAD — missing the literal "Trigger phrases:" label (skill will never auto-load)
description: >
How to create a C++ audio node. Covers processNode() contract, AudioParam a-rate/k-rate,
cross-thread scheduling. Use when implementing a new node or debugging audio rendering.
"add a node", "processNode", "audio thread", "AudioParam automation".
# GOOD
description: >
How to create a C++ audio node. Covers processNode() contract, AudioParam a-rate/k-rate,
cross-thread scheduling. Use when implementing a new node or debugging audio rendering.
Trigger phrases: "add a node", "processNode", "audio thread", "AudioParam automation".The Trigger phrases: label is mandatory — without the exact label, Claude Code does not recognise the list as trigger phrases and the skill will not auto-load.
Invocation Control
By default a skill is both user-invokable (/skill-name) and auto-loaded by Claude. Override with:
| Frontmatter | User /invoke | Claude auto-load | Use when |
| (default) | Yes | Yes | General knowledge skills |
disable-model-invocation: true | Yes | No | Task-only / deployment skills |
user-invocable: false | No | Yes | Internal / meta knowledge |
context: fork
Runs the skill in an isolated subagent. The skill body becomes the task prompt — the subagent has no access to conversation history.
---
name: deep-research
description: Research a topic thoroughly
context: fork
agent: Explore # Explore / Plan / general-purpose / custom .claude/agents/ name
---
Research $ARGUMENTS thoroughly:
1. Find relevant files using Glob and Grep
2. Read and analyze the code
3. Summarize findings with specific file referencesOnly useful for task-oriented skills with concrete step-by-step instructions. Do NOT set on reference/knowledge skills — the subagent receives guidelines but has no actionable task.
String Substitutions
Available in skill body content:
$ARGUMENTS all arguments passed when user invokes /skill-name arg
$ARGUMENTS[0] first argument by index (0-based); $0 is shorthand
${CLAUDE_SESSION_ID} current session ID
${CLAUDE_SKILL_DIR} absolute path to the skill directory — use to reference bundled scriptsShell Preprocessing
!`command` runs a shell command before the skill content is sent to Claude. Output replaces the placeholder at load time — Claude sees only the result, not the syntax.
## Context
Branch: !`git branch --show-current`
Last commits: !`git log --oneline -5`Useful for skills that need live repository state injected automatically.
Skill Body
Structure
---
name: my-skill
description: > ...
---
# Skill: My Skill
One-sentence summary of what this covers (not a repeat of frontmatter — add context).
---
## Most Important Section First
Critical invariants, hard constraints, common mistakes go at the top.
Readers may stop reading early — put the highest-value content first.
## Secondary Sections
...
---
## Maintenance
Review this skill when `pre-push-update` reports changes in:
| Path | What to check |
| ---------------- | ---------------------------- |
| `path/to/file.*` | What to review in this skill |Rules
- Under 500 lines — non-negotiable. If the file exceeds 500 lines, move verbose content to a supporting file in the same directory.
- Imperative form: "Use
AudioParam", "Declare in protected:", "CallscheduleAudioEvent". Not: "You should use", "It is recommended to call". - Code over prose: a 5-line snippet teaches faster than two paragraphs. Prefer concrete examples.
- Critical first: MUST NOT lists, common pitfalls, and hard constraints go in the FIRST section, not buried at the bottom. Readers stop reading early.
- No scope blockquotes: do not add
> **Scope**: .../> **What this skill covers**: .../> **When Claude should consult this skill**: ...— this duplicates the frontmatter and wastes lines. - Escape hatches: add "If unsure → [do X]" guidance wherever a wrong choice causes hard-to-debug bugs (e.g. "If unsure which ITC primitive → check the decision table in
thread-safety-itc"). - Golden references: link to one or two existing files that exemplify the patterns in the skill. These let Claude anchor new code to proven implementations.
What belongs in the skill body vs supporting files
| Belongs in skill body | Move to supporting file |
| API overview (1-line per method) | Complete header + .cpp of a class |
| Key usage patterns (5–15 line snippets) | Full working example (50+ lines) |
| Decision tables, checklists | Exhaustive per-flag build analysis |
| Common pitfalls (concise) | Line-by-line CMakeLists commentary |
| Links to spec or docs | Full .hpp API with every overload |
The Maintenance File
Each skill directory has a maintenance.md file mapping source paths to what needs checking. It is not loaded during normal skill usage — only /pre-push-update reads it.
# Maintenance — skill-name
> Used by /pre-push-update only — not loaded during skill usage.
| Path | What to check |
| ---------------- | ------------------------------------- |
| `path/to/file.*` | Specific section or element to review |SKILL.md ends with a single footer line linking to it:
_Maintenance: see [maintenance.md](maintenance.md)._Supporting files do not have their own maintenance sections — their rows go into the same maintenance.md.
Why separate
## Maintenance embedded in SKILL.md wastes tokens on every skill load. A dedicated maintenance.md is only read by /pre-push-update.
Rules
- Use glob-style patterns (
*,**) for directories. - The "What to check" column must name the specific section or element to review — not just "update if needed".
- Add a row whenever you add a new documented pattern to the skill.
- Supporting file paths belong in the skill's
maintenance.md— not in the supporting file itself.
Supporting Files
For content that is too large for the skill body but still useful to load on demand.
When to create a supporting file
- A complete class header + implementation (50+ lines of code)
- Full API documentation for a large
.hpptemplate file - Deep line-by-line analysis of a build file
- A complete worked example spanning multiple files
Location
Place supporting files in the same directory as SKILL.md:
.claude/skills/audio-nodes/
├── SKILL.md
└── gainnode-example.md # supporting fileLink from the parent skill:
See [gainnode-example.md](gainnode-example.md) for a complete header + .cpp.Supporting files do not need YAML frontmatter or a name field — they are plain markdown.
Checklist: New Skill File
- Create directory
.claude/skills/<skill-name>/ - Create
SKILL.mdwith YAML frontmatter (name,descriptionwith what + when + trigger phrases, ≤1024 chars) # Skill: Nameheading — no scope blockquotes below it- Most important content first
- Under 500 lines — move verbose content to a supporting
.mdfile in the same directory - Imperative form, code snippets preferred over prose
- Create
maintenance.mdwith path → what-to-check table; add*Maintenance: see [maintenance.md](maintenance.md).*at the bottom ofSKILL.md - If supporting files created: their maintenance rows go into
maintenance.md(not in the supporting files) - Add the skill directory to the table in
CLAUDE.mdand the tree in.claude/README.md
Maintenance: see maintenance.md.
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
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.

