refactor-pass
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".
- License 许可
- Apache-2.0
- 最近更新
- 2026-07-15
- Stars
- ★ 15
- Forks
- 1
01 前言 Front Matter
- name
- refactor-pass
- description
- 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".
03 SKILL.md 正文
Refactor Pass
Workflow
-
Review recent changes — identify simplification opportunities:
git difffor unstaged changesgit diff --cachedfor staged changesgit log --oneline -5for recent commits if no uncommitted changes
-
Apply refactors (in priority order):
- Remove dead code and unreachable paths
- Straighten convoluted logic flows
- Remove excessive parameters or intermediary variables
- Remove premature optimization (unnecessary
useMemo,useCallback, etc.) - Extract duplicated logic into custom hooks (
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.
Project-Specific Patterns to Enforce
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 |
Rules
- Don't change behavior — refactors must be semantically equivalent
- Don't introduce new dependencies
- Format edited files with
npx oxfmt <file>after changes - If the build/lint/type-check fails after refactoring, fix it before finishing
04 同仓库更多 Skills
deploy-app
Deploy the application to staging or production environments.
deploy
Deploy the application to environments.
building-native-ui
Complete guide for building beautiful apps with Expo Router. Covers fundamentals, styling, components, navigation, animations, patterns, and native tabs.
create-section
Use when creating a new section for the AI Workshop presentation. Guides through title slide setup, layout choices, and content gathering. Activates when user wants to add a new topic section to the slideshow.
ship-checker
Run a full pre-ship review for this repo. Use when asked if a change is ready to deploy, publish, or ship.
lint-check
Run repository linters and report failures.