---
name: qr-code
description: >
  Generate QR codes from URLs, Wi-Fi credentials, contacts (vCard), email/SMS links,
  or plain text and deliver the image inline. Trigger phrases: "QR code", "generate a
  QR", "create a QR", "make a QR code for", or any request to share data as a scannable code.
---

# QR Code Generation

Generate QR codes from user-provided data and deliver the resulting image inline in conversation.

## When to Activate

- User asks to generate, create, or make a QR code
- User wants to share a URL, Wi-Fi password, or contact details as a scannable code
- Any mention of "QR" in the context of creating one

## Behaviour

Infer the data type from the user's input. For structured types (Wi-Fi, vCard), collect any missing fields conversationally and confirm the structured data before encoding. For simple types (URL, plain text, email, SMS), encode directly.

Generate the QR image by piping the encoded string to the `qrcode` CLI via stdin — never interpolate user data into the shell command. Save the output as PNG to `/tmp/` and present the file to the user.

If the CLI exits with an error, report the error message to the user and suggest corrections (e.g., data too long, invalid format).

## Boundaries

- Generates one QR code per request. Bulk generation is not supported.
- No branded/styled QR codes (logo overlays, custom colours).
- Does not scan or read existing QR codes.

## References

Load `references/data-formats.md` for encoding formats, CLI invocation patterns, and supported options.
