microsoft/agent-framework-py-release
Use when cutting a Python release for the microsoft/agent-framework monorepo. Triggers on "bump py versions", "cut a python release", "prepare release PR for python", "release py packages", "bump python to X.Y.Z", or similar requests to bump Python package versions and prepare a release PR. Handles all four lifecycle tiers (alpha, beta, rc, released) with CHANGELOG-driven selective bumps, floor bound checks, and post-bump validation.
npx skills add https://github.com/microsoft/agent-framework --skill agent-framework-py-release
Cuts a Python release PR for the microsoft/agent-framework monorepo.
No more universal lockstep. A package only bumps if it has a CHANGELOG entry this cycle. Draft the CHANGELOG first, then derive the bump list from it.
Exceptions to selective bumping (these stay coupled regardless of per-package changes):
agent-framework is coupled to agent-framework-core via agent-framework-core[all]==X.Y.Z (exact pin in python/pyproject.toml). If core bumps, root bumps. Root may also bump independently for its own changes (docs/metadata/extras).If the user explicitly states which packages to bump (or hands over a PR list per package), treat that as authoritative.
Use python/.github/skills/python-package-management/SKILL.md as the source of truth for lifecycle
version patterns, date-stamp cutoffs, classifier alignment, and internal dependency updates.
For release work, derive the live tier map at release time from python/PACKAGE_STATUS.md and the actual
version = lines in each pyproject.toml. Do not hardcode counts — packages move between tiers.
git log ${LAST_RELEASED_TAG}..${RELEASE_BASE} -- python/.python-package-managementdate-stamp rule.
If the user states target versions or a date explicitly, use exactly what they said — do not "correct" based on historical timezones.
python/CHANGELOG.md; this workflow creates the entries centrally from merged changes.
python-package-management for package lifecycle and versioning rules — do not duplicate thoserules in this release workflow.
Co-Authored-By trailer on any commit.uv run for all Python/poe commands (uv run poe ..., uv run pytest ...).git fetch origin main --tags --quiet
git fetch upstream main --tags --quiet 2>/dev/null || true
git status
# Fork clones use upstream/main as the authoritative release base; direct clones use origin/main.
if git show-ref --verify --quiet refs/remotes/upstream/main; then
RELEASE_BASE=upstream/main
else
RELEASE_BASE=origin/main
fi
git log -1 --oneline "$RELEASE_BASE"
If the user already has a bump-py-ver-release-* branch checked out, use it. Otherwise:
git checkout -b bump-py-ver-release-YYMMDD "$RELEASE_BASE"
Read python/PACKAGE_STATUS.md to enumerate current packages and lifecycle stages, and grep '^version' python/pyproject.toml python/packages/*/pyproject.toml to confirm actual versions. Cross-reference — if PACKAGE_STATUS.md shows a package as beta but its version looks like 1.0.0aYYMMDD, surface the inconsistency before proceeding.
Watch for: new packages added since the last release, lifecycle transitions (alpha→beta, beta→rc, rc→released), and stale packages that haven't been touched in many cycles.
Use the LATEST released tag as the compare base:
LAST_RELEASED_TAG=$(
git tag -l 'python-[0-9]*.[0-9]*.[0-9]*' \
| uv run --directory python python -c 'import sys; tags=[t.strip() for t in sys.stdin if t.strip()]; print(max(tags, key=lambda t: tuple(map(int, t[7:].split(".")))))'
)
echo "Compare base: $LAST_RELEASED_TAG"
List commits and packages touched:
git log --oneline ${LAST_RELEASED_TAG}..${RELEASE_BASE} -- python/ ':!python/CHANGELOG.md'
# Per-commit package footprint
for sha in $(git log --format='%H' ${LAST_RELEASED_TAG}..${RELEASE_BASE} -- python/); do
echo "--- $(git show -s --format='%h %s' $sha) ---"
git show --name-only --format='' $sha | grep '^python/packages/' | \
sed 's|^python/packages/||' | awk -F/ '{print $1}' | sort -u
done
When both remotes exist, record whether the fork is behind the authoritative base:
git rev-list --left-right --count origin/main...upstream/main
If user provides an explicit commit/PR list, treat THAT as authoritative.
Aggregate the per-commit footprint into a single union across the whole range. This is the source of truth for what must appear in the CHANGELOG. Save it before drafting entries.
# Union of all touched package directories across the range
git log --name-only --format='' ${LAST_RELEASED_TAG}..${RELEASE_BASE} -- python/packages/ \
| grep '^python/packages/' \
| sed 's|^python/packages/||' \
| awk -F/ '{print $1}' \
| sort -u
# Root-level files (drive a root agent-framework entry if substantive)
git log --name-only --format='' ${LAST_RELEASED_TAG}..${RELEASE_BASE} \
-- python/pyproject.toml python/agent_framework_meta/ python/README.md \
2>/dev/null | grep -v '^$' | sort -u
What "touched" means for bump purposes (apply judgment, document in commit message):
| Change scope under python/packages/<pkg>/ | Drives a bump? |
| --- | --- |
| Source code under <pkg>/agent_framework_* or the package's library tree | Yes — ship-affecting |
| pyproject.toml (deps, classifiers, extras, version metadata) | Yes — publishes new metadata |
| README.md substantive changes (env vars, install instructions, usage) | Yes — user-facing |
| README.md typo/wording-only | Judgment — usually no, but record under ### Changed if you do bump |
| Tests only (tests/) | Usually no — test changes don't ship to PyPI consumers. Bump only if the test change reflects a real behavior change in the package |
| Package-local samples (alpha packages only, before promotion) | Yes for alpha; samples ship with the alpha package |
| Repo infra touching the package dir (CI config, lint config) | No — record under - tests:, - samples:, or - docs: instead |
Root agent-framework is touched when python/pyproject.toml, python/agent_framework_meta/, or root README.md substantive content changed.
Individual feature/fix PRs intentionally do not add CHANGELOG entries. During release preparation, derive this section
centrally from the merged PRs since the last released tag.
Locate ## [Unreleased] and the top existing release header. INSERT a new section between them.
New section structure:
## [<release-label>] - YYYY-MM-DD
### Added
- **agent-framework-<pkg>**: <subject> ([#NNNN](https://github.com/microsoft/agent-framework/pull/NNNN))
### Changed
- **agent-framework-<pkg>**: ...
### Fixed
- **agent-framework-<pkg>**: ...
<release-label> is the released-tier target if any released package is bumping (e.g. 1.7.0), or the date stamp (e.g. 1.0.0b260528) if the release is prerelease-only. Reflect the user's framing.
Categorization heuristics (read commit subject + PR title/body):
feat(...), new re-exports from agent_framework, new capabilities surfaced from underlying SDKsfix(...), bug/crash/regression repairs, noise reduction (e.g. stop emitting spurious warnings), protocol-compliance fixes[BREAKING] prefix if breaking)Entry format:
- agent-framework-<pkg>: <subject, grammar-normalized> (#NNNN)- agent-framework-core, agent-framework-foundry: ...- agent-framework: ...- tests: ..., - samples: ..., - docs: ... (these do not drive package bumps)Once entries are drafted, the set of agent-framework-<pkg> and root agent-framework mentions IS the bump list. Anything not mentioned does not bump.
Before moving on, prove that every ship-affecting touched package has at least one CHANGELOG entry. A package whose code changed but is missing from CHANGELOG will NOT bump — and the fix will not ship to PyPI consumers.
# 1. Touched ship-affecting packages and root package files (from step 3a)
TOUCHED_PACKAGES=$(git log --name-only --format='' ${LAST_RELEASED_TAG}..${RELEASE_BASE} -- python/packages/ \
| grep '^python/packages/' \
| sed 's|^python/packages/||' \
| awk -F/ '{print $1}' \
| sort -u)
ROOT_TOUCHED=$(git log --name-only --format='' ${LAST_RELEASED_TAG}..${RELEASE_BASE} \
-- python/pyproject.toml python/agent_framework_meta/ python/README.md \
2>/dev/null | grep -v '^$' | sort -u)
TOUCHED=$(
{
if [ -n "$TOUCHED_PACKAGES" ]; then echo "$TOUCHED_PACKAGES"; fi
if [ -n "$ROOT_TOUCHED" ]; then echo "agent-framework"; fi
} | sort -u
)
# 2. Packages mentioned in the new CHANGELOG section
# (Extract from the section you just drafted — adjust the awk range to the new section's bounds)
MENTIONED=$(awk '
/^## \[<release-label>\]/ { in_section=1; next }
in_section && /^## \[/ { exit }
in_section { print }
' python/CHANGELOG.md \
| grep -oE '\*\*agent-framework(-[a-z0-9_-]+)?\*\*' \
| sed 's/\*\*//g;s/^agent-framework-//' \
| sort -u)
# 3. Diff — anything in TOUCHED but missing from MENTIONED is a gap
comm -23 <(echo "$TOUCHED") <(echo "$MENTIONED")
For every gap, decide explicitly with the user:
### Changed.Package-name aliasing to watch for: directory foundry_local → package agent-framework-foundry-local; github_copilot → agent-framework-github-copilot; azure-ai-search → agent-framework-azure-ai-search. The directory name and the published PyPI name are not always identical — confirm both when reconciling.
Footer reference links (REQUIRED every release):
grep -n "^\[.*\]:" python/CHANGELOG.md | head -5
Two edits when a released-tier bump is in play:
[Unreleased] compare base from python-${OLD_RELEASED}...HEAD to python-${NEW_RELEASED}...HEAD.[${NEW_RELEASED}] line ABOVE the previous version's link: [${NEW_RELEASED}]: https://github.com/microsoft/agent-framework/compare/python-${OLD_RELEASED}...python-${NEW_RELEASED}For prerelease-only releases (no released-tier bump this cycle), footer links don't change.
For each package in the bump list, choose the rule for its current tier. Use anchored sed (^version = "..."$) so only the project's own version matches. Use sed -i.bak plus backup cleanup for portable in-place edits across macOS/BSD sed and GNU sed.
Released tier (per-package semver):
# Example: openai goes 1.6.0 -> 1.6.1 (PATCH); core stays
sed -i.bak 's/^version = "1.6.0"$/version = "1.6.1"/' python/packages/openai/pyproject.toml
rm python/packages/openai/pyproject.toml.bak
Root agent-framework (only when core bumps, OR for its own changes):
sed -i.bak "s/^version = \"${OLD_ROOT}\"$/version = \"${NEW_ROOT}\"/" python/pyproject.toml
# AND keep the exact pin in sync with core
sed -i.bak "s/agent-framework-core\\[all\\]==${OLD_CORE}/agent-framework-core[all]==${NEW_CORE}/" python/pyproject.toml
rm python/pyproject.toml.bak
RC tier (counter increment):
# ag-ui goes 1.0.0rc3 -> 1.0.0rc4 only because it has a CHANGELOG entry
sed -i.bak 's/^version = "1.0.0rc3"$/version = "1.0.0rc4"/' python/packages/ag-ui/pyproject.toml
rm python/packages/ag-ui/pyproject.toml.bak
Alpha/Beta tier (new date stamp):
OLD_DATE=260521
NEW_DATE=260528
# Only the packages with CHANGELOG entries get the new stamp.
# Example: anthropic and bedrock had entries, others did not.
for pkg in anthropic bedrock; do
file="python/packages/$pkg/pyproject.toml"
sed -i.bak "s/1\\.0\\.0b${OLD_DATE}/1.0.0b${NEW_DATE}/g" "$file"
rm "${file}.bak"
done
If the user opts into a cohort-wide beta bump regardless of per-package changes, enumerate every beta package from PACKAGE_STATUS.md and stamp all of them. State that this is a cohort bump in the commit message.
Spot-check with grep '^version' python/pyproject.toml python/packages/*/pyproject.toml | sort before moving on.
agent-framework-coreOnly relevant when core itself bumped this cycle. Two policies, pick one explicitly with the user:
agent-framework-core>=X.Y.Z to the new core version on every non-core package that is ALSO bumping this cycle. Leaves packages-not-bumped at their existing floor.When raising a core floor, replace only the >=OLD half of the bound you intend to change:
file="python/packages/<pkg>/pyproject.toml"
sed -i.bak "s/agent-framework-core>=${OLD_CORE}/agent-framework-core>=${NEW_CORE}/" "$file"
rm "${file}.bak"
If core did not bump this cycle, do not touch floors.
cd python && uv run poe validate-python-release --base-ref "$RELEASE_BASE"
Use the same freshly fetched main ref that the release branch was based on (upstream/main above; use origin/main
when that is the authoritative release base). Must exit 0. This task first regenerates uv.lock, then discovers the
package pyproject.toml files changed from that base and runs their published runtime dependencies and
non-development extras through lock-independent lowest-direct and highest import probes. The probes run in
parallel, derive the minimum supported Python minor from each package's internal editable closure, and share a hard
300-second deadline. Use --python only when the release requires an explicit interpreter override.
This is the release safety net for selective bumping: the lower probe catches unresolvable or unimportable external
floors, internal constraints that reject co-released package versions, and the upper probe catches caps that exclude
an installable package set. The JSON report records the concrete versions resolved in both scenarios. It does not
replace the package-by-package code inspection required by the strict core-floor policy. If it fails, fix the named
package/bound and re-run before committing.
Do not substitute the workspace-wide validate-dependency-bounds-test command here. That command runs every
package's full tests and Pyright in separate isolated environments and is intentionally reserved for CI or an
explicit dependency-range audit. If the release itself changes an external dependency range, also run
validate-dependency-bounds-project --mode both --package <pkg> --dependency <name> for that dependency.
If only prereleases changed (no core bump, no floor changes), release validation is still required because the
lockfile and both ends of each changed package's published dependency metadata must remain installable.
The project's pre-commit hook runs poe check / poe typing / uv lock and may re-modify uv.lock on first commit attempt. Expected pattern — run twice:
git add -u
git commit -m "<message>" # may fail with "files were modified by this hook"
git add -u # re-stage hook-generated changes
git commit -m "<message>" # succeeds
Commit message format — HEREDOC, no Co-Authored-By:
git commit -m "$(cat <<'EOF'
Bump Python package versions for <release-label> release
<One paragraph explaining:
- which packages bumped and why (CHANGELOG-driven)
- semver rationale for any released-tier bumps
- whether a beta cohort bump was applied
- whether core floors were raised, and under which policy>
EOF
)"
git push origin bump-py-ver-release-YYMMDD
The push output includes a Create a pull request for '<branch>' on GitHub by visiting: <URL> line — surface that to the user.
LAST_RELEASED_TAG fresh — do NOT reuse the previous compare base. Symptom: dragging already-shipped PRs into the new CHANGELOG section.python/packages/foo/ but the new CHANGELOG section has no agent-framework-foo: line, then foo will NOT bump, and the fix sits in main but never reaches PyPI. Always run the touched-vs-mentioned reconciliation in step 4a before applying bumps.foundry_local → agent-framework-foundry-local). When reconciling touched dirs against CHANGELOG mentions, normalize on the PyPI form.agent-framework has agent-framework-core[all]==EXACT_VERSION. If core bumps and root does not, the pin is broken. Always bump them together and update the pin string.## [X.Y.Z] header to a new label — that wipes the historical section. Always INSERT a new section above.[Unreleased] line and the new [X.Y.Z] link at the bottom MUST be updated. Heading links don't resolve without them.[X.Y.Z] line compares from the PREVIOUS released tag, not from two releases ago.python-package-management date-stamp rule;do not infer a local timezone from the user's current shell.
Co-Authored-By trailer. Never add it. Rewrite/amend if it slipped in.python/PACKAGE_STATUS.md for the live tier map. Do not trust a hardcoded list.upstream/main consistently for branch creation, changeset discovery, and release validation. A stale origin/main must never become the implicit compare base.--pre README cleanup on promotion. When a package is promoted to released in this cycle, grep for pip install agent-framework-<pkg> --pre in READMEs and drop the --pre flag.1.0.0rcN without a CHANGELOG entry for that package. The counter tracks iterations, not calendar.python/.github/skills/python-package-management/SKILL.mdpython/PACKAGE_STATUS.mdpython/scripts/dependencies/validate_dependency_bounds.py --mode release (changed-package,lock-independent lowest-direct and highest import probes under a five-minute deadline)
python/pyproject.toml [tool.poe.tasks]Take microsoft/agent-framework-py-release from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference pip.
Without those the skill loads but fails at the first command.