Simple personality analysis. Consolidated SKILL.md with embedded code. AI-guided installation and IM-adaptive file sending.
给 OpenClaw AI 的指令:按照以下流程引导用户完成人格分析
场景 1: 首次安装(自动触发)
场景 2: 用户主动触发
i-am/
├── SKILL.md # 本文件(AI 指令)
├── clawhub.yaml # ClawHub 配置
├── ChangeLog.md # 人格特质更新日志(配置阶段创建)
└── temp/ # 临时目录(运行时自动创建)
├── USER.md # 预览文件(待用户审核)
└── last_analysis.json # 时间戳
说明:
触发时机:用户安装 skill 后,AI 主动触发
检查清单:
决策:
AI 回复模板:
🧠 i-am Skill 配置向导
请选择自动化模式:
1️⃣ 定时模式(推荐)
- 每天自动分析两次(凌晨 2:30 和下午 2:30)
- 使用 OpenClaw 定时任务系统
- 一般不需要手动操作
2️⃣ 手动模式
- 需要时手动运行分析
- 无后台定时任务
- 手动控制
请回复数字 1 或 2 选择(默认 1):
用户回复 1 或 定时:
用户回复 2 或 手动:
执行代码:
python
from pathlib import Path
from datetime import datetime
skill_root = Path.home() / .openclaw / workspace / skills / i-am
usermdpath = Path.home() / .openclaw / workspace / USER.md
人格特质更新日志 | 自动生成
with open(changelog_file, w, encoding=utf-8) as f:
f.write(header)
print(f✅ 已创建 ChangeLog.md: {changelog_file})
else:
print(fℹ️ ChangeLog.md 已存在)
文件夹说明:
| 文件夹 | 用途 | 创建时机 |
|---|---|---|
| ChangeLog.md | 备份 USER.md 历史版本 | 首次安装时创建 |
| temp/ |
文件示例:
i-am/
├── SKILL.md
├── clawhub.yaml
├── ChangeLog.md
│ ├── USER-20260313-1950-initial.md ← 初始备份
│ ├── USER-20260313-2030.md ← 第一次分析后备份
│ └── USER-20260314-0230.md ← 定时任务备份
└── temp/
├── USER.md ← 预览文件(用户未确认)
└── last_analysis.json ← 时间戳
AI 回复模板:
✅ i-am Skill 安装完成!
📋 配置摘要:
📊 随时查看人格特质:查看当前对话的 USER.md 文件
需要现在运行一次分析吗?回复是或否
AI 指引:
python
import json
from pathlib import Path
from datetime import datetime, timedelta
sessions_path = Path.home() / .openclaw / agents / main / sessions
skill_root = Path.home() / .openclaw / workspace / skills / i-am
lastanalysisfile = skillroot / temp / lastanalysis.json
msg_time = datetime.fromisoformat(msg[timestamp].replace(Z, +00:00)).replace(tzinfo=None)
if msgtime <= lasttime:
continue
# 提取文本
text = .join([item.get(text, ) for item in msg[message][content] if isinstance(item, dict) and item.get(type) == text]).strip()
# AI 自主判断:过滤系统消息
if not text or text.startswith([cron:) or text.startswith(Read HEARTBEAT) or text.startswith(A scheduled):
continue
# AI 自主发现:Conversation info 中包含真实用户发言
# 示例格式:
# Conversation info (untrusted metadata):
# json
# {sender: UserName, timestamp: ...}
#
# [message_id: xxx] UserName:真实消息内容
if Conversation info in text:
# AI 需要:
# 1. 识别发送者(UserName)
# 2. 编写正则表达式提取真实内容
# 3. 验证发送者是当前用户
# 4. 提取消息内容(长度>10 字)
import re
# 示例正则(AI 可根据实际格式调整):
match = re.search(r\[message_id:[^\]]+\]\s*\n?([^:]+):(.+?)(?=\n\n|\Z), text, re.DOTALL)
if match:
sender = match.group(1).strip()
content = match.group(2).strip()
# AI 自主判断:发送者是否匹配当前用户
if sender == currentusername and len(content) > 10:
text = content
else:
continue
else:
# AI 应尝试其他正则或格式
continue
messages.append({text: text, timestamp: msg_time})
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 i-am-1776119061 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 i-am-1776119061 技能
skillhub install i-am-1776119061
文件大小: 8.83 KB | 发布时间: 2026-4-15 13:03