No slash command · from bitfab
Templates phase of the Bitfab Setup flow. Invoked by the setup flow; not run directly
Ships in bitfab. 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.
Run only when mode is templates.
Iterate on span-rendering templates for one trace function. Read the current template and reference, apply the requested change, then save it with traceFunctionKey set. Provide the regular template-preview link when useful. Keep review decisions in chat.
If the user passed a key as the argument, use it directly and continue.
Otherwise, pick the function:
mcp__plugin_bitfab_Bitfab__list_trace_functions to enumerate the org's traced functions. The tool returns flat FUNCTION: <key> lines; work from those keys directly. Use only the keys returned: do NOT invent or infer descriptions of what each function does from its name. Key names are often ambiguous, and guessing produces hallucinated summaries that confuse the user.*.ts, *.tsx, *.py, *.rb, *.go, *.baml) so you know which keys are instrumented here. Mark each as ✅ instrumented here (with file path) or ⚠️ not found in this repo.<key> · <repo marker + path>. No invented summaries.AskUserQuestion with 2 options: the recommended function (prefer ✅ instrumented here, and matching session context when one is clearly relevant) and a free-text "Type a function key" option. If nothing is instrumented in this repo, say so explicitly in the question, don't hide it.Call mcp__plugin_bitfab_Bitfab__get_template_reference once before any edit. It returns a stable agent-facing schema for Bitfab span templates: the rendering engine (Nunjucks, Jinja2-compatible), the render-context shape (top-level keys, SpanData / ParsedSpanData), the registered custom filters and tests, common patterns from the live default templates, and error-fallback behavior. Without this you cannot write a correct edit; references to undeclared variables silently render empty in production.
Hold the reference in your working context for the rest of the loop. Do NOT call it again on subsequent edits.
Before opening the preview, grep the codebase for the trace function key (<key>) so you can see what the function actually does. The user's "change" requests are usually about surfacing something domain-specific (an input field, a tool name, a context label), and knowing the function helps you map the request to the right span type and the right field path. If grep returns nothing (the function has been renamed or the user is operating on traces from a different repo), continue without it.
The preview page renders the most recent trace for the function. Without at least one trace it has nothing to render, so check before opening it.
Call mcp__plugin_bitfab_Bitfab__search_traces with { traceFunctionKey: "<key>", limit: 1 }. If the response contains a trace ID, continue. If the response indicates no traces exist (e.g. No traces found matching the filter criteria.), exit and tell the user in one short line: No traces yet for <key>. Run your app to generate one, then re-run \/bitfab:setup templates ` to preview.` Do NOT block waiting; the user re-invokes when they have a trace.
setup-cleanup skillNext:
templates): invoke the setup-cleanup skill with mode templates, forwarding $ARGUMENTS minus the leading mode keyword (if the user typed one).The user can watch template saves in a trace they already have open, or on the template-preview page. Both update through normal template:updated events. Offer a preview link when useful. Ask for requested changes in chat. - edit inline against the trace already on screen: skip the preview; edit in place while the user's current view updates live → step 7
Run node "${CLAUDE_PLUGIN_ROOT}/dist/commands/startTemplatePreview.js" and relay the returned URL as a clickable link. Continue the template edit loop in chat. Template saves update the preview through normal organization events. The link command exits immediately.
Each edit is driven by the user’s request in chat. Include traceFunctionKey: in every template read and save. Ask which span or region they mean when unclear.
Ask the user what they want changed in the trace view. Identify the span type and rendered region from their answer. If that is ambiguous, clarify it in chat before editing. Both the regular trace view and the linked preview update on save.
Call mcp__plugin_bitfab_Bitfab__get_template with spanType and traceFunctionKey: <key> to read the live content. The response labels its source: scoped to traceFunctionKey "<key>" (a per-key row already exists), org-global override (no per-key row yet, this is your seed for the first save), or source: file <name> (no DB rows at all). Always read before write: the prior round may have edited the same template, and overwriting blindly drops that work.
Edit the returned source in-context, one focused change per round. Resist the urge to bundle multiple unrelated tweaks into a single save: small steps let the user see each effect land on the preview and redirect mid-loop if the change isn't quite right. Stay inside the documented Nunjucks variables and filters (per the reference). Don't introduce {% extends %}; the assembler injects into base.njk's content block, so extends will break composition. When adding new visible regions, decorate them with the catalog anchors (data-section, data-field-path, data-iter-index) so future clicks resolve cleanly.
Call mcp__plugin_bitfab_Bitfab__save_template with spanType, traceFunctionKey: <key>, and the full edited body. The tool upserts the per-function row in place (no version bump, no row juggling). On the first save for a span type the row is created; subsequent edits update it. The preview updates when the save completes.
Acknowledge the save in one short line (e.g. "Saved."). The live view (the preview page in preview mode, or the trace the user already has open in inline mode) subscribes to SSE template:updated events and re-renders automatically, so do NOT tell the user to refresh. Do not paste the template body back into chat. After a non-trivial change you may briefly ask with AskUserQuestion whether the result looks right before starting the next round; for obvious tweaks (a label rename, a colour swap), skip the check and proceed.
Continue until the user says they are done. - user explicitly says they're done (the only exit in inline mode): exit the loop and acknowledge → the setup-cleanup skill
Next:
templates): invoke the setup-cleanup skill with mode templates, forwarding $ARGUMENTS minus the leading mode keyword (if the user typed one).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub project-white-rabbit/bitfab-claude-plugin --plugin bitfab19 skills in this plugin
/assistantBitfab Assistant (retired)Retired. Only use when the user explicitly types the bitfab assistant command by name; it tells them the assistant has been retired. Never use it for requests about traces, datasets, labels, verdicts, replays, experiments, or improving a traced function: handle those directly with the Bitfab MCP tools/setupBitfab SetupSet up and maintain Bitfab tracing, replay registries, and cloud replay. Use for instrumenting AI/LLM code, adding observability or evaluation, tracing another workflow, changing captured inputs/outputs, re-instrumenting a function, moving side effects across trace boundaries, inspecting missing traces, explaining Bitfab, login, organization switching, session-log consent, database snapshots, templates, or read-only repo instrumentation recommendations (analyze-repo). Also use for 'setup cloud', 'set up cloud replay', or 'replay on GitHub'. Re-enter this skill for each additional function to instrument, even after earlier setup. Do not use for improving output quality, pass rates, verdicts (labeling), or experiments (the agent does those directly with the Bitfab MCP tools), or upgrading SDK/plugin versions (use bitfab:update)