cleanup-ui

Runs lint fix, type-check, and dead code removal on changed files in a UI branch.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/muselesscreator/ui-skills --skill cleanup-ui-muselesscreator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup-ui
Source: https://github.com/muselesscreator/ui-skills/tree/main/cleanup-ui
Command: npx skills add https://github.com/muselesscreator/ui-skills --skill cleanup-ui-muselesscreator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Finishing a feature branch often leaves lint errors, type errors, and dead code scattered across the diff, and fixing them manually risks touching unrelated files or masking real environment problems. This Skill automates a scoped, verified cleanup pass so the branch is review-ready without polluting the commit with unrelated edits. ## Core Features & Use Cases - Environment preflight gate: Verifies Node version and Prisma codegen before any fix, so toolchain issues are not misdiagnosed as code errors. - Scoped lint, Prettier, and type-check: Runs ESLint fix, Prettier, and type-check limited to the branch's changed packages, with strict rules against as/any casts, _-prefixing unused vars, or removing existing assertions and eslint-disable comments. - Dead code removal and test handoff: Deletes unused imports, variables, console.logs, and commented-out code, then delegates affected unit and e2e specs to cleanup-unit-tests and cleanup-e2e-tests. - Capped verify loop with reporting: Re-runs all three gate checks up to 3 attempts, raises decision memos for architectural type issues, and writes a structured cleanup report. - Use Case: After finishing a feature branch in a pnpm monorepo, run the cleanup to auto-fix lint and formatting, resolve in-scope type errors, remove dead code, and get a report listing exactly which files changed. ## Quick Start Ask the AI to run cleanup on the current branch to fix lint errors, type errors, and dead code before committing.

Frequently Asked Questions about cleanup-ui

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix lint and type errors on a feature branch automatically?

Run a scoped cleanup pass that resolves the branch diff, then applies ESLint fix, Prettier, and type-check only to the affected packages. Errors in files outside the change set are reported as pre-existing residuals rather than edited.

How to remove unused imports and dead code in a TypeScript project?

Scan the changed files for unused variables, unused imports, commented-out code, console.log statements, and empty catch blocks, then delete them outright. Unused variables are deleted rather than prefixed with an underscore, which would leave misleading dead code in place.

Why does type-check show errors across many unrelated files?

Cascading type errors across packages usually indicate a broken environment, such as a wrong active Node version or a stale Prisma generated client. Run an environment preflight checking Node against engines.node and re-running db:generate before treating the errors as real code issues.

Should I remove a type assertion or eslint-disable that looks redundant?

No, an apparently redundant assertion or disable comment is more often a symptom of a stale build cache or partially regenerated client than a dead guard. Only remove one after confirming the environment preflight passed and documenting why it is genuinely unnecessary.

What happens when cleanup verification keeps failing after fixes?

The verification loop is capped at 3 attempts, each requiring a fix followed by a clean re-run of type-check, lint, and Prettier. At the cap it stops and presents a menu to keep iterating, accept the residual, or halt for human review.