1---2name: python3description: Write clean, readable Pythonic code. Use this skill any time you write or change a Python file.4---56# General guidelines78# Coding Style910- Always write clean, readable, well separated, well organized, Pythonic code.11- Don't run linters or formatters, they will run automatically after every edit by the harness.12- When using `datetime`, import it like this: `import datetime as dt`13- CRITICAL: ALWAYS put ALL imports at the top of the file, NEVER inside14 functions, methods, or any other block. No exceptions. Use `TYPE_CHECKING` guard15 for type-only imports to avoid circular dependencies.1617# Type hints1819- ALWAYS type hint every function and method signature precisely even in tests.20- NEVER write "-> None" type hint for return values, they are not necessary.21- No need to type hint variables from functions call return values inside function bodies, they are inferred from the method return type,22 except extreme cases when the type is a huge help or a generic and it's concrete type cannot be determined.23- Only use APIs, class names, variables or objects which you already read or know exist for sure.24- Use the new pipe operator for `Optional` variables like this: `value | None`25- Use `Any` for "all types" instead of `object`.2627# Testing2829- ALWAYS use `pytest` for all tests30- ALWAYS assert on whole ouptut or full results in tests, not just tiny parts31- For mocking, use pytest `monkeypatch` fixture, NEVER `unittest.mock` and NEVER32 any of the `Mock` classes or `patch` function33- IMPORTANT: NEVER import from `conftest.py`34- ALWAYS type hint test function parameters correctly.35- Don't make a test class with only one function, a module-level test function is enough36- NEVER use `unittest.mock` or any of the `Mock` classes or `patch` function, never assert on method calls,37 use real objects and assert on full results. When absolutely necessary and can't be avoided, use `pytest.monkeypatch`,38 when the test setup would be too difficult or the code have side effects, but consider writing a fake.39- ALWAYS assert on the full result of the function call, never just list lengths or containment, except where that's the point.4041# Managing dependencies4243- Use `uv add` for adding dependencies, never directly edit `pyproject.toml` files.44- For CLI scripts and apps, ALWAYS use `click` library instead of `argparse`, add it to dependencies if necessary.