agentleFS
jwuthri-cloudjwuthri-cloud/Tracely-ai/skills/tracely/SKILL.md

tracely

Skill1.2k starsChanged 20 days agoMITView on GitHub

Instrument AI agents with Tracely and turn their production traces into CI gates. Use when the user mentions Tracely, tracelyai-sdk, tracely_sdk, the `tracely` CLI, or asks to trace/observe an AI agent, add LLM evaluators or LLM-as-a-judge columns, debug why a trace or conversation isn't showing up, wire agent regression tests into a PR check, run scenario or red-team suites against an agent endpoint, or replay recorded agent failures in CI. Covers both zero-span-code automatic instrumentation and the manual span API.

  • Installs packages

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not start writing spans.

    line 20
  2. Distinctive:

    When the auto path can't express it.

    line 114
  3. Very specific:

    All exit 0 PASS / 1 FAIL / 2 never-got-an-answer, and post a GitHub commit status + PR comment.

    line 161
  4. Very specific:

    Every backend serves MCP at /mcp — read traces, inspect clusters, create evaluators, no glue code.

    line 167
  5. Very specific:

    Run the agent, then tracely.flush().

    line 180
  6. Very specific:

    Check the tree is a tree, not a flat list — if every span is a root, trace() isn't wrapping the call or the framework escaped the context.

    line 182
  7. Distinctive:

    Check the conversation groups its turns.

    line 184
  8. Distinctive:

    Check a deliberately-broken run shows red.

    line 185
  9. Very specific:

    No trace at all, spans not nesting, conversations not grouping, evaluators not running, gate suspiciously green: …

    line 187

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Tracely

Trace-native CI/CD for AI agents. One loop:

production trace → failure detection → regression test → CI gate

The trace is the source of truth. Evaluators, failure clusters, regression cases, gates and trends are all derived from it — there are no hand-authored datasets. Docs: https://doc.tracely-ai.com.

Pick the path first

Do not start writing spans. Ask what the code already looks like, then pick:

The user's codePathEffort
Calls OpenAI / Anthropic / Gemini / Mistral / Bedrock / Groq SDKsAutomatic — init(instrument="auto")1 line
Uses LangChain / LangGraph / LlamaIndex / CrewAI / LiteLLMAutomatic + that extra1 line
Uses OpenAI Agents SDK / Claude Agent SDK / Google ADKAutomatic, named explicitly1 line
Has business logic worth seeing (routers, tools, retrievers)Automatic + @observe1 decorator each
Needs spans the auto path can't produce (custom retrievers, guardrails, handoffs, multimodal I/O, hand-rolled providers)Manual context managersreferences/manual.md
Is TypeScript / Go / Ruby / anything not PythonEmit OTLP directly — no SDKreferences/automatic.md § other languages
Already emits OpenTelemetry / OpenInference / OpenLLMetryPoint the existing exporter at Tracely, add 2 attributesreferences/automatic.md § other languages

Default to automatic. Manual spans are the escape hatch, not the starting point, and the two compose — manual spans nest inside auto-instrumented traces in the same tree.

Connect

import tracely_sdk as tracely   # pip install "tracelyai-sdk[openai]"  ([anthropic] [langchain] [all])

tracely.init(
    endpoint="http://localhost:8000",   # hosted: https://api.tracely-ai.com
    api_key="tracely_dev_key",          # an ingest key — Settings → API keys. The key IS the workspace.
    service_name="support-agent",
    env="prod",                         # prod | staging | ci | dev — the gating axis
    instrument="auto",
)

Python ≥ 3.10. Import name is tracely_sdk; the CLI is tracely. init() is idempotent — call it once at startup. Prefer os.environ for endpoint/api_key in real code; never inline a key.

The 90% path

with tracely.trace(agent="support-agent", conversation="conv-1", user="u_42"):
    client.chat.completions.create(model="gpt-4o", messages=[...])   # traced, no span code

trace() opens no span — it stamps run context (agent, conversation, turn, user, env, arbitrary metadata) onto every span inside it, including the ones the instrumentor created. It also works as a decorator on sync or async functions.

Six rules that decide whether Tracely actually works

Getting these wrong doesn't error — it silently produces a useless workspace. Check them in every review of someone's instrumentation.

  1. The agent name is declared, never inferred. It's the dimension gates, clusters, scenarios and trends group by, and Tracely reads exactly one attribute for it: tracely.agent.id — set by init(service_name=…), overridden by init(agent=…) for the app or trace(agent=…)/agent(...) per run. A framework's own gen_ai.agent.name is deliberately ignored: a harness stamps one on every sub-agent it spins up, which would register dozens of agents nobody chose. Name neither and every trace in the workspace lands under a single default agent. One codebase serving many customers → trace(tenant=customer_id): each tenant is its own Agent (endpoint, scenarios, gate, clusters, cases; the traces list filters by it) and agent= stays the per-span label.
  2. conversation= is what makes a conversation. Each turn is its own trace; passing the same conversation id to every turn is the only thing that threads them. Without it, a 12-turn support thread is 12 unrelated rows, and every conversation-level evaluator has nothing to grade.
  3. env is the gating axis. prod failures become regression cases; ci traces are what the gate grades. Tagging CI runs as prod poisons the case pool with test data.
  4. Errors are the failure signal. A failed tool must be marked — tracely.error(span, msg), an exception inside @observe, or an OTel ERROR status. Detection, clustering and the gate all key off it. A tool that returns {"error": "..."} as a successful span is invisible.
  5. flush() before the process exits. Scripts, Lambdas, CLI runs and tests lose their last spans otherwise. Long-lived servers don't need it.
  6. If Tracely calls your agent, honour the traceparent header. Scenarios and simulate mint the trace id and send it. Ignore it and the gate sees only text in / text out — blind to your tool calls, so tool expectations report SKIP instead of grading. See references/ci-gate.md.

Two more that bite on specific stacks:

  • Streaming OpenAI calls need stream_options={"include_usage": True} or token counts (and therefore cost) are lost.
  • LangChain + a provider instrumentor double-traces. Under "auto" LangChain wins and the provider instrumentors are skipped; pass an explicit list only if you also make direct provider calls.

Your own spans — @observe

The cheapest way to see business logic. Args → input, return → output, exceptions → level=ERROR, auto-nested via OTel context with no parent wiring.

@tracely.observe(as_type="tool")
def get_weather(city: str) -> dict:
    return {"city": city, "tempF": 64}

as_type ∈ agent · delegate · generation · tool · skill · chain · retriever · thinking · embedding · guardrail · span. Decorating tools also makes them hermetically replayable in CI for free.

Manual spans

When the auto path can't express it. Every helper is a context manager; nesting builds the tree.

with tracely.agent("support-agent", version="v4", conversation="conv-1", turn=0) as a:
    tracely.set_io(a, input=user_msg, output=answer)
    with tracely.tool("get_order", agent="support-agent") as t:
        try:
            tracely.set_io(t, input={"order_id": oid}, output=get_order(oid))
        except Exception as e:
            tracely.error(t, str(e))

Two types are worth naming even on an otherwise-automatic agent, because they're the shape a multi-agent system fails in:

  • skill(name, version=…) → SKILL, a named capability the agent chose to run (a refund flow, an escalation playbook, a loaded agent-skill file). Makes "which skill did this?" a filter and a failure cluster instead of a tree shape you have to infer.
  • delegate(to, agent=…, task=…) → DELEGATE, the handover itself. Open the callee's agent(...) inside it and a judge can grade the routing decision separately from the work.

Full cookbook — every span type, set_io / set_usage / set_metadata / set_state / set_agents, RAG pipelines, multi-agent handoffs, multimodal content, structured I/O rendering: references/manual.md.

Evaluators are columns

An evaluator is a column on the trace table, graded automatically as traces land. Two kinds: structural (deterministic, no model, no cost) and llm_judge (a rubric prompt).

A trace fails iff a non-advisory evaluator scored it FAIL. Mark subjective quality judges advisory: true so they show their verdict without flipping the roll-up.

Reach for structural checks before a judge — run_outcome, tool_success, tool_consistency, latency, required_tools cost nothing and never flake. Levels, sequential grading, @VARIABLE advanced templates, targeting and sampling: references/evaluators.md.

Gate the PR

Three ways, by what CI can reach:

SituationCommandNeeds
Agent is a deployed HTTP endpoint (any language)tracely simulate --allEndpoint registered + a scenario
CI already runs the agent and emits env=ci tracestracely gate <agent>Nothing extra
Want deterministic, offline, $0 replay of real failurestracely replay <agent> --entrypoint mod:fnPython agent + @observe tools or the call_tool/call_llm seam

All exit 0 PASS / 1 FAIL / 2 never-got-an-answer, and post a GitHub commit status + PR comment. A composite action ships at .github/actions/tracely-gate/. Details, scenario authoring, red-team runs and hermetic replay: references/ci-gate.md.

Drive it from the editor (MCP)

Every backend serves MCP at /mcp — read traces, inspect clusters, create evaluators, no glue code.

claude mcp add --transport http tracely https://api.tracely-ai.com/mcp \
  --header "Authorization: Bearer $TRACELY_KEY"

Then ask: "look at the last 20 traces, find what's failing, and add an evaluation column that catches it." The key scopes every call to its workspace. Nothing deletes; there is no tool for sending traces — that's the SDK's job.

Verify before claiming it works

  1. Run the agent, then tracely.flush().
  2. Open the UI → Traces. The run appears within a few seconds (evaluation is debounced ~4s).
  3. Check the tree is a tree, not a flat list — if every span is a root, trace() isn't wrapping the call or the framework escaped the context.
  4. Check the conversation groups its turns.
  5. Check a deliberately-broken run shows red.

No trace at all, spans not nesting, conversations not grouping, evaluators not running, gate suspiciously green: references/troubleshooting.md — symptom → cause → fix.

References

FileRead it when
references/automatic.mdZero-span-code setup: extras, instrument=, trace(), @observe, drop-ins, LangChain/LangGraph/LiteLLM/CrewAI, agent SDKs, redaction, threads, and non-Python / raw-OTLP integration.
references/manual.mdThe full manual span API and how to model a real agent with it.
references/evaluators.mdDesigning evaluation columns, judge prompts, @VARIABLE templates, verdict policy, cost control.
references/ci-gate.mdScenarios, adversarial suites, hermetic replay, the CLI, GitHub Actions.
references/troubleshooting.mdSomething isn't showing up or the gate is lying.

Self-hosting (docker compose up -d --build --wait → UI :3001, API :8000, dev key tracely_dev_key) and Railway one-click: https://doc.tracely-ai.com/self-hosting.

Download now (ZIP)

Trending

More talk lately.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the jwuthri-cloud/Tracely-ai repository that our weekly crawl found: only 1 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about jwuthri-cloud/Tracely-ai

The biggest 1 of 1 mention linking to the repository that our crawl found. Each line is their own headline.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.