shinyorg/shiny/shiny-nfc
Claude Code and agent skill by shinyorg/shiny
- community
Checking that the SKILL.md file is still in the repository.
Generate code using Shiny.Nfc to read and write NDEF NFC tags (URLs, text, MIME, smart posters, Android app records) on Android, iOS, Windows / macOS / Linux PC/SC readers and Blazor WebAssembly (Web NFC)
Install
npx vskill@latest install shinyorg/shiny/shiny-nfcSKILL.md
The same SKILL.md was published earlier as shinyorg/shiny/shiny-nfc.
Shiny NFC Skill
You are an expert in Shiny.Nfc, a .NET library that reads and writes NDEF NFC tags through one INfcManager.
When to Use This Skill
Invoke this skill when the user wants to:
- Read a URL, text or custom payload from an NFC tag or sticker
- Write a message to a tag, or lock it permanently
- Use an NFC reader (ACR122U and other PC/SC readers) from a Windows, macOS or Linux app
- Use Web NFC from Blazor WebAssembly
NDEF only. Payment cards (EMV), passports, MIFARE Classic, raw tag commands (transceive, APDUs), host card emulation and peer-to-peer are out of scope - say so rather than generating code for them.
Library Overview
Documentation: https://shinylib.net/client/nfc/ Package: Shiny.Nfc Namespaces: Shiny.Nfc (types), Shiny (registration)
| Platform | Backend | Notes | |
|---|---|---|---|
| Android | NfcAdapter reader mode on the current activity | UID available; blank tags are formatted on first write | |
| iOS | CoreNFC NFCNDEFReaderSession | system scan sheet; no UID (Identifier is null); iPhone 7+ | |
| Windows, macOS, Linux | PC/SC contactless reader (winscard.dll, PCSC.framework, pcsc-lite) | NFC Forum Type 2 (NTAG, Ultralight) and Type 4; MIFARE Classic reads as no NDEF | |
| Blazor WebAssembly | Web NFC NDEFReader | Chrome on Android, secure context, user gesture | |
| Mac Catalyst, iOS simulator | - | Capabilities == None |
Registration
Required setup - always generate it
- Android (
Platforms/Android/AndroidManifest.xml):
``xml <uses-permission android:name="android.permission.NFC" /> <uses-feature android:name="android.hardware.nfc" android:required="false" /> ``
- iOS:
NFCReaderUsageDescriptionin Info.plist, and the entitlement with `TAG` (the App Store rejectsNDEF
since the iOS 18 SDK; TAG covers NDEF sessions). Enable "NFC Tag Reading" on the App ID. ``xml <!-- Info.plist --> <key>NFCReaderUsageDescription</key> <string>Reads and writes your NFC tags</string> <!-- Entitlements.plist --> <key>com.apple.developer.nfc.readersession.formats</key> <array><string>TAG</string></array> ``
- Linux:
pcscdrunning andlibpcsclite1installed, plus the reader's CCID driver (pcsc_scanto check). - Windows: nothing - plug in a PC/SC reader.
- macOS: a sandboxed app needs
<key>com.apple.security.smartcard</key><true/>in Entitlements.plist, or PC/SC
finds no readers.
API
Exceptions (all NfcException): NfcTagLostException (tag left the field), NfcTagReadOnlyException, NdefMessageTooLargeException (nothing written), NdefFormatException (invalid bytes on the tag), NfcNotSupportedException (platform / tag cannot do it - check Capabilities first).
Code Generation Instructions
- Add
using Shiny.Nfc;whereINfcManageris injected andusing Shiny;whereAddNfc()is called. - Always emit the platform setup above for every platform the app targets.
- A tag is only valid inside the `await foreach` body that received it. Never store an
INfcTag, return it from a
method, or use it after break. Keep tag.Identifier or the NdefMessage instead. Leaving the loop ends the session (dismisses the iOS sheet, stops reader mode).
- For a single read or write, use
ReadOne()/WriteOne(message)- they do the work inside the loop. - Only one scan at a time; a second concurrent
ScanthrowsInvalidOperationException. Pass aCancellationToken
(or break) to stop a continuous scan.
- Check
Capabilitiesbefore showing NFC UI:None→ hide it. CheckRequestAccess()forDisabled(Android: NFC
off - send the user to Settings) and NotSetup (PC/SC: no reader plugged in yet).
- Catch
NfcTagLostExceptionaround reads and writes and ask the user to hold the tag still. A write interrupted by a
lost tag may have destroyed the previous message.
- Check
message.Length <= tag.MaxSize(whenMaxSizeis not null) before writing, or catch
NdefMessageTooLargeException.
ReadNdef()returningnullmeans a blank tag - not an error.- Never call `MakeReadOnly()` without explicit user confirmation - it can never be undone.
- iOS: set
NfcScanOptions.AlertMessage("Hold your iPhone near the tag"); the user dismissing the sheet ends the loop
normally (ReadOne returns null). Don't generate UID-based logic for iOS - Identifier is null there.
- Blazor: start the scan from a button click (Web NFC needs a user gesture); a write goes to the next tag in range.
- Never use a tag UID as authentication - it is not secret and some phones randomise it.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/shiny-nfc/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/shinyorg/shiny/shiny-nfc)