agentleFS
Tomas542Tomas542/lightning_hydra_template/.agents/AGENTS.md

lightning_hydra_template

AGENTS.md2 starsChanged 3 days agoMITView on GitHub

Expert in ML experiments and reproducibility

  • Reads credentials

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
  1. Distinctive:

    Write Python code for ML experiments.

    line 9
  2. Distinctive:

    Document code with type hints, docstrings, and comments.

    line 10
  3. Distinctive:

    Use Python 3.12 type annotations for all function arguments and return types.

    line 22
  4. Distinctive:

    Use double quotes (") for strings and single quote (') for keys.

    line 23
  5. Very specific:

    Add Google-style docstrings (description, Args with types, Returns, and optional Raises) to all classes, non init methods and functions.

    line 24
  6. Distinctive:

    Follow existing code patterns and formatting in the repository.

    line 26
  7. Very specific:

    Run Python file: pixi run python /path/to/file

    line 32
  8. Very specific:

    Test coverage repot: pixi run -e test cov

    line 36
  9. Distinctive:

    Always check batch size and scheduler steps.

    line 43
  10. Distinctive:

    After substantial changes (like new loss function) run small smoke test on a small amount of data to check fitting.

    line 44
  11. Distinctive:

    Use terminal multiplexer (screen/tmux) for long training or evaluationi runs.

    line 45
  12. Very specific:

    Write unit tests in tests/ directory for core functionality added to src/ and verify they pass.

    line 46
  13. Distinctive:

    Run tests only for modified or affected files.

    line 47
  14. Very specific:

    Run pixi run -e dev format on modified Python files before finalizing a task.

    line 48
  15. Very specific:

    Run pixi run -e safe scan_envs after adding or updating dependencies.

    line 49
  16. Very specific:

    Run pixi run -e safe scan_model whenever new model weights are downloaded locally.

    line 50
  17. Distinctive:

    Ask for user confirmation before:

    line 52
  18. Very specific:

    Never modify pyproject.toml, .pixi/, or tool configurations directly without approval.

    line 55
  19. Very specific:

    Never write down CUDA_VISIBLE_DEVICES, HTTP_PROXY or HTTPS_PROXY, --as-is and GPU restrictions to README.md - this is a development …

    line 56
  20. Distinctive:

    Do not modify metric evaluation functions or core test suites without explicit instructions.

    line 57
  21. Distinctive:

    Never report a timed-out, interrupted, or incomplete test run as passed.

    line 58
  22. Very specific:

    Never commit secrets, API keys, credentials, or .env files.

    line 59
  23. Very specific:

    Do not download any package with npm - you are working with Python ecosystem only with pixi.

    line 60
  24. Very specific:

    Avoid from __future__ import annotations as antipattern.

    line 61

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 Hydra
    • tests/ – 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.yaml for 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 to src/ and verify they pass.
  • Run tests only for modified or affected files.
  • Run pixi run -e dev format on modified Python files before finalizing a task.
  • Run pixi run -e safe scan_envs after adding or updating dependencies.
  • Run pixi run -e safe scan_model whenever new model weights are downloaded locally.
  • For common runs add --as-is argument 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-is and 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 .env files.
  • Do not download any package with npm - you are working with Python ecosystem only with pixi.
  • Avoid from __future__ import annotations as antipattern.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.