jenkins-pipeline
About
This Claude Skill helps developers build Jenkins pipelines using both declarative and scripted approaches. It enables creating multi-stage CI/CD workflows with agents, parameters, and plugin integrations. Use it for implementing enterprise-grade deployment automation and complex multi-branch pipeline configurations.
Quick Install
Claude Code
Recommended/plugin add https://github.com/aj-geddes/useful-ai-promptsgit clone https://github.com/aj-geddes/useful-ai-prompts.git ~/.claude/skills/jenkins-pipelineCopy and paste this command in Claude Code to install this skill
Documentation
Jenkins Pipeline
Overview
Create enterprise-grade Jenkins pipelines using declarative and scripted approaches to automate building, testing, and deploying with advanced control flow.
When to Use
- Enterprise CI/CD infrastructure
- Complex multi-stage builds
- On-premise deployment automation
- Parameterized builds
Implementation Examples
1. Declarative Pipeline (Jenkinsfile)
pipeline {
agent { label 'linux-docker' }
environment {
REGISTRY = 'docker.io'
IMAGE_NAME = 'myapp'
}
parameters {
string(name: 'DEPLOY_ENV', defaultValue: 'staging')
}
stages {
stage('Checkout') { steps { checkout scm } }
stage('Install') { steps { sh 'npm ci' } }
stage('Lint') { steps { sh 'npm run lint' } }
stage('Test') {
steps {
sh 'npm run test:coverage'
junit 'test-results.xml'
}
}
stage('Build') {
steps {
sh 'npm run build'
archiveArtifacts artifacts: 'dist/**/*'
}
}
stage('Deploy') {
when { branch 'main' }
steps {
sh 'kubectl set image deployment/app app=${REGISTRY}/${IMAGE_NAME}:latest'
}
}
}
post {
always { cleanWs() }
failure { echo 'Pipeline failed!' }
}
}
2. Scripted Pipeline (Groovy)
// Jenkinsfile - Scripted Pipeline
node('linux-docker') {
def imageTag = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim()
def registry = 'docker.io'
try {
stage('Checkout') { checkout scm }
stage('Install') { sh 'npm ci' }
stage('Test') { sh 'npm test' }
stage('Build') { sh 'npm run build' }
currentBuild.result = 'SUCCESS'
} catch (Exception e) {
currentBuild.result = 'FAILURE'
error("Build failed: ${e.message}")
}
}
3. Multi-Branch Pipeline
pipeline {
agent any
stages {
stage('Build') { steps { sh 'npm run build' } }
stage('Test') { steps { sh 'npm test' } }
stage('Deploy') {
when { branch 'main' }
steps { sh 'npm run deploy:prod' }
}
}
}
4. Parameterized Pipeline
pipeline {
agent any
parameters {
string(name: 'VERSION', defaultValue: '1.0.0', description: 'Version to release')
choice(name: 'ENV', choices: ['staging', 'prod'], description: 'Deployment environment')
}
stages {
stage('Build') { steps { sh 'npm run build' } }
stage('Test') { steps { sh 'npm test' } }
stage('Deploy') {
steps { sh "npm run deploy:${params.ENV}" }
}
}
}
5. Pipeline with Credentials
pipeline {
agent any
environment {
DOCKER_CREDS = credentials('docker-hub')
}
stages {
stage('Build & Push') {
steps {
sh '''
echo $DOCKER_CREDS_PSW | docker login -u $DOCKER_CREDS_USR --password-stdin
docker build -t myapp:latest .
docker push myapp:latest
'''
}
}
}
}
Best Practices
✅ DO
- Use declarative pipelines for clarity
- Use credentials plugin for secrets
- Archive artifacts and reports
- Implement approval gates for production
- Keep pipelines modular and reusable
❌ DON'T
- Store credentials in pipeline code
- Ignore pipeline errors
- Skip test coverage reporting
- Use deprecated plugins
Resources
GitHub Repository
Related Skills
sglang
MetaSGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.
content-collections
MetaThis skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.
langchain
MetaLangChain is a framework for building LLM applications using agents, chains, and RAG pipelines. It supports multiple LLM providers, offers 500+ integrations, and includes features like tool calling and memory management. Use it for rapid prototyping and deploying production systems like chatbots, autonomous agents, and question-answering services.
Algorithmic Art Generation
MetaThis skill helps developers create algorithmic art using p5.js, focusing on generative art, computational aesthetics, and interactive visualizations. It automatically activates for topics like "generative art" or "p5.js visualization" and guides you through creating unique algorithms with features like seeded randomness, flow fields, and particle systems. Use it when you need to build reproducible, code-driven artistic patterns.
