Automated summary
Guides the writing, review, and optimization of AWS CloudFormation templates (YAML/JSON), including nested stacks, cross-stack references, and drift handling.
Strengths
- Concrete, actionable rules: YAML over JSON, environment parameterization, multi-environment Conditions, !Sub preferred over !Join
- Covers production safeguards: DeletionPolicy/UpdateReplacePolicy on stateful resources and Outputs/Export for cross-stack references
- Ships a specific troubleshooting recipe for stacks stuck in UPDATE_ROLLBACK_FAILED via continue-update-rollback
- Bakes validation and linting (validate-template, cfn-lint, cfn-nag) into CI pipelines
Limitations
- Does not cover CDK or Terraform, and explicitly tells you to skip it in those cases
- Little guidance on migrating existing infrastructure or on detailed cost optimization despite the optimization framing
- Examples are minimal (a single VPC template) relative to complex nested-stack architectures
Use it when writing or reviewing raw CloudFormation templates, designing nested stack architectures, or debugging stack failures and drift.
Avoid it when the team uses CDK or Terraform, or when the task is application code rather than infrastructure.
Security analysis
SafeThe skill is purely instructional and contains no executable commands, scripts, credential handling, network calls, or destructive operations. It references AWS CLI validation and linting tools as best practices, but does not instruct the agent to run them or modify infrastructure automatically.
No concerns found
How this analysis is madeExamples
Review this CloudFormation YAML template for production readiness: check DeletionPolicy on our RDS and S3 resources, flag hardcoded ARNs, and tell me where I should use !Sub instead of !Join.Our single CloudFormation template has 60 resources including VPC, ECS service, and RDS. Propose a nested stack or cross-stack export architecture and show the Outputs/Export wiring.My CloudFormation stack is stuck in UPDATE_ROLLBACK_FAILED after an RDS update. Walk me through continue-update-rollback with --resources-to-skip and how to fix the root cause.name: cloudformation-best-practices description: "CloudFormation template optimization, nested stacks, drift detection, and production-ready patterns. Use when writing or reviewing CF templates." risk: unknown source: community date_added: "2026-02-27"
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
- Use YAML over JSON for readability.
- Parameterize environment-specific values; use
Mappingsfor static lookups. - Apply
DeletionPolicy: Retainon stateful resources (RDS, S3, DynamoDB). - Use
Conditionsto support multi-environment templates. - Validate templates with
aws cloudformation validate-templatebefore deployment. - Prefer
!Subover!Joinfor string interpolation.
Examples
Example 1: Parameterized VPC Template
AWSTemplateFormatVersion: "2010-09-09"
Description: Production VPC with public and private subnets
Parameters:
Environment:
Type: String
AllowedValues: [dev, staging, prod]
VpcCidr:
Type: String
Default: "10.0.0.0/16"
Conditions:
IsProd: !Equals [!Ref Environment, prod]
Resources:
VPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: !Ref VpcCidr
EnableDnsSupport: true
EnableDnsHostnames: true
Tags:
- Key: Name
Value: !Sub "${Environment}-vpc"
Outputs:
VpcId:
Value: !Ref VPC
Export:
Name: !Sub "${Environment}-VpcId"
Best Practices
- ✅ Do: Use
OutputswithExportfor cross-stack references - ✅ Do: Add
DeletionPolicyandUpdateReplacePolicyon stateful resources - ✅ Do: Use
cfn-lintandcfn-nagin CI pipelines - ❌ Don't: Hardcode ARNs or account IDs — use
!Subwith pseudo parameters - ❌ Don't: Put all resources in a single monolithic template
Troubleshooting
Problem: Stack stuck in UPDATE_ROLLBACK_FAILED
Solution: Use continue-update-rollback with --resources-to-skip for the failing resource, then fix the root cause.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/cloudformation-best-practices-mrx3xymc/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/cloudformation-best-practices-mrx3xymc' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/cloudformation-best-practices-mrx3xymc/download' --output '.skill-downloads/cloudformation-best-practices-mrx3xymc/SKILL.md.part' && mv '.skill-downloads/cloudformation-best-practices-mrx3xymc/SKILL.md.part' '.skill-downloads/cloudformation-best-practices-mrx3xymc/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/cloudformation-best-practices-mrx3xymc/SKILL.md' && test -s '.skill-downloads/cloudformation-best-practices-mrx3xymc/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/cloudformation-best-practices' && cp -R '.skill-downloads/cloudformation-best-practices-mrx3xymc' '.claude/skills/cloudformation-best-practices'Cursor
test -f '.skill-downloads/cloudformation-best-practices-mrx3xymc/SKILL.md' && test -s '.skill-downloads/cloudformation-best-practices-mrx3xymc/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/cloudformation-best-practices' && cp -R '.skill-downloads/cloudformation-best-practices-mrx3xymc' '.cursor/skills/cloudformation-best-practices'Codex
test -f '.skill-downloads/cloudformation-best-practices-mrx3xymc/SKILL.md' && test -s '.skill-downloads/cloudformation-best-practices-mrx3xymc/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/cloudformation-best-practices' && cp -R '.skill-downloads/cloudformation-best-practices-mrx3xymc' '.agents/skills/cloudformation-best-practices'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/cloudformation-best-practices-mrx3xymc'openskills read 'cloudformation-best-practices-mrx3xymc'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/cloudformation-best-practices-mrx3xymc/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
Configure a Chat Channel with SecretRefs
DevOps
Set up chat channels using non-interactive commands, with secrets only as SecretRefs. Covers gather, mutate, repair, and prove steps for reliable delivery.
Investigate ClickHouse CI Failures
DevOps
Investigate a ClickHouse CI failure end-to-end from a PR or S3 report URL. Fetches failed tests, classifies flaky vs real regression, and checks for existing issues/fixes.
Ansible PR Review
DevOps
Reviews an Ansible PR following the project's standardized process, including changelog checks, test coverage validation, and feedback tracking.