apache/hamilton/core
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Core Hamilton patterns for creating DAGs, applying decorators, testing, and debugging dataflows. Use for basic Hamilton development tasks.
Install
npx vskill@latest install apache/hamilton/coreSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Hamilton Core Development Assistant
Apache Hamilton is a lightweight Python framework for building Directed Acyclic Graphs (DAGs) of data transformations using declarative, function-based definitions.
Core Principles
Function-Based DAG Definition
- Functions with type hints define nodes in the DAG
- Function parameters automatically create edges (dependencies)
- Function names become node names in the DAG
- Pure functions enable easy testing and reusability
Key Architecture Components
- Functions: Define transformations with parameters as dependencies
- Driver: Builds and manages DAG execution (
.execute()runs the DAG) - FunctionGraph: Internal DAG representation
- Function Modifiers: Decorators that modify DAG behavior
- Adapters: Result formatters and lifecycle hooks
Separation of Concerns
- Definition layer: Pure Python functions (testable, reusable)
- Execution layer: Driver configuration (where/how to run)
- Observation layer: Monitoring, lineage, caching
Common Tasks
1. Creating New Hamilton Modules
Basic Module Structure:
Driver Setup:
Best Practices:
- ✅ Add type hints to ALL function signatures
- ✅ Write clear docstrings with :param and :return
- ✅ Keep functions pure (no side effects)
- ✅ Name functions after the output they produce
- ✅ Use function parameters for dependencies (not globals)
- ✅ Create unit tests for each function
- ❌ Don't use classes unless needed (functions are preferred)
- ❌ Don't mutate inputs (return new objects)
2. Applying Function Modifiers (Decorators)
Configuration & Polymorphism:
Parameterization - Creating Multiple Nodes:
Column Extraction - DataFrames to Series:
Data Quality Validation:
I/O Materialization:
3. Converting Existing Code to Hamilton
Before (Script):
After (Hamilton Module):
Conversion Guidelines:
- Identify distinct computation steps
- Extract each step into a pure function
- Use previous step's variable name as function parameter
- Add type hints and docstrings
- Remove imperative variable assignments
- Test each function independently
4. Visualizing & Understanding DAGs
Generate Visualization:
Understanding DAG Structure:
- Each function becomes a node
- Function parameters create directed edges
- No cycles allowed (DAG = Directed Acyclic Graph)
- Execution order determined by dependencies
- Multiple paths execute in parallel when possible
Debugging Tips:
- Check for circular dependencies (A depends on B depends on A)
- Verify all parameter names match existing function names
- Look for typos in parameter names
- Use
dr.list_available_variables()to see all nodes - Check
dr.what_is_downstream_of('node_name')for dependencies
5. Testing Hamilton Functions
Unit Testing Pattern:
Integration Testing with Driver:
Common Pitfalls & Solutions
Circular Dependencies:
Missing Type Hints:
Mutating Inputs:
Key Files & Locations
- Core library:
hamilton/- Main package code - Driver:
hamilton/driver.py- Main orchestration class - Function modifiers:
hamilton/function_modifiers/- Decorators - Examples:
examples/- Production examples - Tests:
tests/- Unit and integration tests - Docs:
docs/- Official documentation
Getting Help
- Documentation:
docs/directory in repo - Examples:
examples/directory for patterns - Community: Apache Hamilton Slack, GitHub issues
- Other Skills: Use
/hamilton-scalefor async/Spark,/hamilton-llmfor AI workflows
Additional Resources
For detailed reference material, see:
- Apache Hamilton official docs at hamilton.apache.org
- Apache Hamilton GitHub repository examples folder
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.claude-plugin/skills/core/SKILL.md
Popularity
- Repository stars
- 2,546
- Repository forks
- 198
- 7-day trend score
- 39
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
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/apache/hamilton/core)