Publish operational logs over Nostr with public events and private admin messages for sensitive logs.
npx skills add https://github.com/besoeasy/open-skills --skill nostr-logging-system
Use Nostr as a distributed logging transport: publish non-sensitive logs publicly, and send sensitive logs privately to the admin via Nostr DM.
nostr-sdk libraryInstall:
npm install nostr-sdk
Environment variables:
# REQUIRED: admin Nostr public identity (npub or hex pubkey)
export ADMIN_NOSTR_PUBKEY="npub1..."
# REQUIRED for the logger identity (create if missing; see setup below)
export NOSTR_NSEC="nsec1..."
# Optional
export NOSTR_RELAYS="wss://relay.damus.io,wss://nos.lol,wss://relay.snort.social"
npub / public key).NOSTR_NSEC saved.nsec for future runs.nsec if missing (Node.js)// setup-nostr-identity.js
const fs = require('fs');
const path = require('path');
const { generateRandomNsec, nsecToPublic } = require('nostr-sdk');
function ensureNostrIdentity() {
const envPath = path.resolve(process.cwd(), '.env');
const envText = fs.existsSync(envPath) ? fs.readFileSync(envPath, 'utf8') : '';
const fromProcess = process.env.NOSTR_NSEC;
const fromEnvFile = envText.match(/^NOSTR_NSEC=(.+)$/m)?.[1];
const currentNsec = fromProcess || fromEnvFile;
if (currentNsec && currentNsec.startsWith('nsec1')) {
console.log('NOSTR_NSEC already exists. Reusing saved key.');
return currentNsec;
}
const nsec = generateRandomNsec();
const pub = nsecToPublic(nsec);
const line = `NOSTR_NSEC=${nsec}`;
const nextEnv = envText.includes('NOSTR_NSEC=')
? envText.replace(/^NOSTR_NSEC=.*$/m, line)
: `${envText}${envText.endsWith('\n') || envText.length === 0 ? '' : '\n'}${line}\n`;
fs.writeFileSync(envPath, nextEnv, 'utf8');
console.log('Generated new Nostr identity. Saved NOSTR_NSEC to .env');
console.log('Your npub:', pub.npub);
return nsec;
}
ensureNostrIdentity();
Run:
node setup-nostr-identity.js
const { posttoNostr } = require('nostr-sdk');
async function logPublic(message, level = 'info') {
const tags = [
['t', 'logs'],
['t', 'public'],
['t', level]
];
return posttoNostr(`[PUBLIC_LOG] ${message}`, {
nsec: process.env.NOSTR_NSEC,
tags,
relays: null,
powDifficulty: 4
});
}
// Example:
// await logPublic('Worker started successfully', 'info');
const { sendMessageNIP17 } = require('nostr-sdk');
async function logSensitiveToAdmin(message) {
const admin = process.env.ADMIN_NOSTR_PUBKEY;
if (!admin) throw new Error('Missing ADMIN_NOSTR_PUBKEY');
return sendMessageNIP17(admin, `[SENSITIVE_LOG] ${message}`, {
nsec: process.env.NOSTR_NSEC
});
}
// Example:
// await logSensitiveToAdmin('DB auth retry failed for tenant=alpha');
const { posttoNostr, sendMessageNIP17 } = require('nostr-sdk');
async function logNostrEvent({ level = 'info', message, sensitive = false, context = {} }) {
if (!process.env.NOSTR_NSEC) throw new Error('Missing NOSTR_NSEC');
if (!process.env.ADMIN_NOSTR_PUBKEY) throw new Error('Missing ADMIN_NOSTR_PUBKEY');
const payload = JSON.stringify({
ts: new Date().toISOString(),
level,
message,
context
});
if (sensitive) {
return sendMessageNIP17(process.env.ADMIN_NOSTR_PUBKEY, `[SENSITIVE_LOG] ${payload}`, {
nsec: process.env.NOSTR_NSEC
});
}
return posttoNostr(`[PUBLIC_LOG] ${payload}`, {
nsec: process.env.NOSTR_NSEC,
tags: [['t', 'logs'], ['t', 'public'], ['t', level]],
relays: null,
powDifficulty: 4
});
}
// Example:
// await logNostrEvent({ level: 'info', message: 'Cron completed', sensitive: false });
// await logNostrEvent({ level: 'error', message: 'JWT parse failed', sensitive: true, context: { userId: 42 } });
Use the Nostr Logging System skill.
Rules:
1) Ask for admin Nostr address first (npub/public key) and store as ADMIN_NOSTR_PUBKEY.
2) Check if NOSTR_NSEC already exists in environment/.env.
3) If missing, generate a new identity and persist NOSTR_NSEC for future runs.
4) Route logs:
- Non-sensitive -> public Nostr note with tags logs/public/<level>
- Sensitive -> private DM to ADMIN_NOSTR_PUBKEY using NIP-17
5) Never publish secrets in public notes.
logs, service-name, env) for easier filtering.Missing ADMIN_NOSTR_PUBKEY: Ask admin for npub/public key and export it.Missing NOSTR_NSEC: Run the setup script to generate and persist identity.Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.
Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances
Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.
Build and distribute Expo development clients locally or via TestFlight
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
Take besoeasy/nostr-logging-system from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npm.
Without those the skill loads but fails at the first command.