Loading...
Loading...
Enables agents to register, manage, and execute scheduled tasks using OS native scheduler (crontab for Linux/WSL, launchd for macOS). No git, no dangerous flags, no session dependency. Tasks run headless, output to log files, user reads when ready. Use this skill when: - User wants to schedule recurring tasks with natural language - User mentions "every day at", "cada hora", "schedule", "programar", "automatizar" - User needs tasks to run without open session (headless) - User wants OS-level scheduling (crontab/launchd) - User mentions "cada minuto durante la próxima hora" or temporal intervals ACTIVATE when user mentions: "schedule", "programar", "cron", "cada día", "every hour", "automate", "tarea programada", "ejecutar automáticamente", "recordatorio", "cada minuto durante", "durante la próxima", "intervalo", "task scheduler", "opencode headless", "kiro scheduled", "background task", "tarea en segundo plano" DO NOT USE for: git operations, dangerous permissions, MCP sampling dependency.
npx skill4agent add jheisonmb/skills task-triggeruser: "every day at 9am summarize my memory MCP entries"
└→ You execute: /task-trigger:add
└→ You write crontab entry (Linux) or .plist (macOS)
└→ At scheduled time: CLI runs headless (opencode run or kiro chat)
└→ Output goes to log file
└→ User reads log when ready| Command | Description |
|---|---|
| Register a new task interactively (ALWAYS ask confirmation) |
| Start monitoring a file/directory for changes |
| Show all registered tasks |
| List active file watchers |
| Remove a task + clean scheduler |
| Stop monitoring a file/directory |
| View execution history |
| Execute task immediately |
| Check scheduler health + time remaining |
| Script | Purpose | Usage |
|---|---|---|
| Detect OS platform | |
| Detect available CLI | |
| Add task to crontab | |
| Add task to launchd | |
| Detect file monitoring tools | |
| Start file/directory watcher | |
| Stop file watcher | |
| List registered tasks | |
| List active file watchers | |
| Remove task completely | |
| View task logs | |
| Execute task now | |
chmod +x scripts/*.sh0 9 * * *0 * * * **/1 * * * *duration_minutes: 3030 8 * * 10 10 * * **/1 * * * *duration_minutes: 60detect-cli.sh/usr/local/bin/opencode/Users/you/.local/bin/kiro-cliCLI_PATH=$(./scripts/detect-cli.sh)
echo "Detected CLI: $CLI_PATH"
# Use $CLI_PATH in commands, not just "opencode" or "kiro-cli"# Instead of writing bash code, use:
PLATFORM=$(./scripts/detect-platform.sh)
echo "Detected platform: $PLATFORM"User: "every day at 9am summarize my memory MCP entries using deepseek"
→ You extract:
- Trigger: "every day at 9am" → cron: `0 9 * * *`
- Prompt: "summarize my memory MCP entries"
- Model: "deepseek" (if mentioned, else null)
- CLI: detect with full pathdaily-memory-summarylog-analysis-30min$HOME/.task-trigger/tasks.json[{task1}, {task2}, ...]{
"id": "daily-memory-summary",
"name": "Daily Memory Summary",
"enabled": true,
"trigger": {
"type": "cron",
"expression": "0 9 * * *",
"timezone": "local",
"duration_minutes": null,
"expires_at": null
},
"execution": {
"cli_path": "/usr/local/bin/opencode",
"agent": "opencode",
"model": "deepseek/deepseek-chat",
"prompt": "Check MCP memory for new entries since yesterday and summarize them. Write output to $HOME/.task-trigger/logs/daily-memory-summary.log",
"workingDirectory": "$HOME",
"timeout": 300
},
"created_at": "2026-03-18T10:00:00Z",
"log_path": "$HOME/.task-trigger/logs/daily-memory-summary.log"
}{
"id": "log-file-watcher",
"name": "Log File Watcher",
"enabled": true,
"trigger": {
"type": "file",
"path": "/var/log/myapp.log",
"watch_events": ["create", "modify"],
"recursive": false,
"poll_interval": 5,
"debounce": 1
},
"execution": {
"agent": "opencode",
"model": "deepseek/deepseek-chat",
"prompt": "New log entry detected. Analyze the latest lines and notify if errors found. Write output to $HOME/.task-trigger/logs/log-analyzer.log",
"workingDirectory": "$HOME",
"timeout": 60
},
"created_at": "2026-03-18T10:00:00Z",
"log_path": "$HOME/.task-trigger/logs/log-analyzer.log"
}CLI_PATH=$(./scripts/detect-cli.sh)
# Build command using full path
if [[ "$CLI_PATH" == *opencode* ]]; then
COMMAND="$CLI_PATH run --prompt 'your prompt here'"
else
# kiro needs --trust-all-tools for file writes
COMMAND="$CLI_PATH chat --no-interactive --trust-all-tools 'your prompt here'"
fi
# Preview first, then apply
./scripts/add-to-crontab.sh \
--task-id "daily-memory-summary" \
--cron "0 9 * * *" \
--command "$COMMAND" \
--dry-run
# If looks good, run without --dry-runCLI_PATH=$(./scripts/detect-cli.sh)
if [[ "$CLI_PATH" == *opencode* ]]; then
COMMAND="$CLI_PATH run --prompt 'your prompt here'"
else
COMMAND="$CLI_PATH chat --no-interactive --trust-all-tools 'your prompt here'"
fi
./scripts/add-to-launchd.sh \
--task-id "daily-memory-summary" \
--hour 9 \
--minute 0 \
--command "$COMMAND"mkdir -p $HOME/.task-trigger/logs
mkdir -p $HOME/.task-trigger/launchd # macOS only
mkdir -p $HOME/.task-trigger/watchers # For file watchersdaily-memory-summary0 9 * * */usr/local/bin/opencodedeepseek/deepseek-chat$HOME/.task-trigger/logs/daily-memory-summary.logUser: "watch my log file at /var/log/app.log and analyze new entries"
→ You extract:
- Path: "/var/log/app.log"
- Events: ["modify"] (default for files)
- Prompt: "analyze new log entries"
- CLI: detect opencode/kirolog-file-watcherconfig-monitorCLI_PATH=$(./scripts/detect-cli.sh)
if [[ "$CLI_PATH" == *opencode* ]]; then
COMMAND="$CLI_PATH run --prompt 'New log entry detected. Analyze the latest lines and notify if errors found.'"
else
COMMAND="$CLI_PATH chat --no-interactive --trust-all-tools 'New log entry detected. Analyze the latest lines and notify if errors found.'"
fi
./scripts/start-watcher.sh \
--task-id "log-file-watcher" \
--path "/var/log/app.log" \
--events "modify" \
--command "$COMMAND" \
--debounce 1log-file-watcher/var/log/app.logmodifyinotifywaitopencodekiroUser: "check logs every minute during the next 30 minutes"
→ cron: `*/1 * * * *`
→ duration_minutes: 30
→ expires_at: current_time + 30 minutesexpires_atduration_minutesexpires_atrun-task.shexpires_at/task-trigger:statusUser: "using opencode/zen" or "con claude-3.5-sonnet"
→ Add to command: --model "opencode/zen"
→ If not specified: omit --model flag (uses last model){{TIMESTAMP}}{{FILE_PATH}}{{TASK_ID}}{{LOG_PATH}}"prompt": "Analyze {{FILE_PATH}} for errors since {{TIMESTAMP}}. Write results to {{LOG_PATH}}"run-task.sh$HOME~createmodifydeletemovemodifycreatedeletemovemodifycreate,modify,delete/task-trigger:list./scripts/list-tasks.py/task-trigger:watchers./scripts/list-watchers.py/task-trigger:remove <id>./scripts/remove-task.sh <task-id>/task-trigger:unwatch <id>./scripts/stop-watcher.sh <task-id>/task-trigger:logs [id]# List all available logs
./scripts/view-logs.sh
# View specific log (last 50 lines)
./scripts/view-logs.sh <task-id>
# Tail log in real-time
./scripts/view-logs.sh <task-id> --tail
# View more lines
./scripts/view-logs.sh <task-id> --lines 100/task-trigger:run <id>./scripts/run-task.sh <task-id>/task-trigger:statusexpires_atopencode run --prompt "message"-m "provider/model"opencode run --prompt "Check memory" -m "deepseek/deepseek-chat"kiro-clikirokiro-cli chat --no-interactive "message"--trust-all-tools--model "provider/model"kiro-cli chat --no-interactive --trust-all-tools "Check memory" --model "anthropic/claude-sonnet-4"--trust-all-tools$HOME/.task-trigger/logs/launchd/watchers/--helpdetect-cli.shchmod +x--dangerously-skip-permissionssudoevery day at 9am summarize memorycada hora analiza logs usando deepseekevery minute during the next 30 minutes check emailscada minuto durante la próxima hora revisa sistemaMonday and Wednesday at 8:30am backup fileswatch my log file at /var/log/app.log and alert on errorsmonitor the downloads folder for new PDF filesif config.json changes, restart the servicewhen new files appear in /data/uploads, process themtrack changes to source code and run tests