gof-bridge
Installation
SKILL.md
One-line summary
Decouple an abstraction from its implementation so that the two can vary independently — replacing a combinatorial subclass explosion with composition along two orthogonal dimensions.
When to use this skill
- Two orthogonal dimensions of variation: N shapes × M renderers, or N drawing tools × M rendering backends. Without Bridge, you get an N×M subclass explosion.
- You expect both the abstraction (e.g.,
Shape) and the implementation (e.g.,Renderer) to evolve independently over time, possibly maintained by different teams. - You want to switch implementations at runtime — choose a different renderer per platform, per environment, per configuration.
When NOT to use this skill
- Only one of the two dimensions actually varies — the other has only one implementation and no second is in sight. Bridge is over-engineering.
- The "two dimensions" aren't truly orthogonal — they interact in ways that force coupling. Bridge's value depends on independence.
- You're retrofitting two existing incompatible interfaces — that's
gof-adapter, not Bridge. Bridge is designed up front.