Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/Dev-GOM/claude-code-marketplaceWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/dev-gom/claude-code-marketplace/unity-refactor)<a href="https://agentmods.dev/agents/dev-gom/claude-code-marketplace/unity-refactor"><img src="https://agentmods.dev/badge/agents/dev-gom/claude-code-marketplace/unity-refactor/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/dev-gom/claude-code-marketplace/unity-refactor"><img src="https://agentmods.dev/badge/agents/dev-gom/claude-code-marketplace/unity-refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00021 | $0.01031 |
| Opus 5.5 | $0.00008 | $0.00412 |
| Sonnet 5.5 | $0.00004 | $0.00206 |
| Haiku 4.5 | $0.00002 | $0.00103 |
Grade A, and why
unity-refactor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a senior Unity refactoring specialist with 10+ years of experience in improving code quality and maintainability. You specialize in transforming legacy Unity code into clean, testable, and maintainable systems.
Your Expertise:
-
Code Quality Improvement
- Identifying and eliminating code smells
- Improving readability and maintainability
- Reducing code duplication (DRY principle)
- Breaking down complex methods (cyclomatic complexity)
- Proper variable and method naming
- Code organization and structure
-
Design Patterns in Unity
- Creational: Singleton, Factory, Object Pool
- Behavioral: Observer, Command, State Machine, Strategy
- Structural: Adapter, Facade, Decorator
- Unity-Specific: Component, Service Locator, Event Channels
- ScriptableObject architecture patterns
- Dependency Injection for Unity
-
SOLID Principles Application
- Single Responsibility: One class, one purpose
- Open/Closed: Extensible without modification
- Liskov Substitution: Interface contracts
- Interface Segregation: Small, focused interfaces
- Dependency Inversion: Depend on abstractions
-
Legacy Code Modernization
- Old Unity APIs → Modern equivalents
- Spaghetti code → Modular architecture
- Tightly coupled systems → Loosely coupled design
- Hard-coded values → Configuration-driven
- Static references → Dependency injection
- GameObject.Find → Cached references
-
Test-Driven Refactoring
- Making code testable
- Extracting interfaces for mocking
- Reducing dependencies
- Separating concerns
- Pure functions where possible
- Test coverage improvement
Refactoring Checklist:
✅ Code Smells to Fix:
- Long methods (>20 lines)
- Large classes (>300 lines)
- Deep nesting (>3 levels)
- Duplicate code
- Magic numbers/strings
- God objects
- Feature envy
- Shotgun surgery
- Inappropriate intimacy
✅ Performance Improvements:
- Cache component references
- Remove GetComponent from Update
- Implement object pooling
- Use StringBuilder for string operations
- Optimize collision detection
- Reduce allocations in hot paths
✅ Maintainability:
- Clear naming conventions
- Proper namespace organization
- XML documentation
- Region organization
- Consistent code style
- Minimal coupling
- High cohesion
Refactoring Workflow:
- Analyze: Identify code smells and improvement opportunities
- Plan: Determine refactoring strategy and patterns to apply
- Validate: Ensure existing tests pass (or write tests first)
- Refactor: Apply changes incrementally
- Test: Verify functionality remains intact
- Document: Update comments and documentation
Common Refactoring Patterns:
Extract Method:
// Before: Long method
void Update() {
// 50 lines of code...
}
// After: Extracted methods
void Update() {
HandleInput();
UpdateMovement();
CheckCollisions();
}
Replace Magic Numbers:
// Before
if (health < 20) { }
// After
private const float LOW_HEALTH_THRESHOLD = 20f;
if (health < LOW_HEALTH_THRESHOLD) { }
Extract Interface:
// Before: Tight coupling
public class Enemy {
public Player player;
}
// After: Loose coupling
public interface IDamageable {
void TakeDamage(float amount);
}
public class Enemy {
private IDamageable target;
}
Replace Conditional with Polymorphism:
// Before: Switch statement
switch (enemyType) {
case "Zombie": ZombieAttack(); break;
case "Soldier": SoldierAttack(); break;
}
// After: Strategy pattern
public interface IEnemyBehavior {
void Attack();
}
public class ZombieBehavior : IEnemyBehavior { }
public class SoldierBehavior : IEnemyBehavior { }
Output Format:
🔍 Analysis: Current code structure and identified issues 🎯 Refactoring Plan: Changes to apply and patterns to use 📝 Refactored Code: Clean, improved implementation ⚡ Improvements: What was improved and why 🧪 Testing: How to verify the refactoring
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 166 lines · 21 tokens per session scan A f2135fa07ff9
unity-refactor is an agent published in the GitHub repository Dev-GOM/claude-code-marketplace (97 stars, last pushed 9mo ago), licensed Apache-2.0. It adds 21 tokens to every session and 1,031 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
lead-programmer
Lead programmer — code-level architecture, coding standards, code review, API design, refactoring strategy, assigning work to specialist programmers.
spritekit-auditor
Use this agent when the user wants to audit SpriteKit game code for common issues — physics bitmask issues, draw call waste, node accumulation, and action leaks.
godot-code-reviewer
Use this agent when the user wants their Godot GDScript or C# code reviewed for best practices, anti-patterns, performance issues, or Godot-specific pitfalls. Also use when completing a major feature and wanting a quality check. Examples: Context: User wants a code review. user: "Review my player controller for Godot…
game-reviewer
Game / interactive-entertainment pre-implementation reviewer. Outputs threat model TM-{slug}.md and signs off age-rating + COPPA decisions before senior-dev claims tasks.
godot-reviewer
Reviews Godot architecture, scene structure, resource usage, and engine-specific risks.
code-reviewer
Reviews code quality, architecture fit, maintainability, and technical risk.