---
title: "Test each skill and keep it current · Agent Wranglers"
url: https://agentwranglers.se/playbook/ai-assisted-development/agent-skills/test-and-maintain-skills
updated: 2026-10-21
licence: "All rights reserved"
---

# Test each skill and keep it current

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

- Level: Recommended
- Chapter: [Agent skills](https://agentwranglers.se/playbook/ai-assisted-development/agent-skills)
- Rule: 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: 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](https://agentwranglers.se/playbook/ai-assisted-development/measuring-and-improving/evaluate-agent-setup) 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.
- 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.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
// 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

```python
# 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}")
```

## Related rules

- [Write a description that says when to use the skill](https://agentwranglers.se/playbook/ai-assisted-development/agent-skills/skill-description) in AI development
- [Keep the skill file short and put fixed steps in scripts](https://agentwranglers.se/playbook/ai-assisted-development/agent-skills/skill-scripts) in AI development
- [Test changes to the agent setup on fixed tasks](https://agentwranglers.se/playbook/ai-assisted-development/measuring-and-improving/evaluate-agent-setup) in AI development

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/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 development playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Ask before a skill changes data or spends money](https://agentwranglers.se/playbook/ai-assisted-development/agent-skills/skill-asks-first)
- Next: [Copying rules the agent already has into a skill](https://agentwranglers.se/playbook/ai-assisted-development/agent-skills/duplicate-skill-text)
- [Agent skills](https://agentwranglers.se/playbook/ai-assisted-development/agent-skills)
