Skip to main content
Glama
README.md
<p align="center">
  <img src="assets/logo.svg" alt="Skill Doctor Logo" width="96" height="96" />
</p>

<h1 align="center">Skill Doctor</h1>

<p align="center">
  <strong>Lint, debug, and optimize your AI agent skills and rule files before they silently sabotage your prompts.</strong><br/>
  Detect conflicting directives, skill trigger collisions, duplicate names, context token bloat, broken local references, and security hazards across <strong>Antigravity</strong>, <strong>Claude Code</strong>, <strong>Cursor</strong>, and <strong>Codex</strong>.
</p>

<p align="center">
  <a href="https://github.com/oguzhan-yildirim/skill-doctor/actions"><img src="https://img.shields.io/badge/CI-passing-10b981?style=flat-square" alt="CI Status" /></a>
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-0ea5e9?style=flat-square" alt="MIT License" /></a>
  <img src="https://img.shields.io/badge/MCP_App-SEP--1865-14b8a6?style=flat-square" alt="MCP App" />
  <img src="https://img.shields.io/badge/Node-%3E%3D20-34d399?style=flat-square" alt="Node 20+" />
</p>

---

## Why Skill Doctor?

Modern coding agents pull instructions from **everywhere at once**: global `SKILL.md` folders, installed plugins, `~/.claude/CLAUDE.md`, repo-level `AGENTS.md`, `.cursorrules`, `.cursor/rules/*.mdc`, and `.github/copilot-instructions.md`.

When your agent starts behaving erratically — switching between `pnpm` and `npm`, loading the wrong skill, hitting missing helper scripts, or burning 10,000+ system-prompt tokens before your first message — the culprit is almost always hidden inside those files.

**Skill Doctor** gives you a single cross-agent checkup engine, interactive MCP App dashboard, universal MCP server, and standalone CLI:

1. **Directive Contradiction Detector** — Catches opposing rules across global and workspace files (`npm` vs `pnpm`/`yarn`/`bun`, `tabs` vs `spaces`, `vitest` vs `jest`, `never mock` vs `always mock`, `never commit` vs `always commit`, TypeScript `forbid any` vs `allow any`, quote/semicolon/ESM-vs-CJS conflicts) with exact file paths and line numbers — while safely ignoring negated comparisons (`"use pnpm, never npm"`) and fenced code examples.
2. **Skill Trigger Collision Matrix** — Extracts domain trigger keywords from every `SKILL.md` frontmatter description and flags pairs of installed skills competing for the same triggers with **Jaccard similarity** and **overlap scores**.
3. **Duplicate Skill Name Detector** — Flags skills sharing the exact same `name` across Antigravity, plugins, Claude Code, Cursor, Codex, and project `.agents/skills` before one silently shadows another.
4. **Context Bloat & Always-On Token Budget** — Separates **always-on token tax** (skill trigger descriptions + always-applied rule files loaded on *every single turn*) from **on-demand skill bodies**, flagging bloated frontmatter (>120 words), oversized skills (>3,500 words / >5,000 tokens), and missing/vague descriptions (<25 chars).
5. **Broken Local Reference Checker** — Scans Markdown links and companion script/reference paths (`scripts/...`, `references/...`, `templates/...`) inside each skill folder and flags referenced files that don't exist on disk.
6. **Security Hygiene Scanner** — Flags remote pipe-to-shell commands (`curl | bash`), destructive recursive deletions (`rm -rf ~`, `rm -rf /`), hidden zero-width / bidirectional Unicode characters, prompt-injection override strings, and suspicious credential exfiltration patterns.

All 6 checks roll up into a transparent **Workspace Health Score (0–100)** and **Grade (`A`–`F`)**.

---

## Scanned Locations

| Ecosystem | Discovered Paths |
| :--- | :--- |
| **Antigravity** | `~/.gemini/config/skills/*/SKILL.md` |
| **Antigravity Plugins** | `~/.gemini/config/plugins/*/skills/*/SKILL.md`, `~/.gemini/config/plugins/*/rules/AGENTS.md` |
| **Claude Code** | `~/.claude/skills/*/SKILL.md`, `~/.claude/CLAUDE.md` |
| **Cursor** | `~/.cursor/skills/*/SKILL.md` |
| **Codex** | `~/.codex/skills/*/SKILL.md` |
| **Project Workspace** *(optional path)* | `AGENTS.md`, `CLAUDE.md`, `.cursorrules`, `.cursor/rules/*.mdc`, `.github/copilot-instructions.md`, `.agents/skills/*/SKILL.md` |

---

## Quick Start

### 1. Google Antigravity Plugin (Full Interactive MCP App Dashboard)

```bash
git clone https://github.com/oguzhan-yildirim/skill-doctor.git
cd skill-doctor
npm install
npm run build
npm run install:antigravity
```

Antigravity discovers the plugin automatically:
- Launch **Skill Doctor** from the left **Sidebar** or side pane **`+`** menu.
- Or ask in chat: *"Open Skill Doctor and run a full health diagnosis on my skills and rules."*

### 2. Claude Code / Cursor / Codex (Universal MCP Server)

Add `skill-doctor` to your MCP client configuration:

```json
{
  "mcpServers": {
    "skill-doctor": {
      "command": "npx",
      "args": ["-y", "github:oguzhan-yildirim/skill-doctor"]
    }
  }
}
```

Or point directly to a local build:

```json
{
  "mcpServers": {
    "skill-doctor": {
      "command": "node",
      "args": ["/absolute/path/to/skill-doctor/dist/server.js"]
    }
  }
}
```

### 3. Standalone CLI

```bash
# Run full 6-check health diagnosis (optionally include a workspace repo)
node dist/server.js check
node dist/server.js check /path/to/your/project

# Check directive contradictions, duplicate skill names & trigger collisions
node dist/server.js conflicts /path/to/your/project

# Inspect always-on & on-demand system-prompt token budget
node dist/server.js budget /path/to/your/project

# Machine-readable JSON output for CI pipelines
node dist/server.js check /path/to/your/project --json
```

---

## MCP Tools Reference

| Tool | Visibility | Description |
| :--- | :--- | :--- |
| `open_skill_doctor` | Model + UI Entrypoint | Launches the interactive Skill Doctor dashboard (side pane, full-page sidebar, or inline). Works with `{}`. |
| `diagnose_skills` | Model + Inline UI | Runs the full 6-check health report with 0–100 score, A–F grade, and structured findings. |
| `check_rule_conflicts` | Model | Checks directive contradictions, duplicate skill names, and trigger collisions with exact line citations. |
| `inspect_skill_health` | Model | Deep-inspects a specific skill or rule file (tokens, keywords, companion files, reference validation, targeted issues). |
| `app_diagnose` | App-only | Refreshes full diagnosis from the interactive dashboard UI with an optional workspace path. |
| `app_inspect_file` | App-only | Loads full file inspection & line-highlighted source for the slide-over File Inspector drawer. |

---

## Architecture

```mermaid
flowchart LR
  Host["Antigravity / Claude / Cursor / Codex"] <-->|MCP stdio| Server["Skill Doctor MCP Server"]
  Host <-->|ui://skill-doctor/app.html| UI["Interactive React MCP App"]
  UI <-->|app_diagnose / app_inspect_file| Server
  Server --> Scanner["Cross-Agent Scanner\n(Frontmatter + Token Estimator)"]
  Scanner --> FS["~/.gemini · ~/.claude · ~/.cursor · ~/.codex · Workspace"]
  Scanner --> Engine["6-Check Diagnostic Engine"]
  Engine --> C1["Directive Contradictions"]
  Engine --> C2["Trigger Collision Matrix"]
  Engine --> C3["Duplicate Names & Bloat"]
  Engine --> C4["Broken Local Refs & Security"]
```

---

## Development

```bash
npm install
npm run typecheck   # Strict TypeScript check
npm run build       # Bundles single-file dist/app.html + standalone dist/server.js
npm test            # Runs scanner, 6-check diagnostic, CLI & MCP stdio E2E tests
npm run install:antigravity
```

---

## Agent Toolkit Suite

Skill Doctor is part of the open-source **Agent Toolkit Suite** for Antigravity, Claude Code, Cursor, and Codex:

| Project | Purpose |
| :--- | :--- |
| [**find-my-skill**](https://github.com/oguzhan-yildirim/find-my-skill) | Discover, security-audit, preview, and one-click install AI Agent Skills (`SKILL.md`) from GitHub. |
| [**skill-doctor**](https://github.com/oguzhan-yildirim/skill-doctor) | Diagnose conflicting agent rules, skill trigger collisions, token bloat, broken references & security hazards. |
| [**mcp-xray**](https://github.com/oguzhan-yildirim/mcp-xray) | Live MCP protocol traffic inspector, latency profiler, and schema debugger. |
| [**agent-blackbox**](https://github.com/oguzhan-yildirim/agent-blackbox) | Flight recorder & replay timeline for agent tool calls, file mutations, and failures. |
| [**mcp-switchboard**](https://github.com/oguzhan-yildirim/mcp-switchboard) | Profile-based MCP server router and dynamic tool-surface manager. |

## License

MIT © 2026 [Oğuzhan Yıldırım](https://github.com/oguzhan-yildirim)

TDQS

C2.7/5.0

Scored across 6 tools

Disambiguation2/5

Several tools overlap heavily: diagnose_skills and app_diagnose both perform a full skill/rule diagnosis refresh, and check_rule_conflicts re-detects contradictions and trigger collisions already covered by diagnose_skills. Similarly, inspect_skill_health and app_inspect_file both inspect individual files, with only the 'app-only' qualifier distinguishing them. An agent could easily misselect between these pairs.

Naming Consistency2/5

The set mixes inconsistent patterns: verb_noun tools (diagnose_skills, check_rule_conflicts, inspect_skill_health), a prefix_verb tool with no noun (app_diagnose), and prefix_verb_noun tools (app_inspect_file). The 'app_' prefix signals audience rather than action, breaking the verb-first convention and making the app-only variants look like a separate namespace.

Tool Count4/5

Six tools is a well-scoped count for a skill/rule auditing server. The only issue is redundancy—the two app-only variants largely duplicate the general diagnosis and inspection tools—but the overall size is appropriate.

Completeness3/5

The auditing lifecycle (dashboard, full scan, conflict check, single-file inspection) is reasonably covered, but there is no remediation, suppression/ignore, or report-export operation despite the 'doctor' framing implying fixes. Agents hitting findings have no way to act on them through this surface.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues