teams.py
CLAUDE.md67 starsChanged 6 months agoMITView on GitHub
Microsoft Teams Python SDK — a UV workspace with multiple packages providing APIs, common utilities, and integrations for Microsoft Teams. 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 this repositoryOne other file it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
The file
We split this CLAUDE.md into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
All packages live in packages/, each with src/microsoft_teams/<package>/ layout:
- Distinctive: line 51
ALL imports MUST be at the top of the file — no imports inside functions, classes, or conditional blocks
- Very specific: line 52
Avoid TYPE_CHECKING blocks unless absolutely necessary (genuine circular imports that can't be restructured)
- Distinctive: line 53
Avoid dynamic/deferred imports unless absolutely necessary
- Distinctive: line 62
Prefer composition over inheritance
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.8.11
- Python >= 3.12
Commands
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 checkerTooling
- Formatter/Linter: Ruff — line length 120, rules: E, F, W, B, Q, I, ASYNC
- Type checker: Pyright
- Test framework: pytest + pytest-asyncio (Ruff bans importing the unittest test framework; unittest.mock is allowed and used)
Architecture
Workspace Structure
All packages live in packages/, each with src/microsoft_teams/<package>/ 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 |
botbuilder | Bot Framework integration plugin |
graph | Microsoft Graph integration |
Key Patterns
Imports
- ALL imports MUST be at the top of the file — no imports inside functions, classes, or conditional blocks
- Avoid
TYPE_CHECKINGblocks 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)
cookiecutter templates/package -o packages # New package
cookiecutter templates/examples -o examples # New test appDependencies and Build
- UV workspace — packages reference each other via
{ workspace = true } - Hatchling build backend
- Dev dependencies in root
pyproject.toml
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

