brycewang-stanford/auto-empirical-research-skills/architecture-design
Claude Code and agent skill by brycewang-stanford/auto-empirical-research-skills
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Use only when creating new registrable ML components that require Factory or Registry patterns.
Install
npx vskill@latest install brycewang-stanford/auto-empirical-research-skills/architecture-designSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as brycewang-stanford/auto-empirical-research-skills/architecture-design.
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:
For detailed guidance, refer to references/factory_pattern.md.
Registry Pattern
Components register themselves via decorators:
For detailed guidance, refer to references/registry_pattern.md.
Auto-Import Pattern
Modules automatically discover and import submodules:
For detailed guidance, refer to references/auto_import.md.
Directory Structure
For detailed directory structure with file descriptions, refer to references/structure.md.
Module Organization
Creating a New Dataset
When adding a new dataset:
- Create file in
src/data_module/dataset/ - Use
@register_dataset("name")decorator - Inherit from
torch.utils.data.Dataset - Implement
__init__,__len__,__getitem__
Creating a New Model
CRITICAL: Models use config-driven pattern
When adding a new model:
- Create file in
src/model_module/model/or appropriate module subdirectory - Use
@register_model('ModelName')decorator __init__accepts ONLYcfgparameter - all hyperparameters come from configforward()returns dict:{"loss": loss, "labels": labels, "logits": logits}- Handle training vs inference modes using
self.training
Adding Data Augmentation
When adding augmentation:
- Create file in
src/data_module/augmentation/ - Implement transformation function
- Register with factory if needed
Code Style Guidelines
For comprehensive style guidelines, refer to references/code_style.md.
Key principles:
- Always use type hints for function signatures
- Follow import order: standard library → third-party → local
- Module
__init__.pyfiles contain factory/registry logic - Model classes must be config-driven
Configuration Management
The project uses Hydra for configuration management:
- Config files in
run/conf/organize by module - Each stage (training, analysis) has its own config structure
- Use YAML files for all configuration
When Working on This Project
Before Modifying Code
- Read the relevant module's factory/registry pattern
- Check existing implementations for consistency
- Follow the established directory structure
- Use registration decorators for new components
Adding New Features
- Determine which module the feature belongs to
- Check if similar functionality exists
- Follow factory/registry pattern if creating new component types
- Add configuration files if needed
- Update documentation
Code Review Checklist
- [ ] Uses factory/registry pattern appropriately
- [ ] Follows module directory structure
- [ ] Has proper type annotations
- [ ] Imports are correctly ordered
- [ ] Registration decorator is used
- [ ] Configuration files are added if needed
Additional Resources
Reference Files
For detailed information, consult:
- `references/structure.md` - Detailed directory structure with file descriptions
- `references/factory_pattern.md` - Factory pattern in-depth explanation
- `references/registry_pattern.md` - Registry pattern in-depth explanation
- `references/auto_import.md` - Auto-import pattern in-depth explanation
- `references/code_style.md` - Comprehensive code style guidelines
Example Files
Working examples in examples/:
- `examples/custom_dataset.py` - Custom dataset implementation
- `examples/custom_model.py` - Custom model implementation
- `examples/augmentation_example.py` - Data augmentation example
- `examples/config_example.yaml` - Configuration file example
- `examples/pipeline_example.sh` - Pipeline script example
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/33-Galaxy-Dawn-claude-scholar/skills/architecture-design/SKILL.md
Popularity
- Repository stars
- 1,686
- Repository forks
- 251
- 7-day trend score
- 37
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/brycewang-stanford/auto-empirical-research-skills/architecture-design)