agentleFS
MicrosoftKnown publishermicrosoft/teams.py/CLAUDE.md

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…

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
  1. Very specific:

    All packages live in packages/, each with src/microsoft_teams/<package>/ layout:

    line 37
  2. Distinctive:

    ALL imports MUST be at the top of the file — no imports inside functions, classes, or conditional blocks

    line 51
  3. Very specific:

    Avoid TYPE_CHECKING blocks unless absolutely necessary (genuine circular imports that can't be restructured)

    line 52
  4. Distinctive:

    Avoid dynamic/deferred imports unless absolutely necessary

    line 53
  5. Distinctive:

    Prefer composition over inheritance

    line 62

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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 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 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:

PackageDescription
apiCore API clients, models (Account, Activity, Conversation), auth
appsApp orchestrator, plugins, routing, events, HttpServer
commonHTTP client abstraction, logging, storage
cardsAdaptive cards
botbuilderBot Framework integration plugin
graphMicrosoft 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_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)

cookiecutter templates/package -o packages   # New package
cookiecutter templates/examples -o examples         # New test app

Dependencies and Build

  • UV workspace — packages reference each other via { workspace = true }
  • Hatchling build backend
  • Dev dependencies in root pyproject.toml

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.