Skip to content

Conversation

robertjdominguez
Copy link
Collaborator

Description

Note

In testing, this reduced response time by 50%!

Converted system instructions from markdown format to structured XML format for better LLM parsing and execution.

Changes Made

  • Restructured format: Converted from markdown headers and bullet points to XML tags with descriptive attributes
  • Consolidated validation rules: Moved all CLI and metadata validation requirements into a single <validation_protocols> section
  • Simplified organization: Grouped related instructions under logical XML containers (<technical_requirements>, <output_requirements>, etc.)
  • Preserved all functionality: Every instruction and requirement from the original format is maintained

Previously...

The system instructions used markdown formatting with headers like ## Core Principles and ## Validation Requirements, making it harder for the LLM to parse structured requirements.

Now...

systemInstructions: |
  <system_role>
  You are "DocsBot", the AI assistant for PromptQL documentation...
  </system_role>

  <core_execution_behaviors description="Core instructions...">
  - ALWAYS provide a user-facing message before any action block
  - Lead with the direct answer - give users what they need immediately
  </core_execution_behaviors>

  <technical_requirements>
    <general_protocols description="These apply to all responses...">
    </general_protocols>
    
    <validation_protocols description="Instructions for validating...">
    </validation_protocols>
  </technical_requirements>

The XML structure provides clear semantic boundaries that help the LLM understand instruction hierarchy and execute validation protocols more reliably. All original validation requirements, fallback responses, and technical protocols remain intact but are now organized in a more machine-readable format.

Copy link

github-actions bot commented Jul 31, 2025

🚀 PromptQL Build Complete

Build Version: e4c9f9c023
Project: pql-docs
PromptQL Playground: Open Playground

Description: PR #24: PQL: Transform sys instructions to XML

Copy link

No description provided.

@robertjdominguez robertjdominguez merged commit 57cf4b5 into main Jul 31, 2025
1 check passed
@robertjdominguez robertjdominguez deleted the rob/pql/transform-sys-instructions-to-xml branch July 31, 2025 18:03
Copy link

✅ PromptQL Build Applied

Build Version: e4c9f9c023
Status: Successfully applied to production
Applied at: 2025-07-31T18:03:26.744Z

robertjdominguez added a commit that referenced this pull request Aug 10, 2025
## Description

> [!NOTE]
> In testing, this reduced response time by 50%!

Converted system instructions from markdown format to structured XML
format for better LLM parsing and execution.

### Changes Made

- **Restructured format**: Converted from markdown headers and bullet
points to XML tags with descriptive attributes
- **Consolidated validation rules**: Moved all CLI and metadata
validation requirements into a single `<validation_protocols>` section
- **Simplified organization**: Grouped related instructions under
logical XML containers (`<technical_requirements>`,
`<output_requirements>`, etc.)
- **Preserved all functionality**: Every instruction and requirement
from the original format is maintained

### Previously...

The system instructions used markdown formatting with headers like `##
Core Principles` and `## Validation Requirements`, making it harder for
the LLM to parse structured requirements.

### Now...

````yaml path=pql/globals/metadata/promptql-config.hml mode=EXCERPT
systemInstructions: |
  <system_role>
  You are "DocsBot", the AI assistant for PromptQL documentation...
  </system_role>

  <core_execution_behaviors description="Core instructions...">
  - ALWAYS provide a user-facing message before any action block
  - Lead with the direct answer - give users what they need immediately
  </core_execution_behaviors>

  <technical_requirements>
    <general_protocols description="These apply to all responses...">
    </general_protocols>
    
    <validation_protocols description="Instructions for validating...">
    </validation_protocols>
  </technical_requirements>
````

The XML structure provides clear semantic boundaries that help the LLM
understand instruction hierarchy and execute validation protocols more
reliably. All original validation requirements, fallback responses, and
technical protocols remain intact but are now organized in a more
machine-readable format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant