Safely improve code quality through test-driven refactoring with automatic validation and rollback. Use during quality review to reduce technical debt while preserving behavior.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
La commande reste sur une seule ligne. Faites défiler horizontalement pour la vérifier avant de la copier.
Vous préférez une copie locale ? Téléchargez les fichiers actuellement disponibles dans SkillsMP.
Explorateur de fichiers
6 fichiers
Affichage de SKILL.md
SKILL.md
Instructions source · Aperçu en lecture seule
name
refactor-code
description
Safely improve code quality through test-driven refactoring with automatic validation and rollback. Use during quality review to reduce technical debt while preserving behavior.
acceptance
[{"config_validated":"Configuration allows refactoring and prerequisites verified"},{"opportunities_identified":"Refactoring opportunities identified and prioritized by risk"},{"refactorings_applied":"Selected refactorings applied incrementally with test validation"},{"log_created":"Refactoring log documenting all changes with rationale"},{"tests_passing":"All tests passing after refactoring with no behavioral changes"}]
inputs
{"task_file":{"type":"string","required":true,"description":"Path to task specification with quality findings"},"aggressiveness":{"type":"enum","required":false,"description":"Refactoring scope: conservative, moderate, aggressive","default":"moderate"},"allow_refactoring":{"type":"boolean","required":false,"description":"Override config to allow/disallow refactoring"}}
outputs
{"refactorings_applied":{"type":"number","description":"Number of refactorings successfully applied"},"refactorings_failed":{"type":"number","description":"Number of refactorings that failed and were rolled back"},"files_modified":{"type":"array","description":"List of files modified during refactoring"},"quality_impact":{"type":"object","description":"Before/after quality metrics showing improvements"}}
Safely improve code quality through automated refactoring while maintaining behavioral correctness. This skill identifies refactoring opportunities from quality findings and applies them incrementally with continuous test validation.
Core Capabilities:
Test-driven refactoring (run tests after each change)
Refactoring opportunities identified and prioritized
Selected refactorings applied incrementally
All tests passing after refactoring
Refactoring log created with full documentation
Task file updated with summary
Quality metrics improved or maintained
User notified with actionable next steps
Safety Guarantees
Behavioral preservation (no functionality changes) | Test validation (after each change) | Automatic rollback (on failures) | Full traceability (logged) | Incremental (one at a time) | User control (choose scope)
Integration with Quality Review
Runs after nfr-assess, before quality-gate in quality workflow. Optional - only if user opts in and tests exist/pass. Improvements reflected in final gate decision.