Update AGENTS.md

This commit is contained in:
Neil 2026-07-21 20:51:55 -07:00 committed by GitHub
parent b232df732b
commit 1bb50a5fe1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 13 deletions

View File

@ -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