architecture-design
What it does
This skill explains a modular code layout for machine learning projects, built around factories and registries. It is for ML developers adding new datasets, models or other pluggable parts to a project.
When to use it
- βWhen you are creating a new dataset or model class that must be registered.
- βWhen you are adding a new module folder with factory wiring to an ML project.
- βWhen you are starting an ML project from scratch and want a clear structure.
Skill link
https://github.com/Galaxy-Dawn/claude-scholar/blob/main/skills/architecture-design/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βAdd a new registered dataset class to my ML project following our factory pattern.β
5 new skills a week. 1 minute to read.
How it works
The agent follows the project pattern, adds a registration decorator and wires the new component through the module's factory. It skips this pattern for simple fixes and small edits.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Architecture Design - ML Project Template
This skill defines the standard code architecture for machine learning projects based on the template structure. When modifying or extending code, follow these patterns to maintain consistency.
Overview
The project follows a modular, extensible architecture with clear separation of concerns. Each module (data, model, trainer, analysis) is independently organized using factory and registry patterns for maximum flexibility.
When to Use
Use this skill when:
- Creating a new Dataset class that needs
@register_dataset - Creating a new Model class that needs
@register_model - Creating a new module directory with
__init__.pyfactory wiring - Initializing a new ML project structure from scratch
- Adding new component types such as Augmentation, CollateFunction, or Metrics
When Not to Use
Do not use this skill when:
- Modifying existing functions or methods
- Fixing bugs in existing code
- Adding helper functions or utilities
- Refactoring without adding new registrable components
- Making simple code changes to a single file
- Modifying configuration files
- Reading or understanding existing code
Key indicator: if the task does not require a @register_* decorator or a Factory pattern, skip this skill.
Core Design Patterns
Factory Pattern
Each module uses a factory to create instances dynamically:
# Example from data_module/dataset/__init__.py
DATASET_FACTORY: Dict = {}
def DatasetFactory(data_name: str):
dataset = DATASET_FACTORY.get(data_name, None)
if dataset is None:
print(f"{data_name} dataset is not implementation, use simple dataset")
dataset = DATASET_FACTORY.get('simple')
return dataset
For detailed guidance, refer to references/factory_pattern.md.
Registry Pattern
Components register themselves via decorators:
# Example from data_module/dataset/simple_dataset.py
@register_dataset("simple")
class SimpleDataset(Dataset):
def __init__(self, data):
self.data = data
For detailed guidance, refer to references/registry_pattern.md.
Auto-Import Pattern
Modules automatically discover and import submodules:
# Example from data_module/dataset/__init__.py
models_dir = os.path.dirname(__file__)
import_modules(models_dir, "src.data_module.dataset")
For detailed guidance, refer to references/auto_import.md.
Directory Structure
project/
βββ run/
β βββ pipeline/ # Main workflow scripts
β β βββ training/ # Training pipelines
β β βββ prepare_data/ # Data preparation pipelines
β β βββ analysis/ # Analysis pipelines
β βββ conf/ # Hydra configuration files
β βββ training/ # Training configs
β βββ dataset/ # Dataset configs
β βββ model/ # Model configs
β βββ prepare_data/ # Data prep configs
β βββ analysis/ # Analysis configs
β
βββ src/
β βββ data_module/ # Data processing module
β β βββ dataset/ # Dataset implementations
β β βββ augmentation/ # Data augmentation
β β βββ collate_fn/ # Collate functions
β β βββ compute_metrics/ # Metrics computation
β β βββ prepare_data/ # Data preparation logic
β β βββ data_func/ # Data utility functions
β β βββ utils.py # Module-specific utilities
β β
β βββ model_module/ # Model implementations
β β βββ brain_decoder/ # Brain decoder models
β β βββ model/ # Alternative model location
β β
β βββ trainer_module/ # Training logic
β βββ analysis_module/ # Analysis and evaluation
β βββ llm/ # LLM-related code
β βββ utils/ # Shared utilities
β
βββ data/
β βββ raw/ # Original, immutable data
β βββ processed/ # Cleaned, transformed data
β βββ external/ # Third-party data
β
βββ outputs/
β βββ logs/ # Training and evaluation logs
β βββ checkpoints/ # Model checkpoints
β βββ tables/ # Result tables
β βββ figures/ # Plots and visualizations
β
βββ pyproject.toml # Project configuration
βββ uv.lock # Dependency lock file
βββ TODO.md # Task tracking
βββ README.md # Project documentation
βββ .gitignore # Git ignore rules
For detailed directory structure with file descriptions, refer to `r
FAQ
When should I not use it?
Skip it for bug fixes, small helper functions and config changes, where no registered component is added.
What is a registry?
It is a lookup list where components register themselves, so a factory can create them by name.
Does it cover other component types?
Yes. It mentions others such as augmentation, collate functions and metrics.
Details
Original description by the author
Use only when creating new registrable ML components that require Factory or Registry patterns.
Popularity
- GitHub stars
- 6.0k
- Ranking position
- #14479
- License
- MIT
- Updated
- 10/19/2026
Comments
- β¦
More skills from this repository
agent-identifier
6.0kTeaches your agent to create Claude Code agents, writing their name, trigger description, system prompt and settings correctly.
bug-detective
6.0kHelps your agent find and fix code errors with a clear method: understand the problem, gather evidence, test ideas and verify the fix.
citation-verification
6.0kTeaches your agent to check each citation in an academic paper against trusted scholarly sources, catching fake or wrong references.
code-review-excellence
6.0kHelps your agent review code changes and pull requests with clear, kind, prioritized feedback that catches real bugs and improves the code.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.