domains / devops / config-validation / deployment-validation-config-validate

deployment-validation-config-validate

Skill card

combined

The first copy is a self-contained, executable procedure with concrete Python and TypeScript code for analyzing config files, detecting secrets, and validating schemas. The second copy is a thin wrapper that defers to an external 'detailed-guide.md' and adds risk/limitation metadata but contains no executable steps. Because the second copy lacks the actual procedure and the first lacks the second's explicit risk/limitation framing, crowning one would hide a real alternative (the external guide) or omit the executable steps.

Repositories

RepositoryPath
rmyndharis/antigravity-skillsskills/deployment-validation-config-validate/SKILL.md
sickn33/agentic-awesome-skillsplugins/agentic-awesome-skills-claude/skills/deployment-validation-config-validate/SKILL.md

Other copies

RoleRepositoryPath
peerrmyndharis/antigravity-skillsskills/deployment-validation-config-validate/SKILL.md
peersickn33/agentic-awesome-skillsplugins/agentic-awesome-skills-claude/skills/deployment-validation-config-validate/SKILL.md
adaptersickn33/agentic-awesome-skillsplugins/agentic-awesome-skills/skills/deployment-validation-config-validate/SKILL.md
adaptersickn33/agentic-awesome-skillsskills/deployment-validation-config-validate/SKILL.md

Combined skill

---
name: deployment-validation-config-validate
description: "Validate application configuration with schemas, environment checks, and runtime tests. Use when preventing configuration errors, checking deployment settings, or detecting configuration drift."
risk: critical
source: community
---

# Configuration Validation

You are a configuration management expert specializing in validating, testing, and ensuring the correctness of application configurations. Create comprehensive validation schemas, implement configuration testing strategies, and ensure configurations are secure, consistent, and error-free across all environments.

## Use this skill when

- Working on configuration validation tasks or workflows
- Needing guidance, best practices, or checklists for configuration validation

## Do not use this skill when

- The task is unrelated to configuration validation
- You need a different domain or tool outside this scope

## Limitations

- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

## Instructions

### 1. Configuration Analysis

Analyze existing configuration structure and identify validation needs:

```python
import os
import yaml
import json
from pathlib import Path
from typing import Dict, List, Any

class ConfigurationAnalyzer:
    def analyze_project(self, project_path: str) -> Dict[str, Any]:
        analysis = {
            'config_files': self._find_config_files(project_path),
            'security_issues': self._check_security_issues(project_path),
            'consistency_issues': self._check_consistency(project_path),
            'recommendations': []
        }
        return analysis

    def _find_config_files(self, project_path: str) -> List[Dict]:
        config_patterns = [
            '**/*.json', '**/*.yaml', '**/*.yml', '**/*.toml',
            '**/*.ini', '**/*.env*', '**/config.js'
        ]

        config_files = []
        for pattern in config_patterns:
            for file_path in Path(project_path).glob(pattern):
                if not self._should_ignore(file_path):
                    config_files.append({
                        'path': str(file_path),
                        'type': self._detect_config_type(file_path),
                        'environment': self._detect_environment(file_path)
                    })
        return config_files

    def _check_security_issues(self, project_path: str) -> List[Dict]:
        issues = []
        secret_patterns = [
            r'(api[_-]?key|apikey)',
            r'(secret|password|passwd)',
            r'(token|auth)',
            r'(aws[_-]?access)'
        ]

        for config_file in self._find_config_files(project_path):
            content = Path(config_file['path']).read_text()
            for pattern in secret_patterns:
                if re.search(pattern, content, re.IGNORECASE):
                    if self._looks_like_real_secret(content, pattern):
                        issues.append({
                            'file': config_file['path'],
                            'type': 'potential_secret',
                            'severity': 'high'
                        })
        return issues
```

### 2. Schema Validation

Implement configuration schema validation with JSON Schema:

```typescript
import Ajv from 'ajv';
import ajvFormats from 'ajv-formats';
import { JSONSchema7 } from 'json-schema';

interface ValidationResult {
  valid: boolean;
  errors?: Array<{
    path: string;
    message: string;
    keyword: string;
  }>;
}

export class ConfigValidator {
  private ajv: Ajv;

  constructor() {
    this.ajv = new Ajv({
      allErrors: true,
      strict: false,
      coerceTypes: true
    });
    ajvFormats(this.ajv);
    this.addCustomFormats();
  }

  private addCustomFormats() {
    this.ajv.addFormat('url-https', {
      type: 'string',
      validate: (data: string) => {
        try {
          return new URL(data).protocol === 'https:';
        } catch { return false; }
      }
    });

    this.ajv.addFormat('port', {
      type: 'number',
      validate: (data: number) => data >= 1 && data <= 65535
    });

    this.ajv.addFormat('duration', {
      type: 'string',
      validate: /^\d+[smhd]$/
    });
  }

  validate(configData: any, schemaName: string): ValidationResult {
    const validate = this.ajv.getSchema(schemaName);
    if (!validate) throw new Error(`Schema '${schemaName}' not found`);

    const valid = validate(configData);

    if (!valid && validate.errors) {
      return {
        valid: false,
        errors: validate.errors.map(error => ({
          path: error.instancePath || '/',
          message: error.message || 'Validation error',
          keyword: error.keyword
        }))
      };
    }
    return { valid: true };
  }
}

// Example schema
export const schemas = {
  database: {
    type: 'object',
    properties: {
      host: { type: 'string', format: 'hostname' },
      port: { type: 'integer', format: 'port' },
      database: { type: 'string', minLength: 1 },
      user: { type: 'string', minLength: 1 },
      password: { type: 'string', minLength: 8 },
      ssl: {
        type: 'object',
        properties: {
          enabled: { type: 'boolean' }
        },
        required: ['enabled']
      }
    },
    required: ['host', 'port', 'database', 'user', 'password']
  }
};
```

### 3. Environment-Specific Validation

```python
from typing import Dict, List, Any

class EnvironmentValidator:
    def __init__(self):
        self.environments = ['development', 'staging', 'production']
        self.environment_rules = {
            'development': {
                'allow_debug': True,
                'require_https': False,
                'min_password_length': 8
            },
            'production': {
                'allow_debug': False,
                'require_https': True,
                'min_password_length': 12
            }
        }
```

## Conflicts

- **sickn33/agentic-awesome-skills**: This copy instructs the agent to read an external `references/detailed-guide.md` before executing and treats its safety, prerequisites, and validation requirements as mandatory. The rmyndharis/antigravity-skills copy contains no such external reference and instead embeds the full procedure inline. If the external guide is unavailable, the inline procedure above should be used as the authoritative source.
- **sickn33/agentic-awesome-skills**: This copy adds a `risk: critical` metadata field and a `Limitations` section requiring the agent to stop and ask for clarification if inputs, permissions, safety boundaries, or success criteria are missing. The rmyndharis/antigravity-skills copy has no risk field and no explicit stop-and-ask limitation. The combined instruction retains the risk field and limitations from the sickn33 copy.