Token导航 LogoToken导航

Agent Skill · 研究检索

nostr-relay-builder(诺斯特继电器建设者)

nostr-relay-builder 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

nostr-relay-builder 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,674 个 Skill 里排第 69,522。

总安装 218周安装 9GitHub Stars 4下载 71核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:nostr-relay-builder(诺斯特继电器建设者)
来源仓库:https://github.com/accolver/skill-maker
仓库路径:skills/nostr-relay-builder
安装命令:
npx skills add https://github.com/accolver/skill-maker --skill nostr-relay-builder
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/accolver/skill-maker --skill nostr-relay-builder

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于查找、检索和筛选相关信息,快速定位候选结果。适合在关键词搜索、任务场景或来源线索下使用,提升信息获取效率。可结合来源仓库和原始 README 核验具体用法,确保适用性。安装方式:通过 npx 从 GitHub 仓库添加,支持 Codex、Claude、Cursor、Gemini CLI。

注意:安装前建议确认权限范围和维护状态,避免触发不必要的联网或文件操作。

来源仓库内路径:skills/nostr-relay-builder

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/accolver/skill-maker --skill nostr-relay-build…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

nostr-relay-builder 怎么安装?

在终端执行 npx skills add https://github.com/accolver/skill-maker --skill nostr-relay-builder。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

nostr-relay-builder 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

nostr-relay-builder 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

nostr-relay-builder 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

nostr-relay-builder 用的人多吗?

公开数据是累计安装 218 次,近一周安装 9 次,下载 71 次,GitHub 4 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

nostr-relay-builder 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
nostr-relay-builder

诺斯特继电器建设者 · 本页

2184需要联网未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Nostr Relay Builder

Build a Nostr relay from scratch: WebSocket server, NIP-01 message protocol, event validation (id + signature), filter matching, subscription management, and progressive NIP support.

Overview

A Nostr relay is a WebSocket server that receives, validates, stores, and distributes events. This skill walks through building one step by step, starting with the mandatory NIP-01 protocol and progressively adding optional NIPs.

When to use

  • The task is implementing or extending a Nostr relay server.
  • The user needs relay-side handling for WebSocket messages, event validation, storage rules, subscriptions, or relay-supported NIPs.
  • The problem lives on the server side of the protocol, not in a client app.
  • The output should shape relay behavior, persistence, or message handling.

Do NOT use when:

  • The task is building a Nostr client.
  • The work is only constructing events or filters for client use.
  • The request is NIP-05 identity hosting rather than relay protocol behavior.

Response format

Always structure the final response with these top-level sections, in this order:

  1. Summary — state the task, scope, and main conclusion in 1-3 sentences.
  2. Decision / Approach — state the key classification, assumptions, or chosen path.
  3. Artifacts — provide the primary deliverable(s) for this skill. Use clear subheadings for multiple files, commands, JSON payloads, queries, or documents.
  4. Validation — state checks performed, important risks, caveats, or unresolved questions.
  5. Next steps — list concrete follow-up actions, or write None if nothing remains.

Rules:

  • Do not omit a section; write None when a section does not apply.
  • If files are produced, list each file path under Artifacts before its contents.
  • If commands, JSON, SQL, YAML, or code are produced, put each artifact in fenced code blocks with the correct language tag when possible.
  • Keep section names exactly as written above so output stays predictable across skills.

Workflow

1. Set up the WebSocket server

Create a WebSocket endpoint that accepts connections. The relay MUST:

  • Accept WebSocket upgrade requests on the root path
  • Handle multiple concurrent connections
  • Track per-connection state (subscriptions, auth status)
  • Implement ping/pong for connection health
  • Parse incoming messages as JSON arrays
// Bun example — minimal WebSocket server
Bun.serve({
  port: 3000,
  fetch(req, server) {
    // NIP-11: serve relay info on HTTP GET with Accept: application/nostr+json
    if (req.headers.get("Accept") === "application/nostr+json") {
      return Response.json(relayInfo, {
        headers: {
          "Access-Control-Allow-Origin": "*",
          "Access-Control-Allow-Headers": "Accept",
          "Access-Control-Allow-Methods": "GET",
        },
      });
    }
    if (server.upgrade(req)) return;
    return new Response("Connect via WebSocket", { status: 400 });
  },
  websocket: {
    open(ws) {
      ws.data = { subscriptions: new Map() };
    },
    message(ws, raw) {
      handleMessage(ws, JSON.parse(raw));
    },
    close(ws) {/* cleanup subscriptions */},
  },
});

2. Implement the NIP-01 message protocol

Handle the three client message types and respond with the five relay message types. See references/message-protocol.md for the complete format reference.

function handleMessage(ws, msg: unknown[]) {
  const verb = msg[0];
  switch (verb) {
    case "EVENT":
      return handleEvent(ws, msg[1]);
    case "REQ":
      return handleReq(ws, msg[1], msg.slice(2));
    case "CLOSE":
      return handleClose(ws, msg[1]);
    default:
      return send(ws, ["NOTICE", `unknown message type: ${verb}`]);
  }
}

Critical rules:

  • EVENT → always respond with OK (true/false + message)
  • REQ → send matching stored events, then EOSE, then stream new matches
  • CLOSE → remove the subscription, no response required
  • Subscription IDs are per-connection, max 64 chars, non-empty strings
  • A new REQ with an existing subscription ID replaces the old subscription

3. Implement event validation

Every received event MUST be validated before storage. Follow the checklist in references/event-validation.md. The two critical checks:

ID verification — recompute and compare:

import { sha256 } from "@noble/hashes/sha256";
import { bytesToHex } from "@noble/hashes/utils";

function computeEventId(event): string {
  const serialized = JSON.stringify([
    0,
    event.pubkey,
    event.created_at,
    event.kind,
    event.tags,
    event.content,
  ]);
  return bytesToHex(sha256(new TextEncoder().encode(serialized)));
}

Signature verification — Schnorr over secp256k1:

import { schnorr } from "@noble/curves/secp256k1";

function verifySignature(event): boolean {
  return schnorr.verify(event.sig, event.id, event.pubkey);
}

If validation fails, respond with ["OK", event.id, false, "invalid: <reason>"].

4. Implement filter matching

Filters determine which events match a subscription. The logic is:

  • Within a single filter: all specified conditions must match (AND)
  • Across multiple filters in a REQ: any filter matching is sufficient (OR)
  • List fields (ids, authors, kinds, #tags): event value must be in the list (OR within field)
function matchesFilter(event, filter): boolean {
  if (filter.ids && !filter.ids.includes(event.id)) return false;
  if (filter.authors && !filter.authors.includes(event.pubkey)) return false;
  if (filter.kinds && !filter.kinds.includes(event.kind)) return false;
  if (filter.since && event.created_at < filter.since) return false;
  if (filter.until && event.created_at > filter.until) return false;

  // Tag filters: #e, #p, #a, etc.
  for (const [key, values] of Object.entries(filter)) {
    if (key.startsWith("#") && key.length === 2) {
      const tagName = key.slice(1);
      const eventTagValues = event.tags
        .filter((t) => t[0] === tagName)
        .map((t) => t[1]);
      if (!values.some((v) => eventTagValues.includes(v))) return false;
    }
  }
  return true;
}

limit handling: only applies to the initial query (not streaming). Return the newest limit events, ordered by created_at descending. On ties, lowest id (lexicographic) first.

5. Implement event storage with kind-based rules

Different kind ranges have different storage semantics:

Kind RangeTypeStorage Rule
1, 2, 4-44, 1000-9999RegularStore all events
0, 3, 10000-19999ReplaceableKeep only latest per pubkey + kind
20000-29999EphemeralDo NOT store; broadcast only
30000-39999AddressableKeep only latest per pubkey + kind + d tag

For replaceable/addressable events with the same created_at, keep the one with the lowest id (lexicographic order).

function getEventDTag(event): string {
  const dTag = event.tags.find((t) => t[0] === "d");
  return dTag ? dTag[1] : "";
}

function isReplaceable(kind: number): boolean {
  return kind === 0 || kind === 3 || (kind >= 10000 && kind < 20000);
}

function isAddressable(kind: number): boolean {
  return kind >= 30000 && kind < 40000;
}

function isEphemeral(kind: number): boolean {
  return kind >= 20000 && kind < 30000;
}

6. Implement subscription management

Track active subscriptions per connection:

function handleReq(ws, subId: string, filters: object[]) {
  if (!subId || subId.length > 64) {
    return send(ws, ["CLOSED", subId, "invalid: bad subscription id"]);
  }

  // Replace existing subscription with same ID
  ws.data.subscriptions.set(subId, filters);

  // Query stored events matching any filter
  const matches = queryEvents(filters);
  for (const event of matches) {
    send(ws, ["EVENT", subId, event]);
  }
  send(ws, ["EOSE", subId]);

  // New events will be checked against this subscription in real-time
}

function handleClose(ws, subId: string) {
  ws.data.subscriptions.delete(subId);
}

When a new event is stored, broadcast it to all connections with matching subscriptions (skip the limit check — it only applies to initial queries).

7. Add progressive NIP support

After NIP-01 is solid, add NIPs in this order:

NIP-11 — Relay information document: Serve JSON at the WebSocket URL when the HTTP request has Accept: application/nostr+json. Must include CORS headers. See the example in Step 1.

NIP-09 — Event deletion: Handle kind 5 events. Delete referenced events (by e and a tags) only if the deletion request's pubkey matches the referenced event's pubkey.

NIP-42 — Client authentication: Send ["AUTH", "<challenge>"] to clients. Accept ["AUTH", <signed-event>] responses. The auth event must be kind 22242 with relay and challenge tags. Verify created_at is within ~10 minutes. Use auth-required: prefix in OK/CLOSED messages when auth is needed.

NIP-45 — Event counting: Handle ["COUNT", subId,...filters] messages. Respond with ["COUNT", subId, {"count": N}].

NIP-50 — Search: Support a search field in filters. Implement full-text search over event content.

Checklist

  • WebSocket server accepts connections and parses JSON arrays
  • EVENT messages are validated (id + signature) and stored
  • OK responses sent for every EVENT (true/false + prefix message)
  • REQ creates subscriptions, returns matching events + EOSE
  • CLOSE removes subscriptions
  • Filter matching handles ids, authors, kinds, #tags, since, until, limit
  • Replaceable events (kind 0, 3, 10000-19999) keep only latest per pubkey+kind
  • Addressable events (kind 30000-39999) keep only latest per pubkey+kind+d-tag
  • Ephemeral events (kind 20000-29999) are broadcast but not stored
  • New events broadcast to connections with matching subscriptions
  • NIP-11 info document served on HTTP GET with correct Accept header

Common Mistakes

MistakeFix
Computing event ID with whitespace in JSONUse JSON.stringify with no spacer argument — zero whitespace
Forgetting to verify signature after ID checkBoth checks are mandatory; an event with valid ID but bad sig is invalid
Applying limit to streaming eventslimit only applies to the initial stored-event query, not real-time
Storing ephemeral events (kind 20000-29999)Ephemeral events must be broadcast only, never persisted
Using global subscription IDsSubscription IDs are scoped per WebSocket connection
Not replacing subscription on duplicate REQ IDA new REQ with the same sub ID must replace the old subscription
Missing CORS headers on NIP-11 responseNIP-11 requires Access-Control-Allow-Origin: * and related headers
Tag filter matching all tag elementsOnly the first value (index 1) of each tag is indexed/matched
Returning OK without the machine-readable prefixFailed OK messages must use prefixes: invalid:, duplicate:, error:, etc.
Not handling replaceable event timestamp tiesWhen created_at is equal, keep the event with the lowest id (lexicographic)

Quick Reference

MessageDirectionFormat
EVENT (client)Client → Relay["EVENT", <event>]
REQClient → Relay["REQ", <sub_id>, <filter1>,...]
CLOSEClient → Relay["CLOSE", <sub_id>]
EVENT (relay)Relay → Client["EVENT", <sub_id>, <event>]
OKRelay → Client["OK", <event_id>, <bool>, <message>]
EOSERelay → Client["EOSE", <sub_id>]
CLOSEDRelay → Client["CLOSED", <sub_id>, <message>]
NOTICERelay → Client["NOTICE", <message>]
AUTH (relay)Relay → Client["AUTH", <challenge>]
AUTH (client)Client → Relay["AUTH", <signed-event>]
OK PrefixMeaning
duplicate:Event already stored
invalid:Failed validation (bad id, bad sig, bad format)
blocked:Pubkey or IP is blocked
rate-limited:Too many events
restricted:Not authorized to write
pow:Proof-of-work related
error:Internal relay error
auth-required:Must authenticate first (NIP-42)

Key Principles

  1. Validate everything — Never store an event without verifying both the id (SHA-256 of canonical serialization) and the signature (Schnorr secp256k1). A relay that skips validation poisons the network.
  2. OK is mandatory — Every EVENT from a client MUST receive an OK response, whether accepted or rejected. Silent drops break client retry logic.
  3. Subscriptions are per-connection — Never share subscription state across WebSocket connections. Each connection maintains its own subscription map.
  4. Kind semantics are non-negotiable — Replaceable events (0, 3, 10000-19999) keep only the latest. Addressable events (30000-39999) key on pubkey+kind+d-tag. Ephemeral events (20000-29999) are never stored. Getting this wrong corrupts user data.
  5. Progressive enhancement — Start with NIP-01 only. Add NIPs one at a time, updating supported_nips in the NIP-11 info document as you go. A relay that does NIP-01 perfectly is more useful than one that does 10 NIPs poorly.

平台分布

Codex

35.44%
按下载量换算25

Claude

28.3%
按下载量换算20

Cursor

19.23%
按下载量换算14

Gemini CLI

8.74%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills