بنقرة واحدة
add-matrix
Add Matrix channel integration via Chat SDK. Works with any Matrix homeserver.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Add Matrix channel integration via Chat SDK. Works with any Matrix homeserver.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | add-matrix |
| description | Add Matrix channel integration via Chat SDK. Works with any Matrix homeserver. |
Adds Matrix support via the Chat SDK bridge.
NanoClaw doesn't ship channels in trunk. This skill copies the Matrix adapter in from the channels branch.
Skip to Credentials if all of these are already in place:
src/channels/matrix.ts existssrc/channels/matrix-registration.test.ts existssrc/channels/index.ts contains import './matrix.js';@beeper/chat-adapter-matrix is listed in package.json dependenciesOtherwise continue. Every step below is safe to re-run.
git fetch origin channels
git show origin/channels:src/channels/matrix.ts > src/channels/matrix.ts
git show origin/channels:src/channels/matrix-registration.test.ts > src/channels/matrix-registration.test.ts
Append to src/channels/index.ts (skip if the line is already present):
import './matrix.js';
pnpm install @beeper/chat-adapter-matrix@0.2.0
The adapter's published dist references matrix-js-sdk/lib/... without .js
extensions, which fails under Node 22 strict ESM resolution. Add the missing
extensions (idempotent — safe to re-run):
node -e '
const fs = require("fs"), path = require("path");
const root = "node_modules/.pnpm";
const dir = fs.readdirSync(root).find(d => d.startsWith("@beeper+chat-adapter-matrix@"));
if (!dir) { console.log("Matrix adapter not installed"); process.exit(0); }
const f = path.join(root, dir, "node_modules/@beeper/chat-adapter-matrix/dist/index.js");
fs.writeFileSync(f, fs.readFileSync(f, "utf8").replace(
/from "(matrix-js-sdk\/lib\/[^"]+?)(?<!\.js)"/g, "from \"$1.js\""
));
console.log("Patched", f);
'
Re-run this after every pnpm install that touches the adapter.
pnpm run build
pnpm exec vitest run src/channels/matrix-registration.test.ts
Both must be clean before proceeding. matrix-registration.test.ts is the one integration test: it imports the real channel barrel and asserts the registry contains matrix. It goes red if the import './matrix.js'; line is deleted or drifts, if the barrel fails to evaluate, or if @beeper/chat-adapter-matrix isn't installed (the import throws) — so it also implicitly verifies the dependency from step 4. The adapter also calls core's createChatSdkBridge(...); that typed core-API consumption is guarded by pnpm run build.
End-to-end message delivery against a real Matrix homeserver is verified manually once the service is running — see Next Steps.
The bot needs its own Matrix account — separate from the user's account. This is required because Matrix cannot send DMs to yourself.
andybot on matrix.org)@andybot:matrix.org)Option A: Username + Password (simpler)
No extra steps — just use the bot account's credentials directly. The adapter logs in automatically.
MATRIX_BASE_URL=https://matrix.org
MATRIX_USERNAME=andybot
MATRIX_PASSWORD=your-bot-password
MATRIX_USER_ID=@andybot:matrix.org
MATRIX_BOT_USERNAME=Andy
Option B: Access Token (recommended for production)
Get an access token from Element: sign into the bot account → Settings > Help & About > Access Token (under Advanced). Or via API:
curl -XPOST 'https://matrix.org/_matrix/client/r0/login' \
-d '{"type":"m.login.password","user":"andybot","password":"..."}'
MATRIX_BASE_URL=https://matrix.org
MATRIX_ACCESS_TOKEN=your-access-token
MATRIX_USER_ID=@andybot:matrix.org
MATRIX_BOT_USERNAME=Andy
MATRIX_INVITE_AUTOJOIN=true # Auto-accept room invites (default: true)
MATRIX_INVITE_AUTOJOIN_ALLOWLIST=@you:matrix.org # Only accept invites from these users
MATRIX_RECOVERY_KEY=your-recovery-key # Enable E2EE cross-signing
MATRIX_DEVICE_ID=NANOCLAW01 # Stable device ID across restarts
Add the chosen env vars to .env, then sync:
mkdir -p data/env && cp .env data/env/env
If you're in the middle of /setup, return to the setup flow now.
Otherwise, run /manage-channels to wire this channel to an agent group.
matrix!abc123:matrix.org) and optional aliases (like #general:matrix.org).openDM to resolve the room automatically. For group rooms, in Element click the room name > Settings > Advanced — the "Internal room ID" is the platform ID (starts with !). Or use a room alias like #general:matrix.org.Add persistent graph-based memory via mnemon. Agents recall past context before responding and remember insights after each turn.
Use OpenCode as an agent provider. OpenRouter, OpenAI, Google, DeepSeek, etc. via OpenCode config — not the Anthropic Agent SDK. Per group via `ncl groups config update --provider opencode`; host passes OPENCODE_* and XDG mount when spawning containers.
Configure which host directories agent containers can access. View, add, or remove mount allowlist entries. Triggers on "mounts", "mount allowlist", "agent access to directories", "container mounts".
Add clidash — a zero-dependency, read-only web dashboard that derives its tabs and tables at runtime from any CLI that lists resources as JSON. Ships pre-wired for NanoClaw's ncl CLI (agent groups, sessions, channels, users, roles), plus message-activity charts, a log tail, and a read-only file viewer for group skills/CLAUDE.md/profiles.
Distill a reusable skill from anything — a directory, a URL, pasted notes, or what you just did together — or refine an existing skill with new learnings. Use when the user says '/learn', 'learn this', 'turn this into a skill', 'capture this workflow', 'make a skill from <source>', or 'improve/update the <name> skill'. Produces or updates a .claude/skills/<name>/SKILL.md authored to NanoClaw's skill guidelines. (This CREATES or REFINES a skill from a source; it does not install existing skills from a registry.)
Add Discord bot channel integration via Chat SDK.