From 4fb47a0379dfe160562c831d689e02b44af6c1f1 Mon Sep 17 00:00:00 2001 From: Rin Date: Sun, 15 Mar 2026 14:43:55 +0800 Subject: [PATCH] docs(AGENTS.md): use `errorMesageFrom` (#1372) --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 7a75faf1d..ed3c1f8d1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -90,6 +90,7 @@ Concise but detailed reference for contributors working across the `moeru-ai/air - Prefer functional patterns + DI (`injeca`) for testability. - Use Valibot for schema validation; keep schemas close to their consumers. - Use Eventa (`@moeru/eventa`) for structured IPC/RPC contracts where needed. +- Use `errorMessageFrom(error)` from `@moeru/std` to extract error messages instead of manual patterns like `error instanceof Error ? error.message : String(error)`. Pair with `?? 'fallback'` when a default is needed. - Do not add backward-compatibility guards. If extended support is required, write refactor docs and spin up another Codex or Claude Code instance via shell command to complete the implementation with clear instructions and the expected post-refactor shape. - If the refactor scope is small, do a progressive refactor step by step. - When modifying code, always check for opportunities to do small, minimal progressive refactors alongside the change.