What problem does it solve?
When refactoring the Gum codebase, contributors risk moving code in the wrong architectural direction — promoting members to static, demoting interfaces to concrete types, or bloating god classes like GraphicalUiElement — which undoes the project's ongoing migration from static singletons to constructor-injected services.
Core Features & Use Cases
- Directional refactoring rules: Mandates moving toward instances, interfaces, and single-responsibility classes, and never toward statics or concrete types.
- Singleton drain guidance: Defines which singletons are sanctioned exceptions (ObjectFinder.Self, RenderingLibrary/InputLibrary runtime singletons) versus in-scope drain targets, including MEF plugin injection patterns and Lazy<T> cycle-breaking.
- Testability discipline: Requires that extraction-for-testability refactors ship with a test, and calibrates when characterization tests add value during behavior-preserving drains.
- Use Case: While extracting duplicated Gradient/Dropshadow logic shared by CircleRuntime and RectangleRuntime, apply the composed-struct pattern (no cached mutable references) instead of adding methods to a shared base class that cannot exist.
Quick Start
Ask the AI to review a proposed refactor of a Gum manager class and confirm it follows the refactoring-direction rules before making the changes.