From devops-skills
Validates Declarative/Scripted Jenkinsfiles and Groovy shared libraries for syntax, security issues, hardcoded credentials, and best practices using bash scripts.
npx claudepluginhub akin-ozer/cc-devops-skills --plugin devops-skillsThis skill uses the workspace's default tool permissions.
Use this skill to validate Jenkins pipelines and shared libraries with local scripts first, then optionally enrich findings with plugin documentation.
examples/bad-declarative-pipeline.Jenkinsfileexamples/bad-scripted-pipeline.Jenkinsfileexamples/declarative-docker.Jenkinsfileexamples/declarative-kubernetes.Jenkinsfileexamples/declarative-parallel.Jenkinsfileexamples/declarative-unknown-plugins.Jenkinsfileexamples/scripted-basic.Jenkinsfileexamples/scripted-conditional.Jenkinsfileexamples/scripted-docker.Jenkinsfileexamples/shared-library/src/com/example/BuildConfig.groovyexamples/shared-library/vars/BadStep.groovyexamples/shared-library/vars/buildApp.groovyreferences/best_practices.mdreferences/common_plugins.mdreferences/declarative_syntax.mdreferences/scripted_syntax.mdscripts/best_practices.shscripts/common_validation.shscripts/validate_declarative.shscripts/validate_jenkinsfile.shSearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
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.