---
name: refactoring-assistant-39e7484e2f6a
description: Suggest and guide application of refactoring patterns to improve code quality
allowed-tools: ["Bash", "Read", "Write", "Grep", "Glob", "Edit"]
graph:
  domains: [domain:software-engineering]
  specializations: [specialization:code-migration-modernization]
  skillAreas: [skill-area:dead-code-elimination, skill-area:code-analysis-linting]
  roles: [role:backend-engineer, role:refactor-bot]
  workflows: [workflow:technical-debt-reduction]
  topics: [topic:refactoring]
---

# Refactoring Assistant Skill

Suggests appropriate refactoring patterns and guides their application to improve code quality, maintainability, and migration readiness.

## Purpose

Enable guided refactoring for:
- Code quality improvement
- Design pattern application
- Migration preparation
- Technical debt reduction
- Maintainability enhancement

## Capabilities

### 1. Extract Method/Class Suggestions
- Identify extraction candidates
- Suggest method boundaries
- Recommend class decomposition
- Guide interface extraction

### 2. Move Method Recommendations
- Detect misplaced methods
- Suggest target classes
- Analyze dependencies
- Guide safe relocation

### 3. Rename Refactoring
- Suggest meaningful names
- Propagate renames safely
- Handle cross-references
- Update documentation

### 4. Inline Refactoring
- Identify inline candidates
- Remove unnecessary indirection
- Simplify call chains
- Reduce complexity

### 5. Pull Up/Push Down Member
- Analyze inheritance hierarchies
- Suggest member movement
- Optimize class hierarchies
- Improve polymorphism

### 6. Design Pattern Application
- Recognize pattern opportunities
- Guide pattern implementation
- Suggest appropriate patterns
- Validate pattern application

## Tool Integrations

| Tool | Purpose | Integration Method |
|------|---------|-------------------|
| IDE Refactoring | Automated refactoring | CLI / API |
| Sourcery | AI-powered suggestions | CLI |
| Sourcegraph Cody | Code intelligence | API |
| IntelliJ IDEA | Java refactoring | CLI |
| VS Code | Multi-language | Extension API |

## Output Schema

```json
{
  "analysisId": "string",
  "timestamp": "ISO8601",
  "suggestions": [
    {
      "type": "extract-method|move-method|rename|inline|design-pattern",
      "priority": "high|medium|low",
      "target": {
        "file": "string",
        "element": "string",
        "line": "number"
      },
      "description": "string",
      "rationale": "string",
      "steps": ["string"],
      "estimatedImpact": {
        "complexity": "string",
        "maintainability": "string",
        "testability": "string"
      },
      "risks": ["string"]
    }
  ],
  "patterns": {
    "applicable": ["string"],
    "opportunities": []
  }
}
```

## Integration with Migration Processes

- **code-refactoring**: Primary refactoring guidance
- **technical-debt-remediation**: Debt reduction strategies

## Related Skills

- `code-smell-detector`: Identifies refactoring needs
- `codemod-executor`: Automates refactorings

## Related Agents

- `code-transformation-executor`: Executes suggested refactorings


---
Source attribution: a5c-ai
Original project: https://github.com/a5c-ai/babysitter
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Gabriel Moreira

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: a5c-ai
Original project: https://github.com/a5c-ai/babysitter
Attribution basis: Upstream repository explicitly recorded in package mirror path

Fields of work: Development & Engineering, Product Management
Roles: Backend Developer, DevOps / SRE, Full-Stack Developer, Product Manager, QA / Test Engineer
Specialties: API, Backend
Tools: Sourcery, Intellij Idea, Ide Refactoring, Sourcegraph Cody, Vs Code
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 93a200654baeebea9e42b852c61d8a2d71dc3e1d93a63a958da753e1131b9051
