/office-sim:office [start|stop|status|demo|auth]from office-sim
Starts or reuses the local Office Sim server (office-sim) and opens its 3D office page, where the Claude Code, Codex, Grok and Antigravity sessions on this machine work as office staff. Use when the user types /office (or /office start, stop, status, demo, auth), asks to open or show the office, or wants to see what the agents are doing; also to check or stop the office server.
Ships in office-sim. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Office Sim is a local Node server with no dependencies (Node 22 or later; 22 and 24 are tested). It tails coding-agent session logs and serves a three.js office at http://127.0.0.1:4747/. This skill starts or reuses it, opens the page, reports its status, or stops it. Run each command with the Bash tool. Reply in the user's language (Korean when they write Korean).
Rules:
~/.claude/projects, ~/.codex, ~/.grok, ~/.gemini). Read only /healthz answers and the server's own office-sim: lines.http://127.0.0.1:<port>/, with ?t=<token> under --auth), plus #demo for demo. Never put a file path in a URL. Never pass --host.The skill is either a symlink into an office-sim checkout or a copy, and that decides how the server is run. With <base> = this skill's base directory (given above as "Base directory for this skill"; normally ~/.claude/skills/office), run:
node -p 'const p=require("path"),f=require("fs");const r=p.resolve(f.realpathSync(process.argv[1]),"..","..");f.existsSync(p.join(r,"bin","office-sim.mjs"))?r:"MISSING"' "<base>"
npm run skill:install). Call the path <root>; the server is run as node "<root>/bin/office-sim.mjs".MISSING or fails: the skill is a copy with no checkout behind it, either the office-sim plugin (the command is then /office-sim:office; read /office below as that) or the copy made by office-sim init. There is no <root>: the server is run from npm as npx -y office-sim@latest (it needs npx, and the network when the package is not cached yet). The steps below say what changes "without a checkout".Take the first argument, lowercased: none or start -> start; stop; status; demo (start, then open <url>#demo); auth (start with --auth). Without an argument, infer it from the user's words (default start). Anything else: list these five and stop.
node -e 'const t=setTimeout(()=>{console.log("down Timeout");process.exit(0)},1500);fetch("http://127.0.0.1:4747/healthz",{signal:AbortSignal.timeout(1000)}).then(async r=>console.log(r.status,(await r.text()).slice(0,2000))).catch(e=>console.log("down",e.cause?.code||e.name)).finally(()=>clearTimeout(t))'
200 with JSON that has "ok":true and an agents array: office-sim, open mode.401 unauthorized: open the URL printed by office-sim: office-sim started with --auth.down ECONNREFUSED: nothing on port 4747.down Timeout, down ECONNRESET, another status or body), or no output at all: port 4747 is held by another program.Probe and report one of: running (URL http://127.0.0.1:4747/, agents, sessions, clients, and the build as version and commit, where null means unknown), running with --auth (stats need the browser cookie), not running, or port 4747 used by another program. Start nothing.
When running, also check the counters badLines, skippedLines, applyErrors, loopErrors, linkErrors, rejectedRefs and each runners.<agent>.scanErr. Only if one is non-zero or set, add one line "기록을 읽다 문제가 생겼어요" (in the user's language) with the non-zero counters and scanErr of each agent from runners (rejectedRefs has no agent). All zero and null: say nothing about them.
auth: reuse it. <url> = http://127.0.0.1:4747/, agents = the agents array. Check who started it: run the stop command (below) with 4747 added after its last argument; it then kills nothing and prints ours pid <n> (started from this repo, so /office stop stops it) or not ours. On Windows run only the first two PowerShell lines: a non-empty $m means ours. Without a checkout skip this check: it is ours only if you started it earlier in this conversation, else not ours. Go to step 4.auth: say an open server is already running; offer /office stop then /office auth. Stop.--auth: reuse it only if you started it earlier in this conversation and still have its printed URL (go to step 4). Otherwise say its token URL is in the output of whoever started it and offer /office stop then /office auth. Stop.<port> = 4747. Port held by another program: <port> = 0 (any free port).<out>:
mktemp "${TMPDIR:-/tmp}/office-sim.XXXXXX"
Then start the server as a background process (Bash with run_in_background: true). <flags> is --auth for auth, else empty. Keep --no-open and never pass --open: step 4 opens the page so you see whether that worked.
node "<root>/bin/office-sim.mjs" --port <port> <flags> --no-open > "<out>" 2>&1
Without a checkout, start npx -y office-sim@latest --no-open <flags> --port <port> > "<out>" 2>&1 the same way instead.node --input-type=module -e '
import fs from "node:fs";
const lines = () => { try { const t = fs.readFileSync(process.argv[1], "utf8"); return t.slice(0, t.lastIndexOf("\n") + 1).split("\n").filter((l) => l.startsWith("office-sim: ")); } catch { return []; } };
for (let i = 0; i < 40 && !lines().some((l) => !l.startsWith("office-sim: http://")); i++) await new Promise((r) => setTimeout(r, 250));
const out = lines(); console.log(out.join("\n") || "office-sim: no output after 10 s");
const url = out.map((l) => l.slice(12)).find((u) => u.startsWith("http://"));
const keep = setTimeout(() => {}, 1500);
if (url) console.log("healthz", await fetch(new URL("/healthz", url), { signal: AbortSignal.timeout(1000) }).then((r) => r.status, (e) => "down " + (e.cause?.code || e.name)));
clearTimeout(keep);
' "<out>"
<url> is the office-sim: http://... line (it carries ?t=<token> under --auth); the agents are the office-sim: agents ... line. healthz 200 (or 401 with --auth) means ready. If an office-sim: line contains EADDRINUSE (another start took 4747 first), probe once more and act as in step 1 on the result (reuse, or start again with <port> = 0). Otherwise, if there is no URL line or healthz is down, show the printed office-sim: lines and stop. Without a checkout, npx may first download the package: when the command prints only office-sim: no output after 10 s, run it once or twice more; if that line is still all it prints, say that npx could not start the server (npm's own message is in <out>) and stop.<page> = <url>, or <url>#demo for demo:
mcp__Claude_Browser__preview_start is available, call it with {"url": "<page>"}; that counts as opened.auth: do not run an opener (a browser it starts keeps the token URL in its process arguments, readable by other local users); give the URL to paste instead.open "<page>", Linux xdg-open "<page>", Windows cmd /c start "" "<page>") with this command, which waits at most 3 s and prints one line:
node -e '
const [cmd, ...args] = { darwin: ["open"], win32: ["cmd", "/c", "start", "\"\""] }[process.platform] || ["xdg-open"];
const done = (s) => { console.log(s); process.exit(0); };
setTimeout(() => done("opener still running"), 3000);
const c = require("child_process").spawn(cmd, [...args, process.argv[1]], { detached: true, stdio: "ignore", windowsVerbatimArguments: true });
c.on("error", (e) => done("open failed " + cmd + " " + e.code));
c.on("exit", (code) => done(code === 0 ? "opened" : "open failed " + cmd + " exit " + code));
' "<page>"
opened and opener still running (it started a browser and waits for it) mean opened; open failed ... means it did not. On Windows start reports success even when nothing opens, so say you asked Windows to open it.auth, say you did not open it on purpose).none means no session log folder was found).ours pid: it keeps running in the background while this Claude Code session is open, and /office stop stops it. Otherwise (not ours): it was already running, started outside /office (for example npm start in a terminal, or another checkout); stop it there with Ctrl-C, as /office stop leaves it running.--auth: the URL holds a per-run token; open it once and the browser keeps a cookie. With <port> 0: /office status only probes 4747 (/office stop still finds it).Stop only office-sim servers started from this repo: processes whose command is node <root>/bin/office-sim.mjs .... Never kill anything else. Without a checkout there is no such path, so run neither command below: stop the background task you started the server with in this conversation (with the tool that stops a background Bash command), and if you started none, stop nothing.
macOS and Linux:
node -e '
const [bin, port] = process.argv.slice(1);
const rows = require("child_process").execFileSync("ps", ["-ww", "-eo", "pid=,args="], { encoding: "utf8", maxBuffer: 64e6 }).split("\n");
const ms = rows.map((l) => l.trim().match(/^(\d+)\s+((?:\S*\/)?node)\s+(.*)$/)).filter((m) => m && (m[3] === bin || m[3].startsWith(bin + " ")) && Number(m[1]) !== process.pid);
if (port) { const o = ms.filter((m) => (m[3].match(/ --port[= ](\d+)/)?.[1] ?? "4747") === port); console.log(o.length ? "ours pid " + o.map((m) => m[1]).join(", ") : "not ours"); process.exit(0); }
const done = [], failed = [];
for (const m of ms) { try { process.kill(Number(m[1]), "SIGTERM"); done.push(m[1]); } catch (e) { failed.push(m[1] + " (" + e.code + ")"); } }
if (done.length) console.log("stopped pid " + done.join(", "));
if (failed.length) console.log("could not stop pid " + failed.join(", "));
if (!ms.length) console.log("no office-sim from this repo is running");
' "<root>/bin/office-sim.mjs"
Windows (PowerShell), with <root> in Windows form (double any ' in it):
$b = [regex]::Escape('<root>') + '[\\/]bin[\\/]office-sim\.mjs'
$m = @(Get-CimInstance Win32_Process -Filter "Name='node.exe'" | Where-Object { $_.CommandLine -match ('^(?:"[^"]*[\\/]|[^"\s]*[\\/])?node(?:\.exe)?"?\s+"?' + $b + '"?(?:\s|$)') })
foreach ($p in $m.ProcessId) { try { Stop-Process -Id $p -ErrorAction Stop; "stopped pid $p" } catch { "could not stop pid $p" } }
if (-not $m) { "no office-sim from this repo is running" }
The server exits within 3 s of SIGTERM. Probe again (once more if it still answers) and report what was stopped, and any could not stop pid line (another user's process, or one that already exited). If port 4747 still answers as office-sim, say it was started another way (for example npm start in a terminal, or npx in another Claude Code session) and leave it running.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub wahyzmaster/office-sim --plugin office-sim