AID-59Recommended
Test each skill and keep it current
Test each skill on a fixed set of three or more tasks before you change it, and keep a log of its runs. A check fails when a skill names a path or command that no longer exists.
How to do it
Store each test task as a starting commit, a prompt and the check that proves it done. Rerun the set after every change to the skill, as Test changes to the agent setup on fixed tasks describes. Log each live run with date, arguments, result and cost, so you see which skills fail or never run. Skills rot when the code moves. Scan every skill for file paths and commands, and fail when one is gone. Delete a skill that has not run in 90 days, or update it.
Examples
JavaScript example
// check-skill-paths.mjs, every path a skill names still exists
import { readdirSync, readFileSync, existsSync } from 'node:fs';
for (const folder of readdirSync('.claude/skills')) {
const text = readFileSync(`.claude/skills/${folder}/SKILL.md`, 'utf8');
for (const [, path] of text.matchAll(/`((?:\.{0,2}\/)?[\w.-]+\/[\w./-]+\.\w+)/g)) {
if (!existsSync(path) && !existsSync(`.claude/skills/${folder}/${path}`)) throw new Error(`${folder} names missing ${path}`);
}
}
Python example
# check_skill_paths.py, the same check in Python
import pathlib, re
for skill in pathlib.Path(".claude/skills").glob("*/SKILL.md"):
for path in re.findall(r"`((?:\.{0,2}/)?[\w.-]+/[\w./-]+\.\w+)", skill.read_text()):
if not pathlib.Path(path).exists() and not (skill.parent / path).exists():
raise SystemExit(f"{skill.parent.name} names missing {path}")
How to check
Each skill has three or more stored test tasks with results from its last change. The path check passes, and the run log has an entry for every skill in the last 90 days.
Sources
Related rules
- AID-55 Write a description that says when to use the skill in AI-assisted development
- AID-56 Keep the skill file short and put fixed steps in scripts in AI-assisted development
- AID-50 Test changes to the agent setup on fixed tasks in AI-assisted development
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/ai-assisted-development/agent-skills/test-and-maintain-skills">Agent Wranglers AI-assisted development playbook</a>. In code you write, add a comment next to it with the same link.