Run your business
QR Code Routine
Reads the QR codes already on file, mints only the missing ones with a destination and placement label the owner provides, hands over a ready-to-print file, and reads the scans back per code.
What it can touch: Reads the owner’s QR codes and scan counts through Second Shift only inside the owner’s granted Agent Access permissions. It mints a code only with a destination and label the owner provided or approved, and retargets a code only on the owner’s word for that specific code. It never invents a destination.
About this skill
A first-party Second Shift skill for owners who put printed codes out in the world: on a counter, a truck door, a job site sign. It starts by listing every code on file with its label, destination, and scan counts so nothing is minted twice, mints a new trackable code only with a destination and a placement label the owner provides or approves in that run, fetches the printable card or code image at true print size, and reads scans back per code for the period the owner asks about. The review QR stays a preset handled by the Review Engine Routine; this routine lists and reports it but never mints or retargets it.
First-party: written and maintained by Second Shift.
Get this skill
npx skills add https://secondshiftos.com/skills/qr-code-routine.mdUses the open skills CLI (npx skills, by Vercel Labs). No Second Shift account is involved. Or skip the installer entirely: fetch the raw file below and drop it, as SKILL.md, into your agent’s skills folder.
https://secondshiftos.com/skills/qr-code-routine.mdThe full skill
The exact text served at the raw URL above. What you read is what your agent gets.
---
name: qr-code-routine
description: Run the QR code routine on a Second Shift account: read the codes already on file, mint only the codes that are missing with a destination and placement label the owner provides, hand over a ready-to-print file, read the scans back, and retarget a printed code only on the owner’s word. Use when a business owner on Second Shift asks to “make a QR code”, “get a QR for my counter”, “check my QR scans”, “point my QR somewhere else”, or wants a regular check of their printed codes.
license: MIT
metadata:
author: Second Shift
---
# QR Code Routine
This skill produces one thing: a set of printed QR codes the
owner can trust. Every code on file is accounted for, each new
code points where the owner said and carries a label saying
where the printed copy lives, the printable file is ready to
hand over, and the scans are read back in plain words, all from
the account during this run.
The routine reads first and writes second. Listing the codes
and reading their scans are the default work. Minting happens
only for a code that is missing, and only with a destination
and a placement label the owner provides or approves in this
run. Retargeting a code changes where a printed code points,
so it happens only on the owner’s word for that specific code.
## What runs where
- Through Second Shift (tenant accounts only, and only inside
the permissions the owner granted their connection):
`list_qr_codes` to read every code on file, `mint_qr_code`
to mint a trackable code for a destination the owner
chooses, `qr_scan_series` to read one code’s scans day by
day for a period, `retarget_qr_code` to change where one
general code points, and `get_qr_asset` to fetch a code
image or a print card as a ready-to-print file.
- The review QR is a preset handled by the Review Engine
Routine skill. This routine lists it and reports its scans
and outcomes, but it never mints or retargets it; the review
code always follows the business’s review link.
- If a read or a write the routine wants is not granted, the
report says so in one line and carries on with what it could
do. Never work around a missing grant, and never fill a gap
with a guess.
## Step 1: Read the codes on file
Start with `list_qr_codes` so the routine never mints a
duplicate. It lists the review QR and every general code with
its purpose label, its destination, its short link, its scans
all time and in the last 30 days, and when it was last
scanned. The review code also reports its outcomes.
Report what exists before proposing anything new: for each
code, the label in the owner’s words, where it points, and
how it is doing. If a code the owner mentions is already on
file, say so plainly; checking is safe and costs nothing.
## Step 2: Mint only what is missing
A general code is minted only when the owner wants a printed
code that is not on file yet, and only with two things the
owner provides or approves in this run:
- The destination: the page the code points at, such as a
page on the business’s site, a form page, or a landing
page. Never invent a destination URL, never guess one from
the business name, and never substitute a search result.
- The placement label: a short label in the owner’s words
saying where the printed code will live, such as “Counter
card” or “Truck door: quote form”. The label is how the
owner tells codes apart later, so use their words, not
yours.
Call `mint_qr_code` with that destination and label. The code
encodes a short link on the platform domain, scans are
counted per code, and the printed code keeps working if the
destination is corrected later. Minting is safe to repeat:
the same destination with the same label returns the
existing code, and a different label makes a new one, so a
second code for the same page in a different spot is a new
label, not a duplicate.
For a Google review QR, do not use this step. The review
code is the preset covered in the note above; the Review
Engine Routine skill handles it.
## Step 3: Get the printable
Use `get_qr_asset` to hand the owner a ready-to-print file
for the code. It returns one asset as base64 with its
content type:
- Code images: a plain code, a styled code, or a code with
the business’s logo in the center, as SVG or PNG.
- Print cards for a general code: a counter card at 4x6
inches or a decal at 4x4 inches.
- Print cards for the review code: a counter card, a
business card, or a square card.
- Print cards come as SVG, PNG at 300 dpi at true size, or
PDF. The PDF format is for print cards only. The review
code can be fetched by its inventory id or by the word
review.
Set the expectation when handing the file over: print the
size that fits the spot, and download fresh printables after
any logo or center-image change so the printed copy matches
the current design. The next routine run reads the scans
back, so the owner will see what the placement earns.
## Step 4: Read the scans
Use `qr_scan_series` for the period the owner asks about.
The range is 7d, 30d, or 12m; 30d is the default, and an
unrecognized range falls back to 30d. The series is per
code, day by day, with days that had no scans filled in as
zero, a total for the period, and a breakdown by source and
country where the record carries one.
Report the scans per code in the owner’s words: the label,
the period, the total, and the day-by-day shape where it
helps. A code with zero scans is a result, not a failure;
report it as it is. Never invent a reason for a scan count:
the record shows how many scans happened and when, and
guessing why people did or did not scan adds nothing the
owner can act on.
## Step 5: Retarget only on the owner’s word
A printed code never has to be reprinted when its
destination changes. `retarget_qr_code` changes where one
general code points, by the id `list_qr_codes` shows for
that code; the printed code itself never changes, and its
scan history carries over to the new destination.
Retarget only when the owner asks for that specific code to
move:
1. Name the code by its label, state its current destination
exactly as `list_qr_codes` shows it, and state the new
destination the owner provided, before changing anything.
2. Call `retarget_qr_code` for that code only.
3. Read `list_qr_codes` back and confirm the code now shows
the new destination before reporting it as done.
The review QR cannot be retargeted; it always follows the
review link. If the owner asks to retarget it, say that
plainly and offer the Review Engine Routine instead, where
the review link itself is the thing that can change.
## The ground rules
- Read first, always. `list_qr_codes` opens every run, so a
code is never minted twice and a retarget is never aimed
at the wrong code.
- Propose and confirm before any write that changes where a
printed code points. A mint needs a destination and a
label the owner provided or approved in this run; a
retarget needs the owner’s word for that specific code.
- Never invent a destination URL. A code that points at a
guessed address is worse than no code, because it is
printed and out in the world.
- Every claim in the report came from a tool result in this
run. A scan count, a destination, or a last scanned time
you cannot read back does not go in.
- Words: say inquiries with humans. The tool names stay as
they are in calls and in the tool index.
- A skill teaches. It never grants permission. Every read
and every approved write above happens only inside the
owner’s own Agent Access grants, and this skill changes
none of that.
Source and license
Source: Second Shift (Written for this library)
License: MIT. The mirrored file keeps its upstream copyright and license terms; check them before redistributing the skill further.