home / skills / levnikolaevich / claude-code-skills / ln-115-devops-docs-creator

ln-115-devops-docs-creator skill

/ln-115-devops-docs-creator

This skill helps teams auto-create a docker-focused runbook by extracting deployment data from the coordinator and templates.

npx playbooks add skill levnikolaevich/claude-code-skills --skill ln-115-devops-docs-creator

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

Files (4)
SKILL.md
4.5 KB
---
name: ln-115-devops-docs-creator
description: Creates runbook.md for DevOps setup. L3 Worker invoked CONDITIONALLY when hasDocker detected.
---

> **Paths:** File paths (`shared/`, `references/`, `../ln-*`) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.

# DevOps Documentation Creator

L3 Worker that creates runbook.md. CONDITIONAL - only invoked when project has Docker or deployment config.

## Purpose & Scope
- Creates runbook.md (if hasDocker)
- Receives Context Store from ln-110-project-docs-coordinator
- Step-by-step setup and deployment instructions
- Troubleshooting guide
- Never gathers context itself; uses coordinator input

## Invocation (who/when)
- **ln-110-project-docs-coordinator:** CONDITIONALLY invoked when:
  - `hasDocker=true` (Dockerfile or docker-compose.yml detected)
- Never called directly by users

## Inputs
From coordinator:
- `contextStore`: Context Store with DevOps-specific data
  - DOCKER_COMPOSE_DEV (development setup)
  - DOCKER_COMPOSE_PROD (production setup)
  - ENV_VARIABLES (from .env.example)
  - STARTUP_SEQUENCE (services order)
  - DEPLOYMENT_TARGET (AWS, Vercel, Heroku)
  - CI_CD_PIPELINE (from .github/workflows)
  - DOCKER_SERVICES (parsed from docker-compose.yml services)
  - DEPLOYMENT_SCALE ("single" | "multi" | "auto-scaling" | "gpu-based")
  - DEVOPS_CONTACTS (from CODEOWNERS, package.json author, git log)
  - HAS_GPU (detected from docker-compose nvidia runtime)
- `targetDir`: Project root directory
- `flags`: { hasDocker }

## Documents Created (1, conditional)

| File | Condition | Questions | Auto-Discovery |
|------|-----------|-----------|----------------|
| docs/project/runbook.md | hasDocker | Q46-Q51 | High |

## Workflow

### Phase 1: Check Conditions
1. Parse flags from coordinator
2. If `!hasDocker`: return early with empty result

### Phase 2: Create Document
1. Check if file exists (idempotent)
2. If exists: skip with log
3. If not exists:
   - Copy template
   - Replace placeholders with Context Store values
   - Populate setup steps from package.json scripts
   - Extract env vars from .env.example
   - Mark `[TBD: X]` for missing data
4. **Conditional Section Pruning:**
   - If DEPLOYMENT_SCALE != "multi" or "auto-scaling": Remove scaling/load balancer sections
   - If !HAS_GPU: Remove GPU-related sections (nvidia runtime, CUDA)
   - If service not in DOCKER_SERVICES: Remove that service's examples (e.g., no Redis = no Redis commands)
   - If DEVOPS_CONTACTS empty: Mark {{KEY_CONTACTS}} as `[TBD: Provide DevOps team contacts via Q50]`
   - Populate {{SERVICE_DEPENDENCIES}} ONLY from DOCKER_SERVICES (no generic examples)
   - Populate {{PORT_MAPPING}} ONLY from docker-compose.yml ports section

### Phase 3: Self-Validate
1. Check SCOPE tag
2. Validate sections:
   - Local Development Setup (prerequisites, install, run)
   - Deployment (platform, build, deploy steps)
   - Troubleshooting (common errors, debugging)
3. Check env vars documented
4. Check Maintenance section

### Phase 4: Return Status
```json
{
  "created": ["docs/project/runbook.md"],
  "skipped": [],
  "tbd_count": 0,
  "validation": "OK"
}
```

## Critical Notes

### Core Rules
- **Conditional:** Skip entirely if no Docker detected
- **Heavy auto-discovery:** Most data from docker-compose.yml, .env.example, package.json
- **Reproducible:** Setup steps must be testable and repeatable
- **Idempotent:** Never overwrite existing files

### NO_CODE_EXAMPLES Rule (MANDATORY)
Runbook documents **procedures**, NOT implementations:
- **FORBIDDEN:** Full Docker configs, CI/CD pipelines (>5 lines)
- **ALLOWED:** Command examples (1-3 lines), env var tables, step lists
- **INSTEAD OF CODE:** "See [docker-compose.yml](../docker-compose.yml)"

### Stack Adaptation Rule (MANDATORY)
- Commands must match project stack (npm vs pip vs go)
- Link to correct cloud provider docs (AWS/Azure/GCP)
- Never mix stack references (no npm commands in Python project)

### Format Priority (MANDATORY)
Tables (env vars, ports, services) > Lists (setup steps) > Text

## Definition of Done
- Condition checked (hasDocker)
- Document created if applicable
- Setup steps, deployment, troubleshooting documented
- All env vars from .env.example included
- **Actuality verified:** all document facts match current code (paths, functions, APIs, configs exist and are accurate)
- Status returned to coordinator

## Reference Files
- Templates: `references/templates/runbook_template.md`
- Questions: `references/questions_devops.md` (Q46-Q51)

---
**Version:** 1.1.0
**Last Updated:** 2025-01-12

Overview

This skill creates a project runbook (docs/project/runbook.md) when Docker is detected. It receives a context store from the docs coordinator and produces a concise, reproducible runbook covering setup, deployment, troubleshooting, and maintenance. The skill is conditional and idempotent: it runs only if hasDocker is true and never overwrites existing runbooks.

How this skill works

The worker receives a contextStore, targetDir, and flags from the project docs coordinator. It parses Docker-related artifacts (docker-compose.yml, .env.example, package.json scripts, CI workflow snippets) and fills a runbook template with tables for env vars, ports, and services plus step lists for setup and deploy. Conditional pruning removes irrelevant sections (GPU, scaling, absent services) and marks missing info as TODO placeholders.

When to use it

  • When a project contains a Dockerfile or docker-compose.yml (hasDocker=true).
  • When you need a reproducible, testable runbook for local setup and deployment.
  • When you want consistent DevOps documentation populated from repo artifacts.
  • When a coordinator has already collected DevOps context (contextStore).
  • Not used for projects without Docker or when direct user invocation is required.

Best practices

  • Run only via the docs coordinator so the skill receives a complete contextStore.
  • Keep .env.example, docker-compose.yml, and package.json scripts up to date to maximize auto-discovery accuracy.
  • Do not expect the skill to gather new context; provide missing info via the coordinator questions.
  • Respect NO_CODE_EXAMPLES: include short command snippets (1–3 lines) and link to config files instead of pasting long configs.
  • Verify produced runbook against the repository to ensure actuality before publishing.

Example use cases

  • Auto-generate a runbook for a Node.js microservice that includes docker-compose service tables and npm start instructions.
  • Produce deployment steps and platform links for projects targeting AWS or Heroku based on DEPLOYMENT_TARGET.
  • Create troubleshooting and maintenance sections while removing GPU or scaling content when not applicable.
  • Populate env var and port mapping tables directly from .env.example and docker-compose.yml for on-call engineers.

FAQ

What triggers this skill to run?

The coordinator invokes it only when hasDocker is true (Dockerfile or docker-compose.yml detected).

Will it overwrite an existing runbook?

No. The skill is idempotent and skips creation if docs/project/runbook.md already exists.