r3bl-open-core: Skill for Claude Code

.agents/skills/write-structured-tracing/SKILL.md

write-structured-tracing is a skill for Claude Code, Codex from r3bl-org/r3bl-open-core. It costs 16 tokens per session (752 once invoked), scanned A, original, Apache-2.0.

A project standard for writing tracing logs behind debug flags. Tracing logs record what software is doing, while debug flags turn selected logging on or off.

In plain words
What is it for?
For adding Rust tracing messages to specific modules or subsystems while controlling their performance and avoiding overly broad log output.
Why use it?
It keeps logs filterable and prevents logging work and string creation when debugging is disabled.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is r3bl-org/r3bl-open-core's own configuration. It tells Claude Code and Codex how to work on r3bl-open-core itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything r3bl-open-core configures →

Reuse

Borrowing it

Nothing to install: this file belongs to r3bl-org/r3bl-open-core. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/r3bl-org/r3bl-open-core/main/.agents/skills/write-structured-tracing/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/r3bl-org/r3bl-open-core

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for write-structured-tracing

README.md
[![agentmods](https://agentmods.dev/badge/skills/r3bl-org/r3bl-open-core/write-structured-tracing.svg)](https://agentmods.dev/skills/r3bl-org/r3bl-open-core/write-structured-tracing)
Your own site
<a href="https://agentmods.dev/skills/r3bl-org/r3bl-open-core/write-structured-tracing"><img src="https://agentmods.dev/badge/skills/r3bl-org/r3bl-open-core/write-structured-tracing.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 752 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00016 $0.00752
Opus 5 $0.00008 $0.00376
Sonnet 5 $0.00003 $0.00150
Haiku 4.5 $0.00002 $0.00075

Measured 8d ago against content hash d1abdcaf9a41, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

write-structured-tracing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/write-structured-tracing/SKILL.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Write Structured Tracing

This skill documents the project's standard for writing tracing logs (tracing::info!, tracing::debug!, etc.). It ensures logs are easily filterable, consistently formatted, and don't affect performance when disabled.

1. Gating Behind Debug Flags

All tracing::*! calls must be gated behind a specific debug flag from tui/src/tui/mod.rs (or similar location) using the .then(|| { ... }) pattern. This ensures the tracing macro and any string allocations are completely bypassed when the flag is disabled.

Choosing the right flag (Scope Specificity): Make sure the flag you use is specifically scoped to the module or subsystem you are debugging. This scope can be narrow or broad depending on the requirements.

  • Do NOT reuse a broad orchestrator flag (e.g., DEBUG_TUI_PTY_MUX) for a microscopic, high-volume subsystem (like a byte-stream parser). Doing so would spam the orchestrator logs.
  • If a suitable module-specific flag does not exist, create a new one (e.g., DEBUG_TUI_VT100_PARSER) to ensure developers can isolate and filter logs effectively without overwhelming the IO overhead.
crate::DEBUG_TUI_MOD.then(|| {
    // ... tracing call ...
});

2. The // % is Display, ? is Debug. Comment

You MUST add the exact line comment // % is Display, ? is Debug. directly above every tracing::*! invocation. This serves as a quick syntax reminder.

3. Structured Fields and message

Do not use unstructured string formatting (e.g., tracing::info!("Hello {}", name)). Instead, use structured fields with an explicit message key that identifies the context (e.g., the struct and method name).

crate::DEBUG_TUI_MOD.then(|| {
    // % is Display, ? is Debug.
    tracing::info! {
        message = "ComponentName::method_name",
        status = "Something happened",
    };
});

4. Using inline_string! vs format! for Complex Formatting

When you need to format complex strings within a tracing field, bind it to a field using the % (Display) modifier and follow this rule:

  • If the resulting string will be <= 16 bytes, use the inline_string! macro to stack-allocate it.
  • If the resulting string will be > 16 bytes, use the standard format! macro (since inline_string! would spill to the heap and allocate anyway).

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 80 lines · 16 tokens per session scan A d1abdcaf9a41

Subscribe to this mod's changes

write-structured-tracing is a skill published in the GitHub repository r3bl-org/r3bl-open-core (483 stars, last pushed 2d ago), licensed Apache-2.0. It adds 16 tokens to every session and 752 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.