Skip to content
cccskills
FreePublished on GitHub

refactor

Scan the project for refactoring opportunities, then fix them. No behavior/visual changes.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md1.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Refactor

Identify and fix code quality issues across the project without changing behavior, visuals, or public API.

Constraints

  • NEVER change behavior, visuals, or public API
  • NEVER add new dependencies
  • NEVER add features or functionality
  • Run pnpm check after all changes to verify no type errors were introduced

Phase 1: Scan (read-only, use Agents for token efficiency)

Launch an Explore agent to scan src/ for issues in these categories:

  1. Dead code: unused imports, unreachable branches, commented-out code, unused exports
  2. Oversized components: .svelte files > 300 lines that mix unrelated concerns and could be split (skip files with a // NOTE: Large file by design comment — these have been reviewed and deemed unsplittable)
  3. Redundant state: $state that duplicates or could be $derived from other state
  4. Copy-paste: near-duplicate code blocks across files that should share a helper
  5. Bug risks: unguarded async, missing cleanup, event listener leaks, race conditions
  6. Inefficiency: unnecessary re-computation, work in hot paths, unbounded allocations

Skip lines marked with // REFACTOR-OK: <reason> — these have been reviewed and intentionally kept as-is.

Output a numbered list of findings with file paths and line numbers, sorted by severity (high → low). Do NOT fix anything yet.

Phase 2: User approval

Present the findings list to the user. Ask which items to fix (e.g. "all", specific numbers, or "skip"). Wait for the user to respond before proceeding.

Phase 3: Fix approved items

Fix only approved items, one at a time. After all fixes, run pnpm check to verify.

Briefly summarize what was changed.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

adr

Free

Create a new Architecture Decision Record (ADR) for a proposed feature or design change.

The English summary is being prepared. Showing the original description.

im9/inboil2Updated Oct 17, 2026

Mark an ADR as Implemented (or Superseded) and archive it, following INDEX.md conventions.

The English summary is being prepared. Showing the original description.

im9/inboil2Updated Oct 17, 2026

Scan the codebase for security vulnerabilities. Check OWASP top 10, input validation, auth, crypto, and known BACKLOG security items.

The English summary is being prepared. Showing the original description.

im9/inboil2Updated Oct 17, 2026

Check docs/ai/ spec files and ADRs for inconsistencies with the actual codebase. Report only, no modifications.

The English summary is being prepared. Showing the original description.

im9/inboil2Updated Oct 17, 2026

Check docs/ai/ spec files and ADRs for inconsistencies with the codebase, then fix all discrepancies.

The English summary is being prepared. Showing the original description.

im9/inboil2Updated Oct 17, 2026

See all skills by im9

Report a problem with this skill