/solopreneur:previewfrom solopreneur
Creates interactive HTML previews of proposals, plans, docs, and specs. Supports local library, ephemeral desktop files, or Vercel deployment for sharing.
Ships in solopreneur. 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.
Read when SKILL.md points to them; scripts run unread.
This is the first action. Decide the delivery mode before reading Preview Library config, running Vercel preflight/setup, creating files, using the network, or making any other state change:
vercel only when the user explicitly asks for Vercel, an
online deployment, cross-device access, or external sharing.ephemeral only for explicitly temporary work — "quick look",
"看完就丟", "just drop it on my Desktop" — or when the user names the
output path themselves.library for everything else. library is the default; a request
such as "give me a link" still means a clickable local file:// link.
Misrouting is asymmetric — a real deliverable sent to a throwaway file is
lost after the look, while a throwaway in the Library is one extra catalog
row — so ambiguity always lands in the Library.Run the side-effect-free resolver from this skill directory with no argument
for library, or with exactly one flag for the explicit intents above:
node scripts/resolve-delivery.mjs [--ephemeral | --vercel]
Follow only the workflow it prints. On a Codex host (CODEX_THREAD_ID set),
--vercel fails closed before any network or state change. Stop immediately,
repeat the resolver's Codex Phase 1 local-only limitation, and do not substitute
a local artifact for the explicitly requested deployment. Claude Code may
continue through the existing Vercel workflow. library and ephemeral are
pure local file operations, available on Claude Code and Codex alike.
Turn any proposal / plan / idea into interactive HTML and hand the user a link
they can open. Library delivery writes into the content root and returns a
file:// link into the freshly rebuilt local library. Explicit remote delivery
publishes the existing private Library; an external one-off link uses Share
(same Vercel project, Preview environment only — never promotes Library
production).
A link they can open and try. Not a markdown wall and not a screenshot.
Library delivery returns an absolute file:// Markdown link to the item's
built page (catalog sidebar included). Ephemeral delivery returns an
absolute-path link to one standalone file. Explicit Vercel delivery returns
the existing Library or Share URL.
This workflow is available on Claude Code and Codex and is the default.
Deep reference (schema, setup, deploy internals): ../../shared/config.md, relative to this skill inside an installed package (canonical source: src/solopreneur/shared/config.md).
Config is path-scoped, not git-remote-scoped. From the content path (or cwd when creating new work), walk up for the nearest .solopreneur.json that contains a preview block. Full resolution order and rules: config-resolve.mjs / shared/config.md.
# Inspect what the tools will use (anchor at the content path or cwd)
node scripts/config-resolve.mjs --from "$CONTENT_OR_CWD" # see script --help for flags
root is resolved against the config file's directory, not git root..solopreneur.json fully replaces a parent preview block (no deep merge).my-private-previews).No v2 config resolves (mode none or legacy): library mode is
unavailable here — say so in one line and deliver through the Ephemeral
workflow instead. Creating a new content root stays an explicit setup action
(setup.mjs, Vercel-oriented — do not invent projects or silently create
roots). Legacy solopreneur.json cascades still work for the escape hatch;
prefer migrating with config-migrate.mjs when the user is ready, and never
silently rewrite their legacy file.
Self-assess ambiguity before writing: only ask which deliverable if ≥2 separable topics, bare "preview" after a wide discussion, or multiple candidate artifacts. Otherwise state what you are previewing in one line and proceed.
<root>/ # preview.root from resolved config
├── active/<id>/
│ ├── index.html
│ ├── preview.json
│ └── …assets (relative only)
├── archive/<id>/
│ └── …
└── library/ # generated local library (gitignored, never edited)
active/<id>/ with index.html + preview.json.id, same directory. When content or display metadata actually changes: revision += 1, refresh updatedAt and provenance.lastUpdatedBy. Unchanged re-publish and Share do not bump revision.id: lowercase slug [a-z0-9-]+, unique across all included collections.active vs archive); do not duplicate status in metadata.Prefer, in order: preview id from URL / Share or archive request → caller-given id → sourceRef in metadata. Title similarity alone never auto-merges. Same id or same sourceRef → treat as update candidate. Fork only when the user says so.
preview.json (required fields)Write a sidecar in the Library source tree only — never deploy raw preview.json; the builder projects an allowlist into directory.json:
{
"schemaVersion": 1,
"id": "2026-07-25-short-slug",
"title": "Human title",
"createdAt": "2026-07-25T10:00:00+08:00",
"updatedAt": "2026-07-25T12:00:00+08:00",
"revision": 1,
"entry": "index.html",
"provenance": {
"createdBy": { "agent": "Builder Claude", "platform": "claude", "sessionTitle": "optional" },
"lastUpdatedBy": { "agent": "Builder Claude", "platform": "claude", "sessionTitle": "optional" }
}
}
id, title, createdAt, updatedAt, revision, and provenance parties' agent + platform.sessionTitle only when known — never invent.project (label only), sourceRef (workspace-relative stable ref, not absolute paths), tags.entry v1 must be index.html.scripts/preview-schema.json.Start from assets/template.html (placeholders {{TITLE}} / {{DATE}} / {{LEAD_PARAGRAPH}} / {{AUTHOR_OR_CONTEXT}}).
The builds inject shared comment-overlay.js and preview-shell.js — the local library build and the Vercel publish alike. You may still reference ./comment-overlay.js in the template for raw-source review; the builder rewrites it to the shared asset. Prefer not treating per-item overlay copies as the durable happy path.
Contract (v1 static): single index.html, relative assets only. No root-relative /assets/..., no SPA history fallback, no entry outside the item dir. Read references/libs.md before Alpine / Chart.js / Mermaid.
Form follows content (calculator, doc, charts, etc.) — same guidance as before.
Full-bleed slides: wrap in <main class="doc">, set body.cmt-full-bleed when needed (see template comments).
After content is ready (and preferably committed when the content root is git-backed):
node scripts/build-library.mjs --local --from "$PATH_UNDER_ROOT"
# machine-readable:
node scripts/build-library.mjs --local --json --from "$PATH_UNDER_ROOT"
<root>/library/ — generated output, never edited, never committed. A
failed build leaves the previous library untouched, and re-running is the
recovery. Concurrent builds of one root are serialized by a lock; if a
build was hard-killed, the next one refuses to start and names the stale
lock file to delete./library/ + /library.* to the content root's
.gitignore and reports it — commit those lines with the content. The glob
covers the build's swap siblings (library.tmp, library.bak,
library.lock); untracked build output would otherwise dirty the root and
trip the deploy fetch-guard.file:// with the full Library UX: catalog
sidebar, provenance footer, comment overlay. Comments persist per item in
that browser's localStorage (this machine only — export markdown if they
matter elsewhere).[Open preview](file:///…/<root>/library/p/<id>/index.html) — and mention
the library home <root>/library/index.html when useful. Run open only
when the user explicitly asks.Sidebar Manage mode copies a structured block (agent contract):
## library archive request
library: <label>
exported: <ISO timestamp>
archive(active → archive):
- <id> — <title>
restore(archive → active):
- <id> — <title>
(給 agent:對每個 id 做 mv <root>/<from>/<id> <root>/<to>/<id>,全部完成後重新發布 library。)
When the user pastes this:
mv <root>/active/<id> <root>/archive/<id> (keep id).build-library.mjs --local, plus one
deploy-library.mjs republish when the Library is also published on Vercel.Keep the existing comment + revision workflow:
## comments on: …).<del> / <ins>, apply new changes as visible diff, refresh a top revision-log callout, rebuild the local library (same id, revision +1 when content changed); republish Vercel only when that is where the user reviews.preview_comments_v3:<id>) in the browser that made them. The local library and a Vercel deployment are different origins — comments do not travel between them, or across Share origins. Export if they matter.See "The comment overlay" below for UX detail.
This is the existing Library v2 publish path. Enter it only after the delivery
resolver prints vercel. Content rules are the Library workflow's steps 1–3 —
the same content root, items, and HTML feed both renderings. Legacy
three-bucket / deploy.sh is an escape hatch only (see below).
Always run bash scripts/preflight.sh before drafting HTML. It checks Vercel CLI + auth.
vercel CLI ready, proceeding…) and continue.npm i -g vercel / vercel login), view HTML locally only, or cancel. Re-run preflight until pass or the user chooses local-only / cancel.No v2 config found: run first-run setup — do not invent projects.
node scripts/setup.mjs
# optional: --project my-private-previews --team <teamId>
Setup proposes one private target, creates dirs only after confirm, and fail-closes if protection cannot be verified. It never auto-creates three Hana buckets.
node scripts/deploy-library.mjs --from "$PATH_UNDER_ROOT"
# machine-readable:
node scripts/deploy-library.mjs --json --from "$PATH_UNDER_ROOT"
deploy.sh --bucket keep for Library content (pollutes Library production history).The page Share… control only builds a copyable JSON request (no token, no deploy). Example:
{
"schemaVersion": 1,
"kind": "preview-share-request",
"previewId": "<id>",
"revision": 4,
"contentHash": "sha256:<hash>",
"url": "<current library item URL>",
"access": "project-members"
}
access: project-members (default) or anyone-with-link.
When the user pastes a request (or asks to share an id):
# request on stdin, or --request <file>
node scripts/deploy-share.mjs --from "$PATH_UNDER_ROOT" --request - <<'EOF'
{ ...share request JSON... }
EOF
--prod / promote; Library production unchanged./ for that item only (no catalog / other /p/ / raw preview.json).deploy-share.mjs --list / --revoke (see script usage; shareable-link secret may be required to revoke).Enter only when the resolver prints ephemeral — explicitly temporary work or
a user-named output path — or as the stated fallback when no v2 config
resolves in library mode. The artifact joins no catalog and carries no shell
or overlay chrome.
Choose one output file. A user-specified path wins. For temporary work
with no path, use ~/Desktop/<safe-slug>.html, where the slug is lowercase
ASCII [a-z0-9-], repeated hyphens are collapsed, and an empty result falls
back to preview. Resolve the final path to an absolute path.
Refuse silent overwrite. Unless the user explicitly asked to update or replace that exact file, atomically reserve the target after the delivery mode is decided:
node scripts/reserve-local-output.mjs "$ABSOLUTE_TARGET"
Use only the absolute path it prints. An existing target is preserved and
receives a collision-free sibling such as <safe-slug>-2.html.
Write exactly one self-contained HTML file. Write into the reserved file
(or the explicitly approved replacement). Put all CSS in <style> and
all necessary JavaScript in inline <script> blocks. Use inline SVG or data
URIs for required images. The file must render directly under file://
without a server, build step, external stylesheet/script/module, CDN,
runtime fetch, or relative asset. Omit JavaScript when HTML/CSS is enough.
assets/template.html is a Library-oriented visual reference only: its CDN
and comment-overlay.js references must not appear in an ephemeral artifact.
Keep ephemeral delivery isolated. Create no preview.json, write no
.solopreneur.json / solopreneur.json, run no setup.mjs,
preflight.sh, or deploy script, create no .vercel, and make no
Vercel/network calls. Config reading is not part of this workflow either —
the no-config Library fallback has already done its one read by the time it
lands here. The output HTML is the only delivery artifact.
Verify and hand off. Confirm the file exists, contains its required
inline CSS/JS, and has no runtime asset dependency. Return a clickable
absolute-path Markdown link such as [Open preview](/absolute/path/file.html).
Run open only when the user explicitly asks to open it.
Wanting to keep an ephemeral page later is not a feature — move it into
active/<id>/, add a preview.json, rebuild the library. Ordinary file
operations, on request.
Use only when there is no v2 Library config, or for living-spec / slides / explicit migration rollback.
deploy.sh (arbitrary directory)scripts/deploy.sh <path-to-dir>
# optional: PREVIEW_PROJECT=... or --bucket default|keep|public
Prints one URL to stdout. Buckets (default / keep / public) live in legacy solopreneur.json. Not the default for new /preview work when a Library config resolves.
Path probing + solopreneur.json helpers for legacy flat docs/preview/<date>-<slug>/ dirs remain valid for this escape hatch only. Prefer active/<id>/ whenever v2 applies.
Margin-style annotations (Google Docs / Medium-like), identical in the local library and on Vercel:
+ comment → note → yellow marker + gutter card; stored in localStorage for the review session.export comments → markdown with quotes + context.<del> / <ins>: Clean / Show edits toggle (defaults to showing edits).Agent revision rules:
delete old <del>, unwrap old <ins>).<del> / <ins> only — never silent replace.revision-log callout for this round only.preview.json, write config, run setup/preflight/deploy,
or use the network in ephemeral mode.<root>/library/ — generated output; commit
items + preview.json (+ the .gitignore line when first added) instead.open without an
explicit request.index.html + assets.| Path | Role |
|---|---|
scripts/resolve-delivery.mjs | Side-effect-free library / ephemeral / Vercel gate |
scripts/reserve-local-output.mjs | Atomic no-overwrite ephemeral path reservation |
scripts/preflight.sh | Vercel CLI + auth |
scripts/config-resolve.mjs | Path-scoped v2 + legacy resolve |
scripts/config-migrate.mjs | Legacy → v2 proposal + write |
scripts/setup.mjs | First-run private target |
scripts/build-library.mjs | Scan collections → staging; --local swaps <root>/library/ |
scripts/deploy-library.mjs | Staged Library publish |
scripts/deploy-share.mjs | Single-item Share Preview |
scripts/deploy.sh | Legacy arbitrary-dir deploy |
scripts/preview-schema.json | preview.json schema |
scripts/resolve-provenance.mjs | Provenance display shape |
assets/template.html | HTML starter |
assets/comment-overlay.js | Comments + diff toggle |
assets/preview-shell.js | Sidebar, Manage, Share, footer |
assets/library-index.html | Library home template |
references/libs.md | Alpine / Chart.js / Mermaid recipes |
assets/comment-overlay.js (opens in a new tab)assets/library-index.html (opens in a new tab)assets/preview-shell.js (opens in a new tab)assets/template.html (opens in a new tab)references/libs.md (opens in a new tab)scripts/build-library.mjs (opens in a new tab)scripts/config-migrate.mjs (opens in a new tab)scripts/config-resolve.mjs (opens in a new tab)scripts/deploy-library.mjs (opens in a new tab)scripts/deploy-share.mjs (opens in a new tab)scripts/deploy.sh (opens in a new tab)scripts/preflight.sh (opens in a new tab)scripts/preview-schema.json (opens in a new tab)scripts/reserve-local-output.mjs (opens in a new tab)scripts/resolve-delivery.mjs (opens in a new tab)scripts/resolve-provenance.mjs (opens in a new tab)scripts/setup.mjs (opens in a new tab)scripts/vercel-protect.mjs (opens in a new tab)tests/build-library.test.mjs (opens in a new tab)tests/comment-overlay.test.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub hanamizuki/solopreneur --plugin solopreneur17 skills in this plugin
/autopilotPR orchestration planner. Reads a task file, discusses PR splitting strategy
with the user, produces plan + spec files, and either dispatches a worktree
subagent in the current session (single PR, run now) or schedules execution
via cron (multi-PR, or single-PR scheduled). Use when the user wants a task
implemented, reviewed, and merged automatically — whether the scope fits in
one PR or needs to be split. Triggers: "autopilot", "orchestrate", "batch
implement", "split into PRs and run", or when the user provides a todo/spec
and wants unattended PR execution.
/codex-agents-bootstrapInstall or refresh custom agents shipped by solopreneur-family plugins in the
Codex user agents directory. Use after installing, updating, enabling, or
disabling a solopreneur-family plugin, or when the user asks to bootstrap,
install, refresh, or diagnose Codex agents. This is unnecessary on Claude.
/greenlightAutomated PR review loop that keeps running until the PR is clean. Triggers
external reviewers (Codex bot, Codex CLI, and the Gemini bot when activity
detection sees it on the repo), processes feedback, fixes issues, and
re-triggers — repeating until no new suggestions remain.
Supports `/greenlight external` to skip internal review and go straight to
external reviewers, and `/greenlight external gemini` to specify a starting
reviewer. Use when the user says "greenlight", "run reviews until clean",
"get this PR approved", or wants automated review cycling on an open PR.
Also auto-detects uncommitted mode: when on main branch with uncommitted
changes and no PR, runs Codex CLI `--uncommitted` review loop only, fixes
in-place without committing, until codex reports clean.
Also supports post-commit mode (explicit `/greenlight post-commit <SHA>`
or `<SHA1>..<SHA2>`): Phase 1 subagents + Codex CLI + agy (Gemini-family CLI)
in parallel, fixes as new commits on top (no amend, no new PR), pushes after
each round.
/handoffGenerate a self-contained handoff context document for the current work,
printed inline as markdown so the user can copy it and paste into any other
agent — a fresh Claude Code session, Codex, ChatGPT, or an agent on another
machine. Use when the user says /handoff, "write context for the next
session", "package this for handoff", "hand off to another agent", or wants
to capture the current session's state in a portable form. Output is printed
inline AND written to `/tmp/handoff/<YYYY-MM-DD>_<slug>.md`. No worktree is created (use
worktree-handoff if a git worktree is needed).
/merge-prMerge an open PR for the current branch. Refuses to merge when the worktree
has uncommitted changes, consolidates the branch's plan file (renaming
the latest Handoff Context section to Final Progress and moving the file
to done/ in state-machine mode), merges via GitHub CLI, and reports status.
Also cleans up stale merged-but-not-removed worktrees from prior sessions
on every Claude Code run. Codex V1 uses a merge-only profile that performs
no pre-merge plan or worktree mutation.
Use when the user says "merge", "merge PR", "merge this", or wants to
land the current branch.
/mvpMeta-orchestrator for going from a product idea to a demo-able MVP fast.
Drives the full flow: brainstorming → PRD visual confirmation (user
gate) → template lookup → MVP-flavored plan → single-subagent
execution. Optimized for **time-to-first-demo**, not production
quality — no TDD, no per-task review loops, no hardening. Use INSTEAD
OF superpowers:brainstorming when the user is starting a new product
from scratch — this skill calls brainstorming internally, then chains
in a PRD confirmation phase, template discovery, plan writing, and
execution. Triggers: "/mvp", "我要做 app", "想做產品",
"想做一個 app", "做個 MVP", "build a product", "build an app from
scratch", "MVP from scratch", "start a new app", "new product".
Other plugins' skills for the same job