Skip to content

M27.3: Refactor build_system_prompt() to use mode and expertise #593

@bug-ops

Description

@bug-ops

Parent: #590
Blocked by: M27.1, M27.2

Scope

Refactor build_system_prompt() in zeph-core/src/context.rs:

Before

pub fn build_system_prompt(
    skills_prompt: &str,
    env: Option<&EnvironmentContext>,
    tool_catalog: Option<&str>,
    native_tools: bool,
) -> String

After

pub fn build_system_prompt(
    skills_prompt: &str,
    env: Option<&EnvironmentContext>,
    tool_catalog: Option<&str>,
    native_tools: bool,
    expertise: ExpertiseLevel,
    mode: InteractionMode,
) -> String

Assembly order:

  1. Persona block (from mode)
  2. Philosophy block (from expertise)
  3. Tool use block (native vs legacy — unchanged)
  4. Guardrails block (from expertise x mode)
  5. Environment context
  6. Tool catalog
  7. Skills prompt

Callers to update

  • Agent::new() in agent/mod.rs
  • reload_skills() in agent/mod.rs

Acceptance Criteria

  • Signature updated with new params
  • All existing callers updated
  • Existing tests updated to pass new params
  • New tests: verify prompt content varies by mode/expertise combination
  • Prompt caching in Claude provider still works (no regression)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions