repository-and-state-strategy

Creates Terraform repository layouts with numbered layers and isolated state files per environment.

28|3|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/oborchers/fractional-cto --skill repository-and-state-strategy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: repository-and-state-strategy
Source: https://github.com/oborchers/fractional-cto/tree/main/cloud-foundation-principles/skills/repository-and-state-strategy
Command: npx skills add https://github.com/oborchers/fractional-cto --skill repository-and-state-strategy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity and risk associated with managing cloud infrastructure using Terraform, particularly concerning state management and repository organization, to prevent costly errors and enable scalable deployments.

Core Features & Use Cases

  • Repository Strategy: Guides decisions between mono-repo and multi-repo approaches based on change cadence and ownership.
  • Layered Architecture: Implements a numbered layer system (00-90) within repositories to define explicit dependency order.
  • State Management: Enforces a strict "one state file per layer per environment" rule for isolation and blast radius containment.
  • Cross-Layer Dependencies: Demonstrates how to safely reference outputs from lower layers using terraform_remote_state.
  • Use Case: When setting up a new cloud environment, this Skill helps define a robust Terraform structure that minimizes the risk of accidental data loss or service disruption during deployments.

Quick Start

Use the repository-and-state-strategy skill to define a multi-repository structure with numbered layers for a new AWS environment.

Frequently Asked Questions about repository-and-state-strategy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What's the best way to structure Terraform repositories for cloud infrastructure?

The best way to structure Terraform repositories is to choose between mono-repo and multi-repo approaches based on change cadence and ownership, implementing numbered layers to define explicit dependency order for scalable deployments.

How do I isolate Terraform state files to prevent blast radius damage?

To isolate Terraform state files and prevent blast radius damage, enforce a strict rule of one state file per layer per environment, ensuring safety and maintainability across your cloud infrastructure deployments.

How do I safely reference outputs from lower Terraform layers across environments?

To safely reference outputs from lower Terraform layers across environments, use the terraform_remote_state data source, which allows secure cross-layer dependencies without exposing the entire infrastructure state.

When should I use a multi-repo strategy versus a mono-repo for Terraform?

You should use a multi-repo strategy for Terraform when you need independent CI/CD pipelines and blast radius containment, whereas a mono-repo suits environments with high change cadence and unified ownership.

What is a numbered layer architecture in Terraform and why is it needed?

A numbered layer architecture in Terraform is a system ranging from 00 to 90 that defines explicit dependency order within repositories, needed to ensure safe and scalable cloud infrastructure deployments.

Does structuring Terraform with separate state files per layer work for new cloud environments?

Structuring Terraform with separate state files per layer works effectively for new cloud environments by minimizing the risk of accidental data loss or service disruption during deployments through strict isolation.