writing-skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
config-generatorDynamic configuration file generator for any environment. Generate nginx, apache, docker-compose, k8s manifests from templates. Use when: generate config, create manifest, template config, nginx config
Independent GitHub snapshot · Automated classification · Original documentation governs
name: config-generator description: | Dynamic configuration file generator for any environment. Generate nginx, apache, docker-compose, k8s manifests from templates.
Generate production-ready configuration files from smart templates.
config-generator/
├── SKILL.md
└── scripts/
└── config_generator.py # Core generator implementation
/config-generator nginx --domain myapp.com
/config-generator docker-compose --services web,db,redis
/config-generator kubernetes --replicas 3
To generate a configuration, simply run:
from scripts.config_generator import generate_config
# Generate nginx config
config = generate_config("nginx", domain="myapp.com")
print(config)
That's it! The generate_config() function handles everything automatically.
generate_config(template_name, **kwargs)The main function for configuration generation:
from scripts.config_generator import generate_config, ConfigGenerator
# Simple usage
config = generate_config("nginx", domain="myapp.com")
# Advanced usage with custom template directory
generator = ConfigGenerator(template_dir="./my_templates")
config = generator.generate("custom-template", var1="value1")
ConfigGenerator ClassThe main generator class with template processing capabilities:
from scripts.config_generator import ConfigGenerator
generator = ConfigGenerator()
# Load template
template = generator.load_template("nginx")
# Process with variables
result = generator.process_template(template, {"domain": "example.com"})
Templates support variable interpolation and code blocks:
# nginx.conf template
server {
listen 80;
server_name {{% result = vars["domain"] %}};
root /var/www/html;
}
| Option | Description | Default |
|---|---|---|
| template_dir | Directory for local templates | "./templates" |
| variables | Key-value pairs for substitution | {} |
Configuration as Code - done right