AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Wandb Primary

skill-wandb-skills-wandb-primary · by wandb

Primary W&B skill for broad or mixed Weights & Biases work: project overviews, W&B runs and artifacts, Weave traces and evaluations, Reports, Signal Builder, and Launch workflows. Use when the task spans multiple W&B surfaces or the user asks generally what is happening in a W&B project.

No reviews yet
0 installs
26 views
0.0% view→install

Install

$ agentstack add skill-wandb-skills-wandb-primary

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-wandb-skills-wandb-primary)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Wandb Primary? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

W&B Primary Skill

Environment defaults

  • Python: run scripts with the Python environment available to your coding agent. Install missing optional packages only when needed.
  • Credentials: use WANDB_API_KEY, WANDB_ENTITY, and WANDB_PROJECT from the user's environment or prompt.

Fast recipes — use these first

These cover the most common tasks. Each is a single script. Copy, fill in placeholders, run.

Fast product/API answers

For small W&B product or API questions, answer directly from this section. Do not run tools, inspect docs, or query the user's project unless they explicitly ask for live data. Keep the answer short: direct answer, exact UI/API path, minimal code if useful. If the recommendation depends on missing context, include targeted diagnostic questions in the same response instead of blocking.

For workspace migration or project-structure guidance, ask the diagnostic questions before prescribing a structure or script. Use the phrase "Before I prescribe a structure/script, I need to know:" and include the questions that materially change the answer; then give only tentative guidance.

Product facts to answer from memory

| User asks | Answer with | |---|---| | "How can I see team members via API?" | Use api = wandb.Api() then api.team("").members. Member objects expose fields such as username, name, email, and admin status. | | "Can I programmatically set/update workspaces?" | Yes. Use the wandb-workspaces Python library to define, save, and edit workspaces/views programmatically, including copying views across projects. Before prescribing the exact script, ask whether this is W&B Workspaces, what fields are renamed, how often, what the current manual workflow is, what access/tooling they have available, how many views/workspaces are affected, whether the renames are metrics/config/summary fields, whether they want in-place edits or generated standardized views, and how renames propagate downstream. | | "Static/archive report for compliance?" | W&B Reports have a built-in static export: open the report action menu (...), choose Download, then select PDF or LaTeX. Store the exported file in JIRA or compliance systems. Do not recommend browser Print -> Save as PDF as the primary path. | | "Can reports include PNG/JPEG images?" | Yes. In the UI, press / on a new report line, choose Image, then drag/drop the PNG/JPEG. Programmatically, use wandb-workspaces: import wandb_workspaces.reports.v2 as wr, then add wr.Image(url=..., caption=...) to the report blocks. | | "Are reports associated with an entity?" | Yes. Reports are created within a project, and every project belongs to an entity (user or team). The wr.Report API requires both entity and project; team-project reports are visible to the team, private user-project reports are private to that user. | | "Can I update a prompt created in the UI?" | Weave prompt versions are immutable. To "update", publish a new version with the same prompt name using weave.publish() or the prompt publish API. The new version becomes :latest, previous versions remain in history, and this works for UI-created prompts if you reuse the same prompt name. | | "How should we structure runs across projects?" | Do not prescribe a structure before surfacing ambiguity and do not validate "using projects wrong" without context. Ask targeted questions first about expected run volume per project, what current projects represent, what cross-project comparisons/filters are needed, whether compared runs are the same conceptual experiment/eval/model family, metric-schema differences, audiences/access boundaries, and whether related experiments are over-split. Then give tentative guidance: projects are best as comparison/workspace boundaries; use config, tags, groups, and job_type for segmentation inside a project. | | "Need more observability into agent traces?" | Recommend W&B Weave only. Show weave.init(...), @weave.op(), and optionally weave.Evaluation for evaluations. Keep the recommendation focused on W&B Weave unless the user asks for tool comparisons. | | "How can I check UI agent success from workspace data?" | List these three UI/data options explicitly: (1) screenshots from trajectory runs, (2) Weave traces of trajectories, and (3) summary tables from runs. Then explain that screenshots show visual task completion, Weave traces show step-by-step calls/errors/scorer outputs, and run summary tables let users compare success metrics across agents. | | "Show code for sweeps / multiple experiments" | Put W&B instrumentation directly in the main sweep/training code, not an optional appendix. Use wandb.init(project=..., config=...), wandb.log(...), and wandb.agent(...)/sweep config patterns unconditionally unless the user asks for a flag. |

Trace-count semantics

Use these rules before every Weave count query:

  • "total traces" or "total calls" means all calls. Use calls_query_stats with no

trace_roots_only filter. Do not deduplicate by trace_id unless the prompt asks for unique traces.

  • "root traces", "root-level traces", or "traces with no parent" means root calls.

Use filter={"trace_roots_only": True} only for those prompts.

  • "successful/non-error traces" means total calls minus calls with status error

/ descendant_error / non-null exception; report that as the primary count. summary.weave.status == "success" is a useful supporting breakdown, but it excludes running calls, which are still non-error. Do not count only root traces unless the user says root/root-level.

  • "error/exception traces" means calls with status error OR descendant_error

OR a non-null exception. For root-level error counts, add trace_roots_only=True to that same error query.

  • Evaluation.evaluate counts are op counts. Use an op_names filter for

weave://///op/Evaluation.evaluate:*. Add trace_roots_only only if the user explicitly asks for root eval traces.

  • For exact count tasks, run one script that prints the query and the number; do not

run sample/exploratory scripts after the count is already known.

Eval-analysis rules

  • Filter Evaluation.evaluate calls with

op_names=[f"weave:///{entity}/{project}/op/Evaluation.evaluate:*"].

  • Fetch only needed columns (id, display_name, started_at, ended_at,

summary, inputs, output) and avoid broad object dumps.

  • Eval token usage is in summary.usage; sum input_tokens,

output_tokens, and total_tokens across model keys.

  • Eval success/error counts are in summary.status_counts, not

summary.weave.status_counts. Normalize enum and string keys before reading success, error, and descendant_error.

  • For success-rate tasks, do not lead with a long 43-row markdown table.

First answer with totals, both fractions, and a compact Error evaluations (N): TSV/code block containing every errored eval id, date, successcount, errorcount, and status. If full per-eval rows are requested, use short IDs/dates/counts after the error list; avoid repeating long duplicate display names where they cause truncation. If some evals are still running, report both denominators: success-status evals over completed evals and no-error evals over all evals.

  • Child dataset rows are Evaluation.predict_and_score:* calls with

parent_ids=[eval_call.id].

  • Dataset refs live on inputs["self"].dataset inside the Evaluation object.

Count distinct dataset object refs from the user's project data; repeated evals can reuse the same dataset ref.

  • For scorer inventories, eval summaries, and scorer evolution, include both

wrapper scorer ops whose short names end in _scorer and class scorer ops ending in .score. Never filter only for the substring scorer; versioned class scorers like MyClassifier.score do not contain it.

  • For large scorer inventories, include a compact full TSV/code block

(scorer\tcount) for every scorer and then summarize family groupings. Do not use long prose tables that may truncate before all counts appear.

Count runs (exact, fast)

import wandb, os
api = wandb.Api(timeout=120)
path = f"{os.environ['WANDB_ENTITY']}/{os.environ['WANDB_PROJECT']}"
total = len(api.runs(path, per_page=1, include_sweeps=False, lazy=True))
finished = len(api.runs(path, filters={"state": "finished"}, per_page=1, include_sweeps=False, lazy=True))
crashed = len(api.runs(path, filters={"state": "crashed"}, per_page=1, include_sweeps=False, lazy=True))
running = len(api.runs(path, filters={"state": "running"}, per_page=1, include_sweeps=False, lazy=True))
print(f"Total: {total}  |  Finished: {finished}  |  Crashed: {crashed}  |  Running: {running}")

Run-count rules:

  • Use one script for exact counts. If it prints the requested count, answer from

that stdout; do not rerun just to add labels or nicer formatting.

  • Use include_sweeps=False for normal run-table counts unless the prompt asks

for sweep runs. For sweep counts, query sweeps explicitly.

  • For status breakdowns, scan once and report all states you see (finished,

failed, crashed, killed, etc.). When crashed/killed runs exist, report unsuccessful terminal rate (failed + crashed + killed) / total as the primary failure rate and include failed-only rate as a supporting number.

  • For tags, count runs with at least one tag and also list distinct tag names and

the runs attached to each tag.

  • For run groups, report named groups from groupedRuns(groupKeys: ["group"])

and compute ungrouped runs as total_runs - sum(named_group_counts).

  • For sweep-run tasks, list each sweep's run count and explicitly report the

total runs across all sweeps.

Count/list sweeps

Do not inspect the W&B SDK source for routine sweep questions. Use the public project API directly:

import os, wandb

entity = os.environ["WANDB_ENTITY"]
project = os.environ["WANDB_PROJECT"]
api = wandb.Api(timeout=120)

sweeps = list(api.project(project, entity=entity).sweeps(per_page=50))
rows = []
for sweep in sweeps:
    config = sweep.config or {}
    metric = config.get("metric") or {}
    rows.append({
        "id": sweep.id,
        "state": sweep.state,
        "method": config.get("method"),
        "metric": metric.get("name"),
        "goal": metric.get("goal"),
        "run_count": len(sweep.runs),
    })

print(f"sweep_count={len(rows)}")
print(f"total_sweep_runs={sum(r['run_count'] for r in rows)}")
for r in rows:
    print(r)

Finished runs with trigger/user

For prompts asking who triggered each run, fetch the filtered runs once and read run.user.username / run.user.name; do not search reference files.

import os, wandb

entity = os.environ["WANDB_ENTITY"]
project = os.environ["WANDB_PROJECT"]
path = f"{entity}/{project}"
api = wandb.Api(timeout=120)

runs = api.runs(
    path,
    filters={"state": "finished"},
    order="+created_at",
    per_page=100,
    include_sweeps=False,
)
rows = []
for run in runs:
    user = getattr(run, "user", None)
    rows.append({
        "created_at": run.created_at,
        "name": run.display_name or run.name,
        "id": run.id,
        "username": getattr(user, "username", None),
        "user_name": getattr(user, "name", None),
    })

print(f"finished_count={len(rows)}")
for r in rows:
    print(r)

Count traces (fast, server-side)

import weave, os, logging
logging.getLogger("weave").setLevel(logging.ERROR)
from weave.trace_server.trace_server_interface import CallsQueryStatsReq
from weave.trace_server.interface.query import Query

entity = os.environ["WANDB_ENTITY"]
project = os.environ["WANDB_PROJECT"]
client = weave.init(f"{entity}/{project}")
pid = f"{entity}/{project}"

# Total calls/traces
stats = client.server.calls_query_stats(CallsQueryStatsReq(project_id=pid))
print(f"Total calls: {stats.count}")

# Root traces only
root_stats = client.server.calls_query_stats(CallsQueryStatsReq(
    project_id=pid, filter={"trace_roots_only": True}
))
print(f"Root traces: {root_stats.count}")

# Count by op name
for op in ["Evaluation.evaluate", "my_op.turn"]:
    op_ref = f"weave:///{entity}/{project}/op/{op}:*"
    s = client.server.calls_query_stats(CallsQueryStatsReq(
        project_id=pid,
        filter={"op_names": [op_ref]},
    ))
    print(f"  {op}: {s.count}")

# Count calls whose op_name contains a substring, e.g. scorer calls.
score_query = Query(**{"$expr": {"$contains": {
    "input": {"$getField": "op_name"},
    "substr": {"$literal": ".score"},
    "case_insensitive": True,
}}})
score_stats = client.server.calls_query_stats(CallsQueryStatsReq(
    project_id=pid, query=score_query
))
print(f"Scorer calls (.score): {score_stats.count}")

# Count a named op substring such as create_embeddings.
embedding_query = Query(**{"$expr": {"$contains": {
    "input": {"$getField": "op_name"},
    "substr": {"$literal": "create_embeddings"},
    "case_insensitive": True,
}}})
embedding_stats = client.server.calls_query_stats(CallsQueryStatsReq(
    project_id=pid, query=embedding_query
))
print(f"create_embeddings calls: {embedding_stats.count}")

# Error/exception calls. Include descendant_error when the prompt says
# "error status or exception"; those are traces whose children failed.
error_query = Query(**{"$expr": {"$or": [
    {"$eq": [{"$getField": "summary.weave.status"}, {"$literal": "error"}]},
    {"$eq": [
        {"$getField": "summary.weave.status"},
        {"$literal": "descendant_error"},
    ]},
    {"$not": [{"$eq": [{"$getField": "exception"}, {"$literal": None}]}]},
]}})
error_stats = client.server.calls_query_stats(CallsQueryStatsReq(
    project_id=pid, query=error_query
))
root_error_stats = client.server.calls_query_stats(CallsQueryStatsReq(
    project_id=pid, filter={"trace_roots_only": True}, query=error_query
))
print(f"Error/exception calls: {error_stats.count}")
print(f"Root error/exception calls: {root_error_stats.count}")
print(f"Non-error calls: {stats.count - error_stats.count}")

Count create_embeddings calls and input sizes

import os, statistics, weave, logging, sys
from collections import Counter
logging.getLogger("weave").setLevel(logging.ERROR)
from weave.trace_server.trace_server_interface import CallsQueryStatsReq
from weave.trace_server.interface.query import Query
sys.path.insert(0, "skills/wandb-primary/scripts")
from weave_helpers import unwrap

entity = os.environ["WANDB_ENTITY"]
project = os.environ["WANDB_PROJECT"]
pid = f"{entity}/{project}"
client = weave.init(pid)

query = Query(**{"$expr": {"$contains": {
    "input": {"$getField": "op_name"},
    "substr": {"$literal": "create_embeddings"},
    "case_insensitive": True,
}}})
total = client.server.calls_query_stats(CallsQueryStatsReq(
    project_id=pid, query=query
)).count

sizes = []
for call in client.get_calls(query=query, limit=total, columns=["inputs"]):
    inputs = unwrap(call.inputs)
    texts = inputs.get("texts") or inputs.get("input") or []
    if isinstance(texts, str):
        sizes.append(1)
    else:
        sizes.append(len(texts))

dist = Counter(sizes)
print(f"create_embeddings calls: {total}")
print(f"typical texts per call: {dist.most_common(1)[0][0] if dist else 0}")
print(f"distribution: {dict(sorted(dist.items()))}")
print(f"mean texts per call: {statistics.mean(sizes) if sizes else 0:.4f}")

Count feedback records

import os, weave, logging
logging.getLogger("weave").setLevel(logging.ERROR)
from weave.trace_server.trace_server_interface import FeedbackQueryReq

entity = os.environ["WANDB_ENTITY"]
project = os.environ["WANDB_PROJECT"]
pid = f"{entity}/{project}"
client = weave.init(pid)

limit = 1000
offset = 0
total = 0
while True:
    res = client.server.feedback_query(FeedbackQueryReq(
        project_id=pid,
        fields=["id"],
        limit=limit,
        offset=offset,
    ))
    rows = (
        getattr(res, "result", None)

…

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [wandb](https://github.com/wandb)
- **Source:** [wandb/skills](https://github.com/wandb/skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.