From magic-powers
Use when building AWS CI/CD pipelines with CodePipeline/CodeBuild/CodeDeploy, choosing deployment strategies, configuring buildspec.yml, or setting up artifact management with CodeArtifact. Covers AWS DOP-C02 and DVA-C02 CI/CD domains.
npx claudepluginhub kienbui1995/magic-powers --plugin magic-powersThis skill uses the workspace's default tool permissions.
- Building CI/CD pipelines with AWS CodePipeline, CodeBuild, and CodeDeploy
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.
Standard pipeline flow:
Source → Build → Test → [Approval] → Deploy (Staging) → [Approval] → Deploy (Production)
Pipeline stages and actions:
| Stage | Services | Purpose |
|---|---|---|
| Source | CodeCommit, S3, GitHub, ECR | Trigger on code/artifact change |
| Build | CodeBuild | Compile, test, package artifacts |
| Test | CodeBuild, Lambda | Integration/load tests |
| Deploy | CodeDeploy, ECS, CloudFormation, S3, Elastic Beanstalk | Deploy to target |
| Approval | Manual approval action | Human gate with SNS notification |
Action constraints:
runOrder to sequence actions within a stage (runOrder 1 before runOrder 2)version: 0.2
env:
variables:
ENV: production
parameter-store:
DB_PASSWORD: /myapp/db/password # from SSM Parameter Store
secrets-manager:
API_KEY: myapp/api-key # from Secrets Manager
phases:
install:
runtime-versions:
nodejs: 18
commands:
- npm install
pre_build:
commands:
- echo "Running pre-build checks..."
- aws ecr get-login-password | docker login --username AWS --password-stdin $ECR_REGISTRY
build:
commands:
- npm run build
- npm run test
- docker build -t $IMAGE_TAG .
post_build:
commands:
- docker push $IMAGE_TAG
- echo "Build completed"
artifacts:
files:
- '**/*'
base-directory: dist
discard-paths: no
cache:
paths:
- node_modules/**/* # cache for faster builds
Key sections:
install: Install runtime and toolspre_build: Authentication, setupbuild: Main compilation and testingpost_build: Push images, notificationsartifacts: Files passed to next pipeline stagecache: S3-backed cache between builds (speeds up dependency downloads)For EC2 / On-premises:
| Strategy | Description | Downtime | Rollback |
|---|---|---|---|
| In-Place (Rolling) | Deploy to existing instances; configurable batch size | Brief (batch update) | Redeploy old version |
| Blue/Green | Create new ASG with new version; shift traffic via ELB | Zero downtime | Keep old ASG, redirect traffic back |
In-Place minimum health: MinimumHealthyHosts (percentage or count that must remain healthy during deployment).
For AWS Lambda:
| Strategy | Behavior |
|---|---|
| AllAtOnce | Immediately shift 100% traffic to new version |
| Canary10Percent5Minutes | Shift 10%, wait 5 min, shift remaining 90% |
| Linear10PercentEvery1Minute | Shift 10% every 1 minute (10 steps = 100% in 10 min) |
| Linear10PercentEvery3Minutes | Shift 10% every 3 min (30 min total) |
For ECS (Blue/Green):
For EC2:
version: 0.0
os: linux
files:
- source: /src
destination: /var/www/html
hooks:
BeforeInstall:
- location: scripts/stop_server.sh
timeout: 60
AfterInstall:
- location: scripts/install_dependencies.sh
ApplicationStart:
- location: scripts/start_server.sh
ValidateService:
- location: scripts/validate.sh
timeout: 60
For Lambda:
version: 0.0
Resources:
- MyFunction:
Type: AWS::Lambda::Function
Properties:
Name: MyFunction
Alias: live
CurrentVersion: !Ref LambdaVersion
TargetVersion: !Ref NewLambdaVersion
Hooks:
BeforeAllowTraffic: PreTrafficHook # Lambda to run before traffic shift
AfterAllowTraffic: PostTrafficHook # Lambda to run after traffic shift
Hook lifecycle order (EC2): ApplicationStop → DownloadBundle → BeforeInstall → Install → AfterInstall → ApplicationStart → ValidateService
| Source event | Pipeline trigger |
|---|---|
| CodeCommit push | EventBridge rule (automatic) |
| S3 object change | EventBridge rule |
| GitHub/Bitbucket push | CodeStar Connection webhook |
| ECR image push | EventBridge rule → pipeline (not direct) |
| Scheduled | EventBridge schedule → pipeline |
| Manual | Console, CLI, SDK |
ECR push → Pipeline: CodePipeline cannot watch ECR directly. Use EventBridge rule:
source: aws.ecr → detail-type: "ECR Image Action" → Pipeline trigger.
aws.ecr image action event) → trigger pipelineMinimumHealthyHosts) = must keep X% of instances healthy during rolling deploy to productionValidateService hook