|
| 1 | +--- |
| 2 | +name: scheduling |
| 3 | +description: Create and manage scheduled jobs that run as GitHub Actions — schedule agents, commands, code reviews, linting, and any recurring automation |
| 4 | +license: MIT |
| 5 | +allowed-tools: gitcron cli read write |
| 6 | +metadata: |
| 7 | + author: open-gitagent |
| 8 | + version: "1.0.0" |
| 9 | + category: automation |
| 10 | +--- |
| 11 | + |
| 12 | +# Scheduling |
| 13 | + |
| 14 | +## Instructions |
| 15 | + |
| 16 | +You can create and manage scheduled jobs that run automatically as GitHub Actions workflows. Each schedule is defined in `cron.yaml` and compiled to `.github/workflows/` files. |
| 17 | + |
| 18 | +### When to create a schedule |
| 19 | + |
| 20 | +Create a schedule when the user wants something to run: |
| 21 | +- On a recurring basis (nightly, weekly, monthly) |
| 22 | +- Automatically without human intervention |
| 23 | +- As a GitHub Actions workflow |
| 24 | + |
| 25 | +### Schedule types |
| 26 | + |
| 27 | +**Agent schedules** — Run a gitagent/gitclaw AI agent: |
| 28 | +```yaml |
| 29 | +- name: nightly-review |
| 30 | + cron: "0 2 * * *" |
| 31 | + agent: code-reviewer |
| 32 | + adapter: claude # or: openai, gitclaw, system-prompt |
| 33 | + prompt: "Review all open PRs" |
| 34 | + branch: |
| 35 | + strategy: pr # creates a PR with the agent's changes |
| 36 | +``` |
| 37 | +
|
| 38 | +**Command schedules** — Run any shell command: |
| 39 | +```yaml |
| 40 | +- name: weekly-lint |
| 41 | + cron: "0 6 * * 1" |
| 42 | + command: "npm run lint -- --fix" |
| 43 | + branch: |
| 44 | + strategy: commit # commits directly to base branch |
| 45 | +``` |
| 46 | +
|
| 47 | +### Cron expression reference |
| 48 | +
|
| 49 | +``` |
| 50 | +┌───────────── minute (0-59) |
| 51 | +│ ┌─────────── hour (0-23) |
| 52 | +│ │ ┌───────── day of month (1-31) |
| 53 | +│ │ │ ┌─────── month (1-12) |
| 54 | +│ │ │ │ ┌───── day of week (0-7, Sun=0 or 7) |
| 55 | +│ │ │ │ │ |
| 56 | +* * * * * |
| 57 | +``` |
| 58 | + |
| 59 | +Common patterns: |
| 60 | +- `0 2 * * *` — Daily at 2 AM |
| 61 | +- `0 9 * * 1` — Every Monday at 9 AM |
| 62 | +- `0 0 1 * *` — First of every month at midnight |
| 63 | +- `*/15 * * * *` — Every 15 minutes |
| 64 | +- `0 9 1 */3 *` — Quarterly (first of every 3rd month) |
| 65 | + |
| 66 | +### Branch strategies |
| 67 | + |
| 68 | +| Strategy | Use when | |
| 69 | +|----------|----------| |
| 70 | +| `pr` | Agent makes code changes that need review | |
| 71 | +| `create` | Push a branch without opening a PR | |
| 72 | +| `commit` | Small, safe changes (lint fixes, formatting) | |
| 73 | +| `none` | Read-only tasks (audits, reports, scans) | |
| 74 | + |
| 75 | +### Workflow |
| 76 | + |
| 77 | +1. Use `gitcron` tool with `schedule-list` to see existing schedules |
| 78 | +2. Use `gitcron` tool with appropriate command to create/modify schedules |
| 79 | +3. Edit `cron.yaml` directly for complex configurations |
| 80 | +4. Run `gitcron generate` to compile to GitHub Actions workflows |
| 81 | +5. The workflows will run automatically after push to the repository |
| 82 | + |
| 83 | +### Adapter selection |
| 84 | + |
| 85 | +- **claude** — Best for code changes, complex reasoning. Uses Claude Code via gitagent. |
| 86 | +- **gitclaw** — Full agent runtime with tools, hooks, audit logging, compliance. Best for enterprise use. |
| 87 | +- **openai** — OpenAI API integration via gitagent. |
| 88 | +- **system-prompt** — Generic LLM export. |
| 89 | + |
| 90 | +## Output Format |
| 91 | + |
| 92 | +When creating a schedule, confirm: |
| 93 | +1. Schedule name and cron expression (human-readable) |
| 94 | +2. What it does (agent/command) |
| 95 | +3. Branch strategy chosen and why |
| 96 | +4. Next steps: `gitcron generate` and push |
0 commit comments