# How to Build an Agent Skill: A Step-by-Step Guide

> Build an Agent Skill to automate specialized workflows across Claude surfaces. Learn to create portable directories with YAML metadata and instructions.

Source: https://camnangai.com/en/tools/how-to-build-an-agent-skill  
Published: 2026-08-02

By following this guide, you will finish with a working, portable [Agent
  Skill](https://camnangai.com/en/knowledge/what-are-agent-skills) that automates specialized tasks across Claude
  surfaces.

This architecture lets you package procedural knowledge into modular directories, so you can **build
an Agent Skill** that scales from simple text heuristics to complex, script-driven operations.

Before you start, you need a terminal to run commands, a local directory to work in, and access to a
Claude product — the Claude API, Claude Code, or the claude.ai web interface.

![A .claude/skills/ directory open in an editor, showing the SKILL.md file inside an Agent Skill](https://camnangai.com/articles/huong-dan-tao-agent-skill/01-infographic.webp)

## Step 1 — Pick the repeated task worth packaging as a Skill

Identify a manual, multi-step workflow or a set of domain-specific rules you keep pasting into chat
windows. If a task requires deterministic execution or consistent formatting — where "hallucination"
in the procedure is unacceptable — it belongs in a Skill. High-value candidates include PDF
manipulation such as complex form filling, checking marketing copy against brand guidelines, or
running multi-layered, domain-specific code reviews. If your
[`CLAUDE.md`](https://camnangai.com/en/for/developers/claude-md-vs-agents-md-vs-skill-md) has grown into a procedure
rather than a set of facts, that section is the candidate.

## Step 2 — Write the evaluations before you write any instructions

Define your success criteria before drafting a single line of instruction. Create at least three
representative test cases that reflect the varied inputs your Skill will handle. Run these prompts
against Claude without a Skill active to get a performance baseline; that shows the specific failure
points where Claude's native reasoning needs the explicit guardrails your Skill will provide.

![The evaluations-first loop: run the task with no Skill to get a baseline, write the Skill, run again, then compare against that baseline](https://camnangai.com/articles/huong-dan-tao-agent-skill/02-en.webp)

## Step 3 — Scaffold the Skill in your skills directory

Agent Skills are filesystem-based directories, not standalone files. This structure lets the Skill
include secondary reference materials and executable scripts without bloating the primary context.
Create the Skill directory and the required entry point:

```bash
mkdir my-skill && touch my-skill/SKILL.md
```

Verify the directory exists. Claude looks specifically for `SKILL.md` to bootstrap the Skill's
logic.

_The rest of this article is for members. Read it at https://camnangai.com/en/tools/how-to-build-an-agent-skill_
