AGENT SKILL

cicd-infra-init

Scaffold IaC directory with tiered structure (foundation/platform/app)

License 许可
MIT
所属仓库
cooneycw/skillc
最近更新
2026-11-15
Stars
★ 0
Forks
0

01 前言 Front Matter

name
cicd-infra-init
description
Scaffold IaC directory with tiered structure (foundation/platform/app)

03 SKILL.md 正文

<!-- GENERATED by claude-power-pack - scripts/codex-skill-sync.py; edit .claude/commands/cicd/infra-init.md instead -->

Codex harness adaptations

Generated from a Claude Code command. Where the procedure references these Claude-only surfaces, adapt as follows:

  • CLAUDE.md references: read AGENTS.md first - it is the Codex entry point. Where it defers to CLAUDE.md, follow that pointer and CLAUDE.md is the rules; where it does not, AGENTS.md is. Where the repository has no AGENTS.md, read CLAUDE.md.

/cicd-infra-init - Scaffold Infrastructure as Code

Generate a tiered IaC directory structure for your project.

Step 1: Locate CPP Source

CPP_DIR=""
for dir in ~/Projects/claude-power-pack /opt/claude-power-pack ~/.claude-power-pack; do
  if [ -d "$dir" ] && [ -f "$dir/CLAUDE.md" ]; then
    CPP_DIR="$dir"
    break
  fi
done

if [ -z "$CPP_DIR" ]; then
  echo "ERROR: claude-power-pack not found"
  exit 1
fi

Instructions

  1. Check for existing IaC by running detection:
PYTHONPATH="$CPP_DIR:$PYTHONPATH" uv run --project "$CPP_DIR" python -m lib.cicd infra-init --path "$(pwd)" --json
  1. If no .claude/cicd.yml exists, ask the user for:

    • IaC provider: terraform (default), pulumi, or bicep
    • Cloud provider: aws (default), azure, or gcp
    • Remote state backend type (s3, azure-storage, gcs)
    • Tagging conventions (managed-by, repo, owner)
  2. If .claude/cicd.yml exists with an infrastructure section, use those settings.

  3. Generate the scaffold:

PYTHONPATH="$CPP_DIR:$PYTHONPATH" uv run --project "$CPP_DIR" python -m lib.cicd infra-init --path "$(pwd)" --write
  1. Report what was created and suggest next steps.

Three-Tier Model

  • foundation/ - Run once, touch rarely. DNS zones, resource groups, networking, identity. Manual approval gates.
  • platform/ - Shared services. Container registries, key vaults, shared databases. Less frequent deploys.
  • app/ - Application-specific infrastructure. Deployed with application CI/CD.

Configuration

Add to .claude/cicd.yml:

infrastructure:
  provider: terraform
  cloud: aws
  state_backend:
    type: s3
    bucket: my-tf-state
    lock: true
  tagging:
    managed-by: terraform
    repo: my-project
    owner: platform-team
  tiers:
    foundation:
      approval_required: true
      separate_credentials: true
    platform:
      approval_required: false
    app:
      approval_required: false

Related

  • /cicd-infra-discover - Audit existing cloud resources
  • /cicd-infra-pipeline - Generate CI/CD pipelines with approval gates

04 同仓库更多 Skills