🧪 Skills
NFC Tools
NFC tag discovery, inspection, and cautious write workflows using libnfc/nfc-utils; trigger when the user asks to read tags, inspect NDEF payloads, write or...
v1.0.0
Description
name: nfc-tools description: NFC tag discovery, inspection, and cautious write workflows using libnfc/nfc-utils; trigger when the user asks to read tags, inspect NDEF payloads, write or update NFC data, or automate tag batches with a PN532/ACR122 reader.
NFC tools
Quick start
- Validate that
libnfc/nfc-utilsis installed, the reader is powered, and the OS has udev rules or similar permissions (see README). - Run
scripts/check-nfc.shto confirm the CLI tools are onPATHandnfc-list --helpresponds before touching any hardware. - When the workspace reports hardware missing, follow the offline planning steps in
references/fallback.md.
UID privacy
- Redact tag UIDs and identifiers in user-visible prose and logs by default (e.g., replace with
<REDACTED UID>or[UID REDACTED]) so sensitive tag metadata does not leak. - Reveal the full UID only when the operation explicitly requires it (debugging, pairing details, or an explicit user request), and note the operational reason for unmasking if it is stored.
Discovery
- Run
nfc-listornfc-pollto enumerate connected readers and captureUID,Manufacturer, andFirmwarestrings; usenfc-list --verboseonly when you need to inspect driver options. - Keep tags awake by issuing
nfc-pollonce per interaction window; capture signal strength (RSSI) and technology (ISO14443A/B,MIFARE Classic, etc.) before further commands. - Use
nfc-taginfo -vornfc-taginfo -tto surfaceNDEF/MIFAREblock layout, sector keys, and tag capacity without modifying the tag.
Reading a tag
- Choose the reader connection string from
nfc-listoutput (e.g.,pn532_uart:/dev/ttyACM0) and setLIBNFC_DEVICEif multiple readers exist. - Use
nfc-ndefcat --listfor NDEF tags,nfc-mfultralight r 0 64 dump.ulfor Ultralight blocks, ornfc-mfclassic r a dump.mfdfor MIFARE Classic sectors (supply the correct key file or default key bundle). - Always export a binary/hex dump before proposing edits so the user can refer to the exact pre-write state; include the dump path in your reasoning and mention its layout when answering the request.
Writing a tag (safety-critical)
- Confirm the tag UID, target reader, and exact block(s)/records that will be overwritten. Ask the user to reply with
CONFIRM NFC WRITE(uppercase and exact) before initiating any write. - Create a validated payload file (e.g.,
payload.ndef,payload.ul,payload.mfd) and, when feasible, preview it withndef-tool dump payload.ndeforxxdto avoid surprises. - For Ultralight tags, write with
nfc-mfultralight w 0 payload.ul; for MIFARE Classic, usenfc-mfclassic w a payload.mfdfollowed bynfc-mfclassic c a payload.mfdif only certain blocks change. When writing NDEF content, prefer to generate the final TLV blob withndef-tool(libndef) or an equivalent helper before feeding it to a writer command so the record size/CRC stay intact. - After writing, re-run the appropriate read command (
nfc-ndefcat,nfc-mfultralight, ornfc-mfclassic) to verify the payload matches the desired file before declaring success. - Never invent tag writes; each request must include the explicit confirmation in step 1 before running a destructive command.
Erasing, formatting, or resetting a tag (safety-critical)
- When an operation will erase, reformat, or reset the tag (e.g.,
ndef-tool format,nfc-mfclassic wipe, sector reformat, or block resets), document the desired empty or reinitialized state and the commands that will enforce it. - Ask the user to reply with
CONFIRM NFC FORMAT(uppercase and exact) before running any such command; treat this as a second gate in addition toCONFIRM NFC WRITEand do not proceed without both confirmations if the workflow also rewrites the tag. - Execute the confirmed erase/format command with the validated payload or zeroing steps and monitor the CLI output for success flags or errors.
- Re-run the appropriate read command (
nfc-ndefcat,nfc-mfultralight,nfc-mfclassic, ornfc-taginfo) to prove the tag is blank or reset as requested before reporting completion.
When hardware is missing
- Refer to
references/fallback.mdto plan tag contents, preview binary dumps, and surface manual conversion steps (e.g., buildingndef-tooldata from templates) so a human can run the write once the NFC reader becomes available. - Document the missing hardware state, mention which reader/device was expected, and set expectations for when the physical NFC reader can be reconnected.
Resources
scripts/check-nfc.sh: sanity-check script that validates the presence ofnfc-list,nfc-poll, andnfc-taginfobefore any workflow.references/fallback.md: offline planning guide for tag payload design when hardware or drivers are unavailable.
Reviews (0)
Sign in to write a review.
No reviews yet. Be the first to review!
Comments (0)
No comments yet. Be the first to share your thoughts!