home / skills / htooayelwinict / claude-config / devops-infrastructure

devops-infrastructure skill

/skills/devops-infrastructure

This skill streamlines deployment orchestration and security hardening across Docker, CI/CD, and infra components with safe rollback and verification.

npx playbooks add skill htooayelwinict/claude-config --skill devops-infrastructure

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.5 KB
---
name: devops-infrastructure
description: Manage deployment, Docker, CI/CD, server hardening, and infrastructure security. EXCLUSIVE to devops-engineer agent.
allowed-tools: Read, Edit, Bash, Grep, Glob, Write, mcp_context7
---
# DevOps Infrastructure

**Exclusive to:** `devops-engineer` agent

## 📚 Context7 (Memory) — Up-to-Date Docs

Lookup latest deployment patterns and configs:
```
mcp_context7_resolve-library-id(libraryName="docker", query="multi-stage build")
mcp_context7_query-docs(libraryId="/docker/docs", query="compose healthcheck")
```

## Instructions

1. Review existing infrastructure files (Dockerfile, docker-compose, .github/workflows)
2. Understand deployment requirements
3. Propose configuration with rollback plan
4. Implement with safety checks
5. Verify deployment succeeds

## Docker Patterns

### Multi-stage Build
```dockerfile
FROM composer:2 AS vendor
# Install dependencies

FROM node:20-alpine AS assets
# Build frontend

FROM php:8.3-fpm-alpine
# Final production image
```

### Docker Compose
```yaml
services:
  app:
    build: .
  db:
    image: mysql:8.0
  redis:
    image: redis:alpine
```

## CI/CD Workflow

```yaml
name: CI
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: composer test
```

## Deployment Checklist
- [ ] Tests pass
- [ ] Environment variables set
- [ ] Database migrations ready
- [ ] Backup exists
- [ ] SSL configured

## Examples
- "Create Dockerfile for Laravel"
- "Set up GitHub Actions pipeline"
- "Configure production environment"

Overview

This skill manages deployment, Docker, CI/CD, server hardening, and infrastructure security for production systems. It provides actionable configuration proposals, rollback plans, and safe implementation steps tailored to application requirements. The skill is exclusive to the devops-engineer agent and focuses on repeatable, auditable infrastructure changes. Outputs are pragmatic: Dockerfiles, compose configs, CI workflows, deployment checklists, and verification steps.

How this skill works

I inspect existing infrastructure artifacts such as Dockerfiles, docker-compose, and CI workflow manifests to identify gaps and optimization opportunities. I propose multi-stage builds, hardened base images, CI pipelines with test gates, and deployment plans that include backups and rollback strategies. Implementations include safety checks (healthchecks, readiness probes, feature flags) and verification steps to confirm successful rollouts. I produce concise, copy-paste-ready configuration snippets and a step-by-step deployment checklist.

When to use it

  • When creating or optimizing Docker images for production (multi-stage builds, smaller runtime images).
  • When adding or improving CI/CD pipelines to enforce tests and automate deployments.
  • When preparing a deployment that requires backups, migrations, and a rollback plan.
  • When hardening servers or container images for security and compliance.
  • When validating deployment readiness with automated health checks and verification steps.

Best practices

  • Use multi-stage builds to separate dependency installation, asset compilation, and final runtime image.
  • Enforce CI gates: run tests, linting, and security scans before deployment.
  • Include automated healthchecks and readiness probes in compose or orchestration configs.
  • Define an explicit rollback plan and create backups/migrations checkpoints before applying changes.
  • Minimize privileges in runtime images and apply OS-level hardening (up-to-date packages, non-root user).

Example use cases

  • Create a multi-stage Dockerfile for a PHP + Node frontend that produces a small production image.
  • Add GitHub Actions workflow to run tests, build images, and push to a container registry on merge.
  • Propose a zero-downtime deployment plan with database migration strategy and rollback steps.
  • Harden container images by switching to Alpine, removing build tools, and enforcing non-root execution.
  • Write docker-compose with healthchecks and environment variable validation for local staging.

FAQ

How do you ensure deployments are safe?

I require tests to pass, backups to exist, and explicit rollback steps; I add healthchecks and run post-deploy verifications before marking a release as successful.

Do you handle secrets and environment variables?

Yes — I recommend secure secret stores or ephemeral CI secrets, validate env var presence, and avoid committing secrets to version control.