Prompts

Architectural Context

The Prompts Library provides the static, templated Markdown instructions that orchestrate the behavior of the underlying Large Language Models (LLMs).

Rather than hardcoding string concatenations deep within the C# AI generation cores, MILTON.DocumentGenerator extracts all system instructions, format constraints, and few-shot examples into standalone Markdown files.

Intent and Architecture

Keeping prompts as standalone .md files significantly improves developer ergonomics. It allows prompts to be easily reviewed, format-checked, and tweaked without recompiling the core C# logic. These files act as embedded resources. At runtime, the PromptLibrary loads them and performs token substitution (e.g., replacing {{Token}} with dynamic contextual values).

graph LR
    subgraph Filesystem / Embedded Resources
        MD1[requirement-system.md]
        MD2[section-naming.md]
        MD3[requirement-generation.md]
    end

    subgraph PromptLibrary C# Wrapper
        Cache[ConcurrentDictionary Cache]
        Renderer[Token Renderer]
    end

    MD1 --> Cache
    MD2 --> Cache
    MD3 --> Cache
    
    Cache --> Renderer
    Renderer -->|Rendered Text| AICore[AI Generation Core]

Key Components

PromptLibrary

A strongly typed, highly efficient C# wrapper that reads Markdown files from the assembly’s embedded resources. It caches the raw templates in a ConcurrentDictionary to avoid repetitive disk or assembly I/O during high-volume document generation. It provides a Render() method to perform basic token substitution securely and cleanly.

The Markdown Files

The .md files define instructions tailored to specific block processing behaviors:

  • requirement-system.md: Outlines the base persona, constraints, and safety guidelines for the LLM when acting as a requirement analyst.
  • requirement-generation.md: Provides the structural template and contextual inputs required to generate high-quality software requirements.
  • section-naming.md: Contains instructions for analyzing clustered source files and distilling them into a concise module or section name.

This separation of concerns guarantees that changes to prompt engineering do not leak into the structural processing layers of the application.

6 items under this folder.