agentleFS
DoubleMLDoubleML/doubleml-for-py/.github/copilot-instructions.md

doubleml-for-py

Copilot instructions795 starsChanged 4 months agoBSD-3-ClauseView on GitHub

These instructions guide code and test authoring. Keep changes aligned with the detailed rules in .claude to avoid drift.

We split this copilot-instructions.md into the rules it gives an agent

8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer concise, targeted edits.

    line 7
  2. Distinctive:

    Start each Python file with a one-sentence module docstring.

    line 10
  3. Distinctive:

    Use NumPy-style docstrings for public APIs (summary, Parameters, Returns).

    line 11
  4. Very specific:

    Follow DoubleML patterns: _check_* validation helpers, DoubleMLResampling for splitting, clone learners before fit.

    line 13
  5. Very specific:

    Keep score outputs named psi_a and psi_b with shape (n_obs,).

    line 14
  6. Very specific:

    Use ValueError for invalid values and TypeError for wrong types.

    line 17
  7. Distinctive:

    Use module-scoped fixtures for expensive fits.

    line 23
  8. Distinctive:

    Run relevant checks when changes warrant it:

    line 28

≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions 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
copilot-instructions.md

Copilot instructions for DoubleML (Python)

These instructions guide code and test authoring. Keep changes aligned with the detailed rules in .claude to avoid drift.

Scope

  • Authoring guidance only (not reviewer-only rules).
  • Prefer concise, targeted edits; avoid unrelated refactors.

Code style and design

  • Start each Python file with a one-sentence module docstring.
  • Use NumPy-style docstrings for public APIs (summary, Parameters, Returns).
  • Require full type hints, including return types.
  • Follow DoubleML patterns: _check_* validation helpers, DoubleMLResampling for splitting, clone learners before fit.
  • Keep score outputs named psi_a and psi_b with shape (n_obs,).

Error handling

  • Use ValueError for invalid values and TypeError for wrong types.
  • Validate early (constructors and setters) with clear expected/actual messages.
  • In tests, always use pytest.raises(..., match=...).

Testing

  • Mark all tests with @pytest.mark.ci.
  • Use module-scoped fixtures for expensive fits.
  • Seed random generators for reproducibility.
  • For new scalar models, follow the required 5-file test structure.

Verification (lightweight)

Run relevant checks when changes warrant it:

  • black .
  • ruff check --fix .
  • mypy (checks the allowlist in [tool.mypy] files in pyproject.toml)
  • pytest -m ci

References (canonical rules)

  • Code style: .claude/rules/py-code-conventions.md
  • Error handling: .claude/rules/error-handling.md
  • Performance: .claude/rules/performance-guidelines.md
  • Testing: .claude/rules/testing-conventions.md
  • Scalar test structure: .claude/rules/dml-scalar-test-structure.md

Optional reference docs

  • .github/copilot/code-style.md
  • .github/copilot/error-handling.md
  • .github/copilot/performance.md
  • .github/copilot/testing.md
  • .github/copilot/scalar-tests.md

Download now (ZIP)

  • Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.

    Of the Copilot instructions files we read, the 2,297 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 repository3 other files it gives its agents.

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.