# Agentsmd optimize

> Agentsmd optimize is an open-source agent skill for developer tools. Audits and cleans up AGENTS.md, CLAUDE.md, skills and agent definitions for coding agents. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/majiayu000/spellbook/tree/main/skills/agentsmd-optimize
- **Repository:** https://github.com/majiayu000/spellbook
- **GitHub stars:** 303
- **License:** MIT
- **Skill name:** agentsmd-optimize
- **Collection:** https://github.com/majiayu000/spellbook
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill reviews the instruction files that shape a coding agent's behavior, including AGENTS.md and CLAUDE.md files, installed skills and agent definitions. It looks for conflicting rules, unnecessary approval pauses, overly broad skill triggers, duplicated guidance and references that point to missing files. Inspection is read-only by default, and edits are made only when the user authorizes them.

When changes are authorized, the skill asks for an explicit backup of original files, records paths, symlink targets and hashes, and then applies small, evidence-backed edits. It reports a readable diff and verification steps, and it separates confirmed structural facts from inferred behavioral effects. It also guides the agent to preserve managed blocks, owner preferences and approval boundaries rather than rewriting every file for consistency.

The skill ships as a folder with a single SKILL.md and a review examples reference file, and it runs no bundled scripts. It works with the file system and whatever access path the user specifies, and it does not require a particular shell, account or plugin.

## When your agent uses it

> Audit and organize AI coding-agent instructions, including AGENTS.md, CLAUDE.md, skills, and agent definitions. Use when the user asks to diagnose conflicting instructions, excessive approval pauses, broad skill triggers, duplicate guidance, or broken instruction references, or to clean up that instruction set. Ordinary code review, Markdown editing, or application debugging alone does not trigger this workflow. Inspection stays read-only; apply changes when authorized.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/majiayu000/spellbook/tree/HEAD/skills/agentsmd-optimize)
- [License: MIT](https://github.com/majiayu000/spellbook/tree/HEAD/skills/agentsmd-optimize)

## Features

- **Instruction conflict detection:** Finds rules across instruction files that disagree about scope, precedence, when to ask or allowed actions.
- **Approval pause review:** Spots workflows that repeatedly ask for permission the user already granted, while keeping real approval gates.
- **Skill trigger precision:** Checks whether skill descriptions match the actual capability or fire on ordinary work too broadly.
- **Duplicate and drift checks:** Compares same-name files and repeated guidance to find inconsistent copies without deleting intentional host differences.
- **Broken reference repair:** Verifies paths and links in instructions and repairs them only with a verified source, never by substituting unrelated files.
- **Backup and diff workflow:** Saves originals with hashes before edits and reports a diff with restore steps for the changed files.

## Good for

- Analyze my project's AGENTS.md and CLAUDE.md for conflicting instructions without editing them
- Find skills whose descriptions trigger too broadly on ordinary coding tasks
- Remove duplicate guidance from my personal instructions while keeping my approval rules
- Fix broken file references in my agent instruction set and show me the diff
- Check which instruction and skill files are actually present and where symlinks point

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/agentsmd-optimize` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/majiayu000/spellbook.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/agentsmd-optimize &&
cp -R "$tmp/skills/agentsmd-optimize" ~/.claude/skills/agentsmd-optimize &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/agentsmd-optimize` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/agentsmd-optimize` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/majiayu000/spellbook.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/agentsmd-optimize &&
cp -R "$tmp/skills/agentsmd-optimize" ~/.agents/skills/agentsmd-optimize &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/agentsmd-optimize` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/agentsmd-optimize` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/majiayu000/spellbook.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/agentsmd-optimize &&
cp -R "$tmp/skills/agentsmd-optimize" ~/.cursor/skills/agentsmd-optimize &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/agentsmd-optimize` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/majiayu000/spellbook.git --path skills/agentsmd-optimize
```

Or copy the folder to `~/.gemini/skills/agentsmd-optimize` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/agentsmd-optimize`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/majiayu000/spellbook.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/agentsmd-optimize &&
cp -R "$tmp/skills/agentsmd-optimize" ~/.copilot/skills/agentsmd-optimize &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/agentsmd-optimize` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/majiayu000/spellbook.git
```

Then copy `spellbook/skills/agentsmd-optimize` into your agent's skills folder as `agentsmd-optimize`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does Agentsmd optimize change my files when I run it?

No. Inspection is read-only, and edits are made only when the user authorizes changes. Before editing, it saves originals and records hashes and symlink targets.

### Which AI clients does Agentsmd optimize cover?

It is built around AI coding-agent instruction files such as AGENTS.md, CLAUDE.md, skills and agent definitions, with checks that depend on the host's documented discovery rules.

### Does Agentsmd optimize need any scripts or extra tools?

The package contains no scripts. It uses the available file system and does not require a particular shell, account, plugin or memory service.

### When does Agentsmd optimize trigger?

It triggers when the user asks to diagnose conflicting instructions, excessive approval pauses, broad skill triggers, duplicate guidance or broken references, or to clean up that instruction set. Ordinary code review or Markdown editing does not trigger it.

### How do I install Agentsmd optimize in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/agentsmd-optimize to use it in all your projects, or to .claude/skills/agentsmd-optimize in one project.

### Does Agentsmd optimize run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Agentsmd optimize?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Agentsmd optimize?

The closest alternatives to Agentsmd optimize are Agents md improver, Agents md, Agents md, Agentsmd scaffold and Skill author.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Agents md improver](https://ai-powered.com/skills/agents-md-improver): Agents md improver is an open-source agent skill for developer tools.
- [Agents md](https://ai-powered.com/skills/agents-md-richardgill): Agents md is an open-source agent skill for developer tools.
- [Agents md](https://ai-powered.com/skills/agents-md-scaledockhq): Agents md is an open-source agent skill for developer tools.
- [Agentsmd scaffold](https://ai-powered.com/skills/agentsmd-scaffold): Agentsmd scaffold is an open-source agent skill for developer tools.
- [Skill author](https://ai-powered.com/skills/skill-author): Skill author is an open-source agent skill for developer tools.
- [Agents md authoring](https://ai-powered.com/skills/agents-md-authoring): Agents md authoring is an open-source agent skill for developer tools.
- [Agents md checker](https://ai-powered.com/skills/agents-md-checker): Agents md checker is an open-source agent skill for developer tools.
- [Agent skills](https://ai-powered.com/skills/agent-skills): Agent skills is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/agentsmd-optimize
