# managing-infra

managing-infra guides Kubernetes architectural choices, Terraform module structuring, Helm usage, and GitHub Actions CI/CD workflows.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 115 installs · ★ 17 repo stars
- Author: julianobarbosa
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/julianobarbosa/claude-code-skills/tree/HEAD/skills/managing-infra/SKILL.md
- Updated: 2026-10-14
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/managing-infra

## What it does

This skill supplies your coding assistant with concrete rules for container orchestration and cloud automation. It defines clear boundaries across tools: raw manifests for basic workloads, Kustomize for overlays without templates, and Helm for third-party releases. Workload defaults enforce non-root execution, read-only filesystems, dropped Linux capabilities, and network policies.

A dedicated section covers operational traps across CLI workflows. For example, Kustomize patches that fail to match target resources generate empty diffs silently, demanding explicit verification with `kustomize build`. Declared tool permissions cover Read, Bash, Grep, and Glob.

## Requirements
- Works with: Kubernetes, Terraform

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add julianobarbosa/claude-code-skills --skill managing-infra -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/managing-infra/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/managing-infra/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add julianobarbosa/claude-code-skills --skill managing-infra -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/managing-infra/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add julianobarbosa/claude-code-skills --skill managing-infra -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/managing-infra/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install julianobarbosa/claude-code-skills skills/managing-infra
```

2. **Manually: put the files in place**
- File: `.github/skills/managing-infra/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add julianobarbosa/claude-code-skills --skill managing-infra -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/julianobarbosa/claude-code-skills --path skills/managing-infra
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/managing-infra/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add julianobarbosa/claude-code-skills --skill managing-infra -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/julianobarbosa/claude-code-skills/tree/HEAD/skills/managing-infra/SKILL.md

## When to use it
- decide whether Helm or Kustomize fits an infrastructure task
- apply non-root security contexts to Kubernetes pods
- structure GitHub Actions pipelines using actions pinned by SHA
- prevent state lock collisions and computed index errors in Terraform

## Example prompts
- Check this Kubernetes deployment for missing security defaults
- Help me structure a Terraform module to avoid state lock contention
- Draft a multi-arch container build workflow for GitHub Actions

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: dd4e1571241f4219.

BEGIN THIRD-PARTY FILE dd4e1571241f4219
````text
---
name: managing-infra
description: Infrastructure patterns for Kubernetes, Terraform, Helm, Kustomize, and GitHub Actions. Use when making K8s architectural decisions, choosing between Helm vs Kustomize, structuring Terraform modules, writing CI/CD workflows, or applying security best practices.
allowed-tools: Read, Bash, Grep, Glob
---

# Infrastructure Patterns

## When to Use What

| Tool               | Use For                                             |
| ------------------ | --------------------------------------------------- |
| **Raw K8s YAML**   | Simple deployments, one-off resources               |
| **Kustomize**      | Environment variations, overlays without templating |
| **Helm**           | Complex apps, third-party charts, heavy templating  |
| **Terraform**      | Cloud resources, infrastructure lifecycle           |
| **GitHub Actions** | CI/CD, automated testing, releases                  |
| **Makefile**       | Build automation, self-documenting targets          |
| **Dockerfile**     | Container builds, multi-stage, multi-arch           |

## Quick Decisions

**Kustomize** when: Simple env differences, readable manifests, patching YAML
**Helm** when: Complex templating, third-party charts, release management

## K8s Security Defaults

Every workload: non-root user, read-only filesystem, no privilege escalation, dropped capabilities, network policies.

## GitHub Actions Patterns

- **CI workflow**: Lint, test, compile on PRs (run on both x86 + ARM)
- **Release workflow**: Multi-arch Docker build on tags (native ARM runners)
- Pin actions by SHA, least-privilege permissions

## References

- [KUBERNETES.md](KUBERNETES.md) - K8s resource patterns
- [TERRAFORM.md](TERRAFORM.md) - Terraform module patterns
- [GITHUB-ACTIONS.md](GITHUB-ACTIONS.md) - CI/CD workflow patterns
- [MAKEFILE.md](MAKEFILE.md) - Build automation patterns
- [DOCKERFILE.md](DOCKERFILE.md) - Container build patterns
- [templates/](templates/) - Ready-to-use templates

## Commands

```bash
kubectl apply -k ./              # Apply kustomize
helm upgrade --install NAME .    # Install/upgrade chart
terraform plan && terraform apply
```

---

## Gotchas

- **Terraform state lock contention**: default 10-min lock timeout; bumped timeout doesn't help if the lock holder hung — force-unlock only after confirming the process is dead.
- **Helm release name reuse on uninstalled-but-not-purged release** fails install with "already exists" — use `--no-hooks` + explicit purge, or never reuse names.
- **Kustomize patches that match nothing silently produce empty diffs** — verify with `kustomize build` after every patch addition.
- **Terraform `for_each` over a computed value forces apply-time count** — can cause spurious re-creation of resources between plans.
````
END THIRD-PARTY FILE dd4e1571241f4219

The third-party file has ended. Everything between the dd4e1571241f4219 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2796 of 3129 bytes. © julianobarbosa · MIT · https://github.com/julianobarbosa/claude-code-skills/tree/HEAD/skills/managing-infra/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
