{"id":"ec1bd188-45d7-444d-a176-b69a3eec10aa","shortId":"4VkdXR","kind":"skill","title":"noflate","tagline":"Work with the noflate Rust crate: use DEFLATE, gzip, and zlib encoding/decoding APIs; wire sans-io streaming encoders and decoders; use EncodeOptions; handle WebSocket permessage-deflate (RFC 7692); and debug no_std or checksum-related behavior. Use when the task mentions noflate","description":"# noflate\n\nUse this skill when integrating `noflate` into Rust code. Focus on the crate's\nactual API shape and usage patterns, not generic compression background.\n\n## What this crate exposes\n\n- `noflate::deflate` for raw DEFLATE (RFC 1951)\n- `noflate::gzip` for GZIP (RFC 1952), plus `Crc32` / `crc32`\n- `noflate::zlib` for ZLIB (RFC 1950), plus `Adler32` / `adler32`\n- Shared root types: `Error`, `Result`, `Format`\n\nEach format module exposes the same main shape:\n\n- One-shot helpers: `compress(data) -> Result<Vec<u8>>`, `decompress(data) -> Result<Vec<u8>>`\n- Streaming types: `Encoder`, `Decoder`\n\n## Choosing the right API\n\n1. Pick `deflate`, `gzip`, or `zlib` based on the wire format you need.\n2. Use `compress` / `decompress` for one-shot data.\n3. Use `Encoder` / `Decoder` when data arrives incrementally or output must be\n   consumed in chunks.\n4. Use `EncodeOptions` when you need fixed Huffman blocks, stored blocks, or\n   buffering control.\n\n## Usage gotchas\n\n- This crate is `#![no_std]`; it requires `alloc`, not `std`.\n- The streaming API is sans-io:\n  `feed(data)` pushes input, `output()` borrows produced bytes, `advance(n)`\n  marks bytes as consumed.\n- One-shot compression uses buffered input internally; for similar behavior in\n  streaming code, use `EncodeOptions::new().buffer_all_input()`.\n- `sync_flush()` is for continuing a DEFLATE stream across message boundaries.\n  It is useful for `permessage-deflate`; do not treat it like `finish()`.\n- `reset_history()` is only for `no_context_takeover` style flows. Do not reset\n  state between messages unless the protocol requires it.\n- `Format::detect(&data)` needs enough prefix bytes to distinguish framing; it\n  returns `None` for too-short input.\n- Checksum helpers are format-specific: gzip uses CRC-32, zlib uses Adler-32.\n\n## API patterns to preserve\n\nOne-shot:\n\n```rust\nlet compressed = noflate::deflate::compress(b\"hello\")?;\nlet decompressed = noflate::deflate::decompress(&compressed)?;\n```\n\nStreaming encoder:\n\n```rust\nlet mut enc = noflate::deflate::Encoder::new();\nenc.feed(b\"chunk1\")?;\nenc.feed(b\"chunk2\")?;\nenc.finish()?;\nlet out = enc.output().to_vec();\nenc.advance(out.len());\n```\n\nStreaming decoder:\n\n```rust\nlet mut dec = noflate::deflate::Decoder::new();\ndec.feed(&compressed)?;\nlet out = dec.output().to_vec();\ndec.advance(out.len());\nassert!(dec.is_finished());\n```\n\nOptions:\n\n```rust\nuse noflate::deflate::EncodeOptions;\n\nlet dynamic = EncodeOptions::new();\nlet fixed = EncodeOptions::new().fixed_huffman();\nlet stored = EncodeOptions::new().stored();\nlet buffered = EncodeOptions::new().buffer_all_input();\nlet limited = EncodeOptions::new().max_block_input_bytes(32 * 1024);\n```\n\nWebSocket permessage-deflate:\n\n```rust\nlet mut enc = noflate::deflate::Encoder::new();\nenc.feed(message)?;\nenc.sync_flush()?;\nlet frame = enc.output().to_vec();\nenc.advance(frame.len());\n// Per RFC 7692, strip the trailing 0x00 0x00 0xFF 0xFF before sending.\n\nenc.reset_history(); // only when no_context_takeover is negotiated\n```\n\nFormat detection:\n\n```rust\nmatch noflate::Format::detect(&data) {\n    Some(noflate::Format::Gzip) => {}\n    Some(noflate::Format::Zlib) => {}\n    Some(noflate::Format::Deflate) => {}\n    None => {}\n}\n```\n\n## Practical hints\n\n- If you already have all input bytes, start with `compress` / `decompress`\n  before reaching for the streaming API.\n- If you use the streaming API, always drain `output()` and call `advance()`\n  after consuming bytes.\n- For WebSocket `permessage-deflate`, strip the final `0x00 0x00 0xFF 0xFF`\n  after `sync_flush()`.\n- `EncodeOptions` belongs to `noflate::deflate`, but the same options are used\n  by `gzip::Encoder` and `zlib::Encoder`.\n- The crate performs no I/O itself, but the sans-io API plugs into\n  `std::io::Write` / `Read` with a small adapter: `Write::write` forwards\n  to `feed` and drains `output` into the inner sink; `Read::read` pulls\n  from `output` and tops up via `feed` from the inner source. See\n  `examples/io_bridge.rs` for a runnable `DeflateWriter` / `DeflateReader`\n  pair.","tags":["noflate","sile","agent-skills","deflate","nostd","rust"],"capabilities":["skill","source-sile","skill-noflate","topic-agent-skills","topic-deflate","topic-nostd","topic-rust"],"categories":["noflate"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sile/noflate/noflate","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sile/noflate","source_repo":"https://github.com/sile/noflate","install_from":"skills.sh"}},"qualityScore":"0.454","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 8 github stars · SKILL.md body (4,037 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:08:57.842Z","embedding":null,"createdAt":"2026-05-18T13:14:42.432Z","updatedAt":"2026-05-18T19:08:57.842Z","lastSeenAt":"2026-05-18T19:08:57.842Z","tsv":"'-32':311,315 '0x00':450,451,528,529 '0xff':452,453,530,531 '1':135 '1024':420 '1950':97 '1951':82 '1952':88 '2':148 '3':157 '32':419 '4':172 '7692':31,446 'across':247 'actual':62 'adapt':573 'adler':314 'adler32':99,100 'advanc':213,516 'alloc':195 'alreadi':490 'alway':511 'api':14,63,134,200,316,504,510,563 'arriv':163 'assert':380 'b':329,348,351 'background':71 'base':141 'behavior':40,229 'belong':536 'block':180,182,416 'borrow':210 'boundari':249 'buffer':184,224,236,405,408 'byte':212,216,290,418,494,519 'call':515 'checksum':38,302 'checksum-rel':37 'choos':131 'chunk':171 'chunk1':349 'chunk2':352 'code':56,232 'compress':70,119,150,222,325,328,336,372,497 'consum':169,218,518 'context':269,461 'continu':243 'control':185 'crate':7,60,74,189,553 'crc':310 'crc32':90,91 'data':120,124,156,162,206,286,472 'debug':33 'dec':366 'dec.advance':378 'dec.feed':371 'dec.is':381 'dec.output':375 'decod':22,130,160,362,369 'decompress':123,151,332,335,498 'deflat':9,29,77,80,137,245,256,327,334,344,368,387,424,430,484,524,539 'deflateread':606 'deflatewrit':605 'detect':285,466,471 'distinguish':292 'drain':512,580 'dynam':390 'enc':342,428 'enc.advance':359,442 'enc.feed':347,350,433 'enc.finish':353 'enc.output':356,439 'enc.reset':456 'enc.sync':435 'encod':20,129,159,338,345,431,548,551 'encodeopt':24,174,234,388,391,395,401,406,413,535 'encoding/decoding':13 'enough':288 'error':104 'examples/io_bridge.rs':601 'expos':75,110 'feed':205,578,595 'final':527 'finish':262,382 'fix':178,394,397 'flow':272 'flush':240,436,534 'focus':57 'format':106,108,145,284,306,465,470,475,479,483 'format-specif':305 'forward':576 'frame':293,438 'frame.len':443 'generic':69 'gotcha':187 'gzip':10,84,86,138,308,476,547 'handl':25 'hello':330 'helper':118,303 'hint':487 'histori':264,457 'huffman':179,398 'i/o':556 'increment':164 'inner':584,598 'input':208,225,238,301,410,417,493 'integr':52 'intern':226 'io':18,204,562,567 'let':324,331,340,354,364,373,389,393,399,404,411,426,437 'like':261 'limit':412 'main':113 'mark':215 'match':468 'max':415 'mention':45 'messag':248,278,434 'modul':109 'must':167 'mut':341,365,427 'n':214 'need':147,177,287 'negoti':464 'new':235,346,370,392,396,402,407,414,432 'noflat':1,5,46,47,53,76,83,92,326,333,343,367,386,429,469,474,478,482,538 'none':296,485 'one':116,154,220,321 'one-shot':115,153,219,320 'option':383,543 'out.len':360,379 'output':166,209,513,581,590 'pair':607 'pattern':67,317 'per':444 'perform':554 'permessag':28,255,423,523 'permessage-defl':27,254,422,522 'pick':136 'plug':564 'plus':89,98 'practic':486 'prefix':289 'preserv':319 'produc':211 'protocol':281 'pull':588 'push':207 'raw':79 'reach':500 'read':569,586,587 'relat':39 'requir':194,282 'reset':263,275 'result':105,121,125 'return':295 'rfc':30,81,87,96,445 'right':133 'root':102 'runnabl':604 'rust':6,55,323,339,363,384,425,467 'san':17,203,561 'sans-io':16,202,560 'see':600 'send':455 'shape':64,114 'share':101 'short':300 'shot':117,155,221,322 'similar':228 'sink':585 'skill':50 'skill-noflate' 'small':572 'sourc':599 'source-sile' 'specif':307 'start':495 'state':276 'std':35,192,197,566 'store':181,400,403 'stream':19,127,199,231,246,337,361,503,509 'strip':447,525 'style':271 'sync':239,533 'takeov':270,462 'task':44 'too-short':298 'top':592 'topic-agent-skills' 'topic-deflate' 'topic-nostd' 'topic-rust' 'trail':449 'treat':259 'type':103,128 'unless':279 'usag':66,186 'use':8,23,41,48,149,158,173,223,233,252,309,313,385,507,545 'vec':122,126,358,377,441 'via':594 'websocket':26,421,521 'wire':15,144 'work':2 'write':568,574,575 'zlib':12,93,95,140,312,480,550","prices":[{"id":"e337af22-5c0c-4c97-a65b-c0ef0dd9c134","listingId":"ec1bd188-45d7-444d-a176-b69a3eec10aa","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sile","category":"noflate","install_from":"skills.sh"},"createdAt":"2026-05-18T13:14:42.432Z"}],"sources":[{"listingId":"ec1bd188-45d7-444d-a176-b69a3eec10aa","source":"github","sourceId":"sile/noflate/noflate","sourceUrl":"https://github.com/sile/noflate/tree/main/skills/noflate","isPrimary":false,"firstSeenAt":"2026-05-18T13:14:42.432Z","lastSeenAt":"2026-05-18T19:08:57.842Z"}],"details":{"listingId":"ec1bd188-45d7-444d-a176-b69a3eec10aa","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sile","slug":"noflate","github":{"repo":"sile/noflate","stars":8,"topics":["agent-skills","deflate","nostd","rust"],"license":"mit","html_url":"https://github.com/sile/noflate","pushed_at":"2026-04-29T14:05:57Z","description":"A `no_std` sans-io DEFLATE / ZLIB / GZIP encoder and decoder with no dependencies","skill_md_sha":"2f92bd226f4453e8b301ea8aac9bba6132a9570f","skill_md_path":"skills/noflate/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sile/noflate/tree/main/skills/noflate"},"layout":"multi","source":"github","category":"noflate","frontmatter":{"name":"noflate","license":"MIT","description":"Work with the noflate Rust crate: use DEFLATE, gzip, and zlib encoding/decoding APIs; wire sans-io streaming encoders and decoders; use EncodeOptions; handle WebSocket permessage-deflate (RFC 7692); and debug no_std or checksum-related behavior. Use when the task mentions noflate, DEFLATE/gzip/zlib internals, sync_flush, reset_history, Format::detect, or streaming compression with this crate.","compatibility":"Requires Rust 1.88+ and cargo."},"skills_sh_url":"https://skills.sh/sile/noflate/noflate"},"updatedAt":"2026-05-18T19:08:57.842Z"}}