arch-patterns
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.
More from alphaonedev/openclaw-graph
playwright-scraper
Playwright web scraping: dynamic content, auth flows, pagination, data extraction, screenshots
1.4Kgcp-iam
Manages identity and access control for Google Cloud resources using IAM policies and roles.
370humanize-ai-text
AI text humanization: reduce AI-detection patterns, natural phrasing, tone adjustment
260macos-automation
AppleScript, JXA, Shortcuts, Automator, osascript, System Events, accessibility API
173tavily-web-search
Tavily: web search optimized for AI agents, answer synthesis, domain filtering, depth control
154clawflows
OpenClaw workflow automation: multi-step task chains, conditional logic, triggers, schedule
102