Restore AGENTS.md (CLAUDE.md links to it) and the verify skill, and add a pr skill covering scope, checks to run, the evidence each kind of change needs and a UX consistency review against DESIGN.md and PRODUCT.md. The PR template lists evidence by change type, and the PR check also asks for screenshots or a recording when a PR changes UI files under src/, unless the description says "No visible change".
15 KiB
OpenIDEA — contributor guide
Rust + Tauri 2 desktop IDE with full-featured, multi-language code intelligence.
Visual style: rounded content islands on a grey frame, low-contrast greys, one cool accent;
Islands Light is the default theme. src/styles/tokens.css is the source of truth for colours
and metrics; DESIGN.md and PRODUCT.md describe the design system and who the product is for.
Layout
crates/ide-*— backend crates; one domain each. Depend onide-corefor shared types; never reach into another crate's internals.src-tauri/— glue only:state.rs(AppState / Project),commands/<domain>.rs(desktop-only commands; the adapters ofide-hostcommands are derived),events.rs. No domain logic here.src/bindings.ts— generated by tauri-specta (pnpm gen:bindings). Never edit.src/platform/— ipc (call,onIdeEvent,nextRequestId), actions registry, keymap + dispatcher, context keys /whenclauses, project store.src/workbench/contributions.ts— extension points (tool windows, status items, overlays, editor kinds) and cross-feature services (editor, tool windows, notifications).src/ui/— design-system primitives.src/features/<name>/— one feature each, exportingactivate()registered insrc/features/index.ts.languages/<id>.toml— language definitions (detection, comments, LSP, DAP).crates/ide-host— theopenidea-serverbinary for remote development and theopenidea-pluginCLI (plugin starter templates live in itstemplates.rs).wit/— plugin interface definitions;plugins/— sample and bundled plugins. Plugin docs:plugins/README.md,plugins/themes.md.java/— JDT LS extension bundles (java-usages,kotlin-bridge) and the patched Lombok agent, embedded into the app byide-sdk/ide-tools.e2e/— Playwright UI tests (pnpm e2e).evals/— code-intelligence evals (pnpm eval).fixtures/— sample projects per language for manual and automated testing.docs/— the Mintlify documentation site (docs.jsonnavigation,en/andzh/pages); preview withnpx mint devindocs/.
Rules
- IPC coordinates: 0-based lines, UTF-16 columns/offsets everywhere (
ide-core::text). - Every command returns
IdeResult<T>; convert internal errors at the crate edge. - Declare a command once, on its implementation:
#[command(trust = …)]inide-host::opsplus its module'sdomain!list (Tauri adapter, server handler and bindings are derived); desktop-only commands use#[desktop_command(trust = …)]anddesktop_domain!. - Streaming →
tauri::ipc::Channel<T>; cancellable → UI-allocatedRequestId+cancel_request. Backend → UI notifications →IdeEventviaEventSink. - Long work never blocks the UI thread or a Tauri command thread: use
spawn_blocking/rayon, honourCancellationToken. - Frontend features never import each other; communicate via actions, contributions
and services. All user-invocable behaviour is an action with a stable id; default
shortcuts live in
src/platform/keymaps/. - Styling: CSS Modules + tokens only (no hex literals in components). Inline SVG
icons from
src/ui/icons.tsx, never emoji. Real<button>/<input>;aria-labelon icon buttons.gapuses the--space-*scale (src/styles/tokens.css, 4px grid) where a value is on it. - User-visible text goes through the text catalog: add every new string to both
src/platform/locales/text/en.jsonandzh.json(textCatalog.test.tsenforces it). Other locales may lack entries; their UI shows the English text until a translator adds it. - Keep comments sparse and purposeful; match surrounding style.
- New regular expressions in frontend code must run on WebKit (no lookbehind):
src/platform/webkitCompatibility.test.tschecks them. - For GUI verification, prefer Tauri MCP; use Computer Use only when Tauri MCP is unavailable or cannot cover the required checks.
UX changes
A change to what users see or how they interact must look and behave like the rest of the IDE.
DESIGN.md(colours, type, layout, components, Do's and Don'ts) andPRODUCT.md(users, principles, accessibility) are the reference;docs/en/contribute/guidelines/ui.mdxhas the code-level rules. Build fromsrc/ui/primitives and workbench contributions; don't create a one-off control, colour or spacing when an existing one fits.- Check every theme the change touches (at least Islands Light and Islands Dark) and narrow sizes (e.g. the Commit tool window at its default width, a small window). Long translated strings must not break the layout.
- Everything works from the keyboard; focus is visible and lands somewhere sensible when a
popup or dialog closes. Icon-only buttons have an
aria-labeland a tooltip. - Follow the conventions users of this kind of IDE already know: the same action keeps the same name, place and shortcut across views. Don't invent a new pattern for an existing one.
- Agent and MCP features follow good agent-tool practice: restrained, predictable, reversible.
- Restructuring a page layout or navigation, or changing a default behaviour, needs a
maintainer's decision first: ask in the issue and label it
needs-decision. - The Impeccable design skills may be used for design critique and polish; they read
DESIGN.md,PRODUCT.mdand.impeccable/. A detector exception goes in.impeccable/config.jsonwith a reason.
Issues & PRs
Follow CONTRIBUTING.md and .github/pull_request_template.md: one problem per PR
(Closes #<n> when it resolves an issue), reproduce first, keep the diff focused, short plain
description. Unclear product decisions → needs-decision and stop.
Every PR carries evidence a reviewer can accept without re-running everything, in How it was verified. It must come from the final version of the branch:
| Change | Evidence |
|---|---|
| Bug fix | A test that fails before the fix and passes after, or exact reproduction steps with before/after result |
| Visible UI | Before/after screenshots at the same state and window size; each theme the change touches |
| Interaction (multi-step, drag, keyboard, focus) | A short recording or numbered screenshots |
| Code intelligence / language support | The fixture used and language_smoke output; pnpm eval numbers for Java |
| Run / debug | pnpm smoke smoke/run.test.ts / smoke/debug.test.ts -t <language> output |
| Performance | Before/after numbers on the same machine (pnpm perf, pnpm perf:rust or a stated measurement), plus proof the results are unchanged |
| Windows / Linux only | The platform's CI job, and a screenshot or log from a real machine |
| Backend / IPC | Test output; regenerated src/bindings.ts when types changed |
| Remote development | The flow against a real openidea-server host |
Plugin API / wit/ |
plugins/build.sh run and dist/ committed; a sample plugin using the change |
| Settings / persisted data | Behaviour when starting from data written by the previous version |
| Copy, docs, refactor | The commands run; "No visible change" when nothing users see changed |
Attach screenshots and recordings to the PR description; never commit them. The pr skill
has the full checklist.
Skills
Shared agent skills live in .agents/skills/ (.claude/skills/ links to them):
pr prepares a pull request — checks to run, evidence for the kind of change, description;
verify drives the running app through Tauri MCP and captures screenshot evidence.
Commands
- Optional:
mise installprovisions the contributor toolchain;mise taskslists the task aliases. See Development setup. The direct commands below still work without mise. pnpm tauri dev— run the app with worktree isolation. Use Node 22.22.2 or later on the 22.x line.pnpm dev:appalso enables the global Tauri API.pnpm dev:statusreports this worktree's running MCP bridges and actual ports.pnpm build— typecheck + bundle frontend.pnpm dogfood:local [--build-only](ormise run dogfood:local) — build and locally install the grey-icon dogfood desktop app sharing release settings and data.pnpm dogfood:remote <remote_name> [--restart | --no-restart] [--clean](ormise run dogfood:remote <remote_name>) — sync backend sources to a host from Tools › SSH Configurations, buildopenidea-server, and stage it for Remote Development.pnpm dogfood:all <remote_name> [--restart | --no-restart](ormise run dogfood:all <remote_name>) — rundogfood:localanddogfood:remote <remote_name>in parallel.cargo nextest run --workspace(orcargo test),cargo clippy --workspace --all-targets -- -D warnings,cargo fmt --all.cargo test -p ide-host --test language_smoke -- --ignored --exact <language>— code intelligence onfixtures/with that language's real server installed (CI:Language smoke, pinned versions).pnpm smoke smoke/run.test.ts -t <language>— run and test that language's fixture through the run store and a realopenidea-server(build it first:cargo build -p ide-host --bin openidea-server).pnpm smoke smoke/debug.test.ts -t <language>— debug that fixture's entry point the same way, with the debugger the IDE installs (on macOS, CodeLLDB and Delve may need Developer Mode:sudo DevToolsSecurity -enable).pnpm test,pnpm e2e,pnpm lint,pnpm format:check,pnpm knip,pnpm typecheck,pnpm gen:bindings.pnpm perf(UI interaction latency / frames / leaks),pnpm perf:rust(criterion benches vs budgets). Budgets:perf/budgets.json.pnpm eval [--only <id>] [--runs n] [--save-baseline]— Java code intelligence (navigation, usages, gutter markers) in the production workbench against a releaseopenidea-serverand jdtls: time to feedback / first result / complete, results vsevals/<language>/golden/. Report:target/eval/report.json. Goldens andevals/budgets.jsonare changed by people only. Tool versions:.github/tool-versions.env(shared with Language smoke).pnpm release:prepare <version>— the release commit's changes: app version everywhere,Cargo.lock, and the plugin API snapshot whenwit/moved to a new version.
Before opening a PR
Run what CI runs for the parts you touched:
- Rust:
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo nextest run --workspace. After changing IPC types, runpnpm gen:bindingsand commitsrc/bindings.ts; CI fails if it differs. - Frontend:
pnpm typecheck(vitest does not type-check),pnpm lint,pnpm format:check,pnpm knip,pnpm test,pnpm build, and everye2e/spec of the feature you touched. - New text keys:
src/platform/locales/textCatalog.test.tsandsrc/platform/i18n.test.ts. New or renamed tokens:pnpm gen:theme-docs. - Changed a
pub fnsignature in a crate: run that crate's wholecargo test, not one test. - UI or runtime behaviour: verify in the running app (
.agents/skills/verify) and collect the evidence above (.agents/skills/pr).
Pitfalls
- Run a subset of frontend tests with
pnpm vitest run <path>.pnpm test -- <path>ignores the filter and runs the whole suite, which takes several minutes. - Don't run clippy while iterating:
pnpm tauri devcompiles anyway. Runcargo fmt --all+cargo clippy -p <crate> --all-targets -- -D warningsonce, right before committing. A cold build cache can take around 5 minutes. Run long checks one at a time, not chained in one shell call that may hit the 10-minute tool timeout. pnpm tauri devdoes a full debug build. Clippy only checks the code, so a passing clippy doesn't make the first launch fast.
Parallel worktrees
Several worktrees can be developed and run side by side.
- Create one per task:
git worktree add ../<name> -b <branch> origin/main, thenpnpm installin it. - Launch with
pnpm tauri dev/pnpm dev:app, not the rawpnpm exec tauri devCLI. The wrapper starts Vite on a worktree-derived port (advancing if occupied), passes its actual URL to Tauri, and reports an existing launcher instead of starting another for the same worktree. HMR uses the Vite port. - Debug app identity, data, settings, logs and single-instance scope follow the canonical
worktree path captured at build time, independent of launch cwd. Launching the same debug
binary again focuses its existing instance and forwards its path argument. Different
worktrees and the installed release can coexist.
--releaseuses normal release identity and bypasses the development wrapper. - MCP bridge ports are dynamic (9223–9322). Use
pnpm dev:status, connect to the reported port, verify identifier/cwd, and passappIdentifier: <port>explicitly. Do not assume the default MCP session belongs to this worktree. - Keep each worktree's Cargo output directory separate; do not point
CARGO_TARGET_DIRortargetsymlinks at a shared directory. - Each worktree's first build is cold (several minutes) and
cargo buildoutput takes around 9 GB; tests, clippy and incremental builds add more. Avoid running several heavy builds on one machine at the same time. - Stop only processes started for the current worktree/session. Never use broad
process-name kills such as
pkill openidea. - When done: stop that worktree's app and dev session, delete its build output, then
git worktree remove ../<name>.