Galaxy Shell / docs
Docs / Contributing

Contributor instructions

AGENTS.md · Edit on GitHub ↗

On this page

Galaxy Shell

This file holds the short rules. The full text, with dates, owner quotes and exceptions, is in docs/agent-direction.md, docs/agent-boundaries.md, docs/agent-operations.md and the sections Binding contract (from AGENTS.md) of the feature docs. They are part of this contract and bind exactly as this file does; when a short rule here and its full text differ, the full text wins, and a change to one updates the other in the same commit. Read the full text of the area that your task touches, not all of it. The index of every doc by status is docs/README.md.

License

GPL-3.0-or-later since 2026-11-05 (LICENSE). Third-party parts keep their own licenses.

Project name and technical compatibility

The project is Galaxy Shell (formerly Agent Native OS), repository naaando/galaxy-shell. Use Galaxy Shell in prose. On Linux, preserve runtime identifiers, protocol/window titles, agent-native-os paths and executables, AGENT_NATIVE_* variables, package names and profiles until each step of openspec/changes/naming/design.md, section Name everywhere, lands; macOS and Windows use Galaxy Shell from the start. Full text: docs/agent-direction.md, Project name and technical compatibility.

Current operating philosophy

The shell AI inspects, operates and evolves the whole system (interface, host, core, OpenCode, Smithay, installation) with the privileges of the user, through system_context, execute_command and command_status (openspec/specs/self-maintenance/spec.md). Generated HTML stays isolated and gets none of this. Profile style goes through read_ui/replace_ui on style.css; trusted HTML/React and host controls change in the checkout with a rebuild, or through the chat host overlay that the user approves and activates. Preserve profile, history, applications and recovery. Do not restart the runtime itself without a tested release, a persistent plan and external supervision with rollback. Do not claim that the conversation is available during a failure of the core, the provider or the compositor. Whatever the user can change, the user can ask for in userland, and every default lives outside the compositor (the base theme pack). Full text: docs/agent-direction.md, Current operating philosophy.

Current direction

Full text: docs/agent-direction.md, Current direction.

  • Smithay is the only compositor; the UI is React + Electron; River is history.
  • Every visual component is web-based (bars, widgets, controls, window frames, overview). Smithay does compositing, transforms, GPU effects, focus and input, never a second native UI.
  • System UI is React with shadcn/ui on Base UI and lucide-react icons, one style with the chat and composer as reference, only the semantic tokens of host/theme.css (design-tokens.test.js refuses literals). The approval dialogs, the change review card, the panel confirmations and the lock screen keep their fixed palette, the review card and the panel confirmations are manual popovers in the top layer over a slot, and the lock form never keeps the password in React state. Full text: openspec/specs/shadcn-migration/spec.md, section Binding contract (from AGENTS.md).
  • CSS is the default for animation; Motion only for exits, layout, reorder and springs, under LazyMotion strict and reducedMotion="user". The approval dialogs, change review card, lock screen, recovery, wallpaper, bottom bar tabs and overview cards stay without Motion. Full text: openspec/specs/motion/spec.md, section Binding contract (from AGENTS.md).
  • uiTheme is office (default, one 48 px bottom taskbar after the owner's Windows 10-style picture, positioning only), galaxy (formerly glass; a stored glass reads as galaxy) or ninja (experimental: three islands top bar, cut glass, one fixed palette whose mint the profile color replaces, four photo ambiances of the wallpaper chosen in Settings) or lumen (a 32 px top bar and an app dock at the bottom that hides while a window covers it; its protected panels dock-conversations, app-grid, dock-item-menu and dock-trash-menu and the routes /api/app-dock-region, /api/app-dock-hold, /api/dock-item-menu and /api/dock-trash are not reachable by agent tools). Full text: openspec/specs/ui-themes/spec.md, section Binding contract (from AGENTS.md).
  • Never implement or propose dragging windows between overview cards (decided 2026-10-28).
  • The canvas ships in phases behind the protected setting canvas (openspec/specs/canvas-windows/spec.md). A shader that exists is not a validated effect (openspec/specs/themes/spec.md).
  • Flutter and the removed Rust/Iced prototype are not the definitive UI.

Loading from the home directory

The login runs the checkout named by sourceRoot in ~/.config/agent-native-os/project.json. Publish to main, then sync the active checkout with python3 scripts/sync-active-checkout.py --label <id> (fast-forward only, clean, under coordination.lock), and prepare the build before you declare the next login updated; never git pull automatically at login. A synced checkout changes only the next login; running processes keep their code. Full text: docs/agent-operations.md, Loading from the home directory, and openspec/specs/project-loading/spec.md.

Profile copies of UI themes

Personalization edits only <profile>/ui-themes/<base>/theme.css of the real profile (find it through system_context or project.json), never the seeds in vendor/interface/host/ui-themes/. Read it first, keep unrelated customizations, replace the whole file atomically, and never overwrite original.css. Full text: docs/agent-operations.md, Profile copies of UI themes, and openspec/specs/profile-ui-themes/spec.md.

Contextual discoverability

Every currently available desktop shortcut must have a visible, operable counterpart in its current context: an icon control (text only where no icon reads clearly) whose tooltip and accessible name give the action and its key mapping. Hide Grid-only actions in Canvas and Canvas-only actions in Grid. The controls target their originating monitor and application, even while a protected menu has keyboard focus. See openspec/specs/contextual-actions/spec.md.

Boundaries

The rule behind every boundary: protected settings, routes, panels and compositor commands belong to the user through the protected host and to the core. No agent tool, MCP entry, scheduled turn, generated HTML or isolated plugin panel reaches them, unless the full text names the exception. These flows bind the agent tools and generated HTML; they are advisory against an agent that uses execute_command, which runs as the user. Before you touch one of these areas, read its bullet in docs/agent-boundaries.md and the doc it names:

  • Code layout: web-shell/core (Node core), web-shell/host (protected controls, recovery), web-shell/ui (seed: index.html, style.css, app.js), web-shell/desktop.cjs (Electron, sandboxed).
  • Inline interactive HTML responses are central and stay in opaque iframes, never escaped code or a separate window; pinning is a host control, and generated HTML cannot pin, unpin or resize. Generated code runs only in the isolated renderer; node:vm only parses.
  • Applications and paths: open_application, list_applications, list_directory, open_path; windows: desktop_state, window_action, arrange_windows, set_window_style. No mouse/keyboard automation.
  • Login and models: ChatGPT OAuth through OpenCode or free native models; never an API key or a paid fallback.
  • User consent (the agent uses some of these only behind their own gate): read_window_text, window capture, screenshots, session lock, scheduled intents, memory policy closes, change review card, chat host overlay.
  • Protected settings and routes: wallpaper effect, black-hole close, profile color, compositor visual style, window theme and the Office taskbar, bar and chat glass, workspaces on several outputs, overview planes, Canvas layout and lens, workspace click, switch during a response, hot corners, display off when idle, Canvas window sizing, the tile assist, window declarations.
  • System services: notifications, system tray, media controls and mixer, create_theme, the trash of the Lumen dock (an empty needs the confirmation of the protected host dialog).
  • Product changes go through core/changes.js (journal, lock, verification, recovery); source changes go through change_propose and the user's approval in the review card.
  • Preserve the conversation when the UI reloads. The only send field belongs to the protected host.

OpenSpec

Changes are planned with OpenSpec 2.0.0 (openspec/, npx openspec in web-shell). P: none. M: openspec-propose before editing. G: the same with a design.md of phases and one adversarial round. Archive a change in the commit of its last phase; tasks.md is a plan, not a log. openspec/specs/ holds current contracts, openspec/changes/ work in flight, and AGENTS.md wins over a change. Full text: docs/agent-operations.md, OpenSpec.

Workflow and checks

Work in a dedicated worktree and preserve WIP. Remove it once its branch lands, with git worktree remove <path> and never --force. Publish validated commits directly to main, without a PR. With parallel worktrees, each agent rebases onto origin/main and reruns the gates; the publishing session takes one change at a time.

python3 scripts/prepare-project.py --root "$PWD" --dependencies-only
cd web-shell
npm run format:check
npm run check
npm test

For Smithay changes, run the Rust gates through the preparer, never cargo fmt or cargo clippy directly, and never --local:

python3 scripts/prepare-project.py --root "$PWD" --cargo fmt --check
python3 scripts/prepare-project.py --root "$PWD" --cargo test --locked --features session
python3 scripts/prepare-project.py --root "$PWD" --cargo clippy --locked --features session --all-targets -- -D warnings
python3 scripts/prepare-project.py --root "$PWD" --cargo clippy --locked --all-targets -- -D warnings

npm test takes a machine-wide lock, so full suites of several worktrees take turns; a hung test fails after 300 s. npm test -- test/a.test.js runs only the named files.

Tests must not inherit the live desktop: use testEnvironment, run the Python suite without the AGENT_NATIVE_*, DISPLAY and WAYLAND_DISPLAY variables, stop every test core that you start and never the live one (pgrep -af "core/server.js").

Verify the scenario through the UI before you declare it done. Interactive QA runs in a nested session through python3 scripts/nested-qa.py (docs/nested-qa.md); report nested proof as nested proof. A check that needs the live session, a second monitor, a gesture or the real provider needs the user. Report proof in the browser, in Electron and in real system control separately.

Do not commit node_modules/, local data, binaries, QA media, logs, credentials or conversation snapshots. The owner-approved wallpapers in vendor/interface/host/wallpapers/ (metadata stripped, credited in ATTRIBUTION.md, within the budget of the theme) are product files, not binaries in this sense. Use synthetic data. Do not use the Unicode em dash U+2014. After behavior changes, update the current docs and keep history apart from the current contract.

The commit message is the record of a change. Keep no work log, diary or log of review rounds; a decision that stays in force goes to docs/architecture-decisions.md or the feature doc, and a review finding left for later becomes an issue.

Full text, including dependency preparation, the toolchain fallback and desktop capture: docs/agent-operations.md, Workflow and checks.

Coordination of the shared session

Never end, replace or restart the session in use, and never start another session in its place; the only standing exception is nested QA. Read ${XDG_STATE_HOME:-$HOME/.local/state}/agent-native-os/coordination.log before you install a release, start or stop processes or restart host/core/compositor, and hold flock -n on the sibling coordination.lock for the whole operation. If the lock is busy, do not change the runtime; after you get it, read the log again and check the real processes. Never remove a lock to force concurrency, and never terminate processes of another chat. Append records under flock with metadata only. Read the full text before any such operation: docs/agent-operations.md, Coordination of the shared session.

Trusted React host (decision of 2026-10-27)

The main UI is React compiled from web-shell/ui-src, mounted in a ShadowRoot at #surface (visual isolation, not a sandbox). The profile app.js never runs as trusted code; replace_ui takes only style.css. web-shell/host, web-shell/ui-src and web-shell/ui link to vendor/interface: edit the canonical sources. Never add trusted-ui.css to the outer document of the host. Full text: docs/agent-operations.md, Trusted React host.

Host/core maintenance in the session in use

Restart only the core, and the Electron host if needed, so the supervisor recovers them; never the supervisor, the session or the compositor. First hold coordination.lock, confirm no turn, approval, preview, model switch or login is pending, and persist a plan and rollback that an independent external process can run. Validate PID and start time before every signal. Run python3 scripts/check-host-skew.py; exit 1 or 2 means stop. Health needs ready=true and a connected compositor. Never delete, rename or edit .instance.guard or .instance.lock, and never start another real core to prove the lock. Read the full text before any maintenance: docs/agent-operations.md, Host/core maintenance in the session in use.

Local inference

The installer ships Liquid LFM2.5-1.2B-Instruct for Linux x86_64 CPU, with a private llama.cpp backend owned by the core (openspec/specs/local-liquid/spec.md). Synthetic tests use testEnvironment, which disables it.