---
name: agent-skills
description: Create, use, and manage Agent Skills for Claude. Use when working with Skills, creating custom capabilities, or understanding how Skills extend Claude's functionality. Covers Skill architecture, file structure, and best practices.
title: agent-skills
canonical_url: https://skilld.dev/gh/jyasuu/cheat-sheet/agent-skills
last_updated: 2026-10-06T17:16:37.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install jyasuu/cheat-sheet/agent-skills`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/agent-skills`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/jyasuu/cheat-sheet/agent-skills) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/agent-skills`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/agent-skills --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/agent-skills --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Agent Skills

Agent Skills are modular capabilities that extend Claude's functionality. Each Skill packages instructions, metadata, and optional resources that Claude uses automatically when relevant.

## Quick Start

```yaml
# A basic skill structure
---
name: my-skill
description: Brief description of what this Skill does
---

# My Skill

## Instructions
Clear, step-by-step guidance for Claude to follow

## Examples
Concrete examples of using this Skill
```

## Why use Skills

Skills provide domain-specific expertise that transforms general-purpose agents into specialists. Unlike prompts, Skills load on-demand and eliminate repetitive guidance.

**Key benefits**:
- **Specialize Claude**: Tailor capabilities for specific domains
- **Reduce repetition**: Create once, use automatically
- **Compose capabilities**: Combine Skills to build complex workflows

## How Skills Work

Skills leverage Claude's VM environment with filesystem access. They exist as directories containing instructions, executable code, and reference materials.

### Three Levels of Loading

| Level | When Loaded | Token Cost | Content |
|-------|-------------|------------|---------|
| **Level 1: Metadata** | Always (startup) | ~100 tokens | `name` and `description` from YAML frontmatter |
| **Level 2: Instructions** | When triggered | Under 5k tokens | SKILL.md body with guidance |
| **Level 3+: Resources** | As needed | Unlimited | Bundled files executed via bash |

Progressive disclosure ensures only relevant content occupies the context window.

### Skill Directory Structure

```
my-skill/
├── SKILL.md              # Main instructions
├── GUIDE.md              # Additional guidance
├── REFERENCE.md          # API reference
└── scripts/
    └── helper.py         # Utility scripts
```

**Instructions**: Additional markdown files with specialized guidance
**Code**: Executable scripts that Claude runs via bash
**Resources**: Reference materials like schemas, templates, examples

## Skill Structure

Every Skill requires a `SKILL.md` file with YAML frontmatter:

```yaml
---
name: your-skill-name
description: Brief description of what this Skill does and when to use it
---

# Your Skill Name

## Instructions
[Clear, step-by-step guidance]

## Examples
[Concrete examples]
```

### Field Requirements

**name**:
- Maximum 64 characters
- Lowercase letters, numbers, and hyphens only
- Cannot contain XML tags
- Cannot use reserved words: "anthropic", "claude"

**description**:
- Must be non-empty
- Maximum 1024 characters
- Cannot contain XML tags
- Should explain what the Skill does AND when to use it

## Creating Custom Skills

### For Claude Code

1. Create a directory in `.claude/skills/`
2. Add a `SKILL.md` file with YAML frontmatter
3. Optionally add supporting files (guides, scripts, resources)
4. Claude discovers and uses them automatically

```bash
.claude/skills/
├── my-skill/
│   ├── SKILL.md
│   └── scripts/
│       └── helper.sh
└── another-skill/
    └── SKILL.md
```

### For Claude API

1. Create Skill as a directory with `SKILL.md`
2. Upload via Skills API (`/v1/skills` endpoints)
3. Reference `skill_id` in the `container` parameter
4. Requires beta headers:
   - `code-execution-2025-08-25`
   - `skills-2025-10-02`
   - `files-api-2025-04-14`

### For Claude.ai

1. Create Skill as a directory with `SKILL.md`
2. Zip the skill directory
3. Upload through Settings > Features
4. Available on Pro, Max, Team, Enterprise plans

## Best Practices

### Writing Effective Skills

**Be specific about when to use**:
```yaml
description: Extract text from PDF files using pdfplumber. Use when user mentions PDFs, text extraction, or document processing.
```

**Include concrete examples**:
```markdown
## Examples

To extract text from a PDF:
```python
import pdfplumber
with pdfplumber.open("document.pdf") as pdf:
    text = pdf.pages[0].extract_text()
```

**Organize progressively**:
- Quick start first
- Common workflows
- Advanced scenarios
- Reference materials

### Bundling Resources

**Use scripts for reliability**:
```bash
# Scripts execute without loading code into context
$ bash validate.sh
Validation passed
```

**Include reference materials**:
- API documentation
- Database schemas
- Code examples
- Templates

## Security Considerations

**Use Skills from trusted sources only**:

- **Audit thoroughly**: Review all files bundled in the Skill
- **External sources are risky**: Skills fetching external content pose risks
- **Tool misuse**: Malicious Skills can invoke tools in harmful ways
- **Data exposure**: Skills with sensitive data access could leak information
- **Treat like installing software**: Only use Skills from trusted sources

## Cross-Surface Availability

| Surface | Custom Skills | Pre-built Skills |
|---------|---------------|------------------|
| Claude API | Yes | Yes (pptx, xlsx, docx, pdf) |
| Claude Code | Yes (filesystem-based) | No |
| Claude.ai | Yes (uploaded) | Yes (pptx, xlsx, docx, pdf) |

**Custom Skills do not sync across surfaces** - manage separately for each.

### Runtime Environment

**Claude API**:
- No network access
- No runtime package installation
- Pre-configured dependencies only

**Claude Code**:
- Full network access
- Local package installation only

**Claude.ai**:
- Varying network access (depends on settings)

## Pre-built Agent Skills

Available immediately:

- **PowerPoint (pptx)**: Create presentations, edit slides, analyze content
- **Excel (xlsx)**: Create spreadsheets, analyze data, generate charts
- **Word (docx)**: Create documents, edit content, format text
- **PDF (pdf)**: Generate formatted PDF documents and reports

## Sharing Models

| Surface | Scope |
|---------|-------|
| Claude.ai | Individual user only |
| Claude API | Workspace-wide |
| Claude Code | Personal (`~/.claude/skills/`) or project-based (`.claude/skills/`) |

## Advanced Patterns

### Chaining Skills

Combine Skills to build complex workflows:
1. Skill A processes input
2. Skill B transforms output
3. Skill C validates results

### Environment-Aware Skills

Design Skills to adapt to runtime:
```markdown
## Runtime Notes

- Claude API: Use pre-installed packages only
- Claude Code: Can install packages locally
- Adjust behavior based on available tools
```

### Progressive Disclosure

Structure Skills so Claude loads only what's needed:
```markdown
# Main Skill

## Quick Start
Essential information for common tasks

## Advanced Usage
Detailed guidance when needed

See [REFERENCE.md](https://skilld.dev/api/skills-raw/jyasuu/cheat-sheet/agent-skills/REFERENCE.md) for complete API documentation.
```

## Troubleshooting

### Skill Not Loading

1. Verify `SKILL.md` exists in skill directory
2. Check YAML frontmatter is valid
3. Ensure `name` uses only lowercase letters, numbers, hyphens
4. Confirm `description` is non-empty

### Permission Issues

- Claude Code: Check `.claude/skills/` directory permissions
- Claude API: Verify beta headers are set correctly
- Claude.ai: Confirm plan includes code execution

### Context Overflow

- Move detailed reference to separate files
- Use scripts for complex operations
- Structure with progressive disclosure

## File Reference

- [Authoring Best Practices](https://skilld.dev/docs/en/agents-and-tools/agent-skills/best-practices)
- [Use Skills with Claude API](https://skilld.dev/docs/en/build-with-claude/skills-guide)
- [Use Skills in Claude Code](https://code.claude.com/docs/en/skills)
- [Agent Skills SDK](https://skilld.dev/docs/en/agent-sdk/skills)
