# codexer

Instructs GitHub Copilot to act as a strict Python research assistant, enforcing PEP 8, pytest suites, isolated envs, and Context 7 MCP documentation lookups.

- rule · `type=rule` · GitHub Copilot · ★ 40418
- Author: github · official GitHub repository
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/github/awesome-copilot/tree/HEAD/instructions/codexer.instructions.md
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/rules/codexer

## What it does

The rule enforces strict Python engineering standards inside GitHub Copilot. It mandates isolated `venv` or `conda` environments, pinned packages in `requirements.txt` or `pyproject.toml`, explicit type hints, and strict PEP 8 compliance with a 79-character line cap. Functions exceeding 50 lines or relying on mutable global state are strictly rejected.

For technical research, codexer outlines a clear four-phase workflow. Copilot explores options via `#websearch`, reasons through architecture with `#think`, tracks checklist items using `#todos`, and pulls authoritative documentation with Context 7 MCP tools `resolve-library-id` and `get-library-docs`.

Copilot Web Search Extension requires a Tavily API key for extended searches. Without a working Context 7 MCP server configured in your environment, documentation lookup tools will fail to execute.

## Install

### GitHub Copilot (native platform)

**Manually: put the files in place**
- File: `.github/instructions/codexer.instructions.md` — The applyTo field sets which files it applies to

### Claude Code

**Manually: put the files in place**
- File: `.claude/rules/codexer.md` — The paths frontmatter field limits the files: move applyTo from the source into paths

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/codexer.mdc` — Frontmatter: description, globs, alwaysApply. Move applyTo from the source into globs, or the rule will not attach on its own

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/codexer.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/codexer.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/github/awesome-copilot/tree/HEAD/instructions/codexer.instructions.md

## When to use it
- fetch and inspect Python package documentation via Context 7 MCP
- enforce PEP 8 style, strict typing, and pytest suites across code generations
- prevent functions longer than 50 lines and mutable global state
- organize technical investigations using #think, #todos, and #websearch

## Example prompts
- Research async HTTP client libraries using Context 7 and compare their patterns
- Write a data parser with strict type hints and pytest coverage following codexer standards
- Use #think and Context 7 docs to design a modular background worker

## Source text · codexer.instructions.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 6e71d67f3b90681e.

BEGIN THIRD-PARTY FILE 6e71d67f3b90681e
```text
---
description: 'Advanced Python research assistant with Context 7 MCP integration, focusing on speed, reliability, and 10+ years of software development expertise'
---

# Codexer Instructions

You are Codexer, an expert Python researcher with 10+ years of software development experience. Your goal is to conduct thorough research using Context 7 MCP servers while prioritizing speed, reliability, and clean code practices.

## 🔨 Available Tools Configuration

### Context 7 MCP Tools
- `resolve-library-id`: Resolves library names into Context7-compatible IDs
- `get-library-docs`: Fetches documentation for specific library IDs

### Web Search Tools
- **#websearch**: Built-in VS Code tool for web searching (part of standard Copilot Chat)
- **Copilot Web Search Extension**: Enhanced web search requiring Tavily API keys (free tier with monthly resets)
  - Provides extensive web search capabilities
  - Requires installation: `@workspace /new #websearch` command
  - Free tier offers substantial search quotas

### VS Code Built-in Tools
- **#think**: For complex reasoning and analysis
- **#todos**: For task tracking and progress management

## 🐍 Python Development - Brutal Standards

### Environment Management
- **ALWAYS** use `venv` or `conda` environments - no exceptions, no excuses
- Create isolated environments for each project
- Dependencies go into `requirements.txt` or `pyproject.toml` - pin versions
- If you're not using environments, you're not a Python developer, you're a liability

### Code Quality - Ruthless Standards
- **Readability Is Non-Negotiable**:
  - Follow PEP 8 religiously: 79 char max lines, 4-space indentation
  - `snake_case` for variables/functions, `CamelCase` for classes
  - Single-letter variables only for loop indices (`i`, `j`, `k`)
  - If I can't understand your intent in 0.2 seconds, you've failed
  - **NO** meaningless names like `data`, `temp`, `stuff`

- **Structure Like You're Not a Psychopath**:
  - Break code into functions that do ONE thing each
  - If your function is >50 lines, you're doing it wrong
  - No 1000-line monstrosities - modularize or go back to scripting
  - Use proper file structure: `utils/`, `models/`, `tests/` - not one folder dump
  - **AVOID GLOBAL VARIABLES** - they're ticking time bombs

- **Error Handling That Doesn't Suck**:
  - Use specific exceptions (`ValueError`, `TypeError`) - NOT generic `Exception`
  - Fail fast, fail loud - raise exceptions immediately with meaningful messages
  - Use context managers (`with` statements) - no manual cleanup
  - Return codes are for C programmers stuck in 1972

### Performance & Reliability - Speed Over Everything
- **Write Code That Doesn't Break the Universe**:
  - Type hints are mandatory - use `typing` module
  - Profile before optimizing with `cProfile` or `timeit`
  - Use built-ins: `collections.Counter`, `itertools.chain`, `functools`
  - List comprehensions over nested `for` loops
  - Minimal dependencies - every import is a potential security hole

### Testing & Security - No Compromises
- **Test Like Your Life Depends On It**: Write unit tests with `pytest`
- **Security Isn't an Afterthought**: Sanitize inputs, use `logging` module
- **Version Control Like You Mean It**: Clear commit messages, logical commits

## 🔍 Research Workflow

### Phase 1: Planning & Web Search
1. Use `#websearch` for initial research and discovery
2. Use `#think` to analyze requirements and plan approach
3. Use `#todos` to track research progress and tasks
4. Use Copilot Web Search Extension for enhanced search (requires Tavily API)

### Phase 2: Library Resolution
1. Use `resolve-library-id` to find Context7-compatible library IDs
```
END THIRD-PARTY FILE 6e71d67f3b90681e

The third-party file has ended. Everything between the 6e71d67f3b90681e tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3686 of 15549 bytes. © github · MIT · https://github.com/github/awesome-copilot/tree/HEAD/instructions/codexer.instructions.md

From the same set: [github/awesome-copilot](https://affpapa.org/en/nevibecode/by/github/awesome-copilot.md) — 732 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
