ansible-generator
Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars.
Generate/create/scaffold Jenkinsfile — declarative, scripted, shared library, CI/CD pipelines.
$ npx -y skills add akin-ozer/cc-devops-skills --skill jenkinsfile-generator --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/jenkinsfile-generatorContext preview
The summary Claude sees to decide when to auto-load this skill.
Generate/create/scaffold Jenkinsfile — declarative, scripted, shared library, CI/CD pipelines.
name: jenkinsfile-generator description: Generate/create/scaffold Jenkinsfile — declarative, scripted, shared library, CI/CD pipelines.
Generate production-ready Jenkinsfiles following best practices. All generated files are validated using devops-skills:jenkinsfile-validator skill.
1. Choose **Declarative** by default when stage order and behavior are mostly static. 2. Choose **Scripted** when runtime-generated stages, complex loops, or dynamic control flow are required. 3. Choose **Shared Library scaffolding** when request is about reusable pipeline functions (`vars/`, `src/`, `resources/`). 4. If unsure, start Declarative and only switch to Scripted if requirements cannot be expressed cleanly.
| Template | Path | Use When | |---|---|---| | Declarative basic | `assets/templates/declarative/basic.Jenkinsfile` | Standard CI/CD with predictable stages | | Declarative parallel example | `examples/declarative-parallel.Jenkinsfile` | Parallel test/build branches with fail-fast behavior | | Declarative kubernetes example | `examples/declarative-kubernetes.Jenkinsfile` | Kubernetes agent execution using pod templates | | Scripted basic | `assets/templates/scripted/basic.Jenkinsfile` | Complex conditional logic or generated stages | | Shared library scaffold | Generated by `scripts/generate_shared_library.py` | Reusable pipeline functions and organization-wide patterns |
// Minimal Declarative Pipeline
pipeline {
agent any
stages {
stage('Build') { steps { sh 'make' } }
stage('Test') { steps { sh 'make test' } }
}
}
// Error-tolerant stage
stage('Flaky Tests') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE') {
sh 'run-flaky-tests.sh'
}
}
}
// Conditional deployment with approval
stage('Deploy') {
when { branch 'main'; beforeAgent true }
input { message 'Deploy to production?' }
steps { sh './deploy.sh' }
}| Option | Purpose | |--------|---------| | `timeout(time: 1, unit: 'HOURS')` | Prevent hung builds | | `buildDiscarder(logRotator(numToKeepStr: '10'))` | Manage disk space | | `disableConcurrentBuilds()` | Prevent race conditions | | `catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE')` | Continue on error |
**Process:** 1. **Read templates for structure reference:**
2. **Consult reference documentation:**
3. **Generate with required elements:**
4. **ALWAYS validate** using devops-skills:jenkinsfile-validator skill
**When:** Complex conditional logic, dynamic generation, full Groovy control **Process:** 1. **Read templates for structure reference:**
2. Implement try-catch-finally for error handling 3. **ALWAYS validate** using devops-skills:jenkinsfile-validator skill
Use `parallel {}` block or `matrix {}` with `axes {}` for multi-dimensional builds.
Add SonarQube, OWASP Dependency-Check, Trivy stages with fail thresholds.
python3 scripts/generate_shared_library.py --name my-library --package org.example
agent any // Any available agent
agent { label 'linux && docker' } // Label-based
agent { docker { image 'maven:3.9.11-eclipse-temurin-21' } }
agent { kubernetes { yaml '...' } } // K8s pod template
agent { kubernetes { yamlFile 'pod.yaml' } } // External YAMLenvironment {
VERSION = '1.0.0'
AWS_KEY = credentials('aws-key-id') // Creates _USR and _PSW vars
}options {
buildDiscarder(logRotator(numToKeepStr: '10'))
timeout(time: 1, unit: 'HOURS')
disableConcurrentBuilds()
timestamps()
parallelsAlwaysFailFast()
durabilityHint('PERFORMANCE_OPTIMIZED') // 2-6x faster for simple pipelines
}parameters {
string(name: 'VERSION', defaultValue: '1.0.0')
choice(name: 'ENV', choices: ['dev', 'staging', 'A practical skill pack for DevOps work in Claude Code and Codex desktop. This repository ships 31 skills: 16 generators for scaffolding production-ready configs 14 validators for linting, security checks, and dry-run validation 1 debugger (k8s-debug) for
Repo: akin-ozer/cc-devops-skills
Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars.
Validate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN, tasks.
Generate/create/scaffold azure-pipelines.yml, stages, jobs, steps, or reusable templates.
Validate, lint, audit, or review azure-pipelines.yml — syntax, security, best practices.
Create, generate, write, or scaffold bash/shell scripts (.sh), automation, or CLI tools.
Validate, lint, audit, or fix bash/shell/.sh scripts via ShellCheck.