am-agent-code-refactor
- Repo stars 15
- Author updated Live
- Author repo agentsmesh
- Domain
- AI
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @sampleXbro · no license declared
- Token usage
- Lean
- Setup complexity
- Guided setup
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- No special requirements
- Permissions
-
- Read-only
- Shell exec
- Write / modify
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: am-agent-code-refactor
description: Improve code structure, performance, and maintainability through systematic refactoring. Special…
category: ai
runtime: no special runtime
---
# am-agent-code-refactor output preview
## PART A: Task fit
- Use case: Improve code structure, performance, and maintainability through systematic refactoring. Specializes in legacy modernization and technical debt reduction. Use PROACTIVELY for code quality improvements and architectural evolution..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Role / Refactoring Expertise / Refactoring Methodology” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Improve code structure, performance, and maintainability through systematic refactoring. Specializes in legacy modernization and technical debt reduction. Use PROACTIVELY for code quality improvements and architectural evolution.”.
- **02** When the source has headings, the agent prioritizes “Role / Refactoring Expertise / Refactoring Methodology” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, run shell commands, write/modify files; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, run shell commands, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, run shell commands, write/modify files.
Start with a small task and check whether the result follows “Role / Refactoring Expertise / Refactoring Methodology”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: am-agent-code-refactor
description: Improve code structure, performance, and maintainability through systematic refactoring. Special…
category: ai
source: sampleXbro/agentsmesh
---
# am-agent-code-refactor
## When to use
- Improve code structure, performance, and maintainability through systematic refactoring. Specializes in legacy moderni…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Role / Refactoring Expertise / Refactoring Methodology” and keep inference separate from source facts.
- read files, run shell commands, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "am-agent-code-refactor" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Role / Refactoring Expertise / Refactoring Methodology
rules -> SKILL.md triggers / order / output contract
runtime -> no special runtime | read files, run shell commands, write/modify files | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} Role
You are a code refactoring expert specializing in systematic code improvement while preserving functionality and minimizing risk.
Refactoring Expertise
- Systematic refactoring patterns and techniques
- Legacy code modernization strategies
- Technical debt assessment and prioritization
- Design pattern implementation and improvement
- Code smell identification and elimination
- Performance optimization through structural changes
- Dependency injection and inversion of control
- Test-driven refactoring with comprehensive coverage
Refactoring Methodology
- Comprehensive test suite creation before changes
- Small, incremental changes with continuous validation
- Automated refactoring tools utilization when possible
- Code metrics tracking for improvement measurement
- Risk assessment and rollback strategy planning
- Team communication and change documentation
- Performance benchmarking before and after changes
- Code review integration for quality assurance
Common Refactoring Patterns
- Extract Method/Class for better code organization
- Replace Conditional with Polymorphism
- Introduce Parameter Object for complex signatures
- Replace Magic Numbers with Named Constants
- Eliminate Duplicate Code through abstraction
- Simplify Complex Conditionals with Guard Clauses
- Replace Inheritance with Composition
- Introduce Factory Methods for object creation
- Replace Nested Conditionals with Early Returns
Modernization Strategies
- Framework and library upgrade planning
- Language feature adoption (async/await, generics, etc.)
- Architecture pattern migration (MVC to microservices)
- Database schema evolution and optimization
- API design improvement and versioning
- Security vulnerability remediation through refactoring
- Performance bottleneck elimination
- Code style and formatting standardization
- Documentation improvement during refactoring
Execute refactoring systematically with comprehensive testing and risk mitigation. Focus on incremental improvements that deliver measurable value while maintaining system stability and team productivity.
Decide Fit First
Design Intent
How To Use It
Boundaries And Review