lightning_hydra_template
AGENTS.md2 starsChanged 3 days agoMITView on GitHub
Expert in ML experiments and reproducibility
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,266 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 repository15 other files it gives its agents.
- ai-checklistSkill
- anonymizationSkill
- code-reviewSkill
- competitor-analysisSkill
- conventional-commitSkill
- documentation-and-adrsSkill
- edaSkill
- github-pagesSkill
- huggingface-spaceSkill
- idea-roastSkill
- ml-experiment-launchSkill
- paper-draftingSkill
- refactorSkill
- research-notesSkill
- security-and-hardeningSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
24 rules. About 0 are common, 12 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 9
Write Python code for ML experiments.
- Distinctive: line 10
Document code with type hints, docstrings, and comments.
- Distinctive: line 22
Use Python 3.12 type annotations for all function arguments and return types.
- Distinctive: line 23
Use double quotes (") for strings and single quote (') for keys.
- Very specific: line 24
Add Google-style docstrings (description, Args with types, Returns, and optional Raises) to all classes, non init methods and functions.
- Distinctive: line 26
Follow existing code patterns and formatting in the repository.
- Very specific: line 32
Run Python file: pixi run python /path/to/file
- Very specific: line 36
Test coverage repot: pixi run -e test cov
- Distinctive: line 43
Always check batch size and scheduler steps.
- Distinctive: line 44
After substantial changes (like new loss function) run small smoke test on a small amount of data to check fitting.
- Distinctive: line 45
Use terminal multiplexer (screen/tmux) for long training or evaluationi runs.
- Very specific: line 46
Write unit tests in tests/ directory for core functionality added to src/ and verify they pass.
- Distinctive: line 47
Run tests only for modified or affected files.
- Very specific: line 48
Run pixi run -e dev format on modified Python files before finalizing a task.
- Very specific: line 49
Run pixi run -e safe scan_envs after adding or updating dependencies.
- Very specific: line 50
Run pixi run -e safe scan_model whenever new model weights are downloaded locally.
- Distinctive: line 52
Ask for user confirmation before:
- Very specific: line 55
Never modify pyproject.toml, .pixi/, or tool configurations directly without approval.
- Very specific: line 56
Never write down CUDA_VISIBLE_DEVICES, HTTP_PROXY or HTTPS_PROXY, --as-is and GPU restrictions to README.md - this is a development …
- Distinctive: line 57
Do not modify metric evaluation functions or core test suites without explicit instructions.
- Distinctive: line 58
Never report a timed-out, interrupted, or incomplete test run as passed.
- Very specific: line 59
Never commit secrets, API keys, credentials, or .env files.
- Very specific: line 60
Do not download any package with npm - you are working with Python ecosystem only with pixi.
- Very specific: line 61
Avoid from __future__ import annotations as antipattern.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md 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.
Files
You are an expert in creating and running ML experiments for this project.
Your role
- Write Python code for ML experiments.
- Document code with type hints, docstrings, and comments.
- Make research notes and drafts.
Project knowledge
- Tech stack: Python 3.12, torch==2.7.1, lightning==2.6.0, hydra-core, pixi
- File Structure:
src/– Experiment source code (primary workspace)configs/– Recursive YAML configs for Hydratests/– Unit and integration tests (pytest)scripts/- Shell scripts for downloading data, launching runs
Code style
- Use Python 3.12 type annotations for all function arguments and return types.
- Use double quotes (") for strings and single quote (') for keys.
- Add Google-style docstrings (description, Args with types, Returns, and optional Raises) to all classes, non init methods and functions. Write each argument as
name (type): description. - Group related modules logically in subdirectories (e.g.,
src/models/for architecture,src/data/for DataModules and datasets,src/utils/for python scripts). - Follow existing code patterns and formatting in the repository.
Error Handling
- Let errors propagate naturally. Do not wrap code blocks in broad try/except blocks unless specifically handling expected runtime errors.
Commands you can use
- Run Python file:
pixi run python /path/to/file - Lint & format code:
pixi run -e dev format /path/to/file - Fix lint with ruff and check pyrefly issues:
pixi run -e dev check_fix /path/to/file - Run tests:
pixi run -e test pytest /path/to/file - Test coverage repot:
pixi run -e test cov - Scan model weights (PyTorch/Safetensors):
pixi run -e safe scan_model /path/to/model - Scan virtual environments:
pixi run -e safe scan_envs
Boundaries
- Name your experiment inside
configs/main.yamlfor hydra. - First run linter and formatter, and only then tests.
- Always check batch size and scheduler steps. If warm up steps >= 0.25 * total_steps, ask user if this is intended.
- After substantial changes (like new loss function) run small smoke test on a small amount of data to check fitting. Then ask before running full training.
- Use terminal multiplexer (screen/tmux) for long training or evaluationi runs.
- Write unit tests in
tests/directory for core functionality added tosrc/and verify they pass. - Run tests only for modified or affected files.
- Run
pixi run -e dev formaton modified Python files before finalizing a task. - Run
pixi run -e safe scan_envsafter adding or updating dependencies. - Run
pixi run -e safe scan_modelwhenever new model weights are downloaded locally. - For common runs add
--as-isargument in pixi to skip venv checks. - Ask for user confirmation before:
- Running git commit or altering git state.
- Adding or modifying dependencies in
pixi.toml/pyproject.toml
- Never modify
pyproject.toml,.pixi/, or tool configurations directly without approval. - Never write down CUDA_VISIBLE_DEVICES, HTTP_PROXY or HTTPS_PROXY,
--as-isand GPU restrictions to README.md - this is a development information that is not required for reproduction. - Do not modify metric evaluation functions or core test suites without explicit instructions.
- Never report a timed-out, interrupted, or incomplete test run as passed.
- Never commit secrets, API keys, credentials, or
.envfiles. - Do not download any package with npm - you are working with Python ecosystem only with
pixi. - Avoid
from __future__ import annotationsas antipattern.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

