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
- Distinctive: line 20
Do not start writing spans.
- Distinctive: line 114
When the auto path can't express it.
- Very specific: line 161
All exit 0 PASS / 1 FAIL / 2 never-got-an-answer, and post a GitHub commit status + PR comment.
- Very specific: line 167
Every backend serves MCP at /mcp — read traces, inspect clusters, create evaluators, no glue code.
- Very specific: line 180
Run the agent, then tracely.flush().
- Very specific: line 182
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.
- Distinctive: line 184
Check the conversation groups its turns.
- Distinctive: line 185
Check a deliberately-broken run shows red.
- Very specific: line 187
No trace at all, spans not nesting, conversations not grouping, evaluators not running, gate suspiciously green: …
≈ “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.
Files
Tracely
Trace-native CI/CD for AI agents. One loop:
production trace → failure detection → regression test → CI gateThe 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 code | Path | Effort |
| Calls OpenAI / Anthropic / Gemini / Mistral / Bedrock / Groq SDKs | Automatic — init(instrument="auto") | 1 line |
| Uses LangChain / LangGraph / LlamaIndex / CrewAI / LiteLLM | Automatic + that extra | 1 line |
| Uses OpenAI Agents SDK / Claude Agent SDK / Google ADK | Automatic, named explicitly | 1 line |
| Has business logic worth seeing (routers, tools, retrievers) | Automatic + @observe | 1 decorator each |
| Needs spans the auto path can't produce (custom retrievers, guardrails, handoffs, multimodal I/O, hand-rolled providers) | Manual context managers | references/manual.md |
| Is TypeScript / Go / Ruby / anything not Python | Emit OTLP directly — no SDK | references/automatic.md § other languages |
| Already emits OpenTelemetry / OpenInference / OpenLLMetry | Point the existing exporter at Tracely, add 2 attributes | references/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 codetrace() 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.
- 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 byinit(service_name=…), overridden byinit(agent=…)for the app ortrace(agent=…)/agent(...)per run. A framework's owngen_ai.agent.nameis 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 singledefaultagent. 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) andagent=stays the per-span label. 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.envis the gating axis.prodfailures become regression cases;citraces are what the gate grades. Tagging CI runs asprodpoisons the case pool with test data.- Errors are the failure signal. A failed tool must be marked —
tracely.error(span, msg), an exception inside@observe, or an OTelERRORstatus. Detection, clustering and the gate all key off it. A tool that returns{"error": "..."}as a successful span is invisible. flush()before the process exits. Scripts, Lambdas, CLI runs and tests lose their last spans otherwise. Long-lived servers don't need it.- If Tracely calls your agent, honour the
traceparentheader. Scenarios andsimulatemint 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 reportSKIPinstead of grading. Seereferences/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'sagent(...)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:
| Situation | Command | Needs |
| Agent is a deployed HTTP endpoint (any language) | tracely simulate --all | Endpoint registered + a scenario |
CI already runs the agent and emits env=ci traces | tracely gate <agent> | Nothing extra |
| Want deterministic, offline, $0 replay of real failures | tracely replay <agent> --entrypoint mod:fn | Python 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
- Run the agent, then
tracely.flush(). - Open the UI → Traces. The run appears within a few seconds (evaluation is debounced ~4s).
- 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. - Check the conversation groups its turns.
- 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
| File | Read it when |
references/automatic.md | Zero-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.md | The full manual span API and how to model a real agent with it. |
references/evaluators.md | Designing evaluation columns, judge prompts, @VARIABLE templates, verdict policy, cost control. |
references/ci-gate.md | Scenarios, adversarial suites, hermetic replay, the CLI, GitHub Actions. |
references/troubleshooting.md | Something 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.
Trending
More talk lately.thin dataabout the whole repository
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.
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- Jwuthri/Tracely-ai★ 1.5k99% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository43 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- canvas-generativeSkill
- castSkill
- compose-graphicsSkill
- compose-motionSkill
- compose-multiplatformSkill
- css-nativeSkill
- design-auditSkill
- desktop-principlesSkill
- framer-motionSkill
- gsap-coreSkill
- gsap-frameworksSkill
- gsap-performanceSkill
- gsap-pluginsSkill
- gsap-reactSkill
- gsap-scrolltriggerSkill
- gsapSkill
- gsap-timelineSkill
- gsap-utilsSkill
- mobile-principlesSkill
- motion-designSkill
- motion-principlesSkill
- paintSkill
- swiftui-graphicsSkill
- swiftui-motionSkill
- threejs-r3fSkill
- ui-ux-pro-maxSkill
- ai-observability-langchain-pythonSkill
- competitive-landscapeSkill
- competitor-analysisSkill
- deslopSkill
- keyword-clusteringSkill
- keyword-researchSkill
- link-prospectingSkill
- maintain-greptile-rulesSkill
- merge-readySkill
- openseo-release-notesSkill
- openseo-review-web-contentSkill
- papercutsSkill
- seo-auditSkill
- seo-coachSkill
- seo-project-setupSkill
- simple-issue-descriptionSkill
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.

