# Upgrade dependencies weekly

Returns: A PR, or needs_review. Starts: on an event.

Once a week an agent bumps your dependencies, runs the tests and opens a pull request, or stops at needs_review and says why.

## Best for

- Repositories that fall behind on minor versions
- A test suite that catches breaking upgrades

## Uses

- A connected GitHub repository
- An automation with a schedule trigger

## The automation

Prompt: Upgrade dependencies to their latest minor versions, run the tests, and open a pull request listing each bump. Skip any upgrade that breaks the tests and say why.

Trigger:

```json
{
  "kind": "schedule",
  "config": {
    "cron": "0 9 * * 1",
    "timezone": "UTC"
  }
}
```

## While it works

Live stream events (`GET /o/{org}/sessions/{session}/events`):

- `tool_use`: bash · bun outdated
- `tool_use`: bash · bun update
- `tool_result`: 2 failed
- `thinking`: zod 3.25 changed an error message the tests match.
- `message`: Opened a pull request with 11 bumps; skipped zod.

## What comes back

- `status`: completed
- `branch`: rush/weekly-upgrades
- `result`: 11 upgrades, 1 skipped with the reason

## Steps

1. **Add a weekly schedule.** A `schedule` trigger with `cron` set to the hour you want, in your `timezone`.
2. **Read the pull request.** Each bump is listed. An upgrade that breaks the tests is left out with its reason.

Field names are the API's; the values are an example.
