architecture-design
하는 일
이 스킬은 팩토리와 레지스트리를 중심으로 한 머신러닝 프로젝트의 모듈형 코드 구조를 설명합니다. 프로젝트에 새 데이터셋, 모델, 그 밖의 플러그인 부품을 추가하는 ML 개발자를 위한 것입니다.
사용하는 경우
- ✓등록이 필요한 새 데이터셋 또는 모델 클래스를 만들 때.
- ✓팩토리 연결이 있는 새 모듈 폴더를 ML 프로젝트에 추가할 때.
- ✓처음부터 ML 프로젝트를 시작하고 명확한 구조를 원할 때.
스킬 링크
https://github.com/Galaxy-Dawn/claude-scholar/blob/main/skills/architecture-design/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 ML 프로젝트에 등록되는 새 데이터셋 클래스를 우리 팩토리 패턴에 맞춰 추가해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 프로젝트 패턴을 따르고, 등록 데코레이터를 추가하며, 새 부품을 모듈의 팩토리를 통해 연결합니다. 간단한 수정이나 작은 편집에는 이 패턴을 건너뜁니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
언제 쓰지 않아야 하나요?
등록되는 부품을 추가하지 않는 버그 수정, 작은 도우미 함수, 설정 변경에는 건너뜁니다.
레지스트리란 무엇인가요?
부품들이 스스로 등록하는 조회 목록이며, 팩토리가 이름으로 부품을 만들 수 있게 합니다.
다른 부품 유형도 다루나요?
네. 데이터 증강(augmentation), collate 함수, 메트릭 등 다른 유형도 언급합니다.
상세 정보
작성자의 원본 설명
Use only when creating new registrable ML components that require Factory or Registry patterns.
인기도
- GitHub 스타
- 6.0k
- 순위
- #14479
- 라이선스
- MIT
- 업데이트
- 2026. 10. 19.
댓글
- …
이 저장소의 다른 스킬
agent-identifier
6.0k에이전트가 이름, 트리거 설명, 시스템 프롬프트, 설정을 올바르게 갖춘 Claude Code 에이전트를 만들도록 가르칩니다.
bug-detective
6.0k에이전트가 문제 이해, 증거 수집, 가설 검증, 수정 확인의 방법으로 코드 오류를 찾아 고치도록 돕습니다.
citation-verification
6.0k에이전트가 논문의 인용을 신뢰할 수 있는 자료와 대조해 가짜이거나 잘못된 참고 문헌을 찾도록 가르칩니다.
code-review-excellence
6.0k에이전트가 코드 변경을 검토해 실제 버그를 찾고, 명확하고 친절하며 우선순위가 있는 피드백을 주도록 돕습니다.