# Documentation Start with [CONTRIBUTING.md](../CONTRIBUTING.md) for your first contribution. The [中文快速指引](contributing.zh-CN.md) summarizes the same workflow in Chinese. [maintaining.md](maintaining.md) covers triage, review, the `dev`/`main` transition, and release preparation. ## Where to change things The React renderer talks to a local Fastify daemon over HTTP and SSE. The daemon owns Pi sessions, workspaces, assets, previews, and publishing. Electron owns desktop lifecycle and native game windows; shared modules define contracts. | Area | Code to start with | Read first | Example tests | | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | Agent, chat, and model requests | `src/daemon/agent.ts`, `src/daemon/pi-agent.ts`, `src/daemon/agent-prompts.ts`, `src/daemon/agent-instructions.ts`, `src/renderer/agent-instructions-settings.tsx`, `src/renderer/conversation-instructions-dialog.tsx`, `src/daemon/session-images.ts`, `src/renderer/agent-timeline.tsx`, `src/renderer/image-viewer.tsx` | [Runtime](runtime.md), [agent instructions](runtime.md#agent-instructions), [agent errors](agent-errors.md), [image history](model-image-history.md) | `test/agent.test.ts`, `test/agent-errors.test.ts`, `test/session-images.test.ts`, `test/agent-instructions.test.ts` | | Design and Asset Canvas | `src/daemon/canvas-workspace.ts`, `src/daemon/canvas-routes.ts`, `src/daemon/canvas-edit.ts`, `src/daemon/canvas-agent-tools.ts`, `src/renderer/canvas-workspace.tsx`, `src/renderer/canvas-editor-v2.tsx`, `src/renderer/canvas-board-store.ts`, `src/renderer/canvas-node-registry.tsx`, `src/renderer/canvas-generation.ts`, `src/renderer/canvas-generation-nodes.tsx`, `src/renderer/canvas-content.ts`, `src/renderer/canvas-content-nodes.tsx`, `src/renderer/canvas-menus.tsx`, `src/renderer/canvas-file-import.ts`, `src/renderer/canvas-node-flow.ts`, `src/renderer/design-document-panel.tsx`, `src/renderer/asset-canvas-nodes.tsx`, `src/shared/canvas-workspace.ts`, `src/shared/canvas-core/ops.ts`, `src/shared/canvas-core/references.ts` | [Canvas file contract](canvas-agent.md) | `test/canvas-api.test.ts`, `test/canvas-core.test.ts`, `test/canvas-board-store.test.ts`, `test/canvas-editor-v2.test.tsx`, `test/asset-canvas-document.test.ts`, `test/canvas-table.test.ts` | | Preview and game use | `src/daemon/preview.ts`, `src/daemon/preview-proxy.ts`, `src/desktop/web-game-player.ts`, `src/desktop/game-recorder.ts`, `src/desktop/playtest-driver.ts`, `src/daemon/playtest-tools.ts`, `src/daemon/plugin-game-runtime.ts` | [Preview lifecycle](preview-runtime.md), [service recovery](runtime-recovery.md), [game use](runtime.md#agent-game-use), [plugin game runtimes](runtime.md#plugin-game-runtimes) | `test/preview.test.ts`, `test/web-game-player.test.ts`, `test/playtest-driver.test.ts`, `test/playtest-tools.test.ts`, `test/plugin-game-runtime.test.ts` | | Coding agents (Claude Code, Codex, OpenCode) | `src/daemon/agent-runtimes/`, `src/renderer/coding-agents-settings.tsx`, `src/renderer/approval-card.tsx`, `src/shared/agent-runtimes.ts` | [Coding agents](coding-agents.md) | `test/agent-runtime-session.test.ts`, `test/agent-runtime-drivers.test.ts`, `test/agent-transcript-replay.test.ts`, `test/agent-runtime-routes.test.ts` | | External agents (OhMyGame as an MCP server) | `src/daemon/external-mcp.ts`, `src/desktop/external-mcp-launcher.ts`, `src/renderer/external-agents-settings.tsx` | [External agents](external-agents.md) | `test/external-mcp.test.ts`, `test/external-mcp-launcher.test.ts`, `test/external-agents-settings-ui.test.tsx` | | Providers and media | `src/daemon/provider-model-settings.ts`, `src/daemon/provider-settings-routes.ts`, `src/daemon/provider-models3d.ts`, `src/daemon/cloud-models.ts`, `src/renderer/provider-models.tsx` | [Custom models](custom-models.md), [3D workflows](3d-providers.md), [free cloud models](free-cloud-models.md) | `test/provider-model-settings.test.ts`, `test/model3d-workflows.test.ts`, `test/cloud-models.test.ts` | | Audio providers | `src/shared/audio.ts`, `src/shared/audio-legacy.ts`, `src/daemon/audio-generation.ts`, `src/daemon/doubao-speech-provider.ts`, `src/daemon/volcengine-tts-provider.ts`, `src/daemon/volcengine-seed-audio-provider.ts`, `src/daemon/elevenlabs-audio-provider.ts`, `src/daemon/canvas-workspace.ts` | [Audio providers](audio-providers.md) | `test/volcengine-tts-provider.test.ts`, `test/volcengine-seed-audio-provider.test.ts`, `test/doubao-voice-settings.test.ts`, `test/elevenlabs-audio-provider.test.ts`, `test/tools.test.ts`, `test/game-design.test.ts`, `test/audio-legacy.test.ts` | | Image, sprite, and video tools | `src/daemon/media-tools.ts`, `src/daemon/agent-tools.ts` | [Media processing tools](media-tools.md) | `test/media-tools.test.ts`, `test/agent-tools.test.ts` | | Installed Skills | `src/daemon/skill-library.ts`, `src/daemon/skill-routes.ts`, `src/shared/skills.ts` | [Skills](skills.md), [plan](skills-plan.zh-CN.md) | `test/skill-library.test.ts` | | MCP connections | `src/daemon/connections.ts`, `src/daemon/connection-routes.ts`, `src/renderer/connections-settings.tsx` | [Connections](plugins.md#connections) | `test/connections.test.ts`, `test/connections-api.test.ts` | | Plugins, Skills, and MCP | `src/daemon/plugin-services.ts`, `src/daemon/plugin-mcp-host.ts`, `src/daemon/plugin-hooks.ts`, `src/daemon/tool-hooks.ts`, `src/daemon/plugin-runtime.ts`, `src/daemon/plugin-sessions.ts`, `src/daemon/plugin-authoring.ts`, `src/daemon/plugin-pages.ts`, `src/daemon/project-plugin-index.ts`, `src/renderer/plugins.tsx`, `config/preinstalled-plugins.json` | [Plugin package and runtime contract](plugins.md), [plugins a project carries](plugins.md#plugins-a-project-carries), [app sessions](plugins.md#app-sessions-and-persistent-connections) | `test/tool-hooks.test.ts`, `test/plugin-mcp-host.test.ts`, `test/extension-hosts.test.ts`, `test/plugin-sessions.test.ts`, `test/plugin-builder.test.ts`, `test/bundled-plugins.test.ts`, `test/plugin-files-api.test.ts`, `test/project-plugins.test.ts` | | Plugin author tools and development | `src/daemon/plugin-pack.ts`, `src/daemon/plugin-check.ts`, `src/daemon/plugin-development.ts`, `src/daemon/plugin-export.ts`, `src/shared/plugin-template.ts`, `packages/plugin-cli/`, `packages/create-ohmygame-plugin/`, `packages/plugin-examples/` | [Tools for plugin authors](plugins.md#tools-for-plugin-authors) | `test/plugin-pack.test.ts`, `test/plugin-sources.test.ts` | | Built-in browser | `src/shared/browser.ts`, `src/daemon/browser-store.ts`, `src/desktop/browser-views.ts`, `src/desktop/browser-driver.ts`, `src/daemon/browser-tools.ts`, `src/daemon/web-fetch.ts`, `src/renderer/browser-panel.tsx` | [Browser panel](runtime.md#browser-panel), [plugin browser contributions](plugins.md#browser) | `test/browser-store.test.ts`, `test/browser-views.test.ts`, `test/browser-panel.test.tsx`, `test/web-fetch.test.ts` | | Desktop lifecycle and updates | `src/desktop/main.ts`, `src/desktop/daemon-supervisor.ts`, `src/desktop/updater.ts`, `src/desktop/update-check-scheduler.ts`, `src/renderer/changelog-panel.tsx`, `src/shared/changelog.ts` | [Runtime](runtime.md), [service recovery](runtime-recovery.md), [desktop releases](desktop-releases.md) | `test/daemon-supervisor.test.ts`, `test/desktop-updater.test.ts`, `test/desktop-update-scheduler.test.ts`, `test/desktop-runtime-packaging.test.ts`, `test/desktop-release-notes.test.ts`, `test/changelog-panel.test.tsx` | | Publishing and Community | `src/daemon/publish/`, `src/shared/publish-v1.ts`, `src/renderer/publish-dialog.tsx`, `src/renderer/games.tsx`, `src/renderer/community-*` | [Cloud integration](../CONTRIBUTING.md#cloud-integration), [runtime publishing](runtime.md#publishing) | `test/publish-client.test.ts`, `test/publish-dialog.test.tsx`, `test/community-*`; remote contracts in `test/publish.test.ts` need private cloud access | | Multiplayer publishing | `packages/server/src/`, `packages/games/src/`, `packages/game-sdk/src/multiplayer-client.ts`, `packages/game-sdk/src/multiplayer-protocol.ts` | [Google Playground multiplayer](google-playground-multiplayer.md) | `test/multiplayer-protocol.test.ts`, `test/multiplayer-server.test.ts` | | Cloud saves and leaderboards | `packages/game-sdk/src/cloud.ts`, `packages/game-sdk/src/cloud-protocol.ts`, `packages/server/src/game-data-routes.ts`, `packages/server/src/game-data.ts`, `packages/server/src/postgres-store.ts`, `src/daemon/multiplayer-workspace.ts` | [Cloud saves and leaderboards](cloud-saves.md) | `test/game-data.test.ts`, `test/cloud-saves.test.ts`, `test/archive.test.ts`, `test/publish-client.test.ts` | | Game sign-in | `packages/game-sdk/src/account.ts`, `packages/game-sdk/src/account-protocol.ts`, `packages/server/src/auth.ts`, `src/daemon/publish/archive.ts`, `src/desktop/game-sign-in.ts` | [Game sign-in](game-sign-in.md) | `test/game-sign-in.test.ts`, `test/archive.test.ts`, `test/window.test.ts` | | Shared UI and project navigation | `src/renderer/app.tsx`, `src/renderer/app-sidebar.tsx`, `src/renderer/sidebar-projects.ts` and `src/renderer/page-frame.tsx` (the pages' sidebar, its project list and frame), `src/renderer/project-frame.tsx` (a project's rail and title bar), `src/renderer/panel-layout.tsx`, `src/renderer/panel-tools.tsx` (tools that fold into a narrow toolbar's menu) and `src/renderer/workspace-layout.ts` (a project's panels and its layout), `src/renderer/home.tsx`, `src/renderer/new-game.tsx` (the new game dialog and Home's type cards), `src/renderer/project-create-dialog.tsx`, `src/renderer/projects.tsx`, `src/renderer/project-card.tsx`, `src/renderer/project-appearance-settings.tsx` and `src/shared/project-appearance.ts` (a project's icon, logo and cover), `src/renderer/project-shell.tsx`, `src/renderer/styles.css` and `src/renderer/styles/` (shared styles by area), `src/renderer/ui/` (design tokens and base components) | [Design](design.md), [local setup](../CONTRIBUTING.md#start-local-development), [project navigation](runtime.md#project-navigation), [workspace panels](runtime.md#workspace-panels) | `test/projects-page.test.tsx`, `test/project-card.test.ts`, `test/project-types.test.ts`, `test/ui-components.test.tsx`, `test/app-sidebar.test.tsx`, `test/home-explore.test.tsx`, `test/workspace-layout.test.ts` | | Assets and sources | `src/daemon/media-routes.ts`, `src/daemon/project-assets.ts`, `src/daemon/library-sources.ts`, `src/renderer/asset-source-browser.tsx`, `src/renderer/media-assets.ts`, `src/renderer/library-filters.tsx`, `src/renderer/media-picker.tsx` | [Assets and their sources](runtime.md#assets-and-their-sources), [asset sources](plugins.md#asset-sources), [video trimming](video-trimming.md) | `test/media-api.test.ts`, `test/library-sources.test.ts`, `test/media-assets.test.ts`, `test/media-picker.test.tsx` | | Project export and import | `src/daemon/project-archive.ts`, `src/daemon/archive-extraction.ts`, `src/shared/project-archive.ts`, `src/renderer/project-card.tsx`, `src/renderer/projects.tsx` | [Project archives](project-archives.md) | `test/project-archive.test.ts`, `test/project-archive-ui.test.tsx` | | First-run setup | `src/renderer/onboarding.tsx`, `src/renderer/onboarding-agents.tsx`, `src/renderer/onboarding-pup.tsx`, `src/renderer/onboarding-list.tsx`, `src/renderer/use-onboarding.ts`, `src/renderer/use-model-provider-auth.ts`, `src/renderer/custom-provider-dialog.tsx`, `src/daemon/onboarding.ts` | [First run](https://ohmygame.ai/docs/first-run/), [setup state](runtime.md#first-run-setup) | `test/onboarding.test.ts`, `test/onboarding-renderer.test.tsx` | | Logs and diagnostics | `src/desktop/log-file.ts`, `src/shared/log-redaction.ts`, `src/desktop/console-log.ts`, `src/desktop/diagnostics-export.ts`, `src/daemon/activity-log.ts`, `src/daemon/request-log.ts`, `src/daemon/diagnostics.ts`, `src/renderer/settings-page.tsx` | [Logs and diagnostics](diagnostics.md) | `test/desktop-log-file.test.ts`, `test/activity-log.test.ts`, `test/request-log.test.ts`, `test/diagnostics.test.ts`, `test/desktop-diagnostics-export.test.ts`, `test/diagnostics-settings-ui.test.tsx` | These are entry points, not an exhaustive ownership map. HTTP API and event definitions live in the code; use the corresponding shared types and tests when changing a contract. ## Architecture and feature guides The main sidebar opens **Plugins** for the plugin library, plugin details, and Plugin Builder. Earlier Settings → Plugins links still open the same plugin on this page. [Git changes in Code](workspace-git.md) covers the read-only project changes view, its comparison baseline and refresh behavior. [Turn file changes and Undo](checkpoints.md) covers message checkpoints, file conflicts, workspace versions, and recovery. Start with `src/daemon/checkpoints.ts`, `src/daemon/agent.ts`, and `src/renderer/turn-changes.tsx`; the focused suites are `test/checkpoints.test.ts`, `test/turn-checkpoints.test.ts`, `test/checkpoint-routes.test.ts`, and `test/checkpoint-references.test.ts`. [Project archives](project-archives.md) covers **Export project** and **Import project**: the archive layout and manifest, what an export leaves out, and how an import becomes a new project. `/later