AgentSkillsCN

release-management

运用版本控制策略、部署策略、回滚流程与发布自动化,实施发布管理。在规划发布流水线、选择部署策略(蓝绿部署、金丝雀部署、滚动部署)、实现发布自动化,或设计回滚流程时,可使用此技能。

SKILL.md
--- frontmatter
name: "release-management"
description: 'Implement release management with versioning strategies, deployment strategies, rollback procedures, and release automation. Use when planning release pipelines, choosing deployment strategies (blue-green, canary, rolling), automating releases, or designing rollback procedures.'
metadata:
  author: "AgentX"
  version: "2.0.0"
  created: "2025-01-15"
  updated: "2025-01-15"

Release Management & Deployment Strategies

Purpose: Decision guides, versioning rules, deployment strategy selection, and release checklists. For full YAML examples and runbook templates, see the references/ directory.


When to Use This Skill

  • Planning release pipelines and strategies
  • Choosing deployment strategies (blue-green, canary, rolling)
  • Implementing automated release workflows
  • Designing rollback procedures
  • Setting up versioning with SemVer or CalVer

Prerequisites

  • CI/CD pipeline infrastructure
  • Version control system (Git)

Quick-Start: Deployment Strategy Selection

Pick your strategy first — everything else follows from this choice.

StrategyBest ForDowntimeRollback SpeedInfra CostComplexity
RollingMost apps, K8s-nativeNoneMedium (pod-by-pod)SameLow
Blue-GreenZero-downtime criticalNoneInstant (swap)Medium
CanaryRisk-sensitive releasesNoneMedium (scale to 0)+10-25%High
Feature FlagsGradual user rolloutNoneInstant (toggle)SameMedium
RecreateDev/Test environmentsYesFast (redeploy)SameLow

Decision tree:

code
Need zero-downtime?
├─ No  → Recreate (dev/test only)
└─ Yes
   ├─ Need instant rollback?
   │  ├─ Yes → Blue-Green  (if budget allows 2× infra)
   │  └─ Yes → Feature Flags (if code-level control preferred)
   └─ Need gradual risk reduction?
      ├─ Yes, by traffic %  → Canary
      └─ Default / simplest → Rolling

Full YAML examples for each strategy: references/deployment-strategy-examples.md


Table of Contents

  1. Deployment Strategy Selection
  2. Versioning Strategies
  3. Deployment Strategies — Concepts
  4. Rollback Procedures
  5. Release Pipeline Architecture
  6. Release Automation
  7. Release Checklist
  8. Best Practices
  9. Related Skills & Resources

Versioning Strategies

Choosing a Versioning Scheme

code
Is your release cadence time-based (monthly/quarterly)?
├─ Yes → CalVer  (YYYY.MM.DD)
└─ No
   ├─ Do you expose a public API or library?
   │  └─ Yes → SemVer  (MAJOR.MINOR.PATCH)
   └─ Internal service / continuous delivery?
      └─ Commit-Based  (v1.0.{count}+{sha})

Semantic Versioning (SemVer)

Format: MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD]

Version Increment Rules:

BumpWhenExample
MAJORIncompatible / breaking API changes1.x.x → 2.0.0
MINORNew functionality, backward-compatible1.1.x → 1.2.0
PATCHBug fixes, backward-compatible1.1.1 → 1.1.2
PRERELEASEalpha → beta → rc progression2.0.0-rc.1
BUILDMetadata only (commit hash, CI number)2.0.0+build.47

Key rules:

  • Once a version is released, its contents must not change
  • Pre-release versions (-alpha.1, -beta.2, -rc.1) have lower precedence than the release
  • Build metadata (+build.1) is ignored for version precedence

Calendar Versioning (CalVer)

Format: YYYY.MM[.DD][.MICRO]

When to use:

  • Time-based release cadences (monthly, quarterly)
  • Marketing-driven version numbers
  • Consumer products with regular update schedules
  • Ubuntu, pip, and similar projects use CalVer

Commit-Based Versioning

Format: v{MAJOR}.{MINOR}.{COMMIT_COUNT}+{SHORT_SHA}

Best for internal services with continuous delivery where every merge to main is a release candidate.

Pre-Release Label Progression

LabelMeaningAudience
alpha.NEarly testing, unstableInternal team
beta.NFeature-complete, bugs expectedEarly adopters
rc.NRelease candidate, production-readyWider testing
snapshotDevelopment buildCI only

Automation: Version bump + changelog workflows → references/release-automation-workflows.md


Deployment Strategies — Concepts

Blue-Green Deployment

Two identical production environments; deploy to inactive, test, swap traffic.

AspectDetail
MechanismDNS / load-balancer swap between Blue ↔ Green
RollbackInstant — swap back to previous environment
TradeoffRequires 2× infrastructure; database migrations need care

Pros: Zero downtime · Instant rollback · Full pre-switch testing Cons: Double infrastructure cost · DB migration complexity

Canary Deployment

Route a small percentage of traffic to the new version; expand on success.

AspectDetail
MechanismWeighted routing (10% → 25% → 50% → 100%)
RollbackScale canary to 0 replicas
TradeoffNeeds monitoring infra; longer total deploy time

Pros: Low risk · Real user feedback · Gradual rollout Cons: Complex setup · Requires robust observability

Rolling Deployment

Replace instances one-at-a-time (or in small batches).

AspectDetail
MechanismOrchestrator replaces pods with maxSurge / maxUnavailable
RollbackAutomatic on failed health checks (K8s native)
TradeoffMixed versions during rollout window

Pros: Built-in to K8s / ECS · Zero downtime · Automatic rollback Cons: Briefly mixed versions · Slower than blue-green

Feature Flags / Feature Toggles

Deploy code with features disabled; enable via configuration per user/percentage.

AspectDetail
MechanismRuntime config toggle (LaunchDarkly, Azure App Config, custom)
RollbackInstant — flip flag to false
TradeoffFlag debt accumulates; needs cleanup process

Pros: Instant rollback · Decouple deploy from release · A/B testing Cons: Code complexity · Stale flag cleanup required

Full YAML & K8s manifests for all strategies: references/deployment-strategy-examples.md


Rollback Procedures

Rollback Decision Criteria

Trigger a rollback when any of these thresholds are breached post-deploy:

SignalThresholdAction
Error rate> 2× baselineAutomatic rollback
Health checkHTTP != 200 for > 2 minAutomatic rollback
P95 latency> 50% degradationInvestigate → manual rollback
Critical bugFunctionality brokenImmediate manual rollback
Security vulnAny CVE discoveredImmediate manual rollback

Rollback Strategies by Deployment Type

Deployment TypeRollback MethodSpeed
Blue-GreenSwap traffic back to previous envInstant
CanaryScale canary replicas to 0< 1 min
Rollingkubectl rollout undo2-5 min
Feature FlagsDisable flagInstant
ContainerRedeploy previous image tag2-5 min

Database Rollback Principles

  1. Forward-only migrations — never drop columns; deprecate first
  2. Backward-compatible changes — new code must work with old schema during rollout
  3. Blue-green with separate DBs — rollback by switching connection string
  4. Always test undo scripts in staging before production

Full rollback scripts (automated + manual + DB): references/rollback-scripts.md


Release Pipeline Architecture

A release pipeline should follow this stage progression:

code
Validate Tag → Build → Test → Create Release → Deploy Staging
    → Smoke Tests → Deploy Production → Post-Deploy Verification

Key pipeline principles:

  • Trigger on semantic version tags (v*.*.*)
  • Build once, deploy the same artifact to every environment
  • Gate production deployment behind staging smoke tests
  • Use GitHub Environments with required reviewers for production
  • Generate changelog automatically from conventional commits
  • Attach build artifacts to GitHub Releases

Full pipeline YAML (GitHub Actions + Azure Pipelines): references/release-pipeline-examples.md


Release Automation

What to Automate

TaskTool / Approach
Version bumpingConventional Commits → npm version / dotnet-gitversion
Changelog generationgit log --grep by type (feat/fix/chore)
Tag + Release creationsoftprops/action-gh-release or gh release create
Pre-release detectionTag contains -alpha / -beta → mark as pre-release
Smoke testsAutomated health check + critical-path tests post-deploy
Rollback triggerHealth check failure → auto-redeploy previous version
NotificationsSlack / Teams webhook on deploy success or failure

Conventional Commits → Version Bump Mapping

Commit PrefixVersion BumpExample Message
feat:MINORfeat: add dark mode support
fix:PATCHfix: resolve login timeout (#123)
BREAKING CHANGE:MAJORfeat!: redesign auth API
chore: / docs:No bumpdocs: update README

Full automation workflows: references/release-automation-workflows.md


Release Checklist

Pre-Release

  • All tests passing (unit, integration, e2e)
  • Code coverage ≥ 80%
  • Security scan completed (dependencies + SAST)
  • Dependencies updated and audited
  • Changelog generated from conventional commits
  • Release notes drafted
  • Migration scripts tested in staging
  • Rollback procedure documented and tested
  • Stakeholders notified of release window

Deployment

  • Deploy to staging environment
  • Smoke tests passed (staging)
  • Load / performance testing completed
  • Deploy to production (via chosen strategy)
  • Smoke tests passed (production)
  • Monitoring dashboards reviewed

Post-Release

  • Health checks verified (HTTP 200, all endpoints)
  • Error rate at or below baseline
  • P95 latency at or below baseline
  • User feedback channels monitored
  • Incident response team aware and on-call
  • Documentation updated (API docs, runbook, changelog)
  • Release announcement sent to stakeholders

Communication template + runbook: references/release-runbook-template.md


Best Practices

✅ DO

  • Use semantic versioning consistently; tag every release in VCS
  • Maintain changelogs automatically via conventional commits
  • Version APIs explicitly (URL path or header)
  • Always test in staging before production
  • Use gradual rollouts (canary / feature flags) for high-risk changes
  • Monitor error rates and latency during and after deployment
  • Have a tested rollback plan before every release
  • Document procedures in a runbook
  • Notify stakeholders before the deployment window
  • Communicate breaking changes with migration guides
  • Automate version bumping, changelog generation, and smoke tests
  • Trigger automated rollback on health check failure
  • Establish baseline metrics before each release
  • Implement /health and /ready endpoints on every service

❌ DON'T

  • Deploy on Fridays, holidays, or outside on-call hours
  • Skip staging validation — even for "small" changes
  • Deploy without a documented rollback plan
  • Bundle multiple major changes into a single release
  • Skip versions or hard-code version numbers
  • Deploy without active monitoring and on-call coverage
  • Ignore failed health checks
  • Rush deployments under time pressure

Related Skills & Resources

Related Skills:

External Resources:

Reference Files (full examples, scripts, and templates):

ReferenceContents
release-pipeline-examples.mdGitHub Actions + Azure Pipelines YAML
deployment-strategy-examples.mdBlue-Green, Canary, Rolling, Feature Flag YAML
rollback-scripts.mdAutomated + manual rollback scripts
release-automation-workflows.mdVersion bump + changelog generation workflows
release-runbook-template.mdCommunication template + production runbook

Version: 2.0.0 Author: AgentX Last Updated: February 10, 2026

Scripts

ScriptPurposeUsage
version-bump.ps1Bump semantic version (major/minor/patch)./scripts/version-bump.ps1 -BumpType minor
generate-changelog.ps1Generate changelog from conventional commits./scripts/generate-changelog.ps1 [-Version 2.0.0]

Troubleshooting

IssueSolution
Failed deployment with no rollbackAlways deploy with rollback plan, use blue-green or canary for zero-downtime
Version conflicts between environmentsUse immutable artifacts (Docker images, versioned packages) across all stages