Skip to content

An agentic skills framework & software development methodology that works.

Write server-info to file so agents can find URL after background launch

Jesse Vincent7f8edd9c121e
diff --git a/skills/brainstorming/scripts/index.js b/skills/brainstorming/scripts/index.js
index 1e0fa1ce3..3896f9f7e 100644
--- a/skills/brainstorming/scripts/index.js
+++ b/skills/brainstorming/scripts/index.js
@@ -130,12 +130,18 @@ chokidar.watch(SCREEN_DIR, { ignoreInitial: true })
});
server.listen(PORT, HOST, () => {
- console.log(JSON.stringify({
+ const info = JSON.stringify({
type: 'server-started',
port: PORT,
host: HOST,
url_host: URL_HOST,
url: `http://${URL_HOST}:${PORT}`,
screen_dir: SCREEN_DIR
- }));
+ });
+ console.log(info);
+ // Write to .server-info so agents can find connection details
+ // even when stdout is hidden (e.g. background execution)
+ const fs = require('fs');
+ const path = require('path');
+ fs.writeFileSync(path.join(SCREEN_DIR, '.server-info'), info + '\n');
});
diff --git a/skills/brainstorming/visual-companion.md b/skills/brainstorming/visual-companion.md
index c9f6d8b30..b5f308dcc 100644
--- a/skills/brainstorming/visual-companion.md
+++ b/skills/brainstorming/visual-companion.md
@@ -42,6 +42,8 @@ scripts/start-server.sh --project-dir /path/to/project
Save `screen_dir` from the response. Tell user to open the URL.
+**Finding connection info:** The server writes its startup JSON to `$SCREEN_DIR/.server-info`. If you launched the server in the background and didn't capture stdout, read that file to get the URL and port. When using `--project-dir`, check `<project>/.superpowers/brainstorm/` for the session directory.
+
**Note:** Pass the project root as `--project-dir` so mockups persist in `.superpowers/brainstorm/` and survive server restarts. Without it, files go to `/tmp` and get cleaned up. Remind the user to add `.superpowers/` to `.gitignore` if it's not already there.
**Launching the server by platform:**