Skip to content

Commit f7e332b

Browse files
authored
docs: refresh local agent guidance (#71)
1 parent 20e277d commit f7e332b

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ CLI input
2424
- `hunk mcp serve` runs one loopback daemon that brokers agent commands to many live Hunk sessions. Normal Hunk sessions should auto-start and register with that daemon when MCP is enabled. Keep it local-only and session-brokered rather than opening per-TUI ports.
2525
- Agent rationale is optional sidecar JSON matched onto files/hunks.
2626
- The order of `files` in the sidecar is intentional. Hunk uses that order for the sidebar and main review stream.
27+
- Prefer one source of truth for each user-visible behavior. When rendering, navigation, scrolling, or note placement share the same model, derive them from the same planning layer rather than maintaining parallel implementations.
28+
- When UI behavior depends on derived structure or metrics, make that structure explicit in helper modules and reuse it across rendering and interaction code instead of re-deriving it ad hoc in multiple places.
29+
- If a new implementation makes an older path obsolete, remove the dead path instead of keeping two overlapping systems around.
2730

2831
## architectural rules
2932

@@ -40,6 +43,8 @@ CLI input
4043
- Pane rendering should live in dedicated components.
4144
- New UI work should extend existing components or add new ones, not grow `App` back into a monolith.
4245
- Shared formatting, ids, and small derivations belong in helper modules, not repeated inline.
46+
- Prefer one implementation path per feature instead of separate "old" and "new" codepaths that duplicate behavior.
47+
- When refactoring logic that spans helpers and UI components, add tests at the level where the user-visible behavior actually lives, not only at the lowest helper layer.
4348

4449
## review behavior
4550

@@ -50,7 +55,8 @@ CLI input
5055
- `[` and `]` navigate hunks across the full review stream. Do not reintroduce `j`/`k` hunk navigation unless the user asks.
5156
- Agent context belongs beside the code, not hidden in a separate mode or workflow.
5257
- Agent notes are hunk-specific: show notes for the selected hunk, render them in the diff flow near the annotated row, and keep a clear spatial relationship to the code they explain.
53-
- If you choose to use a local sidecar such as `.hunk/latest.json`, keep it concise and review-oriented: one changeset summary, file summaries in narrative order, and a few hunk-level annotations with real rationale.
58+
- Keep note behavior explicit. If the UI intentionally prioritizes one note, one selection, or one active target, encode that as a named policy rather than scattering array-index assumptions through the codebase.
59+
- If you choose to use a local sidecar for temporary review context, keep it concise and review-oriented: one changeset summary, file summaries in narrative order, and a few hunk-level annotations with real rationale.
5460
- If a local sidecar is present, its file order is intentional, but the visible note UI should stay hunk-note driven rather than showing generic file or changeset explainer cards.
5561
- If newly created files should appear in `hunk diff` before commit, use `git add -N <paths>` so they show up in the review stream without staging content.
5662

@@ -75,11 +81,12 @@ CLI input
7581
## verification
7682

7783
- For rendering changes: run `bun run typecheck`, `bun test`, `bun run test:tty-smoke`, and do one real TTY smoke run on an actual diff.
84+
- For interaction, layout, scrolling, navigation, or windowing changes: also add or update integration tests that exercise the user-visible behavior at the pane/app level.
7885
- For CLI, config, or pager work: make sure the relevant source invocation still works (`diff`, `show`, `patch`, or `pager`).
7986
- Preserve current interaction model unless the user asks to change it explicitly.
8087

8188
## repo notes
8289

83-
- `.hunk/latest.json` is ignored on purpose. Use it only if you want temporary local review context, and do not commit it.
90+
- Local review artifacts are ignored on purpose. Leave them alone unless the user explicitly wants them updated, and do not commit them.
8491
- Do not auto-commit after making changes. Leave edits uncommitted so the user can review them in `hunk`, and only commit when the user explicitly asks.
8592
- Keep this doc short and architectural. Fresh-context agents can discover file paths themselves.

0 commit comments

Comments
 (0)