Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Emitting Output

ASecurity

Writing or converting formatted output in ripwire's C++ source — std::print/std::format via rw::emitTo, emitRaw and formatTo, which printf specifier maps to which format spec, and how to prove a conversion moved zero bytes. Use when adding any output call site, converting a printf-family one, or touching a help/legend string.

2,341 stars
0 votes
0 copies
0 views
Added 9/21/2026
developmentgoc++bashgit

Security Analysis

A100/100

Scanned 9/21/2026

Install to Claude Code

$npx -y skills add redhat-et/ripwire --skill emitting-output --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Emitting Output?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Emitting Output
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/redhat-et-emitting-output/badge)](https://www.skillsdirectory.com/skills/redhat-et-emitting-output)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: emitting-output
description: Writing or converting formatted output in ripwire's C++ source — std::print/std::format via rw::emitTo, emitRaw and formatTo, which printf specifier maps to which format spec, and how to prove a conversion moved zero bytes. Use when adding any output call site, converting a printf-family one, or touching a help/legend string.
---

# Emitting output in ripwire

Every byte this tool prints feeds G4 (minified XML), the determinism contract, `docs/EVALS.md`'s
recorded numbers, and the stored captures. Output code is therefore held to byte-exactness, not taste.

## The three primitives (`src/infra/emit.h`)

| You have | Use | Why |
| --- | --- | --- |
| A format string **with arguments**, going to a stream | `rw::emitTo( stream, "…{}…", args )` | The choke point: `std::print` where the library has it, `std::format`+`fputs` where it does not |
| **Literal text, no arguments** | `rw::emitRaw( stream, "…" )` | `std::format_string` is *consteval*; there is nothing to format, and huge literals do not compile |
| A **caller-owned char buffer** | `rw::formatTo( buf, cap, "…{}…", args )` | Keeps the stack buffer — `std::format` into a `std::string` puts an allocation on hot paths (G2) |

Never add a printf-family call site (`CONTRIBUTING.md` §3). Do not vendor `fmt` — the standard library
has the feature, so a vendored copy is a G3 regression.

## The specifier mapping — measured, not remembered

Proven byte-identical on this toolchain (218 checks; see the lane's `fmtparity.cpp`):

```
%s %u %d %zu %zd %lu %ld %llu %lld %i   ->  {}
%.*s  (precision, pointer)               ->  {}  with std::string_view( ptr, len )
%10s -> {:>10}      %-11s -> {:<11}      %.9s -> {:.9}
%016llx -> {:016x}  %llx -> {:x}  %llX -> {:X}  %o -> {:o}
%.3f -> {:.3f}      %6.1f -> {:6.1f}     %.0f -> {:.0f}
%.6g -> {:.6g}      %.3g -> {:.3g}       (explicit precision only)
```

**The one unsafe mapping.** A `%g` or `%f` with *no* precision is NOT `{}`. printf's `%g` prints six
significant digits; `{}` prints the shortest round-trip. `0.1+0.2` is `0.3` under `%g` and
`0.30000000000000004` under `{}`. Give the format spec an explicit precision or leave the site alone.

## Three traps that are invisible at the call site

1. **`%%` inverts.** In a printf format a literal percent is `%%`. Text handed to `emitRaw` is no longer
   a format, so `%%` there prints *two* characters — collapse it to one `%`. This is how garbage reached
   a generated `docs/COMMANDS.md`.
2. **Braces invert the other way.** `emitTo` needs `{{` and `}}` for literal braces; `emitRaw` needs bare
   `{` and `}`. JSON emitters are where this bites.
3. **`format_to_n` is not `snprintf`.** `snprintf( p, S, … )` writes at most `S-1` chars *plus a NUL*;
   `format_to_n( p, S, … )` writes up to `S` and terminates nothing. Swapping one for the other widens the
   buffer by a byte and drops the terminator. Use `rw::formatTo`, whose contract is snprintf's exactly —
   including its return value, the would-have-written length.

## Proving a conversion moved zero bytes

1. `bash test/printffmtparitycheck.sh` — per-verb SHA-256 of stdout and stderr. **If it does not have a
   label for the verb you touched, it proves nothing about your change: add the label and pin it first.**
   `UPDATE_GOLDEN=1` re-pins; the diff must be additions only. Pinning refuses any verb whose output
   embeds the git stamp (`at="<sha>"`), because such a verb cannot hold a pin at all.
2. **A green fence is not coverage.** Measure it: a coverage build showed only 25% of one batch's call
   sites were ever executed by the corpus. Widen at the gaps — `--json` is a whole second output path.
3. **Differential-test against the pre-conversion binary on a REAL tree.** Build the base commit into a
   scratch worktree and diff both binaries' bytes over `src/`, `test/`, `docs/` and the repo root,
   normalising only the git stamp. A toy fixture cannot reach a truncation branch; a real tree does it by
   accident. This is what caught the `format_to_n` byte, with all 40 labels green.

Attribution

redhat-etredhat-et
View sourceMore from redhat-et →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

284722 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2192 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →