$npx -y skills add wednesday-solutions/ai-agent-skills --skill module-auditUse when asked to audit a module, check its health, or assess whether it should be refactored. Runs structural query, risk check, and test generation automatically.
| 1 | # Module Audit Agent |
| 2 | |
| 3 | ## When to use |
| 4 | - "Audit this module" |
| 5 | - "Is it safe to refactor X?" |
| 6 | - "What is the health of this service?" |
| 7 | - "Should we rewrite X?" |
| 8 | |
| 9 | ## What to do |
| 10 | |
| 11 | 1. **In parallel:** |
| 12 | - **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. |
| 13 | - **brownfield-fix** — Run `wednesday-skills score <module>` and `wednesday-skills blast <module>`. Report risk band and total dependent count. |
| 14 | |
| 15 | 2. Present the combined audit report: |
| 16 | - Purpose summary (from summaries.json) |
| 17 | - Risk score + band (0–30 low / 31–60 medium / 61–80 high / 81–100 critical) |
| 18 | - Blast radius (dependent count, cross-language flagged separately) |
| 19 | - Architecture violations or danger zone warnings (from MASTER.md) |
| 20 | - Recommendation: proceed / review / senior sign-off / do not touch |
| 21 | |
| 22 | 3. **brownfield-tests** — Only run if coverage < 30% AND risk > 50: |
| 23 | - Run `wednesday-skills gen-tests --file <module>` |
| 24 | - Show generated test file to dev for review before writing |
| 25 | |
| 26 | ## Never |
| 27 | - Recommend refactoring a critical file (risk > 80) without flagging the blast radius |
| 28 | - Read raw source to answer structural questions — use graph only |
| 29 | - Auto-write test files without showing the dev first |