|
| 1 | +--- |
| 2 | +name: skillopt-sleep-omp |
| 3 | +description: Use when the user wants OMP to run Microsoft SkillOpt-Sleep, learn from past OMP sessions, review or adopt staged skill improvements, or schedule an offline sleep/dream self-improvement cycle. |
| 4 | +--- |
| 5 | + |
| 6 | +# SkillOpt-Sleep for OMP |
| 7 | + |
| 8 | +This is the OMP thin shell for Microsoft SkillOpt-Sleep. It follows the upstream |
| 9 | +Claude Code, Codex, Devin, and OpenClaw pattern: harvest local agent sessions, |
| 10 | +mine recurring tasks, replay them offline, gate proposed memory/skill edits on a |
| 11 | +held-out score, and stage improvements for review before adoption. |
| 12 | + |
| 13 | +## When to use |
| 14 | + |
| 15 | +Use this when the user asks OMP to: |
| 16 | + |
| 17 | +- learn from prior OMP sessions or repeated feedback; |
| 18 | +- run a nightly/offline sleep, dream, or self-improvement cycle; |
| 19 | +- inspect SkillOpt-Sleep status, harvest, dry-run, run, adopt, schedule, or unschedule; |
| 20 | +- refine reusable Agent Skills from real OMP usage with validation gates. |
| 21 | + |
| 22 | +## Mechanism |
| 23 | + |
| 24 | +The upstream `skillopt_sleep` engine currently knows Claude Code and Codex |
| 25 | +transcript sources. The bundled wrapper mirrors OMP JSONL sessions into a |
| 26 | +Claude-compatible, sanitized mirror at `~/.skillopt-sleep/omp/claude-home`, then |
| 27 | +runs `python -m skillopt_sleep` with `--source claude --claude-home <mirror>`. |
| 28 | + |
| 29 | +- Source sessions: `~/.omp/agent/sessions/**/*.jsonl` |
| 30 | +- Mirror state: `~/.skillopt-sleep/omp/claude-home` |
| 31 | +- SkillOpt state/staging: managed by SkillOpt-Sleep, normally under |
| 32 | + `~/.skillopt-sleep/` |
| 33 | +- Live changes: none until `adopt`; every adoption is backed up by the engine |
| 34 | + |
| 35 | +Tool outputs are not mirrored. The wrapper keeps user/assistant text and |
| 36 | +assistant tool names, enough for SkillOpt to mine recurring task patterns without |
| 37 | +copying raw tool results. |
| 38 | + |
| 39 | +## Commands |
| 40 | + |
| 41 | +Set `SKILLOPT_SLEEP_REPO` when SkillOpt is cloned somewhere the wrapper cannot |
| 42 | +auto-detect: |
| 43 | + |
| 44 | +```bash |
| 45 | +export SKILLOPT_SLEEP_REPO=/path/to/SkillOpt |
| 46 | +``` |
| 47 | + |
| 48 | +Run from the project whose memory/skills should evolve: |
| 49 | + |
| 50 | +```bash |
| 51 | +# Safe smoke check, no proposal staged |
| 52 | +python skills/catalog/skillopt-sleep-omp/scripts/skillopt-sleep-omp.py dry-run \ |
| 53 | + --backend mock --max-sessions 5 --max-tasks 3 --progress |
| 54 | + |
| 55 | +# Full cycle; stages a proposal only |
| 56 | +python skills/catalog/skillopt-sleep-omp/scripts/skillopt-sleep-omp.py run \ |
| 57 | + --backend codex --max-sessions 10 --max-tasks 5 --progress |
| 58 | + |
| 59 | +# Inspect staged proposals and history |
| 60 | +python skills/catalog/skillopt-sleep-omp/scripts/skillopt-sleep-omp.py status |
| 61 | + |
| 62 | +# Adopt only after explicit review/approval |
| 63 | +python skills/catalog/skillopt-sleep-omp/scripts/skillopt-sleep-omp.py adopt |
| 64 | + |
| 65 | +# Nightly wrapper schedule; this installs cron for the OMP wrapper, not the |
| 66 | +# upstream bare `python -m skillopt_sleep run`. |
| 67 | +python skills/catalog/skillopt-sleep-omp/scripts/skillopt-sleep-omp.py schedule \ |
| 68 | + --hour 3 --minute 17 --backend codex --max-sessions 10 --max-tasks 5 |
| 69 | + |
| 70 | +python skills/catalog/skillopt-sleep-omp/scripts/skillopt-sleep-omp.py unschedule |
| 71 | +``` |
| 72 | + |
| 73 | +Actions are `status`, `harvest`, `dry-run`, `run`, `adopt`, `schedule`, and |
| 74 | +`unschedule`. `schedule` / `unschedule` are handled by this OMP wrapper so the |
| 75 | +nightly job refreshes the OMP transcript mirror before invoking SkillOpt-Sleep. |
| 76 | +Other actions pass through to upstream `python -m skillopt_sleep` with |
| 77 | +`--source claude` and the mirrored OMP home injected by default. Upstream flags |
| 78 | +such as `--target-skill-path`, `--tasks-file`, `--backend`, `--model`, |
| 79 | +`--edit-budget`, `--lookback-hours`, `--max-sessions`, `--max-tasks`, |
| 80 | +`--progress`, and `--json` pass through unchanged. |
| 81 | + |
| 82 | +Wrapper-only flags: |
| 83 | + |
| 84 | +| Flag | Meaning | |
| 85 | +| ----------------------- | -------------------------------------------------------------------------------------------- | |
| 86 | +| `--omp-sessions DIR` | Override the OMP session root. Defaults to `~/.omp/agent/sessions`. | |
| 87 | +| `--omp-mirror-home DIR` | Override the Claude-compatible mirror home. Defaults to `~/.skillopt-sleep/omp/claude-home`. | |
| 88 | +| `--help-omp-wrapper` | Show wrapper-specific help. | |
| 89 | +| `--self-test` | Validate the OMP-to-Claude transcript translator without SkillOpt. | |
| 90 | + |
| 91 | +## Recommended workflow |
| 92 | + |
| 93 | +1. Start with `dry-run --backend mock --json` to validate harvesting and task |
| 94 | + mining without API spend. |
| 95 | +2. For real improvement, use `run --backend codex` or another upstream-supported |
| 96 | + backend. Keep `--max-sessions`, `--max-tasks`, and budget flags bounded. |
| 97 | +3. Read the staged `report.md` and proposed edits before summarizing. |
| 98 | +4. Adopt only after explicit user approval. Do not hand-edit memory or skills as |
| 99 | + a substitute for `adopt`. |
| 100 | + |
| 101 | +## Safety rules |
| 102 | + |
| 103 | +- OMP session harvest is read-only; never edit `~/.omp/agent/sessions`. |
| 104 | +- Keep raw secrets, private transcript contents, and raw tool outputs out of |
| 105 | + chat, logs, commits, and generated skill text. |
| 106 | +- Treat generated edits as proposals until the held-out gate and human review |
| 107 | + approve them. |
| 108 | +- Prefer the `mock` backend for plumbing checks; real backends spend the user's |
| 109 | + own agent budget. |
| 110 | +- If using `--tasks-file` with a real backend, review and mark the task file as |
| 111 | + reviewed according to upstream SkillOpt-Sleep rules. |
0 commit comments