Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Coding standards, conventions, and patterns for developing Python code in the Agent Framework repository. Use this when writing or modifying Python source files in the python/ directory.
.claude/skills/microsoft-python-development/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-18 | ✗→✓ | ▲ Improved | 49% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 2% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 403% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -14% | 0% |
Every .py file must start with:
python# Copyright (c) Microsoft. All rights reserved.
Type | None instead of Optional[Type]from __future__ import annotations to enable postponed evaluationT for TypeVar names: ChatResponseT = TypeVar("ChatResponseT", bound=ChatResponse)Mapping instead of MutableMapping for read-only input parameters# type: ignore[...] over unnecessary casts, or isinstance checks, when these are internally called and executed methodsBut make sure the ignore is specific for both mypy and pyright so that we don't miss other mistakes
agent_framework* modules when intentional; use a targeted# pyright: ignore[reportPrivateUsage] instead of making the helper public just to satisfy pyright.
casts, or clearer annotations over adding runtime overhead without a design benefit.
*) for optional parameterspythondef create_agent(name: str, tool_mode: Literal['auto', 'required', 'none'] | ChatToolMode) -> Agent: if isinstance(tool_mode, str): tool_mode = ChatToolMode(tool_mode)
next_handler instead of next)**kwargs unless needed for subclass extensibility; prefer named parametersUse Google-style docstrings for all public APIs:
pythondef 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. """
Keyword Args when applicablepython# 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
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__.
python__all__ = ["Agent", "Message", "ChatResponse"] from ._agents import Agent from ._types import Message, ChatResponse
Special case: the root agent_framework/__init__.py uses lazy runtime exports. For root public API changes:
_LAZY_MODULE_EXPORTS and keep _LAZY_EXPORTS derived from it.__all__ synchronized; it is still required for from agent_framework import *.agent_framework/__init__.pyi so pyright, mypy, and editors see the typed surface.__getattr__; avoid root-levelspecial-case branches for individual deprecated exports.
.pyi stubs because they mark re-exported names for type checkers; avoid themin runtime .py modules unless there is a specific compatibility reason.
match/case on .type attribute over isinstance() in hot paths_prepare_<object>_for_<purpose> for methods that prepare data for external services_parse_<object>_from_<source> for methods that process data from external services| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-18 | fail→pass | 11,252 | 11,622 | +3% | 1 | 1 | 0% | 1,992 | 2,964 | +49% | 0 | 0 | — |
case-01 | fail→pass | 25,847 | 25,951 | +0% | 1 | 1 | 0% | 4,420 | 5,430 | +23% | 0 | 0 | — |
case-19 | pass→pass | 11,574 | 4,408 | -62% | 1 | 1 | 0% | 1,868 | 1,939 | +4% | 0 | 0 | — |
case-02 | fail→pass | 14,072 | 6,054 | -57% | 1 | 1 | 0% | 2,227 | 2,266 | +2% | 0 | 0 | — |
case-03 | fail→pass | 4,071 | 10,984 | +170% | 1 | 1 | 0% | 588 | 2,958 | +403% | 0 | 0 | — |
case-04 | pass→pass | 6,684 | 2,236 | -67% | 1 | 1 | 0% | 1,039 | 1,503 | +45% | 0 | 0 | — |
case-05 | pass→pass | 7,677 | 4,081 | -47% | 1 | 1 | 0% | 1,344 | 1,798 | +34% | 0 | 0 | — |
case-06 | pass→pass | 10,842 | 11,702 | +8% | 1 | 1 | 0% | 1,938 | 2,898 | +50% | 0 | 0 | — |
case-07 | pass→pass | 9,922 | 8,073 | -19% | 1 | 1 | 0% | 1,686 | 2,554 | +51% | 0 | 0 | — |
case-08 | fail→pass | 20,697 | 7,926 | -62% | 1 | 1 | 0% | 3,064 | 2,643 | -14% | 0 | 0 | — |
case-09 | pass→pass | 14,518 | 5,514 | -62% | 1 | 1 | 0% | 2,358 | 2,079 | -12% | 0 | 0 | — |
case-10 | pass→pass | 5,488 | 9,071 | +65% | 1 | 1 | 0% | 996 | 2,814 | +183% | 0 | 0 | — |
case-17 | fail→pass | 11,693 | 4,679 | -60% | 1 | 1 | 0% | 2,015 | 1,975 | -2% | 0 | 0 | — |
case-11 | fail→pass | 10,407 | 8,961 | -14% | 1 | 1 | 0% | 1,536 | 2,940 | +91% | 0 | 0 | — |
case-12 | fail→pass | 12,877 | 5,782 | -55% | 1 | 1 | 0% | 2,041 | 1,986 | -3% | 0 | 0 | — |
case-13 | pass→pass | 12,773 | 6,858 | -46% | 1 | 1 | 0% | 2,185 | 2,421 | +11% | 0 | 0 | — |
case-14 | pass→pass | 13,911 | 6,585 | -53% | 1 | 1 | 0% | 2,392 | 2,294 | -4% | 0 | 0 | — |
case-15 | pass→pass | 12,927 | 8,012 | -38% | 1 | 1 | 0% | 2,178 | 2,702 | +24% | 0 | 0 | — |
case-16 | fail→pass | 9,840 | 2,130 | -78% | 1 | 1 | 0% | 1,415 | 1,422 | +0% | 0 | 0 | — |
case-20 | pass→pass | 12,770 | 7,504 | -41% | 1 | 1 | 0% | 2,439 | 2,256 | -8% | 0 | 0 | — |
case-21 | pass→pass | 6,036 | 5,708 | -5% | 1 | 1 | 0% | 901 | 2,230 | +148% | 0 | 0 | — |
case-22 | pass→pass | 5,489 | 4,765 | -13% | 1 | 1 | 0% | 819 | 1,944 | +137% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +41 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.