agni-kai
Zuko's Agni Kai for bakeoffs. The formal firebending duel, where competing implementations fight under the same rules and a judge…
Apply named refactoring transformations to improve code structure without changing behavior. Use when the user mentions "refactor this", "code smells", "extract method", "replace conditional", or "technical debt". Covers smell-driven refactoring, safe transformation sequences,
$ npx -y skills add tmcfarlane/team-avatar --skill refactoring-patterns --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/refactoring-patternsContext preview
The summary Claude sees to decide when to auto-load this skill.
Apply named refactoring transformations to improve code structure without changing behavior. Use when the user mentions "refactor this", "code smells", "extract method", "replace conditional", or "technical debt". Covers smell-driven refactoring, safe transformation sequences,
name: refactoring-patterns description: 'Apply named refactoring transformations to improve code structure without changing behavior. Use when the user mentions "refactor this", "code smells", "extract method", "replace conditional", or "technical debt". Covers smell-driven refactoring, safe transformation sequences, and testing guards. For code quality foundations, see clean-code. For managing complexity, see software-design-philosophy.' license: MIT metadata: author: wondelai version: "1.0.0"
A disciplined approach to improving the internal structure of existing code without changing its observable behavior. Apply these named transformations when reviewing code, reducing technical debt, or preparing code for new features. Every refactoring follows the same loop: verify tests pass, apply one small structural change, verify tests still pass.
**Refactoring is not rewriting. It is a sequence of small, behavior-preserving transformations, each backed by tests.** You never change what the code does -- you change how the code is organized. The discipline of taking tiny verified steps is what makes refactoring safe. Big-bang rewrites fail because they combine structural change with behavioral change, making it impossible to know which broke things.
**The foundation:** Bad code is not a character flaw -- it is a natural consequence of delivering features under time pressure. Code smells are objective signals that structure has degraded. Named refactorings are the proven mechanical recipes for fixing each smell. The catalog of smells tells you *where* to look; the catalog of refactorings tells you *what to do*.
**Goal: 10/10.** When reviewing or refactoring code, rate the structural quality 0-10 based on adherence to the principles below. A 10/10 means: no obvious smells remain, each function does one thing, names reveal intent, duplication is eliminated, and the test suite covers the refactored paths. Always provide the current score and specific refactorings needed to reach 10/10.
Six areas of focus for systematically improving code structure:
**Core concept:** Code smells are surface indicators of deeper structural problems. They are not bugs -- the code works -- but they signal that the design is making the code harder to understand, extend, or maintain. Each smell maps to one or more named refactorings that fix it.
**Why it works:** Without a shared vocabulary of smells, code review devolves into subjective "I don't like this." Named smells give teams objective criteria: "This is Feature Envy -- the method uses six fields from another class and only one of its own." The name points directly to the fix.
**Key insights:**
**Code applications:**
| Context | Pattern | Example | |---------|---------|---------| | **Method > 10 lines** | Extract Method | Pull the loop body into `calculateLineTotal()` | | **Class > 200 lines** | Extract Class | Move shipping logic into a `ShippingCalculator` | | **Switch on type code** | Replace Conditional with Polymorphism | Create subclasses for each order type | | **Multiple methods use same params** | Introduce Parameter Object | Group `startDate, endDate` into `DateRange` | | **Method uses another object's data** | Move Method | Move `calculateDiscount()` to the `Customer` class | | **Copy-pasted logic** | Extract Method + Pull Up Method | Share via a common method or base class |
See: [references/smell-catalog.md](references/smell-catalog.md)
**Core concept:** Most refactoring starts here. Long methods are broken into smaller, well-named pieces. Each extracted piece should do one thing and its name should say what that thing is. The goal is methods you can read like prose -- a sequence of high-level steps, each delegating to a clearly named helper.
**Why it works:** Short methods with intention-revealing names eliminate the need for comments, make bugs obvious (each method is small enough to verify at a glance), and enable reuse. The cognitive cost of a method call is near zero when the name tells you everything.
**Key insights:**
**Code applications:**
| Context | Pattern | Example | |---------|---------|---------| | **Block with a comment** | Extract Method | `// check eligibility` becomes `isEligible()` | | **Temp used once** | Inline Variable | Remove `const price = order.getPrice()` if used once | | **Temp used in multiple places** | Replace Temp with Query | Replace `let discount = getDiscount()` with method calls | | **Temp assigned twice for different reasons** | Split Temporary Variable | I
Team Avatar: a universal agent orchestrator for Claude Code, Codex, and Cursor. Nine Avatar characters, 58 engineering skills. pstack with Avatar characters on top.
Zuko's Agni Kai for bakeoffs. The formal firebending duel, where competing implementations fight under the same rules and a judge…
Aang showing a new friend around the team. Explains Team Avatar to a user, the roster and who owns what, how to invoke a skill on…
Aang's operating mode for Team Avatar, principal-level engineering where each task goes to the character who owns that…
Aang choosing which bender takes which fight. Configures which model each Team Avatar character runs on, the default reasoning…
Sokka's battle map, the decision trail he keeps so anyone can see how the campaign was won. Use for show-me-your-work,…
Appa's morning departure for picking up paused or handed-off work. The team breaks camp, reads the map they left, and flies on…