Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
microsoft avatar

Python Development

  • 57 installs
  • 12.4k repo stars
  • Updated July 27, 2026
  • microsoft/agent-framework

python-development is an agent skill that documents Microsoft Agent Framework Python coding standards for types, docstrings, imports, and async patterns.

About

The python-development skill defines coding standards for Python source in the Microsoft Agent Framework repository. Every .py file must begin with the Microsoft copyright header, and public APIs require Google-style docstrings with Args, Returns, Raises, and Keyword Args sections for framework-specific exceptions. Type annotations mandate return and parameter types, prefer Type | None over Optional, use from __future__ import annotations, and favor Mapping over MutableMapping for read-only inputs. Function design limits positional parameters to three, pushes optional args after a keyword-only star, and discourages **kwargs except for subclass extensibility. Package __init__.py files re-export public APIs with explicit __all__ and direct imports, avoiding identity aliases and star imports. Import structure groups core agent_framework symbols, observability components, and lazy-loaded connectors such as OpenAI and Foundry clients. Performance guidance caches expensive work like JSON schema generation, prefers match on .type in hot paths, and assumes async by default. Use when writing or modifying Python files under the Agent Framework python/ tree.

  • Requires Microsoft copyright header on every Python file.
  • Enforces Google-style docstrings and strict type annotation rules.
  • Defines keyword-only optional parameters and limited positional arity.
  • Specifies __all__ re-export patterns for public package APIs.
  • Recommends async-by-default code and connector naming conventions.

Python Development by the numbers

  • 57 all-time installs (skills.sh)
  • +1 installs in the week ending Jun 21, 2026 (Skillselion tracking)
  • Ranked #137 of 311 Python skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

python-development capabilities & compatibility

Capabilities
copyright header enforcement · google style docstring template · type annotation and keyword only arg rules · public api __all__ export pattern · connector import and naming conventions
Use cases
documentation · refactoring
From the docs

What python-development says it does

Coding standards, conventions, and patterns for developing Python code in the Agent Framework repository.
SKILL.md
Use Google-style docstrings for all public APIs
SKILL.md
npx skills add https://github.com/microsoft/agent-framework --skill python-development

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs57
repo stars12.4k
Security audit3 / 3 scanners passed
Last updatedJuly 27, 2026
Repositorymicrosoft/agent-framework

What conventions should I follow when writing Python in the Agent Framework repository?

Apply Microsoft Agent Framework Python coding standards for types, docstrings, imports, exports, and async patterns in the python/ directory.

Who is it for?

Developers contributing Python to microsoft/agent-framework who need enforced style and API export rules.

Skip if: Skip for non-Python languages or projects outside the Agent Framework python/ directory.

When should I use this skill?

User writes or modifies Python source files in the Agent Framework python/ directory.

What you get

Code that matches framework headers, typing, docstring, import, and export standards.

Files

SKILL.mdMarkdownGitHub ↗

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 | None instead of Optional[Type]
  • Use from __future__ import annotations to enable postponed evaluation
  • Use suffix T for TypeVar names: ChatResponseT = TypeVar("ChatResponseT", bound=ChatResponse)
  • Use Mapping instead of MutableMapping for read-only input parameters
  • Prefer # type: ignore[...] over unnecessary casts, or isinstance checks, 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

Function Parameters

  • Positional parameters: up to 3 fully expected parameters
  • Use keyword-only arguments (after *) for optional parameters
  • Provide string-based overrides to avoid requiring extra imports:
def create_agent(name: str, tool_mode: Literal['auto', 'required', 'none'] | ChatToolMode) -> Agent:
    if isinstance(tool_mode, str):
        tool_mode = ChatToolMode(tool_mode)
  • Avoid shadowing built-ins (use next_handler instead of next)
  • Avoid **kwargs unless needed for subclass extensibility; prefer named parameters

Docstrings

Use Google-style docstrings for all public APIs:

def equal(arg1: str, arg2: str) -> bool:
    """Compares two strings and returns True if they are the same.

    Args:
        arg1: The first string to compare.
        arg2: The second string to compare.

    Returns:
        True if the strings are the same, False otherwise.

    Raises:
        ValueError: If one of the strings is empty.
    """
  • Always document Agent Framework specific exceptions
  • Explicitly use Keyword Args when applicable
  • Only document standard Python exceptions when the condition is non-obvious

Import Structure

# Core
from agent_framework import Agent, Message, tool

# Components
from agent_framework.observability import enable_sensitive_telemetry

# Connectors (lazy-loaded)
from agent_framework.openai import OpenAIChatClient
from agent_framework.foundry import FoundryChatClient

Public API and Exports

In __init__.py files that define package-level public APIs, use direct re-export imports plus an explicit __all__. Avoid identity aliases like from ._agents import Agent as Agent, and avoid from module import *.

Do not define __all__ in internal non-__init__.py modules. Exception: modules intentionally exposed as a public import surface (for example, agent_framework.observability) should define __all__.

__all__ = ["Agent", "Message", "ChatResponse"]

from ._agents import Agent
from ._types import Message, ChatResponse

Performance Guidelines

  • Cache expensive computations (e.g., JSON schema generation)
  • Prefer match/case on .type attribute over isinstance() in hot paths
  • Avoid redundant serialization — compute once, reuse

Style

  • Line length: 120 characters
  • Format only files you changed, not the entire codebase
  • Prefer attributes over inheritance when parameters are mostly the same
  • Async by default — assume everything is asynchronous

Naming Conventions for Connectors

  • _prepare_<object>_for_<purpose> for methods that prepare data for external services
  • _parse_<object>_from_<source> for methods that process data from external services

Related skills

FAQ

What docstring style does python-development require?

Google-style docstrings with Args, Returns, Raises, and Keyword Args for public APIs.

When should I use python-development?

When writing or editing Python files in the Agent Framework repository python/ tree.

Is python-development safe to install?

Review the Security Audits panel on this page before installing in production.

Pythonbackend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.