agentleFS
MicrosoftKnown publishermicrosoft/SkillOpt/plugins/cursor/skills/skillopt-sleep/SKILL.md

skillopt-sleep

Skill18k starsChanged 4 months agoMITView on GitHub

Use when the user wants Cursor to learn from recent local sessions, asks for an offline sleep or dream cycle, wants to consolidate recurring work into a Cursor skill, or requests SkillOpt-Sleep status, harvest, dry-run, run, scheduling, review, or adoption. Drives the validation-gated skillopt_sleep engine with Cursor transcripts and the optional Cursor Agent CLI backend.

2 other projects use a version of this.

Trending

Less talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 4 mentionsJun 2026: 12 mentionsJul 2026: 15 mentionsAug 2026: 3 mentionsSep 2026: 8 mentionsOct 2026: 9 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/SkillOpt repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about microsoft/SkillOpt

The biggest 5 of 51 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 51

Talked about on GitHub, Bluesky and Hacker News (51 times).

On GitHub · 48

43 more on GitHub
  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. Hassaan146/claude-skills★ 18same name
    2. wm2313/my-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 7 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Always use this project-relative target for Cursor-visible learning:

    line 19
  2. Distinctive:

    Use one of these supported command paths consistently:

    line 35
  3. Very specific:

    If SKILLOPT_SLEEP_REPO is not set and skillopt-sleep is unavailable, stop and explain that the engine must be installed or a SkillOpt …

    line 44
  4. Distinctive:

    Adopt: only after review, backing up existing live targets first.

    line 58
  5. Very specific:

    Use the installed-command form below, or replace skillopt-sleep with the platform-specific source runner described above.

    line 62
  6. Very specific:

    Default backend is mock, which is deterministic and makes no provider calls.

    line 95
  7. Very specific:

    Check model identifiers with cursor-agent --list-models.

    line 106
  8. Very specific:

    Keep live runs bounded with --max-sessions, --max-tasks, and --progress.

    line 108
  9. Very specific:

    Read staged report.md before summarizing a run.

    line 213
  10. Distinctive:

    Never hand-edit the target skill or CLAUDE.md as a substitute for adoption.

    line 220
  11. Distinctive:

    Do not run a real backend on sensitive content without confirming its data boundary or using the reviewed-task workflow.

    line 221
  12. Distinctive:

    Do not add a session-end hook or imply that installing this plugin schedules anything.

    line 223
  13. Distinctive:

    Treat generated edits as proposals, not as source of truth.

    line 226

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SkillOpt-Sleep for Cursor

SkillOpt-Sleep reviews recent local Cursor sessions, mines recurring tasks, replays those tasks, and proposes bounded improvements to a project Cursor skill. With the default gate enabled, a proposal is accepted only when it improves the held-out score. A normal run stages the proposal for review; nothing live changes until explicit adoption. There is no model-weight training.

This plugin has no session-end hook and no MCP server. Run the cycle only when the user asks, or install a schedule only when the user explicitly requests one.

Cursor target

Always use this project-relative target for Cursor-visible learning:

.cursor/skills/skillopt-sleep-learned/SKILL.md

Pass it through --target-skill-path on harvest, dry-run, and run. Without an explicit target, the shared engine uses a Claude-managed skill under ~/.claude/skills, which is not the intended Cursor project skill.

The shared engine can also evolve project CLAUDE.md. If that secondary memory target is unwanted, set "evolve_memory": false in ~/.skillopt-sleep/config.json before running.

Choose the runner

Use one of these supported command paths consistently:

  1. Source checkout on macOS/Linux: bash "$SKILLOPT_SLEEP_REPO/plugins/run-sleep.sh" <action> ...
  2. Source checkout on Windows: powershell -File "$env:SKILLOPT_SLEEP_REPO\plugins\run-sleep.ps1" <action> ...
  3. Installed engine on any platform: skillopt-sleep <action> ...

If SKILLOPT_SLEEP_REPO is not set and skillopt-sleep is unavailable, stop and explain that the engine must be installed or a SkillOpt checkout must be selected. Do not substitute a hand-written edit for the engine workflow.

Core workflow

  1. Harvest local Cursor JSONL transcripts read-only.
  2. Mine recurring, checkable task records from session digests.
  3. Replay tasks under the current skill and memory through the selected backend.
  4. Reflect on failures and propose bounded edits.
  5. Gate the candidate on held-out real tasks.
  6. Stage accepted proposals under <project>/.skillopt-sleep/staging/<timestamp>/.
  7. Adopt only after review, backing up existing live targets first.

Commands

Use the installed-command form below, or replace skillopt-sleep with the platform-specific source runner described above.

TARGET_SKILL=.cursor/skills/skillopt-sleep-learned/SKILL.md

# Inspect current state and the latest staged proposal.
skillopt-sleep status --project "$(pwd)"

# Inspect mined tasks without provider spend.
skillopt-sleep harvest --project "$(pwd)" --source cursor \
  --target-skill-path "$TARGET_SKILL" --max-sessions 5 --max-tasks 3

# First smoke check: deterministic and no provider calls.
skillopt-sleep dry-run --project "$(pwd)" --source cursor --backend mock \
  --target-skill-path "$TARGET_SKILL" --max-sessions 5 --max-tasks 3 --json

# Model-driven optimization through the authenticated Cursor Agent CLI.
skillopt-sleep run --project "$(pwd)" --source cursor --backend cursor \
  --target-skill-path "$TARGET_SKILL" \
  --max-sessions 5 --max-tasks 3 --progress

# Inspect selections, then apply the reviewed managed proposal.
skillopt-sleep status --project "$(pwd)"
skillopt-sleep adopt --project "$(pwd)" --legacy

For fan-out proposals, use repeatable --skill NAME or --all-skills after review. Bare adopt deliberately refuses a night containing fan-out rows.

Actions are status, harvest, dry-run, run, adopt, schedule, and unschedule.

  • Default backend is mock, which is deterministic and makes no provider calls.
  • --backend cursor uses the user's authenticated Cursor Agent CLI budget for model-driven mining, replay, judging, and reflection.
  • --source cursor reads ~/.cursor/projects/<workspace>/agent-transcripts/*/*.jsonl.
  • --cursor-home PATH overrides the Cursor home used for harvesting.
  • --scope invoked selects the current workspace; --scope all includes every Cursor workspace.
  • --cursor-path PATH or SKILLOPT_SLEEP_CURSOR_PATH selects a non-default cursor-agent executable.
  • --model NAME or SKILLOPT_SLEEP_CURSOR_MODEL overrides the Cursor model.
  • Check model identifiers with cursor-agent --list-models; when cost matters, verify the billed variant in Cursor's usage reporting.
  • Keep live runs bounded with --max-sessions, --max-tasks, and --progress.
  • A held-out gain is evidence for that run, not a promise of general improvement.

The first harvest uses a 72-hour lookback. Use --lookback-hours N for a wider initial window or --lookback-hours 0 for all available history. A stateful run, including a no-task run, records a harvest checkpoint; later runs use the checkpoint rather than the initial lookback. Inspect counts with harvest or dry-run before the first real run because those actions do not advance state.

Available backends are:

  • mock - deterministic, with no provider calls (default);
  • cursor - the authenticated Cursor Agent CLI;
  • claude - the authenticated Claude CLI;
  • codex - the authenticated Codex CLI;
  • copilot - the authenticated GitHub Copilot CLI;
  • handoff - prompt/answer files for an interactive agent session;
  • azure_openai - the configured Azure OpenAI endpoint.

SkillOpt reads the target skill and inserts its text into replay prompts; it does not invoke the file as a native Cursor skill. Ordinary Cursor backend calls run in a new empty temporary workspace in read-only Ask mode. File reads, file writes, and MCP tools are denied. --project controls harvesting, target files, state, and staging; it is not the Cursor Agent execution workspace.

Cursor tool-aware replay is temporarily disabled pending live Cursor permission-boundary validation. A task containing a tool_called check fails nonzero before Agent mode starts. The failed replay does not add a cache entry, stage, adopt, persist state, or advance the harvest checkpoint. Use another backend for those tasks. Do not claim that repository- or tool-dependent behavior was validated. The current engine does not implement a fresh-worktree replay for Cursor.

A real-backend dry-run still makes provider calls; it only suppresses staging. Session and task limits are workload bounds, not hard limits on calls, tokens, time, or money. Start with small limits.

Reviewable data path

Cursor harvesting retains user/assistant text, tool names, and explicit turn errors while excluding raw tool arguments, tool outputs, and non-message records. Known secret-shaped strings are redacted, but pattern-based redaction cannot guarantee that a transcript is safe to send to a provider.

For sensitive sessions, export tasks before any real-backend replay:

TARGET_SKILL=.cursor/skills/skillopt-sleep-learned/SKILL.md
skillopt-sleep harvest --project "$(pwd)" --source cursor \
  --target-skill-path "$TARGET_SKILL" \
  --max-sessions 5 --max-tasks 3 --output reviewed-tasks.json

Inspect and redact the file, then set its top-level "reviewed" field to true. Only then run:

skillopt-sleep dry-run --project "$(pwd)" --backend cursor \
  --tasks-file reviewed-tasks.json --progress --json

Real backends reject task files that remain unreviewed. Never include raw transcripts, credentials, secrets, or sensitive task content in messages, commits, or generated summaries.

gate_no_regression is a config-only safeguard in ~/.skillopt-sleep/config.json. It defaults to false; set it to true to reject a candidate when any validation task's configured gate score decreases.

Scheduling

Scheduling is opt-in. The scheduler persists project, backend, time, and the optional auto-adopt flag, but not --source, Cursor path/home/model overrides, or --target-skill-path. Before scheduling a Cursor cycle, set at least these values in ~/.skillopt-sleep/config.json:

{
  "transcript_source": "cursor",
  "target_skill_path": ".cursor/skills/skillopt-sleep-learned/SKILL.md",
  "backend": "cursor"
}

Then run:

skillopt-sleep schedule --project "$(pwd)" --backend cursor --hour 3 --minute 17
skillopt-sleep unschedule --project "$(pwd)"

The scheduler uses cron on Unix and Task Scheduler on Windows. Scheduled runs stage proposals by default. Use --auto-adopt only when the user has explicitly requested unattended adoption.

Report results

For dry-run and run, report:

  • session and task counts;
  • held-out baseline and candidate scores;
  • gate action and accepted/rejected edit counts;
  • exact proposed edits;
  • staging directory, when one was created.

Read staged report.md before summarizing a run. Offer adoption only after the user reviews an accepted proposal that is still staged. Never claim broad improvement from one run.

Hard rules

  • Harvest is read-only. Never edit Cursor transcript files.
  • Never hand-edit the target skill or CLAUDE.md as a substitute for adoption.
  • Do not run a real backend on sensitive content without confirming its data boundary or using the reviewed-task workflow.
  • Do not add a session-end hook or imply that installing this plugin schedules anything.
  • Show validation evidence before recommending adoption.
  • Treat generated edits as proposals, not as source of truth.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.