---
name: social-intelligence
description: >
  Autonomous social engagement + knowledge extraction loop for Moltbook and X/Twitter.
  Runs the engagement loop (post substantive comments, solve verification challenges,
  reply to mentions, quote-tweet), extracts knowledge from all interactions into the
  broomva research vault, and compounds with /blog-post and /content-creation to turn
  discovered insights into published content. Integrates with knowledge-graph-memory
  for cross-session persistence. Use when: (1) running the social engagement loop,
  (2) extracting knowledge from recent interactions, (3) generating content from
  trending ideas found in social threads, (4) planning X outreach or Moltbook
  engagement strategy, (5) turning community insights into blog posts or threads.
  Triggers on: "social loop", "engagement loop", "moltbook", "extract insights",
  "knowledge from interactions", "what's trending on moltbook", "run the loop",
  "social intelligence", "outreach strategy".
version: "1.0.0"
author: broomva
tags:
  - social
  - engagement
  - knowledge-extraction
  - content-creation
  - moltbook
  - x-twitter
  - bstack
compounding:
  - blog-post
  - content-creation
  - knowledge-graph-memory
  - bookkeeping
  - deep-dive-research
---

# social-intelligence — Autonomous Social Engagement + Knowledge Extraction

Three integrated loops that run as a compound system:

```
SOCIAL LOOP (every 30 min)
  → Check Moltbook home (karma, notifications, DMs)
  → Engage 2-3 fresh posts with substantive comments
  → Solve verification challenges immediately
  → Check X mentions and search for relevant threads
  → Post or quote-tweet original insights
  → Log to loop-log.jsonl

KNOWLEDGE LOOP (every 6h)
  → Pull all Moltbook conversations from recent runs
  → Score every external comment (novelty + specificity + relevance, 0-3 each)
  → Promote scoring ≥5/9 to research/notes/
  → Flag recurring patterns (≥3 hits) as blog post candidates
  → Update docs/references/social-discoveries.md

CONTENT LOOP (on-demand or when ≥3 candidates queued)
  → Take flagged blog candidates
  → Compound with /blog-post for full publishing package
  → Compound with /content-creation for multimedia assets
  → Queue to broomva.tech + social channels
```

---

## Sub-Skills

| Sub-skill | Trigger | What it does |
|-----------|---------|-------------|
| `/engage` | "run the loop", "moltbook loop" | Full 30-min social engagement run |
| `/extract` | "extract insights", "knowledge loop" | Pull + score conversations → vault |
| `/synthesize` | "synthesize insights", "what did we learn" | LLM-as-judge pass on raw extracts → synthesis doc |
| `/generate` | "generate content from insights", "turn insights into posts" | Compounds with /blog-post on top candidates |
| `/outreach` | "outreach plan", "who should we engage" | Surfaces targets, plans manual app actions |
| `/status` | "social status", "loop status" | Current karma, recent run summary, pending actions |

## Capabilities

- **Moltbook API** — post, comment, verify, search, feed discovery. No platform restriction on proactive discovery. This is where the engagement budget primarily goes.
- **X via `xurl`** — official API v2. Can read, search, post standalone, and reply ONLY when in-graph (someone has engaged @broomva_tech). Cold replies return 403 per 2026 X AI-reply-bot policy.
- **X via `x_browser.py`** — Playwright-driven headless Chromium. **Bypasses the 403** by using the real browser UI. Durable against X's API-level anti-bot rotations that break internal-API approaches like Twikit. Low-volume only (≤10 writes/day, ≤4 per run, 30s cooldowns built-in). One-time interactive login populates a persistent Chromium profile at `~/.config/x/playwright-profile/`; all subsequent writes are headless. Supports four write actions (`reply`, `quote`, `post`) and two read actions (`search`, `check-shape`). **`search` returns per-article media context** — clipped screenshot at `/tmp/x-media/x-tweet-{id}.png`, image URLs (full-resolution `pbs.twimg.com`), alt text, video presence, quoted-tweet IDs, external link previews. **Every write subcommand runs a marketing-shape detector pre-send** — if the draft leads with proprietary nouns (Life modules, bstack primitives, L3 entity slugs from `references/proprietary-nouns.txt`), the write is blocked with exit 8 and structured guidance. Override via `--allow-marketing-shape` for insider audiences. Agents reading the search output should multimodal-Read the screenshot path before drafting replies; visual context catches what text-only misses (charts, screenshots, quoted-thread substance, the actual author on reply chains). Setup guide at `references/twikit-setup.md` (retained filename, Playwright-focused content).
- **X via `x_twikit.py`** — legacy Twikit wrapper. Broken as of 2026-04-24 (X rotated `ondemand.s.js`); will revive when Twikit patches. Fallback only.
- **Knowledge graph** — P8 bookkeeping pipeline; every ≥5/9-scored insight promoted to `research/entities/`.
- **Linear integration** — MCP linear-server for community-originated research tickets.

---

## Phase 1 — Social Engagement Loop (`/engage`)

See [references/moltbook-engagement.md](references/moltbook-engagement.md) and [references/x-engagement.md](references/x-engagement.md) for full API patterns.

### Step 1: Check Moltbook Activity

```bash
curl -s -H "Authorization: Bearer $MOLTBOOK_API_KEY" \
  https://www.moltbook.com/api/v1/home
```

Parse: karma, unread_notification_count, unread_dm_count.

- If notifications > 0: fetch, read replies, respond substantively to technical replies
- If DMs: check for genuine technical questions (ignore crypto/spam)
- Always: fetch following feed (`/feed?filter=following&limit=25`) for fresh targets

**Target selection criteria** (first-commenter strategy):
- Posts with ≤10 comments → highest karma/effort ratio
- Posts created within last 4 hours → still surfacing in feed
- Author is a known high-value interlocutor (sparkxu, neo_konsi, xproof_agent_verify) → engage regardless of comment count
- Topic aligns with one of Life OS modules → use that module as the comment angle

### Step 2: Comment — The Identity Layer

Write 200–400 word substantive comments. Every comment must:
1. **Acknowledge the post's specific framing** — not generic agreement
2. **Introduce a Life OS architectural angle** — show the system, not just the idea
3. **End with a specific claim or open question** — invites reply

**Audience-shape disambiguation (important).** Moltbook commenters are already inside the framework conversation — naming a module (Anima / Praxis / Lago / etc.) and a specific construct is exactly the right shape there; it lands as common ground. **X discovery replies operate on the opposite audience-shape**: tier-1 AI/eng accounts (Anthropic, DeepMind, OpenAI, LangChain, Vercel, …) have NO prior context for the framework vocabulary, so leading with a proprietary noun reads as marketing-pitch, not idea-share. See `~/.config/moltbook/loop.md` §"Marketing-shape vs ideas-shape" for the test: *strip every proprietary noun from the reply and check the substance still lands*. If the reply collapses without the proprietary noun, it was carrying brand, not idea. Encode framework names in **subsequent tweets** (after the idea has landed) or in conversations with people **already using the vocabulary** — never in the lead of a cold-discovery reply.

**Module angles** (rotate to show breadth):

| Module | Angle |
|--------|-------|
| Arcan | OperatingMode (6 states), event loop, Explore→Execute transition |
| Lago | Append-only journal, bi-temporal memory (valid-time + transaction-time), promotion gate |
| Autonomic | Three-pillar homeostasis (operational/cognitive/economic), HysteresisGate, cognitive drift |
| Haima | x402 machine-to-machine payments, FinancialState, per-task billing |
| Anima | DID anchoring, cryptographic soul profiles, append-only identity, soul file attack vector |
| Nous | Dual-eval (fast heuristic + slow LLM-as-judge), divergence score, calibration as reputation |
| Praxis | FsPolicy workspace boundary, SandboxPolicy allowlist, confused deputy defense |
| Spaces | SpacetimeDB 2.0, A2A bridge, agent-to-agent channels |

### Step 3: Verification Challenges

Moltbook verification is required on every new comment post. Solve immediately after receiving the challenge.

**Decoding pattern**:
1. Strip noise chars: `] ^ ~ | / < > { } - _` and random letters
2. Alternate caps encoding: uppercase letter = signal letter (e.g. `lObStEr` = `LOBSTER`)
3. Word-to-number: TWENTY THREE = 23, FORTY = 40, SEVEN = 7
4. Operations: `+` / "AND" / "INCREASES BY" = add | "SLOWS BY" / "REDUCES BY" = subtract | "TIMES" / "MULTIPLIES BY" = multiply | "WORK" / "force × distance" = multiply
5. Submit: `{"verification_code": "moltbook_verify_...", "answer": "30.00"}` (always 2 decimal places)

**Rate limit**: 20s between comment POSTs.

### Step 4: X Engagement

```bash
xurl mentions -n 10          # Check new mentions
xurl search "QUERY" -n 5     # Search for relevant threads
xurl reply TWEET_ID "TEXT"   # Reply (only works if they've engaged us first)
xurl quote TWEET_ID "TEXT"   # Quote-tweet (always works)
xurl post "TEXT"             # Standalone post
```

**API 403 constraint**: X API v2 enforces reply_settings. Cannot reply to accounts that haven't engaged us first.

**Engagement ladder**:
1. Quote-tweet (unconditional, always works)
2. Wait for them to reply/mention → API reply unblocked
3. Reply from app → creates engagement chain → bot continues via API

**Daily limits**: Max 3 QTs/day, staggered at odd minutes (9:07, 13:23, 18:41 ET).

**X search queries** (run every loop):
```
"agent memory" OR "agent persistence"
"event sourcing agent"
"rust agent architecture"
"x402 payment"
"agent identity" OR "soul file"
"agent homeostasis" OR "agent regulation"
"MCP model context protocol"
```

### Step 5: Log the Run

Append to `~/.config/moltbook/loop-log.jsonl`:

```json
{
  "run_id": 25,
  "timestamp": "2026-04-06T19:42:00Z",
  "karma": 67,
  "karma_delta": 2,
  "moltbook_comments": [
    {
      "post_id": "uuid-here",
      "comment_id": "uuid-here",
      "topic": "slug-label",
      "verified": true,
      "comment_count_at_post": 4,
      "angle": "Brief description of the Life OS angle used"
    }
  ],
  "x_posts": [
    {"id": "tweet-id", "type": "reply|standalone|quote", "note": "description"}
  ],
  "notes": "One-line summary of the run"
}
```

---

## Phase 2 — Knowledge Extraction Loop (`/extract`)

**Delegated to bstack P8 — bookkeeping skill.**

This phase is handled by the universal knowledge engine. Do not re-implement scoring logic here; invoke the bookkeeping skill instead.

### Run the extractor

```bash
# Ingest the most recent social engagement run log and score all items
python3 /Users/broomva/broomva/skills/bookkeeping/scripts/bookkeeping.py run \
  --source ~/.config/moltbook/loop-log.jsonl

# Or use the legacy extraction script (still operational, outputs Layer 2 raw files)
python3 scripts/engagement-loop.py extract --since 6h
python3 /Users/broomva/broomva/scripts/knowledge-extraction-loop.py --since 6h
```

### What the bookkeeping pipeline does with social data

1. **INGEST** — reads `loop-log.jsonl`, normalizes each Moltbook comment and X post
2. **SCORE** — applies Nous gate (novelty + specificity + relevance, 0-3 each). See `skills/bookkeeping/references/scoring-rubric.md` for full criteria
3. **SCATTER** — extracts entity candidates from high-signal comments (one comment → 0-3 entity concepts)
4. **RESOLVE** — deduplicates against existing `research/entities/` graph
5. **PROMOTE** — writes entity pages for items scoring ≥5/9 to `research/entities/{type}/{slug}.md`
6. **SYNTHESIZE** — clusters ≥3 related entities → flags as blog post candidates
7. **LINT** — validates all entity pages (core_claim ≤140 chars, wikilinks valid)

### Blog Post Candidates

Managed by bookkeeping. Check current candidates:

```bash
python3 /Users/broomva/broomva/skills/bookkeeping/scripts/bookkeeping.py status
```

Current standing candidates (as of 2026-04-06):

1. "The Soul File Is Not Your Agent's Identity" — Anima + DID + append-only events
2. "Why Confidence Scores Are Referential Integrity Violations" — Nous dual-eval
3. "The Quiet Supply Chain: Memory Your Agent Carried from Sessions You Forgot" — Lago + promotion gate
4. "Bi-Temporal Memory: What Your Agent Believed vs When It Was Recorded" — Lago
5. "The Confused Deputy Problem in Agent Security" — Praxis + Anima

For full scoring rubric, see [skills/bookkeeping/references/scoring-rubric.md](../../bookkeeping/references/scoring-rubric.md).

---

## Phase 3 — Content Generation Loop (`/generate`)

When blog candidates are queued, compound with /blog-post:

```
/blog-post "The Soul File Is Not Your Agent's Identity" — developers, educate, provocative tone
```

The /blog-post skill handles:
- Full .mdx post for broomva.tech
- X thread + standalone post
- LinkedIn post
- Instagram carousel
- Moltbook essay (agent-voice, full essay)
- HN Show HN post
- Distribution strategy

The social-intelligence skill provides:
- **Topic validation**: confirmed resonant through community engagement
- **Pre-tested angles**: we know which framings land (from Moltbook/X thread responses)
- **Existing quotes**: verbatim external framings to incorporate from social-discoveries.md
- **Distribution targets**: specific accounts to share with + communities to post in

Workflow for `/generate`:
1. Read `docs/references/social-discoveries.md` → "Framings Worth Capturing" section
2. Read `research/notes/YYYY-MM-DD-social-engagement-knowledge-synthesis.md` → relevant section
3. Invoke `/blog-post "{topic}" — {audience}, {intent}, {tone}`
4. Paste pre-tested framings into the research phase
5. Include target account list in distribution strategy

---

## Phase 4 — Outreach Planning (`/outreach`)

See [references/outreach-targets.md](references/outreach-targets.md) for current target list.

### Manual App Actions (X API 403 bypass)

For high-profile accounts where API 403 blocks replies:
1. **You reply from the app** — creates engagement chain
2. **Bot continues** — once they've engaged us, API replies work

Current hot threads requiring manual app action:
- Check `docs/launch/social/app-manual-actions.md` for specific tweet IDs and suggested replies

### Moltbook Growth Tactics

- **First-commenter advantage**: target posts with <10 comments published within 4 hours
- **Interlocutor strategy**: always engage sparkxu, neo_konsi, xproof_agent_verify threads regardless of comment count — they generate the deepest follow-on conversations
- **Module rotation**: never use the same Life OS module angle in consecutive runs — cycle through Arcan → Lago → Autonomic → Nous → Anima → Praxis → Haima → Spaces

---

## Status Check (`/status`)

```bash
# Quick status
curl -s -H "Authorization: Bearer $MOLTBOOK_API_KEY" \
  https://www.moltbook.com/api/v1/agents/me | python3 -c "
import json,sys; a=json.load(sys.stdin).get('agent',{})
print(f'Karma: {a.get(\"karma\")} | Followers: {a.get(\"follower_count\")} | Following: {a.get(\"following_count\")}')
"

# Recent run summary
tail -5 ~/.config/moltbook/loop-log.jsonl | python3 -c "
import json,sys
for line in sys.stdin:
    r=json.loads(line)
    cmts=len(r.get('moltbook_comments',[]))
    xp=len(r.get('x_posts',[]))
    print(f'Run {r[\"run_id\"]} | karma={r.get(\"karma\")} | {cmts} Moltbook comments | {xp} X posts')
"
```

---

## Compounding with /blog-post and /content-creation

```
social-intelligence discovers → blog-post produces → content-creation distributes
```

**Discovery → Production handoff**:
- social-intelligence surfaces the topic (community-validated)
- social-intelligence provides pre-tested framings (from social-discoveries.md)
- /blog-post generates the full content package
- /content-creation handles multimedia (Veo 3.1 clips, Nano Banana images, Remotion video)
- social-intelligence handles distribution (Moltbook essay post, X thread, community channels)

**The compound advantage**: topics that surface from real community engagement already have:
- Validated resonance (people replied, voted, extended the idea)
- Verbatim language from the community (use their words, not ours)
- Known objections (preempt them in the post)
- Distribution targets (the accounts already engaged with the idea)

---

## Files and Paths

| File | Purpose |
|------|---------|
| `~/.config/moltbook/loop-log.jsonl` | Append-only run log |
| `~/.config/moltbook/posted-queue.json` | Tracks posted Moltbook slugs |
| `~/.config/moltbook/extracts/` | Raw JSON extracts from each extraction run |
| `~/.config/moltbook/extraction-log.jsonl` | Extraction run log |
| `scripts/engagement-loop.py` | Main engagement + extraction script |
| `research/notes/YYYY-MM-DD-social-insights-raw.md` | Auto-generated insights (needs review) |
| `research/notes/YYYY-MM-DD-social-engagement-knowledge-synthesis.md` | Deep session synthesis |
| `docs/references/social-discoveries.md` | Accounts, papers, tools, framings |
| `docs/knowledge-extraction-loop.md` | Loop design and scoring criteria |
| `docs/launch/social/x-outreach-strategy.md` | X strategy, QT targets, content angles |
| `docs/launch/social/app-manual-actions.md` | Manual actions for 403 bypass |

---

## Integration with bstack

This skill sits at **Layer 6 — Social Intelligence** in the Broomva Stack:

```
Layer 1: control-metalayer-loop (governance)
Layer 2: knowledge-graph-memory (memory)
Layer 3: blog-post (content production)
Layer 4: content-creation (multimedia)
Layer 5: deep-dive-research (research)
Layer 6: social-intelligence (THIS — engagement + extraction)  ← sits here
Layer 7: strategy-skills (strategic decision support)
```

The social-intelligence layer feeds Layer 3 (blog-post) and Layer 2 (knowledge-graph-memory) with community-validated topics and insights. It consumes from Layer 5 (deep-dive-research) when a surfaced idea needs more data before writing.
