Skip to content
Back to skills

Mermaid Reverse Attempt

ASecurity

Mermaid URL codec - encodes/decodes #base64: (amp CLI) and #pako: (mermaid.live) formats

  • 61 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 29, 2026
developmentjavascriptgojavabashnode

Works with

  • cli

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned May 29, 2026

npx -y skills add plurigrid/asi --skill mermaid-reverse-attempt --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mermaid Reverse Attempt?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mermaid Reverse Attempt
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/plurigrid-mermaid-reverse-attempt/badge)](https://www.skillsdirectory.com/skills/plurigrid-mermaid-reverse-attempt)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mermaid-reverse-attempt
description: "Mermaid URL codec - encodes/decodes #base64: (amp CLI) and #pako: (mermaid.live) formats"
version: 1.0.0
---


# Mermaid Reverse Attempt

Encode diagrams to shareable URLs, decode URLs back to source.

## Formats Discovered

| Prefix | Source | Method |
|--------|--------|--------|
| `#base64:` | amp CLI | `JSON.stringify({code}) → base64` |
| `#pako:` | mermaid.live | `pako.deflate(JSON.stringify({code})) → base64` |

## Usage

```bash
# Encode diagram to pako URL (compressed)
node scripts/codec.js encode-pako < diagram.mmd

# Encode to base64 URL (amp style)
node scripts/codec.js encode-base64 < diagram.mmd

# Decode URL to diagram
node scripts/codec.js decode "https://mermaid.live/edit#pako:..."
```

## Quick Reference

```javascript
// Decode
const hash = url.split('#')[1];
if (hash.startsWith('pako:')) {
  return JSON.parse(pako.inflate(Buffer.from(hash.slice(5), 'base64'), {to:'string'})).code;
}
if (hash.startsWith('base64:')) {
  return JSON.parse(Buffer.from(hash.slice(7), 'base64').toString()).code;
}

// Encode pako
`https://mermaid.live/edit#pako:${Buffer.from(pako.deflate(JSON.stringify({code:diagram}))).toString('base64')}`
```

## GF(3)

- Trit: 0 (ERGODIC)
- decode ∘ encode = id

Files in this skill

  • SKILL.md1.2 KB
  • package-lock.json573 B
  • package.json283 B
  • scripts/codec.js1.3 KB

Attribution

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

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.