Guidance for AI coding agents (Claude Code, Copilot, Cursor, etc.) working in this repository. Human contributors may find it useful too, but the primary audience is an agent preparing a pull request.
Open an issue and discuss the change before writing a PR — see "Contribute" in
README.md. This avoids agents (and their operators) spending effort on a PR that
gets rejected for being out of scope.
This project uses uv to manage the virtualenv and
dependencies. Don't pip install into a venv by hand and don't hand-edit
uv.lock.
uv syncRun these before proposing a change as done — they are what CI
(.github/workflows/ci.yml) runs.
uv run pytest # unit tests
uv run pylint irc2phpbb # lint production code
uv run pylint tests # lint testsCoverage (optional, not enforced by CI):
uv run pytest --cov=irc2phpbbDo not commit generated coverage reports (htmlcov/, .coverage).
irc2phpbb/— the package.bot.py/irc_bot.py/discord_bot.pywire up the bot;marvin_actions.pyandmarvin_general_actions.pyhold the individual chat actions (one function per command/response);data/marvin_strings.jsonholds the response text those actions pick from;config/holds default JSON config.tests/— onetest_<action>.pyper action module, named after the action it covers (e.g.marvinSayHi→tests/test_hello.py).test_action.pyprovides the sharedActionTestbase class (assertActionOutput,assertActionSilent) — use it instead of re-implementing action-invocation boilerplate.
- New chat actions: add the function to
marvin_actions.py(ormarvin_general_actions.py), register it ingetAllActions(), add response strings todata/marvin_strings.jsonrather than hardcoding them, and add a matchingtests/test_<name>.pyusing theActionTestbase class. - Max line length is 100 (
.pylintrc); keepuv run pylintclean rather than suppressing new warnings. - Don't add new runtime dependencies without discussing in the issue first — Marvin is meant to stay light enough to run in the provided Docker image.
Public API docs are generated with pdoc and published from master; don't hand-
edit anything under docs/pdoc.
uv run pdoc --output-dir=docs/pdoc irc2phpbb