From a1161ca4052bc8ffcbc479592d0f194b05fb561a Mon Sep 17 00:00:00 2001 From: heyitsaamir Date: Sun, 8 Mar 2026 23:56:27 -0700 Subject: [PATCH 1/2] Add claude.md file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s time we start formalizing our relationship with Claude :) --- .gitignore | 1 - CLAUDE.md | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 CLAUDE.md diff --git a/.gitignore b/.gitignore index 6ac0bf3f..455074cf 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,6 @@ dmypy.json ref/ py.typed -CLAUDE.md .env.claude/ .claude/ diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..c1bfbc5b --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,85 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +Microsoft Teams Python SDK — a UV workspace with multiple packages providing APIs, common utilities, and integrations for Microsoft Teams. + +## Development Setup + +### Prerequisites +- UV >= 0.4.27 +- Python >= 3.12 + +### Commands +```bash +uv sync # Install virtual env and dependencies +source .venv/bin/activate # Activate virtual environment +pre-commit install # Install pre-commit hooks + +poe fmt # Format code with ruff +poe lint # Lint code with ruff +poe check # Run both format and lint +poe test # Run tests with pytest +pyright # Run type checker +``` + +## Tooling + +- **Formatter/Linter**: Ruff — line length 120, rules: E, F, W, B, Q, I, ASYNC +- **Type checker**: Pyright +- **Test framework**: pytest + pytest-asyncio (ruff bans unittest) + +## Architecture + +### Workspace Structure +All packages live in `packages/`, each with `src/microsoft_teams//` layout: + +| Package | Description | +|---------|-------------| +| `api` | Core API clients, models (Account, Activity, Conversation), auth | +| `apps` | App orchestrator, plugins, routing, events, HttpServer | +| `common` | HTTP client abstraction, logging, storage | +| `cards` | Adaptive cards | +| `ai` | AI/function calling utilities | +| `botbuilder` | Bot Framework integration plugin | +| `devtools` | Development tools plugin | +| `mcpplugin` | MCP server plugin | +| `a2aprotocol` | A2A protocol plugin | +| `graph` | Microsoft Graph integration | +| `openai` | OpenAI integration | + +### Key Patterns + +**Imports** +- ALL imports MUST be at the top of the file — no imports inside functions, classes, or conditional blocks +- Avoid `TYPE_CHECKING` blocks unless absolutely necessary (genuine circular imports that can't be restructured) +- Avoid dynamic/deferred imports unless absolutely necessary +- Relative imports within the same package, absolute for external packages + +**Models** +- Pydantic with `ConfigDict(alias_generator=to_camel)` — snake_case in Python, camelCase in JSON +- `model_dump(by_alias=True)` for serialization, `model_dump(exclude_none=True)` for query params + +**Interfaces** +- Protocol classes instead of Abstract Base Classes (ABC) +- Prefer composition over inheritance + +**Clients** +- Concrete clients inherit from `BaseClient` (`packages/api/src/microsoft_teams/api/clients/base_client.py`) +- Composition with operation classes for sub-functionality +- async/await for all API calls, return domain models + +## Scaffolding (cookiecutter) + +```bash +cookiecutter templates/package -o packages # New package +cookiecutter templates/test -o tests # New test package +``` + +## Dependencies and Build + +- UV workspace — packages reference each other via `{ workspace = true }` +- Hatchling build backend +- Dev dependencies in root `pyproject.toml` From ce25640dd23332087925d4ec09997c3c6a2f3af4 Mon Sep 17 00:00:00 2001 From: heyitsaamir Date: Mon, 9 Mar 2026 23:35:02 -0700 Subject: [PATCH 2/2] Update uv version --- CLAUDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index c1bfbc5b..fc415686 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -9,7 +9,7 @@ Microsoft Teams Python SDK — a UV workspace with multiple packages providing A ## Development Setup ### Prerequisites -- UV >= 0.4.27 +- UV >= 0.9.8 - Python >= 3.12 ### Commands