tg-report
Thin wrapper around $AI_AGENTS_SKILLS_ROOT/skills/tg-notify/tg-notify.sh (with Claude/Codex/Cursor root fallbacks below) that routes to one of two forum topics and enforces a length budget in concise mode.
When to invoke
User-triggered only. Treat any trigger as explicit Telegram-send authorization — ignore the 20-minute threshold of tg-notify.
Routing — pick topic by keyword
- Request contains «задача» / «по задаче» / "task" → task topic (
TELEGRAM_NOTIFY_TASK_THREAD). - Otherwise (plain «отчёт» / «о завершении» / "completion") → completion topic (
TELEGRAM_NOTIFY_COMPLETION_THREAD).
If genuinely ambiguous, ask the user.
Modes
| Mode | Trigger | Budget |
|---|---|---|
| Concise (default) | plain "Отправить отчёт" / "Send report" | ≤ 3500 chars (title + body). Rewrite for density if over. |
| Full | "полный отчёт" / "full report" | No cap; script auto-splits at 4000 chars. |
Configuration
See reference.md for env-resolution details, report structure, and status semantics.
TELEGRAM_BOT_TOKEN is shared with tg-notify (read from ~/.config/tg-notify/.env). Reports need three additional vars:
| Var | Purpose |
|---|---|
TELEGRAM_NOTIFY_CHAT_ID |
Report destination — the group/supergroup id (e.g. -100…). |
TELEGRAM_NOTIFY_COMPLETION_THREAD |
Forum topic id for completion reports. |
TELEGRAM_NOTIFY_TASK_THREAD |
Forum topic id for task reports. |
Critical: TELEGRAM_CHAT_ID is your private DM — never fall back to it for reports.
Critical: If destination or thread is unset → ask the user, offer to persist in ~/.claude/settings.json env block.
How to invoke
ROOT="${AI_AGENTS_SKILLS_ROOT:-${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-${CURSOR_PLUGIN_ROOT:-}}}}"
TG="$ROOT/skills/tg-notify/tg-notify.sh"
ENV_FILE="${TG_NOTIFY_ENV:-${XDG_CONFIG_HOME:-$HOME/.config}/tg-notify/.env}"
# capture process env FIRST (settings.json wins over .env)
CHAT="${TELEGRAM_NOTIFY_CHAT_ID:-}"
THREAD="${TELEGRAM_NOTIFY_COMPLETION_THREAD:-}" # or TASK_THREAD for task reports
# source creds file for bot token + fallback for any unset NOTIFY vars
[ -f "$ENV_FILE" ] && { set -a; . "$ENV_FILE"; set +a; }
CHAT="${CHAT:-${TELEGRAM_NOTIFY_CHAT_ID:-}}"
THREAD="${THREAD:-${TELEGRAM_NOTIFY_COMPLETION_THREAD:-}}" # or TASK_THREAD
# if CHAT empty → ask the user, don't send to the DM
[ -z "$CHAT" ] && { echo "TELEGRAM_NOTIFY_CHAT_ID unset — ask the user"; exit 1; }
ARGS=(-s ok -p plain -c "$CHAT")
[ -n "$THREAD" ] && ARGS+=(-T "$THREAD")
# concise (default): inline body
"$TG" "${ARGS[@]}" -t "server/repo: краткий заголовок" -m "<body ≤3500 chars>"
# full mode: from file (auto-splits into chunks)
"$TG" "${ARGS[@]}" -t "server/repo: заголовок" -f /tmp/report.txt
For all tg-notify.sh flags (-t/-m/-f/-s/-p/-c/-T/-M/-q), see ../tg-notify/reference.md.
Self-check before sending
- Routing correct? (задача/task → task thread, else completion)
TELEGRAM_NOTIFY_CHAT_ID+ right thread set? If not — ask user.- Title ≤70 chars (
server/repo: outcome)? - Concise:
len(title) + len(body) ≤ 3500? - Commit/PR/paths/ports included where relevant?
- Follow-ups / risks marked ⚠️ at the end?
- Correct
-sflag (ok/warn/fail/info)?