| name | deployment-validation-config-validate |
| description | You are a configuration management expert specializing in validating, testing, and ensuring the correctness of application configurations. Create comprehensive validation schemas, implement configurat |
| category | Document Processing |
| source | antigravity |
| tags | ["python","typescript","api","ai","workflow","document","security","aws","cro"] |
| url | https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/deployment-validation-config-validate |
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
Context
The user needs to validate configuration files, implement configuration schemas, ensure consistency across environments, and prevent configuration-related errors. Focus on creating robust validation rules, type safety, security checks, and automated validation processes.
Requirements
$ARGUMENTS
Instructions
1. Configuration Analysis
Analyze existing configuration structure and identify validation needs:
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({
: (file_path),
: ._detect_config_type(file_path),
: ._detect_environment(file_path)
})
config_files
() -> []:
issues = []
secret_patterns = [
,
,
,
]
config_file ._find_config_files(project_path):
content = Path(config_file[]).read_text()
pattern secret_patterns:
re.search(pattern, content, re.IGNORECASE):
._looks_like_real_secret(content, pattern):
issues.append({
: config_file[],
: ,
:
})
issues
2. Schema Validation
Implement configuration schema validation with JSON Schema:
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', {
: ,
: {
{
(data). === ;
} { ; }
}
});
..(, {
: ,
: data >= && data <=
});
..(, {
: ,
:
});
}
(: , : ): {
validate = ..(schemaName);
(!validate) ();
valid = (configData);
(!valid && validate.) {
{
: ,
: validate..( ({
: error. || ,
: error. || ,
: error.
}))
};
}
{ : };
}
}
schemas = {
: {
: ,
: {
: { : , : },
: { : , : },
: { : , : },
: { : , : },
pas