agentleFS
open-telemetryopen-telemetry/semantic-conventions-genai/.github/skills/reference/SKILL.md

reference

Skill528 starsChanged 41 days agoApache-2.0View on GitHub

Use when implementing or evaluating reference coverage for a semantic-conventions changeset involving GenAI spans, attributes, entities, metrics, or events across Python libraries.

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    Use this skill to add or update reference implementations under reference/scenarios/<library>/ when conventions change.

    line 8
  2. Very specific:

    Find libraries: Check which scenarios under reference/scenarios/ support the changed operation(s).

    line 12
  3. Distinctive:

    If the library cannot provide a value, do not fake it, leave it unset.

    line 16
  4. Very specific:

    Update reference/scenarios/<library>/README.md operation table and status.

    line 17
  5. Distinctive:

    When adding or updating a reference scenario, update its README.md:

    line 34
  6. Distinctive:

    Good: Read values from SDK arguments or response objects:

    line 53

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “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

Reference Scenarios Skill

Use this skill to add or update reference implementations under reference/scenarios/<library>/ when conventions change.

Workflow

  1. Find libraries: Check which scenarios under reference/scenarios/ support the changed operation(s).
  2. Update scenario.py and README.md:
    • Wrap real library calls in spans. Call or patch private methods if needed to instrument the library only when it's not possible to do so through the public API.
    • Set attributes inline using only real values from SDK inputs, outputs, errors, or library state.
    • If the library cannot provide a value, do not fake it, leave it unset.
    • Update reference/scenarios/<library>/README.md operation table and status.
  3. Run and test:
    cd reference
    uv run run-scenario <library>       # run scenario and update data.json
    uv run run-scenario --all           # run all scenarios
    uv run update-reports               # update report tables in README.md
  4. Regenerate docs (from repo root):
    make generate-all

Scenario README (reference/scenarios/<library>/README.md)

When adding or updating a reference scenario, update its README.md:

  • Libraries only: Scenarios are for libraries and SDKs only. Do NOT add application examples.
  • Short description: 1-2 sentences explaining what the library is (e.g. model-call boundary, agent framework) and what it owns vs delegates.
  • Operations table: List relevant operations and their status:
| Operation | Should be instrumented here | Status |
| --- | --- | --- |
| inference (`chat`) | Yes - calls model directly | ✅ Implemented |
| execute_tool | No - app runs tools | ➖ Not instrumentable |
| retrieval | Yes - Vector Stores search | ❌ Not implemented |

Good vs Bad Patterns

1. Where values come from

Good: Read values from SDK arguments or response objects:

# 'model' is an SDK parameter; response fields come from the SDK object
with tracer.start_as_current_span("chat", attributes={"gen_ai.request.model": model}) as span:
    response = client.chat.completions.create(model=model, messages=messages)
    span.set_attribute("gen_ai.response.id", response.id)
    span.set_attribute("gen_ai.usage.output_tokens", response.usage.completion_tokens)

Bad: Hardcoding values or using fake test data:

# Bad: hardcoded value not returned by SDK
span.set_attribute("gen_ai.agent.name", "my-agent")

# Bad: reading from test config instead of SDK request/response
span.set_attribute("gen_ai.response.model", test_config["expected_model"])

2. Set attributes inline

Good: Set attributes right next to the SDK call:

with tracer.start_as_current_span("invoke_agent") as span:
    result = agent.invoke(prompt)
    span.set_attribute("gen_ai.agent.id", agent.id)

Bad: Hiding attribute logic in helper functions:

with tracer.start_as_current_span("invoke_agent") as span:
    result = agent.invoke(prompt)
    _set_attributes(span, agent, result)  # Hides where values come from

3. Span boundaries

Good: Span wraps the specific library call representing the operation:

with tracer.start_as_current_span("chat") as span:
    response = client.chat.completions.create(model=model, messages=messages)

Bad: Span wraps scenario setup, multiple calls, or application loops:

# Bad: wraps multiple separate calls and setup code
with tracer.start_as_current_span("chat"):
    setup_environment()
    resp1 = client.chat.completions.create(...)
    resp2 = client.chat.completions.create(...)

# Bad: wraps custom application logic instead of instrumenting library API
with tracer.start_as_current_span("invoke_agent"):
    for step in app_steps:
        process_step(step)

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.