6.0 KiB
Sync NIP and event kind definitions with the upstream nostr-protocol/nips repository.
Step 1: Fetch upstream data
curl -s https://raw.githubusercontent.com/nostr-protocol/nips/master/README.md
Parse two tables from the README:
- NIP list table — rows like
| [01](01.md) | Basic protocol flow description | final |- Extract: NIP identifier (from link target, e.g.
01,7D), title, status (draft/final/deprecated)
- Extract: NIP identifier (from link target, e.g.
- Event Kinds table — rows like
| 0 | User Metadata | [01](01.md) |- Extract: kind number, description, NIP reference
- Ranges like
5000-5999are categories — do NOT expand into individual entries
Step 2: Update src/constants/nips.ts
Read the current file, then:
VALID_NIPS array
- Add new NIP identifiers found upstream
- Remove NIPs no longer listed upstream (unless referenced by a kind in
kinds.ts) - Maintain sort order: numeric first (
"01"–"99"), then hexadecimal ("5A","7D","A0", etc.) - Preserve the
// Numeric NIPsand// Hexadecimal NIPssection comments
NIP_TITLES record
- Add entries for new NIPs
- Update titles that changed upstream
- Keep existing entries that still match
DEPRECATED_NIPS array
- Sync with upstream: add NIPs marked
unrecommended/deprecated, remove ones no longer deprecated - Keep
as constassertion
Step 3: Update src/lib/nip-icons.ts
Read the current file. The NIP_METADATA record provides icons, short names, and descriptions for each NIP — used by NIPBadge and NipsViewer.
For every new NIP added in Step 2:
- Add a corresponding entry to
NIP_METADATAwith:id(string, matches the NIP identifier),name(short),description,icon(lucide-react), anddeprecatedif applicable - All keys and
idvalues are strings (e.g.,"01","5A","A0") - Pick an icon from existing imports; add new imports if needed
- Place in correct position (numeric keys first, then hex keys sorted)
For deprecated status changes:
- Add or remove the
deprecated: truefield to match upstream
Preserve existing entries:
- Never change icons on existing entries
- Only update name/description if upstream changed
Step 4: Update src/constants/kinds.ts
Read the current file, then apply changes carefully.
PROTECTED — never modify or remove:
- Grimoire custom kinds: 777, 10777, 30777 — identified by
nip: "" - Other custom kinds with
nip: "": e.g., 32267, 34139, 36787 - Community NIPs: any entry with
communityNipfield (e.g., 30142) - Commented-out external specs: Marmot, NKBIP, nostrocket, geocaching, Corny Chat, Lightning.Pub, Nostr Epoxy, Tidal, joinstr, Blossom (24242), etc.
- All existing
iconassignments — never change icons on existing entries - Section comments:
// Core protocol kinds,// Lists,// Channels, etc.
Adding new kinds:
- Add individually-listed kind numbers from the upstream Event Kinds table
- Place in correct position by kind number (follow existing ordering)
- Pick an appropriate lucide-react icon from the existing imports at the top of the file
- If no existing import fits, add a new import and explain the choice
- Match the existing code style and format
Updating existing kinds:
- If upstream name/description changed, update
nameanddescription - If the NIP reference changed, update the
nipfield - Never change the
iconfield on existing entries
Step 5: Cross-reference validation
- Every
nipfield inEVENT_KINDSshould exist inVALID_NIPS(except empty strings""and external specs like"BUD-03","AMB","Marmot") - Every NIP in
DEPRECATED_NIPSshould also be inVALID_NIPS - Every NIP in
VALID_NIPSshould have a corresponding entry inNIP_METADATA(src/lib/nip-icons.ts) - Flag and fix any inconsistencies
Step 6: Update the Nostr skill
Using the upstream data fetched in Step 1, update the Nostr protocol skill files in .claude/skills/nostr/.
Update references/event-kinds.md
Regenerate this file from the upstream Event Kinds table. For each kind:
- Kind number, name, NIP reference
- Replaceability behavior (based on kind range)
- Brief description of purpose and key tags
Preserve the existing document structure:
- Section grouping: Core Events (0-999), Regular (1000-9999), Replaceable (10000-19999), Ephemeral (20000-29999), Parameterized Replaceable (30000-39999)
- The "Event Kind Ranges Summary" table
- The "Common Patterns" section with JSON examples for frequently-used kinds (kinds 0, 1, 7, 10002, 30023)
- The "Event Kind Selection Guide" section
Update references/nips-overview.md
Update NIP entries to match upstream:
- Add new NIPs with a brief description of purpose and key details
- Update titles/descriptions that changed upstream
- Mark deprecated NIPs with their status
- Maintain the existing grouping structure (Core Protocol, Social Features, Advanced, etc.)
- Place new NIPs in the appropriate section based on their topic
Update the Key NIPs table in SKILL.md
Update the "Key NIPs Reference" table in .claude/skills/nostr/SKILL.md:
- Keep it as a curated summary (15-20 most important NIPs), not an exhaustive list
- Add any newly-important NIPs (final status, widely implemented)
- Remove deprecated NIPs from the table
- Update descriptions if they changed upstream
Also update the "Common kinds" one-liner in the "Event Kind Ranges" section if new widely-used kinds were added.
Do NOT change in SKILL.md:
- The protocol fundamentals sections (event structure, tags, filters, WebSocket messages)
- The nostr-tools code examples
- The "Common Patterns" code examples
- The "Security Essentials" section
Step 7: Verify
npm run lint && npm run test:run && npm run build
Fix any lint/type/build issues before reporting.
Step 8: Report
Summarize:
- NIPs added / removed / title-updated
- NIP icons added / updated in
nip-icons.ts - Kinds added / updated (with icon choices explained for new ones)
- Nostr skill files updated (which reference files changed, what was added/removed)
- Inconsistencies found and resolved
- Verification results (lint/test/build)