返回顶部
i

i-am我是

Simple personality analysis. Consolidated SKILL.md with embedded code. AI-guided installation and IM-adaptive file sending.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.0.5
安全检测
已通过
301
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

i-am

i-am Skill v4.0.1 - AI 指令文档

给 OpenClaw AI 的指令:按照以下流程引导用户完成人格分析


🎯 触发条件

场景 1: 首次安装(自动触发)

  • - 用户安装此 skill 后,AI 主动询问配置

场景 2: 用户主动触发

  • - 运行 i-am 分析、分析我的人格
  • 人格特质、USER.md 更新
  • 扎根理论



📁 文件结构

i-am/
├── SKILL.md # 本文件(AI 指令)
├── clawhub.yaml # ClawHub 配置
├── ChangeLog.md # 人格特质更新日志(配置阶段创建)
└── temp/ # 临时目录(运行时自动创建)
├── USER.md # 预览文件(待用户审核)
└── last_analysis.json # 时间戳

说明

  • - temp/ 目录和文件在首次运行时自动创建
  • ChangeLog.md 在配置阶段自动创建(记录每次更新)



🔄 完整工作流程(AI 执行指南)

阶段 1: 安装配置(首次使用)

触发时机:用户安装 skill 后,AI 主动触发

AI 检测安装状态

检查清单

  1. 1. Cron 任务是否已配置(~/.openclaw/cron/cron-tasks.json 包含 i-am 任务)
  2. 时间戳文件是否存在(temp/last_analysis.json)

决策

  • - 如果都已存在 → AI 回复:✅ i-am 已配置完成,回复运行分析开始分析
  • 如果有缺失 → 进入配置流程

AI 主动询问配置(首次安装)

AI 回复模板

🧠 i-am Skill 配置向导

请选择自动化模式:

1️⃣ 定时模式(推荐)
- 每天自动分析两次(凌晨 2:30 和下午 2:30)
- 使用 OpenClaw 定时任务系统
- 一般不需要手动操作

2️⃣ 手动模式
- 需要时手动运行分析
- 无后台定时任务
- 手动控制

请回复数字 1 或 2 选择(默认 1):

AI 根据用户回复执行

用户回复 1 或 定时

  1. 1. AI 执行:编辑 cron-tasks.json,添加两个定时任务(代码见下方)
  2. AI 回复:✅ 定时模式已配置,每天 2:30 自动运行

用户回复 2 或 手动

  1. 1. AI 回复:✅ 手动模式已配置,需要时告诉我运行 i-am 分析

AI 创建必要文件夹和 ChangeLog.md

执行代码

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

步骤 1: 创建 temp 文件夹(用于存储临时文件)

tempdir = skillroot / temp tempdir.mkdir(parents=True, existok=True) print(f✅ 已创建文件夹:{temp_dir})

步骤 2: 创建 ChangeLog.md(人格特质更新日志)

changelogfile = skillroot / ChangeLog.md if not changelog_file.exists(): header = # i-am Skill ChangeLog

人格特质更新日志 | 自动生成


更新记录

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 确认安装完成

AI 回复模板

✅ i-am Skill 安装完成!

📋 配置摘要:

  • - 模式:定时模式 / 手动模式
  • Cron 任务:已配置 / 未配置
  • 下次运行:2026-03-14 02:30 / 手动触发
  • 初始备份:ChangeLog.mdUSER-20260313-1800-initial.md

📊 随时查看人格特质:查看当前对话的 USER.md 文件

需要现在运行一次分析吗?回复是或否



阶段 2: 运行分析(定时/手动触发)

步骤 1: AI 加载用户语料

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

读取上次分析时间

if lastanalysisfile.exists(): with open(lastanalysisfile, r, encoding=utf-8) as f: last_time = datetime.fromisoformat(json.load(f)[timestamp]) else: last_time = datetime.now() - timedelta(hours=24) # 首次运行加载 24 小时

扫描 sessions 提取新消息

messages = [] for sessionfile in sorted(sessionspath.glob(*.jsonl), key=lambda x: x.stat().st_mtime, reverse=True): with open(session_file, r, encoding=utf-8) as f: for line in f: msg = json.loads(line) if msg.get(type) != message or msg.get(message, {}).get(role) != user: continue

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})

初次运行不限制消息数量(充分利用历史对话建立人格模型)

后续运行可限制消息数量(避免单次分析过多)

如果消息过多,AI 可自主决定是否设置上限

初次运行不限制,尽可能加载历史对话

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 i-am-1776119061 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 i-am-1776119061 技能

通过命令行安装

skillhub install i-am-1776119061

下载

⬇ 下载 i-am v0.0.5(免费)

文件大小: 8.83 KB | 发布时间: 2026-4-15 13:03

v0.0.5 最新 2026-4-15 13:03
# i-am v0.0.5 changelog

- Updated installation workflow: now only the temp directory and `ChangeLog.md` file are created at setup (USER.md initial backup to be handled by future analysis steps)
- Refined setup code and instructions for file and folder management during installation
- No changes to analysis logic or user interaction flow
- Documentation clarified to match actual initialization and backup behavior

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部