ebi-agent-chat-relay
Copilot instructions59 starsChanged 9 months agoMITView on GitHub
Discord frontend for Claude Code CLI. Python 3.12+ with discord.py v2. Write tests FIRST, then implement. Follow RED → GREEN → REFACTOR for all new features and bug fixes. This project spawns Claude Code CLI as a subprocess. All user input flows through to CLI args. Never interpolate user input into shell commands. Strip secrets from subprocess env. Run security audit before committing changes to runner.py, _run_helper.py, or any Cog.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- add-cogSkill
- python-qualitySkill
- releaseSkill
- security-auditSkill
- tddSkill
- test-guideSkill
- verifySkill
- relay-thread-managerSkill
The file
We split this copilot-instructions.md into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Validate all user input: before passing to CLI (regex for session IDs, skill names)
- Very specific: line 13
--separator: before user prompts in CLI args to prevent flag injection - Distinctive: line 27
Write tests FIRST, then implement: Follow RED → GREEN → REFACTOR for all new features and bug fixes.
- Very specific: line 38
Never interpolate user input into shell commands.
- Very specific: line 39
Run security audit before committing changes to runner.py, _run_helper.py, or any Cog.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
claude-code-discord-bridge — Copilot Instructions
Discord frontend for Claude Code CLI. Python 3.12+ with discord.py v2.
Key Rules
- Type hints required on all function signatures
from __future__ import annotationsin every Python file- ruff for linting and formatting (line-length: 100)
- pytest with pytest-asyncio (auto mode) for testing
- Never use
shell=Truein subprocess calls — alwayscreate_subprocess_exec - Validate all user input before passing to CLI (regex for session IDs, skill names)
--separator before user prompts in CLI args to prevent flag injectioncontextlib.suppressfor non-critical Discord API failures- Logging via
logging.getLogger(__name__), neverprint()
Architecture
claude_discord/claude/— CLI subprocess runner and stream-json parserclaude_discord/cogs/— Discord.py Cogs. Use_run_helper.run_claude_in_thread()for CLI executionclaude_discord/database/— SQLite session persistence (aiosqlite)claude_discord/discord_ui/— Status reactions, message chunking, embedstests/— pytest suite
Testing (TDD Enforced)
Write tests FIRST, then implement. Follow RED → GREEN → REFACTOR for all new features and bug fixes.
uv run pytest tests/ -v --cov=claude_discord
uv run ruff check claude_discord/
uv run ruff format --check claude_discord/Security (Mandatory Pre-Commit)
This project spawns Claude Code CLI as a subprocess. All user input flows through to CLI args. Never interpolate user input into shell commands. Strip secrets from subprocess env. Run security audit before committing changes to runner.py, _run_helper.py, or any Cog.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

