agentleFS
raindrop-airaindrop-ai/workshop/skills/instrument-agent/SKILL.md

instrument-agent

Skill1.1k starsChanged 18 days agoMITView on GitHub

Set up Raindrop AI traces for an agent and verify they flow into Workshop. Use when the user says "set up traces", "add tracing", "instrument my agent", "wire Raindrop", "Workshop is empty", or "make traces show up in Workshop." Guides unknown repos by discovering runtime and telemetry setup, using current Raindrop docs/package types, making the smallest safe change, and proving one useful Workshop run. Not for repos that already have working Raindrop instrumentation — use for initial setup or when Workshop shows no data.

  • Reads credentials

1 other project uses a version of this.

Trending

Quiet since September.thin dataabout the whole repository

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

Most recently taken up by

Who's talking about raindrop-ai/workshop

The biggest 5 of 7 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 7

Talked about on GitHub, Hacker News and Bluesky (7 times).

On GitHub · 4

On Hacker News · 2

On Bluesky · 1

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. telerik/observability-skills★ 1same name

    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 repository2 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

43 rules. About 0 are common, 23 are distinctive, and 20 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈23

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 20

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use supported Raindrop SDK/integration paths.

    line 14
  2. Very specific:

    Use this skill for the workflow and Workshop-specific judgment.

    line 26
  3. Distinctive:

    Before editing any file, tell the user about the intended change, and give them an honest assessment for how risky it might be.

    line 32
  4. Distinctive:

    Prefer installed package docs/types over memory.

    line 37
  5. Distinctive:

    Do a quick read-only pass:

    line 58
  6. Very specific:

    Search for existing telemetry: opentelemetry, NodeSDK, TracerProvider, Sentry.init, Datadog, Honeycomb, Traceloop, LangSmith, RAINDROP_*.

    line 65
  7. Very specific:

    Check whether Workshop is running: curl -fsS http://localhost:5899/health.

    line 66
  8. Distinctive:

    Ask only when the next edit would otherwise be a guess.

    line 70
  9. Very specific:

    Add minimal instrumentation to one real entry point: wrapper call metadata, or begin before the invocation and finish after final …

    line 84
  10. Distinctive:

    Run one representative invocation.

    line 85
  11. Very specific:

    Verify a run appears in Workshop with enough input/output to prove the right code path is connected.

    line 86
  12. Very specific:

    If Workshop is empty, confirm the command exercised the instrumented entry point.

    line 90
  13. Very specific:

    If the app ran but no run appears, confirm the app process received the local Workshop env/config.

    line 91
  14. Distinctive:

    If using a wrapper SDK, confirm the invoked code calls the wrapped client, not the original import.

    line 92
  15. Very specific:

    If using begin/finish, confirm both run in the invoked path and flush/close happens before short-lived processes exit.

    line 93
  16. Distinctive:

    If existing telemetry is present, confirm you did not create a second competing provider.

    line 94
  17. Very specific:

    If Workshop is not reachable, stop and say Workshop is down.

    line 95
  18. Distinctive:

    If these checks do not reveal the problem, stop and report the exact evidence instead of adding more instrumentation.

    line 96
  19. Very specific:

    Add useful properties: tenant/org/workspace, request/job/session/conversation IDs, route/source/surface.

    line 104
  20. Distinctive:

    Ensure the LLM call is visible as an LLM span or obvious interaction summary.

    line 105
  21. Distinctive:

    Ensure real tool executions are visible as tool spans/events.

    line 106
  22. Distinctive:

    Add streaming/live events only when the SDK supports them and they help debugging.

    line 108
  23. Distinctive:

    Always consult docs first, then use the notes below to decide.

    line 119
  24. Distinctive:

    Use for custom TypeScript/Node agents and direct provider SDK calls.

    line 127
  25. Very specific:

    Use @raindrop-ai/ai-sdk. This integration is designed to avoid manual OpenTelemetry setup.

    line 161
  26. Distinctive:

    Verify the invoked code calls the wrapped functions/client.

    line 173
  27. Distinctive:

    Do not choose native telemetry unless installed docs/types and AI SDK version support it.

    line 174
  28. Very specific:

    Use @raindrop-ai/claude-agent-sdk.

    line 180
  29. Very specific:

    Use raindrop-ai. For Phase 1, prefer raindrop.begin(...) before the custom loop and interaction.finish(...) after final output/error.

    line 188
  30. Very specific:

    Check Python and raindrop-ai versions first, then update raindrop-ai to the latest available version before editing instrumentation.

    line 192
  31. Very specific:

    Do not use track_ai as a Workshop Phase 1 path.

    line 193
  32. Distinctive:

    If the Python app already has a complex OTEL/Sentry setup, do not modify it unless you can follow a supported Raindrop SDK path.

    line 197
  33. Very specific:

    Use the Rust raindrop-ai crate and the installed crate docs/API.

    line 203
  34. Very specific:

    Use the raindrop-swift package (product Raindrop) with Swift Package Manager: .package(url: …

    line 215
  35. Distinctive:

    Don't invent per-call wrapper APIs: Swift has no auto-instrumentation of OpenAI/Anthropic clients.

    line 257
  36. Distinctive:

    If no supported integration fits, stop gracefully:

    line 265
  37. Distinctive:

    If the app already owns telemetry:

    line 273
  38. Very specific:

    Do not create a second NodeSDK, tracer provider, or equivalent global provider.

    line 276
  39. Distinctive:

    Look for a Raindrop-supported "external OpenTelemetry" shape in the installed package docs/types.

    line 277
  40. Very specific:

    After the smallest integration, run the agent once and verify Workshop before tuning modules/instrumentations.

    line 279
  41. Distinctive:

    If you cannot identify the telemetry owner, ask for that file or stop with a handoff to docs/team.

    line 281
  42. Distinctive:

    Use the strongest available check:

    line 285
  43. Distinctive:

    If a run exists but content is not useful, verification failed.

    line 296

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

You are helping instrument an AI agent so its next meaningful run appears in Raindrop Workshop. Workshop is the local viewer; it does not run the agent. The user's agent app runs the workflow, the Raindrop SDK captures model/tool boundaries and context, and Workshop renders that telemetry as a debuggable run.

Use supported Raindrop SDK/integration paths. Do not hand-wire Workshop ingestion endpoints or invent SDK APIs. If the repo's telemetry setup is too custom to instrument safely, stop with a clear handoff to the Raindrop docs or team.

Use Docs First

Raindrop SDK and integration APIs move quickly. Before writing code, fetch docs in parallel: the docs index, the likely stack-specific page, and installed package README/types when available.

  • Docs index: https://raindrop.ai/docs/llms.txt
  • Introduction: https://raindrop.ai/docs/introduction
  • Integration overview: https://raindrop.ai/docs/integrations/overview
  • Core SDKs: https://raindrop.ai/docs/sdk/typescript, /sdk/python, /sdk/rust, /sdk/swift, /sdk/go, /sdk/http-api, /sdk/browser
  • Framework integrations: https://raindrop.ai/docs/integrations/<name> such as vercel-ai-sdk, claude-agent-sdk, langchain, openai-agents, pydantic-ai, google-adk, bedrock, azure-openai, vertex-ai

Use this skill for the workflow and Workshop-specific judgment. Use the docs and installed package README/types for exact install commands, imports, options, and signatures.

Core Rules

  • Give visible progress. Say what phase you are in, what you learned, and what you are about to edit. Do not silently research for minutes.
  • Report often but briefly: one or two sentences per update, focused on current phase, finding, and next step. Avoid long dumps unless you are blocked and need a decision.
  • Before editing any file, tell the user about the intended change, and give them an honest assessment for how risky it might be.
  • Instrument one real agent entry point first. If several are plausible, ask which one should appear in Workshop.
  • First get a minimal useful run into Workshop, then enrich it. Do not trace every helper/tool/sub-agent before Phase 1 works.
  • Respect existing telemetry ownership. If the repo already initializes OpenTelemetry, Sentry, Datadog, Honeycomb, Traceloop, LangSmith, or another provider, do not create a competing provider.
  • Updating the matching Raindrop SDK/integration to the latest available version is mandatory before instrumentation edits. Do not proceed on an older installed SDK just because it is already present.
  • Prefer installed package docs/types over memory. If an API is not present in the installed package, do not use it.
  • Verification is required. Success means Workshop shows a useful run, not just that dependencies installed.

Mental Model

One useful Workshop run should show:

  • the user/job input that triggered the agent,
  • the final output or error,
  • the main LLM call,
  • real tool executions and their results,
  • enough properties to recognize the customer/session/job being debugged.

Most integrations use one of three shapes:

  • Interaction boundary: begin when one invocation starts, run the model/tool loop, then finish with output or error. Use this for Python, Rust, Swift, TypeScript core SDK, and custom loops.
  • SDK wrapper: wrap the agent/model SDK once and pass per-call metadata. Use this for Vercel AI SDK, Claude Agent SDK, and similar integrations.
  • Existing OpenTelemetry owner: attach Raindrop through the existing telemetry setup if supported. Do not create a second global tracer/provider.

Phase 0: Orient

Do a quick read-only pass:

  • Find the target agent entry point: route, worker, CLI, queue job, MCP server, or agent class.
  • Identify language/runtime and model/agent SDK: Python, Rust, Swift, TypeScript, Vercel AI SDK, Claude Agent SDK, OpenAI/Anthropic direct SDK, LangChain, etc.
  • For Python, record python --version, package version, and the actual raindrop.analytics surface before assuming current docs apply.
  • Identify where tools actually execute.
  • Identify package manager and env file convention.
  • Search for existing telemetry: opentelemetry, NodeSDK, TracerProvider, Sentry.init, Datadog, Honeycomb, Traceloop, LangSmith, RAINDROP_*.
  • Check whether Workshop is running: curl -fsS http://localhost:5899/health.

Timebox this phase. If discovery is not converging quickly, report what you know and ask the smallest concrete question.

Ask only when the next edit would otherwise be a guess. Keep it concrete:

  • "I found apps/api/src/chat.ts and workers/agent.ts. Which should appear in Workshop first?"
  • "I found src/sentry.ts and src/otel.ts. Which telemetry initializer runs in this agent process?"
  • "What command runs one representative agent invocation locally?"

Phase 1: Basic Run Visibility

Goal: prove the local trace path works with the smallest top-level instrumentation. A successful Phase 1 may show only a basic interaction summary in Workshop; it does not need complete LLM/tool span coverage.

Make the smallest change:

  • Install or update the matching Raindrop SDK/integration to the latest available version using the repo's package manager, then inspect the installed README/types before coding.
  • Point the app at local Workshop, usually with RAINDROP_LOCAL_DEBUGGER=http://localhost:5899/v1/.
  • Add minimal instrumentation to one real entry point: wrapper call metadata, or begin before the invocation and finish after final output/error.
  • Run one representative invocation.
  • Verify a run appears in Workshop with enough input/output to prove the right code path is connected.

Phase 1 troubleshooting:

  • If Workshop is empty, confirm the command exercised the instrumented entry point.
  • If the app ran but no run appears, confirm the app process received the local Workshop env/config.
  • If using a wrapper SDK, confirm the invoked code calls the wrapped client, not the original import.
  • If using begin/finish, confirm both run in the invoked path and flush/close happens before short-lived processes exit.
  • If existing telemetry is present, confirm you did not create a second competing provider.
  • If Workshop is not reachable, stop and say Workshop is down. Do not say "wired" or point the user at the Workshop URL as if verification succeeded.
  • If these checks do not reveal the problem, stop and report the exact evidence instead of adding more instrumentation.

Phase 2: Enrichment

Goal: turn the Phase 1 run into a useful debugging trace.

After Phase 1 works:

  • Add useful properties: tenant/org/workspace, request/job/session/conversation IDs, route/source/surface. Do not invent placeholders.
  • Ensure the LLM call is visible as an LLM span or obvious interaction summary.
  • Ensure real tool executions are visible as tool spans/events.
  • Preserve existing telemetry setup.
  • Add streaming/live events only when the SDK supports them and they help debugging.

Phase 2 troubleshooting:

  • Thin Overview: fix interaction input/output and useful properties.
  • Missing LLM call: confirm the model call uses the wrapper or a supported span helper.
  • Missing tools: wrap the real tool body, not the model's tool-call decision.
  • Duplicate tools: check for both framework auto-instrumentation and manual wrapping on the same operation.

Choosing The Path

Always consult docs first, then use the notes below to decide.

TypeScript Core SDK

Docs: https://raindrop.ai/docs/sdk/typescript

Hard version gate: require the latest available raindrop-ai package for TypeScript/JavaScript core SDK instrumentation, and never lower than 0.0.90. If the repo has an older installed package, update first or stop and report the version mismatch.

Use for custom TypeScript/Node agents and direct provider SDK calls. The core shape is:

const raindrop = new Raindrop({
  writeKey: process.env.RAINDROP_WRITE_KEY,
  endpoint: process.env.RAINDROP_ENDPOINT ?? process.env.RAINDROP_LOCAL_DEBUGGER,
});

const interaction = raindrop.begin({
  eventId,
  event: "agent_name",
  userId,
  input,
  convoId,
  properties,
});

try {
  const output = await runAgentLoop();
  interaction.finish({ output, model });
} catch (err) {
  interaction.finish({ output: `Error: ${err instanceof Error ? err.message : String(err)}` });
  throw err;
} finally {
  await raindrop.flush();
}

In Phase 2, use the current docs/package types for manual span/tool helpers and only wrap real execution boundaries.

Vercel AI SDK

Docs: https://raindrop.ai/docs/integrations/vercel-ai-sdk

Use @raindrop-ai/ai-sdk. This integration is designed to avoid manual OpenTelemetry setup. The docs cover:

  • raindrop.wrap(ai, ...),
  • eventMetadata(...),
  • AI SDK version differences,
  • native telemetry for AI SDK v7+,
  • tool call tracing,
  • flush/shutdown and debugging.

Gotchas to keep inline:

  • eventMetadata(...) is call metadata, not a side effect.
  • Verify the invoked code calls the wrapped functions/client.
  • Do not choose native telemetry unless installed docs/types and AI SDK version support it.

Claude Agent SDK

Docs: https://raindrop.ai/docs/integrations/claude-agent-sdk

Use @raindrop-ai/claude-agent-sdk. The docs cover wrapping the Claude Agent SDK, passing eventMetadata() to tracked query() calls, auto tool tracing, subagent hierarchy, flush/shutdown, and debugging.

Gotcha: calls without eventMetadata() may run normally but not be tracked by Raindrop, depending on the installed package behavior.

Python

Docs: https://raindrop.ai/docs/sdk/python

Use raindrop-ai. For Phase 1, prefer raindrop.begin(...) before the custom loop and interaction.finish(...) after final output/error. This proves Workshop connectivity without needing perfect tool spans.

For Python custom loops:

  • Check Python and raindrop-ai versions first, then update raindrop-ai to the latest available version before editing instrumentation.
  • Do not use track_ai as a Workshop Phase 1 path. If the installed package only exposes track_ai, stop and report that this package version cannot produce a visible Workshop run with the current local ingestion behavior.
  • Phase 1: wrap the whole model/tool loop with begin/finish.
  • Phase 2: preserve loop behavior and add instrumentation at real boundaries: provider call and tool function execution.
  • Python tool/span helpers, decorators, manual spans, and auto-instrumentation may require tracing to remain enabled. Verify useful Workshop spans before promising tool-level coverage.
  • If the Python app already has a complex OTEL/Sentry setup, do not modify it unless you can follow a supported Raindrop SDK path.

Rust

Docs: https://raindrop.ai/docs/sdk/rust

Use the Rust raindrop-ai crate and the installed crate docs/API. The docs describe Client::begin, Interaction::finish, Client::flush/close, track_ai, manual spans, and tool spans.

Keep guidance short:

  • Phase 1: wrap the whole async agent loop with begin/finish, then flush or close.
  • Phase 2: use documented Rust span/tool helpers only after the top-level run lands.
  • The Rust SDK is beta. Pin the crate/tag as the docs recommend and trust installed crate APIs.

Swift

Docs: https://raindrop.ai/docs/sdk/swift

Use the raindrop-swift package (product Raindrop) with Swift Package Manager: .package(url: "https://github.com/raindrop-ai/raindrop-swift", from: "<latest tag>"). Find the latest tag with git ls-remote --tags https://github.com/raindrop-ai/raindrop-swift, and read the resolved package's README.md and public API in .build/checkouts/raindrop-swift (or Xcode's package cache) before coding.

If the docs page isn't available (for example it returns 404), use the resolved package's README.md and public API instead. If git ls-remote can't reach the repository or SwiftPM can't resolve the package, the Swift SDK isn't available to this user yet: stop and report that. Don't vendor or copy SDK source, hand-write an HTTP client, or lower the version gate to get past it.

Hard version gate: require the latest available tag and never lower than 0.0.7 (current span nesting, inlineSubagent and scoped helpers usable from @MainActor, span-content PII redaction, storageProtection). The SDK is beta; pin the version.

First decide where the code runs, because Workshop setup differs:

  • Server, CLI or macOS tool: RAINDROP_LOCAL_DEBUGGER=http://localhost:5899/v1/ in the process environment works as for other SDKs.
  • iOS, tvOS, watchOS or visionOS app: apps have no process environment. Set config.localWorkshopURL in code, behind #if DEBUG. The simulator reaches the Mac at localhost; a physical device needs the Mac's LAN address and NSAllowsLocalNetworking in App Transport Security. Never ship a Workshop URL in release builds.

With a Workshop URL and no write key, the client sends to Workshop only, which is the safest Phase 1 setup.

Phase 1: one client for the process or app lifetime (not one per request), and a begin/finish boundary around one invocation:

import Raindrop

var config = RaindropConfiguration(writeKey: writeKeyFromAppConfig)   // nil/empty: Workshop-only or no-op
#if DEBUG
config.localWorkshopURL = URL(string: "http://localhost:5899")         // apps; servers can use RAINDROP_LOCAL_DEBUGGER
#endif
let raindrop = RaindropClient(configuration: config)

let interaction = raindrop.begin(BeginOptions(userId: userId, event: "agent_name", input: input,
                                              convoId: convoId, properties: properties))
do {
  let output = try await runAgentLoop(input)
  await interaction.finish(output: output)          // sends; returns within ~10 s
} catch {
  await interaction.fail(error)                     // records the error and finishes the event
  throw error
}

Swift gotchas:

  • trackAi, begin and span calls only queue and never throw; finish, flush and close are async and bounded. Short-lived processes (CLI, serverless handler, test) must await raindrop.close() before exiting. Apps don't need to: the SDK flushes when the app goes to the background and resends saved payloads on the next launch.
  • Phase 2: open a scope with interaction.withSpan("agent.run") { _ in ... } and record model calls with interaction.startLlmSpan(...) (setOutput, setUsage, end) and tools with interaction.withTool(name, input:) { ... } around the real tool body. Spans started inside a scope nest automatically (task-local current span); don't add parent: unless the docs call for it.
  • The current span does not flow into Task.detached (it does into Task {} and async let). Work moved to a detached task shows up unnested; pass parent: .span(...) there, or keep the work in a structured task.
  • Subagents: if the caller waits for the subagent within the same turn, use interaction.inlineSubagent(name, input:) { ... } (one event; the subagent's spans nest under it). Use subagent(name:) + raindrop.beginSubagent(handoff) only when the subagent runs on its own (background task or another process) and should be its own event.
  • If the app handles personal data, set config.redactPii = true (event input/output and span content) and keep it on for Workshop runs too. If the organization requires data to be unreadable while the device is locked (common for managed devices), set config.storageProtection = .complete; don't change it otherwise.
  • Don't invent per-call wrapper APIs: Swift has no auto-instrumentation of OpenAI/Anthropic clients. Instrument the app's own loop.

Other Framework Integrations

Docs index: https://raindrop.ai/docs/llms.txt

For LangChain, OpenAI Agents SDK, Pydantic AI, Google ADK, Bedrock, Azure OpenAI, Vertex AI, CrewAI, Strands, and similar frameworks, prefer the matching integration docs over inventing generic wrappers.

If no supported integration fits, stop gracefully:

I could not find a safe Raindrop SDK/integration path for this setup. Please consult the Raindrop docs or reach out to the Raindrop team with the agent entry point and telemetry setup files.

Existing OpenTelemetry / Sentry / Datadog

This is the main case where the skill should add value beyond docs.

If the app already owns telemetry:

  • Find the initializer that actually runs in the agent process.
  • Do not create a second NodeSDK, tracer provider, or equivalent global provider.
  • Look for a Raindrop-supported "external OpenTelemetry" shape in the installed package docs/types.
  • Some setups need only a Raindrop span processor. Others also need Raindrop instrumentations. Do not invent instrumentModules; use only what installed docs/types require.
  • After the smallest integration, run the agent once and verify Workshop before tuning modules/instrumentations.

If you cannot identify the telemetry owner, ask for that file or stop with a handoff to docs/team.

Verification

Use the strongest available check:

  • Raindrop MCP when available: inspect the current/latest run, outline, or trace query results.
  • HTTP/local API only if supported by the current Workshop docs or installed tooling.
  • UI: a visible run in Workshop.

Confirm the run is useful:

  • Phase 1 success: one real invocation appears with input/output or a clear interaction summary.
  • Phase 2 success: expected LLM/tool activity is visible in Overview or span tree.

If a run exists but content is not useful, verification failed. Keep diagnosing or stop with exact evidence.

Handoff

Verified:

Wired. I ran the agent once and confirmed a useful Workshop run at http://localhost:5899.

Needs user run:

Wired. Workshop is running at http://localhost:5899. Run <command> now; the next run should appear in Workshop. If it stays empty, we can debug further!

Blocked:

I stopped before guessing. <specific ambiguity/failure>. The next step is <specific user choice or docs/team handoff if nothing truly works (try your hardest before doing this. For Team handoff, report diagnostics, code skeleton without revealing too much about user's proprietary code)>.

Download now (ZIP)

Does it work?

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

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.