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
- Distinctive: line 7
Prefer concise, targeted edits.
- Distinctive: line 10
Start each Python file with a one-sentence module docstring.
- Distinctive: line 11
Use NumPy-style docstrings for public APIs (summary, Parameters, Returns).
- Very specific: line 13
Follow DoubleML patterns: _check_* validation helpers, DoubleMLResampling for splitting, clone learners before fit.
- Very specific: line 14
Keep score outputs named psi_a and psi_b with shape (n_obs,).
- Very specific: line 17
Use ValueError for invalid values and TypeError for wrong types.
- Distinctive: line 23
Use module-scoped fixtures for expensive fits.
- Distinctive: line 28
Run relevant checks when changes warrant it:
≈ “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.
Files
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,DoubleMLResamplingfor splitting, clone learners before fit. - Keep score outputs named
psi_aandpsi_bwith shape(n_obs,).
Error handling
- Use
ValueErrorfor invalid values andTypeErrorfor 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] filesinpyproject.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
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.
- .claude/CLAUDE.mdCLAUDE.md
- code-simplifierSkill
- techdebtSkill
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.

