Structural Pattern Selector for Openclaw

A specialized decision engine for selecting and implementing the optimal GoF structural design patterns in software development.

quochungto
v1.0.0
Apr 10, 2026
0
372
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install bookforge-structural-pattern-selector

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install bookforge-structural-pattern-selector using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Structural Pattern Selector?

The Structural Pattern Selector is a high-level architectural tool designed to help developers and AI agents navigate the complexities of object composition. As part of the wider ecosystem of Openclaw Skills, this tool provides a rigorous framework for choosing between the seven classic Gang of Four structural patterns: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, and Proxy. It moves beyond simple definitions to focus on architectural intent and timing, ensuring that design choices are semantically correct and practically viable.

By leveraging this skill, developers can eliminate common architectural mistakes, such as using an Adapter when a Bridge is required, or failing to identify the recursive composition needs of the Decorator pattern. It serves as a technical compass for building decoupled, maintainable, and efficient software systems within any AI-augmented development workflow.

Structural Pattern Selector Use Cases

  • Resolving interface mismatches between incompatible third-party libraries and internal application interfaces.
  • Decoupling abstractions from their implementations to allow both to vary independently without class proliferation.
  • Implementing part-whole hierarchies where individual objects and complex compositions must be treated uniformly.
  • Dynamically adding or removing object responsibilities at runtime without the rigidity of subclassing.
  • Creating simplified entry points to complex subsystems to reduce client-side coupling.

How Structural Pattern Selector Works

  1. Initialize the diagnostic process using TodoWrite to frame the structural problem and document existing code constraints.
  2. Analyze the structural intent to map the specific problem to the core purpose of a GoF pattern (e.g., interface translation vs. access control).
  3. Apply the disambiguation decision tree to resolve conflicts between similar patterns, specifically focusing on design timing (pre-design vs. post-design).
  4. Verify specific applicability conditions, ensuring strict requirements for patterns like Flyweight or Proxy are fully met.
  5. Generate a comprehensive recommendation that includes the intent match, a rationale against alternatives, and a summary of architectural trade-offs.

Structural Pattern Selector Setup

To integrate this capability into your development environment using Openclaw Skills, install the package via the CLI:

clawhub install bookforge-structural-pattern-selector

Ensure that your environment has the design-pattern-selector dependency active to allow for broader pattern classification if the problem is not yet confirmed as structural.

Structural Pattern Selector Data Schema & Taxonomy

The skill organizes its analysis and recommendations through a structured metadata taxonomy:

Element Description
Intent Mapping Categorizes the problem into translation, decoupling, uniformity, or embellishment.
Timing Axis Identifies if the solution is being applied to existing code (Adapter) or new designs (Bridge).
Condition Gate A boolean verification list for pattern-specific constraints (e.g., Flyweight's five conditions).
Decision Rationale A detailed explanation of why specific alternative patterns were ruled out.

Structural Pattern Selector Advanced Features

  • Advanced timing-based logic to differentiate between Adapter and Bridge based on the lifecycle of the code.
  • Recursive composition analysis to identify when to stack behaviors via Decorators versus structuring trees via Composite.
  • Identity-safety checks for Flyweight implementations to prevent silent state-sharing bugs.
  • Integration hooks for scanning codebases to detect structural "smells" like deep inheritance trees or combinatorial subclassing.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*