# weixin-agent-sdk

This skill wires any AI backend into WeChat through the weixin-agent-sdk TypeScript framework: QR login plus a message loop.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1100 installs · ★ 88
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/trending-skills/tree/HEAD/skills/weixin-agent-sdk/SKILL.md
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/skills/weixin-agent-sdk

## What it does

The skill covers `weixin-agent-sdk`, a TypeScript framework that bridges an AI backend to WeChat over the Clawbot channel. Messages arrive by long-polling, so no public server is needed. The surface is a single `Agent` interface with a `chat` method — plug in OpenAI, Claude, or your own logic.

The flow: call `login()` once and scan the QR code, credentials land in `~/.openclaw/`. Then `start(agent)` runs the message loop and reconnects when the session expires. Each `ChatRequest` carries a `conversationId`, the text, and any attachment as a local path — images, voice, video and files are already downloaded and decrypted. Replies go back as text or as media from a local path or an HTTPS URL.

Node.js 22 or newer is required. Voice notes from WeChat need `silk-wasm` to convert SILK to WAV; without it that conversion does not happen. If you already run an ACP-compatible agent, skip the code: the `weixin-acp` package launches it as a subprocess and talks JSON-RPC over stdio. Inside the chat, `/echo <message>` and `/toggle-debug` control the bot.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill weixin-agent-sdk -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/weixin-agent-sdk/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/weixin-agent-sdk/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill weixin-agent-sdk -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/weixin-agent-sdk/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill weixin-agent-sdk -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/weixin-agent-sdk/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/trending-skills weixin-agent-sdk
```

2. **Manually: put the files in place**
- File: `.github/skills/weixin-agent-sdk/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill weixin-agent-sdk -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/trending-skills --path skills/weixin-agent-sdk
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/weixin-agent-sdk/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill weixin-agent-sdk -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/trending-skills/tree/HEAD/skills/weixin-agent-sdk/SKILL.md

## When to use it
- connect an AI agent to WeChat without a public server
- accept an image or file from chat and hand it to the agent
- keep per-conversation history keyed by conversationId
- run Claude or Codex as a WeChat bot over ACP
- send an image or PDF back to the user

## Example prompts
- Bridge my agent to WeChat with weixin-agent-sdk: set up login and start with an Agent implementation
- Configure weixin-acp for Claude so it answers in WeChat
- Add incoming image support to my WeChat agent and reply with a file

## Similar
- [rivet-sdk](https://affpapa.org/en/nevibecode/skills/anthropics-rivet-sdk.md) — skill · 2100 installs
- [openai-agents-sdk](https://affpapa.org/en/nevibecode/skills/laguagu-openai-agents-sdk.md) — skill · 2200 installs
- [agents-sdk](https://affpapa.org/en/nevibecode/skills/openai-agents-sdk.md) — skill · 22 installs
- [migrate-ai-sdk-v6-to-v7](https://affpapa.org/en/nevibecode/skills/migrate-ai-sdk-v6-to-v7.md) — skill · 5500 installs
- [sentry-node-sdk](https://affpapa.org/en/nevibecode/skills/sentry-node-sdk.md) — skill · 3300 installs
- [copilot-sdk](https://affpapa.org/en/nevibecode/skills/intellectronica-copilot-sdk.md) — skill · 531 installs

From the same set: [reason-machines/trending-skills](https://affpapa.org/en/nevibecode/by/reason-machines/trending-skills.md) — 139 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
