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.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
docs: require PostHog events for every new feature
leepokai9c6039568cc9
diff --git a/AGENTS.md b/AGENTS.mdindex ae6f8997..d1c175cb 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -59,6 +59,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 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).+- Every new feature or module adds its PostHog events in the same change (use, outcome, failure category; feature use only, never content), so bugs can be traced later: [adding a feature](docs/features/analytics.md#adding-a-feature).- After every code change of our own (tests green, before commit): review → fix, refactor and cleanup → end-to-end test (issues and PRs from other people follow the issue and PR review below instead). 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 changesdiff --git a/CLAUDE.md b/CLAUDE.mdindex 38888af3..e99b5d9e 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -36,7 +36,7 @@ Bot-based remote for coding agents: persistent named bots on your computer, mess- Environments: `iOS Dev` / desktop `dist:*:dev` use the isolated Codync Dev app; `iOS` / `dist:*:main` retain production identities. Stop only the variant being rebuilt. Resource map, signing and diagnostics: [Dev app isolation](docs/guides/dev-app.md). Local secrets: git-ignored `.env.development` / `.env.production` at the root, templates `.env.<env>.example` ([local secrets](docs/guides/dev-app.md#local-secrets)).- Push: iOS registers its APNs token with `relay/` → gets an AES-GCM ticket → gives it (plus its X25519 push key) to the host; the host seals title/body to that key and a Notification Service Extension opens it, so `relay/` sees only generic text. Alert kinds: *needs you*, *done*, and *failed*, suppressed while the iOS app is connected. Delivery and lifecycle: [notification design](docs/design/push-and-live-activity.md).- Voice call (iPhone, desktop): on-device speech (macOS desktop: the `codync-speech` helper), or OpenAI / Gemini realtime on the user's own key (kept in the host's vault, which mints per-call credentials; audio goes device ↔ provider); the host sees plain messages. Grok-style call bar: [docs/features/voice-call.md](docs/features/voice-call.md).-- Analytics: PostHog, on by default (off in each device's Settings), feature use only (never content); host events come from `api::dispatch`: [docs/features/analytics.md](docs/features/analytics.md).+- Analytics: PostHog, on by default (off in each device's Settings), feature use only (never content); host events come from `api::dispatch`: [docs/features/analytics.md](docs/features/analytics.md). **Every new feature or module adds its PostHog events in the same change** (use, outcome, failure category), so bugs can be traced later: [adding a feature](docs/features/analytics.md#adding-a-feature).- Usage: read from the agents on the computer — Claude's `claude -p /usage --no-session-persistence`, the status line (`codync-host statusline`, wrapping any existing one), Claude ACP `usage_update`, the Codex CLI's `account/rateLimits/read` (`codex app-server`, no turn), and the other agents' local commands, databases and IDE files. Cursor is the one provider call: the token Cursor saved, then its dashboard service (unified plans) or `cursor.com/api/usage-summary`. Never call any other provider API with agent credentials.- The desktop app is thin: the Mac build bundles `codync-host` in `Contents/Resources` (Linux uses the installed host) and installs it as a launchd/systemd agent via `codync-host install`; the menu bar/tray shows status/pairing/usage and opens the chat window. Not sandboxed, not Mac App Store (the host must spawn CLIs).diff --git a/docs/features/analytics.md b/docs/features/analytics.mdindex 12735cbc..a1d8d7e8 100644--- a/docs/features/analytics.md+++ b/docs/features/analytics.md@@ -45,6 +45,23 @@ UI: *About usage analytics…*) shows the same promise in the app, in one text p- `env` is `main` or `dev`; filter dev out in PostHog. Debug host builds (`cargo test`, `cargo run`)send nothing: every e2e test starts a fresh host that would count as a new user.+## Adding a feature++Every new feature or module ships with its PostHog events in the same change, so a later bug+can be traced from the events around it:++- **Use**: an event when it is used. A host method gets it from `api::dispatch`+ (`analytics::observe_call` in `analytics/observe.rs`); an app-only action from its client+ (`track` on the desktop and terminal UI, added to `analytics::Reported`; the analytics client+ on the iPhone and Android, both alike).+- **Outcome**: how it ended, as `turn_finished` does: `outcome` (`done`, `failed`, …) and, for a+ failure, its category in `error`. Never the error's message.+- **Errors**: failures that should never happen go to *Error tracking* below (`reportError` on+ the host, desktop and terminal UI); crashes are already caught.+- The *Rules* above apply: feature use only, never content. List each new event and property in+ [analytics events](../reference/analytics-events.md), and check they arrive in PostHog+ (`env = dev`) during the change's e2e test.+## Where events come from- **Host** (`host/src/analytics.rs`, `analytics/`): `api::dispatch` maps successful API calls to