**A. PROMPT TEMPLATE (Markdown for humans)**
### Role:
Prompt Architect
### Context:
This template is designed to guide the development of a Python architecture for microservices. It aims to provide clear guidelines for structuring microservices in a scalable, maintainable, and efficient manner.
### Requirements:
- Provide a detailed architecture outline.
- Include common design patterns for microservices in Python.
- Suggest best practices for deployment and communication between services.
- Address security considerations.
### Methodology:
1. **Initial Analysis**: Identify key components and services needed for the architecture.
2. **Design**: Outline the structure, including service interactions, databases, and APIs.
3. **Domain Layer**: Specify constraints and acceptance criteria for the architecture.
4. **Safety Layer**: Include security best practices and error handling strategies.
5. **Refinement**: Ensure clarity and remove ambiguity in the architecture description.
### Validation:
- Ensure all required components are included.
- Check for alignment with microservices principles.
- Validate against common Python frameworks (e.g., Flask, FastAPI).
- Confirm scalability and maintainability considerations are addressed.
### Delivery:
- Format: both JSON and Markdown.
- Sections: Role, Context, Requirements, Methodology, Validation.
---
**B. prompt_template.json (must validate §2.5)**
```json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "PromptTemplate",
"type": "object",
"required": ["role", "context", "requirements", "methodology", "validation", "delivery"],
"properties": {
"role": { "type": "string", "enum": ["Prompt Architect"] },
"context": {
"type": "object",
"properties": {
"description": { "type": "string", "default": "This template is designed to guide the development of a Python architecture for microservices." }
}
},
"requirements": {
"type": "array",
"items": {
"type": "string",
"enum": [
"Provide a detailed architecture outline.",
"Include common design patterns for microservices in Python.",
"Suggest best practices for deployment and communication between services.",
"Address security considerations."
]
}
},
"methodology": {
"type": "array",
"items": {
"type": "string",
"enum": [
"Initial Analysis: Identify key components and services needed for the architecture.",
"Design: Outline the structure, including service interactions, databases, and APIs.",
"Domain Layer: Specify constraints and acceptance criteria for the architecture.",
"Safety Layer: Include security best practices and error handling strategies.",
"Refinement: Ensure clarity and remove ambiguity in the architecture description."
]
}
},
"validation": {
"type": "array",
"items": {
"type": "string",
"enum": [
"Ensure all required components are included.",
"Check for alignment with microservices principles.",
"Validate against common Python frameworks (e.g., Flask, FastAPI).",
"Confirm scalability and maintainability considerations are addressed."
]
}
},
"delivery": {
"type": "object",
"required": ["format", "sections"],
"properties": {
"format": { "type": "string", "enum": ["markdown", "json", "both"] },
"sections": {
"type": "array",
"items": {
"type": "string",
"enum": ["Role", "Context", "Requirements", "Methodology", "Validation"]
}
}
},
"additionalProperties": false
}
},
"delivery": {
"format": "both",
"sections": ["Role", "Context", "Requirements", "Methodology", "Validation"]
}
}
```
This prompt template provides a structured approach to developing a Python architecture for microservices, ensuring clarity, completeness, and adherence to best practices.Loading...