Use when adding or changing code in any part of Satellite, to know where it goes, how the processes talk, how to run, build and package it, and which dependency rules apply.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Satellite Stack?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/launchsatellite-satellite-stack)
---
name: satellite-stack
description: "Use when adding or changing code in any part of Satellite, to know where it goes, how the processes talk, how to run, build and package it, and which dependency rules apply."
---
# Satellite stack
Electron, TypeScript, React and Tailwind in one ESM npm package on the Node named in `.nvmrc`. electron-vite builds it into `out/`, electron-builder packages it into `release/`. `ARCHITECTURE.md` says why each boundary is where it is, and skill `satellite-conventions` holds the rules every line follows. This skill is how to put code in the right place and prove it.
## Folder map
The Folder layout section of `ARCHITECTURE.md` maps every folder and the files that matter, so the map lives in one place.
## Where a new feature goes
One folder per feature on each side, named for the domain thing, tests beside the code.
- `src/main/<feature>/` holds its handlers and logic, for example `src/main/changes/change-list.ts` with `change-list.test.ts` beside its parser.
- `src/renderer/<feature>/` holds its views, for example `src/renderer/changes/changes-view.tsx`.
- A feature that reads a repository keeps its reads in its own folder, as `src/main/changes/` does, on top of `runGit` and `readGit`, with a read queue when reads can pile up and a per-page cache that `owner.onGone` drops. Text from a repository reaches React only through `VisibleName` or Monaco's models, and a name the page sends goes through a key the page was given first. A feature that reads files for a page, as `src/main/files/` does, takes a relative path, runs it through the five steps of the Files section of `ARCHITECTURE.md` (`isChangePath`, a link-free walk, the real path check, a no-follow open and a recheck) by reusing the confined reader of `src/main/changes/file-sides.ts`, and never reads from an absolute path.
- A feature that reads the machine's processes, as `src/main/processes/` does, takes its rows from the table reader in the platform module, which reads short names for the table that decides and full commands only for the listed ids, lists by a pure rule over a table so a hand-made table in `process.test-fixture.ts` can test it, and keeps what crosses to the page bounded and cut.
- A feature that reads GitHub, as `src/main/pull-request/` does, runs `gh` only through `runTool("gh", args, { cwd, timeoutMs, signal })` with arguments from one builder file, `gh-arguments.ts`, whose builders `callOf` in `verify/stand-ins/gh-call.ts` reuses to tell the calls apart, so no other file builds a `gh` argument. Only values that passed a pattern may enter an argument. Every run goes through the one queue in `gh-pace.ts`, reads stay in memory and nothing is stored, and the answer is parsed loosely into a strict contract shape. A page-side hook asks and the background process paces, as `usePullRequests` does. Text a pull request says reaches React only through `VisibleName`, `visibleText` or revealed text, never into an argument, a prompt or a notification.
- Every agent and shell a project starts takes its profile's overlay, which the terminal sessions build from `profileOf(projectId)` of the profile store and lay over the launch. `profileOf` throws its sentence when the profile can't be read, and the start fails with it, never falling back to your setup. `gh` and git never take a profile, since GitHub and commits follow your setup. `src/main/profiles/` owns the overlay, the profile files and the account reads.
- Its messages go in `src/shared/bridge-contract.ts`, its rows in the `ARCHITECTURE.md` Bridge table.
- `src/renderer/guide/` is the first-run guide. A control it points at carries `data-guide` with its step's name, one element per name, and the layer finds it by that attribute, never by a test id.
- A part two features share moves to `src/renderer/ui/`. Code both processes need goes in `src/shared/` and imports nothing from Electron, Node or the DOM.
The renderer imports only from `src/renderer/` and `src/shared/`. Main never imports from the renderer.
## Adding a bridge request
Names are `<feature>.<verb>`. In this order.
1. **Contract.** Add the entry to `bridgeRequests` in `src/shared/bridge-contract.ts`. Request and response are `z.strictObject`, every string has a `max`, every number is a bounded `z.int()`, ids are `z.uuid()`, a choice is `z.literal` or `z.enum`. A limit both processes use, like `terminalWriteChars`, goes in `bridgeLimits` and the schema reads it from there. A path or a name from the interface is data that the handler confines, never a value it runs.
```ts
"terminal.resize": {
request: z.strictObject({ id: terminalId, cols, rows }),
response: empty,
},
```
2. **Handler.** In the feature folder, typed `BridgeHandler<"x.y">`, or `Pick<BridgeHandlers, ...>` for a group. `BridgeHandler`, `BridgeHandlers`, `BridgeOwner` and `BridgeFailure` live in `src/main/bridge/registry.ts`. It gets the parsed request and the page's `BridgeOwner`. Throw `BridgeFailure(code, sentence)` for an outcome the user sees. The code is one of the `bridgeErrorCode` enum in the contract, and a new kind of outcome adds its code there. Any other throw is logged and answered `failed`. Anything the handler starts for a page ends in `owner.onGone(...)`, and anything it holds for one page answers `not-found` to every other page.
```ts
throw new BridgeFailure("not-found", "That terminal is not running.");
```
3. **Wire it.** Add it to the map passed to `registerBridge` in `src/main/main.ts`. `BridgeHandlers` needs every channel, so typecheck fails until it is there.
4. **Registry test.** Add its spy to `spies()` in `src/main/bridge/registry.test.ts`, which `satisfies BridgeHandlers` and fails typecheck without it. When its input has a shape worth attacking, add the payloads that must be refused to a test that asserts `invalid-request` and that no handler ran.
5. **Call it.** The renderer calls `invoke("x.y", payload)` from `src/renderer/bridge/bridge-client.ts` and gets a `BridgeResult`. On `!result.ok` it shows `result.error.message`, a sentence written for people.
```ts
void invoke("tools.check", {}).then(setResult);
```
React 19 ignores a state update after unmount, so a request whose answer only sets state needs no unmount guard. One that starts something, like `terminal.start`, has a matching cleanup in the effect.
6. **Record it.** One row in the Bridge table of `ARCHITECTURE.md`, with what it does, its limits and why it is safe. Ask what a page that runs hostile script could do with exactly this message. If the answer is more than the row says, narrow the schema or the handler.
7. **Prove it** in the app (skill `satellite-verify`). A new kind of refusal gets a case in the `boundary` journey.
An event is the same, with `bridgeEvents` instead. The handler sends it with `owner.emit("x.done", payload)`, so it reaches only the page that owns it. Add the event's empty `Set` to `listeners` in `src/renderer/bridge/bridge-client.ts`, which typecheck asks for. The client holds one IPC listener for every subscriber, parses each event once, and drops and logs one that fails its schema, naming the event and the failing fields, never the payload. The renderer listens with `subscribe("x.done", listener)`, which returns the unsubscribe for the effect's cleanup. Subscribe before the request that makes the events, as `TerminalView` does before `terminal.start`.
Never add an IPC channel or an `ipcMain` handler. Everything goes through `satellite:bridge` and `satellite:event`. `window.satellite` holds three functions, `invoke`, `onEvent` and `pathForFile`, which only reads a dropped file's path and sends nothing. A fourth is a security decision for the maintainer, recorded in the Bridge section of `ARCHITECTURE.md`.
## The platform module
`src/main/platform/` is the only code that spawns a tool, imports `node:child_process` or `node-pty` or finds an executable, and almost the only code that branches on `process.platform`. The exceptions are small and named here. In the background process they are the macOS app menu, quiet verification on macOS in `src/main/window/verification.ts`, the home folder that `src/main/processes/command-text.ts` shortens to `~` case-insensitively on Windows, the file names `src/main/changes/file-sides.ts` refuses on each system, and the folder watcher in `src/main/watch/`, which picks its backend for the system and runs in an Electron utility process that `watcher-child.ts` forks. In the interface they are the shortcut keys in `src/renderer/commands/shortcuts.ts` and the places that draw or match them, the image paste sequence in `src/renderer/terminal/terminal-keys.ts` and the code font in `src/renderer/ui/code-type.ts`, which read the system from the page's user agent because they have no other way to know it. Test files and their fixtures spawn and branch freely. A feature calls in.
- `resolveTool("gh")` and `runTool("git", ["status", "--porcelain=v2"], { timeoutMs })` take a `Tool` and an argument array, never a shell string. `runTool` takes an optional `cwd`, the folder the tool starts in, which the pull request's `gh` runs pass, and an optional `input`, text written to the tool's standard input and then closed, which a git read passes as `input` in its extras, an optional `overlay`, a profile's environment laid over the tool's, `asSession`, which starts from the environment agents get instead of the tool's hardened one, and `outputLimit`, which lowers the 16 MiB, and answers `{ exitCode, stdout, stderr }`, or `undefined` when the tool is missing, and throws `ToolStopped` when it runs past its time limit, 30 seconds unless the caller asks for less, is aborted or prints more than 16 MiB, after ending the tool's whole process tree, its `reason` saying which. When the tree does not end, it throws `AbandonedRun`, whose `exited` settles once the process really exits, so a caller never starts the same command again while the first still runs.
- `askTool(tool, args, { lines, answers, timeoutMs, outputLimit, ... })` beside it runs a tool that talks over its standard input, writes `lines`, answers the first output line `answers` accepts and ends the tree, or `undefined` at its time limit, output limit, error or exit. Only Codex's app server in `src/main/profiles/profile-status.ts` uses it.
- git on a project or workspace goes through `src/main/workspaces/git-command.ts`. `gitArgs(folder, args)` puts the safe options and `-C <folder>` first, and `runGit(folder, args, timeoutMs, signal?, { gitVariables?, filtersOf?, lazyFetch?, bytes?, input? })` runs it, setting only environment variables on the closed `gitVariables` list in `tools.ts` and reading output byte for byte as latin1 when `bytes` is set, answers `undefined` for a run that failed to finish, throws `tool-missing` when git is gone, and starts nothing in a folder where a git is stuck. `readGit` takes the same arguments and names why a run failed to finish instead, `time`, `stopped`, `output`, `stuck` or `failed`. Use its time limits, and put any value from the interface or a repository after `--end-of-options` or as a full `refs/...` name. Every git run already has `GIT_NO_LAZY_FETCH=1`, and only the workspace checkout passes `lazyFetch`. A run that rehashes working files, such as `status`, `diff` against the worktree or `worktree remove`, passes `filtersOf: <folder>` so the repository's own clean and process filters are blanked through `src/main/workspaces/repository-config.ts`, and on a git that ignores the no-fetch variable a partial clone's reads throw its refusal. A feature passes `gitVariables` only as the changes reads do, the replace and graft variables for stored objects and the other three for the conflict check's scratch repository in `src/main/changes/conflict-check.ts`, and a new name joins the closed list in `tools.ts` only with a recorded reason. A new git command lists the programs a repository's config can make it start, its writes and its optional index lock in the Reads paragraph or the Workspaces section of `ARCHITECTURE.md` before it ships. Adding a project is the one git call outside it, through `runTool` in `src/main/projects/repository-check.ts`.
- `chooseFolder(window)` opens the native folder dialog, or reads the verify answer file, and answers a path or `undefined`. A path that reaches `git` always goes after `-C` in the argument array. `chooseProfileFolder(window)` does the same for a profile's folder, which only `profiles.choose-folder` reads. `chooseImage(window)` in the same file does the same for one PNG or JPEG file, which only `looks.choose-image` reads, through `cutIcon` in `src/main/looks/project-icons.ts`.
- `openInBrowser(href)` opens an address `links.open` already checked in the system browser, or appends it to the verify links file.
- `createAppUpdater(events)` in `app-updater.ts` is the one place that loads electron-updater, answers `undefined` in a build that never updates itself and a stand-in under `SATELLITE_VERIFY_UPDATES`. Only `src/main/updates/updates.ts` calls it, and never `setFeedURL`.
- `copyText(text)` writes plain text to the system clipboard, or appends it to the verify copies file and never touches the clipboard for the whole run when a live driver started the app. Only `workspaces.copy-branch` calls it, with a branch name it read and checked itself. Nothing reads the clipboard.
- `installCommand(tool)` answers the fixed install step for a missing tool on this platform, a `command` or an `address`.
- `childEnvironment()` is the user's login shell environment without `ELECTRON_` variables and the AppImage launch variables, with `XDG_CURRENT_DESKTOP` restored. Every child gets it.
- `resolveInside(root, requested)` answers the real path inside `root`, symlinks followed, or `undefined`. Every path from the interface or a repo that belongs inside a known folder goes through it. A folder to add as a project has no such root, so it goes through `checkRepository` in `src/main/projects/repository-check.ts` instead. `samePath(a, b)` compares two paths the way the platform does, case-insensitively on macOS and Windows, and `isInsidePath(parent, child)` asks whether one holds the other with the same case folding. `isFullyQualified` refuses Windows device paths, and `isNetworkPath` names a Windows share.
- `file-system.ts` holds the file system's platform rules, `isSafeFileName`, `isShortName`, `isTooLongForCheckouts`, `isLinkedFolder`, `restrictToUser`, which gives a folder Satellite makes mode `0700` off Windows, and `restrictFileToUser`, which gives a file `0600` the same way, and the small helpers features share, `errorCode`, `isMissing`, `folderIdentity` with `sameIdentity` on 64-bit device and inode, and the `noFollow`, `nonBlocking` and `noTerminal` open flags. A new Windows file rule goes here.
- `system-notices.ts` owns notifications and the app icon count. `showNotice(text, onClick)` shows Satellite's words and answers a `ShownNotice` or `undefined`, `setAppBadge(count)` sets the count, clamped to 0 to 4200 and skipped on Windows, and `prepareSystemNotices()` sets the Windows app identity at start. Under `SATELLITE_VERIFY_NOTICES` notifications and the count go to that file instead, as do the questions for quitting and for saving a custom agent when the driver check also passed at start, the Windows identity is still set, and `windowCountsInFront` and `windowTookFocus` make the window count as never in front.
- `createTerminals(fork)` in `terminal-client.ts` is how the background process starts a terminal. Only `terminal-process.ts` loads `pty.ts`, so never import it, or anything that does, from the background process, and check the built chunks when the entries share new code. `terminal-host.ts` holds the logic with `spawnPty` passed in, so tests need no Electron. A new message goes in `terminal-messages.ts` with strict bounds, and neither a refused message nor an environment is ever logged.
- `isGone(pid)` in `session-process.ts` is the only instant proof that a session's process ended. A start time, a wait or a missing row never is. Never signal a held process except through `endHeld`.
- `spawnPty(command, { cwd, cols, rows, env })` answers a `PtyProcess` with its `pid` whose `kill()` ends the whole tree on every platform. On Windows it hands node-pty a command line from `windowsCommandLine`, which quotes every argument by the rules Windows programs parse with, since node-pty's own quoting splits an argument that starts and ends with a quote. With no arguments it hands over an empty list, never an empty string, which would leave a program's path with spaces unquoted.
- `readProcessTable()` in `process-table.ts` is the only way to read what runs, and `readListeningPorts(pids)` in `listening-ports.ts` the only way to read ports. Both take no argument from a page, run `ps`, `lsof`, `ss` or PowerShell by absolute path and answer an empty list when a read fails, so code that acts on a table treats an empty one as a failure. A feature signals a process only through `endSubtree(target)` in `process-tree.ts`, and only for a process `ownedProcess` in `src/main/processes/` proved descends from a running session, or for a lost session's own process that passed every check of `endHeld` in `session-process.ts`, never with `process.kill` on its own and never to a group.
- `userShell()` in `user-shell.ts` is the only way to pick the shell a terminal runs. It reads fixed places and never `PATH` or a page's value.
- `claudeEnvironment(env)` is what every agent and the terminal's shell start with, the child environment minus the deny list of names that point at whatever started Satellite, with `127.0.0.1` added to `NO_PROXY` when a proxy is set. A project on a profile then gets `applyOverlay(env, overlay)` from `src/main/profiles/profile-environment.ts` on top.
`src/main/sessions/` owns launching the agents. `codexArgs` in `codex-launch.ts` builds every Codex argument, and `createReportReader` in `status-reports.ts` reads Codex's status from its output and nothing else's. A new built-in agent gets an `AgentId`, its name in `src/shared/agent-names.ts`, its own strict `terminal.start` shape, launch plan and tool, and offers only what it supports. It also joins `agent-choices.ts` in `src/renderer/agents/`, which every menu, command and name reads. Custom agents live in `src/main/agents/`. Their programs go through `findProgram` and a command that takes a request through `wordThatRunsRequest`, both in `src/main/platform/saved-program.ts`, and nothing is saved without the system question. `claudeArgs` in `claude-launch.ts` builds every argument from fixed flags, a UUID, the settings file and a new session's first message last after `--`, and `hookSettings` the hooks in that file, so nothing else builds Claude Code's arguments or hooks, and `src/main/terminal/terminal-sessions.ts` is the one caller. A new hook event joins `hookEvents` only when Claude Code runs HTTP hooks for it, and the listener, the status machine and the Sessions section of `ARCHITECTURE.md` change with it.
- `satelliteHome()` and `prepareSatelliteHome()` own `~/.satellite` and `SATELLITE_HOME`. All state lives there, never in a user's repo.
A new tool joins the `Tool` union. Its override variable, a JSON array of strings, goes in `toolOverrideVariables` when verify needs a stand-in for it.
## Look and colour scheme
`DESIGN.md` owns every visual rule. `src/renderer/styles/app.css` defines its app tokens as CSS variables, light in `:root` and dark under `prefers-color-scheme: dark`, and maps them in `@theme inline` after `--color-*: initial`, so the only colours Tailwind knows are the tokens.
- Components use token utilities only, `bg-bg`, `bg-side`, `text-fg`, `text-dim`, `border-line`, `bg-pri-bg text-pri-fg`, `outline-accent`. A raw colour never appears in a component.
- Every enabled control shows the pointer through one rule in the base layer of `app.css`, a list of the elements and roles the app's controls use that turns back to the arrow on `:disabled` and `aria-disabled="true"`. A new kind of control is one more selector there, never a cursor class on a component, and anything clickable is a real `button` or sits inside an element with its role, as a tree row sits in its `treeitem`, never a bare `div` with a click handler, a scrim aside. One cursor stays outside the rule, the resize cursor of a divider as a utility.
- Type is `font-sans` (Funnel Sans, app text at 13px), `font-display`, `font-mono` (Geist Mono) and `font-pixel` (readouts, uppercase). The terminal and the Monaco viewers take the system's code font and size from `codeType` in `src/renderer/ui/code-type.ts`, never a bundled family.
- The colour scheme follows `prefers-color-scheme`, which the background process points at the saved theme choice, `system`, `light` or `dark`, through `nativeTheme.themeSource` at start and on every `interface.save`, so DOM parts need nothing. A curated theme sets the same tokens inline on the root through `src/renderer/ui/shown-theme.ts`, with the floored values for `raised`, `sel` and `hover` that `app.css` scopes to those grounds, so DOM parts need nothing for it either. A part that takes colours as options rebuilds on `onThemeChange` from `shown-theme.ts`. Under Satellite's own themes it reads tokens with `getComputedStyle(document.documentElement).getPropertyValue("--bg")`, and under a curated theme the terminal reads `shownLook().terminal` and Monaco the theme's own editor theme. Monaco needs six digit hex, so its theme passes each token through a canvas.
- Fonts come from the `@fontsource` packages imported at the top of `app.css` and are bundled. `entry.tsx` waits for each family in `fontFamilies` before the first render, so a new family goes in that list. Nothing loads from the network.
- File kind icons come from the icon set, a dev dependency named in `package.json`. Its SVGs are bundled as files, never inlined (`assetsInlineLimit` refuses `.svg`), loaded lazily with the Files panel and drawn as `<img>` from the app's own origin, so `img-src 'self'` covers them. Its licence is added in `scripts/third-party-licenses.ts`.
## Interface parts
`src/renderer/ui/` holds the shared parts, each a named export.
- `Button`, on Base UI's button, the `primary`, `secondary`, `ghost` and `danger` variants in the `default` and `small` sizes, `danger` for the one action that loses work, such as Archive anyway, and the `link` variant for text that opens an address or a port, with an optional `icon`, `shortcut` hint, `tooltip`, `label`, the accessible name, which an icon-only button needs, `className` for a one-off layout tweak and any `data-*` attribute. The shortcut shows inside a button with text and no `tooltip`, and with a `tooltip` it moves into the tooltip and the accessible description. A disabled button keeps focus through `aria-disabled` and ignores clicks.
- `Dialog`, the modal panel with a title, an optional description, a body and a footer, drawn in `DialogShell`, the scrim and panel the command menu fills with its own field and results. The shell takes focus on open, makes everything beside it inert but what carries `data-stays-live`, keeps Tab and Shift+Tab inside, closes on Escape or a click outside only while `closable`, and returns focus to what had it on open, or to `returnFocusTo`. Its `release` hands focus back and lifts the inert before the shell unmounts, so a command the palette runs finds the window live, and the shell covers the window again when it renders on after that, as the palette does when a command switches its mode.
- `Segmented`, Base UI's radio group drawn as the segmented control, two or more options with a label, a value, options each carrying a `testId`, an `onChange` and `wide` to share the width evenly, the arrow keys moving the choice with focus. Changes uses it for its view, the diff tab for its layout, and Settings for the notifications.
- `Tabs` and `Tab`, Base UI's tabs drawn as the tab strip. `Tabs` takes a `label`, the chosen `value` or `null`, an `onChange` and a `testId`. The arrow keys move focus and Enter or Space opens. `Tabs` keeps the tab stop on the open tab whenever focus is outside the strip, so a session opened or closed from the command menu still gets Tab back to the open one. Every `Tab` is 160px wide, so its text sits in a `min-w-0 truncate` element. A `Tab` takes its `value`, `id`, `testId`, the `panel` it controls, an optional `tooltip`, `description`, `label` and `close`, which draws the close square beside the tab, outside the tab's own button, closes it on Delete and focuses the chosen tab when the closed one had focus. The panels stay in their views with their own ids, since Base UI's panel would have to sit inside the strip's root.
- `MenuItem`, `menuLine` and `menuLook` in `menu.tsx`, the rows, `danger` for a destructive one, the line and the look of every Base UI menu. A row whose command moves focus runs it in `onOpenChangeComplete`, as `agent-menu.tsx` and `project-menu.tsx` do, because a closing menu takes the focus back.
- `rowLook(selected)` and `rowRing` in `row-look.ts`, the one row look of the sidebar, Inbox, the changes list, the files tree and the palette, a 6px corner with the literal `bg-sel` or `hover:bg-hover`, and the ring 2px inside, plus `rowReach`, a pseudo element that carries the press over the 4px a changes or tree row sits in from the pane's sides. Each list sets its own height. The palette's active row is its only lit row, so it takes no hover fill. They are class strings rather than a component, so a 4,000 row tree costs nothing more for them.
- `Select`, Base UI's select with its menu in a portal above any dialog, taking a `value`, `options` of `{ value, label }`, an `onChange`, a `testId` on the trigger and `<testId>-options` on the menu, and an `id` for a `<label>` or a `label` for its name. Settings uses it for the theme and New workspace for the project and Start from.
- `Input`, the text field on Base UI's input with the field look `fieldLook` the select shares.
- `Tooltip`, Base UI's tooltip around one element, with its `text`, none when it is `undefined`, and an optional `shortcut`, never a `title` attribute. With `Esc` as its `shortcut` it leaves Escape to the page, so the key does what the tooltip says. It opens on focus only when Tab, an arrow key, Home or End moved it there in that same keypress, so focus the app moves on its own, such as back to a dialog's opener, never pops one. The changes list and the files tree, which can hold thousands of rows, call `useListTooltip` once instead, spread its `events` on the list, render its `tip` and put `data-tip` on each row, so they cost one tooltip each. It hides when its row leaves the page and reads the row's current `data-tip`. The palette, Inbox and the sidebar readouts are short and keep one `Tooltip` per row. `TooltipProvider` in `entry.tsx` sets the delay for all of them. It is visual only, so the element keeps its own `aria-label` or `aria-description`.
- `refresh-schedule.ts` in `src/renderer/ui/`, the polling schedule with a backoff that takes a pace, 2 to 30 seconds by default and 30 to 300 for the pull request, with resets and a hidden stop, which `useChanges`, `useFiles` and `usePullRequests` all run on. A new view that follows the disk reuses it and never adds a watcher.
- `Icon`, the line icons by `IconName`.
- `KeyHint`, a key hint such as `⌘K` in plain Geist Mono, never boxed.
- `chipLook(state)` in `chip.ts`, the classes of a chip whose edge carries a pixel state, which the header's pull request chip and the Agents page's rows wear.
- `DropTarget` and `useFileDrop` in `file-drop.tsx`, the highlight over an area that takes dropped files and the hook that says when it is under the pointer. A new drop area uses both, its parent is `relative`, and it never overlaps another one.
- `Lockup`, Satellite's mark beside its wordmark, at the top of the sidebar, and `Twin`, the mark alone at a given height.
- `VisibleName` and `visibleLabel` in `visible-name.tsx`, a name drawn with its hidden characters written out, or as plain text that says when it holds look-alike letters.
- `ProjectTile`, a project's face by its id at 18, 14 or 56px, its glyph on its hue or its chosen image, read from `LooksProvider` in `src/renderer/looks/project-looks.tsx`, with `TileFace` and `Glyph` for a face the page draws itself. A hue is `data-hue` on any element, which sets `--tile-hue` and `--tile-ink` for it and its children.
- `ProfileMark` in `profile-mark.tsx`, a profile's mark, its first letter on its hue in a 14px tile inside an 18px chip with its name, built on `data-hue` as `ProjectTile` is, from a `name` and a `hue`.
- `HueSwatches` in `hue-swatches.tsx`, the seven project hues as 24px swatches with the chosen one ringed, which Project settings and the profile page share, and `Checkbox` in `checkbox.tsx`, the kit's 16px checkbox on Base UI's.
- `StatusPixel`, the square status pixel in the state colours of `DESIGN.md`, `idle` grey, `working` ultraviolet, `ready` volt, `done` lilac, `needs-you` signal or `running`, a grey outline for a custom agent.
- `WorkspaceIcon` in `workspace-icon.tsx`, the kit's workspace frame around a status pixel's state, taking the same states and label as `StatusPixel`, which leads every workspace row in the sidebar and every Inbox row.
- `Toast`, an `info`, `notice` or `error` toast with a dismiss button, raised through the `Notify` function the window passes down. One shows at a time inside one polite status region, which a dialog and the command menu leave out of the `inert` they put on everything else, so a toast under them is still announced and dismissable with the mouse, and a press on a toast never takes focus, so the menu or dialog keeps the keys, an error goes to the front, and an `info` toast, a plain confirmation, goes ahead of the notices still waiting and is dropped rather than shown late when it waited more than 10 seconds, while a `notice`, which reports something Satellite forgot, stopped or could not read, and an error, which reports a failure or a refusal, always show (`window/toast-queue.ts`).
- `withUniqueTestIds`, which suffixes repeated test ids with `-2`, `-3`, so two projects of one name stay apart.
Every action is a command, so the button, the shortcut and the command menu all run the same thing. To add one, add its id to `CommandId` in `src/renderer/commands/command-registry.ts`, then one entry to the list `AppWindow` passes to `createCommandRegistry`, with `id`, a plain `title`, an optional `shortcut` such as `{ key: "o" }`, `available` and `run`. The registry refuses a repeated id or shortcut, and a `run` that throws or rejects shows a sentence in a toast. The command menu lists every available command but `palette.commands` itself. Draw its button with `CommandButton` from `src/renderer/commands/commands-context.tsx`, which takes the title, the shortcut hint and the availability from the registry, and with `tooltip` adds the shortcut to the tooltip it shows. A shortcut names one key. It is Cmd plus that key on macOS and Ctrl+Shift plus that key on Windows and Linux, everywhere, the terminal included, never with Alt, so plain Ctrl keys always reach Claude Code. Two take Ctrl alone there through `ctrlAlone: true`. Open settings, `{ key: ",", ctrlAlone: true }`, takes Ctrl+Comma because it is the standard and the terminal sends nothing for it. Create and start on the New workspace page takes Ctrl+Enter, the usual key to submit a multi-line box, and it only listens while that page holds the keyboard, never in a terminal. The review keys of Changes, J, K, N and P in `src/renderer/changes/review-keys.ts`, are no commands. They are plain letters with nothing held, heard only while the Changes list or the diff tab holds the keyboard and never by a text field, so they need no free modifier and never reach a terminal. A shortcut on a key other than a letter or digit adds its physical key to `physicalCode` in `shortcuts.ts`. A digit matches only by its physical key, so Ctrl+Shift+1 still reads as 1 where Shift turns it into a sign, and a named key such as `Enter` shows as its word. A held key runs a command once, nothing fires while an input method is composing, and a press for a command that is not available falls through to the focused element. While any dialog is open every command is unavailable, so no shortcut reaches past it, and a command that opens a dialog or a page closes the command menu first. A page, Settings, Agents or New workspace, is no dialog. It renders in the centre through `Page` in `src/renderer/window/page.tsx`, or for Settings across the window over the inert columns, keeps every command on and leaves on Escape through `usePageEscape` unless the keyboard is in a terminal, a dialog or an open menu. To add a part, take its rules from the Components section of `DESIGN.md` and its drawing from `BRAND.html` chapter 08, then write one file in `src/renderer/ui/` with a named export, token utilities only, the focus ring `focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent` on anything focusable, and a `testId` prop passed to `data-testid`. Test ids are kebab-case and are how verify finds things. State stays in the component with React hooks, and there is no state library. Copy follows the Voice section of `DESIGN.md`.
## The kit and shadcn
The controls in `src/renderer/ui/` are shadcn/ui components on Base UI, copied in and then made Satellite's. `components.json` at the root points the shadcn CLI at the `base-nova` style and at `src/renderer/ui` with plain paths, since the repo has no path aliases.
- Bring a component in with `npx shadcn@latest add <name> --dry-run --view`, or `add <name>` to write it, then rewrite it before it is committed. Name the file in kebab-case, import with relative paths and the extension (`./icon.tsx`), drop `"use client"`, every comment, `data-slot` and anything the call sites do not use, and draw icons with `Icon`, adding a line icon to `icon.tsx` when one is missing instead of an icon package.
- Rewrite shadcn's colour names to the tokens, never adding a second set. Background is `bg`, popover and card are `raised`, a muted surface is `side`, muted text is `dim`, secondary text is `fg2`, the hover surface shadcn calls accent is `hover`, selected is `sel`, border is `line`, input border is `ctl`, ring is `accent`, primary is `pri-bg` with `pri-fg` and destructive is `danger`. Text on an `accent` fill is `on-accent`.
- Sizes, corners, padding and focus come from the Components section of `DESIGN.md`, never shadcn's defaults. Keep the literal `bg-raised`, `bg-sel`, `bg-hover` and `hover:bg-hover` classes, since `app.css` rescopes text colours on them under a curated theme, and leave out the animation utilities, since motion is a 120ms transition at most.
- A part that portals and takes focus, like the select's menu, puts `data-popup` on its portal. While one is open the kit's dialog lets focus into it and ignores every key and a click on its scrim, so the first Escape or outside click closes only the menu. Base UI opens a select's menu one frame after the press, so the kit's `Select` marks its trigger `data-menu-opening` from the press, or from the opening by a key, until the menu closes. The dialog treats the mark as an open menu, and an Escape before the opening cancels it. The menu listens for Escape only once it is drawn, so `Select` holds the open state itself and closes on an Escape that reaches its trigger between the opening and the drawing. The tooltip takes no focus and carries none.
- The dialog and the toast stay ours. Base UI's dialog marks the window behind it with `aria-hidden` and never with `inert`, so script and the app's own focus still reach it, expects a dialog opened over another to be nested inside it, where Satellite opens the link dialog beside Settings, and would count a press on Satellite's toast as a press outside that closes it. Its toast makes every toast a tab stop and, while one shows, takes F6 from the whole window, the terminal included. The command menu keeps its own keys and list instead of Base UI's inline autocomplete or the `cmdk` package, since both bring a selection model and filtering the menu already has in a few lines over its own ranking.
- `cn` from the `cn` package merges classes, and `class-variance-authority` holds variants. Both and `@base-ui/react` are dev dependencies, bundled like the rest of the renderer, and Vite lists them in the notices by itself.
## Imports and TypeScript
- Relative imports carry their extension, `./registry.ts` or `../ui/button.tsx`, so the same file runs under Vite, Vitest and plain Node. No path aliases.
- Type-only imports use `import type` or an inline `type`. `verbatimModuleSyntax` and `erasableSyntaxOnly` refuse enums, namespaces and parameter properties.
- Strict mode plus `noUncheckedIndexedAccess`, so `array[0]` may be `undefined`, and `noPropertyAccessFromIndexSignature`, so environment reads are `process.env["SATELLITE_HOME"]`.
- Three projects. `tsconfig.json` covers main, preload, shared, `lint/`, `scripts/` and the configs with Node types. `src/renderer/tsconfig.json` covers the renderer and shared with DOM types. `verify/tsconfig.json` covers `verify/` and `src/main/platform/`. A new top-level folder of TypeScript joins one of them.
## Lint stops you on
- Any comment. Only a tool directive with its reason after ` -- ` passes, like `// eslint-disable-next-line <rule> -- <why>`, and never one that disables `satellite/no-comments`.
- A default export, `export { x as default }` and `export * as default`. Config files are the exception a tool needs.
- Any type assertion, `as` or angle brackets. Narrow with a schema, a type guard or `satisfies`.
- A file or folder that is not kebab-case, and any `index.ts` or `index.tsx`.
- Everything in typescript-eslint's strict and stylistic type-checked sets and the React hooks rules, at zero warnings.
## Dependencies
- A curated theme's syntax colours come from `shiki`, an MIT dev dependency pinned exactly. `syntax-worker.ts` runs it in a worker under `worker-src 'self'`, with the JavaScript regular expression engine and each grammar loaded on demand as its own chunk, so the content security policy needs no WebAssembly and no eval. `bounded-tokens.ts` holds the bounds. The real bound on one line is the longest line its grammar takes in `syntax-grammars.ts`, since a scan cannot be cut short, and a line stops between scans once 4 ms have passed. The worker works in 25 ms slices with a second per file, warms each grammar once on a short sample when it loads, and is ended and replaced when it stays silent for 5 seconds. `node scripts/grammar-lines.ts` measures the worst hostile line of each grammar at its longest line, which a new grammar needs. `theme-syntax.ts` on the page only looks lines up by a hash of their text and state, colours files up to the viewer's 20,000 lines, keeps only the open files' lines and re-lends a language's provider when its colours arrive. Satellite light and dark keep Monaco's own tokenizers, given back when the theme changes. A language with no grammar in `syntax-grammars.ts` reads as plain text.
- `tm-grammars`, a pinned MIT dev dependency and the source of the highlighter's grammars, is read only at build time. `scripts/grammar-notices.ts` takes each bundled grammar's licence from its `NOTICE`, the licence step writes them into the notices, and a grammar without a licence that allows shipping is replaced by an empty one, so its language and any language that embeds it show its part as plain text. The build fails when a grammar `syntax-grammars.ts` names has no such licence, or when a shipped grammar differs from the one `tm-grammars` licenses, so the two packages cannot drift apart. An embedded grammar without one is stubbed silently.
- `dependencies` holds only what the background, terminal and watcher processes load from `node_modules` at run time, `zod`, `node-pty`, `@parcel/watcher` and `electron-updater`, which the background process loads through a default import, since it is CommonJS. Only the terminal process loads `node-pty`, and only the watcher process loads `@parcel/watcher`. Everything else, the renderer's libraries included, is a dev dependency, because the renderer is bundled and a runtime dependency lands in the packaged app.
- A new runtime dependency is the maintainer's call. Dev dependencies are yours.
- `.npmrc` saves exact versions. Check the latest with `npm view <pkg> version` and the current docs. A machine whose npm refuses very fresh releases keeps the newest one it accepts.
## Scripts
| Command | Does |
| --- | --- |
| `npm ci` | Installs, and `postinstall` installs the Electron binary unless `ELECTRON_SKIP_BINARY_DOWNLOAD` is set |
| `npm run dev` | `electron-vite dev`, the app with the renderer on a local dev server and hot reload |
| `npm run build` | `electron-vite build` into `out/`, the renderer minified |
| `npm run package` | `electron-builder --publish never`, packages for this machine from `out/` into `release/`. Build first |
| `npm run verify -- <scenario> [step ...]` | Launches the real app in a scenario and prints JSON, skill `satellite-verify` |
| `npm run journeys` | Builds once and runs every journey `verify/journeys.ts` lists, or only the ones named after `--` |
| `npm run format`, `npm run format:check` | Prettier at 100 columns. Markdown and HTML are left alone |
| `npm run lint` | ESLint, zero warnings |
| `npm run typecheck` | `tsc` over the three projects |
| `npm test` | Vitest over `src/`, `lint/` and `verify/` |
| `./scripts/check` | Guards, guard tests, format check, lint, typecheck and tests. Every step runs, and it ends with `check: all green` |
| `node scripts/checksums.ts <folder> <label>` | Writes `SHA256SUMS-<label>.txt` for the packages in a folder |
## Run and prove
`npm run dev` opens the app with the user's real tools. Proof goes through the driver against the built app, `npm run --silent verify -- default`, which builds, launches with a temporary home and stand-ins, and prints the window as JSON with screenshots (skill `satellite-verify`). Built and dev runs share `out/`, so one run per checkout at a time.
The app reads `SATELLITE_HOME`, an absolute path that replaces `~/.satellite`, and `SATELLITE_GH`, `SATELLITE_CLAUDE`, `SATELLITE_CODEX` and `SATELLITE_GIT`, a JSON array with the executable then its leading arguments. `ELECTRON_RENDERER_URL` aims the window at the dev server only when the app is not packaged. `SATELLITE_VERIFY_FOLDER_DIALOG`, the absolute path of a file, answers the folder dialog with that file's content, which is how verify adds a project. `SATELLITE_VERIFY_IMAGE_DIALOG` answers the image dialog the same way, which is how verify chooses a project's icon. `SATELLITE_VERIFY_LINKS`, the absolute path of a file, makes `openInBrowser` append each address there instead of opening the browser. `SATELLITE_VERIFY_NOTICES`, the absolute path of a file, makes `system-notices.ts` append each notification, close and app icon count there as a JSON line instead of reaching the system, and, only when the driver check also passed at start, the questions for quitting and for saving a custom agent, both accepted, and the window then always counts as not in front. `SATELLITE_VERIFY_COPIES`, the absolute path of a file, makes `copyText` append each copied branch name there. `SATELLITE_VERIFY_UPDATES`, the absolute path of a JSON file `{ "answer", "version" }` with `none`, `ready`, `offline` or `checksum`, makes the updater a stand-in that plays that answer on each check and appends `check` and `install` to `<file>.log`, honoured only when the driver check passes as the app starts, as the copies file is. `SATELLITE_VERIFY_FOREGROUND=1` turns quiet mode off on macOS. The folder and image dialog and links files are honoured only while Satellite can signal the process `SATELLITE_VERIFY_DRIVER_PID` names, the same check quiet mode uses, which proves a live process of the same user and not that it is the driver. The notices file is honoured when that check passes at its first use and stays chosen for the run. The copies file is honoured only when that check passes as the app starts, and that choice stays for the run.
## Native modules and packaging
- **node-pty** is N-API, so one build runs in Node and Electron and packaging never rebuilds it (`npmRebuild: false`). Every system uses its bundled builds, so `npm ci` compiles nothing. Its version is an exact beta, because the stable release can crash Satellite on Windows when terminals exit together. On Windows its `pid` is 0 until the terminal connects, so read it when it is needed and never look up or stop id 0. Only `src/main/platform/pty.ts` imports it. `terminal-host.ts` relies on its Windows error paths with the system ConPTY, where every error with a number comes before the process is created, `-1` means no number, and an exit can come without a code. `startedNothing` there lists the messages node-pty throws before any process or waiting connection exists, and on macOS and Linux an exit code counts only once `isGone` agrees. Read `windowsPtyAgent.js`, `windowsTerminal.js`, `conpty.cc`, `unixTerminal.js`, `pty.cc` and `utils.js` again, and check every message in that list, before upgrading node-pty or setting `useConptyDll`.
- **Electron's binary** is fetched by `postinstall`, since the electron package installs nothing by itself. CI's check job skips it with `ELECTRON_SKIP_BINARY_DOWNLOAD=1`, because it never launches the app.
- **Windows kills.** node-pty's own kill forks a helper, and with the run-as-Node fuse off a fork starts a second Satellite. `PtyProcess.kill()` ends the tree with the start-checked stop in `process-tree.ts` first and calls node-pty's kill only when the exit never comes. Nothing uses `taskkill`, whose tree flag follows parent ids with no start check. Never call node-pty's kill directly.
- **Packaging.** `electron-builder.yml` ships `out/` and `package.json` as `app.asar`, unpacks only node-pty's and `@parcel/watcher`'s native files with smart unpacking off, keeps only this platform's node-pty build, drops tests, source maps and `node-addon-api`, puts `third-party-licenses.md` in the resources folder and flips the fuses. A runtime dependency with native code needs the same `asarUnpack` and `files` treatment, and its licence reaches the notices by itself because `scripts/third-party-licenses.ts` adds every runtime dependency. macOS packages are ad-hoc signed, except a release from a version tag, which `electron-builder.signed.yml` signs with the Developer ID and notarizes in CI with the `release` environment's secrets. Signing never runs on a developer's machine. To package one Mac architecture, `npm run build`, then `npx electron-builder --mac --arm64 --publish never`.
- **Platforms and release.** `.github/workflows/platforms.yml` proves and packages macOS, Windows and Linux, or only the systems asked for. CI runs it on every pull request and every push to `main` that changes more than docs, packaging only the unpacked app, on Linux with the smoke journeys for a pull request and on all three with every journey for `main`, and `.github/workflows/release.yml` runs it with every installer for a tag. `publish` in `electron-builder.yml` makes packaging write the update files, `latest*.yml` and the blockmaps, which a release uploads with the packages, and every package step keeps `--publish never`. `ARCHITECTURE.md` Packaging and fuses says how.