Skip to main content

Module prompt

Module prompt 

Source
Expand description

Prompt Runtime System

A dynamic prompt management system with:

  • Section-based composition (static/dynamic)
  • Cache management with boundary markers
  • Runtime context injection
  • Pre-processing hooks for Skills/Workflows triggering
  • Prompt export for observability

§Migration Status

This module provides both:

  1. New dynamic system (PromptOrchestrator, PromptBuilder)
  2. Legacy compatibility functions (build_system_prompt, etc.)

The legacy functions are gradually being migrated to the new system.

Re-exports§

pub use section::PromptSection;
pub use section::SectionContent;
pub use section::SectionBuilder;
pub use cache::SectionCache;
pub use cache::CacheKey;
pub use cache::CachedEntry;
pub use cache::CacheStats;
pub use cache::global_cache;
pub use cache::clear_global_cache;
pub use cache::estimate_tokens;
pub use context::ContextInjector;
pub use context::UserContext;
pub use context::SystemContext;
pub use context::ProjectType;
pub use orchestrator::PromptOrchestrator;
pub use orchestrator::PromptProfile;
pub use orchestrator::PromptBuilder;
pub use orchestrator::AssembledPrompt;
pub use orchestrator::CACHE_BOUNDARY;
pub use preprocess::PreProcessHook;
pub use preprocess::ProcessResult;
pub use preprocess::SkillPattern;
pub use preprocess::WorkflowTrigger;
pub use preprocess::preprocess;
pub use dump::PromptDumper;
pub use dump::DumpEntry;
pub use dump::PromptAnalysis;
pub use dump::DumpFileAnalysis;
pub use dump::read_dump_file;
pub use dump::analyze_dump_file;
pub use orchestrator::PromptProfile as LegacyPromptProfile;
pub use constants::*;

Modules§

cache
Section Cache System
constants
Prompt constants migrated from original prompt.rs
context
Runtime Context Injection
dump
Prompt Export and Observability
orchestrator
Prompt Orchestrator
preprocess
Pre-processing Hook for Skills/Workflows Trigger Detection
section
Section-based prompt composition

Structs§

OverviewContext
Legacy OverviewContext for project overview generation Used by overview.rs to generate MATRIX.md content

Functions§

build_overview_prompt
Build overview prompt from context (legacy compatibility) This function generates the AI prompt for MATRIX.md generation
build_system_prompt
Build system prompt using the new orchestrator system
build_system_prompt_with_workflows
Build system prompt with workflow support and LSP injection