--- name: relay-management description: Add a UI for users to view, add, remove, and configure their NIP-65 relay list with per-relay read/write permissions. Publishes kind 10002 events via useNostrPublish and keeps AppContext in sync. --- # Relay List Manager (NIP-65) This skill provides `RelayListManager`, a drop-in settings UI that lets the user inspect and edit their NIP-65 relay list. Each row has a URL plus read/write switches, with an add/remove flow and automatic NIP-65 (kind 10002) publishing when the user is logged in. **The underlying NIP-65 relay state is already active in the template** — it lives in `AppContext`, is synced on login by `NostrSync`, and persists to local storage. This skill only adds the *UI* for managing that state; the core wiring stays untouched. **This component is not included in the project by default.** When the user wants a relay settings screen, follow the setup instructions below to install the component. ## Files Provided by This Skill | Skill file | Copy to | |---|---| | `files/components/RelayListManager.tsx` | `src/components/RelayListManager.tsx` | ## Setup Instructions ### 1. Dependencies No extra npm packages are required. The component uses packages already present in the template: - `lucide-react` — icons (`Plus`, `X`, `Wifi`, `Settings`) - shadcn/ui — `Button`, `Input`, `Label`, `Switch`, `Popover` ### 2. Copy the Skill File Into `src/` Copy `.agents/skills/relay-management/files/components/RelayListManager.tsx` into `src/components/RelayListManager.tsx`. The component imports: - `@/hooks/useAppContext` — reads and updates `config.relayMetadata.relays` - `@/hooks/useCurrentUser` — determines whether to publish a NIP-65 event on change - `@/hooks/useNostrPublish` — publishes kind 10002 events - `@/hooks/useToast` — user feedback All of these are standard in the template; no extra work is needed beyond copying the file. ## Usage Drop the component anywhere you want a relay settings panel — typically a dedicated settings page: ```tsx import { RelayListManager } from '@/components/RelayListManager'; export default function SettingsPage() { return (