- Model control flow in a Rust-y style using
Option/Resultpatterns. - Prefer explicit
Option/Resultreturns and propagation over throwing errors. - Use thrown exceptions only when there is no practical typed alternative.
- Do not add explicit
Promise<void>return annotations on async functions.
- Keep privileged calls in direct user-gesture handlers on the synchronous path.
- Do not place
awaitbefore gesture-gated APIs such asbrowser.sidePanel.open, permission prompts, tab/window open calls, or similar browser APIs. - If additional async work is needed, perform the privileged call first, then run follow-up work (e.g. with
voidfire-and-forget or after the gated call completes).
- Before asking permission to edit files, show a proper unified diff (readable delta) of intended changes.
- Do not present edit intent only as Perl/sed regex commands; include the readable delta first.
- Run
just fmtto format code. - Run
just lintbefore committing. Commits must not be made with lint failures.