Agent skill

Write Structured Tracing

by r3bl-org in r3bl-org/r3bl-open-core

Standard for writing structured tracing logs behind debug flags.

Apache-2.0Auto-check passedDevelopment

Install Write Structured Tracing

skills CLI
$ npx skills add r3bl-org/r3bl-open-core --skill write-structured-tracing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install r3bl-org/r3bl-open-core write-structured-tracing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/r3bl-org/r3bl-open-core.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/write-structured-tracing .claude/skills/write-structured-tracing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
write-structured-tracing
GitHub stars
485
Token cost
~784 tokens
SKILL.md length
302 words
Files
1
Skills in repo
25
Repo updated
First seen
Licence
Apache-2.0

At a glance

Standard for writing structured tracing logs behind debug flags.

  • Works in 4 steps: Gating Behind Debug Flags → The // % is Display, ? is Debug. Comment → Structured Fields and message → …
  • Development work in your project
  • SKILL.md covers 1. Gating Behind Debug Flags, 2. The // % is Display, ? is…, 3. Structured Fields and message and 4. Using inline_string! vs…, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Write Structured Tracing is an agent skill from r3bl-org/r3bl-open-core. Standard for writing structured tracing logs behind debug flags.

Its SKILL.md is about 780 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. The repository describes itself as: TUI framework and developer productivity apps in Rust 🦀. The licence is Apache-2.0.

When your agent uses it

  • Development work in your project

Example prompts

  • “/write-structured-tracing”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Gating Behind Debug Flags
  2. The // % is Display, ? is Debug. Comment
  3. Structured Fields and message
  4. Using inline_string! vs format! for Complex Formatting

What it can do on your machine

Read from SKILL.md and the folder at commit 89db352. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are rust).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Write Structured Tracing loads about 784 tokens when it runs. Until then it costs about 22 tokens; SKILL.md has 302 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~22
When it runs · the whole SKILL.md, loaded when a task matches
~784

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from r3bl-org/r3bl-open-core at commit 89db352, republished under its Apache-2.0 licence (© r3bl-org). 302 words, ~784 tokens.

Download SKILL.mdSave it as .claude/skills/write-structured-tracing/SKILL.md (or your agent's skills folder).
name
write-structured-tracing
description
Standard for writing structured tracing logs behind debug flags.

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.
rust
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).

rust
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).
rust
crate::DEBUG_TUI_MOD.then(|| {
    // % is Display, ? is Debug.
    tracing::info! {
        message = "AppNoLayout::handle_event",
        input_event = %inline_string!(
            "{a} {b:?}",
            a = glyphs::USER_INPUT_GLYPH,
            b = input_event
        )
    };
});

Example Transformation

Bad (Unstructured and Un-gated):

rust
tracing::debug!("Received input event: {:?}", input_event);

Good (Structured and Gated):

rust
crate::DEBUG_TUI_PTY_MUX.then(|| {
    // % is Display, ? is Debug.
    tracing::debug! {
        message = "PTYMux::run_event_loop",
        input_event = %format!("{:?}", input_event)
    };
});

© r3bl-org, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/write-structured-tracing of r3bl-org/r3bl-open-core.

Open the folder on GitHubat commit 89db352

Compare with similar skills

Write Structured Tracing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Write Structured Tracing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Write Structured Tracing this skillr3bl-org/r3bl-open-core485—~784Automated safety check: PassApache-2.0
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k24 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Greplooponyx-dot-app/onyx32k4 repos~3.3kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 24 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed
  • Guidelines

    akash-network/node

    Behavioral guidelines to reduce common LLM coding mistakes. An agent skill from akash-network/node.

    1.1k GitHub starsUsed in 22 repos~577 tokens
    DevelopmentAuto-check passed

More from r3bl-org/r3bl-open-core

All 25 skills in this repo
  • Analyze Log Files

    r3bl-org/r3bl-open-core

    Analyze log files by stripping ANSI escape sequences first. An agent skill from r3bl-org/r3bl-open-core.

    485 GitHub stars~632 tokensUpdated yesterday
    Auto-check: notes
  • Analyze Performance

    r3bl-org/r3bl-open-core

    Establish performance baselines and detect regressions using flamegraph analysis.

    485 GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Check Bounds Safety

    r3bl-org/r3bl-open-core

    Apply type-safe bounds checking patterns using VPIndex/VPLength types instead of usize.

    485 GitHub stars~4.1k tokensUpdated yesterday
    Auto-check passed
  • Release Crate

    r3bl-org/r3bl-open-core

    Publish a crate release to crates.io with changelog, standalone release notes, git tag, and GitHub release.

    485 GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Organize Modules

    r3bl-org/r3bl-open-core

    Apply private modules with public re-exports (barrel export) pattern for clean API design.

    485 GitHub stars~5.8k tokensUpdated yesterday
    Auto-check passed
  • Check Code Quality

    r3bl-org/r3bl-open-core

    Run comprehensive Rust code quality checks including compilation, linting, documentation, and tests.

    485 GitHub stars~3.8k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Write Structured Tracing

What does Write Structured Tracing do?

Standard for writing structured tracing logs behind debug flags. Write Structured Tracing is an agent skill from r3bl-org/r3bl-open-core. Standard for writing structured tracing logs behind debug flags.

When should I use Write Structured Tracing?

Write Structured Tracing fits situations like: development work in your project.

How do I install Write Structured Tracing in Claude Code?

Run `npx skills add r3bl-org/r3bl-open-core --skill write-structured-tracing -a claude-code`. Or copy the skill folder (.agents/skills/write-structured-tracing in r3bl-org/r3bl-open-core) into .claude/skills/write-structured-tracing in your project. Claude Code loads it when a task matches its description.

How do I install Write Structured Tracing in Codex?

Run `npx skills add r3bl-org/r3bl-open-core --skill write-structured-tracing -a codex`. Or copy the skill folder (.agents/skills/write-structured-tracing in r3bl-org/r3bl-open-core) into .agents/skills/write-structured-tracing in your project. Codex loads it when a task matches its description.

Can I use Write Structured Tracing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add r3bl-org/r3bl-open-core --skill write-structured-tracing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/write-structured-tracing, .gemini/skills/write-structured-tracing, .github/skills/write-structured-tracing and .opencode/skills/write-structured-tracing in your project.

What does Write Structured Tracing need to run?

SKILL.md names no scripts, command-line tools or credentials: Write Structured Tracing is instructions for the agent only.

Does Write Structured Tracing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Write Structured Tracing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Write Structured Tracing use?

Write Structured Tracing is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Write Structured Tracing use?

About 784 tokens (SKILL.md is roughly 3.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Write Structured Tracing?

Skills that share tags, products or a category with Write Structured Tracing: Finishing a Development Branch (obra/superpowers, 296k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars), PR Babysitter (openinterpreter/openinterpreter, 69k stars) and Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Write Structured Tracing?

r3bl-org (a GitHub organization) maintains it in r3bl-org/r3bl-open-core, which has 485 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 6, 2026.

Source: r3bl-org/r3bl-open-core on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.