/shiny:shiny-nfcfrom shiny
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)
Ships in shiny. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in Shiny.Nfc, a .NET library that reads and writes NDEF NFC tags through one INfcManager.
Invoke this skill when the user wants to:
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.
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 |
using Shiny;
builder.Services.AddNfc();
Platforms/Android/AndroidManifest.xml):
<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="false" />
NFCReaderUsageDescription in Info.plist, and the entitlement with TAG (the App Store rejects NDEF
since the iOS 18 SDK; TAG covers NDEF sessions). Enable "NFC Tag Reading" on the App ID.
<!-- 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>
pcscd running and libpcsclite1 installed, plus the reader's CCID driver (pcsc_scan to check).<key>com.apple.security.smartcard</key><true/> in Entitlements.plist, or PC/SC
finds no readers.namespace Shiny.Nfc;
public interface INfcManager
{
NfcCapabilities Capabilities { get; } // None, ReadNdef, WriteNdef, MakeReadOnly, TagIdentifier (flags)
Task<AccessState> RequestAccess(CancellationToken ct = default);
IAsyncEnumerable<INfcTag> Scan(NfcScanOptions? options = null, CancellationToken ct = default);
}
public interface INfcTag
{
byte[]? Identifier { get; } // UID; null on iOS
bool IsWritable { get; }
int? MaxSize { get; } // encoded bytes; null when unknown
Task<NdefMessage?> ReadNdef(CancellationToken ct = default); // null = blank / no message
Task WriteNdef(NdefMessage message, CancellationToken ct = default);
Task MakeReadOnly(CancellationToken ct = default); // PERMANENT
}
public class NfcScanOptions { public string? AlertMessage { get; set; } } // iOS scan sheet text
// one-tap helpers (NfcManagerExtensions)
Task<NfcReadResult?> ReadOne(this INfcManager, NfcScanOptions? options = null, CancellationToken ct = default); // null = scan ended first
Task<bool> WriteOne(this INfcManager, NdefMessage message, NfcScanOptions? options = null, CancellationToken ct = default);
public record NfcReadResult(byte[]? Identifier, NdefMessage? Message);
public sealed class NdefMessage
{
public NdefMessage(params IEnumerable<NdefRecord> records);
public IReadOnlyList<NdefRecord> Records { get; }
public int Length { get; } // encoded size - compare with tag.MaxSize
public byte[] ToByteArray();
public static NdefMessage Parse(ReadOnlySpan<byte> data);
public static bool TryParse(ReadOnlySpan<byte> data, out NdefMessage? message);
}
public sealed class NdefRecord
{
public static NdefRecord CreateUri(string uri); // well-known U, prefix-compressed
public static NdefRecord CreateText(string text, string languageCode = "en", bool utf16 = false);
public static NdefRecord CreateMime(string mimeType, ReadOnlyMemory<byte> data);
public static NdefRecord CreateExternal(string domain, string type, ReadOnlyMemory<byte> data);
public static NdefRecord CreateAndroidApplication(string packageName); // AAR - opens/installs the app
public static NdefRecord CreateSmartPoster(string uri, string? title = null, string languageCode = "en");
public static NdefRecord CreateAbsoluteUri(string uri);
public NdefRecord(NdefTypeNameFormat tnf, ReadOnlyMemory<byte> type, ReadOnlyMemory<byte> payload, ReadOnlyMemory<byte> id = default);
public bool TryGetUri(out string? uri);
public bool TryGetText(out NdefText? text); // NdefText(Text, LanguageCode)
public bool TryGetSmartPoster(out NdefSmartPoster? poster); // NdefSmartPoster(Uri, Titles)
public string? MimeType { get; }
public NdefTypeNameFormat TypeNameFormat { get; }
public ReadOnlyMemory<byte> Type { get; }
public ReadOnlyMemory<byte> Payload { get; }
}
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).
using Shiny.Nfc; where INfcManager is injected and using Shiny; where AddNfc() is called.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).ReadOne() / WriteOne(message) - they do the work inside the loop.Scan throws InvalidOperationException. Pass a CancellationToken
(or break) to stop a continuous scan.Capabilities before showing NFC UI: None → hide it. Check RequestAccess() for Disabled (Android: NFC
off - send the user to Settings) and NotSetup (PC/SC: no reader plugged in yet).NfcTagLostException around 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.message.Length <= tag.MaxSize (when MaxSize is not null) before writing, or catch
NdefMessageTooLargeException.ReadNdef() returning null means a blank tag - not an error.MakeReadOnly() without explicit user confirmation - it can never be undone.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.public class TagViewModel(INfcManager nfc)
{
public async Task<string?> ReadUrl(CancellationToken ct)
{
if (nfc.Capabilities == NfcCapabilities.None)
return null;
var result = await nfc.ReadOne(new NfcScanOptions { AlertMessage = "Hold your phone near the tag" }, ct);
var record = result?.Message?.Records.FirstOrDefault();
return record != null && record.TryGetUri(out var uri) ? uri : null;
}
public async Task<bool> WriteUrl(string url, CancellationToken ct)
{
var message = new NdefMessage(NdefRecord.CreateUri(url));
try
{
return await nfc.WriteOne(message, ct: ct);
}
catch (NfcTagLostException)
{
return false; // ask the user to hold the tag still and try again
}
}
// continuous scanning - e.g. a check-in kiosk with a PC/SC reader
public async Task CheckIn(Func<string, Task> onTag, CancellationToken ct)
{
await foreach (var tag in nfc.Scan(ct: ct))
{
if (tag.Identifier is { } uid)
await onTag(Convert.ToHexString(uid));
}
}
}
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub shinyorg/skills --plugin shiny57 skills in this plugin
/localizegenGenerate strongly-typed localization classes from .resx resource files using Shiny.Extensions.Localization.Generator for .NET applications/shiny-accessorysetupGenerate code using Shiny.BluetoothLE.AccessorySetup - the system accessory pairing sheet for BLE devices (AccessorySetupKit on iOS 18+, CompanionDeviceManager on Android) with no MFi, no location prompt and no general Bluetooth prompt on iOS; picked accessories open as Shiny.BluetoothLE peripherals, and Android adds background presence (device appeared / disappeared) events/shiny-actorsGenerate code using Shiny.Actors — Orleans-style virtual actors without the ceremony, AOT/trim-clean, running anywhere .NET runs including .NET MAUI and Blazor WebAssembly. Covers actor interfaces and source-generated proxies, the ShinyActorBuilder (AddShinyActors), persistent state with ETags, named states and auto-save, event-sourced JournaledActor with snapshots, state and event migrations, typed streams (durable, implicit consumers), timers and persistent reminders (background jobs via Shiny.Jobs, on-time OS notifications via Shiny.Notifications), concurrency control ([Reentrant], [AlwaysInterleave], [ReadOnly], [StatelessWorker]), call filters and request context, OpenTelemetry traces and metrics, remoting over HTTP (Shiny.Net.HttpServer server, RemoteActorSystem client), mDNS discovery of actor servers, Shiny.DocumentDb storage (SQLite, PostgreSQL, IndexedDB...), and the ActorTestHost testing kit./shiny-agesignalsGenerate code using Shiny.AgeSignals to read the user's age range as the app store shares it - Apple Declared Age Range (iOS / macOS 26+) and Google Play Age Signals (Android) - for app store accountability laws (Texas SB 2420, Utah, Louisiana, California AB 1043) and age-gated features/shiny-aiconversationGenerate code for Shiny.AiConversation v3 - session-based AI conversations for .NET over Microsoft.Extensions.AI with persisted, resumable sessions (IAiSessionManager / IAiSession / IAiTurn), streaming replies, the built-in ask_user tool for typed questions and multiple-choice answers, interruption and supersession, usage and context-window pressure tracking, rolling context compaction, silent assistant memory, conversation search, session titles and long-term memory, session interceptors for tools and prompts, pluggable session/memory stores (in-memory or SQLite via Shiny.AiConversation.Stores.SqliteDocDb), and voice conversations via Shiny.AiConversation.Voice (wake word, push-to-talk, follow-up, quiet-word/barge-in interruption, sentence-streamed text-to-speech over Shiny.Speech, acknowledgement modes, sounds, voice selection tools), the MAUI chat UI via Shiny.AiConversation.Maui (AiChatView bound to a session with streaming bubbles, choice chips, push-to-talk and an AiMemoryView), image attachments with retention, and the use_camera tool via Shiny.AiConversation.Maui.Camera, and AG-UI via Shiny.AiConversation.AgUi (a session as an AG-UI event stream for the Shiny AgentView with ask_user questions as interrupts, the render_ui tool for A2UI surfaces, and a remote AG-UI agent as the chat client)/shiny-appdevicebridgeGenerate code using Shiny.AppDeviceBridge, device bridges on your app's own Shiny.Net.HttpServer that also host a web app (Blazor WebAssembly, React, Vue, any static build) inside a .NET MAUI app on Android, iOS, Mac Catalyst, Windows and the maui-labs macOS and Linux heads — served from a loopback HTTP server, updated over the air from a signed release server, GitHub releases or a provider of your own, and given device access through bridges with typed C# and TypeScript clientsOther plugins' skills for the same job