mirror of
https://github.com/microsoft/SkillOpt.git
synced 2026-07-06 07:32:34 +08:00
Restructure into plugins/{claude-code,codex,copilot}/ — one engine, three thin
shells, all calling the shared plugins/run-sleep.sh -> python -m skillopt_sleep.
- claude-code/: existing plugin moved here; runner delegates to the shared
launcher (fixes repo-root resolution after the move).
- codex/: ~/.codex/prompts/sleep.md custom prompt + ~/.agents/skills SKILL.md +
install.sh + AGENTS.md hint — Codex's documented, stable extension surfaces.
- copilot/: a stdlib-only MCP server (mcp_server.py) exposing sleep_* tools,
plus mcp-config.example.json and a copilot-instructions snippet. Verified end
to end (initialize -> tools/list -> tools/call returns real engine output).
- plugins/README.md overview table; main README News + a dedicated SkillOpt-Sleep
section; pyproject lists skillopt_sleep as a first-class package.
Decoupling emphasized throughout: open-source tool (skillopt_sleep/) with zero
dependency on the research package. 29 tests pass; all three shells resolve.
Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
30 lines
1.5 KiB
Bash
Executable File
30 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Print (does NOT install) a crontab line that runs SkillOpt-Sleep nightly.
|
|
# The user copies the line into `crontab -e` if they want it.
|
|
set -euo pipefail
|
|
|
|
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
|
|
RUNNER="$PLUGIN_ROOT/scripts/sleep.sh"
|
|
PROJECT="${1:-$(pwd)}"
|
|
BACKEND="${2:-mock}"
|
|
|
|
# 3:17am local — deliberately off the :00 mark so many users don't all hit the
|
|
# API at once (and we leave room for jitter).
|
|
MIN=17
|
|
HOUR=3
|
|
|
|
cat <<EOF
|
|
# ── SkillOpt-Sleep nightly cycle ────────────────────────────────────────────
|
|
# Review past sessions, replay tasks, stage validated memory/skill updates.
|
|
# Runs at ${HOUR}:$(printf '%02d' $MIN) local every day. Output goes to the project's
|
|
# .skillopt-sleep/ dir; nothing live is changed until you run '/sleep adopt'
|
|
# (unless you pass --auto-adopt below).
|
|
#
|
|
# Copy the next line into 'crontab -e':
|
|
${MIN} ${HOUR} * * * "${RUNNER}" run --project "${PROJECT}" --scope invoked --backend ${BACKEND} >> "${PROJECT}/.skillopt-sleep/cron.log" 2>&1
|
|
#
|
|
# For fully-autonomous adoption (power users), append: --auto-adopt
|
|
# To spend real API budget for genuine lift, set BACKEND=anthropic above.
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
EOF
|