refactoring/SKILL.md
Guidelines and techniques for identifying code smells and refactoring code, based on Refactoring.guru principles and adapted for Vanilla JS Chrome Extensions.
npx skillsauth add tai-ch0802/skills-bundle refactoringInstall 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.
This skill helps identify code smells and apply refactoring techniques to improve code quality. The foundational principles are from Refactoring.guru, adapted for Chrome Extension projects using Vanilla JS, Modules, and Side Panel architecture.
Code, methods, or classes that have grown too large to manage.
Long Method
sidepanel.js, or render() functions.Large Class / Module
modules/uiManager.js) takes on too many responsibilities.Long Parameter List
Incorrect application of OO principles.
switch or if-else chains used to determine types and execute different logic.Changing one place requires changing multiple places.
Useless or redundant code.
modules/ui/elements.js or utility functions.86400 with SECONDS_IN_DAY.if (a && b || c) into if (isSpecialCase()).Separate DOM Operations:
modules/stateManager.js).*Renderer.js modules.modules/ui/elements.js (if possible).State Management:
window.globalVar. Use stateManager module to hold cross-module state.Chrome API Encapsulation:
chrome.bookmarks.* directly in UI components. Use modules/apiManager.js for future replacement or testing.Style Consistency:
element.style.color = 'red'. Use CSS classes (element.classList.add('error')) with index.css.When User requests "Refactor this file" or "Clean up this code":
development
Unified testing skill — TDD workflow, unit/integration patterns, E2E/Playwright strategies. Replaces tdd-workflow + testing-patterns + webapp-testing.
testing
Security-first skill vetting for AI agents. Use before installing any skill from ClawdHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.
development
Spec-Driven Development (SDD): A structured workflow (Requirement -> Analysis -> Implementation) enforcing explicit documentation before coding.
development
Methodologies for System Analysis (SA), focusing on technical architecture, data flow modeling, and API design.