{% from 'components/page-heading.html' import page_heading %} {{ page_heading(t.prompts,t.prompts_subtitle) }} {% if errors.get('prompts') %}{{ read_error(errors.prompts,t.prompts) }}{% endif %} {% if not data.prompts and not errors.get('prompts') %}

{{ t.prompt_empty }}

{{ t.prompt_empty_body }}

{% endif %}
{% set groups = [ ('memory', ['atomic_memory.extract', 'atomic_memory.reconcile', 'memory.rerank']), ('topics', ['topic_memory.probe', 'topic_memory.global', 'topic_memory.planner', 'topic_memory.evolve', 'topic_memory.temporary', 'topic_memory.reduce', 'topic_memory.reconcile']), ('experience', ['experience.incubate', 'experience.generate']), ('skill', ['skill.generate']), ('handoff', ['handoff.generate']), ('profile', ['profile.generate']) ] %} {% for group, keys in groups %}{% set prompts = data.prompts|selectattr('prompt_key', 'in', keys)|list %} {% if prompts %}
{{ t['prompt_group_' ~ group] }}{{ prompts|length }} {% if group == 'topics' %}

{{ t.prompt_topic_conditional }}

{% endif %}
{% for prompt in prompts %}{% set opened = prompt_opened if prompt_opened and prompt.prompt_key == prompt_key else none %}{% set failed = prompt.prompt_key == prompt_key and errors.get('prompt_selected') %}{% set mode = none if failed else (opened.content.mode if opened else prompt.mode) %}
{{ t.get(prompt.prompt_key,prompt.prompt_key) }}{{ t[prompt.prompt_key ~ '_purpose'] }}{{ t.prompt_revision_unavailable if failed else (t.prompt_custom if mode == 'custom' else t.prompt_builtin_default) }}

{{ t.prompt_status }}: {{ t.get('prompt_state_' ~ prompt.status,t.get('prompt_' ~ prompt.status,prompt.status)) }}{% if prompt.reason %} — {{ t['prompt_reason_' ~ prompt.reason] }}{% endif %}

{% if not failed %}

{{ t.prompt_mode }}: {{ t.prompt_custom if mode == 'custom' else t.prompt_auto }}

{{ prompt.prompt_key }} · {{ t.prompt_revision }} {{ opened.revision if opened else (prompt.artifact.revision if prompt.artifact else t.prompt_auto) }} · {{ t.prompt_demonstrations }} {{ opened.content.demonstrations|length if opened else (prompt.effective.demonstrations|length if prompt.effective else 0) }}

{{ t.prompt_instructions if opened or prompt.effective else t.prompt_builtin_template }}

{{ opened.content.instructions if opened else (prompt.effective.instructions if prompt.effective else (prompt.builtin.instructions if prompt.builtin else '')) }}
{% if prompt.artifact %}{{ t.revision_history }} →{% endif %} {% set demonstrations = opened.content.demonstrations if opened else (prompt.effective.demonstrations if prompt.effective else []) %} {% if demonstrations %}

{{ t.prompt_demonstrations }}

{{ demonstrations|tojson(indent=2) }}
{% endif %} {% else %}{{ prompt.prompt_key }}{{ read_error(errors.prompt_selected,t.prompt_revision) }}{% endif %}
{% endfor %}
{% endif %}{% endfor %}
{% include 'components/revision-history.html' %}