Inherits all behavior from /AGENTS.md at monorepo root.
HagiCode Desktop is an Electron desktop client for Hagicode Server management and monitoring. It provides a user-friendly interface for:
- System resource and service management
- Web service control (start, stop, restart)
- Version management (install, switch multiple versions)
- Dependency management (auto-detection and installation)
- Package source management (GitHub releases, HTTP indices, local folders)
- License management
- RSS feed monitoring for updates
HagiCode Desktop supports multiple platform and architecture combinations:
| Platform | Architecture | Platform Identifier |
|---|---|---|
| Linux | x64 | linux-x64 |
| Linux | ARM64 | linux-arm64 |
| Windows | x64 | win-x64 |
| macOS | x64 | osx-x64 |
| macOS | ARM64 (Apple Silicon) | osx-arm64 |
The application automatically detects the current platform using process.platform and process.arch. Platform-specific packages are filtered and installed based on this detection.
HagiCode packages follow the naming convention: hagicode-{version}-{platform}-nort.zip
Example: hagicode-0.1.0-linux-arm64-nort.zip
Previous identifier darwin-arm64 has been renamed to osx-arm64 for consistency with the package naming convention used by hagibuild.
Any code directly referencing darwin-arm64 should be updated to use osx-arm64.
- Electron: 39.2.7
- Node.js: Compatible with npm 10.9.2
- TypeScript: 5.7.3 (strict mode enabled)
- React: 19.0.0
- React DOM: 19.0.0
- Redux Toolkit: 2.5.0 (state management)
- React Redux: 9.2.0
- React Router DOM: 7.11.0
- Vite: 6.0.7 (bundler for renderer process)
- electron-builder: 26.0.12 (packaging)
- Tailwind CSS: 4.0.0
- Radix UI: Multiple components (@radix-ui/react-*)
- Base UI: @base-ui/react 1.0.0
- shadcn: 3.6.2
- i18next: 25.7.3
- react-i18next: 16.5.1
- axios: 1.13.2 (HTTP client)
- electron-store: 10.0.0 (persistent storage)
- electron-updater: 6.6.2 (auto-updates)
- electron-log: 5.4.3 (logging)
- @microsoft/applicationinsights-react-js: 19.3.8 (telemetry)
- rss-parser: 3.13.0 (RSS feed parsing)
- semver: 7.7.3 (version comparison)
src/
├── main/ # Electron main process code
│ ├── main.ts # Entry point
│ ├── config-manager.ts # Configuration management
│ ├── dependency-manager.ts
│ ├── license-manager.ts
│ ├── onboarding-manager.ts
│ ├── package-source-config-manager.ts
│ ├── rss-feed-manager.ts
│ ├── state-manager.ts
│ ├── tray.ts
│ └── package-sources/ # Package source implementations
├── preload/ # Electron preload scripts
└── renderer/ # React frontend code
├── App.tsx # Root component
├── main.tsx # Entry point
├── components/ # React components
├── store/ # Redux store
│ ├── index.ts
│ ├── listenerMiddleware.ts
│ ├── slices/ # Redux slices
│ └── thunks/ # Redux thunks
├── hooks/ # Custom React hooks
├── i18n/ # Internationalization
└── lib/ # Utility libraries
When working in the hagicode-desktop submodule:
- Respect Electron architecture: Understand the separation between main process, renderer process, and preload scripts
- Follow Redux Toolkit patterns: Use slices and thunks for state management
- Use shadcn/Radix UI components: Prefer these over building custom components
- Support i18n: All user-facing strings must use i18next translation keys
- Path aliases: Use
@/*for imports within renderer process - Type safety: Strict TypeScript is enabled - maintain type safety
cd repos/hagicode-desktop
npm run dev # Full development (renderer + main + preload + electron)
npm run dev:renderer # Renderer dev server only
npm run dev:main # Main process TypeScript watch
npm run build:prod # Production build with smoke test
npm run build:win # Windows build
npm run build:mac # macOS build
npm run build:linux # Linux build- Co-locate components with their tests when applicable
- Use PascalCase for component files
- Follow shadcn patterns for component composition
- Use Redux Toolkit slices for domain state
- Use listener middleware for side effects
- Keep thunks for async operations
- Renderer process: Use
@/*alias (resolves tosrc/renderer/*) - Types: Import from
@typesalias for shared types - Assets: Import from
@assetsalias
- Use Tailwind utility classes
- Follow Tailwind CSS 4 patterns
- Use cn() utility for conditional classes (clsx + tailwind-merge)
AI assistants should NOT suggest:
- Server-side Orleans patterns (this is a client-side desktop app)
- Backend-only technologies (Express, Fastify, etc.)
- Next.js patterns (this is an Electron app, not a web app)
- Database solutions directly in the desktop app (data is managed via Hagicode Server)
- CSS-in-JS libraries (use Tailwind CSS instead)
- Root AGENTS.md:
/AGENTS.mdat monorepo root - Monorepo CLAUDE.md: See root directory for monorepo-wide conventions
- OpenSpec Workflow: Proposal-driven development happens at monorepo root level (
/openspec/) - Documentation: See
repos/hagicode-desktop/docs/for detailed guides - README:
repos/hagicode-desktop/README.md