Comprehensive developer toolkit providing reusable skills for Java/Spring Boot, TypeScript/NestJS/React/Next.js, Python, PHP, AWS CloudFormation, AI/RAG, DevOps, and more.
82
82%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Risky
Do not use without reviewing
This reference provides comprehensive frameworks for building modular, reusable prompt templates with variable interpolation, conditional sections, and hierarchical composition.
{user_input} - Direct input from user
{context} - Background information
{examples} - Few-shot learning examples
{constraints} - Task limitations and requirements
{output_format} - Desired output structure
{role} - AI role or persona
{expertise_level} - Level of expertise for the role
{domain} - Specific domain or field
{difficulty} - Task complexity level
{language} - Output language specification# Template: Universal Task Framework
# Purpose: Base template for most task types
# Variables: {role}, {task_description}, {context}, {examples}, {output_format}
## System Instructions
You are a {role} with {expertise_level} expertise in {domain}.
## Context Information
{if context}
Background and relevant context:
{context}
{endif}
## Task Description
{task_description}
## Examples
{if examples}
Here are some examples to guide your response:
{examples}
{endif}
## Output Requirements
{output_format}
## Constraints and Guidelines
{constraints}
## User Input
{user_input}def process_conditional_template(template, variables):
"""
Process template with conditional sections.
"""
# Process if/endif blocks
while '{if ' in template:
start = template.find('{if ')
end_condition = template.find('}', start)
condition = template[start+4:end_condition].strip()
start_endif = template.find('{endif}', end_condition)
if_content = template[end_condition+1:start_endif].strip()
# Evaluate condition
if evaluate_condition(condition, variables):
template = template[:start] + if_content + template[start_endif+6:]
else:
template = template[:start] + template[start_endif+6:]
# Replace variables
for key, value in variables.items():
template = template.replace(f'{{{key}}}', str(value))
return templateclass TemplateEngine:
def __init__(self):
self.variables = {}
self.functions = {
'upper': str.upper,
'lower': str.lower,
'capitalize': str.capitalize,
'pluralize': self.pluralize,
'format_date': self.format_date,
'truncate': self.truncate
}
def set_variable(self, name, value):
"""Set a template variable."""
self.variables[name] = value
def render(self, template):
"""Render template with variable substitution."""
# Process function calls {variable|function}
template = self.process_functions(template)
# Replace variables
for key, value in self.variables.items():
template = template.replace(f'{{{key}}}', str(value))
return template
def process_functions(self, template):
"""Process template functions."""
import re
pattern = r'\{(\w+)\|(\w+)\}'
def replace_function(match):
var_name, func_name = match.groups()
value = self.variables.get(var_name, '')
if func_name in self.functions:
return self.functions[func_name](str(value))
return value
return re.sub(pattern, replace_function, template)# Template: Multi-Class Classification
# Purpose: Classify inputs into predefined categories
# Required Variables: {input_text}, {categories}, {role}
## Classification Framework
You are a {role} specializing in accurate text classification.
## Classification Categories
{categories}
## Classification Process
1. Analyze the input text carefully
2. Identify key indicators and features
3. Match against category definitions
4. Select the most appropriate category
5. Provide confidence score
## Input to Classify
{input_text}
## Output Format
```json
{{
"category": "selected_category",
"confidence": 0.95,
"reasoning": "Brief explanation of classification logic",
"key_indicators": ["indicator1", "indicator2"]
}}### 2. Transformation TemplateTransform the given {source_format} text into {target_format} following these rules: {transformation_rules}
{source_text}
### 3. Generation TemplateGenerate {content_type} that meets the following specifications:
{specifications}
{style_guidelines}
### 4. Analysis TemplateYou are an expert analyst with deep expertise in {domain}.
Focus on these key areas: {focus_areas}
{analysis_framework}
{input_data}
executive_summary:
key_findings: []
overall_assessment: ""
detailed_analysis:
{focus_area_1}:
observations: []
patterns: []
insights: []
{focus_area_2}:
observations: []
patterns: []
insights: []
recommendations:
immediate: []
short_term: []
long_term: []class HierarchicalTemplate:
def __init__(self, name, content, parent=None):
self.name = name
self.content = content
self.parent = parent
self.children = []
self.variables = {}
def add_child(self, child_template):
"""Add a child template."""
child_template.parent = self
self.children.append(child_template)
def render(self, variables=None):
"""Render template with inherited variables."""
# Combine variables from parent hierarchy
combined_vars = {}
# Collect variables from parents
current = self.parent
while current:
combined_vars.update(current.variables)
current = current.parent
# Add current variables
combined_vars.update(self.variables)
# Override with provided variables
if variables:
combined_vars.update(variables)
# Render content
rendered_content = self.render_content(self.content, combined_vars)
# Render children
for child in self.children:
child_rendered = child.render(combined_vars)
rendered_content = rendered_content.replace(
f'{{child:{child.name}}}', child_rendered
)
return rendered_contentclass RoleBasedTemplate:
def __init__(self):
self.roles = {
'analyst': {
'persona': 'You are a professional analyst with expertise in data interpretation and pattern recognition.',
'approach': 'systematic',
'output_style': 'detailed and evidence-based',
'verification': 'Always cross-check findings and cite sources'
},
'creative_writer': {
'persona': 'You are a creative writer with a talent for engaging storytelling and vivid descriptions.',
'approach': 'imaginative',
'output_style': 'descriptive and engaging',
'verification': 'Ensure narrative consistency and flow'
},
'technical_expert': {
'persona': 'You are a technical expert with deep knowledge of {domain} and practical implementation experience.',
'approach': 'methodical',
'output_style': 'precise and technical',
'verification': 'Include technical accuracy and best practices'
}
}
def create_prompt(self, role, task, domain=None):
"""Create role-specific prompt template."""
role_config = self.roles.get(role, self.roles['analyst'])
template = f"""
## Role Definition
{role_config['persona']}
## Approach
Use a {role_config['approach']} approach to this task.
## Task
{task}
## Output Style
{role_config['output_style']}
## Verification
{role_config['verification']}
"""
if domain and '{domain}' in role_config['persona']:
template = template.replace('{domain}', domain)
return templateclass DynamicTemplateSelector:
def __init__(self):
self.templates = {}
self.selection_rules = {}
def register_template(self, name, template, selection_criteria):
"""Register a template with selection criteria."""
self.templates[name] = template
self.selection_rules[name] = selection_criteria
def select_template(self, task_characteristics):
"""Select the most appropriate template based on task characteristics."""
best_template = None
best_score = 0
for name, criteria in self.selection_rules.items():
score = self.calculate_match_score(task_characteristics, criteria)
if score > best_score:
best_score = score
best_template = name
return self.templates[best_template] if best_template else None
def calculate_match_score(self, task_characteristics, criteria):
"""Calculate how well task matches template criteria."""
score = 0
total_weight = 0
for characteristic, weight in criteria.items():
if characteristic in task_characteristics:
if task_characteristics[characteristic] == weight['value']:
score += weight['weight']
total_weight += weight['weight']
return score / total_weight if total_weight > 0 else 0customer_service_template = """
# Customer Service Response Template
## Role Definition
You are a {customer_service_role} with {experience_level} of customer service experience in {industry}.
## Context
{if customer_history}
Customer History:
{customer_history}
{endif}
{if issue_context}
Issue Context:
{issue_context}
{endif}
## Response Guidelines
- Maintain {tone} tone throughout
- Address all aspects of the customer's inquiry
- Provide {level_of_detail} explanation
- Include {additional_elements}
- Follow company {communication_style} style
## Customer Inquiry
{customer_inquiry}
## Response Structure
1. Greeting and acknowledgment
2. Understanding and empathy
3. Solution or explanation
4. Additional assistance offered
5. Professional closing
## Response
"""documentation_template = """
# Technical Documentation Generator
## Role Definition
You are a {technical_writer_role} specializing in {technology} documentation with {experience_level} of experience.
## Documentation Standards
- Target audience: {audience_level}
- Technical depth: {technical_depth}
- Include examples: {include_examples}
- Add troubleshooting: {add_troubleshooting}
- Version: {version}
## Content to Document
{content_to_document}
## Documentation Structure
```markdown
# {title}
## Overview
{overview}
## Prerequisites
{prerequisites}
## {main_sections}
## Examples
{if include_examples}
{examples}
{endif}
## Troubleshooting
{if add_troubleshooting}
{troubleshooting}
{endif}
## Additional Resources
{additional_resources}"""
## Template Management System
### Version Control Integration
```python
class TemplateVersionManager:
def __init__(self):
self.versions = {}
self.current_versions = {}
def create_version(self, template_name, template_content, author, description):
"""Create a new version of a template."""
import datetime
import hashlib
version_id = hashlib.md5(template_content.encode()).hexdigest()[:8]
timestamp = datetime.datetime.now().isoformat()
version_info = {
'version_id': version_id,
'content': template_content,
'author': author,
'description': description,
'timestamp': timestamp,
'parent_version': self.current_versions.get(template_name)
}
if template_name not in self.versions:
self.versions[template_name] = []
self.versions[template_name].append(version_info)
self.current_versions[template_name] = version_id
return version_id
def rollback(self, template_name, version_id):
"""Rollback to a specific version."""
if template_name in self.versions:
for version in self.versions[template_name]:
if version['version_id'] == version_id:
self.current_versions[template_name] = version_id
return version['content']
return Noneclass TemplatePerformanceMonitor:
def __init__(self):
self.usage_stats = {}
self.performance_metrics = {}
def track_usage(self, template_name, execution_time, success):
"""Track template usage and performance."""
if template_name not in self.usage_stats:
self.usage_stats[template_name] = {
'usage_count': 0,
'total_time': 0,
'success_count': 0,
'failure_count': 0
}
stats = self.usage_stats[template_name]
stats['usage_count'] += 1
stats['total_time'] += execution_time
if success:
stats['success_count'] += 1
else:
stats['failure_count'] += 1
def get_performance_report(self, template_name):
"""Generate performance report for a template."""
if template_name not in self.usage_stats:
return None
stats = self.usage_stats[template_name]
avg_time = stats['total_time'] / stats['usage_count']
success_rate = stats['success_count'] / stats['usage_count']
return {
'template_name': template_name,
'total_usage': stats['usage_count'],
'average_execution_time': avg_time,
'success_rate': success_rate,
'failure_rate': 1 - success_rate
}This comprehensive template system architecture provides the foundation for building scalable, maintainable prompt templates that can be efficiently managed and optimized across diverse use cases.
plugins
developer-kit-ai
skills
chunking-strategy
prompt-engineering
developer-kit-aws
skills
aws
aws-cli-beast
aws-cost-optimization
aws-drawio-architecture-diagrams
aws-sam-bootstrap
aws-cloudformation
aws-cloudformation-auto-scaling
references
aws-cloudformation-bedrock
references
aws-cloudformation-cloudfront
references
aws-cloudformation-cloudwatch
references
aws-cloudformation-dynamodb
references
aws-cloudformation-ec2
aws-cloudformation-ecs
references
aws-cloudformation-elasticache
aws-cloudformation-iam
references
aws-cloudformation-lambda
references
aws-cloudformation-rds
aws-cloudformation-s3
references
aws-cloudformation-security
references
aws-cloudformation-task-ecs-deploy-gh
aws-cloudformation-vpc
developer-kit-core
skills
developer-kit-java
skills
aws-lambda-java-integration
aws-rds-spring-boot-integration
aws-sdk-java-v2-bedrock
aws-sdk-java-v2-core
aws-sdk-java-v2-dynamodb
aws-sdk-java-v2-kms
aws-sdk-java-v2-lambda
aws-sdk-java-v2-messaging
aws-sdk-java-v2-rds
aws-sdk-java-v2-s3
aws-sdk-java-v2-secrets-manager
graalvm-native-image
langchain4j
langchain4j-mcp-server-patterns
langchain4j-ai-services-patterns
references
langchain4j-mcp-server-patterns
references
langchain4j-rag-implementation-patterns
references
langchain4j-spring-boot-integration
langchain4j-testing-strategies
langchain4j-tool-function-calling-patterns
langchain4j-vector-stores-configuration
references
qdrant
references
spring-ai-mcp-server-patterns
references
spring-boot-actuator
spring-boot-cache
spring-boot-crud-patterns
spring-boot-dependency-injection
spring-boot-event-driven-patterns
spring-boot-openapi-documentation
spring-boot-project-creator
spring-boot-resilience4j
spring-boot-rest-api-standards
spring-boot-saga-pattern
spring-boot-security-jwt
assets
references
scripts
spring-boot-test-patterns
spring-data-jpa
references
spring-data-neo4j
references
unit-test-application-events
unit-test-bean-validation
unit-test-boundary-conditions
unit-test-caching
unit-test-config-properties
unit-test-controller-layer
unit-test-exception-handler
unit-test-json-serialization
unit-test-mapper-converter
unit-test-parameterized
unit-test-scheduled-async
unit-test-service-layer
unit-test-utility-methods
unit-test-wiremock-rest-api
developer-kit-php
skills
aws-lambda-php-integration
developer-kit-python
skills
aws-lambda-python-integration
developer-kit-tools
developer-kit-typescript
skills
aws-lambda-typescript-integration
better-auth
drizzle-orm-patterns
dynamodb-toolbox-patterns
references
nestjs
nestjs-best-practices
nestjs-code-review
nestjs-drizzle-crud-generator
scripts
nextjs-app-router
nextjs-authentication
nextjs-code-review
nextjs-data-fetching
references
nextjs-deployment
nextjs-performance
nx-monorepo
react-code-review
react-patterns
references
shadcn-ui
tailwind-css-patterns
references
tailwind-design-system
references
turborepo-monorepo
typescript-docs
typescript-security-review
zod-validation-utilities