A Screeps AI in TypeScript, built on screeps-typescript-starter.
The bot is being rebuilt from scratch (July 2026). src/main.ts is reset to the
starter kit's default loop (error-mapped, cleans dead-creep memory); the previous bot is preserved
on the backup/pre-rebuild-2026-07-19 branch. What remains on main is the infrastructure: build +
deploy pipeline, unit/integration test harness, and a headless real-engine simulator.
- Build:
@rollup/plugin-typescriptbundles src/main.ts →dist/main.js, targetinges2024(Screeps servers run Node 24). - Error mapping: src/utils/ErrorMapper.ts (from the starter kit) maps runtime stack traces back to TypeScript source via source maps.
- Deploy:
rollup-plugin-screepsuploads to targets defined inscreeps.json(see rollup.config.js and the deploy / deploy_private wrappers). - Unit/integration tests: mocha + chai with mocked Screeps globals (test/helpers). Fast, host-side, pure logic.
- Headless sim: bin/sim runs the real bundled bot in the real Screeps engine (Node 24, in Docker) over many ticks — see sim/README.md. Starting world states live in sim/scenarios; behavioral regression tests in sim/tests.
npm run build # bundle src/main.ts -> dist/main.js
npm run test # unit + integration suites (mocha, host-side mocks)
npm run lint # eslint (see Validation Notes — currently blocked by toolchain)
npm run push-main # upload using the `main` target in screeps.json
npm run privateServer
npm run watch-main
bin/sim run [ticks] # watch the real bot in the real engine, headless
bin/sim test # behavioral regression tests in the real engine- Install dependencies with
npm install(Node >= 24). - Copy screeps.sample.json to
screeps.json. - Fill in Screeps credentials or server host settings.
- For private-server deploys, set
SCREEPS_LOCAL_PATHif the default local client path is wrong.
npm run buildis the reliable baseline check.npm run testruns the unit + integration suites (placeholder harness tests until the new bot has logic to cover).npm run lintis currently broken repo-wide withInvalid value for lib provided: es2024— the installed@typescript-eslintparser predateses2024and fails to parse every file. This is pre-existing toolchain debt; build and tests are the working gates.
- CLAUDE.md: start-here guide for contributors and agents.
- docs/agents/SCREEPS_PRIMER.md: Screeps rules that shape any bot.
- sim/README.md: the headless simulator, in depth.
docs/getting-started,docs/in-depth,docs/screeps-api: generic starter and API references inherited from the template.