/publicar:publicar-deploy [HTMLファイルパスまたはZIPパス] [--project-id ID] [--profile NAME]from publicar
Deploys HTML or ZIP files to publicar and generates shareable URLs. Useful for quickly publishing static content from a local repo.
Ships in publicar. 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.
publicar は HTML/ZIP ファイルを共有 URL で配信するサービス。
HTML/ZIPの対話的な公開にはpublicar-clientを使う。GitHub Actionsから既存プロジェクトを自動更新する場合は、publicar-client ci-uploadを使う。
| 依頼 | 使用する入口 |
|---|---|
| 対話での新規公開、既存プロジェクトへの再公開、コメント修正後の反映 | この本文の publicar-client |
| GitHub Actionsから、アップロード専用キーで既存プロジェクトを更新する仕組みの設定 | CI用アップロード手順を読んでから publicar-client ci-upload を設定する |
publicar-client ci-uploadは明示された接続先とプロジェクトだけへ送信する。対話公開の接続先設定やprofileを探す代替経路には使わない。以下の「実行の原則」は両方に適用し、その後の接続先選択、publicar-clientコマンド、credential、projects.jsonの説明は対話公開のサブコマンドに適用する。
ユーザーの最新リクエストの言語に合わせて応答する。Follow the language of the latest user request.
接続先は artifact が属する git repo の repo-local 設定 publicar.endpoint だけを使う。
git config --local publicar.endpoint (.git/config)。repo の追跡ファイルには保存されない対話で公開する場合の設定・認証・API通信は、publicar-client が行う。
endpoint や API key を使った curl コマンドをこの skill の手順として組み立てない。
publicar-client コマンド<skill-dir>/../../tools/publicar-client を実行する。成功時は stdout に JSON 1 行、失敗時は stderr に {"ok":false,"error":"<code>","message":"..."} を返し、TTY 入力を要求しない。
HELPER=<skill-dir>/../../tools/publicar-client
# 現在の設定を確認 (repo / endpoint / 使用 profile)
"$HELPER" resolve --artifact <デプロイ対象パス>
# 初回の endpoint 保存 (origin はユーザーが選択したもの)
"$HELPER" select --artifact <デプロイ対象パス> --origin https://publicar.example.com
# endpoint の明示変更 / 解除
"$HELPER" change --artifact <デプロイ対象パス> --origin https://other.example.com
"$HELPER" clear --artifact <デプロイ対象パス>
# project 作成 + デプロイ (HTML または ZIP)
"$HELPER" create-and-deploy --artifact <HTMLまたはZIPパス> [--title "タイトル"] [--profile NAME]
# 既存 project への再デプロイ (--project-id 指定時。comment-loop の再デプロイが使う)
"$HELPER" deploy --artifact <HTMLまたはZIPパス> --project-id <ID> [--profile NAME]
--origin は canonical origin (scheme + host + port) のみ受け付ける。HTTPS 必須 (localhost だけ HTTP 可)、path / query / fragment / userinfo 付きは拒否される。
sandbox 実行時の権限: publicar-client は deploy 成功時に ~/.publicar/projects.json へ派生記録を書く。
書込不能のまま project を作成すると記録が失われ、再実行で project を重複作成し得るため、
publicar-client は外部 HTTP の前に保存先の書込可能性を検査し、書けなければ project-record-unwritable
で通信 0 件のまま停止する。sandbox (書込制限付き) 環境で起動する場合は、
~/.publicar へ書込できる実行権限を確保してから publicar-client を起動すること。
resolve を実行し、結果をユーザーに表示する:
接続先: publicar.company.com (work)
形式は <ドメイン> (<profile 名>)。
~/.publicar/profiles.json があれば登録済み origin 一覧を表示する (読み取りのみ):
jq -r '.profiles | to_entries[] | "\(.key): \(.value.url)"' ~/.publicar/profiles.json
select --origin <URL> を実行する
publicar-client が CLI 認証フローを開始し stderr に auth_url: を表示してブラウザを開く。ユーザーに「ブラウザで Google 認証を完了してください」と伝える。認証完了後、publicar-client が profile を ~/.publicar/profiles.json へ保存し、endpoint を repo-local 設定へ保存する選択・確認は skill (agent) がユーザーと行い、publicar-client は --origin を機械入力として受けるだけで対話しない。
publicar-client を実行する前に、「実行の原則」に従って対象パス・ファイル一覧・合計サイズを提示する。
単一 HTML なら 1 ファイルとサイズ、ZIP / directory バンドルなら中身の一覧を出す。
# ZIP の場合
unzip -l <ZIPパス>
# directory バンドルの場合 (publish 前の元 directory を対象にする)
find <ディレクトリ> -type f -not -path "*/.git/*" | head -40; echo "---"; du -sh <ディレクトリ>
一覧に意図しないファイル (個人情報を含む素材、作業中の一時ファイル、別案件の成果物など) が 無いことをユーザーが確認できる形で示してから次へ進む。
"$HELPER" create-and-deploy --artifact <パス> --title "<タイトル>"
.html / .htm: 単一 HTML デプロイ.zip: ZIP デプロイ (クリーンデプロイ: ZIP に含まれないファイルは自動削除。__MACOSX/, .DS_Store, Thumbs.db は自動除外)成功 JSON の url が共有 URL。project.id / project.alias / profile も含まれるので完了報告に使う。
既存 project への再デプロイ (--project-id ID が指定された場合、comment-loop の revise 後など):
"$HELPER" deploy --artifact <パス> --project-id <ID> [--profile NAME]
endpoint と profile)デプロイ対象ディレクトリに renderer-manifest.json が存在する場合、
directory バンドル (reviewable-html-workbench 等で生成) と判断し、
デプロイ前に publish CLI でレビュー UI を除去した公開用 HTML を生成する。
手順:
renderer-manifest.json があるか確認publicar-client でのデプロイまでを 必ず同一 shell invocation 内で実行する。trap は shell 終了時に発火するため、code block を分割して別々の shell で実行すると publish や deploy の前に一時 directory が削除される。publish の出力先は、元 directory が属する git repo の root 直下に mktemp で新規作成した一意な一時 directory を使う (固定名や既存 directory を使わない)。
未設定の shell 変数による実行時分岐は書かず、呼び出し引数の --project-id 有無で 次の 2 つの独立 template から必ず一方だけを選ぶ。--title / --profile も未設定 shell 変数に依存させず、呼び出し引数に存在する場合だけ agent が set -- 行の末尾へ明示的に追加する (「:+」条件展開で flag と値を 1 展開にまとめる形式は zsh で 1 引数に畳まれるため使わない)。
既存 project への再デプロイ (--project-id が指定されている場合。comment-loop の再デプロイ等。project は作成しない。<project ID> は空でない値を必ず埋める):
REPO_ROOT=$(git -C <デプロイ対象> rev-parse --show-toplevel)
PUB_TMP=$(mktemp -d "$REPO_ROOT/.publicar-publish.XXXXXX")
cleanup() {
if [ -f "$PUB_TMP/index.html" ]; then rm -- "$PUB_TMP/index.html"; fi
rmdir -- "$PUB_TMP"
}
trap cleanup EXIT
(cd <rhw-repo-root> && python3 -m scripts.html_review_workbench.cli publish \
--root <デプロイ対象> --output "$PUB_TMP")
set -- deploy --artifact "$PUB_TMP/index.html" --project-id "<project ID>" --bundle-root <デプロイ対象>
"$HELPER" "$@"
新規公開 (--project-id が無い場合。project を新規作成する。project-id を渡さない):
REPO_ROOT=$(git -C <デプロイ対象> rev-parse --show-toplevel)
PUB_TMP=$(mktemp -d "$REPO_ROOT/.publicar-publish.XXXXXX")
cleanup() {
if [ -f "$PUB_TMP/index.html" ]; then rm -- "$PUB_TMP/index.html"; fi
rmdir -- "$PUB_TMP"
}
trap cleanup EXIT
(cd <rhw-repo-root> && python3 -m scripts.html_review_workbench.cli publish \
--root <デプロイ対象> --output "$PUB_TMP")
set -- create-and-deploy --artifact "$PUB_TMP/index.html" --bundle-root <デプロイ対象>
"$HELPER" "$@"
補足:
publicar-client へ渡すと not-in-repo で停止し、派生 artifact の endpoint は元 directory と同じ repo の repo-local 設定に固定する必要があるためindex.html だけを明示 path で削除してから rmdir -- "$PUB_TMP" (空 directory のみ削除) を実行する。想定外のファイルがあった場合は削除されず directory が残るため、内容を確認してから手動で片付ける (quote と -- を必ず付ける)--bundle-root <元directory> を両分岐で必ず渡す。一時 directory は削除されるため、publicar-client は projects.json の localDir に元 directory、sourceKind に directory を記録する。publicar-client は bundle-root の実在・非 symlink・renderer-manifest.json の存在・artifact と同一 repo を通信前に検証し、別 repo の bundle-root は bundle-root-mismatch で通信前に拒否するpublish は Python stdlib のみで動作し、外部依存のインストールは不要。
publicar-client の credential と CI~/.publicar/profiles.json (または CI secret) で管理する。publicar-client は保存済み endpoint と 同一 origin の credential だけを使うprofile-ambiguous で停止する。ユーザーに選んでもらい --profile NAME を付けて再実行するpublicar-client は通信前に失敗する
git config --local publicar.endpoint <origin> を明示設定PUBLICAR_URL (保存 endpoint と同一 origin) + PUBLICAR_API_KEY を secret で注入PUBLICAR_URL が保存 endpoint と異なる場合、publicar-client は通信前に env-endpoint-mismatch で停止する (環境変数で別 endpoint へ送る手段はない)deploy 成功時、publicar-client が ~/.publicar/projects.json の <profile>/<projectId> へ
localDir / alias / url / sourceKind / lastSyncedAt を追記する (comment loop が参照する)。
profiles.json は認証情報の管理元として維持され、endpoint 選択の管理元には使われない。
publicar-client の error code)endpoint-not-set: repo に endpoint 未設定。「初回の endpoint 選択」を実施endpoint-invalid: 保存値または --origin が canonical origin でない。URL を確認endpoint-already-set: select 済み。変更したい場合は change を使うnot-in-repo: artifact が git repo 外。repo 内へ移すか対象を確認credential-not-found / credential-origin-mismatch: endpoint と一致する profile がない。select で認証するか profile を確認credential-invalid: profile の api_key が欠落または空。select で再認証して profile を保存し直すprofile-ambiguous: --profile NAME を付けて再実行env-endpoint-mismatch / env-credential-unverifiable: 環境変数が保存 endpoint と不整合。env を外すか一致させるhttp-error: API 失敗。message 内の HTTP status を確認 (401: API key 無効、403: スコープ不足、413: サイズ超過)project-record-unwritable: ~/.publicar/projects.json へ書込不能 (HTTP 未送信)。~/.publicar の書込権限を確保してから再実行する。この error では project は作成されていないproject-record-failed: project の作成/デプロイは endpoint 上で完了済みだが派生記録に失敗した部分成功。同じ create を再実行しない (project が重複作成される)。error 内 created の id / alias / url / endpoint を使い、権限を直してから ~/.publicar/projects.json へ記録を手動同期するか、再デプロイは deploy --project-id <created.id> を使う詳細は GET <endpoint>/api/v1/openapi.json または GET <endpoint>/llms.txt を参照。
project の一覧・詳細・更新・削除など deploy 以外の操作は本 skill の対象外。
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
3 skills in this plugin
/publicar-comment-looppublicar の公開 URL からコメント thread を取得し、AI 返信案、HTML 修正案、承認後の返信投稿、ローカル HTML 編集、再デプロイを支援する。Use for dialog mode triggers: このURLのコメント処理して, publicar コメント返信, コメントループ, publicar review comments, publicar comment loop. Use for revise mode triggers: publicar の記事を直して, resolved を反映して, publicar 記事修正, apply resolved comments, publicar revise. Do not use for publicar server-side development, simple deploy-only requests handled by publicar-deploy, or RHW ローカル preview のコメント取り込み.
/publicar-mcppublicar の MCP コネクタのツール(`publish_file` など)で HTML などのテキストファイルを公開・更新するとき、公開済みの資料を直すとき、複数のエージェントが同じ資料を直すとき、コメントに答えるときに使う。API キーと `publicar-client` で送るときは `publicar-deploy` を使う。npx claudepluginhub u-ichi/agent-plugins --plugin publicarOther plugins' skills for the same job