clawpage
Share AI agent conversations as public web pages.
Supported Agents
references/platforms/unknown.md — generic skill-based fallback |
|
(new platform) | Add a file following
references/platforms/TEMPLATE.md |
Core Workflow
1. Setup Check
- - Detect agent type; load project dir + site URL using the agent profile
- If project not configured locally, ask the user:
-
"Do you have an existing clawpage repo?"
- Yes →
Existing Repo, New Environment
- No (Default) →
First-Time Setup
2. Locate Session
- - List sessions using agent profile discovery
- Show candidates → user confirms selection
3. Extract & Convert
Follow the Conversion section in the platform profile detected in Step 1.
Save the result to {projectDir}/chats/.tmp/{timestamp}.yaml.
4. Populate Metadata
The CLI auto-fills structural fields. The Skill's job is to fill in the human-facing metadata:
| Field | CLI default | Action |
|---|
INLINECODE1 , sessionId, model, totalMessages, totalTokens, INLINECODE6 | Auto-filled | Review only |
| INLINECODE7 |
private | Update to
public |
|
participants | Generic role names (
user,
assistant) | Ask user for display names → rename keys; if no name is provided, use
Human /
Agent for single-speaker or
Human 1 /
Human 2 … for multi-speaker |
|
title |
'Session Export' (generic) | Skim generated YAML → suggest → confirm |
|
description |
(absent) | Write one-sentence summary → confirm |
|
channel |
(absent) | Ask user — set to platform name (e.g.
discord) if applicable; omit otherwise |
|
cover |
(absent) | Skip (user adds custom OG image URL manually later) |
|
tags |
(absent) | Skip (user adds manually later) |
5. Redact
Review the generated YAML and replace sensitive information with [REDACTED]:
- - API keys, tokens, passwords → INLINECODE25
- File paths with usernames (
/Users/xxx → ~) - Email addresses, phone numbers → INLINECODE28
- Internal URLs and private IPs → INLINECODE29
Do not silently remove content — always substitute [REDACTED] so the reader can see that content was present but withheld.
6. Confirm & Save
- - Suggest filename: INLINECODE31
- Show preview → user confirms or modifies topic/filename
- Before moving the file, create a dedicated branch (see below — required even if the user does not publish yet):
cd {projectDir}
git checkout main
git pull origin main
git checkout -b chat/{YYYYMMDD}-{topic}
- - Move:
{projectDir}/chats/.tmp/{timestamp}.yaml → INLINECODE33 - Stage and commit immediately so the file is isolated on its own branch:
CODEBLOCK1
Why create a branch here? Saving on the default branch risks mixing unrelated changes into a future PR. Always commit each chat file on its own dedicated branch.
Optional: Publish
Push the branch created in step 6 and open a PR.
See references/publish.md. Only proceed after explicit user request.
Edge Cases
clawpage
将AI代理对话分享为公共网页。
支持的代理
references/platforms/unknown.md — 基于技能的通用回退方案 |
|
(新平台) | 按照
references/platforms/TEMPLATE.md 添加文件 |
核心工作流程
1. 设置检查
- - 检测代理类型;使用代理配置文件加载项目目录 + 站点URL
- 如果项目未在本地配置,询问用户:
-
您是否已有现有的clawpage仓库?
- 是 →
现有仓库,新环境
- 否(默认)→
首次设置
2. 定位会话
- - 使用代理配置文件发现功能列出会话
- 显示候选会话 → 用户确认选择
3. 提取与转换
按照步骤1中检测到的平台配置文件的转换部分进行操作。
将结果保存到 {projectDir}/chats/.tmp/{timestamp}.yaml。
4. 填充元数据
CLI自动填充结构字段。技能的任务是填充面向用户的元数据:
| 字段 | CLI默认值 | 操作 |
|---|
| date, sessionId, model, totalMessages, totalTokens, defaultShowProcess | 自动填充 | 仅审核 |
| visibility |
private | 更新为 public |
| participants | 通用角色名称(user, assistant) | 询问用户显示名称 → 重命名键;如果未提供名称,单说话者使用 Human / Agent,多说话者使用 Human 1 / Human 2 … |
| title | Session Export(通用) | 浏览生成的YAML → 建议 → 确认 |
| description |
(缺失) | 写一句话摘要 → 确认 |
| channel |
(缺失) | 询问用户 — 如果适用则设置为平台名称(例如 discord);否则省略 |
| cover |
(缺失) | 跳过(用户稍后手动添加自定义OG图片URL) |
| tags |
(缺失) | 跳过(用户稍后手动添加) |
5. 编辑脱敏
审查生成的YAML,将敏感信息替换为 [REDACTED]:
- - API密钥、令牌、密码 → [REDACTED]
- 包含用户名的文件路径(/Users/xxx → ~)
- 电子邮件地址、电话号码 → [REDACTED]
- 内部URL和私有IP → [REDACTED]
不要静默删除内容 — 始终替换为 [REDACTED],以便读者看到内容存在但被隐藏。
6. 确认并保存
- - 建议文件名:{YYYYMMDD}-{topic}.yaml
- 显示预览 → 用户确认或修改主题/文件名
- 在移动文件之前,创建一个专用分支(见下文 — 即使用户尚未发布也必需):
bash
cd {projectDir}
git checkout main
git pull origin main
git checkout -b chat/{YYYYMMDD}-{topic}
- - 移动:{projectDir}/chats/.tmp/{timestamp}.yaml → {projectDir}/chats/{YYYYMMDD}-{topic}.yaml
- 立即暂存并提交,以便文件隔离在其自己的分支上:
bash
git add chats/{YYYYMMDD}-{topic}.yaml
git commit -m docs: add {topic}
为什么在这里创建分支? 保存到默认分支可能会将不相关的更改混入未来的PR中。始终将每个聊天文件提交到其自己的专用分支上。
可选:发布
推送步骤6中创建的分支并打开一个PR。
参见 references/publish.md。仅在用户明确请求后继续。
边缘情况