skills/refactoring-code/SKILL.md
Analyze and execute behavior-preserving refactors in small, verified steps. Use when the user asks to refactor, clean up code structure, extract functions or modules, reduce duplication, improve maintainability, or modernize code without changing external behavior.
npx skillsauth add hayatosc/dotfiles refactoring-codeInstall 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.
Refactor code without changing externally observable behavior. Start by fixing the scope, preserved behavior, and verification path before editing. Prefer small, reviewable steps over broad rewrites.
Follow these steps in order:
Start with this structure unless the user asked for something else:
Goal: the refactor target and main pain pointPreserved behavior: the observable behavior that must not changePlan: the next 2-5 small slicesVerification: the tests, checks, or manual repro that will guard the changereferences/refactor-playbook.md for common behavior-preserving moves and selection heuristics.references/legacy-safety-net.md when tests are weak, behavior is unclear, or the code is difficult to isolate safely.references/examples.md when the request needs concrete patterns or example outputs.tools
Recommend a modern TypeScript toolchain. Use when choosing or updating a TypeScript stack for Node or CLI projects, libraries or packages, and web apps or APIs; selecting tsgo as the primary typechecker with tsc as compatibility fallback; recommending Hono, tsx, tsdown, Vite, Vitest, oxlint, oxlint-tsgolint, oxfmt, or deciding between bun and pnpm.
development
Implement, review, and refactor TypeScript code with a strong bias toward type safety. Use to fix TypeScript errors, remove `any` or unsafe `as`, review type safety, tighten TypeScript or lint settings, and ship ESM-first code that passes the repository's typecheck without weakening types.
development
Self-review, improve, commit, and push code that Claude has just written. Use this skill when the user asks Claude to "self-ship", "review and ship", "review then commit and push", or wants Claude to autonomously review its own output, apply improvements, and publish the changes to the remote repository. Triggered by: "self-ship", "ship it", "review and push", "review my changes and commit", or similar requests to complete the full write → review → commit → push cycle.
development
Comprehensive Go best practices for writing production-ready, idiomatic, secure, and maintainable code. Use when: (1) writing or reviewing Go code, (2) designing project structure and layout, (3) handling errors and contexts, (4) implementing concurrency, (5) writing tests or benchmarks, (6) optimizing performance, (7) applying security practices, (8) modernizing Go codebases. Covers coding style, project organization, error handling, testing, concurrency, performance, security, and modernization.