telegram-copilot-bridge: Instructions file for GitHub Copilot

.github/copilot-instructions.md

telegram-copilot-bridge copilot-instructions.md is an instructions file for GitHub Copilot from NobufumiMurata/telegram-copilot-bridge. It costs 1,413 tokens per session, scanned A, original, MIT.

A project guide for a Python bridge that lets people control GitHub Copilot CLI, a command-line coding assistant, from a Telegram bot. It covers the project structure, configuration, sessions, and security rules.

In plain words
What is it for?
Use it when changing the Telegram bot, Copilot CLI connection, configuration loading, session management, command routing, or the related tests.
Why use it?
It tells Copilot how the bridge is organized and how to handle users, credentials, permissions, updates, and multiple sessions safely.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot instructions file.

This is NobufumiMurata/telegram-copilot-bridge's own configuration. It tells GitHub Copilot how to work on telegram-copilot-bridge itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything telegram-copilot-bridge configures →

Reuse

Borrowing it

Nothing to install: this file belongs to NobufumiMurata/telegram-copilot-bridge. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/NobufumiMurata/telegram-copilot-bridge/main/.github/copilot-instructions.md
Clone the repo
git clone --depth 1 https://github.com/NobufumiMurata/telegram-copilot-bridge

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for telegram-copilot-bridge copilot-instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nobufumimurata/telegram-copilot-bridge/copilot-instructions.svg)](https://agentmods.dev/instructions/nobufumimurata/telegram-copilot-bridge/copilot-instructions)
Your own site
<a href="https://agentmods.dev/instructions/nobufumimurata/telegram-copilot-bridge/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/nobufumimurata/telegram-copilot-bridge/copilot-instructions.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,413 This file is loaded in full into every session.
When invoked 1,413 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01413 $0.01413
Opus 5 $0.00707 $0.00707
Sonnet 5 $0.00283 $0.00283
Haiku 4.5 $0.00141 $0.00141

Measured 7d ago against content hash 2b5aa128d60b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

telegram-copilot-bridge copilot-instructions.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- Copilot CLI ACP: `copilot --acp --stdio` を subprocess.Popen で起動、NDJSON (1行1JSON) で通信
.github/copilot-instructions.md · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.

telegram-copilot-bridge

Telegram Bot API を使って Copilot CLI をリモート制御するブリッジ。 Telegram からプロンプト送信、セッション管理、ツール承認を行う。 公開リポジトリ — 機密情報は一切含まない。

プロジェクト構造

  • Python 3.12+, src layout
  • Telegram → Copilot CLI (ACP) ブリッジとして動作
  • Telegram Bot API は requests で直接呼び出し (追加ライブラリ不要)
  • 認証情報は .env ファイル優先、フォールバックで環境変数・JSON 設定ファイル

ファイル構成

src/telegram_copilot_bridge/
  __init__.py
  __main__.py          ← エントリポイント (argparse → hub.run_hub())
  hub.py               ← Hub メインロジック (Telegram polling → Copilot CLI)
  telegram.py          ← Telegram Bot API クライアント (バックグラウンドリスナー付き)
  config.py            ← 設定管理 (.env / 環境変数 / JSON)
  copilot_bridge.py    ← Copilot CLI ACP クライアント (NDJSON over stdio)
  session_manager.py   ← マルチセッション管理
  bot_commander.py     ← Telegram コマンドルーター
tests/
  test_config.py
  test_telegram.py
  test_copilot_bridge.py
  test_session_manager.py
  test_bot_commander.py

セキュリティ要件

  • allowed_users リストで送信元ユーザー ID を検証 (全受信メッセージ)
  • タイムアウト設定で自動シャットダウン (デフォルト: タイムアウトなし)
  • 権限リクエストは 2 分でタイムアウト
  • long-polling のオフセット管理 (古い更新の無視、_drain_updates で待機前にクリア)
  • シングルトンロック: TCP ポートバインドで多重起動を防止

設定

.env ファイルから自動読み込み。環境変数が優先。

環境変数 説明 必須
TELEGRAM_BOT_TOKEN Bot API トークン
TELEGRAM_CHAT_ID 通知先チャット ID
TELEGRAM_ALLOWED_USERS カンマ区切りの許可ユーザー ID 推奨
TELEGRAM_ENV_FILE .env ファイルパス (デフォルト: CWD の .env)
TELEGRAM_CONFIG_PATH JSON 設定ファイルパス (フォールバック)
COPILOT_MODEL デフォルト AI モデル
COPILOT_AUTOPILOT true で自動承認モード
COPILOT_DIRS_ROOT /dirs/new のルートフォルダ
COPILOT_ALLOWED_DIRS カンマ区切りの許可ディレクトリ
COPILOT_ALLOWED_TOOLS カンマ区切りの許可ツール

起動方法

# .env ファイルを作成
cp .env.example .env

# 起動 (--hub フラグ不要、デフォルトで Hub モード)
python -m telegram_copilot_bridge

# オプション指定
python -m telegram_copilot_bridge --model claude-opus-4.6 --autopilot -v

Telegram コマンド

コマンド 動作
/new [dir] 新しい Copilot セッション (COPILOT_DIRS_ROOT 設定時はフォルダ選択ボタン表示)
/history [n] 過去のセッション一覧 (デフォルト: 3件)
/resume <id> 過去のセッションを再開
/dirs [dir] ディレクトリ閲覧
/model [name] AI モデルの表示/変更
/mode autopilot/manual 切替
/list アクティブセッション一覧
/switch <id> セッション切替
/status セッション状態
/stop [id] セッション停止
/done 全停止・終了
/help ヘルプ表示
(テキスト) アクティブセッションにプロンプト送信

Read the full file on GitHub · 102 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 102 lines · 1,413 tokens per session scan A 2b5aa128d60b

Subscribe to this mod's changes

telegram-copilot-bridge copilot-instructions.md is an instructions file published in the GitHub repository NobufumiMurata/telegram-copilot-bridge (0 stars, last pushed 4mo ago), licensed MIT. It adds 1,413 tokens to every session, about $0.0071 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens