dot_claude/skills/devops-infrastructure/SKILL.md
Use when provisioning infrastructure, building containers, configuring CI/CD, or deploying services - ensures all infrastructure is codified, versioned, and reviewable with repeatable deployment strategies and proper secrets management | インフラのプロビジョニング、コンテナのビルド、CI/CDの構成、サービスのデプロイ時に使用 - すべてのインフラがコード化、バージョン管理、レビュー可能であることを保証し、再現可能なデプロイ戦略と適切なシークレット管理を実現
npx skillsauth add lv416e/dotfiles devops-infrastructureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Manual infrastructure changes are incidents waiting to happen. Unversioned configs are undocumented debt.
Core principle: EVERY piece of infrastructure is defined in code, stored in version control, and deployed through automation.
Violating the letter of this process is violating the spirit of infrastructure engineering.
NO MANUAL INFRASTRUCTURE CHANGES - EVERYTHING IS CODE, VERSIONED, AND REVIEWABLE
If you clicked through a console UI to create it, it doesn't exist yet. Write the code.
Use for ANY infrastructure work:
Use this ESPECIALLY when:
Don't skip when:
You MUST complete each phase before proceeding to the next.
BEFORE creating ANY resource:
Choose Your IaC Tool
Structure Your Code
infrastructure/
├── modules/ # Reusable components
│ ├── networking/
│ ├── compute/
│ └── database/
├── environments/ # Per-environment configs
│ ├── dev/
│ ├── staging/
│ └── production/
├── variables.tf # Input definitions
└── outputs.tf # Exported values
State Management
Plan Before Apply
Every container image follows these rules:
Multi-Stage Builds
<Good> ```dockerfile FROM node:20-alpine AS builder WORKDIR /app COPY package*.json ./ RUN npm ci --production=false COPY . . RUN npm run buildFROM node:20-alpine AS runtime WORKDIR /app RUN addgroup -g 1001 appgroup && adduser -u 1001 -G appgroup -s /bin/sh -D appuser COPY --from=builder /app/dist ./dist COPY --from=builder /app/node_modules ./node_modules USER appuser EXPOSE 3000 CMD ["node", "dist/index.js"]
Small image, non-root user, only production artifacts
</Good>
<Bad>
```dockerfile
FROM node:20
WORKDIR /app
COPY . .
RUN npm install
CMD ["npm", "start"]
Bloated image, root user, dev dependencies included, source code exposed </Bad>
Minimal Base Images
latest)Security Scanning
Image Hygiene
.dockerignore for every projectMatch the workload to the right abstraction:
Deployments - Stateless services
StatefulSets - Databases, caches, queues
CronJobs - Scheduled tasks
Resource Definitions
<Good> ```yaml resources: requests: cpu: "100m" memory: "128Mi" limits: cpu: "500m" memory: "512Mi" ``` Explicit requests and limits </Good> <Bad> ```yaml # No resource limits defined - hope the node has enough ``` Unbounded resource usage, noisy neighbor problems </Bad>Every pipeline follows this structure:
Pipeline Stages
Lint → Test → Build → Scan → Deploy(staging) → Verify → Deploy(production)
Deployment Strategies
| Strategy | When | Risk | Rollback | |----------|------|------|----------| | Rolling | Default for most services | Medium | Automatic | | Blue-Green | Zero-downtime critical services | Low | Instant switch | | Canary | High-traffic, risk-sensitive | Lowest | Route back to stable |
Rollback Plan
Pipeline Security
Secrets:
Never in Code
Rotation
Monitoring and Alerting:
The Four Golden Signals
Alert Design
If you catch yourself thinking:
ALL of these mean: STOP. Follow the process.
| Excuse | Reality | |--------|---------| | "Console is faster for one resource" | One resource becomes twenty. Codify from the start. | | "We'll codify it later" | You won't. "Later" means "never" in infrastructure. | | "It's just a dev environment" | Dev environments are production templates. Treat them the same. | | "Hardcode the secret for now" | Secrets in code get committed, pushed, leaked. Use a vault. | | "We don't need monitoring yet" | You need monitoring BEFORE the first incident, not after. | | "Skip staging, it works on my machine" | Your machine is not production. Deploy to staging first. | | "Fix forward is our rollback" | Fix forward under pressure creates new incidents. Have a real rollback. | | "Resource limits slow us down" | Unbounded containers slow everyone down when they consume the node. | | "Manual change, just this once" | Snowflake servers start with "just this once." | | "One-time setup doesn't need code" | Nothing is one-time. You'll rebuild, migrate, or recover. |
| Anti-Pattern | Consequence | Correct Approach |
|-------------|-------------|-----------------|
| Snowflake servers | Unreproducible, undocumented, irreplaceable | Everything in IaC, immutable infrastructure |
| Secrets in code | Credential leaks, security incidents | Vault/env injection, runtime secrets |
| No rollback plan | Extended outages, panic-driven fixes | Automated rollback, backward-compatible migrations |
| Deploy without approval | Unreviewed changes in production | PR-based deployments, required approvals |
| No resource limits | Noisy neighbors, node exhaustion, cascading failures | Explicit requests and limits on every workload |
| latest tag | Unreproducible builds, surprise breaking changes | Pin exact versions, rebuild intentionally |
| Phase | Key Activities | Success Criteria | |-------|---------------|------------------| | 1. IaC | Define resources in code, remote state, plan before apply | All infrastructure in version control | | 2. Containers | Multi-stage builds, minimal images, security scanning | Small, secure, non-root images | | 3. Kubernetes | Right abstraction, resource limits, probes | Workloads are resilient and bounded | | 4. CI/CD | Pipeline stages, deployment strategy, rollback plan | Automated, gated, reversible deployments | | 5. Secrets/Monitoring | Vault injection, four golden signals, alert runbooks | No secrets in code, actionable alerts |
Before marking infrastructure work complete:
Can't check all boxes? You're not done.
This skill requires using:
Complementary skills:
If it's not in code, it doesn't exist.
If it's not in version control, it's not real.
If it can't be reviewed, it can't be trusted.
No exceptions without your human partner's explicit approval.
development
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment - applies TDD to process documentation by testing with subagents before writing, iterating until bulletproof against rationalization | 新しいスキルの作成、既存スキルの編集、またはデプロイ前にスキルが機能するか検証する際に使用 - プロセスドキュメントにTDDを適用し、記述前にサブエージェントでテストし、合理化に対して堅牢になるまで反復
development
Use when design is complete and you need detailed implementation tasks for engineers with zero codebase context - creates comprehensive implementation plans with exact file paths, complete code examples, and verification steps assuming engineer has minimal domain knowledge | 設計が完了し、コードベースの知識がゼロのエンジニア向けに詳細な実装タスクが必要な場合に使用 - 正確なファイルパス、完全なコード例、検証ステップを含む包括的な実装計画を作成。エンジニアの領域知識が最小限であることを前提
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.