Published on

Create Agent Skills in Simple Steps

Authors
Saad Bash

Agent skills extend Claude Code and Codex with custom capabilities through simple markdown files and scripts.

Claude Code

Install the skills marketplace

/plugin marketplace add anthropics/skills

Install skill-creator

/plugin install skill-creator@anthropic-agent-skills

Create a new skill

Ask Claude to create a skill:

Create a new skill called "slug-generator" that converts text to URL-friendly slugs

Or manually initialize:

python scripts/init_skill.py my-skill --path ./skills

Skill structure

my-skill/
├── SKILL.md (required)
├── scripts/ (optional)
├── references/ (optional)
└── assets/ (optional)

SKILL.md format

---
name: slug-generator
description: |
  Convert text to URL-friendly slugs with customizable
  separators. Use when you need to: (1) Generate URL
  slugs from titles, (2) Create file-safe names.
---

# Slug Generator

## Usage

Input: "My Blog Post Title!"
Output: "my-blog-post-title"

## Implementation

See [slug_transform.py](scripts/slug_transform.py)

Example script

scripts/slug_transform.py:

import re

def generate_slug(text: str, separator: str = '-') -> str:
    slug = text.lower().strip()
    slug = re.sub(r'[^a-z0-9]+', separator, slug)
    slug = re.sub(f'{separator}+', separator, slug)
    return slug.strip(separator)

if __name__ == '__main__':
    import sys
    text = sys.argv[1] if len(sys.argv) > 1 else "Example Text"
    print(generate_slug(text))

Package the skill

python scripts/package_skill.py ./skills/my-skill

Creates my-skill.skill file.

Install your skill

/plugin install ./my-skill.skill

Use your skill

Use the slug-generator skill to convert: "My Amazing Title"

Codex (OpenAI)

Create skill with skill-creator

$skill-creator

With context:

$skill-creator
Create a skill that generates commit messages from git diff.

Manual creation

Create in either location:

# User-scoped
~/.codex/skills/my-skill/

# Repo-scoped
.codex/skills/my-skill/

Codex SKILL.md format

---
name: commit-msg-generator
description: Generate conventional commit messages from git diff. Use when committing changes.
---

# Commit Message Generator

Review git diff and generate a conventional commit message.

## Steps

1. Run `git diff --staged`
2. Analyze changes
3. Generate message with format: `type(scope): subject`
4. Suggest conventional types: feat, fix, refactor, docs

Restart Codex

# Restart to load new skills
codex restart

Activation

Skills activate automatically when mentioned or via:

/skills

Or explicitly:

$my-skill

Key Differences

AspectClaude CodeCodex
Install command/plugin installFiles in ~/.codex/skills/
Skill creatorskill-creator@anthropic-agent-skills$skill-creator
ActivationMention skill name$skill-name or auto
Packaging.skill zip fileDirectory structure

Resources