From 45110a9689deac63ea4b6ba108821c19215cdd61 Mon Sep 17 00:00:00 2001 From: Cameron Pfiffer Date: Mon, 7 Apr 2025 22:03:32 -0700 Subject: [PATCH] Add development guidelines for Comind, including build and test commands, code style guidelines, and core principles. This document aims to standardize contributions and ensure high-quality code practices. --- CLAUDE.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..77e0c0b --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,29 @@ +# Comind Development Guidelines + +## Build & Test Commands +- Install dependencies: `pip install -r requirements.txt -r requirements-dev.txt` +- Run all tests: `python tests/run_tests.py` or `pytest -xvs tests/` +- Run single test: `pytest -xvs tests/test_structured_gen.py` +- Code coverage: `pytest --cov=src tests/` or with HTML report: `pytest --cov=src --cov-report=html tests/` +- Format code: `black src/ tests/` +- Lint code: `flake8 src/ tests/` +- Type check: `mypy src/ tests/` + +## Code Style Guidelines +- Use Black formatter with default settings +- Keep line length to 88 characters (Black default) +- Use type annotations for all functions and classes +- Variable/function names: snake_case +- Class names: PascalCase +- Constants: UPPER_SNAKE_CASE +- Use Python 3.10+ features and typing +- Use Pydantic models for structured data +- Organize imports: standard library → third-party → local modules +- Proper error handling with try/except and logging +- Include docstrings for public functions/classes +- Code must pass mypy type checking and flake8 linting + +## Core Principles +- Comind is lexicon first. Lexicons are the source of truth. + +AI-generated contributions are welcome but must be high quality and well-reviewed. \ No newline at end of file -- 2.51.2