agentleFS
redhat-etredhat-et/ripwire/.claude/skills/emitting-output/SKILL.md

emitting-output

Skill2.4k starsChanged 3 months agoApache-2.0View on GitHub

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.

Trending

Quiet since October.thin dataabout the whole repository

Jan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 12 mentionsOct 2026: 2 mentionsNov 2026: 0 mentionsDec 2026: 0 mentions
Jan 2026Jul 2026Dec 2026
Mentions a month of the redhat-et/ripwire repository that our weekly crawl found: only 14 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about redhat-et/ripwire

The biggest 5 of 14 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 14

Talked about on GitHub, Bluesky and Hacker News (14 times).

On GitHub · 9

4 more on GitHub

On Hacker News · 2

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every byte this tool prints feeds G4 (minified XML), the determinism contract, docs/EVALS.md's recorded numbers, and the stored captures.

    line 8
  2. Very specific:

    Never add a printf-family call site (CONTRIBUTING.md §3).

    line 19

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 haveUseWhy
A format string with arguments, going to a streamrw::emitTo( stream, "…{}…", args )The choke point: std::print where the library has it, std::format+fputs where it does not
Literal text, no argumentsrw::emitRaw( stream, "…" )std::format_string is consteval; there is nothing to format, and huge literals do not compile
A caller-owned char bufferrw::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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.