Understand the workload (profile traces, data, prompts, and code path)
The intermediate step before you compare, optimize, or route models. You
cannot improve an AI workload you cannot explain. Seeing generated questions
or a side-by-side duel in isolation is secondary; first help the user understand
what their workload is meant to accomplish, what data it represents, and how a
request moves through the app. This skill turns traces, prompt files, datasets,
and code paths into a shared mental model — purpose, inputs, outputs, steps,
tool-call flow, data shape, failure modes, and success criteria — built with
the user through inference-first, targeted Q&A.
Every workload is different, so this is a skill, not a script: the agent
acts as the conversational frontend, extracts structure and a proposed task
meaning from traces and code, and asks the user only about material uncertainty.
When this understanding feeds a hosted eval and the owner is unavailable,
preserve uncertainty explicitly and continue to a provisional local draft
rather than blocking useful analysis.
Safety Gates
- Redact customer content. Captured prompts often contain real customer data
(transcripts, PII, business records). Show structure — system-prompt
outline, message roles + sizes, tool catalog, output schema — never raw message
bodies. Build the decomposer to redact by construction (sizes and headings, not content).
- Local-first. The decomposition/understanding doc stays local; do not commit
it or paste customer payloads into external services. The generated questions
must be synthetic (no customer data) before they can be committed or sent to a
model.
- Make cost/latency/model claims from the capture itself, not memory.
- No premature duel. Do not route to a frontier-vs-local head-to-head until
the workload purpose, data shape, and success criteria are clear enough that
the comparison questions map to real task behavior.
Inputs it handles
- Understudy capture envelopes (
.jsonl with a customer_request_body).
- Raw request JSON (Anthropic/OpenAI shape:
model, system, messages, tools).
- Prompt/config files embedded in an app (
prompts/, route handlers, agent
policy files, YAML/JSON configs, eval manifests).
- Code paths that assemble the request, call the provider, parse responses,
invoke tools, retry, stream, or write state.
- Datasets and eval rows (
.jsonl, fixtures, golden outputs, trace exports,
benchmark tasks, request logs).
- A folder of captures — pick one or two representative ones (e.g. median and
largest token count) rather than all of them.
Flow
Locate the workload surface. Start from what the user named: codebase,
app route, prompt file, dataset, eval suite, trace export, benchmark fixture,
request log, or existing runner. List candidate surfaces and identify which
one appears to be the actual production or benchmark workload. If given a
dataset or trace folder, list row/count/file sizes and pick the median +
largest representative cases (size drives the harness story). Understudy
captures are envelopes with a customer_request_body; parse that to get the
request (model, system, messages, tools, params).
Trace the request/response path in situ. Follow the code from user input
or eval row to prompt assembly, model/provider call, tool loop, response
parsing, retries, streaming, and any writes. Name the files/functions/routes
involved, the env var names used for providers, and where logs or traces are
emitted. Do not stop at "there is a prompt"; show the whole path the request
takes and where the candidate model can safely be swapped in.
Decompose the request structure, redaction-safe — extract and report only:
model + params, token size, the system-prompt outline (its # headings, not
the body), the messages (roles + char sizes — never content), the tool
catalog grouped by action class (read / transform / write / search /
orchestrate / notify / exec, with each tool's token cost), and the output schema.
Crucially, split the token cost into fixed overhead (system + tool definitions,
re-sent every turn) vs per-call content — the fixed share is usually the
surprise and drives the harness story.
Profile the data or traces. Before model comparison, describe what the
dataset represents: row count, split/source if known, task categories, input
size distribution, output shapes, labels/golden fields, tool-call/request-log
counts, common failure classes, and outliers. Use metadata, schemas, counts,
hashes, and redacted examples. If raw examples are needed, ask for explicit
approval and show the smallest safe excerpt.
Explain it back in plain language — seven facets, each one or two sentences:
- Purpose — what is this prompt trying to accomplish?
- Inputs — what goes in (and roughly how big)?
- Data represented — what rows/traces/users/tasks does this dataset stand for?
- Outputs — what should come out, in what shape?
- Steps — how many, and what is each step doing?
- Tools/actions — what can it touch, and which calls mutate state?
- Code path — where the request is assembled, called, parsed, and logged.
- How we judge success — the task-level criteria (correct records written,
right observations extracted, policy followed) — not just cost and speed.
Show the flow as a mermaid diagram. Draw the agent loop and tool classes so
the user can see the shape: inputs → system → loop → {read / transform / write}
→ final state. For a multi-turn case, also reconstruct the loop turn-by-turn from
the (history-carrying) captures — per-request token growth and how context
compounds as tool results are appended — and render that too. When the user
wants to inspect the underlying calls interactively, build the private local
viewer from
../ingest-traces/references/trace-viewer.md
and keep its payload-bearing output under .understudy/.
Targeted Q&A — infer first, then ask only about consequential gaps. Show
the proposed purpose, success criteria, execution modes, and failure taxonomy
with the local evidence behind each inference. Do not ask the user to restate
information already present in the repository or traces. Use
AskUserQuestion only for gaps whose answers would materially change the
metric, environment, or case selection, e.g.:
- "Is the goal extraction (read→structured output) or orchestration
(read→decide→write)? I inferred X from the tools — right?"
- "Which step is the one that actually matters for success?"
- "What counts as a correct outcome here — and what's an unacceptable failure
(e.g. a wrong write vs a missed item)?"
- "Where does the big token cost come from — fixed context or per-item input?"
Incorporate answers when available. If the person at the keyboard is not the
workload owner or cannot answer, label the affected statements provisional,
and list the smallest owner decisions still needed. When this feeds the
hosted-eval path, continue authoring the local eval draft; otherwise finish
the provisional workload brief. Never turn an unanswered question into a
fabricated owner confirmation.
Write the proposed success criteria — the rubric axes for this
workload, beyond cost/latency: final-state correctness, extraction
recall/precision, policy compliance, no-bad-writes, schema validity. These
become the metric capture-evidence and downstream local/optimizer runs use.
Mark them provisional until a workload owner or delegated domain expert
confirms them; trace outputs are observations, never correctness authority.
Use the shared understanding to test or improve models. Primary path:
freeze a workload contract with ../capture-evidence/SKILL.md
and run the local model against the real task via
../run-local-model-lab/SKILL.md or the
appropriate optimizer skill. Optional side quest: derive grounded vibe-check
questions for ../ladder/SKILL.md, each mapped to a
real step/criterion, when the user needs a visible
local-vs-frontier feel check. For a whole-case test a small model cannot one-shot, build a simulated
environment only when no real resettable workload exists.
For a workload hosted by Understudy, follow the draft-first branch in
../capture-evidence/references/hosted-workload-eval.md.
Use the exact one-day raw source and repository to create the local draft, then
run understudy evals check --draft. The CLI defaults to the rolling 24 hours
ending when export starts; --date YYYY-MM-DD selects a completed UTC day.
Keep raw traces local. Strict checking, final approval, and publication remain
separate owner-confirmed release steps.
Output Standard
End with: workload surface inspected; representative trace(s)/dataset rows
chosen and their size; the request/response code path; data/trace profile; the
seven-facet explanation; the mermaid flow; success criteria agreed with the
user or explicitly marked provisional; unresolved assumptions and the smallest
owner decisions still needed; artifact paths for the local workload brief; and
the next evidence action.
If you include ladder vibe-check questions, mark them optional and tie each to a
real step or criterion. Keep the decomposition doc local; only synthetic
questions leave.
Single-run tool-failure forensics
When one environment-backed or tool-calling run failed and the question is
"why did the model make that choice from what it actually saw?", use
references/tool-trace-forensics.md. It
separates environment evidence from model-visible evidence, reconstructs
reads/writes before the first mutation, classifies the failure (retrieval,
authority precedence, format, ID resolution, parser, harness), and recommends
the highest-leverage fix supported by the failure evidence before training.
References
1---2name: understand-workload3description: Use when a developer wants a captured prompt, trace, or dataset explained before changing anything — "explain this prompt", "what is this trace actually doing", "decompose this workload", "help me understand this dataset before testing models". Builds a shared mental model (purpose, inputs, tools, success criteria) with the user through Q&A.4---56# Understand the workload (profile traces, data, prompts, and code path)78The intermediate step before you compare, optimize, or route models. **You9cannot improve an AI workload you cannot explain.** Seeing generated questions10or a side-by-side duel in isolation is secondary; first help the user understand11what their workload is meant to accomplish, what data it represents, and how a12request moves through the app. This skill turns traces, prompt files, datasets,13and code paths into a *shared mental model* — purpose, inputs, outputs, steps,14tool-call flow, data shape, failure modes, and success criteria — built **with**15the user through inference-first, targeted Q&A.1617Every workload is different, so this is a skill, not a script: the agent18acts as the conversational frontend, extracts structure and a proposed task19meaning from traces and code, and asks the user only about material uncertainty.20When this understanding feeds a hosted eval and the owner is unavailable,21preserve uncertainty explicitly and continue to a provisional local draft22rather than blocking useful analysis.2324## Safety Gates2526- **Redact customer content.** Captured prompts often contain real customer data27 (transcripts, PII, business records). Show **structure** — system-prompt28 outline, message roles + sizes, tool catalog, output schema — never raw message29 bodies. Build the decomposer to redact by construction (sizes and headings, not content).30- **Local-first.** The decomposition/understanding doc stays local; do not commit31 it or paste customer payloads into external services. The *generated questions*32 must be synthetic (no customer data) before they can be committed or sent to a33 model.34- Make cost/latency/model claims from the capture itself, not memory.35- **No premature duel.** Do not route to a frontier-vs-local head-to-head until36 the workload purpose, data shape, and success criteria are clear enough that37 the comparison questions map to real task behavior.3839## Inputs it handles4041- **Understudy capture envelopes** (`.jsonl` with a `customer_request_body`).42- **Raw request JSON** (Anthropic/OpenAI shape: `model`, `system`, `messages`, `tools`).43- **Prompt/config files** embedded in an app (`prompts/`, route handlers, agent44 policy files, YAML/JSON configs, eval manifests).45- **Code paths** that assemble the request, call the provider, parse responses,46 invoke tools, retry, stream, or write state.47- **Datasets and eval rows** (`.jsonl`, fixtures, golden outputs, trace exports,48 benchmark tasks, request logs).49- A **folder** of captures — pick one or two representative ones (e.g. median and50 largest token count) rather than all of them.5152## Flow53541. **Locate the workload surface.** Start from what the user named: codebase,55 app route, prompt file, dataset, eval suite, trace export, benchmark fixture,56 request log, or existing runner. List candidate surfaces and identify which57 one appears to be the actual production or benchmark workload. If given a58 dataset or trace folder, list row/count/file sizes and pick the median +59 largest representative cases (size drives the harness story). Understudy60 captures are envelopes with a `customer_request_body`; parse that to get the61 request (`model`, `system`, `messages`, `tools`, params).62632. **Trace the request/response path in situ.** Follow the code from user input64 or eval row to prompt assembly, model/provider call, tool loop, response65 parsing, retries, streaming, and any writes. Name the files/functions/routes66 involved, the env var names used for providers, and where logs or traces are67 emitted. Do not stop at "there is a prompt"; show the whole path the request68 takes and where the candidate model can safely be swapped in.69703. **Decompose the request structure, redaction-safe** — extract and report only:71 model + params, token size, the **system-prompt outline** (its `#` headings, not72 the body), the **messages** (roles + char sizes — never content), the **tool73 catalog grouped by action class** (read / transform / write / search /74 orchestrate / notify / exec, with each tool's token cost), and the output schema.75 Crucially, split the token cost into **fixed overhead (system + tool definitions,76 re-sent every turn) vs per-call content** — the fixed share is usually the77 surprise and drives the harness story.78794. **Profile the data or traces.** Before model comparison, describe what the80 dataset represents: row count, split/source if known, task categories, input81 size distribution, output shapes, labels/golden fields, tool-call/request-log82 counts, common failure classes, and outliers. Use metadata, schemas, counts,83 hashes, and redacted examples. If raw examples are needed, ask for explicit84 approval and show the smallest safe excerpt.85865. **Explain it back in plain language** — seven facets, each one or two sentences:87 - **Purpose** — what is this prompt trying to accomplish?88 - **Inputs** — what goes in (and roughly how big)?89 - **Data represented** — what rows/traces/users/tasks does this dataset stand for?90 - **Outputs** — what should come out, in what shape?91 - **Steps** — how many, and what is each step doing?92 - **Tools/actions** — what can it touch, and which calls *mutate state*?93 - **Code path** — where the request is assembled, called, parsed, and logged.94 - **How we judge success** — the task-level criteria (correct records written,95 right observations extracted, policy followed) — **not just cost and speed.**96976. **Show the flow as a mermaid diagram.** Draw the agent loop and tool classes so98 the user can *see* the shape: inputs → system → loop → {read / transform / write}99 → final state. For a multi-turn case, also reconstruct the loop turn-by-turn from100 the (history-carrying) captures — per-request token growth and how context101 compounds as tool results are appended — and render that too. When the user102 wants to inspect the underlying calls interactively, build the private local103 viewer from104 [`../ingest-traces/references/trace-viewer.md`](../ingest-traces/references/trace-viewer.md)105 and keep its payload-bearing output under `.understudy/`.1061077. **Targeted Q&A — infer first, then ask only about consequential gaps.** Show108 the proposed purpose, success criteria, execution modes, and failure taxonomy109 with the local evidence behind each inference. Do not ask the user to restate110 information already present in the repository or traces. Use111 `AskUserQuestion` only for gaps whose answers would materially change the112 metric, environment, or case selection, e.g.:113 - "Is the goal *extraction* (read→structured output) or *orchestration*114 (read→decide→write)? I inferred X from the tools — right?"115 - "Which step is the one that actually matters for success?"116 - "What counts as a correct outcome here — and what's an unacceptable failure117 (e.g. a wrong write vs a missed item)?"118 - "Where does the big token cost come from — fixed context or per-item input?"119 Incorporate answers when available. If the person at the keyboard is not the120 workload owner or cannot answer, label the affected statements provisional,121 and list the smallest owner decisions still needed. When this feeds the122 hosted-eval path, continue authoring the local eval draft; otherwise finish123 the provisional workload brief. Never turn an unanswered question into a124 fabricated owner confirmation.1251268. **Write the proposed success criteria** — the rubric axes for *this*127 workload, beyond cost/latency: final-state correctness, extraction128 recall/precision, policy compliance, no-bad-writes, schema validity. These129 become the metric `capture-evidence` and downstream local/optimizer runs use.130 Mark them provisional until a workload owner or delegated domain expert131 confirms them; trace outputs are observations, never correctness authority.1321339. **Use the shared understanding to test or improve models.** Primary path:134 freeze a workload contract with [`../capture-evidence/SKILL.md`](../capture-evidence/SKILL.md)135 and run the local model against the real task via136 [`../run-local-model-lab/SKILL.md`](../run-local-model-lab/SKILL.md) or the137 appropriate optimizer skill. Optional side quest: derive grounded vibe-check138 questions for [`../ladder/SKILL.md`](../ladder/SKILL.md), each mapped to a139 real step/criterion, when the user needs a visible140 local-vs-frontier feel check. For a whole-case test a small model cannot one-shot, build a simulated141 environment only when no real resettable workload exists.142143For a workload hosted by Understudy, follow the draft-first branch in144[`../capture-evidence/references/hosted-workload-eval.md`](../capture-evidence/references/hosted-workload-eval.md).145Use the exact one-day raw source and repository to create the local draft, then146run `understudy evals check --draft`. The CLI defaults to the rolling 24 hours147ending when export starts; `--date YYYY-MM-DD` selects a completed UTC day.148Keep raw traces local. Strict checking, final approval, and publication remain149separate owner-confirmed release steps.150151## Output Standard152153End with: workload surface inspected; representative trace(s)/dataset rows154chosen and their size; the request/response code path; data/trace profile; the155seven-facet explanation; the mermaid flow; success criteria agreed with the156user or explicitly marked provisional; unresolved assumptions and the smallest157owner decisions still needed; artifact paths for the local workload brief; and158the next evidence action.159If you include ladder vibe-check questions, mark them optional and tie each to a160real step or criterion. Keep the decomposition doc local; only synthetic161questions leave.162163## Single-run tool-failure forensics164165When one environment-backed or tool-calling run failed and the question is166"why did the model make that choice from what it actually saw?", use167[`references/tool-trace-forensics.md`](references/tool-trace-forensics.md). It168separates environment evidence from model-visible evidence, reconstructs169reads/writes before the first mutation, classifies the failure (retrieval,170authority precedence, format, ID resolution, parser, harness), and recommends171the highest-leverage fix supported by the failure evidence before training.172173## References174175- [`../ingest-traces/references/profile-captures.md`](../ingest-traces/references/profile-captures.md) — the fleet sibling: profile a whole capture dir into a cost + call-type taxonomy first, then aim this skill at the cluster worth decomposing.176- [`../ladder/SKILL.md`](../ladder/SKILL.md) — no-data local-vs-frontier feel check the questions can feed.177- [`../design-simulated-environment/SKILL.md`](../design-simulated-environment/SKILL.md) — turn the understood workload into a scorable env.178- [`../recursive-language-model/SKILL.md`](../recursive-language-model/SKILL.md) — decompose so a small model can take the whole case.179- [`../capture-evidence/SKILL.md`](../capture-evidence/SKILL.md) — freeze the metric/splits.180- [`../optimize-agentic-workload/SKILL.md`](../optimize-agentic-workload/SKILL.md) — the agentic-workload metric axes.