PROJECT NAME: NekoCode
REPO ROOT: E:/project/node/nekocode
WHAT IT IS: AI-powered coding assistant desktop app
VERSION: 0.2.x (active development)
TECH STACK: Electron + React + TypeScript + Tailwind + Radix UI + Biome
BUILD TOOL: electron-vite
PACKAGE MGR: Bun (NEVER npm)
TEST RUNNER: Vitest (via bun run test)
LINTER: ESLint
Every question, bug report, error paste, feature request, or code snippet the user provides in this project folder is about NekoCode. There are no exceptions. You must NOT ask "which project?" or "is this about NekoCode?" — it always is. Specifically:
| User says | It means |
|---|---|
| A pasted stack trace or error | Comes from NekoCode's runtime or build |
| "the editor" | NekoCode's Monaco-based editor component |
| "the terminal" | NekoCode's integrated terminal |
| "the sidebar" | NekoCode's TreeSidebar component |
| "the chat" | NekoCode's ChatView / AI conversation panel |
| "sessions" | NekoCode's session management (SessionManager) |
| "extensions" | NekoCode's extension system (extension-loader) |
| "IPC" | NekoCode's Electron main↔renderer IPC bridge |
| "streaming" | NekoCode's AI response streaming (StreamBatcher) |
| "a component" | A React component in src/renderer/src/components/ |
| "a hook" | A custom React hook in src/renderer/src/hooks/ |
| "the store" | NekoCode's project store (project-store.tsx) |
| "a test" | A test in src/tests/ |
| "the build" | electron-vite build for NekoCode |
| A vague "it's broken" | Something in NekoCode is broken |
| A feature request | A feature for NekoCode |
| "how does auth work?" | NekoCode's provider auth |
If the user says "fix the bug where X doesn't work", X is a NekoCode feature.
If the user pastes a TypeScript error, it's from NekoCode's type-check.
Do NOT ask for clarification about which project — the answer is always NekoCode.
NekoCode is an Electron desktop app structured as:
-
src/main/ → Electron main process
index.ts— Window creation, app lifecycle, auto-updateripc-handlers.ts— IPC handler registration (main↔renderer bridge)session-manager.ts— AI session orchestration, streaming, compactionproject-manager.ts— Project/workspace management, file operationsextension-loader.ts— Extension discovery, loading, lifecyclestream-batcher.ts— AI response stream batching and deliverymessage-store.ts— Message persistence and retrievaltext-extractor.ts— Text extraction from files for AI contextthreading/— Worker thread pool for heavy operations
-
src/preload/ → Electron preload (IPC bridge exposure)
-
src/renderer/ → React UI (runs in Electron BrowserWindow)
App.tsx— Root app componentcomponents/chat/— ChatView, ChatInput, AssistantMessage, UserMessage, MessagesTimeline, ToolCallSection, MarkdownContentcomponents/layout/— NavBar, StatusIndicator, TreeSidebarcomponents/session/— SessionViewcomponents/ui/— ContextMenu, WelcomeScreenhooks/— useSession, useAutoScroll, useClickOutside, useModelSelection, useSessionEvents, useSessionOrchestration, useZoomstores/— project-store.tsxtypes/— chat.tsutils/— message-transforms, project-helpers, logger, extension-logging
-
src/shared/ → Types shared between main and renderer
ipc-types.ts— All IPC request/response/event type definitionsipc-channels.ts— IPC channel name constants
-
workers/ → Pi package & extension examples
pi-package/examples/extensions/— 50+ example extensionspi-package/examples/sdk/— SDK usage examples
-
src/tests/ → Unit + integration tests for main, renderer, and shared modules
- Electron → Shell hosting the React renderer. Main process handles filesystem, Git, native OS.
- React + Tailwind + Radix UI → The entire UI. All components use Radix primitives with Tailwind styling. No raw CSS files.
- Monaco → Code editing surface inside the renderer.
- Pi SDK (
@mariozechner/pi-coding-agent) → The AI agent framework NekoCode is built on. - electron-vite → Build toolchain for the Electron app.
- Bun → Package manager and script runner.
- Vitest → Unit and integration testing.
- This project uses Bun, not npm.
- Always run scripts with
bun run <command>. - Never use
npm run <command>. - Use
bunxinstead ofnpx. - Never use
npxin this repository.
- Always run tests with
bun run test. - Never run
bun testdirectly. It invokes Bun's internal test runner, not the project test runner. - The
testscript inpackage.jsonmaps tovitest run.
For every change, run all commands below and fix all errors before committing, even if they seem unrelated:
bun run testbun run lintbun run type-checkbun run package:local
NEVER, EVER, EVER REMOVE ANY COMMENTS FROM THE CODE!!!
If you need to alter the comments, PLEASE ADD MORE COMMENTS INSTEAD OF REMOVING THE OLD ONES.
For EVERY bug fix, you MUST write a full detailed description of the bug and how you fixed it into the /docs/bugs/ folder.
| User says | It means |
|---|---|
| "the app" | NekoCode desktop app (Electron) |
| "main process" | src/main/ |
| "renderer" | src/renderer/ |
| "preload" | src/preload/ |
| "shared types" | src/shared/ |
| "a provider" | An AI provider extension (Anthropic, GitLab Duo, Qwen) |
| "streaming" | AI token streaming via StreamBatcher |
| "IPC" | Electron IPC via ipc-handlers + ipc-channels |
| "threading" | Worker thread pool in src/main/threading/ |
| "extensions" | NekoCode extension system (extension-loader) |
| "the worker" | Pi's background worker process |
| "pi-package" | The distributable package in workers/pi-package/ |
Coms mean the pi extension that allow multiple pi agents to communicate with each other. path: "C:\Users\admin.pi\agent\extensions\coms.ts"