2.2 KiB
2.2 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
{{ cookiecutter.project_slug }} is a Python library for {{ cookiecutter.description.lower() }}.
Development Commands
Setup
uv sync
Code Quality
- Linting and formatting:
uv run ruff check --fixanduv run ruff format - Type checking:
uv run mypy . - Combined linting:
uv run invoke lint(runs ruff check, ruff format --check, and mypy)
Testing
- Run tests:
uv run pytest - Run tests with coverage:
uv run invoke test
Maintenance
- Clean untracked files:
uv run invoke clean(interactive) - Version bumping:
uv run bump-my-version bump [patch|minor|major]
Code Architecture
Core Components (src/{{ cookiecutter.package_name }}/core.py)
The library implements the main functionality in the core module. Update this section with:
- Key Classes: Describe main classes and their responsibilities
- Core Functions: Document important functions and their purpose
- Data Flow: Explain how data flows through the system
- Dependencies: List and explain key dependencies
Project Structure
src/{{ cookiecutter.package_name }}/
├── __init__.py # Package initialization
├── core.py # Main functionality
└── py.typed # Type hints marker
examples/
└── basic_usage.py # Usage examples
tests/
└── test_{{ cookiecutter.package_name }}.py # Test suite
Development Notes
- Uses Python {{ cookiecutter.python_version }}+ with modern type hints (PEP 604)
- Configured with ruff for linting/formatting and mypy for type checking
- Built with uv for dependency management
- Includes invoke tasks for common operations
- Version {{ cookiecutter.version }} ({{ cookiecutter.year }})
Implementation Guidelines
- Follow test-driven development practices
- Use descriptive function names and one-liner docstrings for non-trivial functions
- Keep files between 300–500 lines where possible
- Don't duplicate code; build upon existing implementations
- Always use type hints as supported by Python {{ cookiecutter.python_version }}+