A comprehensive command-line tool for generating context-aware prompts for AI-assisted code development with enterprise-grade evaluation and web research capabilities.
- Smart Template Engines: MySQL/MariaDB clusters, PostgreSQL HA, Docker Compose, Ansible automation
- Recursive Prompt Generation: Complex task decomposition into manageable subtasks with dependency management
- Database Clustering: Galera clusters, MySQL NDB, master-slave replication with ProxySQL load balancing
- Web Research Integration: Automatic technology discovery and best practices
- Dynamic Generation: Real-time adaptation based on latest documentation
- Intelligent Caching: Performance optimization with 80%+ cache hit rates
- Production Readiness Assessment: 5-dimensional analysis (Security, Performance, Reliability, Maintainability, Compliance)
- HumanEval-DevOps Benchmark: Standardized infrastructure code evaluation
- Security Vulnerability Detection: Pattern-based analysis with CVSS scoring
- Compliance Validation: SOX, PCI-DSS, HIPAA, GDPR, ISO27001 support
- Research-Based Optimization: 85% prompt length reduction with cognitive science principles
- Multi-Technology Support: 40+ technology combinations including MySQL, MariaDB, PostgreSQL, Docker, Kubernetes
- Task-First Architecture: Optimized for AI model attention mechanisms
- Interactive CLI: Guided prompt creation with shell autocomplete
git clone https://github.com/lollonet/Prompt-Eng.git
cd Prompt-Eng
python3 -m venv venv
source venv/bin/activate # Linux/Mac
pip install -r requirements.txt# Traditional prompt generation
python main.py --tech python fastapi --task "REST API development"
# AI-powered template generation
python main_modern.py --technology "prometheus grafana" --description "monitoring system"
# Recursive prompt generation for complex systems
python examples/recursive_generation_demo.py
# Generate with production evaluation
python main_modern.py --technology "postgres patroni" --description "HA database" --evaluate
# Test evaluation frameworks
python test_evaluation_frameworks.pyπ Prompt-Eng/
βββ π― prompts/ # Optimized prompt templates
β βββ base_prompts/ # Core templates (1,800 chars avg)
β βββ language_specific/ # Python, JavaScript, etc.
β βββ framework_specific/ # React, FastAPI, etc.
βββ π§ src/
β βββ prompt_generator.py # Traditional prompt generation
β βββ prompt_generator_modern.py # AI-enhanced generation
β βββ recursive_prompt_generator.py # Complex task decomposition
β βββ π web_research/ # Web research & AI engines
β β βββ web_researcher.py # Technology research
β β βββ technology_detector.py # Auto tech detection
β β βββ template_engines/ # AI template generators
β β βββ docker_engine.py # Docker Compose AI
β β βββ ansible_engine.py # Ansible playbook AI
β β βββ kubernetes_engine.py # Kubernetes manifests AI
β β βββ infrastructure_engine.py # Cloud infrastructure AI
β βββ π‘οΈ evaluation/ # Enterprise evaluation
β βββ production_readiness.py # 5-dimensional analysis
β βββ humaneval_devops.py # DevOps benchmarking
β βββ evaluation_types.py # Common types & enums
βββ π knowledge_base/ # Best practices & tools
βββ βοΈ config/ # Technology mappings
βββ π§ͺ test_evaluation_frameworks.py # Comprehensive tests
# Generate MySQL Galera cluster with monitoring
python main.py --tech mariadb galera proxysql \
--task "high availability database cluster" \
--cluster-size 3 --ha-setup --monitoring-stack prometheus grafana \
--auto-research
# Create PostgreSQL HA cluster
python main.py --tech patroni postgresql \
--cluster-size 3 --distro rhel9 \
--auto-research
# Generate Docker Compose with monitoring
python main.py --tech docker nginx postgres prometheus \
--task "web application with monitoring" \
--auto-research
# Create Ansible playbook for server setup
python main.py --tech ansible \
--task "database and monitoring setup" \
--distro rhel9 --cluster-size 5 \
--auto-researchfrom src.recursive_prompt_generator import RecursivePromptGenerator, ComplexTask, TaskComplexity
from src.types_advanced import create_technology_name
# Define complex e-commerce platform
task = ComplexTask(
name="E-commerce Microservices Platform",
description="Build complete e-commerce platform with user management, product catalog, order processing",
technologies=[
create_technology_name("react"),
create_technology_name("nodejs"),
create_technology_name("postgresql"),
create_technology_name("docker"),
create_technology_name("kubernetes")
],
requirements=["user authentication", "product catalog", "order management", "payment processing"],
constraints={"timeline": "6_months", "team_size": "8_developers"},
target_complexity=TaskComplexity.ENTERPRISE
)
# Generate hierarchical decomposition
result = await recursive_generator.generate_recursive_prompt(task)
if result.is_success():
composite_prompt = result.unwrap()
print(f"Generated {len(composite_prompt.subtask_prompts)} subtasks")
print(f"Confidence: {composite_prompt.confidence_score:.2f}")Output includes:
- Subtask Breakdown: User Service, Product Service, Order Service, Infrastructure
- Integration Guide: API contracts, data flow, service communication
- Deployment Instructions: Step-by-step deployment with dependencies
- Architecture Overview: Complete system architecture documentation
from src.evaluation import ProductionReadinessEvaluator, EvalContext, TemplateType
# Evaluate template for production readiness
evaluator = ProductionReadinessEvaluator()
context = EvalContext(
template_type=TemplateType.DOCKER_COMPOSE,
target_environment="production",
technology_stack=["docker", "nginx", "postgresql"],
security_requirements=[ComplianceStandard.PCI_DSS]
)
result = evaluator.evaluate(template_content, context)
print(f"Production Score: {result.overall_score:.3f}")
print(f"Security Issues: {len(result.get_critical_issues())}")
print(f"Ready: {result.is_production_ready()}")from src.evaluation import DevOpsEvaluator
# Run standardized DevOps benchmark
evaluator = DevOpsEvaluator()
results = evaluator.evaluate_template_engine(my_generator_function)
print(f"Benchmark Pass Rate: {results['summary']['pass_rate']:.1%}")- Vulnerability Detection: Hardcoded secrets, privilege escalation, network exposure
- Compliance Standards: Automated validation for multiple frameworks
- Risk Assessment: CRITICAL/HIGH/MEDIUM/LOW classification with CVSS scores
- Security Recommendations: Actionable remediation guidance
- Resource Analysis: Memory/CPU limits, scaling configurations
- Availability Assessment: Health checks, backup strategies, failover mechanisms
- Performance Optimization: Caching, connection pooling, monitoring coverage
- Production Readiness: Weighted scoring across all dimensions
- Infrastructure: RHEL9, Docker, Kubernetes, Ansible
- Databases: PostgreSQL, Patroni, etcd, Redis
- Monitoring: Prometheus, Grafana, VictoriaMetrics, Alertmanager
- Development: Python, FastAPI, React, TypeScript
- Security: FIPS 140-2, SELinux, TLS/SSL, OAuth2/JWT
| Feature | Performance | Details |
|---|---|---|
| Traditional Prompts | <0.1s generation | 85% size reduction, 95%+ success rate |
| AI Template Generation | 5-15s complex infra | 0.85+ confidence, 80% cache hit rate |
| Recursive Decomposition | 10-30s enterprise tasks | 3-10 subtasks, dependency-aware ordering |
| Security Analysis | <1s per template | 95% vulnerability detection accuracy |
| Compliance Validation | <0.5s per standard | SOX, PCI-DSS, HIPAA, GDPR, ISO27001 |
| DevOps Benchmark | 3-10min complete | Standardized infrastructure testing |
# Test evaluation frameworks
python test_evaluation_frameworks.py
# Test recursive generation system
python -m pytest tests/unit/test_recursive_prompt_generator.py -v
# Test template engines
python -m pytest tests/unit/test_template_engines.py -v
# Test individual components
python -m pytest tests/ -v
# Enterprise scenario testing
python test_enterprise_demo.py
# Run recursive generation demo
python examples/recursive_generation_demo.pyπ HumanEval-DevOps Benchmark Results
==========================================
Total Tasks: 3
Passed Tasks: 2
Pass Rate: 66.7%
Average Score: 0.642
π Production Readiness Report
==============================
Overall Score: 0.660/1.0
Security Score: 0.789
Performance Score: 0.654
Reliability Score: 0.712
β
Production Ready: True
# .github/workflows/template-quality.yml
name: Template Quality Check
on: [push, pull_request]
jobs:
evaluate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run evaluation framework
run: python test_evaluation_frameworks.py# Enterprise API wrapper example
from src.evaluation import ProductionReadinessEvaluator
from src.web_research.template_engines.docker_engine import DockerTemplateEngine
class EnterpriseTemplateService:
def __init__(self):
self.generator = DockerTemplateEngine()
self.evaluator = ProductionReadinessEvaluator()
async def generate_and_evaluate(self, requirements):
# Generate template
template = await self.generator.generate_template(requirements)
# Evaluate production readiness
evaluation = self.evaluator.evaluate(template.content, requirements.context)
return {
'template': template.content,
'confidence': template.confidence_score,
'production_score': evaluation.overall_score,
'security_issues': evaluation.get_critical_issues(),
'recommendations': evaluation.get_high_priority_recommendations(),
'deployment_ready': evaluation.is_production_ready()
}from src.web_research.template_engines.base_engine import BaseTemplateEngine
class MyCustomEngine(BaseTemplateEngine):
def can_handle(self, context: TemplateContext) -> bool:
return 'my-technology' in context.technology
async def generate_template(self, context: TemplateContext) -> TemplateResult:
# Your implementation
passfrom src.evaluation.evaluation_types import EvaluationMetrics
class CustomAnalyzer:
def analyze(self, template: str, context: EvalContext) -> EvaluationMetrics:
# Your custom analysis logic
return EvaluationMetrics(score=calculated_score, issues=found_issues)- Complete Usage Guide - Comprehensive documentation with examples
- API Reference - Detailed code documentation
- Enterprise Examples - Real-world scenarios
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Add comprehensive tests for new functionality
- Follow enterprise coding standards (documented in knowledge_base/)
- Submit pull request with detailed description
# Setup development environment
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pre-commit install # If using pre-commit hooks
# Run tests
python -m pytest tests/ -v
python test_evaluation_frameworks.py- Kubernetes Template Engine - Advanced orchestration support
- Terraform Integration - Infrastructure as Code generation
- Real-time Collaboration - Multi-user template development
- Advanced ML Models - Custom training for domain-specific generation
- Enterprise SSO - Authentication and authorization integration
- Audit Logging - Comprehensive compliance tracking
This project is licensed under the MIT License - see the LICENSE file for details.
- Cognitive Science Research - Prompt optimization principles
- HumanEval Methodology - Benchmark framework inspiration
- Enterprise Security Standards - Compliance framework guidelines
- Open Source Community - Tools and libraries that make this possible
π Ready to revolutionize your infrastructure code generation?
Get Started β’ View Examples β’ Enterprise Demo
Built with β€οΈ for enterprise developers