/publicar:publicar-comment-loop [URL] [--mode dialog|revise] [--dir <path>] [--profile NAME] [--path <html-path>] [--dry-run]from publicar
Fetches comment threads from a publicar public URL, assists with AI reply drafts, HTML revision suggestions, posting replies after approval, local HTML editing, and redeployment.
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 へ付いたコメントを取得し、ユーザー承認を挟んで返信、ローカル HTML 編集、再デプロイまで進める。publicar 単独で成立させ、外部 plugin や preview CLI は呼び出さない。
--mode dialog|revise が明示されていればそれを使う。publicar の記事を直して、resolved を反映して、publicar 記事修正、apply resolved comments、publicar revise が含まれれば revise。dialog。dialog: status=open の thread を 1 件ずつ扱い、返信投稿と HTML 部分編集を行う。resolved 化はしない。revise: status=resolved の thread を path ごとにまとめ、合意内容を HTML に統合する。返信投稿も status 更新もしない。URL から origin、alias、path を抽出する。URL がなければ 1 度だけ質問する。
{origin}/{alias}[/{subpath}] と {origin}/p/{alias}[/{subpath}] の 2 系統を扱う。/p/ なら先に剥がし、/p/foo/index.html を alias=p, path=foo/index.html と誤解釈しない。normalizeFilePath 相当に、先頭 slash 除去、空 path の entry path 化、. / .. 無効化を行う。profile 解決は publicar-deploy と同じ順序で行う。
--profile NAMEPUBLICAR_URL + PUBLICAR_API_KEY~/.publicar/profiles.json の currentprofile 決定後、貼り付け URL の origin と profile の url origin を必ず照合する。不一致なら profile 切替を確認するか停止し、別 origin の alias と混同しない。
HTTP client は User-Agent を必ず browser 相当にする。Python-urllib の default User-Agent は Cloudflare WAF error 1010 で 403 になることがある。
curl -sS -A "Mozilla/5.0 publicar-comment-loop" "$PUBLICAR_URL/api/v1/projects" \
-H "Authorization: Bearer $PUBLICAR_API_KEY"
request.add_header("User-Agent", "Mozilla/5.0 publicar-comment-loop")
GET {origin}/api/v1/projects を Bearer API key 付きで呼び、alias で project id を解決する。
ヒット 0 件は次の 3 分岐で説明する。
~/.publicar/projects.json の <profile>/<projectId> から localDir と sourceKind を読む。なければ次の順で決める。
--dir <path>renderer-manifest.json を探索同時に sourceKind を分類して保存する。
directory: renderer-manifest.json があるディレクトリsingle-html: 単一 .html ファイルzip: .zip ファイル保存形式:
{
"profiles": {
"<profile>": {
"projects": {
"<projectId>": {
"localDir": "<path>",
"alias": "<alias>",
"url": "<public URL>",
"sourceKind": "directory",
"lastSyncedAt": "<ISO timestamp>"
}
}
}
}
}
GET {origin}/api/v1/projects/{projectId}/comment-threads?status=<status>&limit=50 を呼び、nextCursor が尽きるまで取得する。thread.path でグルーピングする。
dialog: status=openrevise: status=resolveddialog は thread 単位で提示する。
[Thread <id>] status=open path=<path>
selectedText: "..."
コメント本文: <body>
返信履歴:
- <author>: <body>
== AI 要旨 ==
== 提案返信 ==
== 提案編集 diff (block 単位) ==
承認プロンプト: [y] 全承認 / [e] 編集 / [r] 返信のみ / [s] skip / [x] 中断
revise は path 単位で一括提示する。
[Path <path>] resolved threads: N 件
--- Thread <id-1> (resolved) ---
selectedText: "..."
合意要約: <元コメント + 返信履歴からの合意点>
--- Thread <id-2> (resolved) ---
...
== 統合修正 diff ==
<path 全体を対象にした 1 本の diff>
承認プロンプト: [y] path ごと承認 / [e] 編集 / [s] skip / [x] 中断
ローカル HTML は tag 除去、entity decode、whitespace collapse で DOM textContent 相当に正規化してから検索する。生 HTML 文字列検索だけに頼らない。
検索順序:
blockTextprefix + selectedText + suffixselectedText 単独複数候補は blockTagName、prefix、suffix、見出し/本文系 tag、nav/header/footer などの位置で scoring する。曖昧なら [m] 手動指定 / [r] 再提案 / [s] skip を出す。0 件でも同じ分岐にする。
擬似コード:
normalized = stripTags(html)
normalized = decodeEntities(normalized)
normalized = collapseWhitespace(normalized)
for pattern in [blockText, prefix + selectedText + suffix, selectedText]:
collect matches
score by prefix/suffix exactness, blockTagName, and location penalty
return best unambiguous match
dialog:
POST {origin}/api/v1/projects/{projectId}/comments/{threadId}/replies で返信する。actorKind: "ai" を含める。AI 経由の識別は UI バッジで行う。{
"body": "<提案返信>",
"actorKind": "ai"
}
status は変更しない。thread は open のまま残し、ユーザーが publicar UI で最終クローズする。最後の deploy が失敗した場合は「返信は済んだが HTML は旧世代」と明示して復旧手順へ誘導する。
revise:
body と actorKind: "ai" を含める。directory: Skill ツールで publicar-deploy を呼び、<localDir> --project-id <id> --profile <profile> を渡す。renderer-manifest.json 付き directory 判定は publicar-deploy に任せる。single-html: Skill ツールに <localDir>/<path> --project-id <id> --profile <profile> を渡す。zip: unsupported として停止し、単一 HTML か directory バンドルで再デプロイするよう案内する。再デプロイは publicar-deploy skill (同 skill が起動する helper) だけを経路とする。
publicar-deploy の helper / skill が使えない場合は、直接 API 呼び出しへ fallback せず、
アップロードを行わずに停止して理由を報告する。
[m] 手動指定 / [r] 再提案 / [s] skip を出す。src/、migrations/、schema を変更しない。sourceKind の値は directory、single-html、zip のみにする。What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub u-ichi/agent-plugins --plugin publicar3 skills in this plugin
/publicar-deployHTML/ZIPをpublicarにデプロイして共有URLを取得する。Deploy HTML/ZIP files to publicar and get shareable URLs. Triggers: publicarにデプロイ, publicar deploy, HTMLを共有, 共有URLを発行, publicarで配信, publicar にアップロード, deploy to publicar, share HTML via publicar, upload ZIP to publicar。使用しない場面: publicarのサーバー側開発、Workers設定変更。Do not use for: developing publicar itself, modifying Workers config. MCP コネクタで公開・更新するときは `publicar-mcp` を使う。
/publicar-mcppublicar の MCP コネクタのツール(`publish_file` など)で HTML などのテキストファイルを公開・更新するとき、公開済みの資料を直すとき、複数のエージェントが同じ資料を直すとき、コメントに答えるときに使う。API キーと `publicar-client` で送るときは `publicar-deploy` を使う。Other plugins' skills for the same job