Skill graph audit

From athola/claude-night-market · View interactive version

Skill graph audit is an AI agent skill from the GitHub repository athola/claude-night-market. Audit Skill() refs; detect hubs, isolates, and dangling targets. Use when auditing skills.

How to use this skill

Skill file

Skill Graph Audit

Overview

Build a directed graph of Skill(plugin:name) invocations across the

marketplace and surface composition patterns: which skills are heavily

referenced (hubs), which orchestrate many others (orchestrators), which

have no incoming or outgoing references (isolates), and which point at

non-existent skills (dangling references).

The federation graph is now derivable from source rather than

hand-curated.

When To Use

When NOT To Use

Quick Start

# Positive control first. The fixture tree has a known answer (1
# bug-class dangling ref, 1 isolate, 2 edges); a regex that stopped
# matching would report plugins/ as clean, and this catches it.
uv run pytest -o addopts= -q plugins/abstract/tests/scripts/test_skill_graph.py -k Planted

python3 plugins/abstract/scripts/skill_graph.py \
  --plugins-root plugins --top-n 10

For machine-readable output:

python3 plugins/abstract/scripts/skill_graph.py \
  --plugins-root plugins --format json --output reports/skill-graph.json

See modules/usage.md for full CLI reference and example workflows.

Core Outputs

| Output | Meaning | Action when high |

|--------|---------|------------------|

| Hubs | Most-referenced skills | Treat as core API; retire with extreme care |

| Orchestrators | Skills that call many others | Verify each ref still resolves |

| Isolates | Zero in / zero out | Check role: library? entrypoint? typo? |

| Dangling: bugs | Missing internal target | Fix immediately (typo or retired skill) |

| Dangling: external | Reference to external plugin | Document plugin dependency |

| Dangling: placeholders | Template text like -NAME | Verify intentional |

See modules/interpretation.md for false-positive guidance and

isolation taxonomy.

Dogfood Evidence

This skill itself was scaffolded TDD-first; on first run against

plugins/, it caught two genuine dangling refs that the manual

audit (2026-04-25) had missed:

(script name confused with skill name)

(command referenced as skill)

Both were converted to correct command-style references in the

same session.

Verification

Two ways to validate the audit output is trustworthy:

  1. Test-suite correctness check: Run `pytest -o addopts=

plugins/abstract/tests/scripts/test_skill_graph.py` to confirm

extraction, graph construction, ranking, isolate detection, and

dangling-ref classification all pass on the current code. The

-o addopts= flag bypasses the package-wide coverage gate, which

would otherwise fail on a single-file run.

  1. Round-trip smoke check: Note the dangling-ref count from a

baseline run, fix one or more flagged references, then rerun and

verify the count drops by at least the number fixed. If the count

does not move, the report is stale or the regex missed a syntax

variant.

Exit Criteria

report on plugins/ is not reportable without it

without error and emits a node/edge count.

placeholders (the three Core Outputs rows resolve).

session or filed as a tracked issue.

passes.

by at least the number of references fixed.

Related Skills

References

docs/quality-gates.md#skill-level-quality-gate-composition

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.