codespace-lavish
Launch a headed Lavish-AXI whiteboard over noVNC in Codespaces.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 2
- Forks
- 2
01 前言 Front Matter
- name
- codespace-lavish
- author
- gitricko, Hermes Agent
- license
- MIT
- version
- 0.1.0
- metadata
- { "hermes": { "tags": [ "lavish", "mermaid", "whiteboard", "codespace", "gui", "novnc" ], "related_skills": [ "codespace-port-visibility" ] } }
- platforms
- [ "linux" ]
- description
- Launch a headed Lavish-AXI whiteboard over noVNC in Codespaces.
02 资源文件 6
- 参考文档references/artifact-tokens.md1.8 KB
- 参考文档references/chrome-gpu-fix.md1.4 KB
- 参考文档references/session-learnings.md11.4 KB
- 脚本scripts/lavish_planning_gui.sh10.5 KB
- 脚本scripts/lavish_planning_prereqs.sh6.9 KB
- 脚本scripts/lavish-gui-sample.html883 B
03 SKILL.md 正文
Codespace Lavish Skill
Launch a headed Lavish-AXI planning whiteboard on a virtual X display, bridge it to noVNC, and start the feedback poll so the user can iterate visually. Self-installing: it verifies prerequisites and installs missing ones — it never assumes the Codespace is pre-provisioned.
When to Use
- User says "planning lavish", "plan this in lavish", or "open a lavish whiteboard".
- User wants a visual, editable Mermaid/HTML planning board rendered in a browser they can watch over noVNC.
- Don't use for: headless browser automation (use
cdp-browser-testing).
Prerequisites
bash,node>= 18,npmon PATH.sudo/root for apt installs (the--fixpath installs system packages).- Network access to download Google Chrome
.debandlavish-axivia npx. - All other deps (Xvfb, openbox, x11vnc, websockify, novnc, a browser) are checked and installed by the prerequisite script — do not pre-check them by hand.
How to Run
Through the terminal tool (scripts are repo-relative under the skill dir):
terminal(command="bash skills/codespace-lavish/scripts/lavish_planning_gui.sh --fix", timeout=300)
Optional arguments:
--fix— install missing prerequisites (required on a fresh Codespace).<artifact.html>— open a specific HTML artifact instead of generating one.--prompt "..."— generate a planning artifact from a free-form prompt.--monitor— tail the poll log for live feedback after launch (Ctrl+C to exit).
Quick Reference
# First run on a fresh Codespace (installs deps, launches everything):
bash skills/codespace-lavish/scripts/lavish_planning_gui.sh --fix
# Open a specific artifact:
bash skills/codespace-lavish/scripts/lavish_planning_gui.sh path/to/plan.html
# Generate from a prompt:
bash skills/codespace-lavish/scripts/lavish_planning_gui.sh --prompt "Plan the Q3 launch"
# Generate and monitor feedback live:
bash skills/codespace-lavish/scripts/lavish_planning_gui.sh --prompt "Plan the Q3 launch" --monitor
# Just check prerequisites (no launch):
bash skills/codespace-lavish/scripts/lavish_planning_prereqs.sh --fix
Procedure
- Run the prerequisite check via
lavish_planning_prereqs.sh. If it reports failures and you passed--fix, it installs them; if you did not pass--fix, re-run with it. Completion:RESULT: ALL REQUIRED PREREQUISITES MET. - Launch the GUI stack: Xvfb :99 + openbox + Chrome (on :99) + x11vnc (:5900) +
websockify/noVNC (:6080). Completion:
curl -s localhost:6080/vnc.htmlreturns 200. - Start the Lavish-AXI engine on loopback (default 4387) and open the artifact session.
Completion:
curl -s 127.0.0.1:4387/healthreturns{"ok":true}and/session/<key>returns 200. - Start the poll listener (background, auto-restarting) so user feedback in the whiteboard is continuously received.
Completion: a
lavish-axi pollprocess is running,/tmp/lavish-poll.logis being written, and the noVNC URL is printed. - Hand the user the noVNC URL (with auto-connect and local scaling):
https://<codespace>-6080.app.github.dev/vnc.html?autoconnect=true&resize=scaleSet port 6080 to PRIVATE in the Codespace UI for auth-gated access. Completion: user can open the URL and see the whiteboard immediately (no connect click needed, viewport scales to fit). - (Optional) Run with
--monitorto tail the poll log and see live feedback as the user interacts with the whiteboard.
Pitfalls
- Browser on Ubuntu 24.04: there is NO
chromiumapt deb (snap-transitional, snap unavailable in container). The prereq script installs Google Chrome's.debinstead. Don't "fix" this by addingchromiumto an apt line — it will fail on a fresh build. - Poll loop is mandatory: Lavish is request/response. Without a running
poll, user feedback in the whiteboard goes nowhere. If the whiteboard seems unresponsive, verify alavish-axi pollprocess is alive (see/tmp/lavish-poll.log). - Poll process must be disowned: The background poll loop (
while true; do poll; done) must run withdisownso it survives the parent script exiting. Without disown, the poll dies when the terminal tool returns. - VNC stack is persistent: The Xvfb/openbox/Chrome/x11vnc/websockify/lavish-axi stack stays running after launch. Only stop it if the user explicitly asks. Do not kill the browser or VNC services just because the launch script completed.
- Killing Chrome to reload: match the process by exact name
chrome+ its--user-data-dir=/tmp/chrome-gui, never by apgrep -fpattern that also appears in your own command line (it will kill your own shell). - Port 4387 vs dynamic slots: this skill uses the reserved default 4387 so the GUI
URL stays stable. The
lavish-axiskill's dynamic 43XX slots are a separate concern. - Artifact load tokens are ephemeral: The
loadTokenfrom the session page expires quickly. Directcurlto/artifact/<key>/index.html?loadToken=...will return "Artifact load expired". The artifact is served correctly inside the noVNC iframe when Chrome loads the session page — do not try to fetch it directly for verification. Verify viacurl 127.0.0.1:4387/healthandcurl 127.0.0.1:6080/vnc.htmlinstead. - Chrome GPU crashes on Ubuntu 24.04: In Codespace containers, Chrome's GPU process
crashes (exit_code=15) causing "GPU process isn't usable" fatal error. Fix: pass
--disable-gpu-sandbox --disable-gpu-compositing --disable-accelerated-2d-canvas --disable-accelerated-video-decode --disable-webgl --use-gl=swiftshaderto force software rendering via SwiftShader. Added tolavish_planning_gui.shChrome launch. - noVNC auto-connect + scaling via query string: The URL
https://<codespace>-6080.app.github.dev/vnc.html?autoconnect=true&resize=scaleenables automatic VNC connection (no "Connect" button) and local viewport scaling (fits to browser window). These are read by noVNC'sWebUtil.getConfigVar()from the query string/hash on page load. - Poll process survival: The disowned background poll loop can still die when the
launching shell exits. The script now uses
disown -h $POLL_PID 2>/dev/null || true(mark as no-hup) and the while-true loop restarts on exit. For maximum persistence, start the poll as a separate tracked background job if the harness supports it. - Agent reply spinner: The
poll --agent-replycommand delivers the message then enters long-polling, showing a "working" spinner in the Lavish UI. This is temporary and does NOT block the chat input — users can still type/send messages. The background poll loop (without--agent-reply) runs without a spinner. - Argument parsing for
--prompt: Use single-pass loop with((i++))to consume the next argument; two-pass approaches with a pending variable lose the value.
References
references/session-learnings.md— session-specific patterns, pitfalls, and workarounds (Ubuntu 24.04 chromium, pgrep self-match, lavish poll loop, prerequisite check pattern, npx resolution)references/artifact-tokens.md— artifact load token behavior and verification pitfallsreferences/chrome-gpu-fix.md— Chrome GPU crash fix for Ubuntu 24.04 Codespaces (SwiftShader flags)
Verification
curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:6080/vnc.html→200.curl -s http://127.0.0.1:4387/health→{"ok":true,...}.curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:4387/session/<key>→200.- A
pgrep -f "lavish-axi poll"process exists (auto-restarts on exit). /tmp/lavish-poll.logreceives feedback entries as user interacts.--monitorflag tails the poll log for live feedback.- noVNC URL with
?autoconnect=true&resize=scaleauto-connects and scales viewport. - Opening the noVNC URL shows Chrome rendering the artifact on the virtual display.
For Future Agents — Quick Start
If you're an agent picking up this task:
# 1. Ensure you're in the repo root
cd /workspaces/hermes-codespace
# 2. Launch with --fix on fresh Codespace (installs all deps)
bash skills/codespace-lavish/scripts/lavish_planning_gui.sh --fix --prompt "Your planning prompt here"
# 3. Or with a specific artifact:
bash skills/codespace-lavish/scripts/lavish_planning_gui.sh --fix path/to/artifact.html
# 4. For live feedback monitoring:
bash skills/codespace-lavish/scripts/lavish_planning_gui.sh --fix --prompt "..." --monitor
# 5. Check if already running (skip --fix):
curl -s http://127.0.0.1:4387/health
# If ok: just run without --fix
The script is idempotent — safe to re-run. It detects running services and only starts missing ones.
04 同仓库更多 Skills
version-single-source
Use when adding a new component dependency or versioning a binary in install/boot scripts.
tdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
shell-path-login
Use when a binary or script works in one shell context but not another (interactive vs non-interactive login vs non-login shell).
self-update-fix
Fix a failing dependency update PR. Use when a self-update PR's CI fails, or when invoked by scripts/self-update-fix.sh.
pr-change-log
Use when a multi-commit PR needs its description written/updated, or when closing out a long branch with many fix commits.
persistent-knowledge
Persistent skills/knowledge in Codespace via symlinks.