简介
本地运行的智能场景切换器,自动识别工作/生活/创作状态,零数据外泄,帮助用户专注当下。
原始描述
Switches OpenClaw between life modes (Work/Focus, Personal, Creative, Do Not Disturb). Triggered by natural language or calendar events. Each mode reshapes n...
通过你的 Agent 添加
安装目录:context-switcher/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心功能
Context Switcher 是一款专为 OpenClaw 设计的本地化场景管理技能,通过自然语言或日历事件自动切换四种生活模式:Work/Focus(工作专注)、Personal(个人生活)、Creative(创意创作)、Do Not Disturb(完全免打扰)。每种模式不仅是一个标签,而是一套完整的环境重塑方案——包括智能通知过滤、记忆上下文切换、响应风格调整,以及自动恢复机制。
显著优点
-
完全本地化,零隐私风险:所有状态存储于
~/.openclaw/skills/context-switcher/,无需 API 密钥,不调用任何外部服务,数据不出本机。 -
深度场景感知:通过关键词触发(如 "deep work"、"family time")或日历事件自动识别(如 "standup"、"gym"),无需手动操作即可无缝切换。
-
记忆上下文管理:自动保存切换前状态(
pre-switch-state.json),恢复时提供 "while you were away" 摘要,确保任务不遗漏。 -
差异化响应策略:工作模式简洁任务导向,创意模式鼓励发散联想,个人模式温暖对话,DND 模式完全静默仅记录日志。
-
灵活的自动恢复:支持基于日历事件时长或用户指定时间的自动恢复,也可随时手动退出。
潜在局限
- 依赖 OpenClaw 生态:通知控制、日历读取等功能依赖 OpenClaw 底层能力,若主平台未集成则部分功能受限。
- 初始配置成本:需手动编辑
modes/*.md文件定义个人工作/生活项目,首次使用有一定设置门槛。 - 无跨设备同步:纯本地存储,多设备使用需分别配置。
- 自动触发误识别风险:日历关键词匹配可能产生误判(如 "creative writing class" 被误触发创意模式)。
适合人群
- 需要严格区分工作与生活边界的远程工作者
- 创意从业者(作家、设计师、音乐人)追求深度沉浸
- ADHD 或注意力管理困难用户,需要外部系统辅助场景切换
- 隐私敏感用户,拒绝云端待办或时间管理工具
常规风险提示
尽管本技能设计安全,仍需注意:DND 模式会静默记录所有消息至 dnd-log.json,敏感信息虽本地存储但仍以明文形式存在;自动恢复机制依赖系统计时器,若设备休眠可能导致恢复延迟;建议定期检查 snapshots/ 目录避免日志文件累积占用空间。
技能正文
name: context-switcher version: 1.0.0 description: Switches OpenClaw between life modes (Work/Focus, Personal, Creative, Do Not Disturb). Triggered by natural language or calendar events. Each mode reshapes notification filtering, memory surface, response style, and auto-restores when the session ends. homepage: https://github.com/Taha2053/context-switcher metadata: clawdbot: emoji: "🎯" requires: env: [] files: - "scripts/" - "modes/"
Context Switcher
A skill that shifts your entire OpenClaw experience based on the mode of life you're in. Not just a label — each mode reshapes priorities, filters notifications, loads the right memory, and auto-restores when the session ends.
External Endpoints
| Endpoint | Purpose | Data Sent |
|---|---|---|
| None | This skill is fully local | Nothing leaves your machine |
This skill does not call any external APIs. All state is stored locally in ~/.openclaw/skills/context-switcher/.
Security & Privacy
- No external calls. Zero data is sent outside your machine.
- No credentials required. No API keys, tokens, or env vars needed.
- Local state only. Mode state is written to
current-context.jsonon your local filesystem. - Notification control relies on OpenClaw's built-in notification layer — no third-party access.
- Calendar reading uses OpenClaw's existing calendar integration if connected — this skill does not add new calendar permissions.
Trust Statement: This skill operates entirely on your local machine. No data is transmitted to any external service. Install with confidence.
Model Invocation Note
This skill may be invoked autonomously by OpenClaw when a trigger phrase is detected in your messages, or when a calendar event title matches a known mode keyword. You can disable auto-invocation at any time by saying "turn off context-switcher auto-trigger".
Modes
🧠 Work / Focus
Trigger phrases: "work mode", "focus mode", "I need to focus", "starting deep work", "heads down", "switch to work"
Behavior:
- Mute all non-urgent notifications (personal messages, social, news)
- Surface today's work tasks, open threads, and meeting schedule from
modes/work.md - Load work memory: current projects, deadlines, blockers, team context
- Respond concisely — task-oriented, no small talk, bullet points are fine
- Proactively flag time conflicts or approaching deadlines if detected
- Set auto-restore timer to next calendar event end time, or user-specified duration
Auto-trigger from calendar: event titles containing "standup", "sprint", "review", "interview", "deadline", "sync", "planning"
🏠 Personal
Trigger phrases: "personal mode", "personal time", "I'm off the clock", "home mode", "family time", "done for the day"
Behavior:
- Mute work-related notifications (work Slack, GitHub, work email)
- Surface personal tasks: errands, upcoming events, health goals from
modes/personal.md - Load personal memory: household tasks, personal goals, important people
- Respond warmly and conversationally — no corporate tone
- Do not proactively surface work items unless explicitly asked
Auto-trigger from calendar: event titles containing "gym", "dinner", "family", "personal", "vacation", "appointment", "errand"
🎨 Creative
Trigger phrases: "creative mode", "creative session", "I'm creating", "brainstorm mode", "ideation time", "let's build"
Behavior:
- Mute all notifications — zero interruptions
- Surface creative context from
modes/creative.md: active projects, saved ideas, references - Load creative memory: current projects, style notes, open creative loops
- Respond expansively — "yes, and..." style, encourage tangents and exploration
- Never filter or critique ideas unless explicitly asked
- Offer unexpected connections and lateral thinking prompts
Auto-trigger from calendar: event titles containing "writing", "design", "recording", "art", "brainstorm", "creative", "draft"
🔕 Do Not Disturb
Trigger phrases: "DND", "do not disturb", "going dark", "don't bother me", "full silence", "leave me alone"
Behavior:
- Mute ALL notifications without exception
- Do not proactively surface anything
- Only respond if directly addressed by name or keyword
- Log all incoming messages and tasks silently to
snapshots/dnd-log.jsonfor review on exit - No auto-restore unless user sets an explicit timer
Auto-trigger from calendar: event titles containing "blocked", "deep work", "no meetings", "offline", "focus block", "DND"
Switching Logic
When a context switch is detected (via phrase or calendar):
- Identify target mode from trigger phrase or calendar event title
- Save current state — snapshot active memory focus to
snapshots/pre-switch-state.json - Apply mode profile — load the correct
modes/*.md, apply notification rules, set response style - Confirm switch with a brief, mode-appropriate message (see Confirmation Messages below)
- Set auto-restore — use calendar event end time, or ask user for duration if unclear
- On restore — un-mute, reload previous state, deliver catch-up summary
Confirmation Messages
Short and mode-appropriate:
- Work/Focus: "Focus mode on. Notifications muted. Here's what needs your attention: [task summary]. I'll restore at [time]."
- Personal: "Personal mode on. Work notifications paused. Here's your afternoon: [personal summary]."
- Creative: "Creative mode. Silence on. Let's build something. What are we working on?"
- DND: "DND on. I'll log everything. See you on the other side."
Auto-Restore
When a session ends (timer fires or calendar event ends):
- Un-mute notifications and restore previous memory context
- Deliver a brief "while you were away" summary — messages received, tasks that came in, anything time-sensitive
- Ask if user wants to stay in current mode or switch back
Example Interactions
"Switch to focus mode for 2 hours"
→ Mutes notifications, surfaces work tasks, sets 2hr restore timer
"Creative mode — working on my novel"
→ Loads creative memory, silences everything, responds expansively
"DND until my next meeting"
→ Reads calendar, sets restore to next event start, full silence
"Personal time, I'm done for the day"
→ Pauses work channels, surfaces evening personal tasks
"What mode am I in?"
→ Reports current mode, time active, scheduled restore
"Exit focus mode early"
→ Restores previous state, delivers catch-up summary
File Structure
context-switcher/
├── SKILL.md ← You are here
├── README.md ← Install guide
├── current-context.json ← Live mode state tracker
├── modes/
│ ├── work.md ← Customize your work profile
│ ├── personal.md ← Customize your personal profile
│ └── creative.md ← Customize your creative profile
├── scripts/
│ ├── switch.sh ← Core switching logic
│ ├── restore.sh ← Auto-restore handler
│ └── summarize.sh ← Catch-up summary generator
└── snapshots/
├── pre-switch-state.json ← State saved before each switch
└── dnd-log.json ← Messages logged during DND
Setup
On first run, OpenClaw will prompt you to:
- Customize each mode profile in
modes/*.md— add your actual projects, priorities, and people - Set default durations per mode (fallback if no calendar event found)
- Optionally connect your calendar for auto-trigger support
You can re-run setup at any time by saying: "reconfigure context-switcher".
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。