diff --git a/.claude/skills/nostr-comments/SKILL.md b/.claude/skills/nostr-comments/SKILL.md index 1ca9064..45feaa1 100644 --- a/.claude/skills/nostr-comments/SKILL.md +++ b/.claude/skills/nostr-comments/SKILL.md @@ -1,11 +1,11 @@ --- name: nostr-comments -description: Implement Nostr comment systems, add discussion features to posts/articles, or build community interaction features. +description: Implement Nostr comment systems, add discussion features to posts/articles, build community interaction features, or attach comments to any external content identifier including URLs, hashtags, and NIP-73 identifiers (ISBN, podcast GUIDs, geohashes, movie ISANs, blockchain transactions, and more). --- # Adding Nostr Comments Sections -The project includes a complete commenting system using NIP-22 (kind 1111) comments that can be added to any Nostr event or URL. The `CommentsSection` component provides a full-featured commenting interface with threaded replies, user authentication, and real-time updates. +The project includes a complete commenting system using NIP-22 (kind 1111) comments that can be added to any Nostr event, URL, hashtag, or NIP-73 external content identifier. The `CommentsSection` component provides a full-featured commenting interface with threaded replies, user authentication, and real-time updates. ## Basic Usage @@ -29,7 +29,10 @@ function ArticlePage({ article }: { article: NostrEvent }) { The `CommentsSection` component accepts the following props: -- **`root`** (required): The root event or URL to comment on. Can be a `NostrEvent` or `URL` object. +- **`root`** (required): The root to comment on. Accepts three types: + - `NostrEvent` — comment on a Nostr event (kind 1 note, long-form article, etc.) + - `URL` — comment on an external identifier: web URLs (`new URL("https://...")`) or any NIP-73 identifier except hashtags (e.g. `new URL("isbn:9780765382030")`, `new URL("iso3166:US")`) + - `#${string}` — NIP-73 hashtag only (e.g. `"#bitcoin"`); this template string type is exclusively for hashtags and must not be used for other NIP-73 identifiers - **`title`**: Custom title for the comments section (default: "Comments") - **`emptyStateMessage`**: Message shown when no comments exist (default: "No comments yet") - **`emptyStateSubtitle`**: Subtitle for empty state (default: "Be the first to share your thoughts!") @@ -49,7 +52,7 @@ The `CommentsSection` component accepts the following props: ## Commenting on URLs -The comments system also supports commenting on external URLs, making it useful for web pages, articles, or any online content: +The comments system supports commenting on external URLs, making it useful for web pages, articles, or any online content: ```tsx ``` + +## Commenting on Hashtags + +Pass a hashtag string (`#${string}` format) to attach comments to a topic. The hashtag must be lowercase: + +```tsx +// Comments for the #bitcoin hashtag + + +// Comments for a community-specific tag + +``` + +## Commenting on NIP-73 External Content Identifiers + +NIP-73 defines a standard set of external content IDs. All NIP-73 identifiers (except hashtags) are passed as `URL` objects — the identifier string is used directly as the URL: + +### Books (ISBN) + +```tsx +// ISBN must be without hyphens + +``` + +### Podcasts + +```tsx +// Podcast feed + + +// Podcast episode + +``` + +### Movies (ISAN) + +```tsx +// ISAN without version part + +``` + +### Geohashes + +```tsx +// Geohash must be lowercase + +``` + +### Countries (ISO 3166) + +```tsx +// ISO 3166 codes must be uppercase + + +// Subdivision (state/province) + +``` + +### Academic Papers (DOI) + +```tsx +// DOI must be lowercase + +``` + +### Blockchain Transactions and Addresses + +```tsx +// Bitcoin transaction + + +// Ethereum address + +```