lov-create-qrcode

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

二维码工坊 · QR Studio

QR Code Workshop · QR Studio

把一段内容确定性地生成二维码或按需生成 Warm Academic 海报 PNG。默认只输出二维码 本体,不加 header、footer、标题或明文;配色、码点、尺寸、纠错和海报选项可由当前 请求或共享 Profile 覆盖。
Deterministically generate a QR code from a piece of content or, on demand, a Warm Academic poster PNG. By default, only the QR code itself is output, without a header, footer, title, or plaintext; the color scheme, modules, size, error correction, and poster options can be overridden by the current request or the shared Profile.

Triggers

Triggers

Activate when

Activate when

  • 用户说“把这个链接生成二维码”“按我的偏好做一个 QR code”“生成可扫码的二维码海报”。
  • 用户要把文本、网址、Wi-Fi 配置或其他 UTF-8 内容编码成 PNG 二维码。
  • The user asks to “create a QR code”, “make a branded QR poster”, or “use my saved QR preferences”.
  • The user says “turn this link into a QR code”, “make a QR code according to my preferences”, or “generate a scannable QR code poster”.
  • The user wants to encode text, a URL, Wi-Fi configuration, or other UTF-8 content into a PNG QR code.
  • The user asks to “create a QR code”, “make a branded QR poster”, or “use my saved QR preferences”.

Do not activate when

Do not activate when

  • 用户要识别、反解或批量提取现有二维码内容;使用二维码识别能力。
  • 用户要装饰一张已有图片,但不需要生成二维码;交给
    lov-image-decorator
    。
  • 用户要生成插画、Logo 或改动二维码所指向的网页;交给对应图像或工程能力。
  • The user wants to identify, decode, or bulk-extract existing QR code content; use the QR code recognition capability.
  • The user wants to decorate an existing image but does not need a QR code generated; hand it off to
    lov-image-decorator
    .
  • The user wants to generate an illustration or Logo, or modify the webpage targeted by the QR code; hand it off to the appropriate image or engineering capability.

User Profile (cross-session)

User Profile (cross-session)

每次运行先读取
skill.yaml
和共享
user-profile/v1
。按当前请求、项目上下文、
skills.lov-create-qrcode.records
、共享 Preferences、品牌 Profile、安全默认值的顺序 解析配置。具体字段与允许值见
references/style-contract.md
。
只有用户直接声明的长期偏好才通过
scripts/profile_store.py record --confirm
保存; 推断自品牌资产、历史产物或当前项目的值只用于本次任务。不得保存二维码载荷、Wi-Fi 密码、token 或其他秘密。
At the start of every run, read
skill.yaml
and the shared
user-profile/v1
. Resolve configuration in this order: current request, project context,
skills.lov-create-qrcode.records
, shared Preferences, brand Profile, and safe defaults. See
references/style-contract.md
for the specific fields and allowed values.
Only long-term preferences explicitly stated by the user may be saved via
scripts/profile_store.py record --confirm
. Values inferred from brand assets, historical outputs, or the current project are used only for the current task. Do not store QR code payloads, Wi-Fi passwords, tokens, or other secrets.

Skill Group Composition

Skill Group Composition

运行前读取
references/skill-composition.md
。相邻 Skills 只通过图片、Logo 或已校验的 本地文件交接,不构成隐藏运行依赖。
Before running, read
references/skill-composition.md
. Adjacent Skills exchange only images, Logos, or validated local files and do not constitute hidden runtime dependencies.

Workflow (MANDATORY)

Workflow (MANDATORY)

Step 0: Resolve root, dependencies, and preferences

Step 0: Resolve root, dependencies, and preferences

  1. 从当前 Skill 上下文解析
    SKILL_DIR
    ,确认下列资源存在:
    • $SKILL_DIR/scripts/create_qrcode.py
    • $SKILL_DIR/scripts/profile_store.py
    • $SKILL_DIR/references/style-contract.md
    • $SKILL_DIR/references/skill-composition.md
  2. 读取
    skill.yaml
    与 Profile;不得把 Profile 中的私有路径或载荷写进 Skill 真源。
  3. 检查 Python、
    qrcode
    与 Pillow。用户要求扫码回读时还要检查 OpenCV。
  1. Resolve
    SKILL_DIR
    from the current Skill context and confirm that the following resources exist:
    • $SKILL_DIR/scripts/create_qrcode.py
    • $SKILL_DIR/scripts/profile_store.py
    • $SKILL_DIR/references/style-contract.md
    • $SKILL_DIR/references/skill-composition.md
  2. Read
    skill.yaml
    and the Profile; do not write private paths or payloads from the Profile into the Skill source of truth.
  3. Check Python,
    qrcode
    , and Pillow. If the user requests scan-back verification, also check OpenCV.

Step 1: Resolve the payload and visible output

Step 1: Resolve the payload and visible output

  • 保留用户提供内容的 UTF-8 字节,不擅自补协议、改大小写、去查询参数或缩短网址。
  • 私密载荷优先通过 stdin 或输入文件传入,避免写进 shell history。
  • 未指定样式时使用安全默认:
    rounded
    、
    classic
    、M 级纠错、4 modules quiet zone。
  • 默认只生成二维码方图,不添加 header、footer、标题、说明、边框海报或载荷明文。
  • 只有用户明确需要海报、标题或说明时启用
    --poster
    ;只有用户明确允许显示原始内容 时启用
    --show-data
    。不能因为品牌 Profile 存在名称就自行切换成海报。
  • 使用 Logo 时要求 H 级纠错,且 Logo 必须是用户有权使用的本地图片。
  • Preserve the UTF-8 bytes of the user-provided content. Do not add a protocol, change letter case, remove query parameters, or shorten a URL without instruction.
  • Pass private payloads via stdin or an input file where possible, to avoid writing them to shell history.
  • When no style is specified, use the safe defaults:
    rounded
    ,
    classic
    , M-level error correction, and a 4-module quiet zone.
  • By default, generate only a square QR code image, with no header, footer, title, caption, bordered poster, or plaintext payload.
  • Enable
    --poster
    only when the user explicitly requests a poster, title, or caption; enable
    --show-data
    only when the user explicitly allows the original content to be displayed. Do not switch to a poster merely because the brand Profile contains a name.
  • When using a Logo, require H-level error correction, and the Logo must be a local image that the user is authorized to use.

Step 2: Generate through the deterministic CLI

Step 2: Generate through the deterministic CLI

普通二维码:
bash
printf '%s' 'https://example.com' | python3 "$SKILL_DIR/scripts/create_qrcode.py" \
  --stdin --output ./qrcode.png --json
按 Profile 生成 Warm Academic 海报:
bash
printf '%s' 'https://example.com' | python3 "$SKILL_DIR/scripts/create_qrcode.py" \
  --stdin --poster --title '扫码访问' --show-data \
  --output ./qrcode-poster.png --verify scan --json
当前请求中的 flag 始终覆盖 Profile。需要完全忽略 Profile 时使用
--no-profile
。
Generate a regular QR code:
bash
printf '%s' 'https://example.com' | python3 "$SKILL_DIR/scripts/create_qrcode.py" \
  --stdin --output ./qrcode.png --json
Generate a Warm Academic poster according to the Profile:
bash
printf '%s' 'https://example.com' | python3 "$SKILL_DIR/scripts/create_qrcode.py" \
  --stdin --poster --title '扫码访问' --show-data \
  --output ./qrcode-poster.png --verify scan --json
Flags in the current request always override the Profile. Use
--no-profile
to completely ignore the Profile.

Step 3: Verify the actual artifact

Step 3: Verify the actual artifact

  1. 回读 JSON,确认绝对输出路径、PNG 尺寸、字节数、SHA-256、载荷字节数和载荷摘要。
  2. 至少完成结构校验;对公开交付、打印、Logo 或自定义低对比度样式使用
    --verify scan
    ,确认解码内容与输入逐字节一致。
  3. 检查 quiet zone 至少 4 modules、前景比背景更暗、图像没有被拉伸或覆盖。
  4. 海报需视觉检查标题、正文披露、留白与移动端可读性;不得把
    verification=structural
    写成已扫码验证。
  1. Read back the JSON and confirm the absolute output path, PNG dimensions, byte size, SHA-256, payload byte count, and payload digest.
  2. Complete at least structural validation. For public delivery, printing, Logos, or custom low-contrast styles, use
    --verify scan
    and confirm that the decoded content matches the input byte for byte.
  3. Check that the quiet zone is at least 4 modules, that the foreground is darker than the background, and that the image has not been stretched or covered.
  4. For posters, visually inspect the title, body-text disclosure, whitespace, and mobile readability; do not describe
    verification=structural
    as scan-verified.

Output contract

Output contract

  • 默认输出一个宽高等于
    size
    的纯二维码 PNG;不包含 header、footer 或海报包装。
  • 只有显式
    --poster
    才输出海报版;只有显式
    --force
    才允许覆盖精确目标。
  • --json
    返回输出路径、尺寸、样式、纠错级别、验证模式、载荷长度与摘要,不回显载荷。
  • 失败时不留下部分文件,并返回可诊断错误;扫码失败不能降级为成功。
  • By default, output a single plain QR code PNG whose width and height equal
    size
    ; include no header, footer, or poster wrapper.
  • Output the poster version only when
    --poster
    is explicitly specified; allow overwriting the exact target only when
    --force
    is explicitly specified.
  • --json
    returns the output path, dimensions, style, error-correction level, verification mode, payload length, and digest without echoing the payload.
  • On failure, leave no partial file and return a diagnosable error; a scan failure must not be downgraded to success.

Dependencies

Dependencies

  • Python 3.10+
  • qrcode
    7.4+ 与 Pillow 9+
  • OpenCV Python 可选,仅用于真实扫码回读
  • 不需要网络、浏览器、凭据或外部 sibling Skill
  • Python 3.10+
  • qrcode
    7.4+ and Pillow 9+
  • Optional OpenCV Python, used only for actual scan-back verification
  • No network, browser, credentials, or external sibling Skill is required

Runtime context (shared)

Runtime context (shared)

字段解析顺序为当前请求、项目上下文、Skill 记录、共享 Preferences、品牌 Profile、 安全默认值。直接声明的长期偏好才写入 Profile,并在结果中报告保存路径。
Field resolution order: current request, project context, Skill records, shared Preferences, brand Profile, and safe defaults. Only explicitly stated long-term preferences are written to the Profile, and the save path is reported in the result.