netresearch/matrix-skill / skills/matrix-communication
matrix-communication
FlaggedUse when communicating via Matrix chat, notifying teams, or managing E2EE. Triggers on #room:server references, Matrix URLs, and chat requests.
scripts/matrix-resolve.py
View on GitHub#!/usr/bin/env -S uv run --script
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: Netresearch DTT GmbH
# /// script
# requires-python = ">=3.11"
# dependencies = []
# ///
"""Resolve a Matrix room alias to room ID.
Usage:
matrix-resolve.py ALIAS [--json]
matrix-resolve.py --help
Arguments:
ALIAS Room alias (e.g., #myroom:matrix.org)
Options:
--json Output as JSON
--help Show this help
"""
import json
import os
import sys
# Add script directory to path for _lib imports
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from _lib import load_config, resolve_room_alias
sys.stdout.reconfigure(line_buffering=True)
sys.stderr.reconfigure(line_buffering=True)
def main():
import argparse
parser = argparse.ArgumentParser(
description="Resolve a Matrix room alias to room ID"
)
parser.add_argument("alias", help="Room alias (e.g., #myroom:matrix.org)")
parser.add_argument("--json", action="store_true", help="Output as JSON")
args = parser.parse_args()
if not args.alias.startswith("#"):
print("Error: Alias must start with #", file=sys.stderr)
sys.exit(1)
config = load_config()
try:
room_id = resolve_room_alias(config, args.alias)
result = {"room_id": room_id, "alias": args.alias}
if args.json:
print(json.dumps(result, indent=2))
else:
print(f"Alias: {args.alias}")
print(f"Room ID: {room_id}")
except ValueError as e:
if args.json:
print(json.dumps({"error": str(e)}))
else:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |