본문으로 건너뛰기
cccskills
무료GitHub에 공개

browser-companion

Zero-dependency live-preview server providing an agent↔browser bidirectional companion. Watches a content directory, wraps HTML fragments in a frame template, broadcasts live-reload over WebSocket, and captures browser-side click events to a JSONL file. Use when an agent needs to show HTML to the user in a browser and react to clicks — mockups, design exploration, gallery browsing, multi-select choices, prototype iteration. Triggered by "live preview", "browser companion", "preview server", "browser mockup", "show in browser", "arkhe-preview", or any skill that wants to write HTML fragments and have the user see them reload in real time.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(17)

  • SKILL.md4.9 KB
  • EXAMPLES.md6.9 KB
  • examples/brainstorm/frame-template.html5.3 KB
  • examples/brainstorm/helper.js4.1 KB
  • examples/brainstorm/README.md2.2 KB
  • examples/gallery/frame-template.html1.3 KB
  • examples/gallery/helper.js2.0 KB
  • examples/gallery/README.md2.7 KB
  • scripts/frame-template.html2.6 KB
  • scripts/helper.js2.5 KB
  • scripts/server.cjs12.8 KB
  • scripts/start-server.sh6.0 KB
  • scripts/status-server.sh1.0 KB
  • scripts/stop-server.sh1.9 KB
  • TROUBLESHOOTING.md7.6 KB
  • USAGE.txt3.0 KB
  • WORKFLOW.md9.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Browser Companion

A zero-dependency Node.js HTTP + WebSocket server that turns a directory of HTML fragments into a live-reloading preview, with browser→agent click event capture.

The skill ships a public CLI arkhe-preview placed in plugins/devtools/bin/. Any plugin's skill can invoke it as a bare bash command — no need to know the devtools install path.

Quick Start

# Start a server scoped to the current project
arkhe-preview start --project-dir "$(pwd)"

# Output (one JSON line on stdout):
#   {"type":"server-started","port":54123,"url":"http://localhost:54123",
#    "screen_dir":".../<id>/content","state_dir":".../<id>/state",
#    "session_dir":".../<id>","pid":12345}

# Tell the user to open the URL. Then write HTML to screen_dir:
echo '<h2>Hello</h2><button data-event="ok">OK</button>' > "$SCREEN/content.html"

# Browser auto-reloads. User clicks. Read events:
tail -f "$STATE/events.jsonl"

# When done:
arkhe-preview stop "$SESSION_DIR"

When to Use This

  • Design / mockup loops — write HTML to screen_dir, browser shows it
  • Multi-select / variant selection — give the user clickable options, read events.jsonl to learn what they picked
  • Iteration on generated UI — overwrite fragment → instant reload
  • Cross-plugin — any plugin's skill can call arkhe-preview directly; it lives in devtools but its CLI is on PATH whenever devtools is enabled

Core Commands

arkhe-preview start [options]      # Print {url, screen_dir, state_dir, session_dir, pid} JSON
arkhe-preview stop <session-dir>   # Graceful SIGTERM, falls back to SIGKILL
arkhe-preview status <session-dir> # {running, pid, url} JSON (always exits 0)
arkhe-preview --help               # Full option reference (USAGE.txt)

Common start options:

  • --project-dir <path> — store under <path>/.claude/preview/<id>/ (default: /tmp/arkhe-preview-<id>/)
  • --frame-template <path> — override default HTML frame
  • --helper <path> — override default browser-side helper JS
  • --port <N> — pin a specific port
  • --owner-pid 0 — disable the watchdog (use idle timeout only)

Custom Frame & Helper

Default frame is neutral — a small header, OS-aware light/dark theming, no domain UI. Default helper captures clicks on [data-event] and ships them as JSONL events.

For richer UIs (indicator bars, gallery sidebars, multi-select chrome), supply a custom frame template and helper:

arkhe-preview start --project-dir "$PWD" \
  --frame-template ./my-frame.html \
  --helper ./my-helper.js

Frame template must contain <!-- FRAGMENT --> (canonical) or <!-- CONTENT --> (legacy alias) where the agent's HTML will be inserted.

Reference example flavors live in ${CLAUDE_PLUGIN_ROOT}/skills/browser-companion/examples/:

These are static reference docs, NOT runtime presets. Copy what fits.

Session Layout

<project>/.claude/preview/<session-id>/
├── content/                 # Agent writes HTML fragments here
├── state/
│   ├── server-info          # JSON: url, port, host, pid
│   ├── events.jsonl         # Append-only browser events (one JSON object/line)
│   └── server.pid           # Server PID
└── logs/
    └── server.log

Event Schema

Every WebSocket message from a browser client is persisted to events.jsonl as one JSON line. Server adds timestamp (ISO 8601) and clientId if not already present. No filtering — consumers parse what they care about.

{"timestamp":"2026-05-21T12:34:56.789Z","clientId":"a1b2c3d4","type":"click","action":"ok","payload":{"foo":"bar"},"text":"OK","id":null}

See Also

  • WORKFLOW.md — full protocol, CLI contract, WebSocket details, lifecycle, attribution
  • EXAMPLES.md — end-to-end walkthroughs
  • TROUBLESHOOTING.md — port collisions, watchdog issues, PATH not refreshed, etc.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

adr

무료

Create, review, and manage Architecture Decision Records (ADRs) with auto-numbering, template detection, quality review, and index maintenance. Use when user mentions "ADR", "architecture decision", "document this decision", "create ADR", "review ADR", editing ADR files (docs/adr/, doc/adr/, .adr/), or discussing architectural choices and tradeoffs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

joaquimscosta/arkhe-claude-plugins212026년 10월 16일 업데이트

architect

무료

Analyze system architecture, module structure, API contracts, data models, and code patterns. Use when designing systems, reviewing module boundaries, evaluating API designs, analyzing data models, checking pattern conformance, tracing decisions, or reviewing frontend architecture. Triggers: "architecture", "module design", "API design", "data model", "boundaries", "patterns", "decisions", "frontend architecture".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

joaquimscosta/arkhe-claude-plugins212026년 10월 16일 업데이트

Converts natural-language descriptions or UI spec files into optimized Google Stitch prompts. Use when creating, refining, or validating design directives for Google Stitch. Use when user says "create a Stitch prompt", "optimize this for Stitch", "convert this spec to a Stitch prompt", "write a UI prompt", or mentions Google Stitch prompt authoring. Follows Stitch best practices with short, directive prompts focused on screens, structure, and visual hierarchy.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

joaquimscosta/arkhe-claude-plugins212026년 10월 16일 업데이트

Deletes merged git branches (local and remote) and flags stale unmerged branches for manual review. Use when user mentions "cleanup branches", "delete merged branches", "prune old branches", "remove stale branches", "branch cleanup", or runs /cleanup-branches command.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

joaquimscosta/arkhe-claude-plugins212026년 10월 16일 업데이트

Interactive Claude Code environment setup wizard. Detects existing configuration, guides through best-practice setup for Global CLAUDE.md, project scaffolding, MCP servers, hooks, custom agents, keybindings, and settings. Use when user runs /devtools:code-env-setup, mentions "setup claude code", "configure claude", "claude code setup", "environment setup", or "initialize claude code".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

joaquimscosta/arkhe-claude-plugins212026년 10월 16일 업데이트

Explains complex code through clear narratives, visual diagrams, and step-by-step breakdowns. Use when user asks to explain code, understand algorithms, analyze design patterns, wants code walkthroughs, or mentions "explain this code", "how does this work", "code breakdown", or "understand this function".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

joaquimscosta/arkhe-claude-plugins212026년 10월 16일 업데이트

joaquimscosta의 스킬 모두 보기

이 스킬의 문제 신고