Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

docs: prefer mature external libraries over reinventing them

leepokai7fdccb012b3d
diff --git a/AGENTS.md b/AGENTS.md
index c254b9e8..ebec7888 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -57,7 +57,7 @@ Name Swift files after their main `UpperCamelCase` type; use `snake_case.rs` and
## Clean code
-- Keep code modular and clean on every change: reuse before writing (existing code first, then a proven component/framework that already fits, see [prefer ready-made](docs/guides/clean-code.md#modules)), one responsibility per file/type, no new code appended to files past ~500 lines (split first), views/components hold no I/O or logic, short single-purpose functions, enums over flags, no dead code, no swallowed errors. Full rules: [docs/guides/clean-code.md](docs/guides/clean-code.md).
+- Keep code modular and clean on every change: reuse before writing (existing code first, then a mature, long-maintained external library over reinventing it, see [prefer ready-made](docs/guides/clean-code.md#modules)), one responsibility per file/type, no new code appended to files past ~500 lines (split first), views/components hold no I/O or logic, short single-purpose functions, enums over flags, no dead code, no swallowed errors. Full rules: [docs/guides/clean-code.md](docs/guides/clean-code.md).
- After every code change (tests green, before commit): review → fix, refactor and cleanup → end-to-end test. In Codex, use the [after-change skill](.agents/skills/after-change/SKILL.md); in Claude Code, use the `after-change` workflow: [after every change](docs/guides/clean-code.md#after-every-change-review-e2e-cleanup).
## Cross-platform UI changes
diff --git a/CLAUDE.md b/CLAUDE.md
index 6bb2506c..6102a1f9 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -16,7 +16,7 @@ Bot-based remote for coding agents: persistent named bots on your computer, mess
## Clean code
-- Keep code modular and clean on every change: reuse before writing (existing code first, then a proven component/framework that already fits, see [prefer ready-made](docs/guides/clean-code.md#modules)), one responsibility per file/type, no new code appended to files past ~500 lines (split first), views/components hold no I/O or logic, short single-purpose functions, enums over flags, no dead code, no swallowed errors. Full rules: [docs/guides/clean-code.md](docs/guides/clean-code.md).
+- Keep code modular and clean on every change: reuse before writing (existing code first, then a mature, long-maintained external library over reinventing it, see [prefer ready-made](docs/guides/clean-code.md#modules)), one responsibility per file/type, no new code appended to files past ~500 lines (split first), views/components hold no I/O or logic, short single-purpose functions, enums over flags, no dead code, no swallowed errors. Full rules: [docs/guides/clean-code.md](docs/guides/clean-code.md).
- After every code change (tests green, before commit): review → fix, refactor and cleanup → end-to-end test, by running the `after-change` workflow from the change's worktree; then merge into `dev`, and only after the merge is pushed stop its `npm run dev` and delete the worktree: [after every change](docs/guides/clean-code.md#after-every-change-review-e2e-cleanup).
## Architecture
diff --git a/docs/guides/clean-code.md b/docs/guides/clean-code.md
index e16d24c3..5aef91df 100644
--- a/docs/guides/clean-code.md
+++ b/docs/guides/clean-code.md
@@ -13,7 +13,7 @@ Rules every change follows, in every part of the repository (host, iOS, desktop,
- **One responsibility per file and per type.** If describing a file needs "and", it is two files. Name it after that responsibility, using the shared terms from file structure.
- **Don't grow a large file.** New behavior in a file past ~500 lines goes into a new sibling module (Rust submodule, Swift extension file, React component/hook), not appended to it. When a change already touches a large file, move the part you are changing out first, as its own `refactor` commit.
- **Layers stay in their lane.** Views render state and send intents; stores/models own state and logic; clients/transports own I/O. No networking, persistence or parsing in a SwiftUI view or React component. In the host, keep protocol parsing, decisions and side effects (db, process, network) apart so the decision part is a pure, unit-testable function. Across the apps, product logic lives in the host, not in any client: [host owns the logic](../architecture/overview.md#host-owns-the-logic).
-- **Prefer a ready-made component over hand-rolling.** Order: existing code here, platform framework, an already-installed dependency, then an approved library (desktop: Motion, dnd-kit). Skip one only when it breaks the platform look or a design rule here (shadcn/ui, Zustand and react-resizable-panels are not wanted on desktop). Add a new dependency only for a concrete need that beats the few hand-written lines.
+- **Prefer a ready-made component over hand-rolling; don't reinvent the wheel.** Order: existing code here, platform framework, an already-installed dependency, then a mature external library. Mature means long and well run: years of releases, wide use, still maintained (an official SDK, a de-facto standard crate or package). When one covers the need, use it instead of writing our own, above all for protocols and transports, parsers, crypto, retries and time handling, where a homegrown copy carries its bugs alone. Hand-write only glue a few lines long, or what no mature library covers. Skip one only when it breaks the platform look or a design rule here (shadcn/ui, Zustand and react-resizable-panels are not wanted on desktop).
- **Small public surface.** Default to `private`/`fileprivate`, `pub(crate)` or no export; widen only when another module needs it.
- **Dependencies point one way.** `CodyncKit` never imports `CodyncUI`; renderer code reaches the host only through `window.codync`; shared code never knows about a specific screen.