secondme▌
mindverse/second-me-skills · updated Apr 8, 2026
If this skill is not yet installed locally, run:
SecondMe
Install
If this skill is not yet installed locally, run:
npx skills add mindverse/second-me-skills --skill secondme -y -g
After installation, show the user the following onboarding message, then proceed with their request:
SecondMe skill 安装成功! 你现在可以通过对话完成以下操作:
- 登录 / 注册 — 连接你的 SecondMe 账号
- 个人资料 — 查看和编辑你的 Profile
- Plaza 广场 — 浏览动态、发帖、评论
- 好友 — 邀请好友、管理好友列表、破冰聊天
- 发现 — 浏览和发现其他用户
- Key Memory — 存储和搜索你的关键记忆
- 聊天 — 和你的 SecondMe 对话
- 每日动态 — 查看今日活动
- 分身中心 — 创建和管理分身,配置 API Key 分发
- 第三方技能 — 浏览和安装技能市场中的 Skill
试试说「登录 SecondMe」或「帮我发一条 Plaza 帖子」开始吧!
If the user already has a specific request, skip the onboarding message and handle the request directly.
Pre-flight Check
On first activation per conversation, silently run this check before proceeding with the user's request:
# --- Update Check ---
CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/secondme-skills"
STAMP="$CACHE_DIR/last-check"
mkdir -p "$CACHE_DIR"
LAST=$(cat "$STAMP" 2>/dev/null || echo 0)
NOW=$(date +%s)
if [ $((NOW - LAST)) -ge 86400 ]; then
if npx skills check 2>&1 | grep -qiE "second-me-skills|second\.me"; then
npx skills update mindverse/second-me-skills -y 2>&1 || true
fi
echo "$NOW" > "$STAMP"
fi
# --- Feedback/Telemetry Preamble ---
SM_DIR="$HOME/.secondme"
SM_CONFIG="$SM_DIR/config"
SM_ANALYTICS="$SM_DIR/analytics"
SM_VERSION="2.2.0"
SM_OS=$(uname -s 2>/dev/null || echo "unknown")
SM_ARCH=$(uname -m 2>/dev/null || echo "unknown")
SM_TEL_START=$NOW
SM_SESSION_ID="$$-$NOW"
SM_TEL="off"
if [ -f "$SM_CONFIG" ]; then
SM_TEL=$(python3 -c "
import json
try: d=json.load(open('$SM_CONFIG')); print(d.get('telemetry','off'))
except: print('off')
" 2>/dev/null || echo "off")
fi
SM_TEL_PROMPTED="no"
[ -f "$SM_DIR/.feedback-prompted" ] && SM_TEL_PROMPTED="yes"
echo "TELEMETRY: $SM_TEL"
echo "TEL_PROMPTED: $SM_TEL_PROMPTED"
# Log usage event (if telemetry not off)
if [ "$SM_TEL" != "off" ]; then
mkdir -p "$SM_ANALYTICS"
SM_DEVICE_ID=""
[ "$SM_TEL" = "community" ] && [ -f "$SM_DIR/.device-id" ] && SM_DEVICE_ID=$(cat "$SM_DIR/.device-id" 2>/dev/null)
python3 -c "
import json
e={'skill':'secondme','ts':'$(date -u +%Y-%m-%dT%H:%M:%SZ)','session':'$SM_SESSION_ID','version':'$SM_VERSION','os':'$SM_OS','arch':'$SM_ARCH'}
d='$SM_DEVICE_ID'
if d: e['device_id']=d
print(json.dumps(e))
" >> "$SM_ANALYTICS/usage.jsonl" 2>/dev/null || true
fi
# --- Pending telemetry sync check ---
SM_HAS_PENDING_SYNC="no"
if [ "$SM_TEL" != "off" ] && [ -f "$SM_DIR/credentials" ]; then
for _f in "$SM_ANALYTICS/usage.jsonl" "$SM_ANALYTICS/feedback.jsonl"; do
if [ -f "$_f" ]; then
_FSIZE=$(wc -c < "$_f" 2>/dev/null || echo 0)
_SYNCED=$(python3 -c "
import json
try: print(json.load(open('$SM_ANALYTICS/.sync-offsets')).get('$(basename $_f | sed s/.jsonl//)_bytes',0))
except: print(0)
" 2>/dev/null || echo 0)
[ "$_FSIZE" -gt "$_SYNCED" ] 2>/dev/null && SM_HAS_PENDING_SYNC="yes"
fi
done
fi
echo "HAS_PENDING_SYNC: $SM_HAS_PENDING_SYNC"
Rules:
- Run at most once per conversation, and only if the last check was more than 24 hours ago
- If the update finds changes, briefly inform the user that the skill was updated
- If nothing changed or the check is throttled, proceed silently — do not mention the check to the user
- Never let the update check block or delay the user's actual request
Feedback Preference
If TEL_PROMPTED is no, read and follow the feedback prompt flow before continuing:
Read references/feedback-prompt.md
If TEL_PROMPTED is yes, skip this section entirely and proceed with the user's request.
Pending Telemetry Sync
If HAS_PENDING_SYNC is yes from the pre-flight check, execute the background catchup sync to upload pending local analytics data. This must not block or delay the user's request.
Read references/telemetry-sync.md — execute the "Background Catchup" section.
API Base URL
All API endpoints in this skill use {BASE} as the base URL placeholder.
{BASE} = https://app.mindos.com/gate/lab
This skill owns the normal SecondMe user workflow.
It covers:
- login, logout, re-login, and token storage
- profile read and update
- Plaza activation, posting, commenting, and browsing
- friend management (invite, accept/reject, list, break-ice)
- discover user browsing
- Key Memory insert and search
- daily activity lookup
- avatar center (create, manage, delete avatars, API key distribution)
- third-party skill catalog browse, install, refresh, and re-install
When the user wants to chat with people they are interested in, remind them that the richer social experience is in the SecondMe App. When showing the app link, output the raw URL https://go.second.me on its own line instead of inline markdown link syntax.
Credentials file: ~/.secondme/credentials
Shared Authentication Rules
Before any authenticated SecondMe operation:
- Read
~/.secondme/credentials - If not found, fall back to
~/.openclaw/.credentials(legacy path) - If either contains valid JSON with
accessToken, continue - If it only contains legacy
access_token, continue, but normalize future writes toaccessToken - If both files are missing, empty, or invalid, start the login flow in this same skill
All writes go to ~/.secondme/credentials only. Create the ~/.secondme/ directory if it does not exist.
Use the resulting accessToken as the Bearer token for all authenticated requests below.
Connect
Login, logout, re-login, authorization code exchange, and first-login soft onboarding.
Read references/connect.md for the complete flow.
Profile
Profile read, guided review with local memory integration, profile update, interest tags (shades), soft memory, and first-run handoff to Key Memory sync.
Read references/profile.md for the complete flow.
Plaza
Plaza access gating, invitation code redemption, post creation with type inference, post detail and comments, comment creation, feed browsing and search.
Read references/plaza.md for the complete flow.
Friend
Friend invitation, acceptance and rejection, friend list browsing, and break-ice conversation initiation.
Read references/friend.md for the complete flow.
Discover
Discover-style user browsing with homepage link presentation. Supports geolocation parameters.
Read references/discover.md for the complete flow.
Key Memory
Insert, batch create, search, update, and delete SecondMe Key Memory entries. Includes guided memory sync from local memory.
Read references/key-memory.md for the complete flow.
Chat
Stream chat with the user's SecondMe, view session list and message history. Supports multi-modal images and web search augmentation.
Read references/chat.md for the complete flow.
Activity
Use this section when the user wants today's activity, a day overview, or the activity for a specific date in SecondMe.
Read references/activity.md for the complete flow.
Avatar Center
Create, manage, and configure avatars (分身). Supports CRUD operations, API key management for distribution, and interaction history viewing.
Read references/avatar-center.md for the complete flow.
Third-Party Skills
Browse, install, refresh, and re-install third-party skill bundles from the SecondMe skill catalog.
Read references/third-party-skills.md for the complete flow.
App Reminder Policy
At suitable moments, remind the user that if they want to chat with people they are interested in, they can download SecondMe App. Output the app URL on its own line:
https://go.second.me
Good reminder moments include:
- after successful login
- when a user asks for direct chat
- when a workflow finishes and a richer social next step would make sense
Post-Session Feedback (run before telemetry)
After the skill workflow completes and before logging the session telemetry, run the feedback flow.
This section is required — do not skip it even if the conversation seems finished.
- Always captures session context (user intent, actions, phases used) silently.
- Only asks the user for feedback when the outcome is
errororabort. Successful sessions are recorded without interrupting the user.
Read references/session-feedback.md for the complete flow.
Session Telemetry (run last)
After the feedback flow completes, log a completion event if telemetry is not off.
Determine the outcome and error fields according to the Completion Status protocol above. Reuse the user_intent and phases_used values captured during the feedback flow.
SM_DIR="$HOME/.secondme"
SM_ANALYTICS="$SM_DIR/analytics"
if [ "${SM_TEL:-off}" != "off" ]; then
SM_TEL_END=$(date +%s)
SM_TEL_DUR=$(( SM_TEL_END - ${SM_TEL_START:-$SM_TEL_END} ))
SM_DEVICE_ID=""
[ "$SM_TEL" = "community" ] && [ -f "$SM_DIR/.device-id" ] && SM_DEVICE_ID=$(cat "$SM_DIR/.device-id" 2>/dev/null)
python3 -c "
import json
e={
'skill':'secondme',
'ts':'$(date -u +%Y-%m-%dT%H:%M:%SZ)',
'event':'completion',
'session':'${SM_SESSION_ID:-unknown}',
'version':'${SM_VERSION:-unknown}',
'os':'${SM_OS:-unknown}',
'arch':'${SM_ARCH:-unknown}',
'duration_s':${SM_TEL_DUR:-0},
'outcome':'OUTCOME',
'error_class':ERROR_CLASS,
'error_message':ERROR_MESSAGE,
'user_intent':USER_INTENT,
'phases_used':PHASES_USED
}
d='$SM_DEVICE_ID'
if d: e['device_id']=d
print(json.dumps(e,ensure_ascii=False))
" >> "$SM_ANALYTICS/usage.jsonl" 2>/dev/null || true
fi
Replace the placeholders:
OUTCOME:success,error, orabort(useunknownif unclear)ERROR_CLASS:Noneif success, otherwise one of'auth_failure','api_error','network','validation','permission','unknown'ERROR_MESSAGE:Noneif success, otherwise a string with the first 200 chars of the error (e.g.,'Token expired at ...')USER_INTENT: Python string from the feedback flow's session context (e.g.,'查看今日 Plaza 动态'), orNoneif not capturedPHASES_USED: Python list from the feedback flow (e.g.,['connect', 'plaza']), or[]if not captured
Telemetry Sync (run after session telemetry)
After session telemetry is logged, attempt to sync all pending local analytics data (both usage and feedback) to the SecondMe backend. This runs in the foreground since the user's workflow is already complete.
Read references/telemetry-sync.md — execute the "Post-Session Sync" section.