AGENTS.md
Guidelines for AI agents working in this Advent of Code repository.
Project Overview
Gleam-based Advent of Code solutions with two parallel implementation tracks (mine/ and llm/) for comparing human vs LLM-generated solutions side-by-side with benchmarking.
Commands
$ gleam build # Compile the project
$ gleam test # Run all tests
$ gleam run # Run all available days with comparison (default)
$ gleam run -- <day> # Run specific day with comparison
$ gleam run -- -e # Run with example input (--example)
$ gleam run -- <day> -n # Run without comparison, mine/ only (--no-compare)
$ gleam run -- 1 -en # Flags can be combined
Code Organization
src/
├── aoc.gleam # CLI entry point, argument parsing, day dispatch
├── compare.gleam # Benchmarking harness for mine/ vs llm/ comparison
├── utils.gleam # Input file reading utilities
└── internal/
├── mine/ # Human-written solutions
└── llm/ # LLM-generated solutions
input/
├── dayXX.txt # Real puzzle input
└── dayXX_example.txt # Example input from problem description
test/
└── aoc_test.gleam # Tests for both implementations
Documentation
When making changes that affect CLI usage, project structure, or workflows, update the relevant documentation (this file and README.md) to reflect those changes.
Adding a New Day
- Create
src/internal/mine/dayXX.gleamwithpub fn part1(input: List(String)) -> Intandpub fn part2(input: List(String)) -> Intand bodies of justtodo. - Create
src/internal/llm/dayXX.gleamwith the same interface. Make sure to include the//// Authored-by: [Model] via Crushheader that you're told to use for commits. - Ask the user to paste the input for
input/dayXX_example.txt, then download the contents ofhttps://adventofcode.com/2025/day/XX/inputtoinput/dayXX.txt. - Wire up dispatch in
src/aoc.gleam:- Add import:
import internal/mine/dayXX as mine_dayXX - Add case to
run_parts
- Add import:
- Wire up comparison in
src/compare.gleam:- Add imports for both implementations
- Add
pub fn dayXX(input: List(String)) -> Nilfunction - Add case to
run_comparisonin aoc.gleam
- Add the day number to
available_daysinsrc/aoc.gleam - Add tests in
test/aoc_test.gleam
Conventions
- Naming:
mine_dayXXandllm_dayXXfor imports to distinguish implementations - Types: Define custom types for domain concepts (Movement, Rotation, etc.)
- Constants: Use module-level
constfor magic numbers (e.g.,const starting_position = 50) - Pipeline style: Heavy use of
|>operator for data transformation