intense-visions/harness-engineering/gof-bridge-pattern
Claude Code and agent skill by intense-visions/harness-engineering
- community
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install intense-visions/harness-engineering/gof-bridge-patternSKILL.md
The same SKILL.md was published earlier as intense-visions/harness-engineering/gof-bridge-pattern.
GOF Bridge Pattern
Separate abstraction from implementation to allow them to vary independently.
When to Use
- You have a class that needs to vary along two independent dimensions (e.g., shape + renderer, notification + channel)
- You want to avoid a class explosion from combining multiple orthogonal hierarchies
- You need to switch implementations at runtime without changing the abstraction
- You're applying composition over inheritance to eliminate deep inheritance chains
Instructions
Classic shape + renderer bridge:
Notification + channel bridge (practical backend example):
Details
Why Bridge prevents class explosion: Without Bridge, combining 3 shapes × 3 renderers requires 9 classes. With Bridge, 3 shape classes + 3 renderer classes = 6 classes total. The number of combinations grows multiplicatively without the pattern.
Bridge vs. Adapter: Adapter works with existing classes to make them compatible. Bridge is designed upfront to allow variation. If you find yourself introducing Bridge after the fact, you might actually want Adapter.
Bridge vs. Strategy: Bridge separates a class hierarchy along two dimensions. Strategy encapsulates a single algorithm. Bridge is architectural; Strategy is behavioral. A bridge can contain multiple strategy-like injections.
Anti-patterns:
- Using Bridge when there's only one implementation — adds needless complexity
- Implementation that calls back into the abstraction — creates coupling in both directions
- Abstraction that exposes implementation details — defeats the purpose of separation
Runtime switching:
Source
refactoring.guru/design-patterns/bridge
Process
- Read the instructions and examples in this document.
- Apply the patterns to your implementation, adapting to your specific context.
- Verify your implementation against the details and edge cases listed above.
Harness Integration
- Type: knowledge — this skill is a reference document, not a procedural workflow.
- No tools or state — consumed as context by other skills and agents.
Success Criteria
- The patterns described in this document are applied correctly in the implementation.
- Edge cases and anti-patterns listed in this document are avoided.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagents/skills/codex/gof-bridge-pattern/SKILL.md
Popularity
- Repository stars
- 9
- Repository forks
- 5
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 30 Apr 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/intense-visions/harness-engineering/gof-bridge-pattern)