/devops-skills:gitlab-ci-validatorfrom devops-skills
Validates, lints, tests, and secures GitLab CI/CD pipeline configurations (.gitlab-ci.yml). Use for syntax checking, best practices, security audits, and debugging pipeline issues.
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.
Comprehensive toolkit for validating, linting, testing, and securing GitLab CI/CD pipeline configurations (.gitlab-ci.yml files). Use this skill when working with GitLab CI/CD pipelines, validating pipeline syntax, debugging configuration issues, implementing best practices, or performing security audits.
Use the gitlab-ci-validator skill in the following scenarios:
.gitlab-ci.yml filesFollow this workflow when validating GitLab CI/CD pipelines to catch issues early and ensure configuration quality:
Start with syntax validation to catch YAML errors, schema violations, and structural issues:
# Quick syntax check (fastest)
bash scripts/validate_gitlab_ci.sh --syntax-only .gitlab-ci.yml
What it checks:
Action: Fix all syntax errors before proceeding.
After passing syntax validation, check for optimization opportunities and best practices:
# Best practices analysis
bash scripts/validate_gitlab_ci.sh --best-practices .gitlab-ci.yml
What it checks:
Action: Review suggestions and apply relevant optimizations.
Perform a comprehensive security scan to identify vulnerabilities:
# Security scan
bash scripts/validate_gitlab_ci.sh --security-only .gitlab-ci.yml
What it checks:
Action: Fix all critical and high-severity security issues immediately.
For complex changes, test pipeline execution locally before pushing:
# Install gitlab-ci-local first (requires Docker and Node.js)
bash scripts/install_tools.sh
# Test pipeline locally
gitlab-ci-local
# Or via the validator script
bash scripts/validate_gitlab_ci.sh --test-only .gitlab-ci.yml
What it does:
Note: Requires Docker and gitlab-ci-local installation.
Run all validators together for comprehensive checking:
# Full validation pipeline
bash scripts/validate_gitlab_ci.sh .gitlab-ci.yml
# Strict mode (fail on warnings)
bash scripts/validate_gitlab_ci.sh .gitlab-ci.yml --strict
┌─────────────────────────────────────────────────────────────┐
│ 1. Syntax Validation (Required) │
│ ├─ YAML structure │
│ ├─ Schema compliance │
│ ├─ Include validation (component, project, etc.) │
│ └─ Component format & version │
│ ↓ │
│ Fix errors → Proceed │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ 2. Best Practices (Recommended) │
│ ├─ Cache optimization │
│ ├─ DAG opportunities │
│ ├─ Image pinning │
│ └─ Resource optimization │
│ ↓ │
│ Review & apply → Proceed │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ 3. Security Audit (Required) │
│ ├─ Hardcoded secrets │
│ ├─ Component security │
│ ├─ Include integrity │
│ └─ Dangerous patterns │
│ ↓ │
│ Fix critical issues → Proceed │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ 4. Local Testing (Optional) │
│ └─ gitlab-ci-local execution │
│ ↓ │
│ Test & verify → Push │
└─────────────────────────────────────────────────────────────┘
To validate a GitLab CI/CD configuration file:
bash .claude/skills/gitlab-ci-validator/scripts/validate_gitlab_ci.sh <file-path>
Example:
bash .claude/skills/gitlab-ci-validator/scripts/validate_gitlab_ci.sh .gitlab-ci.yml
This runs all three validation layers:
# Run only syntax validation
bash scripts/validate_gitlab_ci.sh .gitlab-ci.yml --syntax-only
# Run only best practices check
bash scripts/validate_gitlab_ci.sh .gitlab-ci.yml --best-practices
# Run only security scan
bash scripts/validate_gitlab_ci.sh .gitlab-ci.yml --security-only
# Skip best practices check
bash scripts/validate_gitlab_ci.sh .gitlab-ci.yml --no-best-practices
# Skip security scan
bash scripts/validate_gitlab_ci.sh .gitlab-ci.yml --no-security
# Strict mode (fail on warnings)
bash scripts/validate_gitlab_ci.sh .gitlab-ci.yml --strict
You can also run individual validation scripts:
# Syntax validation
python3 scripts/validate_syntax.py .gitlab-ci.yml
# Best practices check
python3 scripts/check_best_practices.py .gitlab-ci.yml
# Security scan
python3 scripts/check_security.py .gitlab-ci.yml
════════════════════════════════════════════════════════════════════════════════
GitLab CI/CD Validator
════════════════════════════════════════════════════════════════════════════════
File: .gitlab-ci.yml
[1/3] Running syntax validation...
✓ Syntax validation passed
[2/3] Running best practices check...
SUGGESTIONS (2):
──────────────────────────────────────────────────────────────────────────────
SUGGESTION: Line 15: Job 'build_app' installs dependencies but doesn't use cache [cache-missing]
💡 Suggestion: Add 'cache' configuration to speed up dependency installation
SUGGESTION: Line 42: Job 'deploy_production' should use resource_group [missing-resource-group]
💡 Suggestion: Add 'resource_group' to prevent concurrent deployments
⚠ Best practices check found issues
[3/3] Running security scan...
MEDIUM SEVERITY (1):
──────────────────────────────────────────────────────────────────────────────
MEDIUM: Line 8: Using ':latest' tag in job 'test_job' is a security risk [image-latest-tag]
🔒 Remediation: Pin to specific version or SHA digest
✓ Security scan passed
════════════════════════════════════════════════════════════════════════════════
Validation Summary
════════════════════════════════════════════════════════════════════════════════
Syntax Validation: PASSED
Best Practices: WARNINGS
Security Scan: PASSED
════════════════════════════════════════════════════════════════════════════════
✓ All validation checks passed
# Validate syntax and structure
bash scripts/validate_gitlab_ci.sh new-pipeline.gitlab-ci.yml
# Run security scan only with strict mode
bash scripts/validate_gitlab_ci.sh .gitlab-ci.yml --security-only --strict
# Check for best practices and optimization opportunities
bash scripts/validate_gitlab_ci.sh .gitlab-ci.yml --best-practices
# In your CI/CD pipeline
stages:
- validate
validate_pipeline:
stage: validate
script:
- pip3 install PyYAML
- bash .claude/skills/gitlab-ci-validator/scripts/validate_gitlab_ci.sh .gitlab-ci.yml --strict
When Claude Code invokes this skill, it will:
.gitlab-ci.yml files in the projectExample prompts:
yaml-syntax: Valid YAML formattingjob-reserved-keyword: Job names cannot use reserved keywordsjob-missing-script: Jobs must have script, trigger, or extendsjob-stage-undefined: Referenced stages must be defineddependencies-undefined-job: Referenced jobs must existrules-not-list: Rules must be a listcache-invalid-policy: Cache policy must be pull, push, or pull-pushcache-missing: Dependency installation jobs should use cacheartifact-no-expiration: Artifacts should have expirationdeprecated-only-except: Use 'rules' instead of 'only'/'except'missing-interruptible: Test jobs should be interruptiblemissing-retry: Potentially flaky jobs should have retryimage-latest-tag: Pin Docker images to specific versionsdag-optimization: Use 'needs' for faster pipeline executionparallel-opportunity: Tests could benefit from parallelizationhardcoded-password: Hardcoded passwords detectedhardcoded-api-key: Hardcoded API keys detectedsecret-in-logs: Secrets may be exposed in logscurl-pipe-bash: Dangerous curl | bash patternimage-latest-tag: Using :latest is a security riskinclude-remote-unverified: Remote includes without verificationvariable-hardcoded-secret: Sensitive variables with hardcoded valuesartifact-broad-path: Overly broad artifact pathspip3 install PyYAMLInstall dependencies:
pip3 install PyYAML
Comprehensive documentation is included in the docs/ directory:
gitlab-ci-reference.md: Complete GitLab CI/CD YAML syntax referencebest-practices.md: Detailed best practices guidecommon-issues.md: Common issues and solutionsExample GitLab CI/CD configurations are provided in the examples/ directory:
basic-pipeline.gitlab-ci.yml: Simple three-stage pipelinedocker-build.gitlab-ci.yml: Docker build and push workflowmulti-stage.gitlab-ci.yml: Multi-stage pipeline with DAGcomplex-workflow.gitlab-ci.yml: Advanced workflow with all featurescomponent-pipeline.gitlab-ci.yml: NEW - GitLab 17.0+ pipeline using CI/CD components from the CatalogTest the skill with examples:
bash scripts/validate_gitlab_ci.sh examples/basic-pipeline.gitlab-ci.yml
# Test component validation (GitLab 17.0+)
bash scripts/validate_gitlab_ci.sh examples/component-pipeline.gitlab-ci.yml
When encountering custom GitLab features, modules, or specific version requirements, the skill can:
This ensures validation rules stay current with the latest GitLab CI/CD features.
Add custom rules to the validation scripts:
scripts/validate_syntax.pyscripts/check_best_practices.pyscripts/check_security.py# In check_best_practices.py
def _check_custom_rule(self):
"""Check for custom organization rule"""
for job_name, job in self.config.items():
if not self._is_job(job_name):
continue
# Your custom validation logic
if 'tags' not in job:
self.issues.append(BestPracticeIssue(
'warning',
self._get_line(job_name),
f"Job '{job_name}' should specify runner tags",
'custom-missing-tags',
"Add 'tags' to select appropriate runners"
))
# Install PyYAML
pip3 install PyYAML
# Or with homebrew Python
python3 -m pip install PyYAML
# Make scripts executable
chmod +x scripts/*.sh scripts/*.py
Check the documentation:
docs/gitlab-ci-reference.md for syntax referencedocs/common-issues.md for known issuesdocs/best-practices.md for recommended patternsTo improve this skill:
This skill is part of the DevOps Skills collection.
For issues, questions, or contributions:
docs/ directoryexamples/ directoryRemember: This skill validates GitLab CI/CD configurations but does not execute pipelines. Use GitLab's CI Lint tool or gitlab-ci-local for testing actual pipeline execution.
docs/best-practices.md (opens in a new tab)docs/common-issues.md (opens in a new tab)docs/gitlab-ci-reference.md (opens in a new tab)examples/basic-pipeline.gitlab-ci.yml (opens in a new tab)examples/complex-workflow.gitlab-ci.yml (opens in a new tab)examples/component-pipeline.gitlab-ci.yml (opens in a new tab)examples/docker-build.gitlab-ci.yml (opens in a new tab)examples/multi-stage.gitlab-ci.yml (opens in a new tab)scripts/check_best_practices.py (opens in a new tab)scripts/check_security.py (opens in a new tab)scripts/install_tools.sh (opens in a new tab)scripts/python_wrapper.sh (opens in a new tab)scripts/validate_gitlab_ci.sh (opens in a new tab)scripts/validate_syntax.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (gitjfmd/ansible-skills) — no native marketplace selected
npx claudepluginhub p/gitjfmd-devops-skills-devops-skills-plugin31 skills in this plugin
/ansible-generatorComprehensive toolkit for generating best practice Ansible playbooks, roles, tasks, and inventory files./ansible-validatorComprehensive toolkit for validating, linting, testing, and automating Ansible playbooks, roles, and collections. Use this skill when working with Ansible files (.yml, .yaml playbooks, roles, inventories), validating automation code, debugging playbook execution, performing dry-run testing with check mode, or working with custom modules and collections./azure-pipelines-generatorComprehensive toolkit for generating best practice Azure DevOps Pipelines following current standards and conventions. Use this skill when creating new Azure Pipelines, implementing CI/CD workflows, or building deployment pipelines.Other plugins' skills for the same job