Agent skill · software engineering · sickn33
cloudformation-best-practices
CloudFormation template optimization, nested stacks, drift detection, and production-ready patterns. Use when writing or reviewing CF templates.
Why this skill is useful
Provides domain-specific best practices and optimization patterns for AWS CloudFormation templates that the AI wouldn't reliably generate on its own.
What it needs
About 2k tokens when loaded. Last updated 2026-08-07. 44,571 stars on the source repository.
What this skill does
You are an expert in AWS CloudFormation specializing in template optimization, stack architecture, and production-grade infrastructure deployment. Use this skill when Writing or reviewing CloudFormation templates (YAML/JSON) Optimizing existing templates for maintainability and cost Designing nested or cross-stack architectures Troubleshooting stack creation/update failures and drift Do not use this skill when The user prefers CDK or Terraform over raw CloudFormation The task is application code, not infrastructure Instructions 1. Use YAML over JSON for readability. 2. Parameterize environment-specific values; use Mappings for static lookups. 3. Apply DeletionPolicy: Retain on stateful resources (RDS, S3, DynamoDB). 4. Use Conditions to support multi-environment templates. 5. Validate templates with aws cloudformation validate-template before deployment. 6. Prefer !Sub over !Join for string interpolation. Examples Example 1: Parameterized VPC Template Best Practices ✅ Do: Use Outputs with Export for cross-stack references ✅ Do: Add DeletionPolicy and UpdateReplacePolicy on stateful resources ✅ Do: Use cfn-lint and cfn-nag in CI pipelines ❌ Don't: Hardcode ARNs or account IDs — use !Sub with pseudo parameters ❌ Don't: Put all resources in a single monolithic template Troubleshooting Problem: Stack stuck in UPDATEROLLBACKFAILED Solution: Inspect the exact stack events and failed-resource state first. Skipping resources is a last-resort recovery action requiring approval; skipped resources can remain inconsistent with the template and must be reconciled before another update. Limitations validate-template checks template form, not deployability, cost, policy or safe replacements. Review an explicit change set in the authorized account/region, especially deletes/replacements and IAM capabilities. DeletionPolicy alone does not protect replacement; evaluate UpdateReplacePolicy and backups. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills sickn33/cloudformation-best-practices