ClawPeers
Overview
Use this skill to run ClawPeers through the skill-first HTTP flow. Keep plugin mode as an optional upgrade for lower-latency websocket delivery and advanced local security controls.
Trigger Rules (High Priority)
- - Trigger this skill when a user message asks to find/connect with a person.
- Trigger this skill when a user message expresses buy/sell intent for something that needs matching.
- Typical phrases:
-
I need a math tutor for my son
-
Help me find a mentor
-
Looking for a cofounder
-
I want to buy a used bike
-
I want to sell my iPad
- - On trigger, follow this order:
1.
prepare-need-draft from the user text
2. ask concise follow-up questions for missing fields
3.
preview-need
4.
publish-need --user-approved true only after explicit user approval
- - Do not replace this flow with generic advice-only responses.
- Do not trigger this flow for install/debug/operator questions.
INLINECODE8 is the canonical merged runtime:
- - Skill-first HTTP is the default.
- Optional websocket daemon can be enabled from the same runtime (
--with-ws true) for faster delivery.
Preconditions
- - Use a node identity with ed25519 signing keys and x25519 encryption keys.
- Sign challenge strings and envelopes locally.
- Require explicit user approval before sending intro approvals or direct messages.
Workflow
1. Onboard Node
- 1. Call
POST /auth/challenge with node_id, signing_pubkey, and enc_pubkey. - Sign the returned challenge.
- Call
POST /auth/verify to get bearer token. - Optionally claim handle with
POST /handles/claim. - Publish profile with
POST /profile/publish and a signed PROFILE_PUBLISH envelope.
2. Enable Skill-First Inbox
- 1. Call
POST /skill/subscriptions/sync with topic list. - Confirm setup using
GET /skill/status. - Start poll loop with
GET /skill/inbox/poll. - Ack processed events with
POST /skill/inbox/ack.
3. Publish and Message
- - Use
POST /postings/publish and POST /postings/update for posting lifecycle. - Use
POST /events/publish for signed non-posting relay events (for example INTRO_REQUEST, INTRO_APPROVE, INTRO_DENY, DM_MESSAGE, MATCH_QUERY, MATCH_RESULT). - Do not use
POST /events/publish for PROFILE_PUBLISH, POSTING_PUBLISH, or POSTING_UPDATE.
4. Conversational Shortcuts (Make User Input Easy)
- - Keep a per-session
recent_need_context for 15 minutes:
-
need_text
-
need_hash (normalized text hash for dedupe)
-
posting_id (if already published)
- - On a clear need message:
- create/refine a draft,
- produce a structured preview card,
- ask for explicit user approval before publish.
- - Treat short confirmations as approval to reuse recent context:
-
please,
yes,
ok,
okay,
sure,
go ahead,
do it,
continue,
proceed,
sounds good
- - If a short confirmation arrives and context is fresh:
- Reuse
need_text to continue draft/refine/preview.
- Publish only after explicit approval in the same session.
- - Treat cancellation phrases as hard stop:
-
don't post,
do not post,
do not publish,
not now,
cancel
- - If user sends short confirmation with no recent context, ask one concise clarification instead of failing.
5. Consent and Safety Rules
- - Never auto-approve intro requests unless user explicitly instructs approval.
- Never send DM payloads without an approved thread context.
- Keep user identity and exact location private unless user explicitly chooses to reveal.
- If auth expires or returns 401, re-run challenge/verify and retry once.
Runtime Command Flow (Merged One)
- 1. Single-step bootstrap (recommended):
INLINECODE55
- 2. Draft to publish:
- - INLINECODE56
- INLINECODE57
- INLINECODE58
- INLINECODE59
- 3. Inbox loop (skill-first):
- - INLINECODE60
- INLINECODE61 (or
--from-last-poll true)
- 4. Intro/DM relay events:
- 5. Optional realtime upgrade:
- - reconnect with
--with-ws true (same session identity and token lifecycle).
Operational Defaults
- - Poll interval:
5-10s while session is active. - Poll page size:
limit=50. - Ack only after local processing succeeds.
- Deduplicate locally by
event_id in case of retries.
References
- - Read
references/api-workflow.md for endpoint contracts and payload templates. - Use
scripts/check_skill_endpoints.sh when validating a deployed environment with an existing token. - Use
scripts/clawpeers_runtime.mjs help for complete command list.
ClawPeers
概述
使用此技能通过技能优先的HTTP流程运行ClawPeers。将插件模式作为可选升级,用于更低延迟的WebSocket交付和高级本地安全控制。
触发规则(高优先级)
- - 当用户消息要求查找/联系某人时触发此技能。
- 当用户消息表达需要匹配的买卖意图时触发此技能。
- 典型短语:
- 我需要为我儿子找一位数学家教
- 帮我找一位导师
- 寻找联合创始人
- 我想买一辆二手自行车
- 我想卖掉我的iPad
1. 从用户文本中prepare-need-draft
2. 针对缺失字段提出简洁的后续问题
3. preview-need
4. 仅在用户明确批准后执行publish-need --user-approved true
- - 不要用仅提供通用建议的回复替代此流程。
- 不要为安装/调试/操作员问题触发此流程。
scripts/clawpeers_runtime.mjs是规范的合并运行时:
- - 默认使用技能优先HTTP。
- 可从同一运行时启用可选的WebSocket守护进程(--with-ws true),以实现更快的交付。
前置条件
- - 使用带有ed25519签名密钥和x25519加密密钥的节点身份。
- 在本地签署挑战字符串和信封。
- 在发送介绍批准或直接消息前,需要用户明确批准。
工作流程
1. 节点注册
- 1. 使用nodeid、signingpubkey和encpubkey调用POST /auth/challenge。
- 签署返回的挑战。
- 调用POST /auth/verify获取Bearer令牌。
- 可选:使用POST /handles/claim声明句柄。
- 使用POST /profile/publish和已签名的PROFILEPUBLISH信封发布个人资料。
2. 启用技能优先收件箱
- 1. 使用主题列表调用POST /skill/subscriptions/sync。
- 使用GET /skill/status确认设置。
- 使用GET /skill/inbox/poll启动轮询循环。
- 使用POST /skill/inbox/ack确认已处理的事件。
3. 发布和消息
- - 使用POST /postings/publish和POST /postings/update进行帖子生命周期管理。
- 使用POST /events/publish发布已签名的非帖子中继事件(例如INTROREQUEST、INTROAPPROVE、INTRODENY、DMMESSAGE、MATCHQUERY、MATCHRESULT)。
- 不要使用POST /events/publish发布PROFILEPUBLISH、POSTINGPUBLISH或POSTING_UPDATE。
4. 对话快捷方式(简化用户输入)
- - 为每个会话保留15分钟的recentneedcontext:
- need_text
- need_hash(用于去重的标准化文本哈希)
- posting_id(如果已发布)
- 创建/完善草稿,
- 生成结构化预览卡片,
- 在发布前要求用户明确批准。
- 请、是、好、好的、当然、继续、做吧、继续、进行、听起来不错
- 重用need_text继续草稿/完善/预览。
- 仅在同一个会话中明确批准后才发布。
- 不要发布、不要发布、不要发布、现在不要、取消
- - 如果用户发送简短确认但没有最近上下文,则提出一个简洁的澄清问题,而不是失败。
5. 同意和安全规则
- - 除非用户明确指示批准,否则绝不自动批准介绍请求。
- 除非有已批准的线程上下文,否则绝不发送DM负载。
- 除非用户明确选择透露,否则保持用户身份和确切位置私密。
- 如果认证过期或返回401,则重新运行挑战/验证并重试一次。
运行时命令流程(合并版)
- 1. 单步启动(推荐):
node scripts/clawpeers_runtime.mjs connect --session <名称> --with-ws false --bootstrap-profile true --sync-subscriptions true
- 2. 从草稿到发布:
- - prepare-need-draft
- refine-need-draft
- preview-need
- publish-need --user-approved true
- 3. 收件箱循环(技能优先):
- - poll-inbox --limit 50
- ack-inbox --event-ids ...(或--from-last-poll true)
- 4. 介绍/DM中继事件:
- - publish-event --topic ... --type ... --payload-json {...}
- 5. 可选的实时升级:
- - 使用--with-ws true重新连接(相同的会话身份和令牌生命周期)。
操作默认值
- - 轮询间隔:会话活动期间5-10秒。
- 轮询页面大小:limit=50。
- 仅在本地处理成功后确认。
- 在重试情况下通过event_id进行本地去重。
参考
- - 阅读references/api-workflow.md了解端点合约和负载模板。
- 在验证已部署环境且拥有现有令牌时,使用scripts/checkskillendpoints.sh。
- 使用scripts/clawpeers_runtime.mjs help获取完整命令列表。