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/_lib/__init__.py
View on GitHub# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: Netresearch DTT GmbH
"""Matrix Skill shared library.
This module provides common functionality for all Matrix scripts.
All modules use ONLY stdlib to ensure non-E2EE scripts work without dependencies.
Usage:
# At the top of each script, add:
import sys, os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
# Then import what you need:
from _lib import load_config, matrix_request, find_room_by_name
"""
# Config
from _lib.config import get_config_path, load_config
# E2EE (only used by E2EE scripts, but still stdlib-only)
from _lib.daemon_client import daemon_request, running_daemon_pid, socket_path
# Dependency checking
from _lib.deps import check_e2ee_dependencies
from _lib.e2ee import (
delete_credentials,
explain_store_error,
get_credentials_path,
get_store_path,
load_credentials,
private_dir,
restore_login_checked,
rooms_dir,
save_credentials,
store_files_for,
store_lock,
store_lock_path,
verification_emoji_path,
verification_partner_allowed,
write_private_file,
)
# Formatting
from _lib.formatting import (
add_bot_prefix,
build_mentions,
inject_pills,
markdown_to_html,
mention_pill,
rich_text_fields,
shorten_service_urls,
)
# HTTP API
from _lib.http import matrix_request, path_segment
# The account's own reactions on an event
from _lib.reactions import annotations, own_reactions
from _lib.roomlog import (
append_record,
build_record,
cursor_path,
log_path,
next_seq,
read_cursor,
read_records,
remember_subject,
room_slug,
subject_index,
summarize_since,
target_of,
write_cursor,
write_room_bundle,
)
# Room operations
from _lib.rooms import (
find_direct_room,
find_room_by_name,
find_room_in_nio_client,
get_room_info,
list_joined_rooms,
normalize_room_input,
resolve_room_alias,
resolve_room_cli,
room_matches,
)
# Device trust for encrypted sends
from _lib.trust import UntrustedDevicesError, send_checked, untrusted_devices
# Utilities
from _lib.utils import (
clean_message,
format_timestamp,
prefer_ipv4,
suppress_nio_logging,
)
__all__ = [
"UntrustedDevicesError",
"add_bot_prefix",
"annotations",
"append_record",
"build_mentions",
"build_record",
"check_e2ee_dependencies",
"clean_message",
"cursor_path",
"daemon_request",
"delete_credentials",
"explain_store_error",
"find_direct_room",
"find_room_by_name",
"find_room_in_nio_client",
"format_timestamp",
"get_config_path",
"get_credentials_path",
"get_room_info",
"get_store_path",
"inject_pills",
"list_joined_rooms",
"load_config",
"load_credentials",
"log_path",
"markdown_to_html",
"matrix_request",
"mention_pill",
"next_seq",
"normalize_room_input",
"own_reactions",
"path_segment",
"prefer_ipv4",
"private_dir",
"read_cursor",
"read_records",
"remember_subject",
"resolve_room_alias",
"resolve_room_cli",
"restore_login_checked",
"rich_text_fields",
"room_matches",
"room_slug",
"rooms_dir",
"running_daemon_pid",
"save_credentials",
"send_checked",
"shorten_service_urls",
"socket_path",
"store_files_for",
"store_lock",
"store_lock_path",
"subject_index",
"summarize_since",
"suppress_nio_logging",
"target_of",
"untrusted_devices",
"verification_emoji_path",
"verification_partner_allowed",
"write_cursor",
"write_private_file",
"write_room_bundle",
]
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 |