design-patterns

Select GoF patterns using pressure-based filtering and Require/Guarantee/Maintain/Assert contracts.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/thistleknot/skills --skill design-patterns-thistleknot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: design-patterns
Source: https://github.com/thistleknot/skills/tree/main/design-patterns
Command: npx skills add https://github.com/thistleknot/skills --skill design-patterns-thistleknot

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps you avoid interface mismatches, repeated relationship-shape code, and unsafe agent workflows by selecting an appropriate design pattern and enforcing clear Require/Guarantee/Maintain/Assert contracts.

Core Features & Use Cases

  • Pattern-selection protocol: Selects patterns based on the underlying pressure and constraints rather than pattern names.
  • Contract-first interface shaping: Defines caller preconditions, implementation postconditions, invariants, and boundary assertions.
  • Agentic systems state-machine guidance: Reframes nondeterministic loops as deterministic, tool-validated state transitions (model as compiler, harness as linker).
  • Pragmatic constraints: Encourages “no pattern over the wrong pattern,” stops early for single-call solutions, and favors readable interfaces over clever abstractions.

Quick Start

Use the design-patterns skill to refactor an interface or component relationship by stating the concrete constraint and asking which contract-shaped GoF pattern family best matches it.

Frequently Asked Questions about design-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the right design pattern for refactoring code?

To choose a design pattern for refactoring, select based on the underlying pressure and constraints rather than pattern names. This pressure-based pattern filtering ensures you apply the lightest pattern that fits the specific code relationship shape.

What are Require Guarantee Maintain Assert contracts in interface design?

Require Guarantee Maintain Assert contracts are a contract-first interface shaping method. They define caller preconditions, implementation postconditions, invariants, and boundary assertions to prevent interface mismatches in component relationships.

How do I make nondeterministic agent loops deterministic?

Make nondeterministic agent loops deterministic by reframing them as state-machine transitions. Use external tool validation to gate transitions rather than relying on model self-assessment, treating the model as a compiler and the harness as a linker.

When should I avoid using design patterns in my architecture?

You should avoid using design patterns when a single-call solution works, favoring readable interfaces over clever abstractions. The principle of "no pattern over the wrong pattern" means stopping early if the constraint does not require complex relationship shaping.

How do I handle state-driven behavior branching without complex abstractions?

Handle state-driven behavior branching by applying state-machine transition gating. Define explicit contract shapes and use external validation to enforce transitions, ensuring determinism matters are resolved without over-engineering the architecture.