python-development
Installation
SKILL.md
Python Development Standards
File Header
Every .py file must start with:
# Copyright (c) Microsoft. All rights reserved.
Type Annotations
- Always specify return types and parameter types
- Use
Type | Noneinstead ofOptional[Type] - Use
from __future__ import annotationsto enable postponed evaluation - Use suffix
Tfor TypeVar names:ChatResponseT = TypeVar("ChatResponseT", bound=ChatResponse) - Use
Mappinginstead ofMutableMappingfor read-only input parameters - Prefer
# type: ignore[...]over unnecessary casts, orisinstancechecks, when these are internally called and executed methods But make sure the ignore is specific for both mypy and pyright so that we don't miss other mistakes
Related skills
More from microsoft/agent-framework
python-code-quality
>
66build-and-test
How to build and test .NET projects in the Agent Framework repository. Use this when verifying or testing changes.
29python-package-management
>
23python-samples
>
17python-testing
>
17project-structure
Explains the project structure of the agent-framework .NET solution
15