agentsclimarketplace

Base64 encode

Skill MauricioPerera/agent-skills-pack/skills/base64-encode

A curated pack of 7 practical agent-skills demonstrating real-world patterns: HTTP, GitHub CLI, ripgrep, file ops, JSON processing, encoding. Each SKILL.md validated against the v0.1 spec.

Install
npx -y skills add MauricioPerera/agent-skills-pack --skill base64-encode

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Encodes a string as base64. Useful for embedding binary or special-character data in URLs, JSON tokens, or HTTP headers.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

3.7 KB, as published. Nobody here has run it

Base64 encode a string

Pure-shell utility: convert any string to its base64 representation.

Why printf '%s' instead of echo

echo adds a trailing newline by default and has shell-specific behavior with backslash escapes. printf '%s' is portable, predictable, and produces no trailing newline — so the base64 output represents exactly the input bytes.

Why base64 -w0

GNU base64 wraps output at 76 chars per line by default. For URL/JSON/header embedding, that's wrong — you need a single contiguous line. -w0 disables wrapping.

(macOS users: macOS's BSD base64 does NOT support -w0. This skill assumes GNU coreutils. macOS users should use gbase64 from brew install coreutils or omit -w0 and pipe through tr -d '\n' for portability.)

Output

  • stdout: the base64-encoded string, single line, no trailing newline.
  • stderr: empty on success.
  • exit code: 0 always (base64 doesn't fail on string input).

Caveats

  • This is standard base64, not URL-safe (base64url). For URL-safe encoding, pipe through tr '+/' '-_' | tr -d '=' after this skill (or use a dedicated base64url-encode skill if added).
  • The skill takes a STRING. To base64-encode a binary file, use base64 -w0 < /path/to/file directly — wrapping that as a separate skill is straightforward but kept out for now (tighter input validation needed for a path arg).
  • The value pattern allows any UTF-8 character — newlines, NULs, special chars are preserved through the bank's single-quoting and into the printf invocation.

Pairing

A common use is building HTTP Basic Auth:

# Skill 1: build "user:password"
# Skill 2: base64-encode that
# Skill 3: HTTP request with the resulting string in `Authorization: Basic <encoded>` header

Each step is small and verifiable. The agent doesn't need to know base64 internals — it knows when to invoke this skill.

Reverse direction

A future companion skill base64-decode would invert this. Same pattern, with base64 --decode -w0 and a base64-validity pattern on the input.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.