☕ Coffee Patterns - VSCode Design Patterns Extension
Brew Perfect Code with Design Patterns ☕️
A comprehensive Visual Studio Code extension providing 25+ design pattern snippets with coffee-themed examples
📋 Table of Contents
🎯 Overview
Coffee Patterns is a comprehensive Visual Studio Code extension that brings the power of design patterns to your fingertips! 🚀
Whether you're a seasoned architect crafting complex systems or a developer learning the fundamentals, Coffee Patterns provides 25+ meticulously crafted design pattern snippets with engaging coffee-themed examples that make learning both fun and memorable.
🌟 Why Coffee Patterns?
- 📚 Educational: Each pattern includes detailed documentation and real-world examples
- ⚡ Productive: Implement complex patterns in seconds, not hours
- 🎨 Memorable: Coffee-themed examples make patterns easier to understand and remember
- 🔧 Comprehensive: Covers all 23 classic GoF patterns plus advanced combinations
- ✅ Type-Safe: Full Python type annotations and modern best practices
✨ Features
| Feature |
Description |
| 🏗️ 25+ Design Patterns |
Complete collection of GoF patterns plus modern variations |
| 🔀 Pattern Combinations |
Pre-built "blends" that combine multiple patterns effectively |
| ☕ Coffee-Themed Examples |
Memorable examples using coffee shop scenarios |
| 🎯 Type-Safe Code |
Full type annotations with modern Python practices |
| 📚 Rich Documentation |
Detailed explanations, use cases, and examples |
| ⚡ Tab Navigation |
Smart placeholders for quick customization |
| 🎨 Clean Structure |
Well-organized, readable code following best practices |
| 🔄 Regular Updates |
Continuously improved based on community feedback |
🚀 Quick Start
Get started with Coffee Patterns in just a few steps:
- Install the extension from the VS Code Marketplace
- Open a Python file (
.py) in VS Code
- Type
! followed by a pattern name (e.g., !singleton)
- Select from IntelliSense suggestions and press
Enter
- Navigate through placeholders using
Tab and customize your code
💡 Pro Tip: All pattern snippets start with ! for easy discovery and pattern blends start with !blend_
💾 Installation
📦 From VS Code Marketplace
The easiest way to install Coffee Patterns:
- Open Visual Studio Code
- Navigate to Extensions:
- Windows/Linux:
Ctrl+Shift+X
- macOS:
⌘+Shift+X
- Search for "Coffee Patterns"
- Click "Install" on the official extension by
shahafashash
- Reload VS Code if prompted
⚡ Quick Install via Command Line
You can also install directly from the command line:
Windows (PowerShell):
code --install-extension shahafashash.coffee-patterns
macOS (Terminal):
code --install-extension shahafashash.coffee-patterns
Linux (Terminal):
code --install-extension shahafashash.coffee-patterns
🎮 Usage
| Action |
Windows/Linux |
macOS |
Description |
| Open Extensions |
Ctrl+Shift+X |
⌘+Shift+X |
Access the Extensions view |
| Command Palette |
Ctrl+Shift+P |
⌘+Shift+P |
Quick access to all commands |
| IntelliSense |
Ctrl+Space |
⌃+Space |
Trigger code suggestions |
| Next Placeholder |
Tab |
Tab |
Navigate to next snippet placeholder |
| Previous Placeholder |
Shift+Tab |
⇧+Tab |
Navigate to previous placeholder |
📝 Pattern Usage Steps
- Create or open a Python file (
.py extension)
- Start typing
! followed by the pattern name:
- For individual patterns:
!factory_method, !singleton, !observer, etc.
- For pattern combinations:
!blend_factory_singleton, !blend_composite_visitor, etc.
- Select the desired snippet from the IntelliSense dropdown
- Press
Enter to insert the snippet
- Use
Tab to navigate between placeholders (highlighted in blue)
- Replace placeholders with your custom class names and logic
- Continue developing your application with the generated pattern structure
🏗️ Supported Design Patterns
Coffee Patterns includes all 23 classic Gang of Four (GoF) design patterns plus modern variations, organized into three categories:
🏭 Creational Patterns
Patterns that deal with object creation mechanisms
| Pattern |
Trigger |
Description |
| Factory Method |
!factory_method |
Creates objects without specifying exact classes |
| Abstract Factory |
!abstract_factory |
Creates families of related objects |
| Builder |
!builder |
Constructs complex objects step by step |
| Builder with Director |
!builder_director |
Builder pattern with orchestration layer |
| Singleton |
!singleton |
Ensures only one instance exists |
| Thread-Safe Singleton |
!singleton_thread_safe |
Thread-safe singleton implementation |
| Prototype |
!prototype |
Creates objects by cloning existing instances |
🔧 Structural Patterns
Patterns that deal with object composition and relationships
| Pattern |
Trigger |
Description |
| Adapter (Inheritance) |
!adapter_inheritance |
Adapts interfaces using inheritance |
| Adapter (Composition) |
!adapter_composition |
Adapts interfaces using composition |
| Bridge |
!bridge |
Separates abstraction from implementation |
| Composite |
!composite |
Composes objects into tree structures |
| Decorator |
!decorator |
Adds behavior to objects dynamically |
| Facade |
!facade |
Provides unified interface to subsystem |
| Flyweight |
!flyweight |
Shares fine-grained objects efficiently |
| Proxy |
!proxy |
Provides placeholder/surrogate for objects |
🔄 Behavioral Patterns
Patterns that deal with communication between objects and assignment of responsibilities
| Pattern |
Trigger |
Description |
| Chain of Responsibility |
!chain_of_responsibility |
Passes requests along handler chain |
| Command |
!command |
Encapsulates requests as objects |
| Iterator |
!iterator |
Provides sequential access to elements |
| Mediator |
!mediator |
Defines object interaction protocols |
| Memento |
!memento |
Captures and restores object state |
| Observer |
!observer |
Notifies dependents of state changes |
| State |
!state |
Alters behavior when internal state changes |
| Strategy |
!strategy |
Encapsulates algorithms and makes them interchangeable |
| Template Method |
!template_method |
Defines algorithm skeleton in base class |
| Visitor |
!visitor |
Defines new operations without changing classes |
🌟 Pattern Combinations (Blends)
Coffee Patterns also includes powerful "blend" patterns that combine multiple design patterns for common use cases:
| Blend |
Trigger |
Combines |
Use Case |
| Factory-Singleton |
!blend_factory_singleton |
Factory Method + Singleton |
Controlled object creation with single instances |
| Composite-Visitor |
!blend_composite_visitor |
Composite + Visitor |
Hierarchical object processing and operations |
| Proxy-Observer |
!blend_proxy_observer |
Proxy + Observer |
Secure notification systems with access control |
| Builder-Strategy |
!blend_builder_strategy |
Builder + Strategy |
Flexible object construction with different algorithms |
| Decorator-Chain |
!blend_decorator_chain |
Decorator + Chain of Responsibility |
Processing pipelines with enhanced functionality |
| State-Command |
!blend_state_command |
State + Command |
State-dependent command execution systems |
📚 Usage Examples
🎯 Using Individual Patterns
Here's how to quickly implement a Singleton pattern:
- Type
!singleton in your Python file
- Select the snippet from IntelliSense
- Navigate through placeholders using
Tab
- Customize the class name and methods

Example result:
from __future__ import annotations
from typing import Any, Dict
class SingletonMeta(type):
"""Metaclass implementing the Singleton design pattern."""
_instances: Dict[type, Any] = {}
def __call__(cls, *args, **kwargs) -> Any:
if cls not in cls._instances:
cls._instances[cls] = super().__call__(*args, **kwargs)
return cls._instances[cls]
class CoffeeShop(metaclass=SingletonMeta):
"""Singleton class implementing the Singleton design pattern."""
def serve_coffee(self) -> None:
"""Serve coffee to customers."""
print("Serving delicious coffee!")
🔀 Using Pattern Combinations
Pattern blends combine multiple patterns for powerful solutions:
- Type
!blend_factory_singleton in your Python file
- Select the blend from IntelliSense
- Use
Tab to navigate through the combined pattern structure
- Implement your specific logic

Available Pattern Combinations:
| Combination |
Best For |
!blend_factory_singleton |
Factory Method + Singleton - Controlled object creation |
!blend_composite_visitor |
Composite + Visitor - Tree structure operations |
!blend_proxy_observer |
Proxy + Observer - Secure notification systems |
!blend_builder_strategy |
Builder + Strategy - Flexible construction algorithms |
!blend_decorator_chain |
Decorator + Chain of Responsibility - Processing pipelines |
!blend_state_command |
State + Command - State-dependent execution |
💡 Pro Tips
- Autocomplete: Type
! and let IntelliSense guide you
- Quick Access: Use
Ctrl+Space (or ⌃+Space on macOS) to trigger suggestions
- Tab Navigation: Use
Tab/Shift+Tab to move between placeholders
- Documentation: Hover over pattern names for detailed descriptions
- Customization: All snippets are fully customizable - modify to fit your needs!
🤝 Contributing
We ❤️ contributions! Coffee Patterns is an open-source project that thrives on community involvement.
🚀 Quick Contribution Guide
- 🍴 Fork the repository
- 🌿 Create a feature branch:
git checkout -b feature/amazing-pattern
- 💻 Make your changes following our coding guidelines
- ✅ Test your changes thoroughly
- 📝 Commit with descriptive messages:
git commit -m "Add amazing new pattern"
- 🚀 Push to your branch:
git push origin feature/amazing-pattern
- 🎯 Create a Pull Request
🎯 Ways to Contribute
| Type |
Description |
Difficulty |
| 🐛 Bug Reports |
Found an issue? Report it! |
Beginner |
| 💡 Feature Requests |
Suggest new patterns or improvements |
Beginner |
| 📚 Documentation |
Improve README, comments, or examples |
Beginner |
| 🔧 Code Improvements |
Enhance existing patterns |
Intermediate |
| 🆕 New Patterns |
Add missing design patterns |
Advanced |
| 🎨 Design |
Improve visual elements and UX |
Intermediate |
📋 Contribution Guidelines
Before contributing, please review our detailed Contributing Guide and Code of Conduct.
Key points:
- Follow Google Python Style Guide
- Include comprehensive docstrings
- Add coffee-themed examples where appropriate
- Ensure all snippets include proper type annotations
- Test your patterns in VS Code before submitting
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License - Feel free to use, modify, and distribute! ☕
💬 Feedback & Support
We love hearing from our users! Your feedback helps make Coffee Patterns better.
🐛 Found a Bug?
Use our structured bug report form for faster resolution:

💡 Have a Feature Idea?
We'd love to hear your suggestions:

💬 General Questions?
- GitHub Discussions: For general questions and community chat
- GitHub Issues: For bugs and feature requests
- Marketplace Reviews: Share your experience with other users
📊 Project Stats

🙏 Acknowledgments
🌟 Special Thanks
- 🎨 Design Pattern Community: For the foundational Gang of Four patterns
- 👥 Contributors: All the amazing developers who have contributed to this project
- ☕ Coffee Enthusiasts: For inspiring our coffee-themed approach
- 🚀 VS Code Team: For creating an amazing extension platform
- 🐍 Python Community: For the language that makes these patterns shine
📚 References