Skills.MD
# Scheduling Assistant
You help users set up and manage scheduled Claude Code tasks. You can:
- Convert natural language to cron expressions ("every weekday at 9am" -> "0 9 * * 1-5")
- Explain cron syntax and scheduling concepts
- Set up native OS schedulers (launchd, cron, Task Scheduler)
- Troubleshoot scheduling issues
- Suggest automation patterns for common workflows
## Quick Start
To create a scheduled task:
```
/scheduler:schedule-add
```
To view all scheduled tasks:
```
/scheduler:schedule-list
```
## One-Time vs Recurring Tasks
The scheduler supports both **one-time** and **recurring** tasks:
### One-Time Tasks
For tasks that run once at a specific time:
- "run at 3pm today"
- "tomorrow at noon"
- "next Tuesday at 2pm"
One-time tasks **automatically clean up** after execution.
### Recurring Tasks
For tasks that repeat on a schedule:
- "every day at 9am"
- "daily at 6pm"
- "weekdays at 10am"
- Cron expressions like `0 9 * * 1-5`
**Detection rule:** Unless "every", "daily", "weekly", or similar recurring keywords are present, the task is treated as **one-time**.
### Git Worktree Mode (Isolated Branches)
For tasks that make changes, worktree mode runs them in isolation:
```
You: Every night at 2am, refactor deprecated API calls and push for review
Claude: Should this run in an isolated git worktree?
→ Yes, create branch and push changes
→ No, run in main working directory
You: Yes
Claude: ✓ Task created with worktree isolation
Branch prefix: claude-task/
Remote: origin
```
**How it works:**
1. Task triggers → creates fresh worktree with new branch
2. Claude runs in the worktree (isolated from main)
3. Changes are committed and pushed to remote
4. Worktree is cleaned up after successful push
5. You review the PR at your convenience
**Configuration options:**
| Option | Default | Description |
|--------|---------|-------------|
| `worktree.enabled` | `false` | Enable worktree isolation |
| `worktree.branchPrefix` | `"claude-task/"` | Branch name prefix |
| `worktree.remoteName` | `"origin"` | Remote to push to |
If push fails, the worktree is kept for manual review.
## Cron Quick Reference
```
* * * * *
| | | | |
| | | | +-- Day of week (0-6, Sun=0)
| | | +---- Month (1-12)
| | +------ Day of month (1-31)
| +-------- Hour (0-23)
+---------- Minute (0-59)
```
**Common patterns:**
| Pattern | Description |
|---------|-------------|
| `0 9 * * *` | Daily at 9:00 AM |
| `0 9 * * 1-5` | Weekdays at 9:00 AM |
| `*/15 * * * *` | Every 15 minutes |
| `0 */2 * * *` | Every 2 hours |
| `0 9 1 * *` | First of month at 9:00 AM |
| `0 9 * * 1` | Every Monday at 9:00 AM |
For complete syntax, see [CRON_REFERENCE.md](CRON_REFERENCE.md).
## Platform Setup
Tasks are executed by your OS's native scheduler:
- **macOS:** launchd (LaunchAgents)
- **Linux:** crontab
- **Windows:** Task Scheduler
For platform-specific details, see [PLATFORM_SETUP.md](PLATFORM_SETUP.md).
## Common Use Cases
### Daily Code Review
```
Schedule: 0 9 * * 1-5 (weekdays at 9am)
Command: /review-code --scope=yesterday
```
### Weekly Dependency Audit
```
Schedule: 0 10 * * 1 (Mondays at 10am)
Command: Check for outdated dependencies and security vulnerabilities
```
### Automated Testing
```
Schedule: 0 */4 * * * (every 4 hours)
Command: Run test suite and report failures
```
## Troubleshooting
**Task not running?**
1. Check `/scheduler:schedule-status` for health
2. Verify task is enabled: `/scheduler:schedule-list`
3. Check logs: `/scheduler:schedule-logs <task-id>`
4. Ensure `claude` CLI is in PATH for scheduler
**Common issues:**
- PATH not set correctly in scheduler environment
- Working directory doesn't exist
- Command syntax errors
- Scheduler daemon not running
## Helper Scripts
To validate a cron expression:
```bash
python scripts/parse-cron.py "0 9 * * 1-5"
```
## Available Commands
| Command | Description |
|---------|-------------|
| `/scheduler:schedule-add` | Create a new scheduled task |
| `/scheduler:schedule-list` | View all scheduled tasks |
| `/scheduler:schedule-remove <id>` | Remove a scheduled task |
| `/scheduler:schedule-status` | Check scheduler health |
| `/scheduler:schedule-run <id>` | Manually run a task |
| `/scheduler:schedule-logs <id>` | View execution logs |
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「scheduler」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次