From 1bb50a5fe162bdc81787adea14a9071e787d648c Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 21 Jul 2026 20:51:55 -0700 Subject: [PATCH] Update AGENTS.md --- AGENTS.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 1fd213f74..eb43f9119 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,19 +4,9 @@ All UI work — layout, color, typography, spacing, component selection, UX behavior — must follow [`docs/STYLEGUIDE.md`](./docs/STYLEGUIDE.md). Use the tokens defined in `src/renderer/src/assets/main.css` (the canonical source) and the shadcn primitives in `src/renderer/src/components/ui/`. Don't invent new color values, font sizes, or shadow tiers when a documented one already covers the role. When STYLEGUIDE.md is silent, follow the resolution order in its final section. -## Code Comments: Document the "Why", Briefly -When code is non-obvious, Add code comments explaining **why** (not HOW). BE CONCISE — ideally 1 line. - -```ts -// 🚫 Over-explained — narrates the crash, the mechanism, where the helper lives, and every caller: -// Why: Worktree.displayName is typed non-optional, but persisted/discovered worktrees have reached -// the UI with an undefined name (crash 99657ab1), which made a bare displayName.localeCompare(...) -// throw a TypeError and take down whatever was sorting them. Lives in lib so every worktree sort -// site (sidebar board, Cmd+J switcher, right-sidebar, add-repo telemetry) shares one guard. - -// ✅ Just the non-obvious constraint: -// Why: displayName is typed non-optional but arrives undefined at runtime (crash 99657ab1); coalesce so it can't throw. -``` +## Concise/Brief Non-obviosu code comments ONLY + * Only when code is non-obvious, add code comment explaining **why** (not HOW). + * BE CONCISE — ideally 1 line. ## Lint Rules: Do Not Disable Max Lines