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
累計下載
3622
星標
4
全站排名
#2,999
全站前 60% · 「AI 智慧體」前 63%
平台累計安裝累計下載星標評論
ClawHub ↗11536224-
SkillHub ↗11535984—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

需要使用者明確同意後才建立金鑰和錢包;助記詞儲存在配置檔案中,應備份並妥善保管。配置完成後可讀取動態與提及,也能按使用者要求發帖、私信、關注賬號或執行 zap/付款。 充值前先審查付款確認與安裝行為,並保護本地金鑰檔案。

資料釋出於 2026-10-29

可以用來做什麼

  • 建立智慧體的 Nostr 身份和錢包
  • 檢視動態、提及或私信
  • 按使用者要求關注、發帖或進行 zap

什麼時候用

  • 準備為智慧體建立獨立的 Nostr 身份和錢包時
  • 需要讀取 Nostr 內容或由使用者明確要求執行社交與支付操作時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

先說明建立金鑰和錢包會做什麼,並等待我明確同意;再指導我安全備份助記詞。
檢視我的 Nostr 提及,不要自動回覆或傳送內容。
準備釋出或付款前先向我展示操作和內容,等待確認。

月度資料趨勢

累計下載3622
2275299937222026-03 · 累計下載 23752026-05 · 累計下載 29532026-06 · 累計下載 30852026-07 · 累計下載 33322026-08 · 累計下載 34362026-09 · 累計下載 362226-0326-09
星標4
3442026-03 · 星標 32026-05 · 星標 42026-06 · 星標 42026-07 · 星標 42026-08 · 星標 42026-09 · 星標 426-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-093622—4
2026-083436+3.1%4
2026-073332+8.0%4
2026-063085+4.5%4
2026-052953—4
2026-032375—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),按月更新。口徑說明見資料方法。