| name | command-scaffold |
| description | Add a new command to WibWob-DOS — walks the 4-file wiring path so you don't miss a step. Use when: "add a command", "new command", "wire a command", "scaffold command".
|
Command Scaffold
Adding a command touches 4 files. This skill walks the path.
The 4 files (in order)
1. src/core/command-catalog.ts
Add the command definition AND the action key to AppMenuActions:
myAction: (args?: Record<string, unknown>) => unknown;
{
id: "group.verb",
label: "Human Label",
description: "What it does. Args: name (type).",
group: "group",
actionKey: "myAction",
palettePlacement: { order: 100 },
api: true,
agent: true
}
2. src/domain/command-definition.ts
If group is new, add it to the AppCommandGroup union type.
3. src/core/app-controller.ts
Add the action to the actions object (search for existing actions near yours):
myAction: (args) => {
return { ok: true };
},
4. src/services/control-api.ts (if API-exposed)
Add endpoint to the ENDPOINT_TABLE array AND add the route handler:
{ method: "POST", path: "/my/endpoint", body: { arg: "type" }, description: "..." },
if (request.method === "POST" && url.pathname === "/my/endpoint") {
}
After wiring
bun run typecheck
bash scripts/restart.sh
bash scripts/doc-sync.sh
See also
GOTCHAS.md §Adding a command — documents the 4-file tax.