qr-code-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

QR Code Generator

二维码生成器

What this skill does

本Skill的功能

Given a URL, this skill generates:
  • a QR code that encodes the URL
  • optional captions (human-readable URL or short label)
  • exports in PNG and/or SVG
  • optional batch runs from a CSV
给定一个URL,本Skill可生成:
  • 编码该URL的二维码
  • 可选的说明文字(易读的URL或简短标签)
  • 导出为PNG和/或SVG格式文件
  • 支持从CSV文件批量生成二维码

Guardrails

安全准则

  • Don’t generate QR codes for suspicious links (phishing, credential prompts, malware). If unsure, ask for confirmation or suggest a safer destination page.
  • Prefer HTTPS URLs.
  • If the QR is for print, prefer SVG (scales cleanly) and high error correction.
  • 不要为可疑链接(钓鱼、索要凭据、恶意软件链接)生成二维码。若不确定,请求用户确认或建议更安全的目标页面。
  • 优先使用HTTPS协议的URL。
  • 若二维码用于印刷场景,优先选择SVG(缩放不失真)和高纠错级别

Inputs

输入参数

Required:
  • URL
Optional:
  • label/caption text (e.g., “Scan to book a call”)
  • whether to show the URL under the QR (yes/no)
  • output formats: PNG, SVG
  • UTM params (source, medium, campaign, content, term)
  • size intent: screen / print / sticker
必填:
  • URL
可选:
  • 标签/说明文字(例如:“扫码预约通话”)
  • 是否在二维码下方显示URL(是/否)
  • 输出格式:PNG、SVG
  • UTM参数(source、medium、campaign、content、term)
  • 尺寸用途:屏幕显示/印刷/贴纸

Workflow

工作流程

  1. Validate the URL (scheme + domain).
  2. Optionally append UTM parameters (using
    assets/templates/utm_template.json
    ).
  3. Generate QR:
    • Error correction: M (default), H for print/complex usage
    • Border: 4 (default)
  4. Export:
    • PNG (good for web)
    • SVG (best for print)
  5. If caption enabled:
    • PNG: add label and/or URL under the QR
    • SVG: add a text element under the QR
  6. Return links + a quick “usage notes” block (recommended minimum size, print tips).
  1. 验证URL的合法性(协议+域名)。
  2. 可选操作:附加UTM参数(使用
    assets/templates/utm_template.json
    模板)。
  3. 生成二维码:
    • 纠错级别:默认M级,印刷/复杂场景推荐H级
    • 边框:默认4
  4. 导出文件:
    • PNG(适合网页使用)
    • SVG(最适合印刷场景)
  5. 若启用说明文字:
    • PNG格式:在二维码下方添加标签和/或URL
    • SVG格式:在二维码下方添加文本元素
  6. 返回文件链接 + 快速“使用说明”模块(推荐最小尺寸、印刷提示)。

Output format (required)

输出格式(必填)

  • Encoded URL (final URL after UTM, if used)
  • Files generated (with links)
  • Recommendations (error correction, min size, when to use SVG vs PNG)
  • 编码后的URL(若使用UTM参数则为最终拼接后的URL)
  • 生成的文件(带下载链接)
  • 使用建议(纠错级别、最小尺寸、SVG与PNG的适用场景)

Scripts in this pack

工具包中的脚本

  • scripts/generate_qr.py
    — single QR (PNG/SVG, optional caption)
  • scripts/batch_generate.py
    — batch from CSV (id,url,label)
  • scripts/generate_qr.py
    — 单个二维码生成(支持PNG/SVG格式,可选添加说明文字)
  • scripts/batch_generate.py
    — 从CSV文件批量生成(CSV需包含id、url、label字段)

Templates

模板文件

  • assets/templates/utm_template.json
  • assets/templates/print_notes.md
  • assets/templates/prompt_snippets.md
  • assets/templates/utm_template.json
  • assets/templates/print_notes.md
  • assets/templates/prompt_snippets.md