2026-03-13 09:30:05 +00:00
|
|
|
# CLAUDE.md
|
|
|
|
|
|
|
|
|
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
|
|
|
|
|
|
|
|
## Build & Development Commands
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Development (hot-reload GUI + Go rebuild)
|
|
|
|
|
wails3 dev
|
|
|
|
|
|
|
|
|
|
# Production build (preferred)
|
|
|
|
|
core build
|
|
|
|
|
|
|
|
|
|
# Frontend-only development
|
|
|
|
|
cd frontend && npm install && npm run dev
|
|
|
|
|
|
|
|
|
|
# Go tests
|
|
|
|
|
core go test # All tests
|
|
|
|
|
core go test --run TestName # Single test
|
|
|
|
|
core go cov # Coverage report
|
|
|
|
|
core go cov --open # Coverage in browser
|
|
|
|
|
|
|
|
|
|
# Quality assurance
|
|
|
|
|
core go qa # Format + vet + lint + test
|
|
|
|
|
core go qa full # + race detector, vuln scan, security audit
|
|
|
|
|
core go fmt # Format only
|
|
|
|
|
core go lint # Lint only
|
|
|
|
|
|
|
|
|
|
# Frontend tests
|
|
|
|
|
cd frontend && npm run test
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Architecture
|
|
|
|
|
|
feat: modernise IDE with ecosystem packages
Replace 7 hand-rolled service files (mcp_bridge, webview_svc, brain_mcp,
claude_bridge, headless_mcp, headless, greetservice) with ecosystem
packages from core/gui, core/mcp, and core/go-ws.
Three operating modes: GUI (Wails systray), MCP (--mcp stdio for Claude
Code), and headless (no display). Core framework manages all service
lifecycles via dependency injection.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 09:18:55 +00:00
|
|
|
**Thin Wails shell** wiring ecosystem packages via `core.Core` dependency injection. Three operating modes:
|
2026-03-13 09:30:05 +00:00
|
|
|
|
|
|
|
|
### GUI Mode (default)
|
feat: modernise IDE with ecosystem packages
Replace 7 hand-rolled service files (mcp_bridge, webview_svc, brain_mcp,
claude_bridge, headless_mcp, headless, greetservice) with ecosystem
packages from core/gui, core/mcp, and core/go-ws.
Three operating modes: GUI (Wails systray), MCP (--mcp stdio for Claude
Code), and headless (no display). Core framework manages all service
lifecycles via dependency injection.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 09:18:55 +00:00
|
|
|
`main()` → Wails 3 application with embedded Angular frontend, system tray (macOS: accessory app, no Dock icon). Core framework manages all services:
|
|
|
|
|
- **display** (`core/gui`) — window management, webview automation, 74 MCP tools across 14 categories
|
|
|
|
|
- **MCP** (`core/mcp`) — Model Context Protocol server with file ops, brain subsystem, GUI subsystem
|
|
|
|
|
- **IDE bridge** (`core/mcp/pkg/mcp/ide`) — WebSocket bridge to Laravel core-agentic backend
|
|
|
|
|
- **WS hub** (`core/go-ws`) — WebSocket hub for Angular frontend communication
|
|
|
|
|
|
|
|
|
|
### MCP Mode (`--mcp`)
|
|
|
|
|
`core-ide --mcp` → stdio MCP server for Claude Code integration. No GUI, no HTTP. Configure in `.claude/.mcp.json`:
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"mcpServers": {
|
|
|
|
|
"core-ide": {
|
|
|
|
|
"type": "stdio",
|
|
|
|
|
"command": "core-ide",
|
|
|
|
|
"args": ["--mcp"]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
2026-03-13 09:30:05 +00:00
|
|
|
|
feat: modernise IDE with ecosystem packages
Replace 7 hand-rolled service files (mcp_bridge, webview_svc, brain_mcp,
claude_bridge, headless_mcp, headless, greetservice) with ecosystem
packages from core/gui, core/mcp, and core/go-ws.
Three operating modes: GUI (Wails systray), MCP (--mcp stdio for Claude
Code), and headless (no display). Core framework manages all service
lifecycles via dependency injection.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 09:18:55 +00:00
|
|
|
### Headless Mode (no display or `gui.enabled: false`)
|
|
|
|
|
Core framework runs all services without Wails. MCP transport determined by `MCP_ADDR` env var (TCP if set, stdio otherwise).
|
2026-03-13 09:30:05 +00:00
|
|
|
|
|
|
|
|
### Frontend
|
feat: modernise IDE with ecosystem packages
Replace 7 hand-rolled service files (mcp_bridge, webview_svc, brain_mcp,
claude_bridge, headless_mcp, headless, greetservice) with ecosystem
packages from core/gui, core/mcp, and core/go-ws.
Three operating modes: GUI (Wails systray), MCP (--mcp stdio for Claude
Code), and headless (no display). Core framework manages all service
lifecycles via dependency injection.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 09:18:55 +00:00
|
|
|
Angular 20+ app embedded via `//go:embed`. Two routes: `/tray` (system tray panel, 380x480 frameless) and `/ide` (full IDE layout).
|
|
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
# .core/config.yaml
|
|
|
|
|
gui:
|
|
|
|
|
enabled: true # false = no Wails, Core still runs
|
|
|
|
|
mcp:
|
|
|
|
|
transport: stdio # stdio | tcp | unix
|
|
|
|
|
tcp:
|
|
|
|
|
port: 9877
|
|
|
|
|
brain:
|
|
|
|
|
api_url: http://localhost:8000
|
|
|
|
|
api_token: "" # or CORE_API_TOKEN env var
|
|
|
|
|
```
|
2026-03-13 09:30:05 +00:00
|
|
|
|
|
|
|
|
## Environment Variables
|
|
|
|
|
|
|
|
|
|
| Variable | Default | Purpose |
|
|
|
|
|
|----------|---------|---------|
|
feat: modernise IDE with ecosystem packages
Replace 7 hand-rolled service files (mcp_bridge, webview_svc, brain_mcp,
claude_bridge, headless_mcp, headless, greetservice) with ecosystem
packages from core/gui, core/mcp, and core/go-ws.
Three operating modes: GUI (Wails systray), MCP (--mcp stdio for Claude
Code), and headless (no display). Core framework manages all service
lifecycles via dependency injection.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 09:18:55 +00:00
|
|
|
| `CORE_API_URL` | `http://localhost:8000` | Laravel backend WebSocket URL |
|
|
|
|
|
| `CORE_API_TOKEN` | (empty) | Bearer token for Laravel backend auth |
|
|
|
|
|
| `MCP_ADDR` | (empty) | TCP address for MCP server (headless mode) |
|
2026-03-13 09:30:05 +00:00
|
|
|
|
|
|
|
|
## Workspace Dependencies
|
|
|
|
|
|
feat: modernise IDE with ecosystem packages
Replace 7 hand-rolled service files (mcp_bridge, webview_svc, brain_mcp,
claude_bridge, headless_mcp, headless, greetservice) with ecosystem
packages from core/gui, core/mcp, and core/go-ws.
Three operating modes: GUI (Wails systray), MCP (--mcp stdio for Claude
Code), and headless (no display). Core framework manages all service
lifecycles via dependency injection.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 09:18:55 +00:00
|
|
|
This module uses a Go workspace (`~/Code/go.work`) with `replace` directives for sibling modules:
|
2026-03-13 09:30:05 +00:00
|
|
|
- `../go` → `forge.lthn.ai/core/go`
|
|
|
|
|
- `../gui` → `forge.lthn.ai/core/gui`
|
feat: modernise IDE with ecosystem packages
Replace 7 hand-rolled service files (mcp_bridge, webview_svc, brain_mcp,
claude_bridge, headless_mcp, headless, greetservice) with ecosystem
packages from core/gui, core/mcp, and core/go-ws.
Three operating modes: GUI (Wails systray), MCP (--mcp stdio for Claude
Code), and headless (no display). Core framework manages all service
lifecycles via dependency injection.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 09:18:55 +00:00
|
|
|
- `../mcp` → `forge.lthn.ai/core/mcp`
|
2026-03-14 10:28:39 +00:00
|
|
|
- `../config` → `forge.lthn.ai/core/config`
|
feat: modernise IDE with ecosystem packages
Replace 7 hand-rolled service files (mcp_bridge, webview_svc, brain_mcp,
claude_bridge, headless_mcp, headless, greetservice) with ecosystem
packages from core/gui, core/mcp, and core/go-ws.
Three operating modes: GUI (Wails systray), MCP (--mcp stdio for Claude
Code), and headless (no display). Core framework manages all service
lifecycles via dependency injection.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 09:18:55 +00:00
|
|
|
- `../go-ws` → `forge.lthn.ai/core/go-ws`
|
2026-03-13 09:30:05 +00:00
|
|
|
|
|
|
|
|
## Conventions
|
|
|
|
|
|
|
|
|
|
- **UK English** in documentation and user-facing strings (colour, organisation, centre).
|
|
|
|
|
- **Conventional commits**: `type(scope): description` with co-author line `Co-Authored-By: Virgil <virgil@lethean.io>`.
|
|
|
|
|
- **Licence**: EUPL-1.2.
|
|
|
|
|
- All Go code is in `package main` (single-package application).
|
feat: modernise IDE with ecosystem packages
Replace 7 hand-rolled service files (mcp_bridge, webview_svc, brain_mcp,
claude_bridge, headless_mcp, headless, greetservice) with ecosystem
packages from core/gui, core/mcp, and core/go-ws.
Three operating modes: GUI (Wails systray), MCP (--mcp stdio for Claude
Code), and headless (no display). Core framework manages all service
lifecycles via dependency injection.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 09:18:55 +00:00
|
|
|
- Services are registered via `core.WithService` or `core.WithName` factory functions.
|
|
|
|
|
- MCP subsystems implement `mcp.Subsystem` interface from `core/mcp`.
|