5-layer AI-powered infrastructure system โ CLAUDE.md ยท Skills ยท Subagents ยท MCP ยท Safety Hooks
Overview
A fully automated, safety-guarded, auditable DevOps pipeline using Claude Code as an AI copilot. The system deploys a static portfolio website to AWS S3 with CloudFront CDN โ but what makes it remarkable is not the destination, it is the five-layer agentic architecture that makes every action consistent, safe, and auditable.
Lessons Learned
Claude Code generated 400+ lines of Terraform in minutes. But when something unexpected happened, I had to understand and respond. The engineers who win with AI are the ones who understand what it is doing, not just that it is doing it.
The subagent found my tfstate file with live AWS credentials before I pushed to GitHub. This is not a theoretical risk โ bots actively scan public repositories for exposed credentials within minutes of a push. The audit-fix-verify loop is non-negotiable.
For DevOps, the difference between what was true (training data) and what is true (MCP live data) is the difference between working Terraform and a deployment that fails on the first plan.