claude-skills/

Anthropic公式スキル・プラグインの日本語ディレクトリ

last sync 22h ago
スキルOfficialdevelopment

🏗️iac-scaffold

プラグイン
aws-dev-toolkit
引数
<framework> <project-description>

説明

次のような場合に使用: 新しい IaC プロジェクトの作成、新規スタック/モジュールの追加、 または AWS インフラ向けデプロイメントパイプラインのセットアップ。 CDK、Terraform、SAM、または CloudFormation を使用して、 AWS の Infrastructure as Code プロジェクトの雛形を生成します。

原文を表示

Scaffold new AWS infrastructure-as-code projects using CDK, Terraform, SAM, or CloudFormation. Use when creating new IaC projects, adding new stacks/modules, or setting up deployment pipelines for AWS infrastructure.

ユースケース

  • 新しいIaCプロジェクトを作成するとき
  • 新規スタック/モジュールを追加するとき
  • AWSインフラ向けデプロイメントパイプラインをセットアップするとき

本文(日本語訳)

新しい AWS IaC プロジェクトのスキャフォールドを生成します。

フレームワーク: $ARGUMENTS[0](cdk / terraform / sam / cfn) 説明: $ARGUMENTS[1]

処理フロー

  1. フレームワークや説明が不明確な場合は、確認事項を質問する
  2. aws-iac MCP ツールを使用して、リソース設定のバリデーションおよびセキュリティ問題のチェックを行う
  3. awsknowledge MCP ツール(mcp__plugin_aws-dev-toolkit_awsknowledge__aws___search_documentationmcp__plugin_aws-dev-toolkit_awsknowledge__aws___read_documentationmcp__plugin_aws-dev-toolkit_awsknowledge__aws___recommend)を使用して、選択したフレームワークの最新ベストプラクティスを調査する
  4. templates/ 内のパターンに従ってプロジェクト構造を生成する

フレームワーク別ガイダンス

CDK(デフォルト: TypeScript)

  • cdk init app --language typescript パターンを使用する
  • スタックはライフサイクル単位で分割する(ネットワーキング・データ・コンピューティング)
  • コンプライアンスチェックには cdk-nag を使用する
  • クロススタック参照には Outputs を活用する

Terraform

  • サービスごとにモジュールを分割する構成にする
  • リモートステートは S3 に保存し、DynamoDB でロック管理する
  • 既存モジュールがある場合は terraform-aws-modules を使用する
  • 環境ごとに tfvars ファイルを分ける

SAM

  • template.yaml はルートディレクトリに配置する
  • Lambda の共通設定は Globals セクションにまとめる
  • 高速な反復開発には SAM Accelerate を使用する

CloudFormation

  • 再利用性のためにネストされたスタックを活用する
  • ガードレールとして AllowedValues 付きの Parameters を定義する
  • マルチ環境テンプレートには Conditions を使用する

注意事項

  • フレームワークに適した .gitignore を必ず含めること
  • CDK: シークレット情報を context に記載しないこと — SSM Parameter Store または Secrets Manager を使用すること
  • Terraform: .tfstate は絶対にコミットしないこと — 先にリモートバックエンドを設定すること
  • SAM: sam local には Docker が必要 — README にその旨を明記すること
  • 全フレームワーク共通: 最低限 EnvironmentProjectOwner のタグをすべてのリソースに付与すること
  • よく使うコマンド(deploy / destroy / diff / synth)をまとめた Makefile または justfile を含めること

出力内容

以下を含む完全なプロジェクト構造を生成します:

  1. エントリーポイント / メイン設定ファイル
  2. リソースの実装例(最低1つ)
  3. 環境別設定ファイル
  4. セットアップ手順を記載した README
  5. CI/CD パイプライン設定(デフォルトは GitHub Actions。異なる場合は確認する)
原文(English)を表示

Scaffold a new AWS IaC project.

Framework: $ARGUMENTS[0] (cdk, terraform, sam, or cfn) Description: $ARGUMENTS[1]

Process

  1. Ask clarifying questions if the framework or description is unclear
  2. Use the aws-iac MCP tools to validate resource configurations and check for security issues
  3. Use the awsknowledge MCP tools (mcp__plugin_aws-dev-toolkit_awsknowledge__aws___search_documentation, mcp__plugin_aws-dev-toolkit_awsknowledge__aws___read_documentation, mcp__plugin_aws-dev-toolkit_awsknowledge__aws___recommend) to look up current best practices for the chosen framework
  4. Generate the project structure following the patterns in templates/

Framework-Specific Guidance

CDK (TypeScript default)

  • Use cdk init app --language typescript patterns
  • Separate stacks by lifecycle (networking, data, compute)
  • Use cdk-nag for compliance checks
  • Outputs for cross-stack references

Terraform

  • Module-per-service structure
  • Remote state in S3 + DynamoDB locking
  • Use terraform-aws-modules where they exist
  • Separate tfvars per environment

SAM

  • template.yaml at root
  • Globals section for shared Lambda config
  • Use SAM Accelerate for fast iteration

CloudFormation

  • Nested stacks for reuse
  • Parameters with AllowedValues for guardrails
  • Conditions for multi-environment templates

Gotchas

  • Always include a .gitignore appropriate for the framework
  • CDK: don't put secrets in context — use SSM Parameter Store or Secrets Manager
  • Terraform: never commit .tfstate — configure remote backend first
  • SAM: sam local needs Docker — mention this in the README
  • All frameworks: tag everything with at minimum Environment, Project, Owner
  • Include a Makefile or justfile with common commands (deploy, destroy, diff, synth)

Output

Generate the complete project structure with:

  1. Entry point / main config file
  2. At least one example resource
  3. Environment-specific configuration
  4. README with setup instructions
  5. CI/CD pipeline config (GitHub Actions default, ask if different)

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。