From magic-powers
Use when designing Azure Pipelines YAML — multi-stage pipelines, reusable templates, conditions and expressions, matrix strategies, triggers, and pipeline dependencies for complex CI/CD workflows.
npx claudepluginhub kienbui1995/magic-powers --plugin magic-powersThis skill uses the workspace's default tool permissions.
- Designing a new CI/CD pipeline for an application
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
# azure-pipelines.yml — canonical multi-stage structure
trigger:
branches:
include: [main, release/*]
paths:
exclude: [docs/**, '*.md']
pr:
branches:
include: [main]
drafts: false # don't run on draft PRs
variables:
- group: global-config # variable group from Library
- name: imageRepository
value: myapp
- name: tag
value: $(Build.BuildId)
stages:
- stage: Build
displayName: Build & Test
jobs:
- job: BuildJob
pool:
vmImage: ubuntu-latest
steps:
- task: UseDotNet@2
inputs:
version: '8.x'
- script: dotnet build --configuration Release
- script: dotnet test --collect:"XPlat Code Coverage"
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/TestResults/*.xml'
- task: PublishPipelineArtifact@1
inputs:
artifactName: drop
targetPath: $(Build.ArtifactStagingDirectory)
- stage: Deploy_Dev
displayName: Deploy to Dev
dependsOn: Build
condition: succeeded()
jobs:
- deployment: DeployDev
environment: dev
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: drop
- task: AzureWebApp@1
inputs:
appName: myapp-dev
- stage: Deploy_Prod
displayName: Deploy to Production
dependsOn: Deploy_Dev
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
jobs:
- deployment: DeployProd
environment: production # has approval gates configured in UI
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: drop
# templates/build-steps.yml — reusable build template
parameters:
- name: dotnetVersion
type: string
default: '8.x'
- name: buildConfiguration
type: string
default: Release
- name: runTests
type: boolean
default: true
steps:
- task: UseDotNet@2
inputs:
version: ${{ parameters.dotnetVersion }}
- script: dotnet build --configuration ${{ parameters.buildConfiguration }}
- ${{ if parameters.runTests }}:
- script: dotnet test --no-build
# Using the template in azure-pipelines.yml:
steps:
- template: templates/build-steps.yml
parameters:
dotnetVersion: '8.x'
runTests: false # skip tests in hotfix
Template types:
# Run only on main branch after successful build
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
# Run even if previous stage failed (e.g. cleanup stage)
condition: always()
# Run only when commit message contains a deploy keyword
condition: and(succeeded(), contains(variables['Build.SourceVersionMessage'], '[deploy]'))
# Pre-compute condition into a variable for clarity
variables:
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
stages:
- stage: ProdDeploy
condition: eq(variables.isMain, 'true')
# Test across multiple versions and OS combinations
jobs:
- job: Test
strategy:
matrix:
Linux_Python310:
imageName: ubuntu-latest
pythonVersion: '3.10'
Linux_Python311:
imageName: ubuntu-latest
pythonVersion: '3.11'
Windows_Python310:
imageName: windows-latest
pythonVersion: '3.10'
maxParallel: 3
pool:
vmImage: $(imageName)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(pythonVersion)
- script: pytest tests/
stages:
- stage: Build
jobs:
- job: BuildJob
steps:
- script: echo "##vso[task.setvariable variable=imageTag;isOutput=true]$(Build.BuildId)"
name: setTag
- stage: Deploy
dependsOn: Build
variables:
# Reference output from previous stage
imageTag: $[stageDependencies.Build.BuildJob.outputs['setTag.imageTag']]
jobs:
- job: DeployJob
steps:
- script: echo "Deploying image tag $(imageTag)"
succeeded()maxParallelstageDependencies + isOutput=trueenvironment and deployment strategy (runOnce, rolling, canary)paths.exclude)?dependsOn explicit for non-linear stage dependencies?templates/ directory and parameterized== instead of eq() (YAML expression syntax is different from standard comparison)paths filter on trigger (rebuilds on every commit including documentation changes)trigger: none on a pipeline that should run on push (accidental manual-only pipeline)ado-release-management — add gates and approvals to the deploy stages designed hereado-pipeline-optimization — optimize the build and test stages for speed and costado-pipeline-security — harden the pipeline designed here against secret exfiltration and unauthorized access