USPS Intelligent Mail Barcode (IMb) Encoder
Generate the 65-bar Intelligent Mail barcode for automation and full-service mail without a library or web service: a dependency-free encoder from the public USPS-B-3200 spec, pinned to all four official test vectors, with a mailer-construct helper, tracking-code parser, SVG renderer and CLI
$29
Works with the AI Agents you already use
About this skill
Automation-rate postage, full-service discounts and mail tracking need the 65-bar Intelligent Mail barcode on every piece, and most billing and notice systems either pay a print vendor for it or depend on a package nobody can audit. The encoding is public but fiddly: a 102-bit binarization with routing offsets, an 11-bit CRC, two character tables built from bit-count rules, and a 65-entry bar map; one wrong constant yields a barcode that scans as another mailpiece.
Encoder (imb.mjs): implemented directly from USPS-B-3200 Rev H (Appendix F binarization, Appendix D CRC-11 and the 5-of-13 / 2-of-13 tables, Table 22 bar map) and validated against all four official Appendix C examples, which between them exercise every stage (no routing, 5, 9 and 11 digits, the FCS bit-10 case, both table halves). encodeImb(tracking, routing) returns the T/A/D/F string the USPS font expects; encodeMailerImb assembles barcode id, service type, 6- or 9-digit Mailer ID and the serial with padding and overflow checks; parseTrackingCode splits a stored code back into its fields.
Renderer: renderImbSvg draws the barcode at the specification's geometry (22 bars per inch, 0.020-inch bars, 0.145-inch full height, 0.0975-inch ascenders and descenders, centered 0.050-inch tracker, quiet zone) at any DPI, for print pipelines without the USPS font.
CLI (imb-cli.mjs): from a tracking code or the construct fields, prints the parsed fields and the bars and writes the SVG.
8 tests: the four official vectors, the construct and parser, fail-closed validation, the SVG geometry (65 bars, pitch, width, the four heights and their placement) and the CLI. reference/imb-fields.md explains the fields, the routing code, printing with the font or the SVG, and the size window.
Node 18+, no packages, no network.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 17 days ago
- Software
Node.js 18+