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.
curl -O https://raw.githubusercontent.com/mergesort/Broadcast/main/.agents/skills/broadcast-logging-best-practices/SKILL.mdgit clone --depth 1 https://github.com/mergesort/BroadcastWrote 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.
[](https://agentmods.dev/skills/mergesort/broadcast/broadcast-logging-best-practices)<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.
<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>- NVIDIA SkillSpector warn
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.
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.
| Model | Per session | Once 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 |
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.
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
- Add Broadcast as a dependency using the host project's normal package workflow.
- Import
Broadcastwhere logging is configured or called. - Create a shared
Loginstance from one or more destinations. - For app or app-specific package code, prefer one immutable app or package-scoped global
let logso SwiftUI and non-SwiftUI surfaces share the same destination graph. - Use Broadcast's built-in
Log.Payloadhelper factories for common typed values, then add app-specificLog.Categoryvalues and app-specificLog.Payloadhelpers in the integrating app or app-specific logging package. - 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.
- Validate with the host project's normal build and test commands.
Core APIs
Logfans out one log call to one or more destinations.LoggingDestinationis the write-only sink protocol whose primitive islog(_ record:); Broadcast provides defaultdebug,info,warn,error, andfaultconvenience methods that create records.BufferedLoggingDestinationextendsLoggingDestinationwithrecords()for destinations that need access to canonical records, plus overridable defaultlogs()text export.ConsoleLoggerwrites process-local output.SessionLoggerbuffers logs in memory for the current process.MultiSessionLoggerbuffers canonicalLog.Recordvalues across launches using persistent storage; use it only when the host app has configured the required persistence.Log.Signaldescribes the intent of a structured log. Defaults include.action,.state,.event,.metric, and.diagnostic.Log.Categorydescribes a human-readable subsystem or area.Log.Payloadstores 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.timestampso call-sites do not need to format values manually.Log.Recordis the identifiable timestamped semantic structured log value that destinations format throughrecordFormatter, which defaults to Broadcast's standard single-line format; records create a UUID and current timestamp by default.Log.Record.Formatteris the type-erased destination-level formatter for structuredLog.Recordvalues.- Built-in
Log.Recordformat styles include.default,.json,.tokenOptimized, and.canonicalLogLine. Log.DateProvidersupplies dates for buffered loggers, andLog.Timestamp.FormatStyleformats those dates;Log.Timestampdefaults to the current date and is available asLog.Timestamp.now, but fixed date providers are still the deterministic-test path for logger output.
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.
- 10d ago First seen · 470 lines · 52 tokens per session scan A b6006b3e5815
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.
Other skills, from other repositories
swift-format-style
Writes and reviews Swift FormatStyle code, replacing legacy Formatter subclasses and C-style String(format:) with modern .formatted() APIs. Use when formatting numbers, dates, durations, measurements, lists, names, byte counts, or URLs.
swift-concurrency
Diagnose Swift Concurrency issues, refactor callback-based code to async/await, and guide Swift 6 migration when working with tasks, actors, @MainActor, Sendable, data races, thread safety, or concurrency-related compiler and linter warnings.
authoring-java-sdk-tasks
Writes Airflow task logic in Java, Kotlin, or any JVM language using the Airflow Java SDK. Use when the user wants to implement Airflow tasks in Java/JVM, asks about @Builder.Dag/@Builder.Task/@Builder.XCom, the Task/BundleBuilder interfaces, reading connections/variables/XComs from Java, the JSON-to-Java type…
swift-development
You MUST activate this skill when working on Swift projects.
android-development
Android development with Kotlin, Jetpack Compose, and modern Android architecture. Use when building Android apps, implementing Material Design, or following Android best practices.
ios-development
Comprehensive guide for building native Apple platform applications.