hunk

Review-first terminal diff viewer built for reading agent-authored changesets.

Documents a shared review seam as two ASCII data flows, then forbids re-deriving it in a renderer.

Documents


├── .changeset
│   └── 
├── docs
│   ├── 
│   ├── 
│   ├── 
│   ├── 
│   ├── 
│   └── 
├── packages
│   └── hunk
│       └── skills
│           ├── hunk-extensions
│           │   └── 
│           └── hunk-review
│               └── 
├── skills
│   └── hunk-release
│       └── 
├── test
│   └── 
├── 
└── 

The file, explained

What makes it useful

Organized around one constraint: several surfaces share review semantics and none may reimplement them. Also carries a verification section that maps each kind of change to its specific test command, and a naming section defining three words.

Techniques in this file

Quoted passages are verbatim. Open one to see it in the source.

01 / Architecture as narrative

The seam drawn as a pipeline

Two ASCII flows show how a diff becomes a review document and how an intent becomes a surface projection. Each stage names the module that owns it and the facts a renderer is to consume rather than recompute.

Source excerpt starting at line 49.
  parity manifests. Consume them; never re-derive those facts in a renderer.

02 / Ratchets

Shrink-only baselines and append-only tombstones

The known-violations baseline may only shrink and the tombstone lists may only grow. Paying off a violation has a defined sequence: delete the copies, add a tombstone and an adversarial fixture, register the consumers, update the audit document.

Source excerpt starting at line 104.
  explicit `@hunk/vcs/*` leaves. The known-violations baseline is shrink-only: fix an edge, rerun  `bun run deps:baseline`, and never add to it.

03 / Verification by change type

Checks selected by kind of change

Rendering changes take a typecheck, tests, integration, TTY smoke and one real terminal run. Interaction and scrolling changes take PTY coverage. Broker changes take the Node adapter suite. The section also states which four suites the default test command excludes.

Source excerpt starting at line 149.
- `bun run test` does not include review conformance, PTY, TTY smoke, or real-Node adapter  conformance under `test/session-broker-node/`. Run the dedicated command documented in

04 / House vocabulary

A stated voice for comments

Header comments are written in active voice and lead with what the module does. Two phrasings are named as the ones to avoid, both of which describe the architecture's opinion of itself rather than its behavior.

Source excerpt starting at line 158.
  invariants. Avoid passive or self-important framing ("The one place where…", "the single  source of truth for…") — name the behavior, not the architecture's opinion of itself.

05 / House vocabulary

Three words defined

layout for structural arrangement, geometry for aggregate spatial data, bounds for one concrete visible extent. Three definitions that settle naming for everything in that area.

06 / Generated file guards

Generated files named with their generators

The agent-facing skill document, the theme colors, the changelog page and the session wire fixtures are each identified as generated, with the source to edit and the command to run. One of them requires a protocol version bump and deleting the previous fixture in the same change.

Put it to work

Borrow this for your repo

  1. If several surfaces share semantics, draw the pipeline and name the owner of each stage.
  2. Give every known-violations baseline a stated direction of travel, and enforce it in CI.
  3. If your default test command excludes suites, say which ones. Agents run the obvious command.
  4. Define the three or four words your domain keeps arguing about.

How the file is organized

  1. 01purpose
  2. 02architecture and workspace map
  3. 03shared review seam
  4. 04architectural rules
  5. 05component guidance
  6. 06theme guidance
  7. 07testing
  8. 08code comments
  9. 09naming
  10. 10review behavior
  11. 11verification
  12. 12cross-platform support
  13. 13releases
Read this revision on GitHub ↗

Context your AGENTS.md cannot carry

hunk's file tells an agent how the codebase works. It cannot tell it which bug three customers hit this week. Modem keeps that context current and attaches it to the work.

Try Modem