AGENT SKILL

cicd-infra-discover

Generate cloud resource discovery script for IaC import

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

01 前言 Front Matter

name
cicd-infra-discover
description
Generate cloud resource discovery script for IaC import

03 SKILL.md 正文

<!-- GENERATED by claude-power-pack - scripts/codex-skill-sync.py; edit .claude/commands/cicd/infra-discover.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-discover - Cloud Resource Discovery

Generate a discovery script that audits existing cloud resources and outputs them in a format suitable for IaC import (terraform import, etc.).

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. Detect cloud provider from .claude/cicd.yml or ask the user (aws/azure/gcp).

  2. Generate the discovery script:

PYTHONPATH="$CPP_DIR:$PYTHONPATH" uv run --project "$CPP_DIR" python -m lib.cicd infra-discover --path "$(pwd)" --cloud aws --write
  1. Optionally run the script if the user has CLI tools configured:
bash infra/scripts/discover-aws.sh
  1. Report findings and suggest which resources to import first (most critical/fragile).

When to Use

  • Starting IaC from scratch ("no documentation exists yet")
  • Auditing what exists before codifying it
  • Building a manifest for terraform import

Key Principle

Even if you only plan to run infrastructure changes once, codify them. The value is having an executable runbook, not a stale wiki page.

Related

  • /cicd-infra-init - Scaffold IaC directory structure
  • /cicd-infra-pipeline - Generate CI/CD pipelines with approval gates

04 同仓库更多 Skills