Broadcast: Skill for Claude Code

.agents/skills/broadcast-logging-best-practices/SKILL.md

broadcast-logging-best-practices is a skill for Claude Code, Codex from mergesort/Broadcast. It costs 52 tokens per session (4,381 once invoked), scanned A, original, MIT.

A guide for using Broadcast, a Swift logging library, in an app or package. It covers shared log destinations, structured records with consistent fields, dependency injection, buffered export, and tests.

In plain words
What is it for?
Use it when adding Broadcast to a Swift project, configuring its shared logger, defining app-specific categories and values, exporting buffered logs, or testing logging behavior.
Why use it?
It helps replace scattered free-form messages with logs that are easier to filter, export, and test. It also reduces inconsistent logging setup across SwiftUI and other parts of an app.

Skill for Claude CodeCodex

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

This is mergesort/Broadcast's own configuration. It tells Claude Code and Codex how to work on Broadcast 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 Broadcast configures →

Reuse

Borrowing it

Nothing to install: this file belongs to mergesort/Broadcast. 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/mergesort/Broadcast/main/.agents/skills/broadcast-logging-best-practices/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/mergesort/Broadcast

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 broadcast-logging-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/mergesort/broadcast/broadcast-logging-best-practices/github.svg)](https://agentmods.dev/skills/mergesort/broadcast/broadcast-logging-best-practices)
Your own site
<a href="https://agentmods.dev/skills/mergesort/broadcast/broadcast-logging-best-practices"><img src="https://agentmods.dev/badge/skills/mergesort/broadcast/broadcast-logging-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for broadcast-logging-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/mergesort/broadcast/broadcast-logging-best-practices"><img src="https://agentmods.dev/badge/skills/mergesort/broadcast/broadcast-logging-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,381 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 390
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
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.00052 $0.04381
Opus 5 $0.00026 $0.02191
Sonnet 5 $0.00010 $0.00876
Haiku 4.5 $0.00005 $0.00438

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

Security

Grade A, and why

broadcast-logging-best-practices 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 10d 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/broadcast-logging-best-practices/SKILL.md · 470 lines

How it starts

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

Broadcast Logging Best Practices

Use this skill when integrating Broadcast into a Swift project. Treat Broadcast as an external reusable logging library; do not assume you are modifying Broadcast itself unless the user explicitly asks to work on the library.

Before making non-trivial Broadcast changes or integrations, read the current Broadcast README and relevant DocC articles in Sources/Broadcast/Documentation.docc/ so examples, API choices, and terminology match the library's public guidance.

Integration Workflow

  1. Add Broadcast as a dependency using the host project's normal package workflow.
  2. Import Broadcast where logging is configured or called.
  3. Create a shared Log instance from one or more destinations.
  4. For app or app-specific package code, prefer one immutable app or package-scoped global let log so SwiftUI and non-SwiftUI surfaces share the same destination graph.
  5. Use Broadcast's built-in Log.Payload helper factories for common typed values, then add app-specific Log.Category values and app-specific Log.Payload helpers in the integrating app or app-specific logging package.
  6. Replace important free-form logs with structured logs where they help explain user-visible behavior, support diagnostics, startup, sync, entitlement, routing, persistence, or network decisions.
  7. Validate with the host project's normal build and test commands.

Core APIs

  • Log fans out one log call to one or more destinations.
  • LoggingDestination is the write-only sink protocol whose primitive is log(_ record:); Broadcast provides default debug, info, warn, error, and fault convenience methods that create records.
  • BufferedLoggingDestination extends LoggingDestination with records() for destinations that need access to canonical records, plus overridable default logs() text export.
  • ConsoleLogger writes process-local output.
  • SessionLogger buffers logs in memory for the current process.
  • MultiSessionLogger buffers canonical Log.Record values across launches using persistent storage; use it only when the host app has configured the required persistence.
  • Log.Signal describes the intent of a structured log. Defaults include .action, .state, .event, .metric, and .diagnostic.
  • Log.Category describes a human-readable subsystem or area.
  • Log.Payload stores typed key-value diagnostics and exposes public typed initializers plus helper factories such as .string, .bool, .int, .uuid, .url, .date, .duration, .error, .count, .id, and .timestamp so call-sites do not need to format values manually.
  • Log.Record is the identifiable timestamped semantic structured log value that destinations format through recordFormatter, which defaults to Broadcast's standard single-line format; records create a UUID and current timestamp by default.
  • Log.Record.Formatter is the type-erased destination-level formatter for structured Log.Record values.
  • Built-in Log.Record format styles include .default, .json, .tokenOptimized, and .canonicalLogLine.
  • Log.DateProvider supplies dates for buffered loggers, and Log.Timestamp.FormatStyle formats those dates; Log.Timestamp defaults to the current date and is available as Log.Timestamp.now, but fixed date providers are still the deterministic-test path for logger output.

Read the full file on GitHub · 470 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. 10d ago First seen · 470 lines · 52 tokens per session scan A b6006b3e5815

Subscribe to this mod's changes

broadcast-logging-best-practices is a skill published in the GitHub repository mergesort/Broadcast (50 stars, last pushed 9d ago), licensed MIT. It adds 52 tokens to every session and 4,381 once invoked, about $0.0003 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.

Related

Other skills, from other repositories