技能详情(站内镜像,无评论)
许可证:MIT-0
MIT-0 ·免费使用、修改和重新分发。无需归因。
版本:v1.7.1
统计:⭐ 0 · 35 · 0当前安装量· 0历史安装量
⭐ 0
安装量(当前) 0
🛡 VirusTotal :可疑 · OpenClaw :可疑
Package:axelhu/openclaw-sleep
安全扫描(ClawHub)
- VirusTotal :可疑
- OpenClaw :可疑
OpenClaw 评估
The skill's stated purpose (save unfinished items and restore them after a session reset) is coherent, but the runtime instructions access local config files and encourage storing detailed technical/context data (potentially secrets) and the SKILL.md omits some real dependencies — these mismatches warrant caution.
目的
Overall the code and documentation implement the described sleep+wake behavior (write per-session preview files, call sessions.reset, hook injects preview on agent:bootstrap). However SKILL.md uses the openclaw CLI and python3 in examples and reads ~/.openclaw/openclaw.json for a gateway token, yet the skill metadata lists no required binaries or environment variables — a mismatch between declared requirements and actual instructions.
说明范围
Instructions direct the agent/user to write a preview file containing 'technical details: code paths, configuration values, API endpoints, error messages' — which can encourage including secrets or sensitive configuration in a workspace file. The SKILL.md also instructs reading a local auth file (~/.openclaw/openclaw.json) to extract a gateway token and then calling sessions.reset. Accessing local authentication files and asking users/agents t…
安装机制
This is instruction-only with a small handler.ts hook included as a template — there is no remote download or script execution from untrusted URLs. Hook installation is manual (copy files into ~/.openclaw/workspace/hooks/ and restart), which limits automatic code fetching risk. The handler is simple and performs only local filesystem operations and event-based injection.
证书
Metadata declares no required env vars or credentials, but the runtime example reads ~/.openclaw/openclaw.json to get gateway.auth.token (via a python snippet) and then supplies that token to the gateway call. The skill therefore expects access to a local auth token (not declared). Additionally, SKILL.md's encouragement to include configuration values and API endpoints in preview files can lead to storing secrets in workspace files with unclea…
持久
The skill does not request always:true and does not modify other skills. The hook writes a local log file (~/.openclaw/workspace/hooks/session-sleep-wake/hook.log) and reads/writes files within the user's workspace hooks and previews directories — scope is limited to its own paths. This is expected behavior for a hook, though local logs and preview files should be considered sensitive.
安装(复制给龙虾 AI)
将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。
请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「Sleep」。简介:睡觉技能。收到 /sleep 时,将当前 session 中未完成的事项记录到文件,然后通过 Gateway API reset session。醒来时 ho…。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/axelhu/openclaw-sleep/SKILL.md
(来源:yingzhi8.cn 技能库)
SKILL.md
---
name: sleep
version: 1.7.1
description: 睡觉技能。执行睡觉流程:将当前 session 中未完成的事项记录到 preview 文件,通过 Gateway API reset session。醒来时 hook 自动读取并注入未完成事项到新 session 上下文。触发方式:Agent 自行判断适合入睡时调用,强制入睡用 /sleep。
## ClawHub
> Install: `clawhub install openclaw-sleep`
> Published: https://clawhub.com/openclaw-sleep
## 安装说明
详细安装步骤见 `references/implementation.md`。
⚠️ **Hook 部分只需主 agent 安装一次**(所有 agent 共享),其他 agent 只需安装 skill 本身。
---
# Sleep — 睡前记录 + 醒来续接
## 核心原则
**只记录未完成的,已完成的从记忆里回忆即可。**
## 触发条件
⚠️ **本 skill 的完整流程依赖 session reset(`/new` 或 `/reset`),不仅仅是激活 skill。**
触发方式:
- **Agent 判断**:Agent 认为当前 session 适合结束/暂停时,主动调用
- **强制触发**:`/sleep` 命令,用户或 Agent 强制执行睡觉流程
**Skill 本身只负责写 preview 文件 + 调用 Gateway API reset session**
- **Reset 触发 `agent:bootstrap` 事件 → hook 在 bootstrap 时注入 preview**
如果只激活 skill 而不调用 Gateway API,session 不会 reset,hook 不会触发。
## 记录要求
执行 /sleep 时,逐项回答以下问题:
1. **本次 session 做了什么?**(一句话概括)
2. **有哪些未完成的事?**
- 每条尽量详细:具体要做什么、做到哪一步、卡在哪里
- 不要省略技术细节:代码路径、配置值、API 端点、错误信息
- 只要没完成,不管多小都记
3. **醒来后第一步做什么?**
## Preview 文件格式
```markdown
# Sleep Preview — {sessionKey}
# 生成时间:YYYY-MM-DD HH:mm
## 本次 session 摘要
[一句话描述本次 session 做了什么]
## 未完成事项
- [ ] [事项1:具体描述,要做到哪一步]
- [ ] [事项2:具体描述]
## 醒来后第一步
[醒来后最先要处理的事情]
## 关键上下文
[技术细节:代码路径、配置值、决策结论等,尽量详尽]
## 状态
pending / all_done
```
## 执行流程
### Step 1:获取当前 Session Key
**这是最关键的步骤——必须睡你自己的 session,不是别人的。**
执行以下命令获取当前 session 的 key:
```bash
openclaw session current
```
输出格式如:`agent:main:feishu:group:oc_87d0d49f1f81f9e1b8dd1d5ad5f9ec72`
**记录下来,后续两步都要用到这个 key。**
### Step 2:评估并记录
根据"记录要求"逐项填写上述格式,写入:
```
$HOME/.openclaw/workspace/previews/{你的sessionKey}.md
```
⚠️ **路径说明**:
- 把 preview 写到**你自己**工作空间下的 `previews/` 目录
- main agent 路径是 `$HOME/.openclaw/workspace/previews/`
- 文件名用**你刚获取的 session key**,不是别人的
### Step 3:判断状态
- 有未完成事项 → 状态写 `pending`
- 全部完成 → 状态写 `all_done`
### Step 4:通过 Gateway API reset 你自己的 session
写入文件后,必须调用 Gateway API 才能真正 reset session:
```bash
#!/bin/bash
# 以下全部使用你自己的 session key
AGENT_SESSION_KEY="agent:main:feishu:group:oc_87d0d49f1f81f9e1b8dd1d5ad5f9ec72" # 替换为 Step 1 获取的值
PREVIEW_DIR="$HOME/.openclaw/workspace/previews" # 替换为你的工作空间路径
mkdir -p "$PREVIEW_DIR"
TOKEN="$(cat ~/.openclaw/openclaw.json | python3 -c "import json,sys; c=json.load(sys.stdin); print(c['gateway']['auth']['token'])")"
openclaw gateway call sessions.reset
--token "$TOKEN"
--json
--params "{"key":"$AGENT_SESSION_KEY"}"
```
⚠️ **关键提醒**:
- `$AGENT_SESSION_KEY` 必须填**你自己的 session key**,不是 main 或其他 agent 的
- **只写 preview 不调用 reset** = hook 不会触发,preview 不会被注入
- Reset 的是**你自己的 session**,Gateway 会触发 `agent:bootstrap`,hook 会在你重新被唤醒时注入 preview
## 设计原则
- **只记未完成的**:已完成的不需要记录,记忆里可以回忆
- **细节越多越好**:宁可写多也不要写少,特别是技术上下文
- **文件独立**:每个 session key 独立文件,互不影响
- **Reset 才触发**:Hook 只在 `agent:bootstrap` 时触发,对应 `/new` 或 `/reset`
- **温和 reset**:使用 `sessions.reset` API 重置上下文,不删除 session 文件,不断开连接