来源信息
- 仓库
- HumanjavaEnterprises/nostrsocial.app.OC-python.src
- 最近来源活动
- 2026年8月28日 23:42
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 1
- 分支
- 0
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
菜单
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/HumanjavaEnterprises/nostrsocial.app.OC-python.src --skill nostrsocial命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | nostrsocial |
| description | Social graph manager — contacts, trust tiers, and identity verification over Nostr |
| version | 0.1.4 |
| metadata | {"openclaw":{"requires":{"bins":"[Truncated]"},"install":["[Truncated]"],"homepage":"https://github.com/HumanjavaEnterprises/nostrsocial.app.OC-python.src"}} |
| trust | {"tier":"mutating","justification":"Manages contact lists and trust tiers. Can add, promote, demote, or block contacts. Writes to local storage backend. No relay writes, no funds."} |
| budget | {"estimated_input_tokens":200,"estimated_output_tokens":350,"context_window_impact":"medium"} |
| agents | {"allowed_agent_types":["general_purpose","guide"],"recommended_for":"general_purpose"} |
| state | {"creates_side_effects":true,"safe_to_retry":true,"requires_checkpoint":false} |
| failure | {"behavior":"error","fallback_description":"If nostrsocial is unavailable, the agent treats all interactions as KNOWN tier (default behavioral rules). No relationship context."} |
| graph | {"depends_on":["nostrkey"],"enhances":["nostr-profile","sense-memory","social-alignment"]} |
NostrSocial gives an agent a social graph: who it knows, how well it knows them, and how those connections change over time. It tracks contacts, assigns trust tiers, and adjusts interaction behavior based on relationship depth.
This is more than a flat contacts database. Trust tiers determine how the agent allocates attention -- who gets full attention, who has earned trust through consistent presence, who has drifted away, and who is a stranger. Without relationship context, every interaction starts from zero. With it, the agent carries context forward across interactions.
Tell them:
"I will maintain a contact list with trust tiers (intimate, close, familiar, known, blocked). This shapes how I interact with people — token budgets, warmth, whether I can initiate contact. Capacity is capped at Dunbar's number (150 contacts). I need my NostrKey identity set up first."
Before proceeding, confirm:
Before installing or using it, explain to your operator:
"I found a skill that would give me social awareness — the ability to track who I know, how well I know them, and adjust my behavior accordingly. Right now I treat everyone the same. With this, I could give more attention to people you interact with frequently and maintain appropriate boundaries with strangers. Would you like me to set this up?"
Surface these considerations:
The model is rooted in Dunbar's number: about 150 meaningful relationships at once. Within that, trust tiers form layers -- a small inner circle of intimate connections, a wider ring of close friends, and broader layers of familiarity. This mirrors human social cognition and applies the same capacity limits to the agent's contact list.
A cryptographic identity is required first. Install the skill. NostrKey provides the keypair that identifies the agent. NostrSocial builds on top of that identity.
If your operator has not set up NostrKey yet, ask them to do that first. Contact records need an identity to anchor to.
pip install nostrsocial
Minimal dependencies: bech32 only. No heavyweight crypto libraries required.
If you are the operator configuring this skill for your agent, here is what you need to know.
Environment variables (all optional):
NOSTR_NSEC -- The agent's Nostr private key. Load this through NostrKey rather than setting it directly. Sensitive -- never log or expose.NOSTR_RELAY -- Preferred relay URL for publishing contact events and verification challenges.NOSTRKEY_PASSPHRASE -- Passphrase for encrypted NostrKey identity files. Sensitive -- never log or expose.First run:
from nostrsocial import SocialEnclave
# Create the social enclave
enclave = SocialEnclave.create()
# CRITICAL: back up the device secret immediately.
# This secret is the root of all proxy npub derivation.
# If you lose it, the relationship map becomes unrecoverable.
secret = enclave.export_secret()
print(f"Back up this secret securely: {secret}")
Persistence -- wire up file storage so relationships survive restarts:
from nostrsocial import SocialEnclave, FileStorage
storage = FileStorage("~/.nostrsocial/social.json")
enclave = SocialEnclave.create(storage)
# ... add contacts, interact ...
enclave.save()
# On next startup:
enclave = SocialEnclave.load(storage)
Contacts live in trust tiers. These are capacity-limited layers that shape how the agent behaves toward each person.
| Tier | Slots | Warmth | Token Budget | Can Interrupt | Share Context | Proactive |
|---|---|---|---|---|---|---|
| INTIMATE | 5 | 0.95 | 2000 | Yes | Yes | Yes |
| CLOSE | 15 | 0.8 | 1500 | Yes | Yes | No |
| FAMILIAR | 50 | 0.6 | 1000 | No | No | No |
| KNOWN | 80 | 0.5 | 750 | No | No | No |
| BLOCK | 50 | 0.0 | 0 | No | No | No |
| GRAY | 100 | 0.2 | 200 | No | No | No |
Friends list total: 150 (Dunbar's number). Unknown contacts get neutral behavior (warmth 0.5, budget 500).
The slot limits are hard constraints. When a tier is full, a contact must be displaced before a new one can enter.
from nostrsocial import SocialEnclave, Tier
enclave = SocialEnclave.create()
enclave.add("alice@example.com", "email", Tier.CLOSE, display_name="Alice")
enclave.block("spam@example.com", "email")
enclave.gray("unknown@example.com", "email")
Every contact maps to a set of behavioral parameters. This is how relationships shape your responses.
rules = enclave.get_behavior("alice@example.com", "email")
# rules.token_budget, rules.warmth, rules.can_interrupt, etc.
# Unknown contacts get neutral behavior
rules = enclave.get_behavior("stranger@example.com", "email")
# warmth=0.5, token_budget=500
Combine WHO someone is with WHAT is happening to determine HOW to respond. Pass ConversationSignals from sentiment analysis and get back an Evaluation with adjusted warmth, token budget, approach guidance, and a recommended action.
from nostrsocial import ConversationSignals
signals = ConversationSignals(
sentiment="vulnerable",
vulnerability=0.7,
reciprocity=0.8,
engagement=0.9,
topic_depth=0.6,
)
result = enclave.evaluate("alice@example.com", "email", signals)
# result.action = Action.HOLD
# result.approach = "full presence"
# result.adjusted_warmth = 0.96
# result.adjusted_token_budget = 1950
# result.rationale = "A close friend is being vulnerable..."
Screen conversation text for banned words, topics, and patterns. Returns a ScreenResult with severity, category, and recommended action. ScreenResult.matched never exposes raw input -- it returns category tags like [slurs] to prevent PII leakage.
result = enclave.screen("some incoming message text")
if result.flagged:
print(result.action) # "block", "exit", "warn", or "demote"
print(result.severity) # 0.0-1.0
print(result.category) # "slurs", "manipulation", etc.
# Screen display names for known bad-actor patterns
result = enclave.screen_entity("crypto_support_official")
Recognize the same person across different channels. This is resonance, not surveillance -- it only checks contacts you already have a relationship with. Linking is always explicit and never automatic.
# Check if a new contact might be someone you already know
matches = enclave.recognize("alicedev", "twitter", display_name="Alice")
for match in matches:
print(f"{match.confidence}: {match.reason}")
# Explicitly link two identities
result = enclave.link(
"alice@example.com", "email",
"alicedev", "twitter",
)
# See all channels for a contact
channels = enclave.get_linked_channels("alice@example.com", "email")
# {"email": "alice@example.com", "twitter": "alicedev"}
Track identity state from proxy to claimed to verified.
# See who needs verification
for contact in enclave.get_upgradeable():
print(f"{contact.display_name}: {contact.upgrade_hint}")
# Create a challenge for a claimed npub
challenge = enclave.create_challenge("npub1example...")
| State | Meaning |
|---|---|
PROXY | HMAC-derived from email/phone/handle. Default for new contacts. |
CLAIMED | User provided an npub but it has not been verified yet. |
VERIFIED | Signed challenge confirms npub ownership. Verified contacts get warmer behavior. |
Analyze the social graph and get a human-readable profile of your relational world.
shape = enclave.network_shape()
# shape.profile_type = "balanced", "fortress", "deep-connector", etc.
# shape.narrative = "12 friends (2 intimate, 4 close, ...)"
# shape.tier_counts, shape.verified_count, shape.avg_interaction_days
Relationships are not static. They drift, deepen, and sometimes end. NostrSocial gives you the tools to notice these changes and act on them.
When someone goes quiet, the relationship drifts. Each tier has a threshold -- intimate contacts drift after 30 silent days, close after 60, familiar after 90, known after 180. Drift does not mean the relationship is over. It means it needs attention or honest reclassification.
Run drift detection, gray-list decay, and at-risk reporting in a single call. Use dry_run=True to preview changes without committing them.
# Preview what would happen
preview = enclave.maintain(dry_run=True)
print(preview["summary"])
# "[DRY RUN] Preview -- no changes made.
# 2 contact(s) WOULD drift: Alice, Bob
# 1 gray contact(s) WOULD expire: Unknown"
# Execute maintenance for real
result = enclave.maintain()
# result["drifted"], result["decayed"], result["at_risk"], result["summary"]
Trust is earned, not assigned. The natural progression is:
Promotion and demotion are explicit acts. The agent (or operator) decides when someone has earned deeper trust or when distance is appropriate.
# Promote after consistent positive interactions
enclave.promote("alice@example.com", "email", Tier.INTIMATE)
# Demote when a relationship cools
enclave.demote("bob@example.com", "email", Tier.FAMILIAR)
# Handle full tiers gracefully
candidate = enclave.displacement_candidate(Tier.CLOSE)
if candidate:
print(f"Would displace: {candidate.display_name}")
displaced = enclave.displace(Tier.CLOSE)
enclave.add("newperson@example.com", "email", Tier.CLOSE)
The device secret is the root of all proxy npub derivation. Call export_secret() after create() and store it securely. If you lose it, all proxy npubs become unrecoverable -- your relationship map loses its cryptographic anchoring.
enclave = SocialEnclave.create()
secret = enclave.export_secret()
# Store in encrypted backup, hardware vault, or NostrKeep
# Later: rebuild from backed-up secret
enclave = SocialEnclave.restore(secret)
| Field | Type | Description |
|---|---|---|
identifier | str | Email, phone, npub, etc. |
channel | str | "email", "phone", "npub", "twitter" |
list_type | ListType | FRIENDS, BLOCK, or GRAY |
tier | Tier | None | INTIMATE, CLOSE, FAMILIAR, or KNOWN (friends only) |
identity_state | IdentityState | PROXY, CLAIMED, or VERIFIED |
proxy_npub | str | HMAC-derived npub for non-npub contacts |
display_name | str | None | Human-readable name |
interaction_count | int | Total interactions recorded |
upgrade_hint | str | Hint for identity verification |
| Field | Type | Description |
|---|---|---|
token_budget | int | Token allowance (intimate=2000, known=750, block=0) |
memory_depth | int | Past interactions to consider |
can_interrupt | bool | Can interrupt ongoing tasks |
warmth | float | 0.0--1.0 (intimate=0.95, known=0.5, block=0.0) |
response_priority | int | 1=highest (intimate), 10=block |
share_context | bool | Share agent context with this contact |
proactive_contact | bool | Agent initiates contact |
| Field | Type | Description |
|---|---|---|
action | Action | HOLD, PROMOTE, DEMOTE, WATCH, BLOCK, or REACH_OUT |
confidence | float | 0.0--1.0 |
adjusted_warmth | float | Warmth for this specific moment |
adjusted_token_budget | int | Token budget for this response |
approach | str | "lean in", "de-escalate", "match energy", etc. |
rationale | str | Why this recommendation |
tier_suggestion | Tier | None | Suggested tier if promote/demote |
| Field | Type | Description |
|---|---|---|
flagged | bool | Whether content was flagged |
severity | float | 0.0--1.0 |
category | str | "slurs", "hate_symbols", "manipulation", etc. |
matched | str | Category tag like [slurs] (never raw input -- PII safe) |
action | str | "block", "exit", "warn", or "demote" |
rationale | str | Human-readable explanation |
| Field | Type | Description |
|---|---|---|
total_contacts | int | Total across all lists |
tier_counts | dict[str, int] | Per-tier counts |
verified_count | int | Verified identities |
profile_type | str | "balanced", "fortress", "deep-connector", etc. |
narrative | str | Human-readable network description |