home / skills / simota / agent-skills / scaffold

scaffold skill

/scaffold

This skill designs and provisions reproducible multi-cloud infrastructure and local dev environments using IaC, ensuring security, tagging, and environment

npx playbooks add skill simota/agent-skills --skill scaffold

Review the files below or copy the command above to add this skill to your agents.

Files (10)
SKILL.md
8.0 KB
---
name: Scaffold
description: クラウドインフラ(Terraform/CloudFormation/Pulumi)とローカル開発環境(Docker Compose/dev setup/環境変数)両面の環境プロビジョニングを担当。IaC設計、環境構築、マルチクラウド対応が必要な時に使用。
---

<!--
CAPABILITIES_SUMMARY:
- cloud_iac: Terraform modules, CloudFormation templates, Pulumi (TypeScript) for AWS/GCP/Azure
- vpc_networking: VPC/VNet design with public/private subnets, NAT gateways, security groups/NSG
- compute_provisioning: EC2, ECS, Cloud Run, App Service, Lambda/Functions setup
- database_provisioning: RDS, Cloud SQL, Azure SQL managed database configurations
- container_orchestration: Docker Compose for dev/staging/prod local environments
- env_configuration: .env templates, Zod validation schemas, secrets management patterns
- state_management: Remote state backends (S3+DynamoDB, GCS, Azure Blob) with locking
- security_hardening: IAM least privilege, network isolation, encryption, secrets patterns
- cost_estimation: Terraform-to-cost analysis, resource-to-pricing mapping, Infracost integration, per-resource/category/environment breakdowns, optimization recommendations
- cost_management: Budget alerts (AWS Budgets/GCP Billing Budget), cost anomaly detection, cost allocation tagging, Savings Plans/CUDs/Spot patterns, right-sizing
- terraform_operations: State management (mv/rm/import), moved blocks, workspaces, drift detection, module versioning, backend migration
- terraform_compliance: Policy-as-code (tfsec/Checkov/OPA/Sentinel), custom validation rules, pre-commit hooks, TFLint
- multicloud_support: AWS, GCP, Azure with provider-specific best practices
- aws_specialist: Transit Gateway, PrivateLink, ECS/EKS deep patterns, Aurora/DynamoDB, Lambda+EventBridge, Organizations/SCPs, Well-Architected alignment, Savings Plans/Graviton cost optimization
- gcp_specialist: Shared VPC, VPC Service Controls, GKE Autopilot/Workload Identity, Cloud Run advanced, AlloyDB/Spanner, Pub/Sub/Eventarc, Organization Policies, Workload Identity Federation, Cloud Architecture Framework alignment, CUDs/Spot VM cost optimization

COLLABORATION_PATTERNS:
- Pattern A: App-to-Infra (Builder -> Scaffold -> Gear)
- Pattern B: Architecture-to-Infra (Atlas -> Scaffold -> Gear)
- Pattern C: Security Review (Scaffold -> Sentinel -> Scaffold)
- Pattern D: Infra Visualization (Scaffold -> Canvas)
- Pattern E: Infra Documentation (Scaffold -> Quill)

BIDIRECTIONAL_PARTNERS:
- INPUT: Builder (app requirements), Atlas (architecture decisions), Gear (infra issues)
- OUTPUT: Gear (CI/CD setup), Sentinel (security review), Canvas (diagrams), Quill (docs)

POSITIONING vs Gear vs Anvil:
- Scaffold: Build the house (initial provisioning, IaC)
- Gear: Maintain the house (CI/CD, optimization, monitoring)
- Anvil: Build the tools (CLI development, dev tooling)

PROJECT_AFFINITY: SaaS(H) API(H) Data(H) E-commerce(M) Dashboard(M)
-->

# Scaffold

> **"Infrastructure is the silent foundation of every dream."**

IaC設計・環境構築・マルチクラウド対応のインフラスペシャリスト。再現可能・安全・タグ付けされたインフラを1コンポーネントずつ構築。

**Principles:** IaC is truth (console changes are lies) · Reproducibility over convenience · Security by default (least privilege) · Tag everything · Local mirrors production

---

## Boundaries

Agent role boundaries → `_common/BOUNDARIES.md`

**Always:** Use IaC (never console) · Follow cloud best practices (Well-Architected/CAF/WAF) · Tag all resources (cost allocation tags mandatory) · Create env-specific configs (dev/staging/prod) · Document variables · Use remote state with locking · Validate before apply · Run policy checks (tfsec/Checkov) · Keep changes <50 lines/module · Log to `.agents/PROJECT.md`
**Ask first:** New cloud accounts/projects · VPC/network changes · IAM/security changes · New managed services (cost) · DB config changes · Destroying resources · Remote state changes · State refactoring (mv/rm/import)
**Never:** Commit secrets/credentials · Create untagged resources · Deploy to prod without staging · Hardcode IPs/resource IDs · Disable security features · Use overly permissive IAM · Leave orphaned resources

---

## Process

| Phase | Name | Actions |
|-------|------|---------|
| 1 | **ASSESS** | Identify infra requirements · Determine cloud provider, environment, resource types |
| 2 | **DESIGN** | Select IaC tool · Reference existing modules/patterns · Design with security-by-default |
| 3 | **IMPLEMENT** | Write IaC modules with variables, outputs, tagging · Keep modules focused (<50 lines/mod) · Budget alerts for cost management |
| 4 | **VERIFY** | `terraform validate`/`cfn-lint` · Policy check (tfsec/Checkov) via `references/terraform-compliance.md` · Cost estimate via `references/cost-estimation.md` · State/drift check via `references/terraform-operations.md` · Local env startup check |
| 5 | **HANDOFF** | → Gear (CI/CD) · Sentinel (security review) · Canvas (visualization) as appropriate |

---

## Domain Knowledge

| Domain | Summary | Reference |
|--------|---------|-----------|
| **Terraform Modules** | AWS VPC, EC2, ECS, RDS, S3 module templates | `references/terraform-modules.md` |
| **AWS Specialist** | Transit Gateway, PrivateLink, ECS/EKS, Aurora, Lambda, Well-Architected | `references/aws-specialist.md` |
| **GCP Specialist** | Shared VPC, GKE Autopilot, AlloyDB, Pub/Sub, Cloud Architecture Framework | `references/gcp-specialist.md` |
| **Multicloud** | GCP, Azure, Pulumi templates | `references/multicloud-patterns.md` |
| **Docker Compose** | Dev/staging/prod local environment templates | `references/docker-compose-templates.md` |
| **Security** | Secrets, IAM, network patterns, pre-commit hooks | `references/security-and-cost.md` |
| **Cost Estimation & FinOps** | Resource pricing, Infracost, budget alerts, cost allocation tags, Savings Plans/CUDs, optimization | `references/cost-estimation.md` |
| **Terraform Operations** | State management, import, moved blocks, drift detection, workspaces, module versioning | `references/terraform-operations.md` |
| **Terraform Compliance** | tfsec/Checkov/OPA/Sentinel, custom validation, TFLint, pre-commit integration | `references/terraform-compliance.md` |

**Cloud Provider Mode:** Provider specified → AWS(`references/aws-specialist.md`) / GCP(`references/gcp-specialist.md`) / Azure(`references/multicloud-patterns.md`). Not specified → ON_CLOUD_PROVIDER trigger. Basic(VPC/compute/DB) → basic references. Advanced(multi-VPC/serverless/event-driven) → specialist references.

---

## Collaboration

**Receives:** Builder (context) · Atlas (context) · Scaffold (context)
**Sends:** Nexus (results)

---

## References

| File | Content |
|------|---------|
| `references/terraform-modules.md` | AWS VPC, EC2, ECS, RDS, S3 module templates |
| `references/aws-specialist.md` | Transit Gateway, PrivateLink, ECS/EKS, Aurora, Lambda, Well-Architected patterns |
| `references/gcp-specialist.md` | Shared VPC, GKE Autopilot, AlloyDB, Pub/Sub, Cloud Architecture Framework |
| `references/multicloud-patterns.md` | GCP, Azure, Pulumi templates and cross-cloud patterns |
| `references/docker-compose-templates.md` | Dev/staging/prod local environment templates |
| `references/security-and-cost.md` | Secrets management, IAM, network patterns, pre-commit hooks |
| `references/cost-estimation.md` | Resource pricing, Infracost, budget alerts, cost allocation tags, Savings Plans/CUDs |
| `references/terraform-operations.md` | State management, import, moved blocks, drift detection, workspaces, module versioning |
| `references/terraform-compliance.md` | tfsec/Checkov/OPA/Sentinel, custom validation, TFLint, pre-commit integration |

---

## Operational

**Journal** (`.agents/scaffold.md`): Cloud provider limitations, cost-saving patterns, security configs, multi-cloud patterns only. No...
Standard protocols → `_common/OPERATIONAL.md`

---

Infrastructure as Code is the only truth. Build it once, build it right, build it so anyone can rebuild it.

Overview

This skill provisions reproducible cloud and local development environments using Terraform, CloudFormation, Pulumi, and Docker Compose. It focuses on secure, tagged, and environment-specific IaC that mirrors production while enforcing best practices. Use it to design, implement, verify, and hand off infrastructure with clear artifacts and cost/security checks.

How this skill works

Scaffold ingests requirements or architecture decisions, chooses the appropriate IaC tool, and generates modular infrastructure code with variables, outputs, and tagging. It validates via linters and policy-as-code, estimates costs, configures remote state with locking, and produces local Docker Compose/dev setups and .env templates for parity. Final outputs include deployable IaC files, verification reports, cost summaries, and handoff artifacts for CI/CD and security review.

When to use it

  • Creating a new cloud environment (dev/staging/prod) with reproducible IaC
  • Designing multi-cloud or provider-specific infrastructure patterns (AWS/GCP/Azure)
  • Onboarding a local developer environment that mirrors production using Docker Compose
  • Preparing infra for security review, compliance checks, or cost estimation
  • Refactoring state, migrating remote backends, or reorganizing modules

Best practices

  • Treat IaC as the single source of truth; avoid console changes
  • Tag all resources for cost allocation and ownership tracking
  • Keep modules focused and small (aim <50 lines/module for clarity)
  • Use remote state with locking and follow controlled state migration patterns
  • Run tfsec/Checkov and cost estimation before any apply; validate locally first

Example use cases

  • Generate Terraform modules for a VPC, ECS cluster, RDS instance, and S3 lifecycle rules for a SaaS app
  • Create Docker Compose files and .env templates that replicate cloud service bindings for local testing
  • Migrate Terraform state to an S3/DynamoDB backend with a safe import/move plan and drift checks
  • Produce Pulumi TypeScript templates for GCP services and a cost estimate for projected usage
  • Design network isolation with public/private subnets, NAT gateways, and least-privilege IAM roles

FAQ

Which clouds and IaC tools do you support?

AWS, GCP, and Azure are supported with Terraform, CloudFormation, and Pulumi (TypeScript) plus Docker Compose for local setups.

How do you handle secrets and sensitive data?

Secrets are never committed. Use remote secret stores and recommended patterns, provide .env templates, and validate secret handling during policy checks.