Comprehensive toolkit for validating, linting, testing, and automating Jenkinsfile pipelines (both Declarative and Scripted). Use this skill when working with Jenkins pipeline files, validating pipeline syntax, checking best practices, debugging pipeline issues, or working with custom plugins.
Overall
score
93%
Does it follow best practices?
Validation for skill structure
Comprehensive toolkit for validating, linting, and testing Jenkinsfile pipelines (both Declarative and Scripted). This skill applies when working with Jenkins pipeline files, validating pipeline syntax, checking best practices, debugging pipeline issues, or working with custom plugins that require documentation lookup.
Declarative: Required sections, directive placement, parallel execution, credential management, combined shell commands.
Scripted: Groovy syntax, node blocks, try-catch-finally, NonCPS annotation usage, variable scoping.
Both types: Hardcoded credential detection, controller-heavy operations (JsonSlurper, HttpRequest), variable declarations, plugin-specific step validation.
Shared Library — vars/*.groovy: call() method, NonCPS annotation correctness, CPS compatibility, camelCase naming, documentation comments. src/**/*.groovy: package declaration, class-filename match, Serializable implementation, wildcard import warnings, static method CPS compatibility.
See references/validation_rules.md for detailed rules, error reporting format, and examples.
Auto-detected: Declarative (pipeline {), Scripted (node block or Groovy outside pipeline block). Clarification is requested only if ambiguous.
# Run complete validation (syntax + security + best practices)
bash scripts/validate_jenkinsfile.sh JenkinsfileAuto-detects pipeline type, validates syntax, scans for hardcoded credentials, checks best practices, and produces a unified summary.
# Full validation (default)
bash scripts/validate_jenkinsfile.sh Jenkinsfile
# Syntax validation only (fastest)
bash scripts/validate_jenkinsfile.sh --syntax-only Jenkinsfile
# Security audit only
bash scripts/validate_jenkinsfile.sh --security-only Jenkinsfile
# Best practices check only
bash scripts/validate_jenkinsfile.sh --best-practices Jenkinsfile
# Skip security checks
bash scripts/validate_jenkinsfile.sh --no-security Jenkinsfile
# Skip best practices
bash scripts/validate_jenkinsfile.sh --no-best-practices Jenkinsfile
# Strict mode (fail on warnings)
bash scripts/validate_jenkinsfile.sh --strict JenkinsfileThe validation system uses a modular script architecture:
scripts/
├── validate_jenkinsfile.sh # Main orchestrator (USE THIS)
│ ├── Auto-detects pipeline type
│ ├── Runs syntax validation
│ ├── Runs security scan
│ ├── Runs best practices check
│ └── Produces unified summary
│
├── validate_declarative.sh # Declarative syntax validator
├── validate_scripted.sh # Scripted syntax validator
├── common_validation.sh # Shared functions + security scan
├── best_practices.sh # 15-point best practices scorer
└── validate_shared_library.sh # Shared library validatorValidate Jenkins Shared Library files using validate_shared_library.sh:
# Validate a single vars file
bash scripts/validate_shared_library.sh vars/myStep.groovy
# Validate entire shared library directory
bash scripts/validate_shared_library.sh /path/to/shared-libraryImportant: Plugin documentation lookup is Claude's responsibility (not automated in scripts). After running validation, Claude should identify unknown plugins and look them up.
Look up documentation when you encounter:
references/common_plugins.md (e.g., customDeploy, sendToDatadog, grafanaNotify)nexusArtifactUploader, sonarQubeScanner)See references/common_plugins.md for documentation on commonly used plugins.
When a user provides a Jenkinsfile for validation:
Run validation using the main script:
bash scripts/validate_jenkinsfile.sh <path-to-jenkinsfile>Optionally read the Jenkinsfile using the Read tool if you need to:
Look up unknown plugins after validation:
references/common_plugins.md firstmcp__context7__resolve-library-id with query "jenkinsci <plugin-name>"Report results with line numbers, severity, and actionable suggestions
Provide inline fix suggestions when errors are found (include corrected code snippets directly in the response)
Install with Tessl CLI
npx tessl i pantheon-ai/jenkinsfile-validator