add-matrix
Skill3 starsChanged 59 days agoMITView on GitHub
Add Matrix channel integration via Chat SDK. Works with any Matrix homeserver.
- Reads credentials
- Sends data out
We split this skill into the rules it gives an agent
3 rules. 1 is common, 0 are distinctive, and 2 are very specific to this project.
1
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 102
No extra steps — just use the bot account's credentials directly.
- Very specific: line 182
If you're in the middle of /setup, return to the setup flow now.
- Very specific: line 205
Registered but silent: Run pnpm exec vitest run src/channels/matrix-registration.test.ts — red means the barrel import or the …
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add Matrix Channel
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.
The mechanical steps under Apply carry nc: directive fences: an agent
reads the prose and applies them, and a parser can apply them deterministically
from the same document. Every directive is idempotent, so the whole skill is
safe to re-run; anything a parser can't apply falls back to the prose beside it.
Apply
1. Copy the adapter
Fetch the channels branch and copy the Matrix adapter into src/channels/
(overwrite — the branch is canonical):
src/channels/matrix.ts
src/channels/matrix-registration.test.ts2. Register the adapter
Append the self-registration import to the channel barrel (skipped if the line is already present). This one line is the skill's only reach-in into core:
import './matrix.js';3. Configure the ESM patch
The published adapter references matrix-js-sdk/lib/... without .js
extensions, which fails under Node 22 strict ESM resolution. Register the
committed pnpm patch before installing the package. pnpm reapplies it after
every install and fails if the pinned package drifts away from the patch:
patches/@beeper__chat-adapter-matrix@0.2.0.patchpnpm pkg set 'pnpm.patchedDependencies[@beeper/chat-adapter-matrix@0.2.0]=patches/@beeper__chat-adapter-matrix@0.2.0.patch'4. Install the adapter package
Pinned to an exact version — the supply-chain policy rejects ranges and latest.
The Matrix adapter lives in the @beeper/ namespace and versions on its own
track (not the @chat-adapter/* family), so it carries its own pin:
@beeper/chat-adapter-matrix@0.2.05. Verify and build
Build guards the typed createChatSdkBridge(...) core call the adapter makes
and fails if the import './matrix.js'; line is missing. The direct Node import
checks the published ESM entrypoint using the real runtime resolver:
pnpm run buildnode --input-type=module -e 'await import("@beeper/chat-adapter-matrix")'pnpm exec vitest run src/channels/matrix-registration.test.tsmatrix-registration.test.ts imports the real channel barrel and asserts the
registry contains matrix. It goes red if the import 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 covers the dependency from step 3.
End-to-end message delivery against a real Matrix homeserver is verified manually once the service is running — see Next Steps.
Credentials
The bot needs its own Matrix account — separate from the user's account. This is required because Matrix cannot send DMs to yourself. These steps are human and interactive (no parser can click through Element), so they stay prose.
Create a bot account
- Open app.element.io in a private/incognito window (or sign out first)
- Register a new account for the bot (e.g.
andyboton matrix.org) - Note the bot's user ID (e.g.
@andybot:matrix.org)
Choose an auth method
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=AndyOption 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=AndyOptional settings
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 restartsStore the credentials
Capture the values for the auth method you chose, then write them. prompt only
asks and binds the answer to a name; a separate directive consumes it — so the
same prompts could feed ncl or the OneCLI vault instead of .env by swapping
only the consumer. The homeserver URL, the bot's user ID, and a display name are
shared across both auth methods:
Paste the homeserver base URL, e.g. `https://matrix.org`.Paste the bot's full Matrix user ID, e.g. `@andybot:matrix.org`.Paste a display name for the bot, e.g. `Andy`.MATRIX_BASE_URL={{base_url}}
MATRIX_USER_ID={{user_id}}
MATRIX_BOT_USERNAME={{bot_username}}For Option A capture the bot login, for Option B capture the access token — set only the block matching your chosen method:
Option A only — the bot's login username (the localpart, e.g. `andybot`).Option A only — the bot account's password.MATRIX_USERNAME={{username}}
MATRIX_PASSWORD={{password}}Option B only — the access token from Element Settings > Help & About, or from the login API.MATRIX_ACCESS_TOKEN={{access_token}}Next Steps
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.
Channel Info
- type:
matrix - terminology: Matrix has "rooms." A room can be a group chat or a direct message. Rooms have internal IDs (like
!abc123:matrix.org) and optional aliases (like#general:matrix.org). - how-to-find-id: For DMs, use the bot's
openDMto 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. - supports-threads: partial (some clients support threads, but not all — treat as no for reliability)
- typical-use: Interactive chat — rooms or direct messages. Requires a separate bot account (the agent cannot DM users from their own account).
- default-isolation: Same agent group for rooms where you're the primary user. Separate agent group for rooms with different communities or sensitive contexts.
Troubleshooting
Build fails with ERR_MODULE_NOT_FOUND for matrix-js-sdk/lib/.... The ESM extension patch (step 4) hasn't been applied — or a later pnpm install reinstalled the adapter and wiped it. Re-run the patch, then pnpm run build; the patch is idempotent, so re-running is always safe.
Login fails with M_FORBIDDEN. The username/user-ID split is the usual trip: MATRIX_USERNAME is the bare localpart (andybot), while MATRIX_USER_ID is the full ID (@andybot:matrix.org) — swapping them fails auth. With Option B, an access token dies the moment that Element session signs out; grab a fresh one from Settings → Help & About → Access Token, or via the login API.
The bot never joins your room. Auto-join is on by default (MATRIX_INVITE_AUTOJOIN=true), but an allowlist (MATRIX_INVITE_AUTOJOIN_ALLOWLIST) that doesn't include your user ID makes it ignore your invites. Invite the bot from your own account and watch the service log for the join.
Messages to yourself never arrive. Matrix cannot DM your own account — the bot must be its own account, separate from yours. If you configured the adapter with your personal credentials, register a dedicated bot account and redo the credential steps.
Registered but silent. Run pnpm exec vitest run src/channels/matrix-registration.test.ts — red means the barrel import or the @beeper/chat-adapter-matrix install drifted, so re-run the Apply steps. If green, restart the service (see Next Steps) and check logs/nanoclaw.error.log for login errors.
Other versions7 projects use a version of this.
Word for word · 4
- gavrielc/nanoclaw★ 31k100% same
- nanocoai/nanoclaw★ 31k100% same
- qwibitai/nanoclaw★ 31k100% same
- prathish-ks/isthmus★ 2100% same
Edited · 3
- microsoft/amplifier-app-nanoclaw★ 464% same
- mcarmona1064-cell/clawbridge-codex★ 163% same
- ss2code/nanoclaw-ops★ 161% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use add-iron-proxy, add-mattermost and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
qwibitaiSkilladd-iron-proxy
Install or refresh Iron Proxy and its official Iron Control web console for NanoClaw. Use when selecting the Iron gateway, adding its management UI, configuring credentials and grants, or restoring the proxy, approval bridge, and agent guidance.
Also in 4 projects that use this
qwibitaiSkilladd-mattermost
Add a self-hosted or cloud Mattermost bot channel through the Chat SDK bridge, reusing a healthy server when available and linking to official server setup guidance when needed.
Also in 4 projects that use this
- +2 more from qwibitai
In this repository51 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- container/CLAUDE.mdCLAUDE.md
- add-anydocSkill
- add-atomic-chat-toolSkill
- add-clidashSkill
- add-codexSkill
- add-dashboardSkill
- add-deltachatSkill
- add-dial-numberSkill
- add-dialSkill
- add-dial-toolSkill
- add-discordSkill
- add-emacsSkill
- add-gchatSkill
- add-githubSkill
- add-imessageSkill
- add-karpathy-llm-wikiSkill
- add-linearSkill
- add-macos-statusbarSkill
- add-mnemonSkill
- add-ollama-providerSkill
- add-ollama-toolSkill
- add-opencodeSkill
- add-resendSkill
- add-rtkSkill
- add-signalSkill
- add-slackSkill
- add-tavily-toolSkill
- add-teamsSkill
- add-telegramSkill
- add-vercelSkill
- add-webexSkill
- add-wechatSkill
- add-whatsapp-cloudSkill
- add-whatsappSkill
- customizeSkill
- debugSkill
- init-first-agentSkill
- init-onecliSkill
- learnSkill
- manage-channelsSkill
- manage-mountsSkill
- migrate-from-openclawSkill
- migrate-from-v1Skill
- migrate-memorySkill
- migrate-nanoclawSkill
- migrate-slack-agentsSkill
- setupSkill
- update-nanoclawSkill
- update-skillsSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

