There are two different jobs people do in this repo. Keep them separate:
- Developing
mainlineitself- you are changing the
mainlinecodebase in this checkout - the local baseline is
make build,go test ./..., and CLI help / repo-root inspection mainline.tomlin this repo is committed policy, not proof that a fresh clone is already initialized as a managed queue target
- you are changing the
- Using
mainlineon some other repo- you are in a target repo that
mqshould manage - that repo needs its own
mq repo init, committedmainline.toml, and repo-local state under.git/mainline/
- you are in a target repo that
For a fresh clone of this source repo, start with:
make build
go test ./...
./bin/mq --help
./bin/mq repo show --repo . --json
./bin/mq repo root --repo . --json
./bin/mq status --repo . --jsonInterpretation:
- build should succeed
- tests should succeed even if your normal global Git config enforces commit signing; the test helpers neutralize global signing for temp repos
mq repo root --repo . --jsontells you whether the current checkout is the canonical protected root checkoutmq status --repo . --jsonmay fail in a fresh source clone until this repo is explicitly initialized as a managed target repo on that machine
If you want the repo-local orientation flow encoded for an agent, use the onboarding skill at .agents/skills/onboarding/SKILL.md. Use that before the worktree skill. The onboarding skill is for first-pass setup and terminology; the worktree skill is for the contribution flow after that baseline is already understood.
- Go 1.25 or newer
- run
make fmt,make lint,make test, andmake buildbefore sending changes - run
make sqlcafter editinginternal/state/sql/schema.sqlorinternal/state/sql/query.sql - if you change
internal/state/migrations/, keepinternal/state/sql/schema.sqlin sync with the post-migration schema snapshot before regenerating sqlc - run
make install-hooksonce per clone so local commit and push gates mirror CI - keep edits ASCII unless the file already requires Unicode
- treat
mainas protected - keep the repo root checkout clean on
main; that is the canonical protected checkout humans inspect and wrappers build from - do feature work in a dedicated topic worktree
- initialize new clones with
mq repo init, commitmainline.toml, and run./scripts/install-hooks.sh - most agents should finish from a topic worktree with
mq submit --check-only --jsonandmq submit --wait --timeout 15m --json - controller agents should prefer
mq land --json --timeout 30m - land through
mqinstead of manual merge-on-main when possible - do not hand-edit SQLite state
When the command surface changes, update:
README.mdPLAN.mdorSPEC.mdif the operating model changed- flow or install docs under
docs/if operator behavior changed AGENTS.mdand repo-local skills if agent workflow changeddocs/JSON_CONTRACTS.mdplus contract tests if machine-readable output changed
Prefer end-to-end command tests for user-facing workflow changes. This repo’s core promise is operational correctness across Git worktrees, state, and worker coordination, so command-level coverage matters more than isolated helper tests alone.