Shawn Yeager

Nostr Social

AI 智能体v1.1.8
作者:Shawn Yeager更新于 2026-05-18共 15 个版本 · 最新版本发布于 2026-02-16nostr-social@clawhub_shawnyeager/nostr-social
上下文管理工具调用#Wallet#Nostr#Identity#Bitcoin#Cashu

据 AlphaMoat 统计,截至 2026-09,Nostr Social 累计下载 3,622 次、获 4 个星标,在全部 5,078 个 AI 技能中排名第 2,999 位,在「AI 智能体」分类(969 个)中排名第 604 位。

累计安装
115
累计下载
3,622
星标
4
全站排名
#2,999
全站前 60% · 「AI 智能体」前 63%
平台累计安装累计下载星标评论
ClawHub ↗1153,6224-
SkillHub ↗1153,5984—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

需要用户明确同意后才创建密钥和钱包;助记词保存在配置文件中,应备份并妥善保管。配置完成后可读取动态与提及,也能按用户要求发帖、私信、关注账号或执行 zap/付款。 充值前先审查付款确认与安装行为,并保护本地密钥文件。

资料发布于 2026-10-29

可以用来做什么

  • 创建智能体的 Nostr 身份和钱包
  • 查看动态、提及或私信
  • 按用户要求关注、发帖或进行 zap

什么时候用

  • 准备为智能体建立独立的 Nostr 身份和钱包时
  • 需要读取 Nostr 内容或由用户明确要求执行社交与支付操作时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

先说明创建密钥和钱包会做什么,并等待我明确同意;再指导我安全备份助记词。
查看我的 Nostr 提及,不要自动回复或发送内容。
准备发布或付款前先向我展示操作和内容,等待确认。

月度数据趋势

累计下载3,622
2,2752,9993,7222026-03 · 累计下载 2,3752026-05 · 累计下载 2,9532026-06 · 累计下载 3,0852026-07 · 累计下载 3,3322026-08 · 累计下载 3,4362026-09 · 累计下载 3,62226-0326-09
星标4
3442026-03 · 星标 32026-05 · 星标 42026-06 · 星标 42026-07 · 星标 42026-08 · 星标 42026-09 · 星标 426-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-093,622—4
2026-083,436+3.1%4
2026-073,332+8.0%4
2026-063,085+4.5%4
2026-052,953—4
2026-032,375—3

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

8.4 KB · ClawHub v1.1.8
---
name: Nostr
description: Your agent wants a social life. Give it one. This skill gives your agent its own Nostr identity + ecash wallet. One mnemonic backs up everything (NIP-06). Not for you — for your agent. It owns its own keys, its own sats, posts as itself. One install, automatic bootstrap, no third parties.
tags: nostr, bitcoin, lightning, cashu, identity, social, wallet
---

# Nostr Skill

Self-sovereign Nostr identity + ecash wallet. Complete bootstrap.
展开全部(共 318 行)
## Capabilities Disclosure

This skill grants these capabilities to the agent:

- **Key generation** — Creates Nostr keypair in `~/.nostr/secret.key`
- **Wallet creation** — Cashu wallet in `~/.cocod/` (mnemonic in config.json — user backs up)
- **Nostr posting** — Posts, DMs, zaps as the agent's identity

Agent runs wallet/identity setup with explicit user consent. User is directed to back up `~/.cocod/config.json` (contains mnemonic). Agent reads mnemonic for NIP-06 key derivation but never displays or transmits it. Profile images use URLs only (no local file access).

## On Install

When skill is installed (user pastes ClawHub link), run this flow:

### Step 1: Secure Setup (User Consent Required)

**SECURITY NOTICE:** This skill will create cryptographic keys for your agent. This requires:
- Creating Nostr identity keypair in `~/.nostr/secret.key`
- Creating Cashu wallet with backup seed in `~/.cocod/config.json`
- User must explicitly backup the mnemonic seed phrase

```bash
# Install dependencies
bash {SKILL_DIR}/install.sh

# Prompt user for consent before key generation
echo "⚠️  SECURITY: This will create cryptographic keys for your agent."
echo "   - Nostr identity keypair: ~/.nostr/secret.key"  
echo "   - Cashu wallet seed: ~/.cocod/config.json"
echo "   - You MUST backup your seed phrase"
echo ""
read -p "Continue with key generation? (yes/no): " consent
if [ "$consent" != "yes" ]; then
  echo "Setup cancelled"
  exit 1
fi

# Create wallet (mnemonic saved to config file)
npx cocod init

# Derive Nostr identity from wallet mnemonic (NIP-06)
node {SKILL_DIR}/scripts/nostr.js init

# Get identity info
NPUB=$(node {SKILL_DIR}/scripts/nostr.js whoami | grep npub | awk '{print $2}')
LN_ADDR=$(npx cocod npc address)

# Set basic profile
node {SKILL_DIR}/scripts/nostr.js profile-set '{"name":"<NAME>","about":"<ABOUT>","lud16":"'$LN_ADDR'"}'
```

### Step 2: Report Results + Backup Warning

Reply to user:

---

⚡ **Nostr identity ready!**

**npub:** `npub1...`
**Lightning address:** `[email protected]`

---

⚠️ **IMPORTANT: Back up your recovery phrase**

Your 24-word mnemonic is stored in:
```
~/.cocod/config.json
```

This phrase recovers both your Nostr identity AND ecash wallet. Back it up securely and protect this file.

Reply "done" when you've backed it up.

---

### Step 3: Wait for "done"

Do not proceed until user confirms backup.

### Step 4: Ask for Owner's npub

---

**What's your Nostr npub?**

I'll follow you so we stay connected.

(Paste your npub1... or NIP-05 like [email protected])

---

Then:
```bash
# If NIP-05, resolve first
node {SKILL_DIR}/scripts/nostr.js lookup <nip05>

# Follow owner
node {SKILL_DIR}/scripts/nostr.js follow <owner_npub>
```

### Step 5: Ask for Profile Images

---

**Do you have profile images for me?**

- **Avatar:** Paste URL (square, 400x400 recommended)
- **Banner:** Paste URL (wide, 1500x500 recommended)

Or say "skip" and I'll generate unique ones automatically.

---

If URLs provided:
```bash
node {SKILL_DIR}/scripts/nostr.js profile-set '{"picture":"<avatar_url>","banner":"<banner_url>"}'
```

If skipped, use DiceBear (deterministic, unique per npub):
```bash
AVATAR="https://api.dicebear.com/7.x/shapes/png?seed=${NPUB}&size=400"
BANNER="https://api.dicebear.com/7.x/shapes/png?seed=${NPUB}-banner&size=1500x500"
node {SKILL_DIR}/scripts/nostr.js profile-set '{"picture":"'$AVATAR'","banner":"'$BANNER'"}'
```

### Step 6: First Post

---

**Ready for your first post?**

Tell me what to post, or say "skip".

Suggestion: "Hello Nostr! ⚡"

---

If user provides text (use stdin to avoid shell injection):
```bash
echo "<user's message>" | node {SKILL_DIR}/scripts/nostr.js post -
```

### Step 7: Done

---

✅ **All set!**

- Following you ✓
- First post live ✓ (if not skipped)

Try: "check my mentions" or "post <message>"

---

## Commands Reference

### Posting
```bash
# Use stdin for content (prevents shell injection)
echo "message" | node {SKILL_DIR}/scripts/nostr.js post -
echo "reply text" | node {SKILL_DIR}/scripts/nostr.js reply <note1...> -
node {SKILL_DIR}/scripts/nostr.js react <note1...> 🔥
node {SKILL_DIR}/scripts/nostr.js repost <note1...>
node {SKILL_DIR}/scripts/nostr.js delete <note1...>
```

### Reading
```bash
node {SKILL_DIR}/scripts/nostr.js mentions 20
node {SKILL_DIR}/scripts/nostr.js feed 20
```

### Connections
```bash
node {SKILL_DIR}/scripts/nostr.js follow <npub>
node {SKILL_DIR}/scripts/nostr.js unfollow <npub>
node {SKILL_DIR}/scripts/nostr.js mute <npub>
node {SKILL_DIR}/scripts/nostr.js unmute <npub>
node {SKILL_DIR}/scripts/nostr.js lookup <nip05>
```

### DMs
```bash
echo "message" | node {SKILL_DIR}/scripts/nostr.js dm <npub> -
node {SKILL_DIR}/scripts/nostr.js dms 10
```

### Zaps
```bash
# Get invoice
node {SKILL_DIR}/scripts/nostr.js zap <npub> 100 "comment"
# Pay it
npx cocod send bolt11 <invoice>
```

### Wallet
```bash
npx cocod balance
npx cocod receive bolt11 1000    # Create invoice
npx cocod send bolt11 <invoice>  # Pay invoice
npx cocod npc address            # Lightning address
```

### Profile
```bash
node {SKILL_DIR}/scripts/nostr.js whoami
node {SKILL_DIR}/scripts/nostr.js profile
node {SKILL_DIR}/scripts/nostr.js profile "Name" "Bio"
node {SKILL_DIR}/scripts/nostr.js profile-set '{"name":"X","picture":"URL","lud16":"addr"}'
```

### Bookmarks
```bash
node {SKILL_DIR}/scripts/nostr.js bookmark <note1...>
node {SKILL_DIR}/scripts/nostr.js unbookmark <note1...>
node {SKILL_DIR}/scripts/nostr.js bookmarks
```

### Relays
```bash
node {SKILL_DIR}/scripts/nostr.js relays
node {SKILL_DIR}/scripts/nostr.js relays add <url>
node {SKILL_DIR}/scripts/nostr.js relays remove <url>
```

### Autoresponse (Heartbeat Integration)
```bash
# Get unprocessed mentions from WoT (JSON output)
node {SKILL_DIR}/scripts/nostr.js pending-mentions [stateFile] [limit]

# Mark mention as responded (after replying)
node {SKILL_DIR}/scripts/nostr.js mark-responded <note1...> [responseNoteId]

# Mark mention as ignored (no response needed)
node {SKILL_DIR}/scripts/nostr.js mark-ignored <note1...> [reason]

# Check hourly rate limit (max 10/hr)
node {SKILL_DIR}/scripts/nostr.js rate-limit

# Show autoresponse state summary
node {SKILL_DIR}/scripts/nostr.js autoresponse-status
```

**State file:** `~/.openclaw/workspace/memory/nostr-autoresponse-state.json`
**WoT source:** Owner's follow list (defined in nostr.js as OWNER_PUBKEY)

## User Phrases → Actions

| User says | Action |
|-----------|--------|
| "post X" | `echo "X" \| nostr.js post -` |
| "reply to X with Y" | `echo "Y" \| nostr.js reply <note> -` |
| "check mentions" | `nostr.js mentions` |
| "my feed" | `nostr.js feed` |
| "follow X" | Lookup if NIP-05 → `nostr.js follow` |
| "DM X message" | `echo "message" \| nostr.js dm <npub> -` |
| "zap X 100 sats" | `nostr.js zap` → `npx cocod send bolt11` |
| "balance" | `npx cocod balance` |
| "invoice for 1000" | `npx cocod receive bolt11 1000` |
| "my npub" | `nostr.js whoami` |
| "my lightning address" | `npx cocod npc address` |

## Defaults

| Setting | Value |
|---------|-------|
| Mint | `https://mint.minibits.cash/Bitcoin` |
| Lightning domain | `@npubx.cash` |
| Avatar fallback | `https://api.dicebear.com/7.x/shapes/png?seed=<npub>` |
| Nostr key | `~/.nostr/secret.key` |
| Wallet data | `~/.cocod/` |

## Integration

### SOUL.md
- Pull name/about from SOUL.md or IDENTITY.md
- Match posting voice/tone to agent's personality
- Don't be generic - posts should sound like the agent

### HEARTBEAT.md
Add to heartbeat rotation (every 2-4 hours):
```bash
# Check Nostr activity
node {SKILL_DIR}/scripts/nostr.js mentions 10
node {SKILL_DIR}/scripts/nostr.js dms 5
```
If mentions from WoT or zaps received → notify user.

### TOOLS.md
After setup, store for quick reference:
```markdown
## Nostr
- npub: npub1...
- Lightning: [email protected]  
- Owner: npub1... (followed)
```

## Profile Sources

- **Name**: IDENTITY.md or SOUL.md
- **About**: SOUL.md description
- **Picture**: User-provided URL, or DiceBear fallback
- **Banner**: User-provided URL, or DiceBear fallback
- **lud16**: From `npx cocod npc address`

「AI 智能体」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。