Audit and clean a page, feature flow, component, or file by tracing state sources, business invariants, queries, mutations, permissions, errors, duplicated calculations, and defensive code. Use for agent-assisted frontend cleanup, page cleanup, feature-flow cleanup, source-of-truth audits, query/mutation cleanup, permission/error-state review, defensive UI removal, and continued deep cleanup.
How this skill is triggered — by the user, by Claude, or both
Slash command
/page-flow-cleanup-audit:page-flow-cleanup-auditThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Start from first principles: identify the page purpose, the facts it depends on, and the business invariants that must stay true. Do not start by mechanically deduplicating files or deleting optional checks.
Start from first principles: identify the page purpose, the facts it depends on, and the business invariants that must stay true. Do not start by mechanically deduplicating files or deleting optional checks.
Good cleanup removes extra sources of truth and meaningless branches while preserving real loading, empty, error, permission, and lifecycle states.
This skill is useful when cleanup might change user-visible behavior. It separates meaningless defensive code from real lifecycle, permission, error, and empty states.
This skill is part of a three-skill cleanup system:
page-flow-cleanup-audit for user-visible flows, state ownership, and business invariants.necessary-code-audit for wrapper, compatibility, fallback, default, and defensive-code necessity decisions.unused-code-audit to prove whether removed helpers, exports, and files still have consumers.Trace state in this order:
Red flags:
Preferred shape:
Only extract logic when it is deterministic and business-equivalent across consumers.
Extract:
Do not extract:
Delete as meaningless when:
as any hides a type mismatch that can be fixed by narrowing the boundary.Keep as meaningful when:
When a value is optional only before a successful boundary, create a narrower response type rather than adding UI guards.
as any, empty fallback helpers, and constant parameters.Avoid normalizing data "just in case". Keep edits surgical and tied to the flow being audited.
Use the available repository tools for structure:
Then use literal scans for residuals:
as any.Scan the defining location and every likely consumer root, not just the file or folder being edited.
Run the narrowest checks that cover the touched boundary:
rg scans for deleted symbols and old source paths.git diff --check.If generated artifacts or declaration files are read by downstream consumers, rebuild dependencies in order before judging downstream type errors.
Report:
When pushing back, be explicit: "this is not defensive code; it is a real business empty/error/permission/lifecycle state."
npx claudepluginhub danhuaxiansheng/claude-code-cleanup-skills --plugin claude-code-cleanup-skillsProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.