cloudformation-best-practices – skill Viết lách & Nội dung cho agent AI
Tối ưu template CloudFormation, nested stack, phát hiện drift và các mẫu sẵn sàng cho production. Dùng khi viết hoặc rà soát template CF.
Cài skill cloudformation-best-practices bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/cloudformation-best-practices-fca82.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /cloudformation-best-practices – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/cloudformation-best-practices-fca82.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $cloudformation-best-practices – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/cloudformation-best-practices-fca82.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /cloudformation-best-practices – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/cloudformation-best-practices-fca82.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /cloudformation-best-practices – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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
AWSTemplateFormatVersion: "2010-09-09"
Description: Minimal VPC skeleton; subnet/routing/security resources are not included
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: 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.
- Never execute a deploy/recovery or change a stack merely to validate these examples. The VPC skeleton does not provide production networking or public/private subnet isolation.
- 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.
Skill liên quan
- pymc – Xây dựng và kiểm tra mô hình Bayes với PyMC, gồm mô hình phân cấp, NUTS MCMC, suy luận…
- jira-expert – Chuyên gia Atlassian Jira về tạo và quản lý dự án, lập kế hoạch, khám phá sản phẩm, truy…
- codebase-onboarding – Đưa lập trình viên mới vào repository bằng tóm tắt đồ thị Ontoly. Dùng khi được yêu cầu…
- competitor-summary-report-creator – Competitor Summary Report Creator. Dùng khi làm việc với tên hoặc URL đối thủ và bằng…
- linkedin-content – Dùng khi ai đó muốn viết, chỉnh sửa hoặc kiểm tra bài đăng LinkedIn — câu chuyện, hướng…
- linkedin-skills – Dùng khi ai đó muốn phát triển sự hiện diện hữu cơ trên LinkedIn — chiến lược nội dung…
- qiime2-amplicon – Xử lý các read amplicon 16S paired-end thành ASV và phân loại phân loại học bằng QIIME…
- linkedin-strategy – Dùng khi ai đó cần một kế hoạch LinkedIn thay vì một bài đăng: các trụ cột nội dung…