Skill v1.0.1
currentAutomated scan100/1006 files
version: "1.0.1" name: configuration-generator description: "Generate configuration files for applications, services, and infrastructure. Use when: (1) Setting up new projects (package.json, requirements.txt, tsconfig.json), (2) Creating Docker or Kubernetes configurations, (3) Configuring CI/CD pipelines (GitHub Actions, GitLab CI, CircleCI), (4) Setting up web servers (Nginx, Apache), (5) Defining infrastructure as code (Terraform, CloudFormation), (6) Generating linter/formatter configs (ESLint, Prettier, Black). Provides templates and custom-generated configs for diverse tech stacks."
Configuration Generator
Generate configuration files for applications, services, and infrastructure across various formats and frameworks.
Quick Start
Use Built-in Templates
Access ready-to-use configuration templates from assets:
# Docker Composecat assets/docker-compose.yml# Kubernetescat assets/kubernetes-deployment.yaml# GitHub Actionscat assets/github-actions-workflow.yml
Generate Custom Configuration
Specify your requirements to get tailored configuration files.
Common Configuration Types
Application Configurations
Package Managers
Node.js (package.json)
{"name": "my-app","version": "1.0.0","scripts": {"start": "node index.js","dev": "nodemon index.js","test": "jest","build": "tsc"},"dependencies": {"express": "^4.18.0"},"devDependencies": {"typescript": "^5.0.0","jest": "^29.0.0"}}
Python (requirements.txt)
django==4.2.0djangorestframework==3.14.0psycopg2-binary==2.9.5pytest==7.3.0black==23.3.0
See [app_configs.md](references/app_configs.md) for:
- Package managers (npm, pip, cargo)
- Build tools (TypeScript, Webpack, Vite)
- Linters/formatters (ESLint, Prettier, Black)
- Testing frameworks (Jest, pytest)
- Environment files (.env, .editorconfig, .gitignore)
Build Configurations
TypeScript (tsconfig.json)
{"compilerOptions": {"target": "ES2022","module": "commonjs","outDir": "./dist","rootDir": "./src","strict": true,"esModuleInterop": true},"include": ["src/**/*"],"exclude": ["node_modules", "dist"]}
Infrastructure Configurations
Docker
Dockerfile (Multi-stage)
FROM node:18-alpine as builderWORKDIR /appCOPY package*.json ./RUN npm ciCOPY . .RUN npm run buildFROM node:18-alpineWORKDIR /appCOPY --from=builder /app/dist ./distCOPY --from=builder /app/node_modules ./node_modulesUSER nodeEXPOSE 3000CMD ["node", "dist/index.js"]
Docker Compose - See assets/docker-compose.yml:
- Multi-service setup (web, database, cache)
- Environment variable configuration
- Volume management
- Network configuration
Kubernetes
Deployment Configuration - See assets/kubernetes-deployment.yaml:
- Deployment with replicas
- ConfigMap and Secret management
- Service and Ingress configuration
- Health probes
- Resource limits
Example Deployment:
apiVersion: apps/v1kind: Deploymentmetadata:name: web-appspec:replicas: 3selector:matchLabels:app: web-apptemplate:spec:containers:- name: webimage: myapp:latestports:- containerPort: 8000resources:requests:memory: "256Mi"cpu: "250m"limits:memory: "512Mi"cpu: "500m"
See [infra_configs.md](references/infra_configs.md) for:
- Docker and Kubernetes
- Terraform (AWS, GCP, Azure)
- CI/CD pipelines
- Web servers (Nginx, Apache)
CI/CD Pipelines
GitHub Actions - See assets/github-actions-workflow.yml:
- Test, build, and deploy workflow
- Service containers (PostgreSQL, Redis)
- Docker image building
- Deployment automation
Example Workflow:
name: CI/CD Pipelineon:push:branches: [ main ]jobs:test:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v3- uses: actions/setup-python@v4with:python-version: '3.11'- run: pip install -r requirements.txt- run: pytest
Configuration Decision Tree
What type of configuration do you need?├─ Application Config│ ├─ Package manager? → package.json, requirements.txt, Cargo.toml│ ├─ Build tool? → tsconfig.json, webpack.config.js, vite.config.ts│ ├─ Linter/formatter? → .eslintrc, .prettierrc, pyproject.toml│ └─ Environment? → .env, .editorconfig, .gitignore│├─ Container/Orchestration│ ├─ Docker? → Dockerfile, docker-compose.yml│ └─ Kubernetes? → deployment.yaml, service.yaml, ingress.yaml│├─ Infrastructure as Code│ ├─ Terraform? → main.tf, variables.tf, outputs.tf│ └─ CloudFormation? → template.yaml│├─ CI/CD│ ├─ GitHub Actions? → .github/workflows/ci.yml│ ├─ GitLab CI? → .gitlab-ci.yml│ └─ CircleCI? → .circleci/config.yml│└─ Web Server├─ Nginx? → nginx.conf└─ Apache? → httpd.conf, .htaccess
Generation Approaches
Approach 1: Template-Based
Use pre-built templates from assets/:
When to use:
- Standard setups
- Quick prototyping
- Learning/reference
How:
- Identify needed template
- Copy from assets
- Customize variables
- Deploy
Example:
# Copy Docker Compose templatecp assets/docker-compose.yml ./# Edit environment variables# Deploydocker-compose up -d
Approach 2: Requirements-Based Generation
Generate from scratch based on specific needs:
When to use:
- Custom requirements
- Complex setups
- Specific tech stack
How:
- Specify requirements
- Choose tech stack
- Define constraints
- Generate configuration
Example Request: "Generate a GitHub Actions workflow for a Python Django app with PostgreSQL, Redis, and deployment to AWS ECS"
Generated Output: Custom workflow with:
- Python 3.11 setup
- PostgreSQL and Redis services
- Django test suite
- Docker image build
- AWS ECS deployment
Approach 3: Hybrid
Combine templates with customization:
When to use:
- Partially standard setup
- Template needs modification
- Best practices + customization
How:
- Start with template
- Identify customization points
- Modify specific sections
- Validate configuration
Best Practices
1. Use Environment Variables
Separate configuration from code:
Application:
# settings.pyimport osDATABASE_URL = os.getenv('DATABASE_URL')SECRET_KEY = os.getenv('SECRET_KEY')DEBUG = os.getenv('DEBUG', 'False') == 'True'
.env file:
DATABASE_URL=postgresql://localhost/mydbSECRET_KEY=your-secret-keyDEBUG=true
2. Version Control Best Practices
Do commit:
.env.example(template)- Configuration templates
- Development configs
Don't commit:
.env(secrets).env.local(local overrides)- Production credentials
.gitignore:
.env.env.local.env.*.local
3. Validate Configurations
Check syntax before deploying:
# Docker Composedocker-compose config# Kuberneteskubectl apply --dry-run=client -f deployment.yaml# Terraformterraform validate# YAML syntaxyamllint config.yml
4. Document Configuration
Add comments explaining purpose:
# docker-compose.ymlservices:web:# Application server - handles HTTP requestsimage: myapp:latestports:# Expose on port 8000 for development- "8000:8000"environment:# Database connection string- DATABASE_URL=${DATABASE_URL}
5. Use Sensible Defaults
Provide defaults for optional values:
# Kubernetes ConfigMapapiVersion: v1kind: ConfigMapmetadata:name: app-configdata:# Default to info level loggingLOG_LEVEL: "info"# Default connection pool sizeDB_POOL_SIZE: "10"
Common Patterns
Multi-Environment Configuration
Development:
# docker-compose.dev.ymlservices:web:build: .volumes:- ./app:/app # Hot reloadenvironment:- DEBUG=true
Production:
# docker-compose.prod.ymlservices:web:image: registry/myapp:latestenvironment:- DEBUG=falsedeploy:replicas: 3
Secret Management
Kubernetes Secrets:
apiVersion: v1kind: Secretmetadata:name: app-secretstype: OpaquestringData:database-url: "postgresql://..."api-key: "secret-key"
Docker Compose (with env file):
services:web:env_file:- .env.production
Health Checks
Docker Compose:
services:web:healthcheck:test: ["CMD", "curl", "-f", "http://localhost:8000/health"]interval: 30stimeout: 10sretries: 3start_period: 40s
Kubernetes:
livenessProbe:httpGet:path: /healthport: 8000initialDelaySeconds: 30periodSeconds: 10readinessProbe:httpGet:path: /readyport: 8000initialDelaySeconds: 5periodSeconds: 5
Complete Example
Request: "Create complete configuration for a Python FastAPI application with PostgreSQL and Redis, using Docker Compose for development and Kubernetes for production"
Generated Configurations:
- Dockerfile
- docker-compose.yml (development)
- requirements.txt
- kubernetes/deployment.yaml (production)
- .env.example
- .github/workflows/deploy.yml
These files work together to provide:
- Local development environment
- CI/CD pipeline
- Production deployment
- Secret management
- Health monitoring
Troubleshooting
Configuration Validation Errors
YAML syntax errors:
# Check YAML syntaxpython -c "import yaml; yaml.safe_load(open('config.yml'))"# Or use yamllintyamllint config.yml
Docker Compose issues:
# Validate and view resolved configdocker-compose config# Check for errorsdocker-compose config --quiet
Environment Variable Issues
Missing variables:
# List all required variablesgrep -o '\${[^}]*}' docker-compose.yml# Check if variable is setecho $DATABASE_URL
Port Conflicts
Find process using port:
# Linux/macOSlsof -i :8000# Windowsnetstat -ano | findstr :8000
Reference Materials
Application Configs
See [app_configs.md](references/app_configs.md) for complete templates:
- Package managers (package.json, requirements.txt, Pipfile, Cargo.toml)
- Build tools (tsconfig.json, webpack.config.js, vite.config.ts)
- Linters and formatters (.eslintrc, .prettierrc, .flake8, pyproject.toml)
- Testing frameworks (jest.config.js, pytest.ini)
- Environment files (.env.example, .editorconfig, .gitignore)
Infrastructure Configs
See [infra_configs.md](references/infra_configs.md) for:
- Docker (Dockerfile multi-stage, docker-compose.yml, .dockerignore)
- Kubernetes (Deployment, Service, Ingress, ConfigMap, Secret, HPA)
- Terraform (AWS, GCP, Azure infrastructure)
- CI/CD (GitHub Actions, GitLab CI, CircleCI)
- Web servers (Nginx, Apache configuration)