# Claude Skills

Packaged, reusable instructions that turn repeatable work into something invokable rather than re-explained each time.

**Rests on:** Context Packs, Skill Design and Scoping

*AI Agents · AI Coding Assistants*


## Why learn this

Claude Skills let you package the repetitive coding chores you do every day — formatting a commit message, writing a test, reviewing a pull request — into something you can invoke with a single line instead of re-explaining every time. Once you grasp this, you'll see how larger AI coding systems work: automated helpers that run changes across multiple files at once, tools that fetch data from your company's customer records, and even automated testing suites. Mastering skills here is the gateway to understanding how these automated helpers coordinate complex tasks and how developers build reliable AI-assisted software.


## The intuition

Think of every task you do repeatedly: writing a status update, formatting a report, checking a list of items against a set of rules. Each time you do it, you have to remember the steps, the format, the exceptions. Now imagine you could write those steps down once, save them in a file, and then just say 'do the status update' and have it done consistently every time. That's what a Claude Skill is — a written set of instructions that your AI assistant can follow whenever you ask. It's not a magic black box; it's plain text that tells the AI what to do, so it doesn't have to guess or ask you a hundred questions. The key is that the instructions are reusable — you write them once, but they work for any similar task you throw at them.


## An analogy

A recipe is a good analogy for a skill. When you want to cook a particular dish, you don't describe every ingredient and action from scratch each time — you follow the recipe. It's a written set of instructions that gets you a consistent result. But like a skill, a recipe has a scope: a recipe for 'pasta' is too vague to be useful — you'd end up with something different every time. You need a recipe for 'spaghetti with tomato sauce' — that's specific enough to give you what you want. The same is true for skills: if you write a skill for 'write a test', it'll be too broad and you'll get unpredictable results. You need a skill for 'write a unit test for the login function' — that's narrow and reliable. A recipe works like a skill because both are self-contained instructions that yield predictable outcomes when followed correctly.


## Definition

A Claude Skill is a packaged, reusable set of instructions that turns a repeatable piece of work into something invokable by an AI assistant, rather than having to be re-explained each time.


## How it connects

You're starting fresh, so I'll place this within the world of AI coding tools. Claude Skills are a way to give an AI assistant like Claude instructions that persist across conversations. Without a skill, every time you ask Claude to 'write a unit test', you'd have to explain what testing framework to use, what conventions to follow, where the test files go, etc. A skill bundles all that into one file you invoke by name. This is related to the idea of an Agent Instruction File — a document that provides background information to an automated helper before it starts working. But a skill is more focused: it's a single procedure, whereas an instruction file might cover general architecture and commands. Your library notes also connect skills to Skill Design and Scoping — the art of defining what a skill does and what it doesn't. That's exactly the craft we'll touch on here.


## From scratch, in Python

```python
skills are not code, but they are written in Markdown, which we can explore with Python by reading and using the text. Here's a plain-Python example of what a skill file might look like and how we could parse it. We'll start by learning what a dictionary is, then we'll read a skill file and print its parts.

# Step 1: Let's create a dictionary to hold a simple skill
# A dictionary is like a labeled box. You put things in, and you find them by a name, not by a number.
skill = {
    "name": "commit-message",
    "description": "Write a conventional commit message.",
    "instructions": "Given the diff, write a commit message that follows the conventional format: type(scope): description."
}

# Step 2: Let's see what's inside
print(skill["name"])            # prints: commit-message
print(skill["description"])     # prints: Write a conventional commit message.

# Step 3: Often we have many skills. Let's make a list of dictionaries.
skills_list = [
    {"name": "commit-message", "instructions": "Write conventional commit."},
    {"name": "review-pr", "instructions": "Review the PR for style and correctness."}
]

# Step 4: Loop through the list to find the one we want
for s in skills_list:
    if s["name"] == "review-pr":
        print("Found: " + s["instructions"])

# Output: Found: Review the PR for style and correctness.
```


## What the code does

Step 1: We define a dictionary — that's a Python data structure that maps names to values. We use curly braces and colons. We store a skill's name and instructions. Step 2: We access values with square brackets and the key name. Step 3: We create a list of dictionaries — that's a list, which is an ordered collection of things. Each item in the list is a dictionary. Step 4: We use a for-loop to go through each dictionary in the list and check if the name matches. If it does, we print its instructions. This is exactly how a real skill registry works: you have a collection of skills, and you search for the one you need.


## Common misconceptions

**A skill is just a saved prompt** — A skill is just a prompt that I save so I don't have to type it again.

While a skill is text, it's more than a prompt. A skill is designed as a versioned, testable artifact. It has a clear trigger condition, a scope, and it can be tested against known inputs. A saved prompt is informal and doesn't have that structure. In fact: A skill is a formal, reusable instruction set that includes metadata like a name, description, and trigger conditions, making it testable and reliable.

**A skill can do everything** — The more a skill covers, the more useful it will be.

A skill that tries to cover every possible scenario becomes vague. The model doesn't know which rule to follow when the skill has dozens of different instructions for separate cases. In fact: A skill should be narrowly scoped. Focus on one kind of task so that the instructions are clear and the behavior is predictable.

**Once you write a skill, you never have to update it** — I wrote the skill, so it's done forever.

Skills are versioned artifacts. As your project changes, the skill might become outdated. For example, if you change your coding standards, the skill needs to be updated to match, otherwise it will give wrong instructions. In fact: Skills need maintenance and versioning, just like code. You should review and update them as your processes evolve.

**Skills always run their code automatically** — A skill executes a program on my computer.

A skill is just text instructions. The AI model reads and interprets them and then produces a response or action. It doesn't run a script by itself; it uses the instructions to guide its reasoning and output. In fact: A skill is a set of instructions for the AI model to follow. The model interprets them, and when it generates code, that code needs to be run separately.


## In short

A Claude Skill is a reusable set of instructions that packages a specific task so an AI assistant can execute it consistently, without re-explaining the procedure every time. Skills are versioned and testable, and their scope is critical: a skill that tries to do everything ends up doing nothing well. They are used across AI systems—from coding agents to RAG pipelines—to standardize how models handle tasks.


## Where this is used

Claude Skills are used in a variety of AI systems, primarily those that involve coding assistants and agents. In **large language models** like Claude, a skill is a specific set of instructions that the model follows to perform a task, such as writing code, generating a summary, or explaining something. When you invoke a skill, the model retrieves its instructions and uses that to guide its response. Developers use skills to standardize the output of the model based on their needs — for example, ensuring all generated code follows company style. In **small models running on devices**, skills might be preloaded into the model's context to handle a specific user request like a voice command to 'set an alarm' — the skill tells the model exactly how to parse the command and call the right function. In **retrieval-augmented generation (RAG)**, a skill might be used to generate a query for a vector database, ensuring the search is consistent. The skill would contain instructions on how to structure the query. In **agentic systems**, skills are crucial. An agent can be given a set of skills it can invoke to break down a complex task. For example, an agent coding a feature might use a skill to write a unit test, another skill to format the code, and a third to commit the changes. The agent doesn't have to explain each step; it just calls the skill. This is how frameworks like Claude Agent SDK let you define tools and skills. In **everyday applied ML**, a data scientist might use a skill to generate a data cleaning pipeline or a feature engineering script, so that the model training is consistent across experiments. In practice, a developer writes a skill file (usually in Markdown) that contains the instructions, and then references it when calling the model. They might use a framework like `claude-code` or the `@skills` directory. When done badly, a skill that is too broad or vague will cause the model to produce unreliable results, wasting developer time.


---

Read this on the web: https://basavapurushottam.com/learn-ai/claude-skills
