AGENTS.md
Guidance for coding agents working on the Personal Work Agent Microsoft Teams connector boundary.
Project Overview
The Microsoft Teams connector boundary keeps platform-specific API access, cursor sync, event normalization, and case creation separate from the generic runtime. Use this guide when changing Microsoft Teams request shapes, sync cursors, watch-profile scoping, ingest mapping, validation behavior, or connector-specific tests.
This document is intentionally narrower than the broad connector guide. It is for agents already touching Microsoft Teams-specific files.
Project Map
- src/workagent/connectors/microsoft_teams_client.py
- src/workagent/connectors/microsoft_teams_sync.py
- src/workagent/services/microsoft_teams_ingest.py
Relevant tests:
- tests/test_microsoft_teams_adapter.py
- tests/test_microsoft_teams_sync.py
- tests/test_microsoft_teams_ingest.py
Setup Commands
bashuv run pytest tests/test_microsoft_teams_adapter.py tests/test_microsoft_teams_sync.py tests/test_microsoft_teams_ingest.py -q
uv run pytest tests/test_connector_validation.py tests/test_platform_event_normalization.py -q
make lint
Connector Notes
- Teams sync follows workspace communication boundaries.
- Keep tenant and channel identifiers redacted in examples.
Change Rules For Agents
- Keep raw platform API calls in connector client files.
- Keep pagination, cursor parsing, and batch construction in connector sync files when a sync file exists.
- Keep platform event to local case conversion in the matching ingest service when an ingest service exists.
- Use credentials through the configured credential resolver and secret store; do not pass raw token values into cases.
- Preserve watch-profile and query scoping before broad collection.
- Normalize remote IDs consistently so duplicate events do not create duplicate local cases.
- Keep platform-specific errors typed and covered by focused tests.
Verification
bashuv run pytest tests/test_microsoft_teams_adapter.py tests/test_microsoft_teams_sync.py tests/test_microsoft_teams_ingest.py -q
make lint
Run runtime factory tests too if connector registration changes.
Security Notes
Microsoft Teams data can include private workspace content, user identifiers, files, tickets, messages, and credentials. Do not publish tokens, private endpoints, tenant identifiers, message bodies, file links, or account-specific IDs. Use placeholders in examples.
PR Checklist
- Client behavior is covered by platform tests.
- Cursor and duplicate handling are covered when sync exists.
- Ingest conversion is covered when ingest exists.
- Credential handling stays resolver-owned and redacted.