skillopt-sleep
它能做什么
回顾你过去在本地的 Codex 会话,找出重复出现的任务,并提出改进某个技能的建议。适合希望 Codex 智能体从自身历史中变好、而无需手动改写的人。
适用场景
- ✓当你希望 Codex 智能体从过去的会话中学习时。
- ✓当你希望每晚或按需回顾重复出现的任务时。
- ✓当你想检查或采用一项提议的技能修改时。
技能链接
https://github.com/microsoft/SkillOpt/blob/main/plugins/codex/skills/skillopt-sleep/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请回顾我过去的 Codex 会话,并为我的项目技能提出改进建议,但先不要修改任何正在使用的内容。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能会收集本地会话记录,挖掘重复任务,重放这些任务并提出修改。只有在保留验证集得分有所提高时,修改才会被保留;在你采用提案之前,正式内容不会发生任何变化。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
SkillOpt-Sleep: usage-driven self-evolution for a local Codex agent
SkillOpt-Sleep gives the user's Codex agent a sleep cycle. On demand or on a
nightly schedule, it reviews past local sessions, re-runs recurring tasks
through the selected backend, and proposes changes to a configured skill and to
the project's CLAUDE.md. With the default validation gate enabled, it keeps
only changes that improve a held-out score. Live files change only through
explicit adoption or a user-requested --auto-adopt. There is no model-weight
training.
The current shared engine does not write AGENTS.md. For a Codex-visible
result, always select a Codex skill explicitly with --target-skill-path (for
example .agents/skills/<name>/SKILL.md). If project CLAUDE.md is not a
desired secondary target, set "evolve_memory": false in
~/.skillopt-sleep/config.json before running.
When to use
Trigger when the user wants any of:
- Codex to learn from past sessions or get better the more they use it;
- a nightly/scheduled or on-demand sleep/dream/offline self-improvement run;
- to review past sessions and distill recurring tasks;
- to consolidate feedback into memory or managed skills;
- to run
status,harvest,dry-run,run, oradoptfor SkillOpt-Sleep.
The cycle
- Harvest - read local session transcripts according to the engine configuration and normalize them into session digests.
- Mine - turn digests into recurring
TaskRecords with outcomes and checkable references where possible. - Replay - re-run mined tasks through the selected backend under the current skill and memory.
- Consolidate - reflect on failures and propose bounded edits.
- Gate - with the default gate enabled, accept edits only when the held-out validation score improves.
- Stage - write the proposal under
<project>/.skillopt-sleep/staging/<date>/; nothing live changes. - Adopt - explicitly, or through user-requested auto-adopt, copy staged files over live files with backups for existing targets.
How to drive it
Invoke the bundled runner via shell (Codex exec has shell access). The runner
finds the engine and a Python >= 3.10 automatically.
# point at the repo if it isn't auto-detected from CWD:
export SKILLOPT_SLEEP_REPO=/path/to/SkillOpt
TARGET_SKILL=.agents/skills/example/SKILL.md
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" status --project "$(pwd)"
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" harvest --project "$(pwd)" \
--source codex --target-skill-path "$TARGET_SKILL"
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" dry-run --project "$(pwd)" \
--source codex --target-skill-path "$TARGET_SKILL" --backend mock
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" run --project "$(pwd)" \
--source codex --target-skill-path "$TARGET_SKILL" --backend codex \
--max-sessions 5 --max-tasks 3 --progress
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" status --project "$(pwd)"
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" adopt --project "$(pwd)" --legacy
For a fan-out night, select reviewed proposals with repeatable
--skill NAME or --all-skills; do not treat bare adopt as “adopt everything.”
On Windows (CMD / PowerShell):
:: CMD
set SKILLOPT_SLEEP_REPO=C:\path\to\SkillOpt-Sleep
"%SKILLOPT_SLEEP_REPO%\plugins\run-sleep.cmd" status --project "%CD%"
# PowerShell
$env:SKILLOPT_SLEEP_REPO = "C:\path\to\SkillOpt-Sleep"
powershell -File "$env:SKILLOPT_SLEEP_REPO\plugins\run-sleep.ps1" status --project "$(pwd)"
Actions are status, harvest, dry-run, run, adopt, schedule, and unschedule.
- Default backend is
mock, which is deterministic and spends no API budget. --backend codexuses the user's Codex budget for model-driven optimization. An accepted held-out gain is run-specific evidence, not a guarantee of broader improvement; results depend on the tasks, model, and checks.--source codexreads Codex Desktop archived sessions from~/.codex/archived_sessions; use--codex-home /path/to/.codexif the archive lives elsewhere.--target-skill-pathis required for a Codex skill target. Without it, the shared default is a Claude-managed skill under~/.claude/skills/, not an.agentsskill.- Keep
dry-run --backend mockas the first smoke check unless the user explicitly asked for a real optimization run.
Scheduling
bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" schedu
常见问题
它会自动修改我的文件吗?
不会。只有你明确采用提案时,正式文件才会改变,除非你要求自动采用。
它会训练模型吗?
不会。它不做模型权重训练,只编辑技能和记忆文档。
它能在后台运行吗?
可以。它可以设置为定时运行,例如每晚运行。
详情
作者的原始描述
Use when the user wants Codex to self-improve from past usage, asks about a nightly/offline 'sleep' or 'dream' cycle, wants Codex to review past sessions, learn preferences, consolidate memory/skills, run dry-run/run/adopt/status for SkillOpt-Sleep, or schedule background self-optimization. Drives the skillopt_sleep engine: harvest past sessions -> mine recurring tasks -> replay through a selected backend -> consolidate validated memory + skills behind a held-out gate.
repo: microsoft/SkillOpt
热度
- GitHub 星标
- 19k
- 排名
- #10500
- 许可证
- MIT
- 更新时间
- 2026/11/1
评论
- …