AGENTS.md
AGENTS.mdAGENTS.mdroot
Quality
84/100
Scores the file, not the repository.Length
778 words
13 headings · 1 code blocksRepository
2.0k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# AGENTS.md23This file provides guidance to Codex (Codex.ai/code) when working with code in this repository.45## Before You Code67Read and follow the **karpathy-guidelines** skill (`.Codex/skills/karpathy-guidelines`) when writing, reviewing, or refactoring code here — surface assumptions, make surgical changes, keep it simple, and define verifiable success criteria.89## Project Overview1011Cate is a desktop application that provides an infinite zoomable canvas where editor panels, terminal panels, and browser panels float spatially (similar to Figma/Miro, but for coding). Built with Electron + React + TypeScript, styled with Tailwind CSS.1213## Build System1415The Electron app lives at the project root. Uses **electron-vite** for bundling.1617```bash18npm install # install dependencies19npm run dev # start dev server with hot reload20npm run build # production build21npm test # run vitest suite22```2324Tests use **Vitest** and live alongside the code they cover (`*.test.ts` / `*.test.tsx`). A few git-touching tests assume a clean working repo and may fail when the dev tree has a branch named `main` or local modifications — those failures are environmental, not regressions.2526## Release Process2728Before creating any beta or stable release, update `CHANGELOG.md` with the29matching version, release date, summary, and categorized user-facing changes.30The changelog entry must be complete before bumping or tagging the release.3132## Dependencies3334Managed via npm (`package.json`):35- **Electron** — desktop shell (Chromium + Node.js)36- **React 18** + **react-dom** — UI framework37- **xterm.js** (`@xterm/xterm`) — terminal emulator with WebGL addon38- **node-pty** — native PTY for terminal backend39- **Monaco Editor** — code editor (VS Code's editor component)40- **zustand** — lightweight state management41- **chokidar** — filesystem watching42- **simple-git** — git operations43- **@phosphor-icons/react** — icons44- **electron-updater** — auto-update (GitHub Releases)4546## Architecture4748### Process Model (Electron)4950- **Main process** (`src/main/`) — window management, IPC handlers, native APIs51- **Preload** (`src/preload/`) — secure bridge exposing IPC to renderer52- **Renderer** (`src/renderer/`) — React app with canvas UI5354IPC channels are defined in `src/shared/ipc-channels.ts`. Type definitions in `src/shared/types.ts`.5556### Coordinate System & Canvas5758The canvas (`Canvas.tsx`) positions nodes using CSS transforms. Panel positions are stored in **canvas-space** and converted to **view-space** via zoom level and viewport offset. Key conversions in `src/renderer/lib/canvas/coordinates.ts`: `canvasToView()` / `viewToCanvas()`. Zoom range defined by `ZOOM_MIN`/`ZOOM_MAX` in shared types.5960### Canvas Interaction6162`useCanvasInteraction` hook handles wheel events (Cmd+scroll = zoom, two-finger = pan) and right-click drag panning. Node drag/resize handled by `useCanvasNodeDrag` and `useNodeResize` hooks.6364### Panel System6566Panel definitions are centralised in `src/shared/panels.ts`. The detachable panel67types (`PanelType` in `src/shared/types.ts`) are: terminal, browser, editor,68canvas, agent, document, extension. Renderer components live in `src/renderer/panels/`:69- **EditorPanel** — Monaco Editor with syntax highlighting70- **TerminalPanel** — xterm.js terminal with WebGL renderer, backed by node-pty71- **BrowserPanel** — embedded webview (file:// allowed for local HTML)72- **CanvasPanel** — nested canvas73- **DocumentPanel** — PDF / docx preview74- **AgentPanel** — Codex agent thread (sidebar + dock)75- **ExtensionPanel** — third-party extension panel (isolated webview served by an extension server)7677The file tree (`src/renderer/sidebar/FileExplorer.tsx`) and recent-projects78switcher (`src/renderer/sidebar/ProjectList.tsx`) are **sidebar** components, not79detachable panels.8081Each panel can be wrapped in a `CanvasNode` (`src/renderer/canvas/CanvasNode.tsx`) — title bar, drag, resize, close — or live inside a dock zone via `DockTabStack` (`src/renderer/docking/`). All panel records render through the shared `PanelHost` (`src/renderer/panels/PanelHost.tsx`); detached windows are dock windows (`src/renderer/shells/DockWindowShell.tsx`) with local panels state synced back to main for session persistence.8283### State Management8485Zustand stores in `src/renderer/stores/`:86- **canvasStore** — nodes, regions, zoom, viewport offset, focus state, history; per-canvas instances created via `CanvasStoreContext`. A `focusEpoch` counter lets panels re-run focus side effects when the same node is re-focused.87- **appStore** — workspaces, panels, selected workspace, sidebar88- **dockStore** — dock-zone layout (per window)89- **settingsStore** — user preferences90- **shortcutStore** — keyboard shortcut bindings91- **statusStore** — status bar state92- **uiStore** — transient UI state (command palette, etc.)93- **extensionsStore** — renderer-side mirror of the main process's extension registry (enabled-extension set)9495Persisted state is stored as hand-editable JSON files under `userData` (no96electron-store). `settingsFile.ts` owns `settings.json`; `jsonStateFile.ts` is a97reusable factory for that same pattern — it delegates the in-memory-authority98engine to `jsonStateStore.ts` and keeps the filesystem backend (sync load,99debounced atomic write, chokidar external-edit watcher, corrupt-file quarantine).100`workspaceStateStore.ts` uses it for `recent-projects.json`, `sidebar.json`,101`remote-workspaces.json`, and `layouts.json`. Per-project canvas/session state102lives in `<project>/.cate/workspace.json` + `session.json`. AI provider credentials are103global in `userData/pi-agent/auth.json` (+ `models.json`), mirrored into each104workspace's `.cate/pi-agent/`.105106### Key Patterns107108- **Functional React** with hooks for all logic109- **Zustand** for global state (no Redux/Context boilerplate)110- **Tailwind CSS** for styling111- **IPC** for all main↔renderer communication (filesystem, git, terminal, shell)112- Keyboard shortcuts via `useShortcuts` hook113- File explorer is git-aware (tracks file status)114
Also in 0-AI-UG/cate
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| 0-AI-UG/cateCLAUDE.md · 2.0k | CLAUDE.md | setupbuildteststyle+3 | 84/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| trick77/agents-md-syncAGENTS.md · 2 | AGENTS.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago |
