Drop-in rules for coding agents working on a 42 curriculum Python project. Nothing in the public rule catalogs matches this subject: those templates use Ruff and omit the Makefile wording, the mypy flag set, and the README first line.
| File | Who reads it |
|---|---|
AGENTS.md |
Codex, Cursor, Copilot coding agent, Windsurf, Zed, Aider, and other AGENTS.md clients. Source of truth. |
CLAUDE.md |
Claude Code. Imports AGENTS.md so Claude does not ignore it. |
GEMINI.md |
Gemini CLI. |
.github/copilot-instructions.md |
GitHub Copilot IDE. |
.cursor/rules/42-python.mdc |
Cursor, every Python edit. |
.cursor/rules/42-readme.mdc |
Cursor, when README.md is in context. |
Makefile |
Humans and the evaluation. Targets required by the subject. |
.flake8, mypy.ini |
Same gates as make lint, so a bare mypy . is not weaker by accident. |
.gitignore, requirements.txt |
Hygiene the subject asks for. |
README.md |
Starter that already satisfies the section contract. Replace the prose. |
main.py, tests/test_main.py |
Compilable skeleton so make lint and make test have something to check. Replace them. |
From the root of the student repository:
cp -R AGENTS.md CLAUDE.md GEMINI.md Makefile .flake8 mypy.ini .gitignore requirements.txt README.md main.py .github .cursor tests .Then fill in "Project constraints" inside AGENTS.md with the subject-specific
block, and replace the Description, Algorithm, and AI usage sections.
make install
. .venv/bin/activate
make lint
make test
make runmake run and make debug use python3 on PATH (the evaluator's interpreter).
make lint prefers .venv/bin so flake8 and mypy resolve after make install
even when the shell has not activated the venv.
- flake8, not Ruff. The graded command is
flake8 .. - mypy flags are the ones written in the subject, not
--strictalone.lint-strictis optional and still present. - Line length stays 79. Black-style 88 would fail a default flake8 run.
- README line 1 is fixed text and must stay italicized.
- Tests exist and are declared non-graded so an agent does not delete the program in favor of a test suite, or skip tests entirely.