- Primary Language: Python 3.12+
- Framework: N/A (this is a custom library)
- Type Checking: Strictly use Python Type Hints (
mypycompatible). - Documentation: Use Google-style docstrings for all public functions and classes.
- Coding Style: Adhere strictly to PEP 8.
- Async Patterns: Prefer
async/awaitfor all I/O bound operations. - Error Handling: Use custom exception classes; avoid "bare"
except:blocks. - Dependency Injection: N/A (this is a custom library).
- Location: Source code is organized under
src/my_lib/andclient/folders. - Structure: Configuration in
config/, static resource files inresources/, and entry points incalculator.py. - Refactoring: When modifying existing code, maintain the existing variable naming conventions unless they violate PEP 8.
- Imports: Use relative imports (e.g.,
from .service import ExampleService).
- Framework: Use
pytest. - Coverage: Aim for 80%+ coverage on all new logic.
- Mocks: Use
unittest.mockorpytest-mockfor external API calls. - Location: All tests for
src/my_lib/must reside in thetests/directory, mirroring the source structure without themy_lib/directory path prefix. Tests forclient/folder files must be placed in theclient/folder.
- Memory: Avoid loading large datasets into memory; use generators or streaming where possible.
- Efficiency: Prioritize
list comprehensionsover manualforloops for simple transformations.
- Analysis: Before writing code, explain your plan in 2-3 bullet points.
- Context: If a task requires knowledge of a file not currently open, ask me to open it or use your indexing to find it.
- Safety: Do not delete files or large blocks of code without explicit confirmation.