From c32593c07c09bf4a49b2cdd317f3576739e83ecc Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Tue, 25 Aug 2026 04:35:39 -0700 Subject: [PATCH] docs(AGENTS): add code-reuse guidance and verification commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add "Reuse Before Reimplementing" section guiding developers to check for existing implementations before writing new code - Add "Verifying Changes" section with quick reference for typecheck, test, and lint commands - Fix typo: "Non-obviosu" → "Non-obvious" --- AGENTS.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 292dcc64ed3..307c975d219 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,7 +7,11 @@ All UI work — layout, color, typography, spacing, component selection, UX beha Use the `$electron` skill and Playwright CDP for rendered Orca UI checks. Do not use computer-use for Orca UI validation. # Style -## Concise/Brief Non-obviosu comments ONLY +## Reuse Before Reimplementing + +Before writing new logic at any scale — a function, component, IPC channel, state store, or whole subsystem/flow — check whether an existing implementation already does the job (or nearly does). Extend or generalize it instead of building a parallel version; only write from scratch when nothing fits. Keep the check proportionate: a quick search for trivial code, a real one before building anything substantial. + +## Concise/Brief Non-obvious Comments ONLY * DO NOT: be verbose, explain the obvious, walk through the code ("WHY not HOW") * BE CONCISE. 1 LINE if possible @@ -21,6 +25,12 @@ Never use vague names like `helpers`, `utils`, `common`, `misc`, or `shared-stuf ## Type Declarations: Prefer `.ts` Over `.d.ts` +# Verifying Changes + +- **Typecheck**: `pnpm tc` (or `tc:node` / `tc:cli` / `tc:web`) +- **Test**: `pnpm test [path/to/file.test.ts]` +- **Lint**: `oxlint`, or `pnpm run check:code-quality:changed` for changed files (full `pnpm lint` is slow); format with `pnpm format` + # Considerations ## Worktree Safety