akin-ozer/cc-devops-skills/jenkinsfile-generator
Claude Code and agent skill by akin-ozer/cc-devops-skills
- community
Checking that the SKILL.md file is still in the repository.
Generate/create/scaffold Jenkinsfile — declarative, scripted, shared library, CI/CD pipelines.
Install
npx vskill@latest install akin-ozer/cc-devops-skills/jenkinsfile-generatorSKILL.md
Jenkinsfile Generator Skill
Generate production-ready Jenkinsfiles following best practices. All generated files are validated using devops-skills:jenkinsfile-validator skill.
Trigger Phrases
- "Generate a CI pipeline for Maven/Gradle/npm"
- "Create a Jenkins deployment pipeline with approvals"
- "Build a Jenkinsfile with parallel test stages"
- "Create a scripted pipeline with dynamic stage logic"
- "Scaffold a Jenkins shared library"
- "Generate a Jenkinsfile for Docker or Kubernetes agents"
When to Use
- Creating new Jenkinsfiles (declarative or scripted)
- CI/CD pipelines, Docker/Kubernetes deployments
- Parallel execution, matrix builds, parameterized pipelines
- DevSecOps pipelines with security scanning
- Shared library scaffolding
Declarative vs Scripted Decision Tree
- Choose Declarative by default when stage order and behavior are mostly static.
- Choose Scripted when runtime-generated stages, complex loops, or dynamic control flow are required.
- Choose Shared Library scaffolding when request is about reusable pipeline functions (
vars/,src/,resources/). - If unsure, start Declarative and only switch to Scripted if requirements cannot be expressed cleanly.
Template Map
| 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 |
Quick Reference
| 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 |
Core Capabilities
1. Declarative Pipelines (RECOMMENDED)
Process:
- Read templates for structure reference:
- Read
assets/templates/declarative/basic.Jenkinsfileto understand the standard structure - Templates show the expected sections: pipeline → agent → environment → options → parameters → stages → post
- For complex requests, adapt the structure rather than copying verbatim
- Consult reference documentation:
- Read
references/best_practices.mdfor performance, security, and reliability patterns - Read
references/common_plugins.mdfor plugin-specific syntax
- Generate with required elements:
- Proper stages with descriptive names
- Environment block with credentials binding (never hardcode secrets)
- Options: timeout, buildDiscarder, timestamps, disableConcurrentBuilds
- Post conditions: always (cleanup), success (artifacts), failure (notifications)
- Always add `failFast true` or `parallelsAlwaysFailFast()` for parallel blocks
- Always include `fingerprint: true` when using `archiveArtifacts`
- ALWAYS validate using devops-skills:jenkinsfile-validator skill
2. Scripted Pipelines
When: Complex conditional logic, dynamic generation, full Groovy control Process:
- Read templates for structure reference:
- Read
assets/templates/scripted/basic.Jenkinsfilefor node/stage patterns - Understand try-catch-finally structure for error handling
- Implement try-catch-finally for error handling
- ALWAYS validate using devops-skills:jenkinsfile-validator skill
3. Parallel/Matrix Pipelines
Use parallel {} block or matrix {} with axes {} for multi-dimensional builds.
- Default behavior is fail-fast for generated parallel pipelines (
parallelsAlwaysFailFast()or stage-levelfailFast true).
4. Security Scanning (DevSecOps)
Add SonarQube, OWASP Dependency-Check, Trivy stages with fail thresholds.
5. Shared Library Scaffolding
Declarative Syntax Reference
Agent Types
Environment & Credentials
Options
Parameters
When Conditions
| Condition | Example | |
|---|---|---|
branch | branch 'main' or branch pattern: 'release/*', comparator: 'GLOB' | |
tag | tag pattern: 'v*', comparator: 'GLOB' | |
changeRequest | changeRequest target: 'main' | |
changeset | changeset 'src/**/*.java' | |
expression | expression { env.DEPLOY == 'true' } | |
allOf/anyOf/not | Combine conditions |
Add beforeAgent true to skip agent allocation if condition fails.
Error Handling
Post Section
Order: always → changed → fixed → regression → failure → success → unstable → cleanup
NOTE: Always use fingerprint: true with archiveArtifacts for build traceability and artifact tracking.
Parallel & Matrix
IMPORTANT: Always ensure parallel blocks fail fast on first failure using one of these approaches:
Option 1: Global (RECOMMENDED) - Use parallelsAlwaysFailFast() in pipeline options:
This is the preferred approach as it covers all parallel blocks automatically.
Option 2: Per-block - Use failFast true on individual parallel stages:
NOTE: When parallelsAlwaysFailFast() is set in options, explicit failFast true on individual parallel blocks is redundant.
Input (Manual Approval)
IMPORTANT: Place input outside steps to avoid holding agents.
Scripted Syntax Reference
@NonCPS for Non-Serializable Operations
Rules: No pipeline steps (sh, echo) inside @NonCPS. Use for JsonSlurper, iterators, regex Matchers.
Docker & Kubernetes
Docker Agent
Build & Push
Kubernetes Pod
Shared Libraries
Validation Workflow
CRITICAL: ALWAYS validate using devops-skills:jenkinsfile-validator skill:
- Generate Jenkinsfile
- Invoke
devops-skills:jenkinsfile-validatorskill - Handle validation results by severity:
- ERRORS: MUST fix before presenting to user - these break the pipeline
- WARNINGS: SHOULD fix - these indicate potential issues
- INFO/SUGGESTIONS: Consider applying based on use case:
failFast truefor parallel blocks → apply by default- Build triggers → ask user if they want automated builds
- Other optimizations → apply if they improve the pipeline
- Re-validate after fixes
- Only present validated Jenkinsfiles to user
Validation commands:
Generator Scripts
When to use scripts vs manual generation:
- Use scripts for: Simple, standard pipelines with common patterns (basic CI, straightforward CD)
- Use manual generation for: Complex pipelines with multiple features (parallel tests + security scanning + Docker + K8s deployments), custom logic, or non-standard requirements
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdevops-skills-plugin/skills/jenkinsfile-generator/SKILL.md
Popularity
- Repository stars
- 294
- Repository forks
- 32
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/akin-ozer/cc-devops-skills/jenkinsfile-generator)