/devops-skills:jenkinsfile-validatorfrom devops-skills
Validates Jenkinsfiles and shared libraries for syntax errors, security issues, and best practices using local shell scripts.
Ships in devops-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Use this skill to validate Jenkins pipelines and shared libraries with local scripts first, then optionally enrich findings with plugin documentation.
Use this skill when requests look like:
This skill validates:
pipeline { ... })node { ... } and Groovy-style pipelines)vars/*.groovy, src/**/*.groovy)Run commands from repository root unless noted.
bashgrepsedawkheadwcfind (needed for shared-library directory scans)jq (optional; improves JSON-heavy troubleshooting workflows)devops-skills-plugin/skills/jenkinsfile-validator/scripts/+x is missing (it uses bash fallback)./script.sh), make scripts executable:chmod +x devops-skills-plugin/skills/jenkinsfile-validator/scripts/*.sh
SKILL_DIR="devops-skills-plugin/skills/jenkinsfile-validator"
command -v bash grep sed awk head wc find >/dev/null && echo "required tools: ok" || echo "required tools: missing"
command -v jq >/dev/null && echo "jq: installed (optional)" || echo "jq: missing (optional)"
[ -d "$SKILL_DIR/scripts" ] && echo "scripts dir: ok" || echo "scripts dir: missing"
[ -f "$SKILL_DIR/scripts/validate_jenkinsfile.sh" ] && echo "main validator: ok" || echo "main validator: missing"
Use a single base path variable to avoid path ambiguity.
SKILL_DIR="devops-skills-plugin/skills/jenkinsfile-validator"
TARGET_JENKINSFILE="Jenkinsfile"
# Full validation (recommended)
bash "$SKILL_DIR/scripts/validate_jenkinsfile.sh" "$TARGET_JENKINSFILE"
SKILL_DIR="devops-skills-plugin/skills/jenkinsfile-validator"
TARGET_JENKINSFILE="Jenkinsfile"
bash "$SKILL_DIR/scripts/validate_jenkinsfile.sh" --syntax-only "$TARGET_JENKINSFILE"
bash "$SKILL_DIR/scripts/validate_jenkinsfile.sh" --security-only "$TARGET_JENKINSFILE"
bash "$SKILL_DIR/scripts/validate_jenkinsfile.sh" --best-practices "$TARGET_JENKINSFILE"
bash "$SKILL_DIR/scripts/validate_jenkinsfile.sh" --no-security "$TARGET_JENKINSFILE"
bash "$SKILL_DIR/scripts/validate_jenkinsfile.sh" --no-best-practices "$TARGET_JENKINSFILE"
bash "$SKILL_DIR/scripts/validate_jenkinsfile.sh" --strict "$TARGET_JENKINSFILE"
bash "$SKILL_DIR/scripts/validate_jenkinsfile.sh" --assume-declarative "$TARGET_JENKINSFILE"
bash "$SKILL_DIR/scripts/validate_jenkinsfile.sh" --assume-scripted "$TARGET_JENKINSFILE"
SKILL_DIR="devops-skills-plugin/skills/jenkinsfile-validator"
bash "$SKILL_DIR/scripts/validate_shared_library.sh" vars/myStep.groovy
bash "$SKILL_DIR/scripts/validate_shared_library.sh" vars/
bash "$SKILL_DIR/scripts/validate_shared_library.sh" src/
bash "$SKILL_DIR/scripts/validate_shared_library.sh" /path/to/shared-library
SKILL_DIR="devops-skills-plugin/skills/jenkinsfile-validator"
bash "$SKILL_DIR/tests/run_local_ci.sh"
run_local_ci.sh is the supported local/CI entrypoint for regression coverage. It runs:
bash -n syntax checks for all scripts/*.sh and tests/*.sh filestests/test_validate_jenkinsfile.sh regression scenariospipeline { => Declarative validatornode (...) or node { => Scripted validatorERROR [TypeDetection])--assume-declarative or --assume-scriptedvalidate_declarative.shvalidate_scripted.shcommon_validation.sh check_credentialsbest_practices.shbash tests/run_local_ci.shSKILL_DIR="devops-skills-plugin/skills/jenkinsfile-validator"
TARGET_JENKINSFILE="Jenkinsfile"
# Type detection
bash "$SKILL_DIR/scripts/common_validation.sh" detect_type "$TARGET_JENKINSFILE"
# Syntax-only by type
bash "$SKILL_DIR/scripts/validate_declarative.sh" "$TARGET_JENKINSFILE"
bash "$SKILL_DIR/scripts/validate_scripted.sh" "$TARGET_JENKINSFILE"
# Security-only
bash "$SKILL_DIR/scripts/common_validation.sh" check_credentials "$TARGET_JENKINSFILE"
# Best-practices-only
bash "$SKILL_DIR/scripts/best_practices.sh" "$TARGET_JENKINSFILE"
validate_jenkinsfile.sh0: Validation passed1: Validation failed (syntax/security errors, or warnings in --strict mode)2: Usage or environment error (bad args, missing file, missing required tools)validate_declarative.sh: 0 pass (errors=0), 1 usage/file/validation failurevalidate_scripted.sh: 0 pass (errors=0), 1 usage/file/validation failurecommon_validation.sh check_credentials: 0 no credential errors, 1 credential issues foundvalidate_shared_library.sh: 0 pass, 1 validation errors found, 2 invalid input targetbest_practices.sh: 1 only for usage/file errors; content findings are reported in logs and score outputERROR [Line N]: ... => must fixWARNING [Line N]: ... => should reviewINFO [Line N]: ... => optional improvementVALIDATION PASSED/FAILED) determine final interpretation quickly--strict when warnings should fail pipelines.best_practices.sh is run standalone, read report sections (CRITICAL ISSUES, IMPROVEMENTS RECOMMENDED, score); do not rely only on exit code.jq is missing, continue validation; treat as non-blocking.bash <script> execution.Use this order:
devops-skills-plugin/skills/jenkinsfile-validator/references/common_plugins.mdmcp__context7__resolve-library-id with query like jenkinsci <plugin-name>-pluginmcp__context7__query-docs for usage and parametersWhen plugin-specific validation is requested:
references/common_plugins.md first.resolve-library-id then query-docs).Local references:
devops-skills-plugin/skills/jenkinsfile-validator/references/declarative_syntax.mddevops-skills-plugin/skills/jenkinsfile-validator/references/scripted_syntax.mddevops-skills-plugin/skills/jenkinsfile-validator/references/best_practices.mddevops-skills-plugin/skills/jenkinsfile-validator/references/common_plugins.mdExternal references:
Use this structure in validation responses:
Validation Target: <path>
Pipeline Type: <Declarative|Scripted|Shared Library|Unknown>
Findings:
- ERROR [Line X]: <issue>
- WARNING [Line Y]: <issue>
- INFO [Line Z]: <suggestion>
Phase Results:
- Syntax: <PASSED|FAILED|SKIPPED>
- Security: <PASSED|FAILED|SKIPPED>
- Best Practices: <PASSED|REVIEW NEEDED|SKIPPED>
Exit Code: <0|1|2>
Next Actions:
1. <highest-priority fix>
2. <second fix>
SKILL_DIR="devops-skills-plugin/skills/jenkinsfile-validator"
bash "$SKILL_DIR/scripts/validate_jenkinsfile.sh" Jenkinsfile
Expected behavior:
0/1/2 per orchestrator rulesSKILL_DIR="devops-skills-plugin/skills/jenkinsfile-validator"
bash "$SKILL_DIR/scripts/validate_shared_library.sh" examples/shared-library
Expected behavior:
vars/ and src/ files1 when errors are presentInput step:
nexusArtifactUploader artifacts: [[...]], nexusUrl: 'https://nexus.example.com'
Flow:
The skill usage is complete when all are true:
$SKILL_DIR/scripts/...) with no cwd ambiguity.examples/bad-declarative-pipeline.Jenkinsfile (opens in a new tab)examples/bad-scripted-pipeline.Jenkinsfile (opens in a new tab)examples/declarative-docker.Jenkinsfile (opens in a new tab)examples/declarative-kubernetes.Jenkinsfile (opens in a new tab)examples/declarative-parallel.Jenkinsfile (opens in a new tab)examples/declarative-unknown-plugins.Jenkinsfile (opens in a new tab)examples/scripted-basic.Jenkinsfile (opens in a new tab)examples/scripted-conditional.Jenkinsfile (opens in a new tab)examples/scripted-docker.Jenkinsfile (opens in a new tab)examples/shared-library/src/com/example/BuildConfig.groovy (opens in a new tab)examples/shared-library/vars/BadStep.groovy (opens in a new tab)examples/shared-library/vars/buildApp.groovy (opens in a new tab)references/best_practices.md (opens in a new tab)references/common_plugins.md (opens in a new tab)references/declarative_syntax.md (opens in a new tab)references/scripted_syntax.md (opens in a new tab)scripts/best_practices.sh (opens in a new tab)scripts/common_validation.sh (opens in a new tab)scripts/validate_declarative.sh (opens in a new tab)scripts/validate_jenkinsfile.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub akin-ozer/cc-devops-skills --plugin devops-skills31 skills in this plugin
/ansible-generatorGenerate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars./ansible-validatorValidate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN, tasks./azure-pipelines-generatorGenerate/create/scaffold azure-pipelines.yml, stages, jobs, steps, or reusable templates./azure-pipelines-validatorValidate, lint, audit, or review azure-pipelines.yml — syntax, security, best practices.Other plugins' skills for the same job