.codex/skills/refactor-pass/SKILL.md
Perform a refactor pass focused on simplicity after recent changes. Use when the user asks for a refactor/cleanup pass, simplification, dead-code removal, or says "refactor pass".
npx skillsauth add bitsocialnet/5chan refactor-passInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Review recent changes — identify simplification opportunities:
git diff for unstaged changesgit diff --cached for staged changesgit log --oneline -5 for recent commits if no uncommitted changesApply refactors (in priority order):
useMemo, useCallback, etc.)src/hooks/) or shared components (src/components/)Verify — run all three checks:
yarn build && yarn lint && yarn type-check
Optional suggestions — identify abstractions or reusable patterns only if they clearly improve clarity. Keep suggestions brief; don't refactor speculatively.
When refactoring, watch for these anti-patterns from AGENTS.md:
| Anti-pattern | Refactor to |
|---|---|
| useState for shared state | Zustand store in src/stores/ |
| useEffect for data fetching | bitsocial-react-hooks (useComment, useFeed, etc.) |
| useEffect to sync derived state | Calculate during render |
| Copy-pasted logic across components | Custom hook in src/hooks/ |
| Boolean flag soup (isLoading, isError, isSuccess) | State machine in Zustand |
| Prop drilling through many layers | Zustand store |
npx oxfmt <file> after changestools
Profile app performance while browsing, collecting Web Vitals and React rerender data via react-scan. Orchestrates parallel profiler subagents via playwright-cli to capture navigation timing, long tasks, layout shifts, LCP, React commit counts, render bursts, and per-component render data. Use when profiling browsing performance, finding bottlenecks, diagnosing excessive rerenders, or auditing page performance.
tools
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
tools
Create a GitHub issue from recent changes, commit only relevant diffs on a short-lived task branch, push that branch, and open a PR into master that will close the issue on merge. Use when the user says "make closed issue", "close issue", or wants to create a tracked, already-resolved GitHub issue for completed work.
development
Formats GitHub issue titles and descriptions for tracking problems that were fixed. Use when proposing or implementing code changes, creating GitHub issues, or when the user asks for issue suggestions.