arch-patterns

Installation
SKILL.md

arch-patterns

Purpose

This skill equips OpenClaw to assist in applying software architecture patterns, including the GoF 23 patterns (e.g., Factory, Singleton, Observer), SOLID principles (Single Responsibility, Open-Closed), and guidelines like DRY (Don't Repeat Yourself), YAGNI (You Aren't Gonna Need It), KISS (Keep It Simple, Stupid), composition over inheritance, and functional programming concepts. Use it to generate code snippets, suggest refactorings, or validate designs.

When to Use

Apply this skill when structuring new codebases, refactoring legacy systems, or resolving design issues. For example, use it for object-oriented designs in languages like Java or Go, or when adopting functional styles in Python. Avoid it for trivial scripts; reserve for projects with >1000 lines or teams >5 members.

Key Capabilities

  • GoF Patterns: Suggest implementations like Factory Method (creates objects without specifying class) or Observer (notifies dependents of state changes).
  • SOLID Principles: Enforce Single Responsibility (one class does one thing) or Dependency Inversion (depend on abstractions).
  • Best Practices: Recommend DRY by extracting repeated code into functions, YAGNI by avoiding premature features, KISS by simplifying complex logic, and favoring composition (e.g., using interfaces) over inheritance.
  • Comparisons: Provide code examples contrasting composition vs. inheritance, or functional vs. imperative approaches.
  • Validation: Analyze user code for anti-patterns and suggest fixes, e.g., detecting God Objects.

Usage Patterns

To use this skill, invoke OpenClaw via CLI or API with specific pattern queries. Start by providing context like language and problem. For CLI, pipe code snippets; for API, send JSON payloads. Always include the skill ID "arch-patterns" in requests. Example flow: Query a pattern, get a code snippet, then refine with follow-ups. Limit queries to one pattern per call for accuracy.

Related skills
Installs
22
GitHub Stars
5
First Seen
Mar 7, 2026