Skip to content

netresearch/matrix-skill / skills/matrix-administration

matrix-administration

Verified

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.

scripts/test_synapse_graph.py

View on GitHub
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: Netresearch DTT GmbH

"""Tests for synapse-graph.py: room-supplied text stays inside its DOT string.

Run directly (stdlib only):

    python3 skills/matrix-administration/scripts/test_synapse_graph.py
"""

import importlib.util
import os
import re
import sys
import unittest

HERE = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, HERE)

from _lib.condensing import Room

_spec = importlib.util.spec_from_file_location(
    "synapse_graph", os.path.join(HERE, "synapse-graph.py")
)
synapse_graph = importlib.util.module_from_spec(_spec)
_spec.loader.exec_module(synapse_graph)

# A double quote not preceded by a backslash would end the DOT string.
UNESCAPED_QUOTE = re.compile(r'(?<!\\)"')


class NodeLabelTests(unittest.TestCase):
    def test_space_names_in_the_join_policy_are_escaped(self):
        space = Room(id="!space:example.org", name='Ops", fillcolor="red', version=10)
        room = Room(
            id="!room:example.org",
            name="Room",
            version=10,
            join_policy=("in-space", [space.id]),
        )
        label = synapse_graph.node_label(room, {space.id: space, room.id: room})
        self.assertIn("members of Ops", label)
        self.assertIsNone(UNESCAPED_QUOTE.search(label), label)

    def test_room_name_creator_and_version_are_escaped(self):
        room = Room(
            id="!room:example.org",
            name='Na"me\\',
            version='1"',
            creator='@a"b:example.org',
            join_policy="invite-only",
        )
        label = synapse_graph.node_label(room, {room.id: room})
        self.assertIsNone(UNESCAPED_QUOTE.search(label.replace("\\\\", "")), label)


if __name__ == "__main__":
    unittest.main(verbosity=2)
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall