SuperAPI AI Directory

lov-create-qrcode

Office & productivity

View repository

Updated 10-16 00:01

About this skill

lov-create-qrcode

Deterministically generate a QR code from a piece of content, or generate a Warm Academic poster PNG on demand. By default, output only the QR code itself, without a header, footer, title, or plaintext; colors, modules, size, error correction, and poster options can be overridden by the current request or a shared Profile.

Triggers

Activate when

  • The user says "generate a QR code from this link," "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

  • The user wants to recognize, decode, or batch-extract existing QR code content; use QR code recognition capabilities.
  • The user wants to decorate an existing image but does not need to generate a QR code; hand it off to lov-image-decorator。
  • The user wants to generate an illustration, Logo, or modify the webpage that the QR code points to; hand it off to the corresponding image or engineering capability.

User Profile (cross-session)

At each run, first read skill.yaml and the shared user-profile/v1. Resolve configuration in the order of the current request, project context, skills.lov-create-qrcode.records, shared Preferences, brand Profile, and safe defaults. For specific fields and allowed values, see references/style-contract.md。

Only long-term preferences directly declared by the user are saved through scripts/profile_store.py record --confirm ; values inferred from brand assets, historical artifacts, or the current project are used only for this task. QR code payloads, Wi-Fi passwords, tokens, or other secrets must not be saved.

Skill Group Composition

Before running, read references/skill-composition.md. Adjacent Skills are handed off only through images, Logos, or verified local files, and do not constitute hidden runtime dependencies.

Workflow (MANDATORY)

Step 0: Resolve root, dependencies, and preferences

  1. Resolve SKILL_DIRfrom 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; private paths or payloads in the Profile must not be written 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

  • Preserve the UTF-8 bytes of the content provided by the user; do not arbitrarily add a protocol, change case, remove query parameters, or shorten a URL.
  • Pass private payloads via stdin or an input file whenever possible to avoid writing them into shell history.
  • When no style is specified, use safe defaults:rounded、classic, M-level error correction, 4 modules quiet zone.
  • By default, generate only a square QR code image, without adding a header, footer, title, caption, bordered poster, or plaintext payload.
  • Enable --posteronly when the user explicitly needs a poster, title, or caption; enable --show-dataonly when the user explicitly permits displaying the original content. Do not switch to a poster on your own just because a name exists in a brand Profile.
  • When using a Logo, H-level error correction is required, and the Logo must be a local image that the user has the right to use.

Step 2: Generate through the deterministic CLI

Ordinary QR code:

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:

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. To completely ignore the Profile, use --no-profile。

Step 3: Verify the actual artifact

  1. Read back the JSON and confirm the absolute output path, PNG dimensions, byte count, SHA-256, payload byte count, and payload digest.
  2. At minimum, complete structural validation; for public delivery, printing, Logos, or custom low-contrast styles, use --verify scanto confirm that the decoded content is byte-for-byte identical to the input.
  3. Check that the quiet zone is at least 4 modules, the foreground is darker than the background, and the image is not stretched or covered.
  4. The poster requires visual inspection of the title, body disclosure, whitespace, and mobile readability; it must not be written as verification=structural as already scan-verified.

Output contract

  • By default, output a pure QR code PNG whose width and height equal size ; it does not include a header, footer, or poster wrapper.
  • Only an explicit --poster outputs the poster version; only an explicit --force allows overwriting the exact target.
  • --json Return the output path, dimensions, style, error correction level, verification mode, payload length, and digest, without echoing the payload.
  • On failure, do not leave partial files, and return a diagnosable error; a scan failure must not be downgraded to success.

Dependencies

  • Python 3.10+
  • qrcode 7.4+ and Pillow 9+
  • OpenCV Python is optional and is used only for real scan readback
  • No network, browser, credentials, or external sibling Skill is required

Runtime context (shared)

The field resolution order is the current request, project context, Skill records, shared Preferences, brand Profile, and secure defaults. Only directly declared long-term preferences are written to the Profile, and the save path is reported in the result.