⚡ skill: {{ block.content }}
{{ block.description }}
{{ block.content }}
{% endif %}
{% elif block.kind == 'status' %}
{% if block.description == 'subagent' %}
{# Hidden: standalone subagent status pills are redundant with agent block headers and read_agent backlinks #}
{% elif block.description == 'subagent-error' %}
{# Hidden: standalone subagent error pills are redundant with agent block headers and read_agent backlinks #}
{% elif block.description == 'task-complete' %}
✅ Task complete
{{ block.content | markdown | safe }}
{{ block.description or 'Agent' }} {% if block.is_background %} ↗ background {% endif %} {% if block.kind == 'subagent_failed' %} failed {% elif block.kind == 'subagent_incomplete' %} incomplete {% else %} completed {% endif %}
{% if block.prompt %}
{% endif %}
{% if include_agent_details is not defined or include_agent_details %}
{# Full details: all tools, commands, file changes, result #}
{% if block.content_blocks %}
{{ render_content_blocks(block.content_blocks, block.tool_invocations, block.file_changes, block.command_runs, get_nested_meta(block), block.content) }}
{% else %}
{{ block.content | markdown | safe }}
{% endif %}
{% else %}
{# Result only: just show text blocks (the agent's response) #}
{% set has_result = false %}
{% if block.content_blocks %}
{% for inner in block.content_blocks %}
{% if inner.kind == 'text' and inner.content.strip() %}
Prompt
{{ block.prompt | markdown | safe }}
{{ inner.content | markdown | safe }}
{% set has_result = true %}
{% endif %}
{% endfor %}
{% endif %}
{% if not has_result %}
{{ block.content | markdown | safe }}
{% endif %}
{% endif %}
Thinking {% if block.description %} — {{ block.description }} {% endif %}
{{ block.content | markdown | safe }}
{% if matched_cmd.is_async %} {% if matched_cmd.is_detached %} detached {% else %} async {% endif %} {% endif %} {% if matched_cmd.status %} {{ matched_cmd.status }} {% endif %}
Input:
{% if matched_cmd.output or matched_cmd.result %}
{% set cmd_output = (matched_cmd.output or matched_cmd.result) | strip_ansi %}
{% if matched_cmd.is_async and matched_cmd.shell_id %}
{{ matched_cmd.command }}
shellId:
{% set is_boilerplate = cmd_output.strip().startswith('{{ matched_cmd.shell_id }}{{ highlight_code(cmd_output, cmd_out_lang) }}
Output:
{% endif %}
{% endif %}
{% if matched_cmd.io_entries %}
{% for io in matched_cmd.io_entries %}
{{ highlight_code(cmd_output, cmd_out_lang) }}
{% if io.action == 'read' %}
{% elif io.action == 'write' %}
{% elif io.action == 'stop' %}
{% else %}
{% endif %}
{{ io.action }}
{% if io.pill_id %}
↗ context
{% endif %}
{% if io.action == 'write' and io.input_text %}
Input:
{{ io.input_text }}
{% endif %}
{% if io.result %}
{% set io_result_clean = io.result | strip_ansi %}
{% set io_result_lang = detect_language(io_result_clean) %}
{% if io.action == 'write' %}Response:{% elif io.action == 'read' %}Output:{% else %}Result:{% endif %}
{{ highlight_code(io_result_clean, io_result_lang) }}
{% endif %}
{% if matched_cmd.title %}
{{ matched_cmd.title }}
{% else %}
{% elif matched_tool %}
{# Show collapsible details for tools with input/output: #}
{# - MCP tools (source_type == 'mcp') #}
{# - run_in_terminal (has command input and terminal output) #}
{# Internal file tools (copilot_readFile, etc.) just show pretty invocation message #}
{% set is_mcp_tool = matched_tool.source_type == 'mcp' %}
{% set is_terminal_tool = matched_tool.name == 'run_in_terminal' %}
{% set has_tool_details = matched_tool.input or matched_tool.result %}
{% set show_collapsible = (is_mcp_tool or is_terminal_tool) and has_tool_details %}
{# Determine the pretty header text - use invocation_message if available, else block content #}
{% set pretty_header = matched_tool.invocation_message if matched_tool.invocation_message else block.content %}
{% if matched_tool.is_agent_backlink and matched_tool.backlink_agent_id %}
{# Determine backlink state from read_agent result text #}
{% set agent_result = matched_tool.result or '' %}
{% if 'status: running' in agent_result or 'still running' in agent_result %}
{% set bl_state = 'in-progress' %}
{% set bl_label = 'in progress' %}
{% elif 'failed' in agent_result or 'error' in agent_result.lower() %}
{% set bl_state = 'failed' %}
{% set bl_label = 'failed' %}
{% else %}
{% set bl_state = 'completed' %}
{% set bl_label = 'completed' %}
{% endif %}
↩ {{ matched_tool.invocation_message | replace('⏳ Checking agent ', '') }} — {{ bl_label }}
{% elif matched_tool.is_shell_backlink %}
{# Shell interaction — lightweight pill linking to IO entry inside shell block #}
{% set shell_action = matched_tool.name | replace('_powershell', '') %}
{% if shell_action == 'read' %}
{% set shell_icon = 'fa-solid fa-book-open' %}
{% elif shell_action == 'write' %}
{% set shell_icon = 'fa-solid fa-keyboard' %}
{% elif shell_action == 'stop' %}
{% set shell_icon = 'fa-solid fa-stop' %}
{% else %}
{% set shell_icon = 'fa-solid fa-terminal' %}
{% endif %}
{% set shell_display = matched_tool.invocation_message | replace('↩ ', '') | replace(' — ' ~ shell_action, '') %}
{% if matched_tool.shell_anchor_id %}
↩ {{ shell_action | upper }} — {{ shell_display }}
{% else %}
{{ shell_action | upper }} — {{ shell_display }}
{% endif %}
{% else %}
{% if show_collapsible %}
{{ matched_cmd.command | truncate(80, True) }}
{% endif %}
{% if matched_cmd.status %}
{{ matched_cmd.status }}
{% endif %}
{% if matched_tool.status %} {{ matched_tool.status }} {% endif %}
{% if matched_tool.input %}
{% set tool_in_lang = detect_language(matched_tool.input, matched_tool.name) %}
{% set tool_in = matched_tool.input | prettify_json %}
Input:
{% endif %}
{% if matched_tool.result %}
{% set tool_out_raw = matched_tool.result | strip_ansi %}
{% set tool_out_lang = detect_language(tool_out_raw, matched_tool.name, is_output=True) %}
{% set tool_out = tool_out_raw | prettify_json %}
{{ highlight_code(tool_in, tool_in_lang) }}
Output:
{% endif %}
{{ highlight_code(tool_out, tool_out_lang) }}
{{ pretty_header | markdown | safe }}
{% if matched_tool.status %}
{{ matched_tool.status }}
{% endif %}
{{ block.content | markdown | safe }}
{% endif %}
{% else %}
{{ block.content | markdown | safe }}
{% endif %}
{% endfor %}
{% elif fallback_content %}
{# Fallback to flat content for backwards compatibility #}
{{ fallback_content | markdown | safe }}
{% endif %}
{# Show unmatched tool invocations #}
{% set unmatched_tools = [] %}
{% for tool in tool_invocations %}
{% set is_collapsible_tool = (tool.source_type == 'mcp' or tool.name == 'run_in_terminal') and (tool.input or tool.result) %}
{% if tool.name not in (meta.get('matched_tool_names', []) if meta else []) and is_collapsible_tool %}
{% set _ = unmatched_tools.append(tool) %}
{% endif %}
{% endfor %}
{% if unmatched_tools %}
Used {{ unmatched_tools | length }} tool{{ 's' if unmatched_tools | length > 1 else '' }}: {{ unmatched_tools | map(attribute='name') | list | join(', ') | truncate(100) }}
Tool Invocations ({{ unmatched_tools | length }})
{% for tool in unmatched_tools %}
{% endfor %}
{% if tool.invocation_message %} {% else %} {{ tool.name }} {% endif %} {% if tool.status %} {{ tool.status }} {% endif %}
{% if tool.input %}
{% set utool_in_lang = detect_language(tool.input, tool.name) %}
{% set utool_in = tool.input | prettify_json %}
Input:
{% endif %}
{% if tool.result %}
{% set utool_out_raw = tool.result | strip_ansi %}
{% set utool_out_lang = detect_language(utool_out_raw, tool.name, is_output=True) %}
{% set utool_out = utool_out_raw | prettify_json %}
{{ highlight_code(utool_in, utool_in_lang) }}
Output:
{% endif %}
{{ highlight_code(utool_out, utool_out_lang) }}
{% if tool.invocation_message %}
{{ tool.invocation_message | markdown | safe }}
{% else %}
{{ tool.name }}
{% endif %}
{% if tool.status %}
{{ tool.status }}
{% endif %}
{% endfor %}
{% endif %}
{% if file_changes %}
Changed {{ file_changes | length }} file{{ 's' if file_changes | length > 1 else '' }}: {{ file_changes | map(attribute='path') | list | join(', ') | truncate(100) }}
File Changes ({{ file_changes | length }}) {{ file_changes | map(attribute='path') | map('extract_filename') | join(', ') | truncate(80) }}
{% for change in file_changes %}
{% endfor %}
{{ change.path | extract_filename }}
{% if change.language_id %}
{{ change.language_id }}
{% endif %}
{% if change.diff %}
{% set stats = change.diff | parse_diff_stats %}
{% if stats.additions > 0 %}+{{ stats.additions }}{% endif %}
{% if stats.deletions > 0 %}-{{ stats.deletions }}{% endif %}
{% endif %}
{% if change.explanation %}
{{ change.explanation }}
{% endif %}
{% if change.diff %}
{{ change.diff }}
{% endif %}
Ran {{ unmatched_cmd_count }} command{{ 's' if unmatched_cmd_count > 1 else '' }}
Command Runs ({{ unmatched_cmd_count }}) {{ command_runs | map(attribute='command') | join(', ') | truncate(80) }}
{% for cmd in command_runs %}
{# Skip commands already rendered inline #}
{% if loop.index0 not in ((meta.get('matched_cmd_indices') if meta else none) or []) %}
{% endif %}
{% endif %}
{% endfor %}
{% if cmd.title %}
{{ cmd.title }}
{% else %}
{{ cmd.command }}
{% endif %}
{% if cmd.status %}
{{ cmd.status }}
{% endif %}
{% if cmd.output %}
Show output
{{ cmd.output | strip_ansi }}