Skip to content

Comprehensive GoF design patterns and data structures reference skill for Claude Code

License

Notifications You must be signed in to change notification settings

grndlvl/software-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Software Patterns

License: MIT Claude Code Skill Contributions Welcome

A comprehensive reference for Gang of Four design patterns and fundamental data structures for Claude Code. Language-agnostic pseudocode examples that translate to any programming language.

What's Included

Category Count Description
GoF Creational Patterns 5 Abstract Factory, Builder, Factory Method, Prototype, Singleton
GoF Structural Patterns 7 Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy
GoF Behavioral Patterns 11 Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor
Data Structures 23 Arrays, Lists, Trees, Graphs, Hash Tables, and more
Decision Guides 3 Pattern selection, data structure selection, complexity cheat sheet

Total: 50 comprehensive documentation files (~35,000 lines)

Installation

As a Claude Code Skill (Recommended)

npx skills add git@github.com:grndlvl/software-patterns.git -g

This installs the skill globally so it's available in all your projects.

Project-Level Installation

npx skills add git@github.com:grndlvl/software-patterns.git

Manual Installation

git clone git@github.com:grndlvl/software-patterns.git
cp -r software-patterns/.claude/skills/software-patterns ~/.claude/skills/

Usage

Once installed, the skill auto-activates when you:

  • Ask about or need to implement a design pattern
  • Need to choose between patterns or data structures
  • Are refactoring code and considering structural improvements
  • Discuss architecture, decoupling, or extensibility
  • Need to understand time/space complexity trade-offs

Example Prompts

"Which design pattern should I use for creating objects without specifying their concrete classes?"

"What's the best data structure for fast lookups with frequent insertions?"

"Show me how to implement the Observer pattern"

"Compare the trade-offs between using a hash table vs a balanced tree"

Contents

GoF Design Patterns (23)

Creational Patterns

Pattern Intent
Abstract Factory Create families of related objects
Builder Construct complex objects step-by-step
Factory Method Let subclasses decide which class to instantiate
Prototype Clone existing objects
Singleton Ensure single instance

Structural Patterns

Pattern Intent
Adapter Convert interface to expected interface
Bridge Separate abstraction from implementation
Composite Treat individual and groups uniformly
Decorator Add responsibilities dynamically
Facade Simplified interface to subsystem
Flyweight Share common state efficiently
Proxy Control access to object

Behavioral Patterns

Pattern Intent
Chain of Responsibility Pass request along handler chain
Command Encapsulate request as object
Interpreter Define grammar and interpret sentences
Iterator Sequential access without exposing internals
Mediator Centralize complex communications
Memento Capture and restore object state
Observer Notify dependents of state changes
State Alter behavior when state changes
Strategy Encapsulate interchangeable algorithms
Template Method Define skeleton, let subclasses fill in
Visitor Add operations without changing classes

Data Structures (23)

Linear

Array · Dynamic Array · Linked List · Stack · Queue · Deque

Trees

Binary Tree · BST · AVL Tree · Red-Black Tree · B-Tree · Trie · Heap

Hash-Based

Hash Table · Hash Set · Bloom Filter

Graphs

Adjacency List · Adjacency Matrix · Graph Algorithms

Advanced

Skip List · Disjoint Set · Segment Tree · Fenwick Tree

Decision Guides

Documentation Format

Each pattern/structure includes:

  • Intent - Core purpose in one paragraph
  • Motivation - Real-world scenario explaining why it's needed
  • Structure - ASCII diagrams showing relationships
  • Participants - Roles and responsibilities
  • Implementation - Language-agnostic pseudocode
  • Example - Complete working example
  • When to Use / When NOT to Use - Practical guidance
  • Related Patterns - Connections to other patterns

Language Support

All examples use language-agnostic pseudocode designed to translate easily to:

  • PHP - Direct class mapping
  • JavaScript/TypeScript - ES6 classes or functional patterns
  • Python - Classes with type hints
  • Java/C# - Direct mapping with generics
  • Go/Rust - Adapt to language idioms

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Ideas for contributions:

  • Additional patterns (SOLID, GRASP, enterprise patterns)
  • Language-specific examples
  • More data structures (persistent, probabilistic)
  • Improvements to existing documentation
  • Translations

License

MIT License - see LICENSE for details.

Acknowledgments

  • Gang of Four: Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides
  • Design Patterns: Elements of Reusable Object-Oriented Software (1994)
  • The software engineering community

Made with Claude Code

About

Comprehensive GoF design patterns and data structures reference skill for Claude Code

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published