nexent's full system prompt: 4 versions, 31,553 characters. Audited against AISPA.
The full text of 4
prompts is reproduced below,
31,553 characters in all, each read
instruction by instruction against the eight
AISPA dimensions.
Nothing was flagged as working against the person on
the other end.
# Prompt Writing Best Practices
This document provides comprehensive guidelines for creating high-quality YAML prompts.
## 1. YAML Syntax Fundamentals
### Multi-line String Handling
| Syntax | Use Case | Example |
|--------|----------|---------|
| `\|-` | System prompts (strips trailing newline) | `system_prompt: \|-` |
| `|` | User prompts (preserves newlines) | `user_prompt: \|` |
| `>` | Long single lines (rarely used) | `description: >` |
### Indentation Rules
- Use 2 spaces for indentation (no tabs)
- Nested structures under each field
- List items align at parent level
```yaml
system_prompt: |-
### Section Title
Content here.
- List item 1
Nested item (2 spaces)
- List item 2
```
## 2. Structure Guidelines
### Heading Hierarchy
Use headings to create logical sections:
```yaml
system_prompt: |-
### Primary Section (most important)
Core role and primary responsibilities.
### Secondary Section
Additional requirements.
## Less Important Section
Background context.
### Specific Guidelines
- Concrete rules
```
**Rules:**
- Never skip heading levels (e.g., `###` to `#####`)
- Maximum heading depth: `####` for most prompts
- Use `###` for major sections, `####` for subsections
### Separator Usage
Separators (`---`, `***`) create visual clutter and should be avoided:
**DO:**
```yaml
system_prompt: |-
### Requirements
1. Be concise
2. Be clear
### Output Format
Plain text response.
```
**DON'T:**
```yaml
system_prompt: |-
### Requirements
1. Be concise
2. Be clear
---
### Output Format
Plain text response.
***
Additional notes.
```
**Exception:** Use `---` only when truly separating distinct document types or sections in complex templates.
## 3. Writing Style
### Sentence Structure
**DO:**
- Use active voice: "You are a helpful assistant."
- Be direct: "Generate a summary."
- Keep sentences under 25 words.
**DON'T:**
- Passive voice: "A summary should be generated by you."
- Vague instructions: "Maybe you could try to..."
- Run-on sentences.
### Conciseness Principles
**Before (verbose):**
```
You are a document summarization assistant and your main job and responsibility is to read through the document that is provided to you and create a summary of it. You should make sure to...
```
**After (concise):**
```
You are a professional document summarization assistant. Generate a concise summary based on the provided content.
```
### List Consistency
**DO (all items parallel):**
```yaml
- Be accurate
- Be concise
- Be helpful
```
**DON'T (mixed structures):**
```yaml
- Be accurate
- Creating summaries
- You should be helpful
```
### Punctuation Rules
| Element | Rule | Example |
|---------|------|---------|
| Lists | Period only if complex sentences | `- Item one` or `- First item. Second sentence.` |
| Headings | No period at end | `### Requirements` |
| Variables | Spaces around braces | `{{ filename }}` not `{{filename}}` |
| Code blocks | Language tag required | ```python |
## 4. Variable Placeholder Standards
### Naming Conventions
Use descriptive, lowercase names with underscores:
| Good | Bad |
|------|-----|
| `{{ document_title }}` | `{{ title }}` |
| `{{ max_word_count }}` | `{{ max }}` |
| `{{ user_query }}` | `{{ q }}` |
### Variable Types
```yaml
# String variables
user_prompt: |
Analyze: {{ document_content }}
# Numeric variables with constraints
user_prompt: |
Summary ({{ max_words }} words maximum):
# Optional variables (with Jinja2 default)
{{ time|default('current time') }}
# Conditional variables
{%- if memory_list and memory_list|length > 0 %}
### Contextual Memory
...
{%- endif %}
```
## 5. Common Sections
### Role Definition
```yaml
system_prompt: |-
### Role
You are a professional [domain] assistant specialized in [specific task].
```
### Requirements
```yaml
### Requirements
1. First requirement (most important)
2. Second requirement
3. Third requirement
```
### Guidelines
```yaml
### Guidelines
- Do this (positive instruction)
- Don't do that (negative instruction)
- Always do this (mandatory)
```
### Output Format
```yaml
### Output Format
Respond in plain text without:
- Separators (---, ***)
- HTML tags
- Special formatting
```
## 6. Anti-Patterns to Avoid
### Anti-Pattern 1: Excessive Instructions
```yaml
# BAD - Too many nested rules
system_prompt: |-
You are an assistant. Your name is X. You were created by Y.
You should always be helpful. Being helpful means you should:
1. Greet the user
2. Listen carefully
3. Respond appropriately
...
```
**Better:**
```yaml
system_prompt: |-
You are a helpful assistant specialized in {{ task_type }}.
```
### Anti-Pattern 2: Vague Instructions
```yaml
# BAD - Not actionable
system_prompt: |-
You should do a good job at summarizing. Make sure it's good.
```
**Better:**
```yaml
system_prompt: |-
### Task
Generate a {{ word_count }}-word summary that captures:
- Main topic
- Key arguments
- Supporting evidence
```
### Anti-Pattern 3: Mixed Languages
```yaml
# BAD - Inconsistent language
system_prompt: |-
### Role
You are a professional assistant.
### 要求
保持简洁。
```
**Better (choose one language):**
```yaml
system_prompt: |-
### Role
You are a professional assistant.
### Requirements
Keep responses concise.
```
### Anti-Pattern 4: Unbalanced Lists
```yaml
# BAD - Missing items
- Do A
- Do B
# Better - Complete list
- Do A
- Do B
- Do C
```
## 7. Language Guidelines
### English Prompts
- Use American or British English consistently
- Prefer simple vocabulary over complex terms
- Use "you" for direct addressing
### Chinese Prompts
- Use Simplified Chinese (简体中文)
- Follow Chinese punctuation standards
- Keep technical terms in English when appropriate
### Mixed-Language Projects
When maintaining both EN and ZH versions:
```yaml
# Filename pattern: prompt_name_en.yaml
# Corresponding file: prompt_name_zh.yaml
# Key terms translation:
# - "Requirements" → "要求"
# - "Guidelines" → "指南"
# - "Output Format" → "输出格式"
```
## 8. Quality Validation Checklist
### Before Finalizing
```markdown
□ All braces are balanced ({{ }})
□ No trailing spaces at line ends
□ Consistent heading hierarchy
□ Parallel list structure
□ Proper YAML indentation (2 spaces)
□ No HTML tags in Markdown
□ Variables have descriptive names
□ Language is consistent throughout
□ No excessive separators
□ Sentence case for list items
```
### Automated Checks
Consider using:
1. YAML linter (yamllint)
2. Jinja2 syntax validator
3. Markdown formatter
## 9. Performance Considerations
### Prompt Length
- System prompts: 500-2000 tokens typical
- User prompts: 100-500 tokens typical
- Longer isn't always better—be concise
### Token Efficiency
- Avoid repetitive phrasing
- Use variables for repeated content
- Trim unnecessary sections
## 10. Version Control
### File Naming
```yaml
# Format: {purpose}_{lang}.yaml
manager_system_prompt_template_en.yaml
manager_system_prompt_template_zh.yaml
document_summary_agent_en.yaml
```
### Changelog Practices
When modifying prompts:
1. Update file in place
2. Document significant changes
3. Consider version history for major revisions
---
name: prompt-writing
description: Create, refine, and optimize high-quality YAML prompts for AI assistants. Use when working with prompt templates, system prompts, agent prompts, or any prompt engineering tasks. Provides structure guidelines, template patterns, and quality standards for YAML-based prompts.
license: Complete terms in LICENSE.txt
---
# Prompt Writing
Create and optimize YAML-based prompts for AI assistants following industry best practices.
## Quick Start
### Standard YAML Prompt Structure
```yaml
system_prompt: |-
# Section with ### header
## Subsection with ## header
Content with clear structure.
**Bold key concepts**
- Bullet points for requirements
- Consistent indentation (2 spaces)
1. Numbered lists for sequences
2. Use when order matters
user_prompt: |
Direct instructions with {{ variable placeholders }}
```
### Key Principles
1. **Structure**: Use `|-` for multi-line system prompts, `|` for user prompts
2. **Templating**: Use `{{ variable }}` for dynamic content
3. **Separators**: Use `---` sparingly, only between major sections
4. **Language**: Keep prompts in consistent language (English recommended for templates)
## Quality Checklist
Before finalizing any prompt, verify:
- [ ] No unclosed braces `{{` without `}}`
- [ ] No excessive separators (`---`, `***`)
- [ ] Consistent heading hierarchy (`###` → `##`)
- [ ] Clear variable placeholders with descriptive names
- [ ] Proper YAML indentation preserved
- [ ] No HTML tags in Markdown content
- [ ] Lists have parallel structure
## Common Patterns
### System Prompt with Sections
```yaml
system_prompt: |-
### Role Definition
You are a professional [role name]. Your task is to [core responsibility].
### Requirements
1. First requirement
2. Second requirement
3. Third requirement
### Guidelines
- Do this
- Don't do that
- Always do this
### Output Format
Respond in plain text without separators.
```
### Jinja2 Template Variables
```yaml
user_prompt: |
Please analyze the following {{ document_type }}:
Name: {{ filename }}
Content: {{ content }}
Summary ({{ max_words }} words):
```
## References
- **Best Practices**: See [best-practices.md](best-practices.md) for detailed guidelines
- **Templates**: See [templates.md](templates.md) for reusable patterns
- **Examples**: See [examples.md](examples.md) for real-world samples
## Related Tools
When working with prompts, also consider:
- YAML validation tools
- Jinja2 syntax checkers
- Markdown linters
# Prompt Templates
This document provides reusable template patterns for YAML-based prompts.
## 1. Agent System Prompt Template
```yaml
system_prompt: |-
### Basic Information
You are {{APP_NAME}}, {{APP_DESCRIPTION}}, it is {{time|default('current time')}} now
### Core Responsibilities
{{ duty }}
### Principles
Legal Compliance: Strictly adhere to all laws and regulations;
Security Protection: Do not respond to dangerous requests;
Ethical Guidelines: Refuse harmful content.
### Execution Process
1. Think: Analyze the task and plan approach
2. Code: Execute using tools/agents
3. Observe Results: Review and iterate
### Available Resources
{%- if tools and tools.values() | list %}
- Available tools:
{%- for tool in tools.values() %}
- {{ tool.name }}: {{ tool.description }}
{%- endfor %}
{%- else %}
- No tools available
{%- endif %}
### Resource Usage Requirements
{{ constraint }}
### Example Templates
{{ few_shots }}
managed_agent:
task: |-
You are '{{name}}'. Your manager has submitted this task:
---
{{task}}
---
Provide comprehensive assistance.
report: |-
{{final_answer}}
planning:
initial_plan: |-
update_plan_pre_messages: |-
update_plan_post_messages: |-
final_answer:
pre_messages: |-
post_messages: |-
```
## 2. Document Summary Agent Template
```yaml
system_prompt: |-
You are a professional document summarization assistant.
**Summary Requirements:**
1. Extract main themes and key topics
2. Generate representative summary
3. Ensure accuracy and coherence
4. Respect word limit
**Guidelines:**
- Focus on main themes
- Highlight important concepts
- Use clear, concise language
- Avoid redundancy
- **Important: No separators, plain text only**
user_prompt: |
Generate a summary for:
Document name: {{ filename }}
Content snippets:
{{ content }}
Summary (max {{ max_words }} words):
```
## 3. Cluster Summary Agent Template
```yaml
system_prompt: |-
You are a professional knowledge summarization assistant.
**Summary Requirements:**
1. Analyze multiple documents
2. Extract common themes
3. Generate collective summary
4. Respect word limit
**Guidelines:**
- Focus on shared themes
- Highlight key concepts
- Use concise language
- Avoid listing individual titles
user_prompt: |
Summarize this document cluster:
{{ cluster_content }}
Summary ({{ max_words }} words):
```
## 4. Image Analysis Template
```yaml
image_analysis:
system_prompt: |-
The user asks: {{ query }}. Describe this image concisely (200 words max).
**Requirements:**
1. Focus on question-relevant content
2. Keep descriptions clear and concise
3. Avoid irrelevant details
4. Maintain objective description
user_prompt: |
Observe and describe this image for the user's question.
```
## 5. Long Text Analysis Template
```yaml
long_text_analysis:
system_prompt: |-
The user asks: {{ query }}. Summarize this text concisely (200 words max).
**Requirements:**
1. Extract question-relevant content
2. Highlight core information
3. Preserve key viewpoints
4. Avoid redundancy
user_prompt: |
Read and analyze this text:
```
## 6. Conditional Content Template
```yaml
system_prompt: |-
### Basic Information
You are {{APP_NAME}}.
{%- if memory_list and memory_list|length > 0 %}
### Contextual Memory
{%- set level_order = ['tenant', 'user_agent', 'user', 'agent'] %}
{%- for level in level_order %}
{%- if level in memory_by_level %}
**{{ level|title }} Level Memory:**
{%- for item in memory_by_level[level] %}
- {{ item.memory }}
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- endif %}
### Core Task
{{ duty }}
```
## 7. Tool-Only Agent Template
```yaml
system_prompt: |-
You have access to specific tools only.
{%- if tools and tools.values() | list %}
### Available Tools
{%- for tool in tools.values() %}
- {{ tool.name }}: {{ tool.description }}
Input: {{tool.inputs}}
Output: {{tool.output_type}}
{%- endfor %}
{%- else %}
- No tools available.
{%- endif %}
### Workflow
1. Understand the user's request
2. Select appropriate tools
3. Execute tool calls
4. Synthesize results
### Guidelines
- Call tools only when needed
- Use correct parameters
- Handle errors gracefully
user_prompt: |
Task: {{ task }}
{%- if context %}
Context:
{{ context }}
{%- endif %}
Result:
```
## 8. Memory Integration Template
```yaml
system_prompt: |-
### Role
You are {{agent_name}}.
{%- if memory_list and memory_list|length > 0 %}
### Contextual Memory
{%- set level_order = ['tenant', 'user_agent', 'user', 'agent'] %}
{%- set memory_by_level = memory_list|groupby('memory_level') %}
{%- for level in level_order %}
{%- for group_level, memories in memory_by_level %}
{%- if group_level == level %}
**{{ level|title }} Level Memory:**
{%- for item in memories %}
- {{ item.memory }} `({{ "%.2f"|format(item.score|float) }})`
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- endfor %}
**Memory Usage:**
- Conflicts: Earlier items take precedence
- Integration: Weave memories naturally
{%- endif %}
### Task
{{ task }}
```
## 9. Output Format Specification Template
```yaml
system_prompt: |-
### Role
You are {{role_name}}.
### Task
{{task_description}}
### Output Requirements
1. **Markdown Format:**
- Standard Markdown syntax
- Single blank line between paragraphs
- Inline formulas: $formula$
- Block formulas: $$formula$$
2. **Reference Marks:**
- Format: `[[letter+number]]` (e.g., `[[a1]]`)
- Place after relevant sentences
- Multiple marks: `[[a1]][[b2]]`
3. **Code:**
- Use language tags: ```python
- Maintain original format
4. **Restrictions:**
- No HTML tags
- No separators
- No extra escape characters
user_prompt: |
{{ user_input }}
Response:
```
## 10. Minimal Template
For simple, focused prompts:
```yaml
system_prompt: |-
You are a {{role_type}} assistant. Your task is to {{primary_task}}.
Requirements:
1. {{requirement_1}}
2. {{requirement_2}}
Guidelines:
- {{guideline_1}}
- {{guideline_2}}
user_prompt: |
{{ input_content }}
{{ output_instruction }}:
```
## Template Variables Summary
| Variable | Type | Description | Example |
|----------|------|-------------|---------|
| `{{APP_NAME}}` | String | Application name | "Nexent" |
| `{{APP_DESCRIPTION}}` | String | App description | "An AI assistant" |
| `{{time}}` | String/datetime | Current time | "2024-01-01" |
| `{{duty}}` | String | Core responsibilities | "Summarize documents" |
| `{{constraint}}` | String | Resource constraints | "Max 500 words" |
| `{{few_shots}}` | String | Example templates | "Q:... A:..." |
| `{{filename}}` | String | Document filename | "report.pdf" |
| `{{content}}` | String | Document content | "..." |
| `{{max_words}}` | Integer | Word limit | 200 |
| `{{task}}` | String | Task description | "Analyze..." |
| `{{query}}` | String | User query | "..." |
| `{{memory_list}}` | List | Context memories | [...] |
Questions about nexent's system prompt
Does nexent's system prompt contain instructions that work against the user?
No. Nothing in nexent's system prompt was flagged as working against the person the product is talking to. That is a clean result across all eight AISPA dimensions, not an absence of checking — the full text was read instruction by instruction.
How long is nexent's system prompt?
31,553 characters across 4 prompts on this page. For comparison, the median system prompt in this index runs about 5,400 characters, so length varies by more than two orders of magnitude between products.
How many versions of nexent's system prompt are on record?
4. Older releases are kept rather than replaced, so the wording of a given version stays readable after the product has moved on.
Where did this nexent system prompt come from?
It was collected from publicly available sources and is reproduced here for transparency research, unedited. This site does not extract prompts from products itself.
How was nexent's system prompt audited?
Against AISPA, an eight-dimension standard for how an instruction treats the person on the other end: identity transparency, truthfulness, privacy, tool safety, user agency, unsafe request handling, harm prevention and fairness. This audit was ai audit. The method is described in the paper behind the standard.
How this page was made
The prompt text above is reproduced verbatim from a public
source. Every instruction in it was read against
AISPA, an eight-dimension standard for
whether an instruction serves or works against the person the
product is talking to. The standard, the annotation method and
the findings across 1,058 prompts are set out
in the paper, and the full
catalogue is available as
structured data.
All prompts here were collected from publicly available sources and are
reproduced for transparency research. Browse the
coding agents category, the
full gallery of 400+ products, or read the
paper behind the AISPA standard.