This project solves Advent of Code problems in Python and JavaScript.
- Structure: Year-centric (
<YEAR>/<DAY_NN>), withpython/andjavascript/subfolders. - Solution Interface: Implement
part1(input: str)andpart2(input: str)functions. - Input: Solutions receive raw file content as a string.
| Feature | Python | JavaScript |
|---|---|---|
| Language | Python 3.14+ | Node.js (LTS) |
| Package Mgr | uv (pyproject.toml) |
pnpm (package.json) |
| Test Runner | pytest |
jest |
| Code Quality | flake8, black, mypy |
eslint, prettier |
Test runners prioritize test_data.json over example_*.txt files.
test_data.json: For multiple, small, single-line examples.- JSON format:
{ "part1": [{ "input": "...", "expected": "..." }], "part2": [...] }
- JSON format:
example_*.txt: For larger, multi-line inputs.- Format: Input data, then
---, thenPart 1: <answer>andPart 2: <answer>.
- Format: Input data, then
- Setup:
pnpm install(installs all JS and Python dependencies). - Scaffold:
pnpm scaffold <YEAR> <DAY> - Run Solution:
pnpm run:py <YEAR> <DAY>pnpm run:js <YEAR> <DAY>pnpm run:py:watch <YEAR> <DAY>pnpm run:js:watch <YEAR> <DAY>- Runners execute tests first. Solution runs only if tests pass.
- Test:
pnpm test - Validate Agent Work:
- Run
pnpm test. - Run
pnpm run:js 2015 1andpnpm run:py 2015 1. - Update
GEMINI.mdwith any relevant details.
- Run
- All shell commands must be wrapped with a
timeout 30sto prevent hangs.- Example:
timeout 30s <command_to_run>
- Example: