--- name: edit-profile description: Add a form that lets users edit their Nostr profile metadata (NIP-01 kind 0). Provides EditProfileForm with fields for name, about, picture, banner, website, nip05, and a bot flag, plus Blossom image uploads wired up through useUploadFile. --- # Edit Profile Form This skill provides `EditProfileForm`, a drop-in React component that lets a logged-in user update their Nostr profile metadata (NIP-01 kind 0). The form covers the common metadata fields, handles image uploads through the project's existing `useUploadFile` hook, publishes a new kind 0 event on save, and invalidates the relevant TanStack Query caches so the rest of the app reflects the change. **This component is not included in the project by default.** When the user wants profile editing, follow the setup instructions below to install the component. ## Files Provided by This Skill | Skill file | Copy to | |---|---| | `files/components/EditProfileForm.tsx` | `src/components/EditProfileForm.tsx` | ## Setup Instructions ### 1. Dependencies No extra npm packages are required. The component uses packages already present in the template: - `react-hook-form` + `@hookform/resolvers` — form state and validation - `zod` (via `NSchema` in `@nostrify/nostrify`) — metadata schema validation - `@tanstack/react-query` — cache invalidation after publish - `@nostrify/nostrify` — `NSchema.metadata()` Zod schema + `NostrMetadata` type - `lucide-react` — icons - shadcn/ui — `Button`, `Form`, `Input`, `Textarea`, `Switch` ### 2. Copy the Skill File Into `src/` Copy `.agents/skills/edit-profile/files/components/EditProfileForm.tsx` into `src/components/EditProfileForm.tsx`. The component imports: - `@/hooks/useCurrentUser` — current logged-in user and their existing metadata - `@/hooks/useNostrPublish` — publishes the kind 0 event - `@/hooks/useToast` — success/error feedback - `@/hooks/useUploadFile` — Blossom uploads for picture/banner All of these are standard in the template; no extra work is needed beyond copying the file. ## Usage Place the component anywhere a logged-in user should be able to edit their profile. It renders the form itself, with no surrounding layout: ```tsx import { EditProfileForm } from '@/components/EditProfileForm'; export default function EditProfilePage() { return (