agentleFS
ebibibiebibibi/ebi-agent-chat-relay/.github/copilot-instructions.md

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.

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
  1. Distinctive:

    Validate all user input: before passing to CLI (regex for session IDs, skill names)

    line 12
  2. Very specific:

    -- separator: before user prompts in CLI args to prevent flag injection

    line 13
  3. Distinctive:

    Write tests FIRST, then implement: Follow RED → GREEN → REFACTOR for all new features and bug fixes.

    line 27
  4. Very specific:

    Never interpolate user input into shell commands.

    line 38
  5. Very specific:

    Run security audit before committing changes to runner.py, _run_helper.py, or any Cog.

    line 39

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

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 annotations in every Python file
  • ruff for linting and formatting (line-length: 100)
  • pytest with pytest-asyncio (auto mode) for testing
  • Never use shell=True in subprocess calls — always create_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 injection
  • contextlib.suppress for non-critical Discord API failures
  • Logging via logging.getLogger(__name__), never print()

Architecture

  • claude_discord/claude/ — CLI subprocess runner and stream-json parser
  • claude_discord/cogs/ — Discord.py Cogs. Use _run_helper.run_claude_in_thread() for CLI execution
  • claude_discord/database/ — SQLite session persistence (aiosqlite)
  • claude_discord/discord_ui/ — Status reactions, message chunking, embeds
  • tests/ — 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.