---
name: Module Audit Agent
slug: module-audit-agent
category: Quality
description: Module Audit Agent audits a module’s purpose, dependencies, risk, and test coverage to decide whether it is safe to refactor. It uses graph-based analysis and only generates tests when coverage is low and risk is elevated.
github: "https://github.com/wednesday-solutions/ai-agent-skills/tree/main/skills/agents/module-audit"
language: JavaScript
stars: 168
forks: 21
install: "npx degit https://github.com/wednesday-solutions/ai-agent-skills/tree/main/skills/agents/module-audit ~/.claude/skills/module-audit"
installs_to: ~/.claude/skills/module-audit
source_path: skills/agents/module-audit/SKILL.md
collection_size: 10
category_size: 1897
collection_url: "https://dirskills.com/collections/wednesday-solutions/ai-agent-skills"
added: 2026-09-08T05:34:08.363Z
last_synced: 2026-09-08T05:34:08.363Z
canonical_url: "https://dirskills.com/skills/module-audit-agent"
---

# Module Audit Agent

Module Audit Agent audits a module’s purpose, dependencies, risk, and test coverage to decide whether it is safe to refactor. It uses graph-based analysis and only generates tests when coverage is low and risk is elevated.

**Install:**

```bash
npx degit https://github.com/wednesday-solutions/ai-agent-skills/tree/main/skills/agents/module-audit ~/.claude/skills/module-audit
```

## README

# Module Audit Agent

## When to use
- "Audit this module"
- "Is it safe to refactor X?"
- "What is the health of this service?"
- "Should we rewrite X?"

## What to do

1. **In parallel:**
   - **brownfield-chat** — Read `dep-graph.json` and `summaries.json` for the target module. Report: what it does, its imports, what imports it, and any known conflicts.
   - **brownfield-fix** — Run `wednesday-skills score <module>` and `wednesday-skills blast <module>`. Report risk band and total dependent count.

2. Present the combined audit report:
   - Purpose summary (from summaries.json)
   - Risk score + band (0–30 low / 31–60 medium / 61–80 high / 81–100 critical)
   - Blast radius (dependent count, cross-language flagged separately)
   - Architecture violations or danger zone warnings (from MASTER.md)
   - Recommendation: proceed / review / senior sign-off / do not touch

3. **brownfield-tests** — Only run if coverage < 30% AND risk > 50:
   - Run `wednesday-skills gen-tests --file <module>`
   - Show generated test file to dev for review before writing

## Never
- Recommend refactoring a critical file (risk > 80) without flagging the blast radius
- Read raw source to answer structural questions — use graph only
- Auto-write test files without showing the dev first
