Build Logs·Dec 1, 2026·9 min read
How to Create AI Agent Skills: Make Claude Code and Codex Work Smarter
Stop explaining the same project conventions and workflows to your AI coding assistant every session. Learn how to build reusable SKILL.md packages for Claude Code and OpenAI Codex using the Agent Skills open standard.
how to create AI agent skillsAI agent skillsClaude Code skillsCodex skillsSKILL.md tutorialCustom AI agent instructionsOpenAI Codex custom skillsReusable AI workflowsAgent Skills open standardClaude Code tutorialOpenAI Codex guidehow to automate coding with AIreusable AI prompts
AI coding assistants are becoming increasingly capable. Tools such as Claude Code and OpenAI Codex can understand codebases, write software, execute commands, and help developers automate complicated workflows.
But there’s a problem. Every time you start a new conversation, you might find yourself explaining the same project conventions, coding standards, workflows, and instructions all over again.
What if you could teach your AI agent how to perform a specific task once and reuse that knowledge whenever you need it?
That’s exactly what AI agent skills are designed to do. Agent Skills are reusable packages of instructions, resources, and optional scripts that give AI agents specialized knowledge and repeatable workflows. Even better, the Agent Skills format is an open standard, meaning compatible implementations can use the same skill structure across different AI tools.
In this guide, we’ll create a custom AI agent skill from scratch, understand how
SKILL.md works, and install it in both Claude Code and OpenAI Codex. You don’t need to train a model — all you need is a text editor and an AI coding assistant.Table of Contents
- → What are AI agent skills?
- → How progressive disclosure works
- → What you need before creating a skill
- → Step 1: Create your skill directory
- → Step 2: Write the SKILL.md instructions
- → Step 3: Install in Claude Code
- → Step 4: Install in OpenAI Codex
- → Step 5: Create advanced multi-file skills
- → Step 6: Find existing skill repositories
- → Agent Skills vs System Prompts vs MCP
- → Are AI agent skills worth creating?
- → Frequently asked questions
What Are AI Agent Skills?
An AI agent skill is a reusable set of instructions that teaches an AI agent how to perform a particular task. Think of it as a specialized instruction manual that your AI assistant consults whenever it encounters a matching request.
For example, imagine you regularly ask a coding assistant to:
- Review pull requests for security vulnerabilities and edge cases.
- Write SEO-friendly technical articles with consistent formatting.
- Generate React components following your exact design system.
- Analyze unfamiliar GitHub repositories before integrating them.
- Write documentation matching your team’s house style.
- Prepare deployment configurations and environment checklists.
Without reusable instructions, you end up repeating those rules in every chat session. With a skill, you define the workflow once inside a folder containing:
- A
SKILL.mdfile containing the core metadata and instructions. - Optional reference documents (style guides, schemas, checklists).
- Optional helper scripts (linters, validators, data fetchers).
- Optional supporting templates or assets.
Originally developed by Anthropic and subsequently released as an open standard, you can inspect the full specification at agentskills.io.
How Do AI Agent Skills Work?
Skills use a pattern called progressive disclosure. Instead of stuffing every instruction from every skill into the AI’s context window upfront — which wastes tokens and confuses the model — compatible agents discover skills through lightweight metadata and load the full instructions only when needed.
1. Discovery
At startup, the agent scans configured skill folders and reads only the YAML
name and description from each SKILL.md:name: seo-content-writer
description: Research and write SEO-optimized technical articles for software and technology websites.2. Activation
When you submit a prompt that matches a skill’s description — for example, “Write an article explaining how to install Docker on Windows 11” — the agent loads the complete
SKILL.md instructions into context. Most tools also let you invoke a skill explicitly by name.3. Execution
The agent follows the step-by-step instructions inside
SKILL.md: reading linked reference files, running supporting scripts, or formatting files in a specific structure. Because skills keep context lean until activated, they also save significant token budget — especially helpful if you are running Claude Code and Codex CLI with FreeLLMAPI or working within rate limits.What You Need Before Creating a Skill
You don’t need a custom runtime or complex SDK. All you need is:
| Requirement | Purpose |
|---|---|
| A text editor | Create and edit your SKILL.md file |
| A compatible AI agent | Discover and execute the skill (e.g., Claude Code or OpenAI Codex) |
| A skill folder | Store instructions, references, and optional scripts |
If you are running open-source coding agents against a local environment (such as Ollama on Windows), you can pair the exact same directory layout with any agent client that supports the open standard.
Step 1: Create Your First AI Agent Skill
Let’s build something practical: a
code-reviewer skill that teaches an AI coding assistant to audit source code for logic bugs, security vulnerabilities, performance issues, and maintainability gaps.Create a folder named
code-reviewer and place a file named SKILL.md inside it:code-reviewer/
└── SKILL.mdExact naming matters: Name the file
SKILL.md with uppercase SKILL and lowercase .md. Most skill loaders look specifically for that exact capitalization.Step 2: Write the SKILL.md Instructions
Open
SKILL.md in your editor. Every valid skill starts with YAML frontmatter containing name and description, followed by clear Markdown instructions:---
name: code-reviewer
description: Review source code for bugs, security vulnerabilities, performance issues, and maintainability problems. Use when reviewing code changes or auditing an existing codebase.
---
# Code Reviewer
You are an experienced software engineer conducting a thorough code review.
## Objectives
Identify problems that could affect the correctness, security, reliability, or maintainability of the software.
## Review Process
1. Understand the purpose of the code.
2. Identify the files and functions involved.
3. Examine potential logical errors.
4. Check input validation and error handling.
5. Look for security vulnerabilities.
6. Identify unnecessary performance overhead.
7. Check consistency with existing project conventions.
## Reporting Format
For every issue, provide:
- Severity: Critical, High, Medium, or Low.
- File and relevant line number.
- Description of the problem.
- Why it matters.
- A recommended fix.
## Important Rules
- Do not invent problems.
- Do not report stylistic preferences as bugs.
- Prioritize actual correctness and security issues.
- Explain uncertainty when an issue cannot be verified.
- Do not modify source files unless explicitly requested.
## Final Output
Finish with:
1. A summary of the review.
2. A prioritized list of findings.
3. Any additional recommendations.Save the file. You now have a complete, portable AI agent skill.
Step 3: Install Your Skill in Claude Code
Claude Code discovers custom skills from two filesystem scopes (see the Claude Code Skills documentation):
Personal (global) skill
Available across all of your projects. Place the folder at:
~/.claude/skills/code-reviewer/SKILL.mdOn Windows, ~ resolves to your user profile directory: C:\Users\YOUR_USERNAME\.claude\skills\code-reviewer\SKILL.md.
Project-specific skill
Scoped to a single repository and easy to commit to Git for your whole team:
your-project/
└── .claude/
└── skills/
└── code-reviewer/
└── SKILL.mdOnce placed, open Claude Code and either ask naturally (“Review this project using the code-reviewer skill”) or invoke it directly as a slash command:
/code-reviewerStep 4: Install Your Skill in OpenAI Codex
You can install the exact same
code-reviewer folder into OpenAI Codex (documented in the OpenAI Codex Skills guide).Personal (global) skill
~/.agents/skills/code-reviewer/SKILL.mdOn Windows, this maps to C:\Users\YOUR_USERNAME\.agents\skills\code-reviewer\SKILL.md.
Repository-specific skill
your-project/
└── .agents/
└── skills/
└── code-reviewer/
└── SKILL.mdIn Codex, run
/skills to inspect loaded skills, or ask directly: “Use the code-reviewer skill to inspect this repository.”Portability note: Although the
SKILL.md format is portable, directory paths and invocation triggers differ between apps. Conformance to the open standard does not guarantee identical execution behavior across every agent.Step 5: Create More Advanced Skills
Once a single
SKILL.md becomes too long, split supporting guidelines into dedicated subdirectories so the agent only reads what it needs:seo-content-writer/
├── SKILL.md
├── references/
│ ├── seo-guidelines.md
│ ├── article-structure.md
│ └── editorial-style.md
└── scripts/
└── validate-article.pyFor instance, an
seo-content-writer skill can instruct the agent to:- Identify search intent and long-tail keyword opportunities.
- Plan headings and internal links to related articles.
- Draft the article following
references/editorial-style.md. - Generate meta titles, descriptions, and FAQ schema.
- Run
scripts/validate-article.pyto verify formatting before publishing.
If you handle sensitive repositories or private client drafts inside these workflows, pairing your coding agent with a private local backend keeps your data off external servers — see how to use AI without sending your data to the cloud.
Step 6: Find Existing AI Agent Skills
You don’t have to author every workflow from scratch. Several official and community repositories publish ready-to-inspect skills:
- Agent Skills Official Repository: github.com/agentskills/skills — reference examples for the open format.
- Anthropic Skills Repository: github.com/anthropics/skills — curated workflows maintained by Anthropic.
- OpenAI Skills Repository: github.com/openai/skills — official skills for Codex-compatible workflows.
- GitHub search: Search for
SKILL.md AI agent skillsto discover community skills for testing, documentation, and architecture.
Security warning: Never install third-party skills blindly. Because skills can bundle executable scripts and prompt instructions that steer your agent’s tool calls, treat them like software dependencies: read
SKILL.md and inspect every script before trusting it.AI Agent Skills vs System Prompts vs MCP
Developers often confuse these three layers, because they sit side by side in modern coding tools. In practice, they solve distinct problems:
| Technology | Primary purpose | When it loads |
|---|---|---|
| System prompts | Define an agent’s baseline personality and global rules | Always present in every turn |
| Agent Skills | Package specialized, repeatable workflows and references | On demand when relevant to the task |
| MCP (Model Context Protocol) | Connect AI tools to external APIs, databases, and services | Exposes live tools and resources |
They work best together: a system prompt defines general behavior, an Agent Skill teaches your code-review or writing process, and MCP gives the agent access to GitHub, Postgres, or issue trackers.
Are AI Agent Skills Worth Creating?
If you use Claude Code, Codex, or similar CLI agents daily, yes. Skills pay off immediately whenever you:
- Repeat the same setup instructions or formatting constraints across sessions.
- Maintain consistent standards across multiple repositories.
- Want teammates (or other AI agents) to follow the same engineering playbook.
- Need a single place to update a workflow instead of editing prompts across dozens of files.
Keep expectations grounded, though: a well-crafted skill improves consistency, but it doesn’t guarantee 100% deterministic execution. Model capability, context length, and clear step-by-step phrasing still matter.
Frequently asked questions
Final Thoughts
AI agents are evolving from one-off chat windows into extensible engineering collaborators. Agent Skills give you a lightweight, open-standard way to encode your habits and workflows without fine-tuning a model or building a custom harness.
Pick one repetitive task you explained twice this week, write it into a single
SKILL.md file, drop it into ~/.claude/skills/ or ~/.agents/skills/, and test it on your next commit. Once you stop re-prompting the basics, you’re building a durable toolkit rather than starting from zero every morning.