Skip to content

Commit 8fe69ef

Browse files
claudewilliamdemeo
authored andcommitted
CONTRIBUTING: document single-module Agda type-checking via the Nix dev shell
Adds a short "Type-checking while you work" subsection: enter `nix develop` and run `agda <file>` (or `nix develop --command agda <file>`) to type-check a single module — much faster than `nix build` for iterating on a proof — plus a direnv tip to put the toolchain on PATH and launch your editor/agent tooling from that shell. This is the lightweight, no-repo-machinery alternative to a SessionStart hook (see #1220). https://claude.ai/code/session_0174ZBS1RKAGSbBXDsESUwoA
1 parent de2fdf1 commit 8fe69ef

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,35 @@ code block with the standard HTML comment delimiters. For example,
373373

374374
See also: [the Agda documentation section on literate markdown][Agda literate markdown].
375375

376+
### Type-checking while you work
377+
378+
The specification is type-checked through the Nix flake, which pins the Agda version
379+
and all required libraries — there is no separate global Agda install to maintain. For
380+
day-to-day work, enter the development shell once and run Agda from there, so the
381+
toolchain is on your `PATH` for your editor and any other tooling:
382+
383+
```bash
384+
nix develop # Agda + libraries on PATH
385+
agda src/Ledger/Dijkstra/Specification/Ledger.lagda.md # type-check one module
386+
```
387+
388+
Type-checking a single module is much faster than `nix build` (which checks the whole
389+
specification) and is the quickest way to iterate on a proof. To check one module
390+
without staying in the shell:
391+
392+
```bash
393+
nix develop --command agda src/Path/To/Module.lagda.md
394+
```
395+
396+
If you use [direnv](https://direnv.net), add `use flake` to a `.envrc` and run `direnv
397+
allow`; the toolchain is then placed on your `PATH` automatically whenever you enter the
398+
project directory. Launching your editor — and any agent tooling, such as Claude Code —
399+
from that shell makes Agda available to all of it, which is cheaper than re-entering
400+
`nix develop` for each invocation.
401+
402+
Generated artifacts (`*.agdai`, `Everything*.agda`, `_build/`, `/.agda/`) are
403+
git-ignored; don't commit them.
404+
376405
### Checking how your code looks on the site
377406

378407
An important step in contributing any code to the repository is to check how it will

0 commit comments

Comments
 (0)