pluginagentmarketplace/custom-plugin-software-design
Overview
This skill detects common code smells and generates safe, actionable refactoring guidance for Python and other supported languages. It identifies problematic patterns, proposes prioritized refactoring plans, and can apply or validate refactorings when tests or risk parameters permit. The goal is to reduce technical debt while preserving behavior.
How this skill works
The skill analyzes source code with an AST-based smell detector to find categories like bloaters, couplers, dispensables, and change-preventers. For a requested action (detect, plan, apply, validate) it returns detected smells, a refactoring plan with recommended techniques (e.g., Extract Method, Move Method), refactored code when safe, and validation results against tests or heuristics. It respects configurable risk tolerance and test coverage to avoid unsafe changes.
When to use it
- Before major feature work to reduce the chance of regressions caused by complex code
- During code review to provide automated, prioritized refactoring suggestions
- When preparing legacy code for extension or integration
- To generate safe, test-driven refactor plans for long methods or large classes
- When validating that an automated refactor preserved behavior with available tests
Best practices
- Provide at least partial test coverage before applying risky refactors; prefer low/medium risk actions when tests are absent
- Limit refactoring scope per run (single method or class) to keep changes reviewable and reversible
- Use the plan action to preview steps and filenames before applying code modifications
- Configure smell categories to focus on the most relevant issues for the codebase (e.g., couplers vs bloaters)
- Run validation after apply to confirm behavior unchanged and update tests if needed
Example use cases
- Detect and report Long Method and Long Parameter List in a legacy Python module
- Generate a step-by-step Extract Method plan for a 60-line function, including test checkpoints
- Apply safe refactorings for low-risk transformations when full test coverage exists
- Validate that recent refactors did not introduce behavioral changes using provided tests
- Prioritize refactoring work by severity and risk tolerance for sprint planning
FAQ
The skill supports Python, TypeScript, JavaScript, Java, C#, and Go as input languages.
What does 'unsafe refactoring' mean?
An unsafe refactoring is one that cannot be verified by tests or heuristics and could change behavior; the skill will refuse or flag such changes unless risk_tolerance is increased or tests are added.
6 skills
This skill detects code smells and guides safe refactoring to improve maintainability and readability across Python projects.
This skill helps you model domains using domain-driven design patterns to create clear contexts, aggregates, and ubiquitous language.
This skill analyzes Python code to apply and validate SOLID principles, highlighting violations and offering actionable refactor suggestions for maintainable
This skill guides test-driven development design, helping you craft tests and mocking strategies to improve code quality.
This skill analyzes Python code to improve quality, readability, and maintainability by applying best-practice guidelines and actionable recommendations.
This skill helps you select and document architectural patterns, improving design decisions and consistency across projects.