/pmstack:pmstack-custom-viewfrom pmstack: Eval Studio for product managers
Builds a custom trace renderer for Eval Studio when no built-in view fits. Reads traces, chooses between panel layout and custom view file, writes it, and validates rendering.
Ships in pmstack: Eval Studio for product managers. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A reviewer can only judge what they can see. The view shows each trace the way the customer saw it, so the reviewer notices what the customer noticed: a raw ** in a text message, a wrong price on a product card, a slide with overflowing text.
Use the project's user word (experience.userLabel, default "customer") wherever this skill says customer.
<skill-dir> is this skill's base directory: the folder holding this SKILL.md, which your agent receives when it loads the skill. Run:
PMSTACK=""
for p in "<skill-dir>/../../../.pmstack/bin/pmstack.mjs" "<skill-dir>/../../bin/pmstack.mjs" "$HOME/.pmstack/bin/pmstack.mjs"; do
[ -f "$p" ] && PMSTACK="$p" && break
done
It needs Node 20 or newer. If your shell forgets variables between commands, use the found path literally. If no path is found, send the user to https://ryanalberts.github.io/pmstack/studio/: its Set up tab offers every built-in view and "Build your own view" (the panel layout). Custom view files need the local studio. Never install npm packages.
pmstack/.studio.json names a live process), change the product setup in the studio's Set up tab, not in project.json. Check with:node -e 'try{process.kill(JSON.parse(require("fs").readFileSync("pmstack/.studio.json","utf8")).pid,0);console.log("studio running")}catch{console.log("studio not running")}'
pmstack/project.json with the studio stopped, add 1 to revision, update updatedAt, and run node "$PMSTACK" validate pmstack/project.json afterwards.Read 5 to 10 traces that differ: short and long, each channel or product line, one with an error. For each, write down:
Phase 1 is done when you can describe, in one sentence per trace, what the customer saw.
| Situation | Use |
|---|---|
| A built-in view matches: chat (text, web chat, phone calls), email, document, answer with sources, agent steps, code review, form fields, ranked list | Set experience.renderer to it and stop |
| Different traces need different built-in views (calls and texts, for example) | experience.rendererBy: { "key": "channel", "map": { "email": "email" } } |
| The trace is a few fields, each fine as text, formatted text, chat, cards, a table, details, or structured data | A panel layout (Phase 3a) |
| The customer saw something panels cannot draw: a styled card, a slide, an image with overlays, two items side by side | A custom view file (Phase 3b) |
Phase 2 is done when you have picked one row and can say why the row above it falls short.
Set experience.renderer to "layout" and list the panels in experience.layout, in reading order:
"layout": [
{ "label": "Shopper's request", "path": "input", "as": "text" },
{ "label": "What the shopper saw", "path": "output.items", "as": "cards" },
{ "label": "Search results", "path": "steps[0].output", "as": "table" }
]
path points into the raw trace (dots and [index]). as is one of text, markdown, chat, cards, table, details, json. Each panel becomes a pickable step panel:<i>, so the reviewer can mark the first panel that went wrong. The studio's "Build your own view" card edits the same list with a live preview.
Write pmstack/renderers/<id>.mjs. The id matches ^[a-z0-9][a-z0-9-]{0,40}$, such as slide-card. Then set experience.renderer to "custom:<id>", or name it in a rendererBy map. Custom views load only in the local studio.
Read these before writing, so you match the real contract:
$(dirname "$PMSTACK")/../docs/studio/renderers/common.mjs: the shared pieces and their props.list.mjs or chat.mjs.examples/quickstart/pmstack/renderers/sms-card.mjs in the pmstack repository, when available: a complete custom view.The contract:
pmstack/ui (html, hooks, small components), pmstack/renderers/common, and preact/hooks. No other imports, no network requests, no remote images.{ trace, experience, showHidden, pickedStepId, onPickStep, highlights, stepBadges, retrieval, onRetrieval, compact }. Every callback may be missing; with no onPickStep, draw no pick button.stepBadges is { [stepId]: [{ tone, text }] }, such as a policy check's "Breaks policy: Ask before acting". Draw each step's badges next to it with StepBadges and badgesFor from pmstack/renderers/common: <${StepBadges} badges=${badgesFor(stepBadges, step.id)} />.trace is the normalized trace: id, title, metadata (flat keys like channel), context ([{ label, value }]), input, steps (id, kind, role, name, text, data, status, stage, callId, customerVisible, isOutput), and output. The studio draws trace.result itself; leave it out.data-step-id with that step's id, and shows its stage tag when step.stage is set.onPickStep(step.id, step.stage); the picked step (pickedStepId) shows as picked.showHidden is false, internal steps (system, tool calls and results, search, model steps) collapse into the shared "steps behind the scenes" expander in place. They stay one click away.<${Comp} ...> closed with <//>, class (not className), onInput for text fields, kebab-case SVG attributes such as stroke-width. Render text as text; formatted text goes through the shared Markdown component. Never set inner HTML.style attributes that use the studio's color variables (var(--surface), var(--surface-2), var(--ink), var(--ink-2), var(--line)), so light and dark themes both work.A minimal starting shape, before adding the shared pieces:
import { html } from 'pmstack/ui';
// Draws the slide the customer saw. Every step element carries data-step-id.
export default function SlideView({ trace, pickedStepId }) {
const out = trace.steps.find((s) => s.isOutput);
return html`
<article style="background: var(--surface); color: var(--ink)">
<h4>${trace.title}</h4>
${out && html`
<section data-step-id=${out.id} aria-current=${out.id === pickedStepId ? 'true' : null}>
${out.text}
</section>`}
</article>`;
}
Design rules:
**Friday** literally, the view shows the asterisks.experience.filters.callId), so cause and effect sit side by side.Before starting the studio, check the syntax: node --check pmstack/renderers/<id>.mjs.
node "$PMSTACK" validate pmstack/project.json.Eval Studio: http://127.0.0.1:<port>/:node "$PMSTACK" studio <folder> --port 0
curl -s -o /dev/null -w "%{http_code}\n" "<url>custom/renderers/<id>.mjs" prints 200.<url>#/review/<trace-id> for 3 of the traces from Phase 1 (encode the id with encodeURIComponent). With a browser tool: take a screenshot of each, read the console, and count [data-step-id] elements. Toggle "Show behind-the-scenes steps" (H) and click a step's "First thing that went wrong" button once.Phase 4 is done when 3 traces render in the new view with a clean console, a data-step-id on every step, and a working pick button, and the "Custom view could not load" notice never appears.
View: <built-in name | layout with n panels | custom:<id>>
Why: <one line on what the customer saw that the built-in views missed>
Checked on: <3 trace ids>, <screenshots taken | not seen, user to confirm>
Filters added: <keys>
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
12 skills in this plugin
/pmstack-build-judgeBuilds an AI judge (a prompt that asks a model for Pass or Fail) for one failure mode found while reviewing traces, and saves it as a check in the pmstack project. Checks the prerequisites (at least 20 Problem and 20 Good labels, no simple rule that could decide it, the product's instructions already ask for the behavior), turns the failure mode's definition into Pass and Fail rules, picks 2 to 4 examples from the examples split only, puts the critique before the result, limits what the judge sees, pins an exact model version, and runs it on the tuning set. Use when a failure mode is marked Build a check and needs judgment a simple rule cannot make, or when someone asks to write, draft, or improve a judge prompt./pmstack-check-sourcesChecks an answer bot that searches documents by testing the search and the answer separately. Reviews full traces first, has the reviewer mark the sources each answer needed, measures the search with Recall@k and mean reciprocal rank, fixes search before the answer step, then builds one judge for answers backed by their sources and another for answers that address the question. Use when a product answers questions from a document collection, knowledge base, help center, or search results, when its answers cite sources, or when someone mentions RAG.npx claudepluginhub ryanalberts/pmstack --plugin pmstackOther plugins' skills for the same job