architecture-design

Create and register ML components using factory and registry patterns.

2|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Clay-HHK/claude-config --skill architecture-design-clay-hhk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: architecture-design
Source: https://github.com/Clay-HHK/claude-config/tree/main/skills/architecture-design
Command: npx skills add https://github.com/Clay-HHK/claude-config --skill architecture-design-clay-hhk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Establishes a consistent architecture and clear patterns for adding new registrable components in machine learning projects so teams avoid inconsistent implementations, missing imports, and config misalignment when extending codebases.

Core Features & Use Cases

  • Factory & Registry Patterns: guidance for creating and using factories and @register_* decorators to keep component creation decoupled from consumers.
  • Auto-Import Discovery: instructions for using import_modules to automatically discover and register implementations without manual imports.
  • Config-Driven Models & Hydra Integration: enforces model constructors that accept only cfg, forward outputs expected dict structure, and placement of Hydra configs for reproducible runs.
  • Common Use Cases: adding a new Dataset, registering a new Model, creating augmentation or collate function types, or initializing a new module directory with init.py factory logic.

Quick Start

Create a new dataset file under src/data_module/dataset, decorate the class with @register_dataset("your_name"), implement init, len, and getitem, and ensure the package auto-imports the module so the factory can discover it.

Frequently Asked Questions about architecture-design

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

FAQPage Schema
How do I add a new dataset to my ML project using a registry pattern?

To add a new dataset, create a file under your data module, decorate the class with @register_dataset, implement __init__, __len__, and __getitem__, and ensure the package auto-imports the module so the factory can discover it for your ML project.

What is the benefit of using auto-import discovery for ML components?

Auto-import discovery uses import_modules to automatically find and register ML component implementations, eliminating manual imports, preventing missing registrations, and decoupling component creation from consumers in your codebase.

Does this approach work with Hydra for config-driven model construction?

Yes, it enforces config-driven model constructors that accept only cfg, ensures forward outputs follow a dict structure, and guides placement of Hydra-compatible configurations for reproducible ML runs.

How do I create a new module directory with factory logic?

To create a new module directory, initialize it with an __init__.py file containing factory logic, then apply @register_* decorators to your classes so the auto-import discovery and registry patterns function correctly.

Can I register augmentations and collate functions using this factory pattern?

Yes, the factory and registry patterns support creating and registering augmentations, collate functions, datasets, and models, ensuring consistent architecture and clear patterns when extending your ML codebase.

Why should I standardize registrable components in machine learning projects?

Standardizing registrable ML components prevents inconsistent implementations, missing imports, and config misalignment, establishing clear patterns for teams to safely extend codebases with new datasets, models, and augmentations.