Xpersona
X

X Engagement

CLAWHUB · Unverified

X/Twitter 运营辅助。完整 onboarding → Persona 学习 → Browser Relay 浏览器控制 → 记忆系统 → 手动提醒模板 → For You 关注建议 → Following 互动建议 Skill: X Engagement Owner: jasoncodespace Summary: X/Twitter 运营辅助。完整 onboarding → Persona 学习 → Browser Relay 浏览器控制 → 记忆系统 → 手动提醒模板 → For You 关注建议 → Following 互动建议 Tags: latest:4.1.3 Version history: v4.1.3 | 2026-04-14T10:31:48.013Z | user x-engagement v4.1.3 - 新增 _meta.json 元数据文件。 - 新增 runtime/manual-reminders.txt 文件,用于手动提醒配置或说明。 - No changes to existing source behavior. - 提升本地运行与手动提醒的文档和结构支持。 v4.1.2 | 2026-03-03T05

62
Rank
84
Safety
1.3k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17bkj506r10zrrgqpv69nv5ns84skh6:x-engagement
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-jasoncodespace-x-engagement/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

145,337 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: x-engagement
version: 4.2.0-local
description: "X/Twitter 运营辅助。完整 onboarding → Persona 学习 → Browser Relay 浏览器控制 → 记忆系统 → 手动提醒模板 → For You 关注建议 → Following 互动建议"
---

# X 运营辅助 Skill v4.2

## 快速开始

**触发条件:**
- "刷推 [时间]"
- "运营推特 [时间]"
- "去X上互动 [时间]"

**首次运行:**
自动进入 Onboarding 流程(详见 `docs/onboarding.md`)

**后续运行:**
读取配置 → 生成互动建议 → 用户确认后执行

---

## 文档结构

```
x-engagement/
├── SKILL.md                    # 主入口(本文件)
├── docs/
│   ├── onboarding.md           # Onboarding 流程
│   ├── browser-operations.md   # 浏览器操作模块(基于 Browser Relay)
│   ├── comment-rules.md        # 评论规则(重要!防止错误)
│   ├── human-behavior.md       # 自然节奏与确认规范
│   ├── memory-system.md        # 记忆系统设计
│   ├── cron-jobs.md            # 手动提醒与维护
│   ├── comment-generation.md   # 评论生成逻辑
│   └── natural-language-parser.md # 自然语言时间解析
├── playbooks/
│   ├── comment-strategies.md   # 评论策略(有效/无效)
│   └── changelog.md            # 策略变更记录
├── data/
│   └── engagement/
│       └── YYYY-MM-DD.json     # 每日评论数据
├── templates/
│   ├── persona.md              # Persona 模板
│   ├── config.json             # 配置模板
│   └── daily-log.md            # 每日日志模板
└── scripts/
    ├── setup-cron.sh           # 生成手动提醒模板
    ├── check-cron.sh           # 检查本地运行状态
    └── daily-review.sh         # 每日复盘脚本
```

---

## 核心功能

### 1. Onboarding(首次运行)

**5个阶段:**
1. 浏览器连接 + 登录检查
2. 选择 Persona(自己或其他账号)
3. 学习 Persona(抓取100条 → 生成描述)
4. 刷推习惯配置
5. 保存配置

**详见:** `docs/onboarding.md`

---

### 2. 自然节奏与确认

**核心原则:** 保持自然节奏,但不追求伪装或规避检测。

**包含:**
- 阅读与判断节奏建议
- 点赞/关注/评论二次确认
- 频率限制
- 人工审核后再执行写操作

**详见:** `docs/human-behavior.md`

---

### 3. 记忆系统

**三层记忆:**

```
memory/daily/hotspots/
├── .onboarding_complete     # Onboarding 标记
├── .config.json             # 用户配置
├── personas/
│   └── [handle].md          # Persona 描述
├── events/                  # 重大事件(永久)
├── tables/                  # 每日热点(7天)
└── history/
    ├── comments/            # 评论历史(避免自相矛盾)
    └── daily/               # 每日日志
```

**关键功能:**
- 记录每次评论内容
- 记录用户说过的话(如"昨天出去吃饭了")
- 评论前检查历史,避免矛盾

**详见:** `docs/memory-system.md`

---

### 4. 手动提醒与维护

**默认策略:**
- 不自动安装 cron
- 不自动修改 `crontab`
- 仅生成手动提醒模板

**可手动执行的维护项:**
- 每日热点总结
- 记忆清理预览
- 记忆清理执行(需显式 `--apply`)

**生成手动模板:**
```bash
./scripts/setup-cron.sh
```

**详见:** `docs/cron-jobs.md`

---

### 5. 刷推流程

**⚠️ 重要规则(必须遵守):**

1. **只在 Following 的 Recent 页面评论**(不是 Popular)
2. **评论前检查历史**(避免重复评论同一博主)
3. **记录所有评论**(保存到历史文件)
4. **评论发送前必须得到用户确认**

**详见:** `docs/comment-rules.md`(必读!)

**For You 页面:**
1. 浏览(自然阅读节奏)
2. 关注建议(根据配置条件)

**Following 页面:**
1. 确保是 Recent(不是 Popular)
2. 点赞建议(有价值的推文)
3. 评论建议(2小时内,使用 persona 风格)
4. 用户确认后执行
5. 记录评论到历史(避免重复)

**详见:** `docs/comment-generation.md`

---

### 6. 浏览器操作(基于 Browser Relay)

**使用 `browser-relay-cli`:**
- 连接你们自己的 Browser Relay 运行时
- 复用本地已登录 Chrome/Chromium
- 支持 DOM 优先、截图兜底的受控操作
- 仓库:`https://github.com/jasonCodeSpace/browser-relay`

**核心操作:**
- 读取推文
- 生成评论建议
- 点赞/关注/评论确认后执行
- 滚动与截图验证

**安全边界:**
- 不默认安装持久任务
- 不默认自动发送评论
- 不把 Browser Relay 当 stealth bot

**详见:** `docs/browser-operations.md`

---

README.md

# X 运营辅助 Skill v4.2

完整的 X/Twitter 运营辅助方案。默认走 Browser Relay + 人工确认,不安装后台持久任务。

Browser Relay 仓库:
`https://github.com/jasonCodeSpace/browser-relay`

## 特性

- ✅ 完整 Onboarding 流程
- ✅ Persona 学习(抓取100条推文)
- ✅ 自然节奏与确认(先建议,后执行)
- ✅ 记忆系统(评论历史、用户事实、避免矛盾)
- ✅ 手动提醒模板(不改 crontab)
- ✅ 智能评论生成(语言匹配、风格应用)
- ✅ Browser Relay 集成(使用自有运行时)

## 快速开始

### 1. 准备 Browser Relay 运行时

```bash
npx browser-relay-cli version
npx browser-relay-cli extension-path
npx browser-relay-cli relay-start
```

如果需要查看 Browser Relay 源码或本地开发,请使用仓库:
`https://github.com/jasonCodeSpace/browser-relay`

### 2. 首次运行

```
用户: 刷推
Bot: 开始 Onboarding...
```

### 3. 后续使用

```
用户: 刷推半小时
Bot: 读取配置... 先给出互动建议,确认后执行...
```

## 文档

| 文档 | 说明 |
|------|------|
| [SKILL.md](SKILL.md) | 主入口 |
| [docs/onboarding.md](docs/onboarding.md) | Onboarding 流程 |
| [docs/human-behavior.md](docs/human-behavior.md) | 自然节奏与确认 |
| [docs/memory-system.md](docs/memory-system.md) | 记忆系统 |
| [docs/cron-jobs.md](docs/cron-jobs.md) | 手动提醒与维护 |
| [docs/comment-generation.md](docs/comment-generation.md) | 评论生成 |

## 目录结构

```
x-engagement/
├── SKILL.md                    # 主入口
├── README.md                   # 说明文档
├── docs/                       # 详细文档
│   ├── onboarding.md
│   ├── human-behavior.md
│   ├── memory-system.md
│   ├── cron-jobs.md
│   └── comment-generation.md
├── templates/                  # 模板文件
│   ├── persona.md
│   ├── config.json
│   └── daily-log.md
└── scripts/                    # 脚本
    ├── setup-cron.sh
    ├── check-cron.sh
    └── cleanup-memory.sh
```

## 核心功能

### 1. Onboarding

首次运行自动引导:
- 浏览器连接 + 登录检查
- 选择 Persona(自己或其他账号)
- 学习 Persona(抓取100条)
- 配置刷推习惯

### 2. 自然节奏与确认

保留自然阅读节奏,但不做规避检测设计:
- 评论前给出候选内容
- 发送前必须再次确认
- 点赞 / 关注也建议确认
- 保留频率建议

### 3. 记忆系统

三层记忆:
- 评论历史(避免重复、矛盾)
- 用户事实(记住用户说过的话)
- 每日日志(活动记录)

### 4. 手动维护

- 手动热点总结
- 手动记忆清理预览
- 手动记忆清理执行(`--apply`)
- 手动提醒模板生成

默认不直接安装 cron,也不修改用户 `crontab`。

### 5. 智能评论

- 语言匹配(中文/英文)
- Persona 风格应用
- 历史检查(避免矛盾)
- 用户事实检查

## 使用示例

### 示例 1:正常评论

```
推文: "今天市场大涨!"
评论: "确实,趋势起来了。"
```

### 示例 2:避免矛盾

```
用户昨天说: "出去吃饭了"
推文: "最近都在家做饭"
评论: "做饭不错,偶尔出去换换口味也好"(避免说"你都在家")
```

### 示例 3:跳过政治

```
推文: "特朗普最新政策"
结果: 跳过(政治内容)
```

## 配置

### 刷推习惯

```json
{
  "forYou": {
    "followNewAccounts": true,
    "followCriteria": ["views_1m+", "crypto", "ai"]
  },
  "following": {
    "commentWithin": "2h",
    "avoidTopics": ["politics", "war"]
  }
}
```

### 频率限制

| 操作 | 每小时上限 |
|------|-----------|
| 关注 | 10 |
| 点赞 | 30 |
| 评论 | 10 |

## 故障排除

### 浏览器连接失败

```
1. 运行 `npx browser-relay-cli relay-start`
2. 在 Chrome 加载 Browser Relay 扩展
3. 运行 `npx browser-relay-cli status`
```

### 不希望自动发送评论

```
1. 保持默认确认流
2. 先生成候选评论
3. 用户确认后再点发送
```

### 记忆系统不工作

```
1. 检查目录是否存在: memory/daily/hotspots/
2. 检查文件权限
3. 运行: ./scripts/check-cron.sh
```

## 更新日志

### v4.2.0-local (2026-04-14)
- 移除自动 cron / crontab 修改
- 清理脚本改成默认 dry-run
- Browser Relay 替代 OpenClaw
- 评论改成先建议后确认

### v4.0.0 (2026-03-02)
- 结构化设计
- 记忆系统(评论历史、用户事实)
- 定时任务(每日热点)
- 人类行为模拟规范
- 智能评论生成

### v3.0.0 (2026-03-01)
- 完整 Onboarding 流

_meta.json

{
  "ownerId": "kn7a9dynkxbnn6qvaa6ygkdjyd8187b4",
  "slug": "x-engagement",
  "version": "4.1.3",
  "publishedAt": 1776162708013
}

docs/browser-operations.md

# 浏览器操作模块

## 设计原则

基于本地 `browser-relay-cli`,目标是 **稳定、可审计、手动确认**:

- 使用你们自己的 Browser Relay 运行时,而不是 OpenClaw
- 优先 DOM 可见元素与标准输入,不依赖 stealth / 规避检测逻辑
- 点赞、关注、评论都先生成建议,再由用户确认是否执行
- 能复用现有 tab 就复用,不盲目开新窗口

---

## 1. 运行时准备

### 1.1 检查 Browser Relay

```bash
npx browser-relay-cli version
npx browser-relay-cli extension-path
npx browser-relay-cli relay-start
npx browser-relay-cli status
```

要求:
- `extensionConnected: true`
- Chrome/Chromium 已登录目标 X 账号

### 1.2 推荐流程

```bash
npx browser-relay-cli list-tabs
npx browser-relay-cli create-tab https://x.com/home
```

如果已经有可复用的 X tab,优先复用,不重复创建。

---

## 2. 核心规则

1. **不要自动发送评论。**
2. **不要自动安装调度器。**
3. **所有写操作先展示预览,再等待用户确认。**
4. **只在用户明确同意时执行点赞、关注、评论。**

---

## 3. 常用操作

### 3.1 打开首页

```bash
npx browser-relay-cli create-tab https://x.com/home
```

### 3.2 查看当前页面

```bash
npx browser-relay-cli screenshot <tabId>
npx browser-relay-cli describe-visible <tabId>
```

### 3.3 切到 Following / Recent

优先用 DOM 选择器;选择器失效时,再用截图 + 坐标点击。

```bash
npx browser-relay-cli click <tabId> 'a[href="/home"]'
npx browser-relay-cli click <tabId> 'a[href="/home?tab=following"]'
npx browser-relay-cli click <tabId> 'a[href="/home?tab=recent"]'
```

### 3.4 读取推文内容

```bash
npx browser-relay-cli raw CDP.send "{\"tabId\":<tabId>,\"method\":\"Runtime.evaluate\",\"params\":{\"expression\":\"(() => { const tweets = [...document.querySelectorAll('[data-testid=\\\"tweet\\\"]')]; return tweets.slice(0, 5).map((tweet) => ({ author: tweet.querySelector('[data-testid=\\\"User-Name\\\"]')?.innerText || '', content: tweet.querySelector('[data-testid=\\\"tweetText\\\"]')?.innerText || '', link: tweet.querySelector('a[href*=\\\"/status/\\\"]')?.href || '' })); })()\",\"returnByValue\":true}}"
```

---

## 4. 评论流程

### 4.1 生成评论建议

先基于 persona、历史记录、推文内容生成 1-3 个候选评论,只展示,不自动提交。

输出格式建议:

```text
推文作者: @example
推文链接: https://x.com/...
候选评论:
1. ...
2. ...
3. ...
```

### 4.2 用户确认后再填入输入框

```bash
npx browser-relay-cli click <tabId> '[data-testid="reply"]'
npx browser-relay-cli type <tabId> '[data-testid="tweetTextarea_0"]' '这里填入用户已确认的评论'
```

### 4.3 发送前最后确认

发送动作必须单独确认一次。确认前可以:

```bash
npx browser-relay-cli screenshot <tabId>
npx browser-relay-cli describe-visible <tabId>
```

确认后再执行:

```bash
npx browser-relay-cli click <tabId> '[data-testid="tweetButton"]'
```

---

## 5. 点赞与关注

点赞、关注同样走确认流:

1. 先展示目标账号/推文
2. 说明为什么要点赞或关注
3. 等用户确认
4. 再执行 click

示例:

```bash
npx browser-relay-cli click <tabId> '[data-testid="like"]'
npx browser-relay-cli click <tabId> '[data-testid$="-follow"]'
```

---

## 6. 频率建议

这些是人工运营建议,不是自动化节流器:

- 点赞:每小时不超过 20 次
- 评论:每小时不超过 5 次
- 关注:每小时不超过 5 次
- 评论之间保留自然阅读和思考时间

---

## 7. 故障处理

### 7.1 选择器失效

1. `screenshot`
2. `describe-visible`
3. `click-at` 或 `click-at-norm`

### 7.2 扩展未连接

```bash
npx browser-relay-cli status
```

如果未连接:
1. 运行 `npx browser-relay-cli relay-start`
2. 在 `chrome://extensions` 加载 unpacked 扩展
3. 重试 `status`

---

## 8. 与 x-engagement 整合

- Persona 仍然从 `memory/daily/hotspots/personas/*.md` 读取
- 评论历史仍然写到 `memory/daily/h

docs/comment-generation.md

# 评论生成逻辑

## 概述

**目标:**
- 生成符合 persona 风格的评论
- 匹配推文语言
- 避免自相矛盾
- 短、有力、有趣

---

## 1. 评论流程

```
推文 → 检查 → 生成 → 检查历史 → 检查用户事实 → 发表 → 记录
```

### 1.1 完整流程

```python
def comment_workflow(tweet):
    # 1. 检查推文
    if not should_comment(tweet):
        return None
    
    # 2. 生成评论
    persona = load_persona(config.persona)
    proposed = generate_comment(tweet, persona)
    
    # 3. 检查历史
    issues = check_history(tweet, proposed)
    if issues:
        proposed = regenerate(proposed, avoid=issues)
    
    # 4. 检查用户事实
    issues = check_user_facts(proposed)
    if issues:
        proposed = regenerate(proposed, avoid=issues)
    
    # 5. 发表
    post_comment(proposed)
    
    # 6. 记录
    record_comment(tweet, proposed)
    
    return proposed
```

---

## 2. 推文检查

### 2.1 跳过条件

| 条件 | 说明 |
|------|------|
| 发布时间 > 2小时 | 只评论新推文 |
| 政治/战争内容 | 避免敏感话题 |
| 已评论过 | 避免重复 |
| 推文语言不匹配 | 无法用正确语言评论 |

### 2.2 检查代码

```python
def should_comment(tweet):
    # 1. 检查时间
    age_hours = (now() - tweet.timestamp) / 3600
    if age_hours > 2:
        return False
    
    # 2. 检查类型
    if is_political(tweet.text) or is_war(tweet.text):
        return False
    
    # 3. 检查是否已评论
    history = load_recent_comments(days=7)
    if any(c.target == tweet.author and c.tweet == tweet.text for c in history):
        return False
    
    # 4. 检查语言
    lang = detect_language(tweet.text)
    if lang not in ["zh", "en"]:
        return False
    
    return True
```

### 2.3 政治检测

```python
political_keywords = [
    "特朗普", "拜登", "习近平", "普京",
    "Trump", "Biden", "Putin", "Xi",
    "选举", "election", "投票", "vote",
    "民主党", "共和党", "Democrat", "Republican"
]

war_keywords = [
    "战争", "war", "导弹", "missile",
    "轰炸", "bomb", "伊朗", "Iran",
    "以色列", "Israel", "加沙", "Gaza"
]

def is_political(text):
    return any(kw in text for kw in political_keywords)

def is_war(text):
    return any(kw in text for kw in war_keywords)
```

---

## 3. 语言匹配

### 3.1 语言检测

```python
def detect_language(text):
    # 简单检测
    chinese_chars = len(re.findall(r'[\u4e00-\u9fff]', text))
    total_chars = len(text)
    
    if chinese_chars / total_chars > 0.3:
        return "zh"
    else:
        return "en"
```

### 3.2 语言匹配规则

| 推文语言 | 评论语言 | 说明 |
|----------|----------|------|
| 中文 | 中文 | 中文评论 |
| 英文 | 英文 | 英文评论 |
| 混合 | 英文 | 默认英文 |
| 其他 | 跳过 | 不评论 |

---

## 4. Persona 风格应用

### 4.1 Persona 内容

**从 `memory/daily/hotspots/personas/[handle].md` 读取:**

```markdown
## 评论风格
- 长度: 1句话
- 特点: 短、有力、用梗
- 示例:
  1. "Facts."
  2. "This is the way."
  3. "Real talk."
```

### 4.2 风格应用

```python
def apply_persona_style(comment, persona):
    # 1. 检查长度
    if len(comment) > persona.max_comment_length:
        comment = shorten(comment, persona.max_comment_length)
    
    # 2. 检查语气
    if persona.tone == "casual":
        comment = make_casual(comment)
    
    # 3. 添加特色
    if persona.use_slang:
        comment = add_slang(comment, persona.common_words)
    
    return comment
```

### 4.3 风格示例

**Persona

Sponsored

Ads related to X Engagement and adjacent AI workflows.