mend-agent-skills
npx machina-cli add skill yu-iskw/meta-agent-skills/mend-agent-skills --openclawMend Agent Skills
Purpose
This skill iterates through existing agent skills, verifies that their embedded commands (e.g., make lint, npm test) are still valid in the current codebase, and updates them if they are broken or outdated.
When to Use
- When the
Makefileor task runner configuration (e.g.,package.json,pyproject.toml) has changed. - When an agent reports that a command in a skill failed to execute.
- As a periodic health check to prevent "bit rot" in the agentic layer.
Instructions
1. Identify Target Platform
- Check for existing configuration directories:
.claude/-> Claude Code.cursor/-> Cursor.gemini/-> Gemini CLI.codex/-> Codex
- If multiple or none are found, or if you are unsure, use
AskQuestionto ask the user which platform to prioritize.
2. Audit Skills
- Iterate through each
SKILL.mdfile in the platform's skills directory (e.g.,.claude/skills/). - Identify commands defined in tables or instruction blocks. Look for keywords like
Command,Step, or code blocks containing shell commands.
3. Verify and Mend Commands
- For each extracted command:
- Determine its intended working directory.
- Verify: Check if the command/target is still valid.
- If it's a
makecommand, check theMakefile. - If it's an
npm/pnpm/yarncommand, checkpackage.json. - If it's a language-specific tool (e.g.,
pytest,ruff), verify the tool is configured.
- If it's a
- Mend:
- If the command is invalid, search for a replacement (e.g., if
make testbecamemake unit-test). - If a replacement is found, update the
SKILL.mdfile usingStrReplace. - If no replacement is found, mark the skill as "Broken" and report it.
- If the command is invalid, search for a replacement (e.g., if
4. Final Report
- Summarize:
- Total skills audited.
- Commands successfully mended.
- Skills requiring manual intervention (no replacement found).
Source
git clone https://github.com/yu-iskw/meta-agent-skills/blob/main/skills/mend-agent-skills/SKILL.mdView on GitHub Overview
Mend Agent Skills audits each skill's embedded commands to ensure they still align with the current codebase. It updates outdated commands or marks skills as Broken to prevent bit-rot in the agentic layer.
How This Skill Works
The process scans for platform config directories (.claude, .cursor, .gemini, .codex) to identify the target platform. It then audits every SKILL.md to extract commands from tables or instruction blocks, checks their validity against Makefiles, package.json, or tool configs, and applies replacements using StrReplace when needed; if no replacement is found, the skill is marked as Broken.
When to Use It
- When the Makefile or task runner configuration (e.g., package.json, pyproject.toml) has changed.
- When an agent reports that a command in a skill failed to execute.
- As a periodic health check to prevent bit rot in the agentic layer.
- When migrating to a different platform (Claude, Cursor, Gemini, Codex) and commands need alignment.
- After dependency or tooling upgrades (e.g., pytest, lint tools) to ensure commands remain valid.
Quick Start
- Step 1: Identify Target Platform by locating .claude, .cursor, .gemini, or .codex.
- Step 2: Audit Skills by scanning each SKILL.md for Command/Step blocks and embedded commands.
- Step 3: Verify and Mend: confirm validity, apply replacements with StrReplace, or mark as Broken.
Best Practices
- Limit changes to command substrings and test updated skills locally before deployment.
- Verify the working directory for each command to avoid path-related failures.
- Prefer stable replacements and document why each change was made.
- Run a quick dry-run to confirm commands execute as expected after mends.
- Record changes in SKILL.md and maintain a changelog for traceability.
Example Use Cases
- A skill using 'make lint' breaks after a Makefile update; replace with the new target and update SKILL.md.
- An 'npm test' command fails after package.json script rename; mend to the new script name.
- A Python skill relies on 'pytest' but the project switched to 'pytest -q'; update command accordingly.
- A skill references 'make test' whereas the repo uses 'make unit-test'; update to the new target.
- No replacement found for a broken command; mark the skill as Broken and report for manual intervention.