Extending Claude Code

Building Skills for Claude Code

How to preserve recurring instructions, local rules, and workflow knowledge.

Why Skills Matter

Every session with Claude Code begins from zero. It will not remember your citation style, your metadata schema, or your local workflow rules unless you give that knowledge some more durable form. A skill stores those instructions in a file that Claude Code can load when the task matches, so you write them once and they persist across sessions.

Think of it as a reference sheet

A skill works like a reference sheet pinned to the wall of your office, except Claude Code checks it automatically. You keep it updated as your rules evolve, and every session benefits from whatever you have added so far.

What a Skill Is

A skill is a folder containing a markdown file called SKILL.md. The file has two parts. The first is a YAML frontmatter header, the small structured block between --- delimiters that tells Claude Code when to use the skill. The second is a body that contains the instructions themselves.

SKILL.md ---
name: chicago-citations
description: Format citations and bibliographies in
  Chicago Manual of Style 17th edition. Use when
  asked to create citations, format references,
  or build a bibliography.
---

# Chicago Citation Formatting

When formatting citations, follow the Chicago
Manual of Style, 17th edition.

## Notes-Bibliography Style
Use this style by default unless the user
specifies Author-Date...

A skill can also include reference documents, templates, and sample data alongside the main file, as covered below in How to Build a Skill.

What Belongs in a Skill

Any instruction you find yourself repeating across sessions is a candidate.

Reference Skills

Teach Claude Code the rules of a specific standard, format, or system. Citation styles, metadata schemas, cataloging rules, naming conventions.

Workflow Skills

Capture a multi-step process you repeat. Processing interlibrary loan requests, preparing data for a specific platform, generating reports in a particular format.

Verification Skills

Define how to check that output is correct. What to validate in a metadata record, how to spot-check a data transformation, what a properly formatted export looks like.

Output Skills

Specify how results should be formatted and delivered. Your institution's report template, a specific CSV structure for import into another system, an exhibit metadata format.

Concrete examples

Metadata standards

Your institution's metadata profile: which fields are required, what controlled vocabularies to use, how to format dates. Once encoded in a skill, Claude Code follows the local rules when creating or cleaning records without being reminded each time.

Data export formatting

The exact structure a target system expects for imports: column names, field order, date format, encoding. Particularly useful when the import format is finicky or underdocumented.

Literature screening criteria

Inclusion/exclusion criteria for a systematic review, covering population definitions, outcome measures, study design requirements, and sub-topic categories. Consistent application across hundreds of records is exactly the kind of repetitive judgment call that benefits from written-down rules.

API access

How to query a specific API (OpenAlex, OCLC WorldCat, your institution's repository), including endpoints, authentication, and pagination. Without reference docs, Claude Code tends to guess at parameter names and get them wrong.

How to Build a Skill

Claude Code includes a built-in skill creator. Describe the task and the recurring failure points, and it will build an initial structure for you.

The skill creation process
You describe it
Claude builds it
You test + refine
Working skill

Claude Code generates the file structure and the initial text.

Using the Skill Creator

Type /skill-creator in Claude Code and describe the skill you want. Claude Code will ask a few questions, then generate the folder, the SKILL.md file, and any supporting files.

Example: creating a metadata skill

"I want a skill that formats metadata for our institutional repository. We use a modified Dublin Core profile. Required fields are title, creator, date (YYYY-MM-DD), type, and rights. The rights field should always be set to our standard license statement unless I specify otherwise. Creator names should be in 'Last, First' format. I'll give you our controlled vocabulary for the type field."

Claude Code will generate the skill and walk you through reviewing it, after which you should test it on a task to see where the instructions hold up and where they need refinement.

Building a Skill from Scratch

If you would rather build a skill yourself, or if you want to understand the mechanics, the process is straightforward:

  1. Create a folder in ~/.claude/skills/ (the ~ means your home directory) with a hyphenated name (e.g., dublin-core-metadata)
  2. Create a SKILL.md file inside it with the header (name and description) and the body (your instructions)
  3. Add reference files if needed, in subfolders like references/ or assets/
  4. Test it by typing /your-skill-name in Claude Code and trying it on a task

The folder can also hold reference documents, templates, and sample data beyond the SKILL.md file itself. Keep the main file concise and move detail into side files; Claude reads the extra material when it needs it.

chicago-citations/
  SKILL.md # the main instructions
  references/
    notes-bibliography.md # detailed format rules
    author-date.md # alternate style
  assets/
    bibliography-template.md # output template

Where skills live

Use ~/.claude/skills/ for personal defaults you want available everywhere. Use .claude/skills/ inside a project when the instructions belong to that project or need to be shared with other people.

Writing a Good Skill

When you write a skill, you have to make sure it activates when needed and captures the local rules Claude would otherwise have to guess at. When format matters, an example of correct output also helps.

Write the Description Clearly

Claude Code reads each skill description at the start of a session and loads any that seem relevant to the task at hand. A clear description makes this automatic activation more reliable. You can also invoke a skill directly by typing /skill-name, which always works regardless of how the description is written, but automatic activation saves you from having to remember to invoke it.

# Vague (Claude may not trigger this when needed)
description: Handles metadata

# Specific (Claude knows exactly when to activate)
description: Format metadata records for Omeka S
  import. Use when creating item metadata,
  preparing CSV imports, or working with Dublin
  Core fields for the digital collections.

Focus on the predictable failure points

Claude Code already knows general background about most standards and file formats. The skill should focus on the local rules and edge cases Claude would otherwise have to guess at.

Add the project-specific rules Claude will not infer

You do not need to explain what Dublin Core is or how CSV files work. Claude Code already knows that much. What it does not know is that your institution requires the dc.rights field to contain a specific license URL, or that your date field must use EDTF (Extended Date/Time Format) notation for uncertain dates. Focus the skill on those local demands.

Include a gotchas section

Add a list of mistakes Claude Code tends to make. Each time you see a repeated error while using the skill, add it to the gotchas.

SKILL.md excerpt ## Gotchas

- The `type` field uses our local vocabulary, NOT
  the standard DCMI Type Vocabulary. See
  `references/local-types.md` for the full list.

- Dates before 1900 must use EDTF format with
  uncertainty markers (e.g., "1850~" for
  "approximately 1850"). Do NOT use "circa".

- Creator names: always check for "Jr.", "III",
  etc. "Martin Luther King, Jr." becomes
  "King, Martin Luther, Jr." not "Jr., Martin
  Luther King".

Show a correct result, then stop

Rules tell Claude Code the constraints. Examples show what a correct result looks like. When format matters, examples are usually more useful than abstract rules. Give Claude Code the boundaries and the local rules, and let it work out the mechanics. Skills that script every step are brittle. They fail on tasks that differ even slightly from the one you wrote them for.

Iterating on a Skill

First versions are usually short. You improve a skill by using it, noticing where Claude Code goes wrong, and adding what was missing.

  1. Start small. Pick the task you explain most often. Five lines of instructions and one gotcha are enough to get something working.
  2. Use it and pay attention to where Claude Code goes wrong.
  3. Add gotchas as you find them. Each repeated mistake gets a line in the list.
  4. Expand the references. If you keep explaining the same edge case in conversation, move the explanation into a reference file so the skill handles it directly.
  5. Test again. After changes, run the skill on a task where you already know what the output should look like.

A Minimal Starting Prompt

Tell Claude Code: "I want to create a skill called [your-name-here]. Here's what it should know: [paste in the instructions you keep repeating]. Use /skill-creator to set it up."

Iterate from use

A metadata skill might start with just the required fields and date format. After a few uses, you have a gotchas list. Creator names with suffixes get inverted incorrectly, the rights field needs a particular URL, multi-value fields are separated with pipes. You only discover those details by using the skill.

When a skill underperforms

The most common failure is that a skill never activates automatically because the description does not match how you phrase your requests. Try adding trigger phrases that reflect your natural wording, or invoke the skill explicitly with /skill-name to confirm the file itself is valid.

When a skill activates but produces wrong output, the instructions are usually ambiguous or missing a case. Add a new gotcha with an example of the correct result. If two skills have overlapping descriptions, both may load at once. To fix this, narrow each description so they trigger in distinct situations. If a skill stopped working after it had worked before, test it with a simple case to see whether the folder structure changed or a Claude Code update shifted behavior.

Sharing Skills

Once a skill works, you can share it the same way you share any other project asset.

For most teams, a shared Git repository is enough. Updates are tracked through version control, and new team members inherit the same conventions when they clone the project. (If Git is new to you, the Git guide in this series covers the basics.)

Skills as documentation

Because a skill file is plain markdown, it is readable by both humans and Claude Code. Metadata standards, workflow conventions, and formatting rules encoded as skills can double as onboarding documentation for new team members.

A Complete Example

To see how these pieces fit together, here is a complete skill for a common library task: preparing metadata for a digital exhibit in Omeka S.

omeka-metadata/
  SKILL.md
  references/
    field-mapping.md # Dublin Core to Omeka field map
    controlled-vocabs.md # local vocabulary lists
    examples.md # 5 sample records
  assets/
    import-template.csv # blank CSV with correct headers
SKILL.md ---
name: omeka-metadata
description: Prepare metadata for Omeka S digital
  exhibits. Use when creating item records,
  formatting CSV imports, or working with
  Dublin Core fields for our digital
  collections platform.
---

# Omeka S Metadata Preparation

Prepare item metadata for import into our
Omeka S instance. All records use Dublin Core
with local extensions.

## Required Fields
Every item must have: dcterms:title,
dcterms:creator, dcterms:date,
dcterms:type, dcterms:rights.

See `references/field-mapping.md` for the
complete field list and Omeka property IDs.

## Date Format
- Exact dates: YYYY-MM-DD
- Year only: YYYY
- Approximate: YYYY~ (EDTF uncertain)
- Range: YYYY/YYYY
- Unknown: leave blank, set dcterms:description
  to note "date unknown"

## Gotchas
- Omeka S CSV Import expects the header row to
  use property URIs such as "dcterms:title".
  Labels like "Title" are too vague.
- The rights field must contain our standard
  statement. See line 12 of controlled-vocabs.md.
- Creator names in "Last, First" format. For
  institutions, use the name as-is (do not
  invert).
- Multi-value fields: separate with a pipe
  character (|). Semicolons break imports here.
- Always use the import template in
  `assets/import-template.csv` as the starting
  point. Do not create CSV files from scratch.

The skill is short on purpose. It has the field mapping, the date conventions, the rights statement, and a gotchas list. You add to the list as you find more edge cases. There is no need to write a comprehensive version up front.

Further Reading