| name | add-host-manager |
| description | Scaffolds a new main-process manager for the Power Platform ToolBox host, following the existing settings/connections/tool-lifecycle/auth pattern and wired through `toolboxAPI`/`toolboxAPIBridge.js` so tools never get direct Node.js or Electron access. Use when asked to "add a new manager to the toolbox host for X", "the main process needs to handle a new kind of persistent state", "expose a new host capability to tools without breaking the sandbox", or "where does this new Node.js-side logic belong in the host" — typically right after `setup-toolbox-dev-env`, when a change needs new main-process capability rather than a renderer-only UI change. |
Add Host Manager
The Power Platform ToolBox host's main process is organized into managers, each owning one domain — settings, Dataverse connections, tool lifecycle, authentication, Dataverse Web API operations, OS-native encryption, terminal handling, auto-update. This skill scaffolds a new manager following that same pattern, so new host capability lands in the right place instead of getting bolted onto an unrelated existing manager.
The host is split into a main process, a renderer process, and an API layer; every tool runs inside a sandboxed iframe with no direct access to Node.js or Electron APIs, communicating only through toolboxAPI/toolboxAPIBridge.js — a new manager's tool-facing surface, if any, must go through that bridge and nowhere else.
Step 1: Scope the manager to one domain
Before writing any code, confirm the new manager owns a single, well-defined responsibility — the same way Dataverse connection CRUD is its own manager rather than folded into settings. If the request describes two unrelated concerns ("handle environment variables and also manage terminal themes"), that's two managers, not one.
Step 2: Place it in src/main/
Add the new manager under src/main/, alongside the existing managers, rather than mixing its logic into settings, connections, tool lifecycle, auth, Dataverse Web API, encryption, terminal, or auto-update: