An open-source, faster Devin alternative
TypeScript
Calvin (package name still slack-presence)
Claude Code (Agent SDK) driven live from Slack. Start with README.md; it has the terminal→Slack mapping, setup, deployment shapes and file layout.
npm run checkbefore every push:tsc,biome lint,vitest run, the file-size ratchet. CI runs the same on every PR, andmaindeploys only after it passes.- Fast loop without Slack:
npx tsx src/dev/fake-run.ts "<prompt>" ["<steer>"](real Claude, fake Slack client that prints every API call). The othersrc/dev/*-check.tsare integration checks, run by hand (README "Development"). - Secrets live in gitignored
.env; never commit it,state.json, orworkspaces/. - Design notes live outside this repository; comments cite them as "work NNN". The code-structure plan is work 050.
Code conventions
These exist to keep the repository splittable as it grows; the file-size
ratchet (scripts/max-lines.mjs) enforces the first one mechanically.
- One concept per file, and a header comment that says what the file owns
and its invariants (
runner/segment.ts,runner/agents.ts,ipc.tsare the template). A file over 400 lines is a signal to split by concept, over 600 failscheck. Never raise the limit; shrink the file. - Unit tests sit next to the code as
<file>.test.ts, and test the pure parts (rendering state, parsing, routing against fakes). Every bug fix adds a unit test where one can express it, otherwise extends a dev check. src/protocol.tsis the only thing two processes share at runtime. Changing it means: keep oldtvalues readable, bumpPROTOCOL_VERSIONwhen a field's meaning changes, and keep the backend's gateway side (its copy of the protocol in managed-agents) in step.anyonly at the edge. Untyped SDK events and Slack payloads are cast once where they enter; the rest of the code works on named types. Biome warns on everyany; the count must not grow.- Environment variables are read where a process starts (
main.tsof gateway, host, runner) and passed down, not read ad hoc in modules. New variables are documented in the README tables. - Slack calls go through one place per process (today
SessionandSegment; aSlackThreadhelper is 050 phase 2), so a fake client covers everything andthread_tshandling is written once. - No behaviour change in a refactor PR. Move code, add tests, then change behaviour in a separate PR, so each is reviewable on its own.