agentleFS
Akash-nath29Akash-nath29/Coderrr/.github/copilot-instructions.md

Coderrr

Copilot instructions72 starsChanged 3 months agoMITView on GitHub

Coderrr v2 is a single Python CLI (pip install coderrr). There is no Node frontend and no hosted backend; the CLI talks to LLM providers directly over HTTP. mcp/ has no SDK dependency — the JSON-RPC client, both transports, and OAuth 2.1 are written over httpx, for the same reason the provider adapters are. 1. Write tools do not exist in Planning mode. agent/modes.py maps each mode to a set of tool classes; ToolRegistry.exposed() filters on it. The model is…

  • Installs packages

We split this copilot-instructions.md into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Everything a tool touches comes from ToolContext: No globals — that is what makes the surface testable with a temp dir and a fake console.

    line 68
  2. Very specific:

    All four gates are blocking in CI.

    line 94

≈ “Common” is an estimate: at least 1 in 5 of the 3,669 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

Coderrr — AI agent instructions

Coderrr v2 is a single Python CLI (pip install coderrr). There is no Node frontend and no hosted backend; the CLI talks to LLM providers directly over HTTP.

Architecture

src/coderrr/
├── cli.py          typer entry point
├── agent/          loop.py (the runtime), session.py (two-phase flow), modes.py
├── llm/            normalized types + 3 HTTP adapters, schema.py ($ref flattening)
├── tools/          read/ · write/ · system/
├── spec/           spec artifact store, models, markdown parser
├── sandbox/        scratch (default) and docker tiers
├── skills/         registry client, ephemeral loader
├── mcp/            custom MCP servers: client (wire) · oauth · credentials ·
│                   bridge · manager · naming · setup · types
├── policy/         paths.py (containment), gate.py (approval)
├── prompts/        system prompt assembly
└── verify.py       LLM write verification

mcp/ has no SDK dependency — the JSON-RPC client, both transports, and OAuth 2.1 are written over httpx, for the same reason the provider adapters are.

The invariants — do not weaken these

1. Write tools do not exist in Planning mode. agent/modes.py maps each mode to a set of tool classes; ToolRegistry.exposed() filters on it. The model is never told to avoid editing — it has no tool that edits. session.py::execute is the only place mode flips to EXECUTION, and only after user approval.

2. Path containment is deterministic code, never a model judgement. policy/paths.py resolves symlinks before testing containment. The LLM verifier in verify.py judges content; it is not the security boundary and must never become one.

3. No tool runs commands against the user's working tree. run_in_sandbox is the only execution path. v1's run_command was removed deliberately.

4. Tool errors are returned, never raised. ToolRegistry.execute catches everything and returns ToolResult.error(...) so the model can recover. A tool crash must not kill the loop.

5. An MCP server's claims about itself decide nothing. Annotations like readOnlyHint may shape the wording of a prompt; policy/gate.py reads the user's stored answer in allowed_tools/denied_tools and nothing else. MCP tools are class EXTERNAL, exposed in both modes, and approved per tool.

6. No browser opens during a run. OAuth's interactive leg belongs to mcp add/mcp login. Silent refresh anywhere is fine; a task blocking on a browser is not.

7. Only mcp/client.py speaks the wire format. Everything above it uses mcp/types.py. That boundary is why the official SDK could be dropped by rewriting one file with no test changes.

Conventions

  • Read/write tools document themselves through pydantic field descriptions — those schemas are what the model sees. Only SYSTEM tools are described in prompts/system.py. Keep the system prompt from growing with the project.
  • Adapters translate outward from the internal block model (llm/types.py), which follows Anthropic's shape. OpenAI's flat tool_calls maps into blocks; the reverse loses information.
  • Everything a tool touches comes from ToolContext. No globals — that is what makes the surface testable with a temp dir and a fake console.
  • Async throughout. httpx only; no provider SDKs.

Testing

tests/fakes.py::FakeProvider replays scripted turns, so the agent loop is tested deterministically with no network and no API key. Provider adapters are tested against recorded SSE fixtures via respx.

MCP uses tests/test_mcp.py::FakeConnection rather than a live server. The OAuth flow does run for real against a loopback socket with an injected open_url — if you touch it, add respx.mock.route(host="127.0.0.1").pass_through() or the redirect is intercepted and the login hangs, and pass a short timeout= because the production default is 300 seconds.

Tests must never touch the real ~/.coderrr. Everything roots in tmp_path, and CredentialStore must be constructed with use_keyring=False.

uv sync --all-extras --dev
uv run pytest -q
uv run ruff check src tests && uv run ruff format --check src tests
uv run mypy            # strict

All four gates are blocking in CI. Do not add continue-on-error to them.

History

v1 was a Node CLI plus a hosted FastAPI backend. It is preserved on the v1-legacy branch and is not maintained. See docs/V2-MIGRATION.md for the mapping and docs/V2-IMPLEMENTATION-PLAN.md for the decisions behind v2.

Download now (ZIP)

  • Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.

    Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.