Index of every page on this site: llms.txt
All skills
netresearch avatar

/matrix-administration

@3e8b423
Run it yourself

Use when administering a Synapse / Matrix homeserver — list or snapshot all rooms, rate room health (public, unencrypted, orphaned), render a Graphviz map of the room/space tree, force-join users, promote room admins, harden rooms (add-to-space + restrict + encrypt), deactivate Matrix users (with GDPR erase), find biggest rooms by DB size, audit where a user is admin or member, replay join/leave timelines, or search unencrypted history. Trigger on any '/_synapse/admin', server-wide room operation, Matrix user offboarding, or anything requiring a homeserver-admin token — even without 'admin API' in the prompt. Companion to matrix-communication.

Use this Skill: https://skilld.dev/gh/netresearch/matrix-skill/matrix-administration

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈170 tokens for metadata: the name and description. ≈1k when used: this file. ≈7.4k more on demand in 6 files.

Description uses 8.4% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈675 characters, or 8.4%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Matrix Administration

Stdlib-only Python wrappers around the Synapse Admin API and the Client-Server API. Reads ~/.config/matrix/config.json (the same file matrix-communication uses).

Quick Reference

S=skills/matrix-administration/scripts

uv run ${CLAUDE_SKILL_DIR}/scripts/synapse-fetch-rooms.py [--server :example.com]
uv run ${CLAUDE_SKILL_DIR}/scripts/synapse-rate-rooms.py --space '!home:srv' [--language de]
uv run ${CLAUDE_SKILL_DIR}/scripts/synapse-graph.py --space '!home:srv'
uv run ${CLAUDE_SKILL_DIR}/scripts/synapse-biggest-rooms.py [-n 10]

uv run ${CLAUDE_SKILL_DIR}/scripts/synapse-join-room.py    '!room:srv' '@user:srv'
uv run ${CLAUDE_SKILL_DIR}/scripts/synapse-make-admin.py   '!room:srv' '@user:srv'
uv run ${CLAUDE_SKILL_DIR}/scripts/synapse-add-to-space.py '!room:srv' '!space:srv'
uv run ${CLAUDE_SKILL_DIR}/scripts/synapse-migrate-room.py '!room:srv' '@admin:srv' '!space:srv'   # DESTRUCTIVE, asks first

uv run ${CLAUDE_SKILL_DIR}/scripts/synapse-deactivate-user.py   '@user:srv'   # DESTRUCTIVE
uv run ${CLAUDE_SKILL_DIR}/scripts/synapse-user-rooms.py        '@user:srv'
uv run ${CLAUDE_SKILL_DIR}/scripts/synapse-user-admin-rooms.py  '@user:srv'
uv run ${CLAUDE_SKILL_DIR}/scripts/synapse-room-member-flow.py  '!room:srv'
uv run ${CLAUDE_SKILL_DIR}/scripts/synapse-search.py            '!room:srv' '@bot:srv' deploy

Scripts

Script Purpose
synapse-fetch-rooms.py Snapshot all rooms + state → rooms.json
synapse-rate-rooms.py Health checks (EN/DE) on rooms.json
synapse-graph.py Render rooms.json → Graphviz .dot + .svg
synapse-biggest-rooms.py Top-N rooms by DB size
synapse-join-room.py Force-join a user
synapse-make-admin.py Promote to PL 100
synapse-add-to-space.py Send m.space.child
synapse-migrate-room.py Add to space + restrict + encrypt
synapse-deactivate-user.py Destructive deactivation (--erase for GDPR)
synapse-user-admin-rooms.py Local: rooms where user is PL 100
synapse-user-rooms.py Local: rooms a user belongs to
synapse-room-member-flow.py Join/leave timeline
synapse-search.py Unencrypted history search

Setup

~/.config/matrix/config.json (respects $XDG_CONFIG_HOME):

{
  "homeserver": "https://matrix.example.com",
  "admin_token": "syt_admin_…",
  "room_filter": ":example.com",
  "default_space_id": "!home:example.com",
  "home_space_ids": ["!home:example.com"]
}

homeserver and either admin_token or access_token (server-admin) are required. The other fields are optional. To keep the token out of this file, set admin_token_file to a file holding it (relative paths resolve against the config directory) or export MATRIX_ADMIN_TOKEN; the environment wins over the file, the file over the inline value. Env fallbacks: MATRIX_USER_ID, MATRIX_SPACE_ID, LANGUAGE=en|de, NO_COLOR.

Safety

The token is server-admin. Read references/safety-guide.md before any destructive op.

  • synapse-deactivate-user.py is irreversible.
  • synapse-migrate-room.py enables encryption (one-way) and restricts joins; it prints the plan and asks before the first write (--yes skips, and is required without a terminal). Power-level changes restored on exit including Ctrl-C.
  • synapse-make-admin.py raises PL 100 permanently.
  • synapse-search.py cannot read E2EE — empty ≠ no messages.
  • rooms.json exposes user IDs; never commit it.

References

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

2 warnings13d3 checks · Risk SAFE
  • Gen Agent Trust Hub13d

    This skill provides a set of administrative tools for Matrix Synapse homeservers using standard Python scripts. It correctly handles sensitive admin tokens with redirect protections and follows established security practices for server administration tools.

  • Socket13d

    1 alert: gptSecurity

  • Snyk13d

    Risk: MEDIUM · 1 issue

Signed by skilld at 3e8b423. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 days ago
What it can do
Runs commands
All 1 allowed tools
Bash(uv run ${CLAUDE_SKILL_DIR}/scripts/*) Bash(uv run skills/matrix-administration/scripts/*) Bash(dot:*) Read Write
Other metadata
compatibility
Requires uv (runs the scripts on Python 3.11 or later; stdlib only) + a Matrix access token belonging to a Synapse server-admin user. Optional: graphviz `dot` for SVG. Synapse 1.x with admin API enabled.
metadata
{
  "author": "Netresearch DTT GmbH",
  "version": "4.4.2",
  "repository": "https://github.com/netresearch/matrix-skill"
}

README badge

README badge for netresearch/matrix-skill/matrix-administration