Document I made some months ago and contributed to bmad-method with. I personally use this with claude extended thinking and sequential thinking. It has never let me down. The PDF version is 44 pages long.
This is just a teaser. its best you open up the actual file.
The Complete Guide to Building Sophisticated AI Systems Through Structured Prompting Made by Anthony Mikinka
- [Introduction & Overview]
- [Theoretical Foundations]
- [Core Semantic Markup Patterns]
- [Template Logic Programming]
- [Advanced Agent Architecture]
- [Meta-Instruction Systems]
- [Quality Assurance Integration]
- [Real-World Implementation Strategies]
- [Best Practices & Anti-Patterns]
- [Complete Implementation Examples]
Semantic Markup Prompting and Template Logic Programming represent the evolution of prompt engineering from simple text instructions to sophisticated AI system architectures. These techniques enable the creation of complex, maintainable, and reusable AI interactions that scale from simple tasks to multi-agent orchestration systems.
- Structured Prompting: Organizing complex prompts using semantic markup
- Template Logic: Conditional logic, loops, and variables in prompts
- Agent Architecture: YAML-in-Markdown configuration systems
- Meta-Instructions: Embedding AI guidance within templates
- Quality Systems: Validation and assurance frameworks
- Practical Implementation: Real-world examples and best practices
Traditional prompting approaches break down as complexity increases. These advanced techniques provide:
- Maintainability: Structured systems that can be updated and extended
- Reusability: Components that work across multiple contexts
- Reliability: Predictable behavior through structured constraints
- Scalability: Patterns that work for both simple and complex systems
Level 1: Basic Prompting
Write a summary of this article.
Level 2: Structured Prompting
<objective>Summarize the article</objective>
<constraints>
- Maximum 3 paragraphs
- Include key statistics
- Maintain professional tone
</constraints>
Level 3: Template Logic Programming
<objective>
Create a {{document_type}} for {{target_audience}}
</objective>
^^CONDITION: document_type == "technical_report"^^
Focus on technical accuracy and detailed analysis.
^^/CONDITION: document_type^^
[[LLM: Adapt language complexity based on target_audience variable]]
Level 4: Agent Architecture Systems
activation-instructions:
- Follow embedded configuration
- Maintain character consistency
- Use numbered options protocol
agent:
name: Technical Writer
persona: Expert technical communicator
commands:
- create-documentation
- review-technical-content
- Separation of Concerns: Different aspects handled by different markup patterns
- Progressive Enhancement: Building complexity through layered systems
- Convention Over Configuration: Established patterns reduce cognitive load
- Explicit State Management: Clear control over AI behavior and context
- Modular Composition: Reusable components that work together
Purpose: Organize complex prompts into logical, parseable sections
<objective>
Define what the AI should accomplish
</objective>
<constraints>
Define limitations and requirements
</constraints>
<process>
1. Step one
2. Step two
3. Step three
</process>
<output_format>
Specify exactly how output should be structured
</output_format>
Benefits:
- Clear prompt structure for both humans and AI
- Easy to modify individual sections
- Enables prompt composition and inheritance
- Improves AI comprehension of complex instructions
Purpose: Instructions TO the AI about how to process content
[[LLM: This section provides guidance for AI processing]]
[[LLM: Present this content first, wait for user input, then proceed]]
[[LLM: Use technical language if user indicates expertise]]
[[LLM: Validate completeness before final output]]
Usage Patterns:
- Processing Guidance: How to handle specific sections
- Interaction Flow: When to pause for user input
- Adaptation Logic: How to modify behavior based on context
- Quality Control: Validation and checking instructions
Purpose: Self-documenting templates with clear usage patterns
@{example-1: Basic Configuration}
Simple example showing minimal setup
@{example-2: Advanced Configuration}
Complex example with all features enabled
@{example-3: Domain-Specific Usage}
Real-world application in specific context
Benefits:
- Templates become self-teaching
- Reduces learning curve for new users
- Provides validation examples
- Shows progression from simple to complex
Basic Conditionals:
^^CONDITION: user_level == "beginner"^^
Provide detailed explanations with examples
^^/CONDITION: user_level^^
^^CONDITION: user_level == "expert"^^
Use technical terminology and assume knowledge
^^/CONDITION: user_level^^
Nested Conditionals:
^^CONDITION: project_type == "web_application"^^
^^CONDITION: framework == "react"^^
Use React-specific patterns and conventions
^^/CONDITION: framework^^
^^CONDITION: framework == "vue"^^
Use Vue-specific patterns and conventions
^^/CONDITION: framework^^
^^/CONDITION: project_type^^
Repeat Blocks:
<<REPEAT section="stakeholder" count="{{stakeholder_count}}">>
### Stakeholder {{loop_index}}: {{stakeholder_name}}
- Role: {{stakeholder_role}}
- Requirements: {{stakeholder_requirements}}
- Contact: {{stakeholder_contact}}
<</REPEAT>>
Dynamic Lists:
<<REPEAT section="feature" source="{{feature_list}}">>
- [ ] {{feature.name}} - Priority: {{feature.priority}}
- Description: {{feature.description}}
- Acceptance Criteria: {{feature.criteria}}
<</REPEAT>>
Simple Placeholders:
{project_name} # Basic substitution
{user_name} # User-provided content
{current_date} # System-generated content
Template Engine Style:
{{project.name}} # Object property access
{{user.preferences}} # Nested property access
{{#each items}} # Template engine compatibility
Interpolation Style:
${dynamic_content} # JavaScript-style interpolation
${user.input} # Property access
${function_call()} # Function execution
Content Inclusion:
@{include: header-template}
@{include: footer-template}
@{include: domain-specific-sections}
Template Inheritance:
@{extends: base-document-template}
@{block: custom-content}
Domain-specific customizations
@{/block: custom-content}