Apply Clean Code principles (meaningful names, small functions, error handling, TDD, SRP, smells & heuristics) when authoring, refactoring, or reviewing code—especially TypeScript. Use when the user asks for clean code, refactoring, extract function or class, code smell or maintainability review, readable tests, or Robert C. Martin's Clean Code rules.
Detect, name, and remediate code smells using the classic taxonomy (Bloaters, Object-Orientation Abusers, Change Preventers, Dispensables, Couplers) when reviewing, refactoring, or authoring code. Use when the user asks to find code smells, review code for maintainability, identify long methods/large classes/duplicate code/feature envy, or wants refactoring guidance tied to a named smell.
Create and maintain custom Skills with correct SKILL.md metadata, strong trigger-aware descriptions, concise instructions, progressive disclosure, and validation loops. Use when the user asks to write, improve, review, or organize a Skill.
Create and maintain custom subagent definition files for any AI agent platform, with strong descriptions, tight tool scope, and explicit handoff contracts. Use when the user asks to create, improve, or standardize a subagent.
Teach and apply the Chain of Responsibility (CoR) pattern to pass requests along a dynamic chain of handlers where each can process or forward the request. Use when users ask about CoR, Chain of Command, middleware pipelines, sequential validation, request bubbling, or comparing CoR to Decorator, Command, or Mediator.
Teach and apply the Command pattern to encapsulate requests as objects for decoupled invocation, queuing, scheduling, logging, and undo/redo workflows. Use when users ask about Command, Action, Transaction, invoker-receiver decoupling, reversible operations, or comparing Command with Strategy, Chain of Responsibility, or Memento.
Teach and apply the Iterator pattern to traverse collections without exposing their internal structure. Use when users ask about Iterator, custom traversal algorithms, decoupling traversal from collections, parallel iteration, lazy iteration, or comparing Iterator to for-each loops and language-native iterables.
Teach and apply the Mediator pattern to centralize collaboration rules among tightly coupled components and eliminate direct component-to-component dependencies. Use when users ask about Mediator, Intermediary, Controller, UI dialog coordination, reusable components, or comparing Mediator with Observer, Facade, or Chain of Responsibility.