.claude/skills/deployment/SKILL.md
Serverless deployment with zero-downtime, multi-environment strategies, and infrastructure validation. Use when deploying Lambda functions, managing environments, or troubleshooting deployment failures.
npx skillsauth add awannaphasch2016/jousef-landing deploymentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Tech Stack: AWS Lambda, Docker, Terraform, GitHub Actions, Doppler (secrets)
Source: Extracted from CLAUDE.md deployment principles and production deployment patterns.
Use the deployment skill when:
DO NOT use this skill for:
Quick Links:
What are you deploying?
├─ Lambda function update?
│ ├─ Code change only? → Update function code, wait for update
│ ├─ Config change (env vars, memory)? → Update configuration, wait
│ ├─ Zero-downtime required? → Use versioning + alias pattern
│ └─ Rollback needed? → Point alias to previous version
│
├─ New environment?
│ ├─ Branch-based (dev/staging/prod)? → Follow multi-env guide
│ ├─ Secrets setup? → Configure Doppler + GitHub secrets
│ └─ Infrastructure? → Terraform apply
│
├─ Deployment failed?
│ ├─ Check CloudWatch logs → Filter ERROR level
│ ├─ Validate secrets → Run validation script
│ ├─ Check resource state → AWS CLI describe commands
│ └─ Verify permissions → IAM policy validation
│
└─ CI/CD pipeline setup?
├─ Define environments → dev/staging/prod
├─ Configure artifact promotion → Immutable images
├─ Add validation gates → Pre-deploy checks
└─ Setup monitoring → CloudWatch + smoke tests
Problem: Updating Lambda function causes brief unavailability during deployment.
Solution: Version + Alias pattern
$LATEST (mutable, testing)
↓ publish version
Version N (immutable snapshot)
↓ update alias
live (production pointer) → Version N
Benefits:
See ZERO_DOWNTIME.md for detailed patterns.
Branch-Based Deployment:
dev branch → dev environment (~8 min)
↓ PR
main branch → staging environment (~10 min)
↓ Tag v*.*.*
production environment (~12 min)
Artifact Promotion:
See MULTI_ENV.md for environment separation patterns.
Note: Deployment verification applies Progressive Evidence Strengthening (CLAUDE.md Principle #2). We verify from weak evidence (exit codes) to strong evidence (actual traffic metrics).
Multi-Layer Verification (Deployment Application):
Status Code (weakest signal)
aws lambda invoke --function-name worker --payload '{}' /tmp/response.json
# Exit code 0 only means "invocation succeeded", not "function worked"
Response Payload (stronger signal)
if grep -q "errorMessage" /tmp/response.json; then
echo "❌ Lambda returned error"
exit 1
fi
CloudWatch Logs (strongest signal)
ERROR_COUNT=$(aws logs filter-log-events \
--log-group-name /aws/lambda/worker \
--filter-pattern "ERROR" \
--query 'length(events)' --output text)
if [ "$ERROR_COUNT" -gt 0 ]; then
echo "❌ Found errors in logs"
exit 1
fi
Principle: AWS services returning 200 OK doesn't guarantee error-free execution. Always validate logs.
See MONITORING.md for comprehensive validation patterns.
Doppler (Runtime Secrets)
AURORA_HOST, OPENROUTER_API_KEYGitHub Secrets (Deployment Secrets)
CLOUDFRONT_DISTRIBUTION_ID, AWS_ACCESS_KEY_ID${{ secrets.SECRET_NAME }} in workflowsThe Deciding Question: "Does the Lambda function running in production need this value?"
See MULTI_ENV.md#secret-management for detailed patterns.
Principle: Validate configuration BEFORE deployment, not during.
# Run before every deployment
scripts/validate_deployment_ready.sh
# Checks:
# 1. Doppler configuration exists
# 2. Required environment variables set
# 3. AWS resources exist (S3 buckets, DynamoDB tables)
# 4. Lambda function dependencies available
Why This Matters:
Pattern: Query AWS infrastructure, validate secrets match reality.
jobs:
validate-deployment-config:
runs-on: ubuntu-latest
steps:
- name: Validate CloudFront Distributions
run: |
# Query actual infrastructure
ACTUAL=$(aws cloudfront list-distributions \
--query 'DistributionList.Items[?Comment==`app-dev`].Id' \
--output text)
# Compare to GitHub secret
if [ "$ACTUAL" != "${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}" ]; then
echo "❌ Secret mismatch detected"
exit 1
fi
build:
needs: validate-deployment-config # Won't run if validation fails
Benefits:
See MONITORING.md#infrastructure-validation.
# 1. Commit to dev branch
git add .
git commit -m "feat: Add new feature"
git push origin dev
# 2. GitHub Actions automatically:
# - Builds Docker image
# - Pushes to ECR
# - Updates Lambda function code
# - Waits for function update (no sleep!)
# - Runs smoke tests
# - Validates CloudWatch logs
# 3. Manual verification (optional)
just test-dev-api # Test deployed function
Time: ~8 minutes
# 1. Create PR from dev → main
gh pr create --base main --head dev --title "Release: v1.2.0"
# 2. Review and merge
gh pr merge --squash
# 3. GitHub Actions automatically:
# - Uses SAME Docker image from dev (artifact promotion)
# - Updates staging Lambda with promoted image
# - Runs integration tests
# - Validates staging environment
Time: ~10 minutes (faster because no rebuild)
# 1. Tag release on main branch
git tag v1.2.0
git push origin v1.2.0
# 2. GitHub Actions automatically:
# - Uses SAME Docker image from staging
# - Publishes new Lambda version (immutable)
# - Updates 'live' alias to new version (zero-downtime)
# - Runs smoke tests
# - Validates production logs
Time: ~12 minutes
# Find previous version
aws lambda list-versions-by-function \
--function-name worker \
--query 'Versions[-2].Version' # Previous version
# Update alias to previous version (instant rollback)
aws lambda update-alias \
--function-name worker \
--name live \
--function-version 42 # Previous working version
# Verify rollback
aws lambda get-alias --function-name worker --name live
Time: < 30 seconds (instant)
From CLAUDE.md global instructions:
"Deployment Philosophy: Serverless AWS Lambda with immutable container images, zero-downtime promotion via versioning."
just test-deploy first)terraform apply first)DO:
aws lambda update-function-code --function-name worker --image-uri $IMAGE
aws lambda wait function-updated --function-name worker # Blocks until ready
DON'T:
aws lambda update-function-code --function-name worker --image-uri $IMAGE
sleep 30 # ❌ Arbitrary delay, might be too short or too long
Why Waiters:
.claude/skills/deployment/
├── SKILL.md # This file (entry point)
├── ZERO_DOWNTIME.md # Lambda versioning patterns
├── MULTI_ENV.md # Environment strategy
├── MONITORING.md # Validation and monitoring
└── scripts/
└── validate_deployment_ready.sh # Pre-deployment validation
docs/deployment/TELEGRAM_DEPLOYMENT_RUNBOOK.mdtools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
testing
Write comprehensive tests following project conventions (tiers, patterns, anti-patterns). Use when writing tests, improving test coverage, fixing failing tests, or reviewing test quality.
content-media
Clone and customize existing templates (landing pages, dashboards, admin panels) with style extraction, config-driven content, and theme customization
development
Create high-converting B2B landing pages using psychological section sequencing. Use when building landing pages for services, agencies, consultants, or B2B products. Provides 14-section framework optimized for conversion psychology.