CodeXomics Developer Guide¶
This guide summarizes the current CodeXomics development workflow and architecture. For agent-specific rules, read AI Assistant Guidelines and the canonical root Agents.md.
Prerequisites¶
- Node.js 20 or 22.
- npm 10 or newer.
- Git.
- Platform build tools required by Electron Builder for your operating system.
CodeXomics 0.722.0 uses Electron 41.7.1 for compatibility with the supported Node.js CI matrix.
Setup¶
Development mode:
Commands¶
| Command | Purpose |
|---|---|
npm start | Launch the Electron app |
npm run dev | Launch with developer tools |
npm run mcp-server | Start the standalone MCP server |
npm run start-with-mcp | Start Electron and MCP together |
npm run marketplace:start | Start the plugin marketplace server |
npm run start-full | Start Electron, MCP, and marketplace together |
npm test | Run Vitest tests |
npm run lint | Run ESLint |
npm run version-sync | Synchronize version fields |
npm run version-validate | Validate version consistency |
npm run docs:serve | Preview the MkDocs site locally |
npm run docs:validate | Validate docs and build the site strictly |
npm run docs:deploy | Publish documentation to gh-pages |
npm run build | Build the current platform |
npm run build:mac | Build macOS packages |
npm run build:win | Build Windows packages |
npm run build:linux | Build Linux packages |
Source Tree¶
CodeXomics/
├── src/
│ ├── main.js
│ ├── main/
│ ├── preload.js
│ ├── version.js
│ ├── mcp-server.js
│ ├── mcp-tools/
│ ├── bioinformatics-tools/
│ └── renderer/
│ ├── index.html
│ ├── renderer-modular.js
│ ├── css/
│ └── modules/
├── tools_registry/
├── packages/marketplace-server/
├── docs/
├── test/
├── scripts/
├── Agents.md
├── Memory.md
└── mkdocs.yml
Architecture¶
Electron Boundary¶
src/main.jsowns app lifecycle and BrowserWindow creation.src/main/contains extracted main-process modules for windows, menus, MCP lifecycle, IPC, and project IPC.src/preload.jsexposes safe APIs across the context bridge.- Renderer code should not reach directly into Node APIs when a preload or IPC path exists.
Renderer Modules¶
Most app behavior lives in src/renderer/modules/.
High-impact modules:
ChatManager.js- LLM orchestration and dynamic tool prompt assembly.MultiAgentSystem.js- agent scoring and routing.FileManager.js,MultiFileManager.js,ProjectManager.js- file and project workflows.TrackRenderer.jsplus Canvas renderers - genome visualization.PluginManagerV2.js,PluginMarketplace.js,PluginFunctionCallsIntegrator.js- plugin lifecycle and AI-callable plugins.LLMConfigManager.js,MultiAgentSettingsManager.js- provider and agent settings.BenchmarkManager.js,BenchmarkUI.js,benchmark-suites/- benchmark execution and reporting.
Chat Services¶
Tool execution is split into focused services under src/renderer/modules/chat/services/:
ToolExecutionService.jsLLMContextService.jsIntentParserService.jsTaskService.jsFileOperationService.jsAnnotationService.jsProteinService.jsBlastService.jsGenomeAnalysisService.jsPrimerService.jsRestrictionDigestService.jsGelElectrophoresisService.jsUIService.js
Use existing services before adding new ChatManager logic.
Dynamic Tool Registry¶
The registry is rooted at tools_registry/.
Important files:
registry_manager.jsloads and scores YAML tools.system_integration.jsmerges built-in, registry, MCP, and plugin tools.builtin_tools_integration.jsmaps local built-ins to ChatManager/service methods.tool_categories.yamldescribes categories.
Current registry snapshot:
- 179 YAML tool schemas.
- 18 active YAML categories.
- 143 built-in ChatBox tools.
- 96 MCP tools in tools mode.
MCP Server¶
Entry point: src/mcp-server.js.
Tool modules live under src/mcp-tools/:
- navigation
- sequence
- protein
- database
- data
- pathway
- action
- utility
- file
- track
- primer
- annotation
Tools mode exposes the full MCP list. Agent mode exposes only codexomics_chat, list_genome_windows, and switch_active_window.
Plugin System¶
The plugin architecture is centered on:
src/renderer/modules/core/ExtensionService.jssrc/renderer/modules/core/ExtensionHost.jssrc/renderer/modules/core/ContributionRegistry.jssrc/renderer/modules/core/CommandRegistry.jssrc/renderer/modules/PluginManagerV2.jssrc/renderer/modules/PluginSecurityValidator.jspackages/marketplace-server/
Plugin API version is 2.0.0.
Adding A Tool¶
Use the complete checklist in root Agents.md. The short version:
- Add a YAML schema in
tools_registry/<category>/. - Add the built-in mapping if the app can execute it locally.
- Add keyword relevance and intent matching.
- Wire execution through an existing service or ChatManager fallback.
- Add
ToolNames.jsconstants. - Add FunctionCallsOrganizer categorization.
- Add MCP parity if external clients need it.
- Add an explicit policy in
LLMContextService.shouldAllowToolExecution(). - Add focused tests for registry, routing, and execution behavior.
Styling¶
CodeXomics uses vanilla CSS.
- Shared CSS lives in
src/renderer/css/. - Theme preset overrides live in
src/renderer/css/themes/. - Current preset CSS files:
professional.css,minimal.css,pastel.css,elegant.css,midnight.css. - Do not add TailwindCSS, Bootstrap, or atomic CSS frameworks unless explicitly requested.
Testing¶
Vitest is configured by vitest.config.mjs.
Test folders:
test/unit/test/integration/test/mocks/
Common focused checks:
Documentation¶
MkDocs source lives in docs/ and is configured by mkdocs.yml.
Do:
- Update
docs/index.mdfor public landing-page changes. - Add user content under
docs/user-guides/. - Add implementation content under
docs/developer-guides/. - Add deep architecture content under
docs/architecture/. - Keep root
README.md,Agents.md, andMemory.mdaccurate. - Keep semantic version, compact display version, and MkDocs release label distinct and synchronized.
Do not:
- Edit generated
site/output directly. - Point MkDocs nav at root-level files outside
docs/. - Hand-edit generated content on the
gh-pagesbranch.
Run this before committing documentation or release metadata changes:
Contribution Notes¶
- Keep changes scoped.
- Preserve user changes in the working tree.
- Use conventional commit messages.
- For docs-only changes, use
docs(scope): summary. - Run the most relevant checks before committing.