This file contains project guidelines and context that AI coding agents should follow when working on this codebase.
Project Name: Morphogenesis
Language: Ruby
Goal: Explore morphogenesis through cellular automata using object-oriented design principles.
The project is inspired by the following research papers:
CA-NEAT: Evolved Compositional Pattern Producing Networks for Cellular Automata Morphogenesis and Replication
(Amos et al., GECCO 2018)
ARC-NCA: Towards Developmental Solutions to the Abstraction and Reasoning Corpus
(TBD et al., May 2025)
A key concept explored in this project is the French Flag Problem.
-
Object-Oriented Design
Use modular classes for cells, grids, patterns, and evolutionary operators. -
Extensibility
Make it easy to add new automaton rules, fitness metrics, and mutation strategies. -
Test-Driven Development
Write comprehensive tests using RSpec following BDD principles.
.
├── lib/ # Ruby source files
├── spec/ # RSpec test files
├── AGENTS.md # AI agent directives (this file)
└── README.md # Project overview and usage instructions
- Use StandardRB for code formatting and style enforcement.
- Run
bundle exec standardrbto check for style issues. - Run
bundle exec standardrb --fixto auto-fix issues before committing. - Always use double quotes for strings in Ruby code.
- Add an empty line at the end of each file.
- Wrap lines in Markdown and plain text files at a maximum width of 100 characters.
- Use
RSpec.describefor top-level example groups. - Use
letandlet!to define test data and memoize it across examples. - Use the
expect(...).tosyntax for assertions. - Always use parentheses with
eq:expect(...).to eq(value). - Use
aggregate_failureswhen grouping multiple related expectations in one example. - Run tests with
bundle exec rspec.
- Commit early and often with clear, descriptive messages.
- Ensure all style checks and tests pass before committing.
When making changes to this project:
- Understand the context by reading relevant tests and implementation files.
- Make minimal changes - only modify what's necessary to accomplish the task.
- Write tests first or ensure existing tests cover your changes.
- Run tests frequently to catch issues early.
- Follow the existing code style and patterns used in the project.
- Update documentation if your changes affect the public API or behavior.
This file provides guidance for AI coding agents. Keep it updated as project conventions evolve.