This document harmonizes Makefile-derived developer conventions with augmentative best-practices inspired by Pragmatic AI Labs and the fast.ai developer style guide. It is written to be non-breaking and augmentive: preserve existing Makefile behavior while recommending optional improvements for reproducibility, discoverability, CI parity, and notebook hygiene.
Provide a concise, actionable reference for:
- How agents (developers, automation) should run tasks via Makefile.
- How to keep local development and CI behavior consistent.
- Notebook and coding style guidance informed by Pragmatic AI Labs on YT and fast.ai.
- Virtual env:
.venv, activate script at.venv/bin/activate - Key variables:
PYTHON=.venv/bin/python3,PIP=.venv/bin/pip3,DOCKER_IMAGE_NAME,DOCKER_IMAGE_VERSION,DOCKER_IMAGE_TAG - Standard targets present:
venv/bin/activate,activate,install,docstring,format,clean,lint,test .ONESHELL:and.DEFAULT_GOAL := allare used.
- Use venv binaries directly inside Make targets and CI:
- Prefer
.venv/bin/pythonand.venv/bin/pipin recipes to avoid relying on shell activation persistence.
- Prefer
- Keep targets idempotent and declarative:
- Make sure
install,format,lint, andtestcan be re-run safely.
- Make sure
- Add discoverability and CI-parity targets (suggested, optional):
.PHONY: help ci install-devand ahelptarget that lists commands.citarget runs same steps as CI (e.g.,install-dev format lint test).
- Separate runtime and dev dependencies:
- Introduce
requirements-dev.txtandinstall-devtarget to install linting/test tools.
- Introduce
- Makefile UX improvements inspired by Pragmatic AI Labs:
- Add helpful echo messages, fail-fast settings (e.g.,
set -euo pipefailin multi-line recipes), and explicit.PHONY.
- Add helpful echo messages, fail-fast settings (e.g.,
- Docker ergonomics:
- Use
DOCKER_IMAGE_TAGfor build/push targets and consider deriving version from git tags in CI.
- Use
- Notebook and experiment hygiene (fast.ai-aligned):
- Keep notebooks runnable top-to-bottom; move production logic into
.pymodules. - Strip outputs before commit (use
nbstripout,jupytext, or pre-commit hooks). - Store experiment artifacts under
runs/orartifacts/.
- Keep notebooks runnable top-to-bottom; move production logic into
- help, venv, install-dev, ci, docker-build examples using
.venv/bin/*binaries and.PHONYlist (see repository README or conventions for full snippet).
- Format: keep
black *.py utils/*.py tests/*.pybut run via.venv/bin/blackin CI orinstall-dev. - Docstrings:
pyment -w -o numpydoc *.pyremains valid—document usage in CONTRIBUTING. - Lint: keep
pylint --disable=R,C --errors-only *.pyfor errors-only mode; considerlint-fullfor stricter checks. - Test: use
pytestinvocation from Makefile but ensure small, deterministic tests for CI.
- Consider
pip-compile/lockfiles or poetry for reproducible builds when releasing. - Add
bump-versionor derive Docker tag from git in CI for consistent releases.
- Prefer short, testable functions; avoid heavy computations committed to notebooks.
- Convert critical notebook logic to modules and add unit tests.
- Use
pre-commitwith nbstripout/jupytext and black/isort to keep diffs clean.
- Keep this file updated when adding Makefile targets or changing developer workflow.
- Add
CONTRIBUTING.mdpointing tomake help,make ci, and notebook guidelines.
- fast.ai developer style guide: https://docs.fast.ai/dev/style.html
- Pragmatic AI Labs / Noah Gift: https://paiml.com/ and https://noahgift.com/
- agents.md convention: https://github.com/agentsmd/agents.md