How to Write and Test a SKILL.md File
Learn how to write a SKILL.md file for compatible AI agents, with a release-check example tested in Codex on an Astro blog.
I wrote a small skill to check whether my Astro blog, Quiet Iterations, was ready to deploy. I tested it in Codex. The agent found the skill, ran the preview build, and saw that the SEO checks passed. Then it kept going. It built the production version and ran a Cloudflare deployment dry run.
I’d intended the skill to run one command. The first test showed that I also needed to tell the agent when the job was done. How I deployed this blog to Cloudflare Workers
What is a SKILL.md file?
SKILL.md is part of the open Agent Skills format. It puts a name, a description, and instructions for a repeatable task in a Markdown file. The skill folder can also hold scripts, references, or templates. Agent Skills specification
The example below should also work with other agents that support Agent Skills, provided they can find the file and run pnpm in the repository. The folder location depends on the client. Codex looks in .agents/skills/, and Claude Code looks in .claude/skills/. The results in this article come from my Codex test. Codex documentation · Claude Code documentation
What I changed after the first run
My original last step said, “Finish with the local verification report.” A production build and a Wrangler dry run both fit that wording. I changed the step so the check would end as soon as the agent reported the preview build result.
I repeated the same request in a fresh Codex session. It selected the skill, ran pnpm run build:preview, and stopped after the report. The SEO checks covered 10 pages, 7 sitemap URLs, and 3 social images. They also confirmed that the preview kept noindex.
In a separate test, I forced the analytics check to stop the build before Astro started. Codex identified the first error and reported that the SEO checks were skipped.
Write and test your first skill
Create a folder called check-blog-release in your agent’s project skills directory and save the following as SKILL.md. In Codex, the full path is .agents/skills/check-blog-release/SKILL.md.
---name: check-blog-releasedescription: Use when asked to check whether Quiet Iterations is ready to deploy. Runs the local preview build and reports its SEO check results.---
# Check the blog before deployment
1. From the repository root, run `pnpm run build:preview`.2. Report whether the build and SEO checks passed.3. If the build failed, report the first actionable error and say whether the SEO checks ran.4. Stop after reporting the result of `pnpm run build:preview`. Keep this check scoped to the local preview build and its output.For your own project, use a command whose output you already know how to verify. Ask the agent to do the check in a fresh session, then compare its report with the commands it actually ran. In my first test, the build passed. The command log showed the extra work the agent had decided to do.
What else can skills do?
Three widely installed examples on Skills.sh cover different jobs. Skills.sh leaderboard
agent-browserhelps an agent click through a site and capture screenshots. Agent Browserfrontend-designguides layout, typography, and color choices when building an interface. Frontend Designvercel-react-best-practicesguides React and Next.js performance reviews, including checks for sequential data fetching and large bundles. Vercel React Best Practices
Keep a little room for curiosity. — Q.