This plugin is your scheduling and automation layer. Use it to run workflows triggered by events, cron schedules, or manual invocation.
- Check if any workflows have
crontriggers - For each one, schedule it with
CronCreate:CronCreate(cron: "<expression>", prompt: "Run the workflow '<name>' using the run_workflow MCP tool. Act on any agent steps by spawning Agents.") - Report what was scheduled to the user
The run_workflow MCP tool executes shell steps and returns results. For agent steps, it returns prompts. You MUST act on these:
- Spawn an Agent for each agent prompt — don't just print it
- Use
mode: "bypassPermissions"for automated workflows - If the agent prompt references step output (test failures, lint errors, PR data), include that context in the agent's prompt
- Launch independent agents in parallel when possible
- Use a workflow when: the task is recurring, has multiple steps, needs conditions, or should run on a schedule
- Use direct action when: it's a one-off task the user asked for right now
Handled by the plugin's hooks — fires when Claude uses matching tools:
PostToolUse+matcher: Bash+condition: "git push"→ fires after git pushPostToolUse+matcher: "Edit|Write"→ fires after file editsStop→ fires when session ends
For polling and recurring tasks. Schedule on session start.
User says "run workflow X" or you call run_workflow directly.
When users ask to automate something, create a workflow YAML. Pick the right trigger:
| User says | Trigger type | Example |
|---|---|---|
| "run tests after every push" | hook: PostToolUse/Bash/git push | auto-test.yml |
| "lint after edits" | hook: PostToolUse/Edit|Write | lint-on-edit.yml |
| "check PRs every 10 minutes" | cron: */10 * * * * | pr-watch.yml |
| "morning standup summary" | cron: 57 8 * * 1-5 | morning-triage.yml |
| "watch CI and fix failures" | cron: */5 * * * * | ci-watch.yml |
| "review new issues" | cron: */15 * * * * | issue-watch.yml |
For GitHub events (PRs, issues, CI), use cron workflows that poll with gh CLI:
gh pr list --state open --json number,title,updatedAt,authorgh issue list --state open --json number,title,labelsgh run list --limit 5 --json status,conclusion,headBranchgh pr checks <number>
The workflow runs the gh command, then an agent step tells Claude what to do with the results.
To avoid acting on the same event twice, agent steps should compare against previous runs. The workflow history (logged in .claude/workflows/runs/) provides this context.