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.

referencesroom-graph-pipeline.md

≈761 tokens on demand. Your agent reads this file only when SKILL.md points to it.

<!-- SPDX-License-Identifier: CC-BY-SA-4.0 --> <!-- SPDX-FileCopyrightText: Netresearch DTT GmbH -->

Room graph pipeline

synapse-graph.py produces a Graphviz .dot file (and optionally an .svg via the system dot binary) showing every non-replaced room and its parent-space relationships. Edges go from a child room to its parent space; node colours and the gradient on space nodes encode the rating.

Local one-shot

uv run skills/matrix-administration/scripts/synapse-fetch-rooms.py
uv run skills/matrix-administration/scripts/synapse-graph.py --space '!home:server'
xdg-open rooms.svg

dot must be installed (apt install graphviz, brew install graphviz, …). Pass --no-svg to emit only the .dot source.

Periodic dashboard (Docker)

A common deployment is a static-file container that re-runs the snapshot+render at build time and serves the resulting SVG behind a reverse proxy. The Dockerfile below is a generic version of the upstream pipeline — drop in your own homeserver URL and reverse-proxy labels.

# Builder: produce rooms.{en,de}.svg from a live snapshot
FROM python:3.13-slim AS builder
WORKDIR /app
RUN apt-get update \
 && apt-get install -y --no-install-recommends graphviz \
 && rm -rf /var/lib/apt/lists/*
# uv starts the scripts on Python 3.11 or later (here the image's 3.13)
COPY --from=ghcr.io/astral-sh/uv:0.13.1 /uv /bin/uv

COPY skills/matrix-administration/scripts ./scripts

# admin token mounted as a build secret
RUN --mount=type=secret,id=matrix_token \
    mkdir -p /root/.config/matrix && \
    cat <<EOF > /root/.config/matrix/config.json
{
  "homeserver": "${MATRIX_HOMESERVER:-https://matrix.example.com}",
  "admin_token": "$(cat /run/secrets/matrix_token)"
}
EOF

RUN uv run scripts/synapse-fetch-rooms.py
RUN LANGUAGE=en uv run scripts/synapse-graph.py && mv rooms.svg rooms.en.svg
RUN LANGUAGE=de uv run scripts/synapse-graph.py && mv rooms.svg rooms.de.svg

# Runtime: any tiny static-file server
FROM ghcr.io/thedevminertv/gostatic:1.5.2
CMD ["-cache","4h","-log-requests","-compress-level=2","-spa","-index","rooms.en.svg"]
COPY --from=builder /app/rooms.*.svg /static/

Build with:

echo -n "syt_admin_…" > /tmp/token
DOCKER_BUILDKIT=1 docker build --secret id=matrix_token,src=/tmp/token -t matrix-graph .

Schedule a rebuild however your platform prefers (cron + docker compose build --no-cache && up -d, a CI pipeline on a timer, a Kubernetes CronJob …).

Reading the output

  • Green node — all checks SUCCESS.
  • Orange node — at least one WARNING, no FAIL.
  • Red node — at least one FAIL.
  • Spaces get a green→blue gradient when healthy, otherwise a flat orange/red.
  • Edges are labelled space child and point from a room to the space that contains it.
  • Node tooltip (visible in browsers / vector editors that honour SVG title attributes) lists every individual rating message.
  • Replaced rooms (those that were upgraded and tombstoned) are dropped from the graph entirely.

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