# Post Refactor Audit

> post-refactor-audit

- Skill: `claudiawong522/post-refactor-audit` (Agent Skill)
- Install (CLI): `npx skillmds@latest add claudiawong522/post-refactor-audit`
- Raw SKILL.md: https://api.skillmd.com/api/skills/claudiawong522/post-refactor-audit/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: claudiawong522 (https://skillmd.com/u/claudiawong522)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/claudiawong522/post-refactor-audit

---

# post-refactor-audit

Systematically check for dead code and regressions after refactoring to ensure code quality and functionality.

# Post-Refactor Audit

After completing a refactoring task, run a structured audit to catch dead code and regressions before declaring the work done.

## Steps

1. **Identify unused code**
   - Search for variables, functions, and imports that are no longer referenced
   - Use your editor's "Find References" feature to confirm nothing calls removed code
   - Pay special attention to old helper functions that may have been duplicated in the refactor

2. **Check for overlapping logic**
   - Look for duplicate renders, state management, or side effects
   - Verify that components don't handle the same responsibility twice
   - Ensure event handlers aren't firing multiple times due to lingering code

3. **Test core functionality**
   - Run the app and manually test key user flows
   - Check browser console for errors and warnings
   - Test edge cases that might have been affected by structural changes

4. **Review side effects and state**
   - Verify useEffect dependencies are correct
   - Check that state updates happen in expected order
   - Look for memory leaks or cleanup functions that may have been missed

5. **Clean up findings**
   - Remove all confirmed dead code
   - Fix any regressions discovered
   - Update related tests and documentation

## Tips

- Refactoring often reveals overlapping code that wasn't obvious before—this is valuable
- Large monolithic components frequently have hidden duplicate logic when broken down
- Run a linter to catch obvious issues automatically
- Consider writing a quick integration test for the refactored section before cleanup

