No slash command · from bitfab
Analyze Repo 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 analyze-repo.
Analyze the repository without changing code or asking for confirmation. Read the source, identify the most valuable AI workflows to instrument, and report recommendations with file locations and replay considerations. No server-side planning artifact is created.
First, confirm authentication non-interactively. Call mcp__plugin_bitfab_Bitfab__get_bitfab_api_key to retrieve the API key for the plugin's active org. If it returns a key, hold it and continue. If it errors or returns no key, STOP the whole phase immediately: this mode cannot run the interactive login (that needs a browser sign-in). Tell the user to run /bitfab:setup login first, then re-run /bitfab:setup analyze-repo. Do not prompt, do not retry, do not fall through to scanning.
Then detect the project language (TypeScript, Python, Ruby, or Go). In a monorepo, identify which directories are applications (services, APIs, agents) vs libraries (SDKs, shared packages) and focus on the application directories. Scan imports and package manifests for supported framework signals, and note which framework each application directory uses:
@langchain/langgraph, @langchain/core; Python: langgraph, langchain, langchain_coredeepagents, createDeepAgent (takes precedence over LangGraph / LangChain when present); Python: deepagents, create_deep_agent (takes precedence over LangGraph / LangChain when present)@openai/agents, setTraceProcessors; Python: agents (from agents import ...)@anthropic-ai/claude-agent-sdk, query(; Python: claude_agent_sdk, ClaudeSDKClient, query(@boundaryml/baml, baml_client import; Python: baml-py, from baml_client import bai, wrapLanguageModel, streamText, generateText (TypeScript only)@earendil-works/pi-agent-core, @mariozechner/pi-agent-core, @earendil-works/pi-coding-agent (createAgentSession); instrument with getPiIntegration(key).instrument(agent) (TypeScript only)@livekit/agents (voice.AgentSession, voice.Agent); instrument the session with getLiveKitIntegration(key).instrument(session) and register runTurn({ buildSession, buildAgent }) for replay; Python: livekit-agents (from livekit.agents import AgentSession, Agent); instrument the session with get_livekit_integration(key).instrument(session) and register run_turn(build_session=..., build_agent=...) for replayFirst, check the skill invocation arguments for free-text guidance. Anything after a guidance: marker (e.g. analyze-repo guidance: focus on the billing and checkout flows) is the user's steer on what to prioritize. When present, let it shape this scan: bias toward the areas, directories, or workflow types the guidance names, and still record other candidates you find so selection can fall back to them. When absent, scan the whole codebase evenhandedly as below. Never treat the guidance as a reason to prompt the user or to skip the non-interactive contract.
Read the codebase to identify every AI workflow, each place the app makes LLM calls, runs agents, or makes AI-driven decisions. In a monorepo, search each application directory separately (a root-level search misses subdirectories). For each workflow, find the outer workflow boundary (the function that builds any framework/stateful object, invokes it, and processes the output, e.g. an API handler, message processor, job runner, or pipeline coordinator, almost never the SDK's own run()/invoke() call), and note the meaningful work above it (auth, validation, input prep, retry/orchestration loops, multi-agent coordination), alongside it (custom LLM calls outside the SDK, unregistered tools, downstream services), and below it (post-processing, parsing, persistence). In supported TypeScript and Python workflows, this analysis identifies the opt-out trace root and the descendants that need explicit withNode/node policy. Only in fallback runtimes does it identify spans to add around auto-captured SDK content. In supported TypeScript and Python framework integrations, the native framework spans stay beneath the opt-out root.
Record each candidate's replayability up front, because it drives selection in the next step. A trace is replayable only if either (1) the boundary's inputs are serializable by the SDK's tracing layer, or (2) the workflow runs on a supported framework integration that records a replayable root (LangGraph / LangChain, LangChain Deep Agents, OpenAI Agents SDK, Claude Agent SDK, Vercel AI SDK, Pi agent harness, or LiveKit Agents). Flag boundaries whose natural inputs are unserializable: live SDK client instances passed as arguments (OpenAI/Anthropic/Bedrock clients, configured agents, DB connections, often smuggled inside an options/config bag), HTTP Request/Response, stream writers, open sockets, browser objects, or genuinely opaque request contexts. Module-scope or closure-captured dependencies do NOT count as unserializable inputs because runtime wiring resolves them without storing them as span arguments; only values passed as arguments do. Note, per candidate: the trace function boundary, its input shape and whether it is serializable, and the external state/side effects it touches (DB reads/writes, third-party APIs, queues, blob storage).
Also record each candidate's existing instrumentation, so the report describes the delta between what's already traced and what's recommended. Grep each workflow for existing Bitfab SDK usage (withTrace, trace, withNode, node, withSpan, @span, bitfab_span, client.Span, getFunction, get_function, bitfab_function, WithFunctionName) and for the TypeScript transform/build adapter. For each candidate note whether it is already instrumented and, if so: its traceFunctionKey; whether capture is an opt-out trace tree, framework auto-capture, or an opt-in span tree; whether the TypeScript production entrypoint is transformed; which descendants have explicit node/span configuration; and which captured descendants serve their recorded output on replay. Existing opt-in spans elsewhere in a repository do not establish a house style and are not a reason to recommend more opt-in instrumentation. If the selected call stack already contains spans, recommend a coherent conversion or a disjoint trace root rather than placing withTrace/trace around those spans, which would raise MixedTracingError. Use this map in step 4 to distinguish existing instrumentation from recommended changes. An already-instrumented candidate remains eligible when source analysis identifies useful improvements. Do not build or upload planning artifacts.
Rank the workflows found in step 2 by tracing value, most valuable first: prefer complex or LLM-heavy workflows, multi-step agents, and high-traffic production paths; deprioritize thin single-call wrappers and anything that only exists to test or explore locally (dev CLIs, notebooks).
If the invocation carried free-text guidance: (see step 2), let it drive this ranking: candidates matching the user's steer come first, and only fill the remaining slots with the general value ranking above. Treat the guidance as a strong preference, not a hard filter: if it matches fewer than N candidates, top up from the rest rather than recommending fewer workflows.
Pick the top N, where N is the workflow cap for this run. Read N from the skill invocation arguments: if they include a limit=<number> token (e.g. analyze-repo limit=3), use that number; otherwise default to 5. Pick fewer than N only if fewer valid candidates exist; pick more than N only if several are clearly tied for value and cheap to assess (never exceed N when it was explicitly passed).
Resolve serializability without prompting or editing code, since this mode never refactors:
/bitfab:setup instrument pass to create a serializable boundary, then recommend opt-out withTrace/trace plus withNode/node on that boundary when the runtime supports it. Only drop a candidate when there is no identifiable production workflow boundary at all. Report every one of the N selected workflows; dropping should be rare.If zero valid candidates remain, skip to step 4 and say so.
Print one plain-markdown report of the selected workflows. Lead with "Identified N workflows to instrument". For each, give the function key, root file and signature, what it does, frameworks, existing instrumentation, tracing value, additive instrumentation approach, replay dependencies, and estimated effort. Distinguish already-instrumented workflows and candidates requiring a refactor. Do not edit code, upload artifacts, wait for review, or claim changes were made. The user can ask setup to instrument a named workflow from this report.
Next:
analyze-repo: invoke the setup-cleanup skill with mode analyze-repo, forwarding $ARGUMENTS minus the leading mode keyword (if the user typed one).What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
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)/setup-approachApproach phase of the Bitfab Setup flow. Invoked by the setup flow; not run directly/setup-cleanupCleanup phase of the Bitfab Setup flow. Invoked by the setup flow; not run directly/setup-cloudCloud replay phase of the Bitfab Setup flow. Invoked by the setup flow; not run directly/setup-db-snapshotDB Snapshot phase of the Bitfab Setup flow. Invoked by the setup flow; not run directly