Skip to content

prompts

code_context_agent.agent.prompts

Agent prompt rendering from Jinja2 templates.

This module renders system prompts and steering fragments from Jinja2 templates in src/code_context_agent/templates/.

get_prompt

get_prompt(mode='standard')

Render the unified system prompt.

Parameters:

Name Type Description Default
mode str

Analysis mode ("standard" or "full").

'standard'

Returns:

Type Description
str

Rendered system prompt string from system.md.j2

Source code in src/code_context_agent/agent/prompts.py
def get_prompt(mode: str = "standard") -> str:
    """Render the unified system prompt.

    Args:
        mode: Analysis mode ("standard" or "full").

    Returns:
        Rendered system prompt string from system.md.j2
    """
    return render_prompt("system.md.j2", mode=mode)

get_steering_content

get_steering_content(name)

Render a steering prompt fragment by name.

Parameters:

Name Type Description Default
name str

Fragment name (e.g., "size_limits", "conciseness", "anti_patterns", "tool_efficiency", "graph_exploration")

required

Returns:

Type Description
str

Rendered steering content string

Source code in src/code_context_agent/agent/prompts.py
def get_steering_content(name: str) -> str:
    """Render a steering prompt fragment by name.

    Args:
        name: Fragment name (e.g., "size_limits", "conciseness",
              "anti_patterns", "tool_efficiency", "graph_exploration")

    Returns:
        Rendered steering content string
    """
    return render_steering(name)