Install rules-manager

Compose and watch agent-rules with the rulesd daemon and an Electron tray UI.

Prerequisites

  • D toolchain (dub + DMD or LDC) to build rulesd

  • Node.js + pnpm for the tray UI

  • A clone of agent-rules (or your fork)

Configure

Write a default config under $CODE_ROOT:

cd daemon
dub run -- --write-config --code-root C:\code

Edit $CODE_ROOT/rules-manager.config.json:

  • rules_repo_path — absolute path to your agent-rules clone (prefer the real clone under .forks/; junctions are temporary)

  • hostname_map — map COMPUTERNAME / hostname to laptop or desktop

  • composed_path — usually $CODE_ROOT/agent-rules.composed.md (machine-local; never commit)

JSON is the v1 config format; SDL/JSON5 is preferred later per Software Product Essentials.

Run the daemon

cd daemon
dub run -- --compose          # one-shot
dub run -- --serve            # watch + IPC on 127.0.0.1:17355 (default)

IPC:

  • GET /health

  • GET /status

  • GET /debug

  • POST /compose

Tray UI

cd ui
pnpm install
pnpm start

The app lives in the system tray / menu bar. Open Settings or Compose now from the tray menu. The UI talks only to rulesd over localhost JSON; it does not write rules files itself.

Desktop environments (Linux)

DE Expectation

GNOME

StatusNotifier / AppIndicator. If the shell hides legacy trays, install a tray extension (for example AppIndicator support).

KDE Plasma

StatusNotifier in the system tray panel.

XFCE

Panel notification area applet.

COSMIC

StatusNotifier / panel applet equivalent.

Windows uses the notification area; macOS uses a menu bar extra (dock icon is hidden).

Start at login

Windows

  • Daemon: Task Scheduler or a Run key pointing at rulesd.exe --serve --config …

  • Tray: Electron login item (app.setLoginItemSettings) or Startup folder shortcut to pnpm start / packaged exe

Packaging helpers live under packaging/windows/.

macOS

  • Daemon: LaunchAgent plist under ~/Library/LaunchAgents/ (see packaging/macos/)

  • Tray: Login Items for the packaged app

Linux

  • Daemon: systemd --user unit (packaging/linux/rulesd.service) or XDG autostart for a wrapper script

  • Tray: XDG autostart desktop entry for the Electron app

Junctions (temporary)

A directory junction into a rules clone is only a path convenience while migrating. Normal operation sets rules_repo_path in rules-manager config. Agents and docs should point at manager-managed paths; do not require junctions after rules-manager is installed.

Profiles

In the agent-rules repo:

  • profiles/laptop.md / profiles/desktop.md — constants

  • profiles/*.overlay.md — machine-only bullets (composed into the machine marker section)

Hostname → profile mapping lives in rules-manager config, not in the fork.