---
name: bug-summarization
description: "Use when handling step 1 of the automatic agent tuning workflow: read a bug ticket, agent capability context, Langfuse or session evidence, screenshots, and relevant code or prompt sections, then produce a structured summary for the planning step."
---

# Bug Summarization

Use this skill for the first stage of the automatic agent tuning process.
The goal is to turn scattered bug evidence into a planning-ready summary.

## Instructions

1. Read `references/workflow.md`.
2. Gather the required inputs before concluding anything:
   - Jira ticket URL (use the Atlassian MCP to fetch the full ticket: summary, description, comments, attachments, and linked issues)
   - affected agent repo or workspace path
   - agent capability overview, usually `README.md`
   - Langfuse reference if available: session link, trace link, raw session ID, or raw trace ID (may be found in the Jira ticket body or comments)
   - screenshot path or image attachment if available
3. When using the bundled Langfuse helpers, execute them from the affected agent repo so they can read that repo's `.env`. Resolve the script path from this skill directory.
   - All helpers accept a session link, trace link, raw session ID, or raw trace ID.
   - `langfuse-query.sh session <langfuse_ref>` always expands to full session history first. If the input is a trace reference, it resolves the parent session and keeps the trace as the focus trace.
   - `langfuse-query.sh lsearch <langfuse_ref> <keyword...>` searches the cached full-session data.
   - `langfuse-lastmsg.sh <langfuse_ref>` shows the focused trace if a trace reference was provided, or the latest trace in the session if a session reference was provided.
4. Search the codebase for the root agent entrypoint, prompt sections, tool wiring, and any code paths implicated by the bug.
5. If the caller gives exact output file paths, write the artifacts directly to those paths instead of only returning the content in chat.
6. Produce the final write-up using `references/output-contract.md`.
7. Keep confirmed evidence separate from inference. If a claim is not directly supported by the bug ticket, logs, screenshot, or codebase, label it as a hypothesis.
