Rules for organizing, versioning, and testing prompt templates in production applications that use DeepSeek models.
## Prompt Template Management Rules
### Organization
- Store prompt templates in a dedicated directory: /prompts/ or /src/prompts/
- One file per prompt template with a descriptive name
- Use a consistent format: Markdown (.md), Jinja2 (.j2), or Handlebars (.hbs)
- Include metadata in frontmatter: version, model, author, last_tested_date
### Versioning
- Version prompts independently from application code
- Use semantic versioning: major (breaking change), minor (improvement), patch (typo fix)
- Keep a changelog for each prompt template
- A/B test new versions before full rollout
- Maintain a rollback capability to the previous version
### Template Structure
```
---
version: 1.2.0
model: deepseek-chat
temperature: 0.6
max_tokens: 2048
author: team-name
last_tested: 2026-04-01
---
## Role
[Define the AI's role and expertise]
## Context
[Provide relevant background information]
{{context_variable}}
## Task
[Describe exactly what needs to be done]
{{task_description}}
## Output Format
[Specify the exact format expected]
## Constraints
[List any limitations or rules]
```
### Testing
- Create evaluation datasets for each prompt template
- Test with diverse inputs covering edge cases
- Measure quality metrics: accuracy, relevance, format compliance
- Set quality thresholds: template must score >80% on evaluation set
- Run regression tests when updating templates
### Anti-Patterns
- Do not hardcode prompts as string literals in application code
- Do not modify prompts without testing
- Do not use the same prompt for fundamentally different tasks
- Do not include sensitive data in template examplesSystem rules for designing inter-service communication in microservices architectures with DeepSeek Coder, covering sync/async patterns, error handling, and resilience.
System rules for generating content in multiple languages with DeepSeek V3, covering translation quality, cultural adaptation, locale-specific formatting, and quality assurance.
System rules for safe code refactoring with DeepSeek R1, requiring test coverage verification, incremental changes, and behavior preservation checks.
System rules for using DeepSeek V3 to generate clear, maintainable technical documentation including API docs, architecture docs, and onboarding guides.
System rules for DeepSeek Coder to generate optimized database queries, with requirements for EXPLAIN analysis, indexing recommendations, and performance targets.
System rules for using DeepSeek V3 to generate infrastructure code, CI/CD pipelines, and operational runbooks with security and reliability best practices.