Skip to content
Skills Library
AI & agents · Automation

skillopt-sleep

/skillopt-sleep

Use when the user wants the dsh agent to self-improve from past usage, asks about a nightly/offline 'sleep' or 'dream' cycle, skill/memory consolidation, or says things like 'make my agent better the more I use it', 'review my past sessions', 'learn my preferences', 'consolidate what you learned', 'run the sleep cycle', or wants to schedule background self-optimization. Drives the skillopt_sleep engine through the skillopt_* tools: harvest past sessions -> mine recurring tasks -> replay via a selected backend -> consolidate validated skills behind a held-out gate.

Repository
SkillOpt ↗
Licence
MIT
Last repository change
25.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when the user wants the dsh agent to self-improve from past usage, asks about a nightly/offline 'sleep' or 'dream' cycle, skill/memory consolidation, or says things like 'make my agent better the more I use it', 'review my past sessions', 'learn my preferences', 'consolidate what you learned', 'run the sleep cycle', or wants to schedule background self-optimization. Drives the skillopt_sleep engine through the skillopt_* tools: harvest past sessions -> mine recurring tasks -> replay via a selected backend -> consolidate validated skills behind a held-out gate.

Triggers from the description

sleepdreammake my agent better the more I use itreview my past sessionslearn my preferencesconsolidate what you learnedrun the sleep cycle
Original author description

Use when the user wants the dsh agent to self-improve from past usage, asks about a nightly/offline 'sleep' or 'dream' cycle, skill/memory consolidation, or says things like 'make my agent better the more I use it', 'review my past sessions', 'learn my preferences', 'consolidate what you learned', 'run the sleep cycle', or wants to schedule background self-optimization. Drives the skillopt_sleep engine through the skillopt_* tools: harvest past sessions -> mine recurring tasks -> replay via a selected backend -> consolidate validated skills behind a held-out gate.

How it works

  1. When to use
  2. The cycle (six stages)
  3. Driving it
  4. Parameters
  5. Configuration (cordis.yml / bundle patch)
  6. Hard rules
  7. Validate / demo (no API spend)
Original SKILL.md headings · 118 lines, 680 words
SKILL.md preview
---
name: skillopt-sleep
description: "Use when the user wants the dsh agent to self-improve from past usage, asks about a nightly/offline 'sleep' or 'dream' cycle, skill/memory consolidation, or says things like 'make my agent better the more I use it', 'review my past sessions', 'learn my preferences', 'consolidate what you learned', 'run the sleep cycle', or wants to schedule background self-optimization. Drives the skillopt_sleep engine through the skillopt_* tools: harvest past sessions -> mine recurring tasks -> replay via a selected backend -> consolidate validated skills behind a held-out gate."
---

# SkillOpt-Sleep: usage-driven self-evolution for the dsh agent

SkillOpt-Sleep is Microsoft's [SkillOpt](https://github.com/microsoft/SkillOpt)
deployment-time companion engine: it reviews your past sessions (harvest), mines
recurring tasks (mine), replays them through a selected backend (replay), and
consolidates what it learns into skill documents behind a **held-out validation
gate** (consolidate).

This skill drives the engine through the 7 `skillopt_*` tools exposed by the
dsh-skillopt plugin. The default `mock` backend makes no model calls, which is
useful for verifying the plumbing; a real backend consumes your API budget.

## When to use

- "make my agent better the more I use it" / "learn my preferences across sessions"
- a one-off **offline self-evolution / sleep / dream** run (immediate or scheduled)
- review past sessions/trajectories and distill recurring tasks
- consolidate feedback into `AGENTS.md` / `SKILL.md` / managed skills
- schedule (cron) the cycle, or adopt a staged proposal

## The cycle (six stages)

1. **Harvest** — read-only scan of supported local session records → digests
2. **Mine** — digests → recurring task records (intent + outcome labels + checkable refs)
3. **Replay** — re-run tasks under the current skill+memory with the selected backend → (hard, soft) scores
4. **Consolidate** — reflect on failures → propose bounded edits → **validation gate** on a held-out slice (default: accept only on strict improvement)
5. **Stage** — write accepted proposals to `<project>/.skillopt-sleep/staging/<timestamp>/`. **Live files are unchanged.** A rejected run still has a report but no proposal files.
6. **Adopt** — explicit (or operator-configured `--auto-adopt`) copies staged files over live ones, backing up first.

## Driving it

Prefer the tools over hand-editing files:

| Tool | Behavior |
|---|---|
| `skillopt_status` | state, engine availability, latest staged proposal & report |
| `skillopt_dry_run` | full preview (harvest+mine+replay), stages nothing |
| `skillopt_run` | full cycle, stages a proposal (live files unchanged by default) |
| `skillopt_adopt` | apply latest staged proposal (with backup) — the live-change boundary |
| `skillopt_harvest` | read-only show/export of mined tasks |
| `skillopt_schedule` / `skillopt_unschedule` | install/remove the nightly cron entry for this project |

Typical flow:

```text
# 1. check state (default mock backend, zero cost)
skillopt_status

# 2. preview the cycle
skillopt_dry_run project=<dir> source=<claude|codex|…>

# 3. real run (consumes the selected backend's API budget)
skillopt_run project=<dir> backend=<codex|claude|…> preferences="Prefer pytest; keep commits imperative."

# 4. review the report, then adopt
skillopt_adopt project=<dir>

# 5. schedule nightly at 03:17
skillopt_schedule project=<dir> hour=3 minute=17 backend=<codex>
```

## Parameters

| Parameter | Default | Meaning |
|---|---|---|
| `project` | config or cwd | project directory to evolve |
| `backend` | `mock` | `mock\|claude\|codex\|copilot\|cursor\|pi\|opencode\|handoff\|azure_openai` (mock = no model calls) |
| `source` | config | transcript source: `claude\|codex\|copilot\|cursor\|pi\|opencode\|auto` |
| `model` | backend default | replay model override |
| `maxTasks` | 40 | mined-task cap |
| `preferences` | empty | house rules for the reflection prior (e.g. "always use async/await") |

## Configuration (cordis.yml / bundle patch)

```yaml
- insert:
    - id: skillopt
      name: './src/index.js'
      config:
        backend: codex
        project: /path/to/project
        preferences: 'Always use async/await'
        # auto-adopt is OPERATOR-ONLY — the model cannot set it
        autoAdopt: false
```

Advanced engine keys go in `~/.skillopt-sleep/config.json`:
`gate_mode` (on/off), `gate_metric` (hard/soft/mixed), `gate_no_regression`,
`dream_rollouts`, `recall_k`, `evolve_memory` / `evolve_skill`.

## Hard rules

- **Never** hand-edit `AGENTS.md` / `SKILL.md` around `skillopt_adopt`; let the
  engine's explicit adopt (or operator-configured `--auto-adopt`) apply the
  staging manifest, backing up live files first.
- Harvest is read-only; `mock` replay has no side effects.
- Real backends send truncated transcript excerpts and derived tasks to the
  selected provider for mining/replay/judging/reflection. For sensitive
  sessions, export tasks first (`skillopt_harvest output=<file>`), redact, set
  the top-level `"reviewed"` to `true`, then replay with `--tasks-file`; real
  backends refuse unreviewed task files.
- Show the user the **held-out baseline → candidate** score and the exact
  proposed edits before suggesting adoption. Evidence before adoption.

## Validate / demo (no API spend)

```bash
pip install skillopt
python -m skillopt_sleep.experiments.run_experiment --persona researcher --assert-improves
```

Deterministic synthetic demo: the score rises and the gate blocks a regression.
It validates the mechanism, not effectiveness on your own tasks.

See the [SkillOpt-Sleep docs](https://github.com/microsoft/SkillOpt/tree/main/docs/sleep)
for recorded results and limitations.

Versions

RepositoryScoreLicence
This page · microsoft/SkillOpt100MIT
microsoft/SkillOpt100MIT
microsoft/SkillOpt100MIT
pleaseai/claude-code-plugins100MIT
edmundmiller/dotfiles100MIT
alirezarezvani/claude-skills100MIT
microsoft/SkillOpt98MIT
microsoft/SkillOpt95MIT

Database snapshot: 13.11.2026 · package version baceac503003 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100sleep
    Use Sleep's reviewable T0 to T1 to T2 memory cycle in Pi or OmO. Use when the user asks to capture a durable observation, run sleep or dream, inspect provisional memory, measure replay, or promote an approved candidate.
  • 95sleep
    Run the memory sleep cycle - capture wake observations, consolidate them into provisional candidates, review them, and promote only what replay has measured. Use when the user asks to save what was learned, run a memory/sleep pass, review provisional memory, or asks why memory…
  • 100agent-sleep
    Sleep-cycle memory management for coding agents. Use when consolidating a finished session into memory, running daily memory hygiene or drift checks, prestudying a repo before the next session, reconciling accumulated memory, rebuilding memory from source, or installing the…
  • 100memory-consolidate
    Consolidate brain memory and mine user sessions since the last consolidation checkpoint (sleep-cycle style). Use to reduce noisy prompt injection while preserving durable high-value memories.
  • 90skillopt-setup
    Set up Microsoft SkillOpt for Agent Skills improvement. Use when installing SkillOpt, preparing per-skill train/val/test eval splits, configuring Codex CLI or provider-backed execution, running SkillOpt against SKILL.md bodies, reviewing best_skill.md, or importing optimized…
  • 91consolidate-memory
    Consolidate this project's durable memory — the agent equivalent of sleep-time memory consolidation. Reads recent session work + git history, verifies every candidate fact against the LIVE codebase, and reconciles BOTH memory stores (the repo's MEMORY.md/AGENTS.md/CLAUDE.md and…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.