CodeNomad Architecture & SDK Navigation Skill
Quick Start (by contribution frequency)
- UI component/feature (60%) → Read
references/ui-conventions.md → Check i18n
- Server route/feature (25%) → Read
references/server-conventions.md → Check references/feature-traces.md
- Bug fix (10%) → Use Navigation Guide below → Check
references/feature-traces.md
- Desktop/Plugin (5%) → Read
references/desktop-conventions.md
- Not covered? → See "Escape Hatch" at bottom
1. Architecture Overview
CodeNomad is a multi-platform desktop application with a Fastify backend and SolidJS frontend.
6 Functional Areas (from RPG analysis)
| Area |
Entities |
Key Responsibility |
| UserInterface |
613 |
SolidJS components, stores, hooks, i18n, API client |
| ServerBackend |
418 |
Fastify routes, auth, workspaces, filesystem, speech |
| SpeechAndAudio |
74 |
Speech synthesis, voice mode, conversation mode |
| DesktopClient |
59 |
Electron main, Tauri Rust, preload, IPC |
| BuildAndPackaging |
28 |
Build scripts, packaging, resource bundling |
| CloudflareDeployment |
3 |
Edge deployment, asset serving |
Package Map
packages/server/ — Fastify backend, workspaces, auth, speech, sidecars
packages/ui/ — SolidJS frontend, stores, components, i18n
packages/electron-app/ — Electron desktop wrapper
packages/tauri-app/ — Tauri desktop wrapper (Rust + webview)
packages/opencode-plugin/ — OpenCode plugin integration
Key Entry Points
- Server:
packages/server/src/index.ts (CLI entry)
- UI:
packages/ui/src/main.tsx (app bootstrap)
- Electron:
packages/electron-app/electron/main/main.ts
- Tauri:
packages/tauri-app/src-tauri/src/main.rs
2. Navigation Guide
Finding Code in the Codebase
Use grep and file search tools to navigate:
Search by intent:
grep "permission approval" packages/ui/src/components/
grep "session list" packages/ui/src/stores/
grep "workspace create" packages/server/src/server/routes/
Search by imports:
- Find what uses a module:
grep "import.*from.*module-path" packages/
- Find exports:
grep "^export" packages/server/src/api-types.ts
Cross-reference by feature:
- Server API types:
packages/server/src/api-types.ts
- UI type mirrors:
packages/ui/src/types/
- SDK wrappers:
packages/ui/src/lib/sdk-manager.ts
3. SDK Schema Verification (Mandatory)
SDK Note: The OpenCode SDK is an external package (@opencode-ai/sdk/v2/client). Its implementation lives outside this repository.
- After
npm install, you can inspect types in node_modules/@opencode-ai/sdk/v2/client.d.ts
- Fallback: Read the actual usage patterns in CodeNomad code (see
references/sdk-api-reference.md for file locations)
- When in doubt, check how the SDK is imported and used in existing CodeNomad files
This skill provides navigation and patterns, not definitive schemas.
4. Anti-Patterns
Common Mistakes
| Mistake |
Correct Approach |
Reference |
Import enMessages directly |
Use t() or tGlobal() |
packages/ui/src/lib/i18n/index.tsx |
Set metadata: { flag: true } on assistant parts |
Use client-side registry |
packages/ui/src/stores/session-compaction.ts |
Call client.session.* directly without worktree routing |
Use getOrCreateWorktreeClient() |
packages/ui/src/stores/worktrees.ts |
| Forget SSE disconnection handling |
Add handlers |
packages/ui/src/lib/event-source-handlers.ts |
| Add hardcoded strings without i18n |
Add to English + all 7 locales |
packages/ui/src/lib/i18n/messages/ |
| Modify server route without checking UI API client |
Trace full feature flow |
references/feature-traces.md |
| Change API type without checking UI type matches |
Check UI types mirror server types |
packages/ui/src/types/ vs packages/server/src/api-types.ts |
5. Platform Integration Checklist
Desktop Platform Rules
- Existing IPC/handlers (pre-Tauri): MUST implement in both Electron + Tauri
- New features: Implement in Electron first, Tauri if time permits
- Native APIs (dialogs, notifications): Use
packages/ui/src/lib/native/ abstraction
Checklist
6. Implementation Checklist
Before submitting changes:
7. Escape Hatch + Update Criteria
Not Covered?
If your change involves areas not documented here:
- Read package entry points and scan directory structure
- Ask the user before proceeding with unfamiliar code
Update This Skill If
- You discover a new SDK gotcha not documented in
references/sdk-critical-behaviors.md
- You add a new cross-area feature flow (add to
references/feature-traces.md)
- File paths or conventions change significantly
- You find an anti-pattern occurring repeatedly
- SDK schemas change and examples become outdated
Reference Files
| File |
Purpose |
references/architecture-overview.md |
Package structure, functional areas, entry points |
references/ui-conventions.md |
SolidJS, i18n, stores, components, testing |
references/server-conventions.md |
Fastify, API types, config, testing |
references/desktop-conventions.md |
Electron + Tauri parity, native abstractions |
references/sdk-api-reference.md |
OpenCode SDK V2 categories and signatures |
references/sdk-critical-behaviors.md |
Schema gotchas, limitations, decision matrix |
references/sdk-integration-patterns.md |
Client lifecycle, error handling, optimistic updates |
references/feature-traces.md |
End-to-end flows with decision branches |
Source: NeuralNomadsAI/CodeNomad — distributed by TomeVault.
1---2name: neuralnomadsai-codenomad-codenomad3description: CodeNomad Architecture & SDK Navigation Skill4---56# CodeNomad Architecture & SDK Navigation Skill78## Quick Start (by contribution frequency)910- **UI component/feature (60%)** → Read `references/ui-conventions.md` → Check i18n11- **Server route/feature (25%)** → Read `references/server-conventions.md` → Check `references/feature-traces.md`12- **Bug fix (10%)** → Use Navigation Guide below → Check `references/feature-traces.md`13- **Desktop/Plugin (5%)** → Read `references/desktop-conventions.md`14- **Not covered?** → See "Escape Hatch" at bottom1516## 1. Architecture Overview1718CodeNomad is a multi-platform desktop application with a Fastify backend and SolidJS frontend.1920### 6 Functional Areas (from RPG analysis)2122| Area | Entities | Key Responsibility |23|------|----------|-------------------|24| **UserInterface** | 613 | SolidJS components, stores, hooks, i18n, API client |25| **ServerBackend** | 418 | Fastify routes, auth, workspaces, filesystem, speech |26| **SpeechAndAudio** | 74 | Speech synthesis, voice mode, conversation mode |27| **DesktopClient** | 59 | Electron main, Tauri Rust, preload, IPC |28| **BuildAndPackaging** | 28 | Build scripts, packaging, resource bundling |29| **CloudflareDeployment** | 3 | Edge deployment, asset serving |3031### Package Map3233- `packages/server/` — Fastify backend, workspaces, auth, speech, sidecars34- `packages/ui/` — SolidJS frontend, stores, components, i18n35- `packages/electron-app/` — Electron desktop wrapper36- `packages/tauri-app/` — Tauri desktop wrapper (Rust + webview)37- `packages/opencode-plugin/` — OpenCode plugin integration3839### Key Entry Points4041- **Server:** `packages/server/src/index.ts` (CLI entry)42- **UI:** `packages/ui/src/main.tsx` (app bootstrap)43- **Electron:** `packages/electron-app/electron/main/main.ts`44- **Tauri:** `packages/tauri-app/src-tauri/src/main.rs`4546## 2. Navigation Guide4748### Finding Code in the Codebase4950Use grep and file search tools to navigate:5152**Search by intent:**53- `grep "permission approval" packages/ui/src/components/`54- `grep "session list" packages/ui/src/stores/`55- `grep "workspace create" packages/server/src/server/routes/`5657**Search by imports:**58- Find what uses a module: `grep "import.*from.*module-path" packages/`59- Find exports: `grep "^export" packages/server/src/api-types.ts`6061**Cross-reference by feature:**62- Server API types: `packages/server/src/api-types.ts`63- UI type mirrors: `packages/ui/src/types/`64- SDK wrappers: `packages/ui/src/lib/sdk-manager.ts`6566## 3. SDK Schema Verification (Mandatory)6768**SDK Note:** The OpenCode SDK is an external package (`@opencode-ai/sdk/v2/client`). Its implementation lives outside this repository.6970- After `npm install`, you can inspect types in `node_modules/@opencode-ai/sdk/v2/client.d.ts`71- **Fallback:** Read the actual usage patterns in CodeNomad code (see `references/sdk-api-reference.md` for file locations)72- When in doubt, check how the SDK is imported and used in existing CodeNomad files7374This skill provides navigation and patterns, not definitive schemas.7576## 4. Anti-Patterns7778### Common Mistakes7980| Mistake | Correct Approach | Reference |81|---------|-----------------|-----------|82| Import `enMessages` directly | Use `t()` or `tGlobal()` | `packages/ui/src/lib/i18n/index.tsx` |83| Set `metadata: { flag: true }` on assistant parts | Use client-side registry | `packages/ui/src/stores/session-compaction.ts` |84| Call `client.session.*` directly without worktree routing | Use `getOrCreateWorktreeClient()` | `packages/ui/src/stores/worktrees.ts` |85| Forget SSE disconnection handling | Add handlers | `packages/ui/src/lib/event-source-handlers.ts` |86| Add hardcoded strings without i18n | Add to English + all 7 locales | `packages/ui/src/lib/i18n/messages/` |87| Modify server route without checking UI API client | Trace full feature flow | `references/feature-traces.md` |88| Change API type without checking UI type matches | Check UI types mirror server types | `packages/ui/src/types/` vs `packages/server/src/api-types.ts` |8990## 5. Platform Integration Checklist9192### Desktop Platform Rules9394- **Existing IPC/handlers (pre-Tauri):** MUST implement in both Electron + Tauri95- **New features:** Implement in Electron first, Tauri if time permits96- **Native APIs (dialogs, notifications):** Use `packages/ui/src/lib/native/` abstraction9798### Checklist99100- [ ] Electron main-process changes? (`packages/electron-app/electron/main/`)101- [ ] Tauri Rust changes? (`packages/tauri-app/src-tauri/src/`)102- [ ] Preload API exposure? (`packages/electron-app/electron/preload/`)103- [ ] Native abstraction? (`packages/ui/src/lib/native/`)104105## 6. Implementation Checklist106107Before submitting changes:108109- [ ] Run impact analysis: `grep "YOUR_EXPORT_NAME" packages/` to find all usages110- [ ] Check i18n: Search for hardcoded strings in modified files111- [ ] Verify file length: Check line count (warn >500, reject >800 source; >1000 tests)112- [ ] Check DesktopClient: Does this need IPC/main-process changes?113- [ ] Verify SDK compatibility: Check types in `node_modules/@opencode-ai/sdk/v2/client.d.ts`114- [ ] Cross-area check: If modifying server routes, check UI stores and API clients115- [ ] Check anti-patterns: Review "Common Mistakes" section above116- [ ] API compatibility: If changing `api-types.ts`, check UI type matches117118## 7. Escape Hatch + Update Criteria119120### Not Covered?121122If your change involves areas not documented here:1231241. Read package entry points and scan directory structure1252. Ask the user before proceeding with unfamiliar code126127### Update This Skill If128129- You discover a new SDK gotcha not documented in `references/sdk-critical-behaviors.md`130- You add a new cross-area feature flow (add to `references/feature-traces.md`)131- File paths or conventions change significantly132- You find an anti-pattern occurring repeatedly133- SDK schemas change and examples become outdated134135## Reference Files136137| File | Purpose |138|------|---------|139| `references/architecture-overview.md` | Package structure, functional areas, entry points |140| `references/ui-conventions.md` | SolidJS, i18n, stores, components, testing |141| `references/server-conventions.md` | Fastify, API types, config, testing |142| `references/desktop-conventions.md` | Electron + Tauri parity, native abstractions |143| `references/sdk-api-reference.md` | OpenCode SDK V2 categories and signatures |144| `references/sdk-critical-behaviors.md` | Schema gotchas, limitations, decision matrix |145| `references/sdk-integration-patterns.md` | Client lifecycle, error handling, optimistic updates |146| `references/feature-traces.md` | End-to-end flows with decision branches |147148---149> Source: [NeuralNomadsAI/CodeNomad](https://github.com/NeuralNomadsAI/CodeNomad) — distributed by [TomeVault](https://tomevault.io).150<!-- tomevault:4.0:skill_md:2026-07-02 -->