Skip to content

Commit 1b6ec12

Browse files
blafourcadeclaude
andcommitted
feat(aidd-orchestrator): drop OS cron, route local scheduling via Claude Code
The 04-generate-local-script action now writes a Claude Code-native scheduling guide instead of a cron+launchd snippets file. The two documented paths are the Desktop scheduled task and the `/schedule` skill (cloud routine). OS-level cron is intentionally avoided so that the schedule stays inside Claude Code, where the rest of the workflow already lives. - New asset: assets/local-mode-scheduling-template.md - 04-generate-local-script.md updated to render aidd_docs/local-mode-scheduling.md - README updated to describe the two paths and drop the cron snippet Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ac3b47e commit 1b6ec12

4 files changed

Lines changed: 78 additions & 25 deletions

File tree

plugins/aidd-orchestrator/CATALOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Auto-generated index of skills, agents, references and assets shipped by the `ai
2727
| Group | File | Description |
2828
|-------|------|---|
2929
| `assets` | [config-template.json](skills/01-setup-async-dev/assets/config-template.json) | - |
30+
| `assets` | [local-mode-scheduling-template.md](skills/01-setup-async-dev/assets/local-mode-scheduling-template.md) | - |
3031
| `assets` | [local-poll-template.sh](skills/01-setup-async-dev/assets/local-poll-template.sh) | - |
3132
| `evals` | [scenarios.json](skills/01-setup-async-dev/evals/scenarios.json) | - |
3233
| `references` | [auth-modes.md](skills/01-setup-async-dev/references/auth-modes.md) | - |

plugins/aidd-orchestrator/README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -157,25 +157,15 @@ The next time you apply `to-implement` on an issue, the workflow runs.
157157

158158
### 4b. Local-mode finalisation
159159

160-
The setup skill drops a poll script and a scheduler snippet:
160+
The setup skill drops two files:
161161

162162
```
163-
scripts/aidd-async-poll.sh # the runner
164-
scripts/aidd-async-poll.scheduler.txt # cron + launchd snippets to copy/paste
163+
scripts/aidd-async-poll.sh # the poll runner (wraps claude -p)
164+
aidd_docs/local-mode-scheduling.md # short guide: two Claude Code-native scheduling paths
165165
```
166166

167-
Pick one of the snippets and install it. Examples:
167+
Manual sanity check first:
168168

169-
**cron** (Linux, macOS):
170-
```cron
171-
*/5 * * * * cd /abs/path/to/repo && ./scripts/aidd-async-poll.sh >> /tmp/aidd-async.log 2>&1
172-
```
173-
174-
**launchd** (macOS): copy the `<plist>` from the `.scheduler.txt` file into `~/Library/LaunchAgents/com.aidd.async-poll.plist`, then `launchctl load …`.
175-
176-
**Claude Code Desktop scheduled task**: create a task that runs `./scripts/aidd-async-poll.sh` from the repo root every N minutes.
177-
178-
Manual sanity check:
179169
```bash
180170
./scripts/aidd-async-poll.sh --dry-run # lists what it would do
181171
./scripts/aidd-async-poll.sh # runs once for real
@@ -186,6 +176,15 @@ The script invokes `claude -p` under the hood, so the local machine must have:
186176
- `gh auth status` OK
187177
- The `aidd-orchestrator` and SDLC plugins installed at user scope (`claude plugin install …`)
188178

179+
Then schedule via one of the two Claude Code-native paths documented in `aidd_docs/local-mode-scheduling.md`:
180+
181+
| Path | Where the schedule lives | Runs when |
182+
| ---- | ------------------------ | --------- |
183+
| **Desktop scheduled task** | Inside Claude Code Desktop on your machine | Only when the machine is awake |
184+
| **`/schedule` skill** | On Anthropic's cloud (a routine in your account) | Always, machine-independent |
185+
186+
Both paths call the same poll script (or invoke the same skill prompt), so behaviour is identical. Pick the one that fits your availability needs. OS-level cron and launchd are intentionally not used here: the scheduling stays inside Claude Code so it is visible and pausable from the same UI as the rest of the workflow.
187+
189188
## Daily workflow
190189

191190
| You do | Claude does |
@@ -215,7 +214,7 @@ Repeat. The same flow scales to N issues in parallel; each one has its own concu
215214
| ------------------------------------- | ------------------------------------------------------------- |
216215
| `.github/workflows/aidd-async.yml` | GitHub Actions workflow: dispatch + run + review jobs (remote mode). |
217216
| `scripts/aidd-async-poll.sh` | Local poll script wrapping `claude -p` (local mode). |
218-
| `scripts/aidd-async-poll.scheduler.txt` | Ready-to-paste cron and launchd snippets (local mode). |
217+
| `aidd_docs/local-mode-scheduling.md` | Guide: schedule the poll script via Claude Code Desktop or `/schedule`. |
219218
| `.claude/aidd-orchestrator.json` | Runtime config (committed; no secrets). |
220219
| `aidd_docs/async-runs/<YYYY_MM>/<run-id>.json` | Per-run audit log: trigger, dependency check, lock timestamps, SDLC outcome, iteration log. |
221220

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 04 -- Generate Local Script
22

3-
Renders the local poll script that wraps `claude -p` invocations of the run and review skills, plus a scheduler snippet (launchd plist or cron line) for the user to install.
3+
Renders the local poll script and a short Claude Code-native scheduling guide that wraps it.
44

55
## Inputs
66

@@ -10,8 +10,8 @@ Renders the local poll script that wraps `claude -p` invocations of the run and
1010
## Outputs
1111

1212
Two files at:
13-
- `scripts/aidd-async-poll.sh` -- executable poll script
14-
- `scripts/aidd-async-poll.scheduler.txt` -- ready-to-paste cron line (one-line) and a launchd plist body (multiline), with TODO markers for the absolute paths
13+
- `scripts/aidd-async-poll.sh` -- executable poll script that wraps `claude -p` invocations of the run and review skills
14+
- `aidd_docs/local-mode-scheduling.md` -- a short guide explaining the two Claude Code-native ways to run the script on a schedule (Desktop scheduled task, `/schedule` skill)
1515

1616
## Depends on
1717

@@ -27,14 +27,13 @@ Two files at:
2727
- `__WORKING_LABEL__` -> `answers.labels.working`
2828
- `__BLOCKED_LABEL__` -> `answers.labels.blocked`
2929
- `__REPO_FULL_NAME__` -> `${detection.remote_owner}/${detection.remote_repo}`
30-
4. If `scripts/aidd-async-poll.sh` already exists, prompt the user to overwrite or skip. Write with mode `0755` (`chmod +x`).
31-
5. Render a sibling file `scripts/aidd-async-poll.scheduler.txt` with two snippets:
32-
- **cron** (Linux, macOS): `*/5 * * * * cd /abs/path/to/repo && ./scripts/aidd-async-poll.sh >> /tmp/aidd-async.log 2>&1`
33-
- **launchd plist** (macOS): a complete `<plist>` that runs the script every 5 minutes, with TODO comments for the absolute paths.
34-
The user installs whichever fits their OS; the plugin does not install schedulers itself.
35-
6. Print a follow-up note explaining how to test the script once: `./scripts/aidd-async-poll.sh` from the repo root, after labelling at least one issue with `to-implement`.
30+
4. If `scripts/aidd-async-poll.sh` already exists, prompt the user to overwrite or skip. Write with mode `0755`.
31+
5. Render `aidd_docs/local-mode-scheduling.md` from `assets/local-mode-scheduling-template.md`. The guide does NOT install OS-level cron or launchd; it documents two Claude Code-native paths:
32+
- **Path A -- Claude Code Desktop scheduled task**: the user creates a task in the app UI that runs `./scripts/aidd-async-poll.sh` from the repo root every N minutes. The template includes a checklist of the fields to fill in the UI.
33+
- **Path B -- `/schedule` skill** (cloud routine): the user opens a Claude Code session and runs `/schedule` with a cron expression and the prompt `Use skill aidd-orchestrator:02:run-async-dev on the next ready issue in <owner>/<repo>`. The template gives the exact prompt with placeholders pre-filled from `answers` and `detection`.
34+
6. Print a follow-up note explaining how to test the script once before scheduling: `./scripts/aidd-async-poll.sh --dry-run` from the repo root, after labelling at least one issue with `to-implement`.
3635
7. `git add` both files but do not commit.
3736

3837
## Test
3938

40-
After running, `./scripts/aidd-async-poll.sh --dry-run` (when invoked from the repo root) prints the list of issues it would process, exits 0, and makes no `claude -p` calls. The scheduler snippet file contains both a `cron` block and a `launchd` `<plist>` block.
39+
After running, `./scripts/aidd-async-poll.sh --dry-run` (when invoked from the repo root) prints the list of issues it would process, exits 0, and makes no `claude -p` calls. The scheduling guide file exists and contains both `Desktop scheduled task` and `/schedule` headings.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Local-mode scheduling
2+
3+
Two Claude Code-native ways to run `scripts/aidd-async-poll.sh` on a schedule. Pick one. Both stay inside Claude Code; neither needs OS-level cron or launchd.
4+
5+
## Path A -- Claude Code Desktop scheduled task
6+
7+
Best for: users who want the schedule to live on their machine and run only when the laptop is awake.
8+
9+
1. Open Claude Code Desktop.
10+
2. Open the scheduled tasks panel (settings -> Scheduled tasks -> New task).
11+
3. Fill the form:
12+
- **Working directory**: the absolute path of this repo
13+
- **Schedule**: every 5 minutes (or whatever cadence you want)
14+
- **Prompt**: `Run ./scripts/aidd-async-poll.sh and report what was processed.`
15+
4. Save. The Desktop will run the script in a fresh session at each tick.
16+
17+
To pause: disable the task in the same panel. To remove: delete the task.
18+
19+
## Path B -- `/schedule` skill (cloud routine)
20+
21+
Best for: users who want the schedule to keep running even when their machine is off, and accept that the cycle runs on Anthropic's cloud.
22+
23+
1. Open any Claude Code session in this repo.
24+
2. Run the `/schedule` skill with this exact input (placeholders are already filled in):
25+
26+
```
27+
/schedule
28+
cron: */5 * * * *
29+
prompt: Use skill aidd-orchestrator:02:run-async-dev on the next ready issue in __REPO_FULL_NAME__
30+
```
31+
32+
3. Confirm. The routine appears in your Claude Code account and runs server-side.
33+
34+
To pause: `/schedule list`, then disable the routine. To remove: delete it from the same UI.
35+
36+
## Sanity check first
37+
38+
Before scheduling either path, run the script once manually to make sure it picks up the right issues:
39+
40+
```
41+
./scripts/aidd-async-poll.sh --dry-run # lists what it would do
42+
./scripts/aidd-async-poll.sh # runs once for real
43+
```
44+
45+
If the script reports `no open issues with label to-implement`, label one issue with `to-implement` and try again.
46+
47+
## Why no OS-level cron?
48+
49+
OS-level cron and launchd work, but they:
50+
- bypass Claude Code's session boundary (each tick spawns a brand-new `claude -p`),
51+
- are harder to see and pause from inside Claude Code,
52+
- silently fail when `claude` is not on the PATH of the cron user.
53+
54+
The two paths above keep the schedule visible inside Claude Code, where the rest of the workflow already lives.

0 commit comments

Comments
 (0)