AI coding agent skills for designing and developing agent-based models (ABM) with the Melodie framework and tab2dict data management library.
skills_cn/ (or skills_en/)
├── melodie-design/ # Model design skill
│ ├── SKILL.md # Skill entry point — structured design dialogue
│ └── design-template.md # README.md template for design documents
├── melodie-develop/ # Model development skill
│ └── SKILL.md # Skill entry point — code generation workflow
└── melodie-reference/ # Shared reference docs (loaded by both skills)
├── melodie-framework.md # Core architecture and API reference
├── melodie-quickref.md # Compact API cheat sheet
├── melodie-code-templates.md # Boilerplate code templates
├── melodie-data-guide.md # Input data file format guide
├── tab2dict-guide.md # TabKey / TabDict usage guide
├── abm-suitability.md # When (not) to use ABM
├── abm-agent-design.md # Agent design patterns
├── change-impact.md # Change impact analysis matrices
└── modules/
├── module-grid.md # Grid (2D space) module
├── module-network.md # Network (graph) module
├── module-calibrator.md # Calibrator (parameter tuning)
└── module-trainer.md # Trainer (agent behavior evolution)
Guides a structured conversation to help the user design an ABM:
- Phase 0 — Evaluates whether ABM is the right approach for the research question
- Phase A — Collects requirements through a systematic checklist (agents, interactions, decisions, scenarios, data, etc.)
- Phase B — Generates a
README.mddesign document from a template
Takes a README.md design document and turns it into a working Melodie project:
- Reads the design doc, plans the implementation, generates project structure and code
- Creates input data files with correct formats
- Runs the model, handles errors, and reports results
Not invoked directly. Both skills load these documents as needed for API details, code patterns, and domain knowledge.
1. Install the skills — copy the skill files into your project's .claude/skills/ directory.
2. Design your model — start Claude Code in your project directory and run:
/melodie-design I want to simulate how a carbon tax affects household energy choices
This opens a structured conversation where the AI walks you through research question validation, agent design, interaction mechanisms, and scenario setup. At the end it produces a README.md design document in your project root.
You can also run /melodie-design with no arguments for a fully guided start.
3. Develop your model — once the design document is ready, run:
/melodie-develop go
The AI reads the design doc, generates the full project structure (agents, environment, data collectors, scenario parameters, input data files), runs the model, and fixes errors until it works.
To modify an existing model, describe what you want to change:
/melodie-develop add a network module so agents interact with neighbors
The skills are plain Markdown files with no Claude Code-specific logic. Copy the skills_en/ (or skills_cn/) directory into your project and point your agent to the relevant SKILL.md file as a system prompt or instruction set.
If you use this project in your research, please cite:
Yu, S., & Hou, Z. (2023). Melodie: Agent-based modeling in python. Journal of Open Source Software, 8(83), 5100.
@article{yu2023melodie,
title={Melodie: Agent-based modeling in python},
author={Yu, Songmin and Hou, Zhanyi},
journal={Journal of Open Source Software},
volume={8},
number={83},
pages={5100},
year={2023}
}Yu, S. (2022). An agent-based framework for policy simulation: modeling heterogeneous behaviors with modified sigmoid function and evolutionary training. IEEE Transactions on Computational Social Systems, 10(4), 1901-1913.
@article{yu2022agent,
title={An agent-based framework for policy simulation: modeling heterogeneous behaviors with modified sigmoid function and evolutionary training},
author={Yu, Songmin},
journal={IEEE Transactions on Computational Social Systems},
volume={10},
number={4},
pages={1901--1913},
year={2022},
publisher={IEEE}
}MIT