Get the FREE Ultimate OpenClaw Setup Guide →

mend-agent-skills

npx machina-cli add skill yu-iskw/meta-agent-skills/mend-agent-skills --openclaw
Files (1)
SKILL.md
2.0 KB

Mend 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 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.

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 AskQuestion to ask the user which platform to prioritize.

2. Audit Skills

  • Iterate through each SKILL.md file 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 make command, check the Makefile.
      • If it's an npm/pnpm/yarn command, check package.json.
      • If it's a language-specific tool (e.g., pytest, ruff), verify the tool is configured.
    • Mend:
      • If the command is invalid, search for a replacement (e.g., if make test became make unit-test).
      • If a replacement is found, update the SKILL.md file using StrReplace.
      • If no replacement is found, mark the skill as "Broken" and report it.

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

  1. Step 1: Identify Target Platform by locating .claude, .cursor, .gemini, or .codex.
  2. Step 2: Audit Skills by scanning each SKILL.md for Command/Step blocks and embedded commands.
  3. 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.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers