# Add Dependabot to a Chrome Extension Repository

Yes. An agent reads your extension's npm and Actions dependencies, writes a dependabot.yml that groups the toolchain bumps, validates it and opens a PR.

[Run this on Rush](https://cloud.getrush.ai/run/add-dependabot/chrome-extension/). Opens the console with this prompt ready to send, in a Project that has your repository.

## What the agent does

The agent starts by reading what the repository depends on and how old it is, because the grouping in a Dependabot config should follow the shape of the toolchain. In an extension laid out like chibat/chrome-extension-typescript-starter, `package.json` runs on `react` and `react-dom` 18 and builds with `webpack` 5, `webpack-cli` 4, `webpack-merge` 5, `ts-loader` 8 and `copy-webpack-plugin` 14, tests with `jest` 29 and `ts-jest` 29, formats with `prettier` 2, and pins `@types/chrome` to exactly `0.0.158` with no range at all; `rimraf` is declared as `"^3.0.2 "` with a trailing space inside the string. A `package-lock.json` is committed. `.github/workflows/build.yml` runs `npm ci`, `npm run build` and `npm test` on Node 20 and 22 with `actions/checkout@v5` and `actions/setup-node@v4`, and there is no `.github/dependabot.yml`.

The config it writes has two `updates` entries. The `npm` entry on `/` runs weekly and groups by purpose so a review is one pull request per toolchain, not one per package: a `react` group for `react`, `react-dom` and their `@types` packages, a `webpack` group for `webpack`, `webpack-cli`, `webpack-merge`, `ts-loader` and `copy-webpack-plugin`, a `jest` group for `jest`, `ts-jest` and `@types/jest`, and a `tooling` group for the rest. `@types/chrome` is left ungrouped so its bumps arrive alone, because that package tracks the `chrome.*` API surface the extension types against and a change there is worth reading on its own. The `github-actions` entry on `/` runs weekly too, so `actions/checkout` and `actions/setup-node` move with their majors.

Two details come from reading rather than from a template. `versioning-strategy` is set to `increase` so the exact pin on `@types/chrome` becomes a newer exact pin instead of a widened range, which keeps the repository's intent. And the trailing space in the `rimraf` range, which npm tolerates, is normalised to `^3.0.2` so that a parser stricter than npm's does not reject the manifest; the pull request names that one-character change so the reviewer knows it is deliberate and not a stray edit.

In its sandbox the agent runs `npm ci`, `npm run build` and `npm test` once to record a baseline on the current lockfile, validates the new file with `check-jsonschema` against the Dependabot schema from the schema store, and reads `build.yml` again to confirm a Dependabot pull request would run the same build and tests on both Node versions. Nothing in `src/`, `public/` or `webpack/` changes, and no dependency is bumped in this pull request: that is Dependabot's job once the file lands.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Add Dependabot to this Chrome extension repository. Read package.json, package-lock.json and .github/workflows/build.yml first. Write .github/dependabot.yml with a weekly npm entry on the root that groups react and react-dom with their types, the webpack toolchain with ts-loader and copy-webpack-plugin, jest with ts-jest and its types, and the remaining dev tools, leaves @types/chrome ungrouped, and uses the increase versioning strategy so exact pins stay exact; add a weekly github-actions entry. Normalise the rimraf range that has a trailing space and name that change in the pull request. Do not bump any dependency. Run npm ci, npm run build and npm test once in the sandbox to record the baseline, validate the config against the Dependabot schema with check-jsonschema, and open a pull request whose description quotes the validation and the baseline results.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

What comes back is a pull request with one new file, `.github/dependabot.yml`, and a one-character change in `package.json` to the `rimraf` range. No dependency moves, the lockfile is as it was apart from that range, and nothing under `src/`, `public/` or `webpack/` changes. The description quotes the schema validation and the baseline `npm run build` and `npm test` results, and lists the four groups with the packages each one holds.

The run's record keeps the `npm ci` log, the webpack build output and the Jest run from the baseline, so a reviewer can see the repository built and tested cleanly on the lockfile Dependabot will start from.

Before merging, a reviewer decides whether `ts-loader` and `webpack-cli`, both a major behind the webpack 5 they build with, should be allowed through the first weekly run or held with an `ignore` rule until there is time to read their release notes, and whether the open pull request limit should stay at Dependabot's default for the first week.

## Run it on every Dependabot pull request

Once the file is in, the recurring work is the pull requests Dependabot opens. A `github` trigger never fires for a pull request a bot opens, so a handler on the reader's server receives GitHub's pull request webhook, keeps the ones whose author is Dependabot, and sends `POST /o/{org}/sessions` with the pull request's `…/pull/<n>` URL in `resources` and a `request_id` that is a UUID v5 of the head commit SHA, so a synchronize event after a rebase starts a new run and a redelivered webhook does not.

Each run checks out that pull request's branch in its own sandbox, runs `npm ci`, `npm run build` and `npm test`, loads the built `dist/` into Chromium to open the popup and the options page, and posts one review that quotes any failure with its file and line. A `webpack` group bump that breaks the build gets a review saying which loader changed; a `react` group bump that passes gets an approval the maintainer can merge.

## Why run it on Rush?

A Dependabot config pasted from the documentation opens one pull request per package on the first Monday, widens an exact pin the maintainer chose on purpose, and groups nothing, so the toolchain that has to move together arrives in pieces. In a Rush sandbox the agent reads the real manifest and lockfile, records a baseline build and test on them, and validates the file against the real schema before it opens anything.

The baseline and the validation stay with the run and the pull request quotes them, so the reviewer knows the repository was green before Dependabot starts and that the file parses. Across a team's extensions the job runs in parallel, each with its own machine, its own baseline and its own pull request.

## Frequently asked questions

### Why leave @types/chrome out of the groups?

Because it is pinned exactly and tracks the `chrome.*` API the popup, options page and content script are typed against, so a bump there deserves its own pull request and its own read of what changed. With `versioning-strategy: increase` the pin stays exact at the new version.

### Does this bump anything now?

No. The pull request adds the config and fixes the one range with a trailing space. Dependabot opens the bumps on its schedule, each one running the existing `build.yml` on Node 20 and 22.

### Why change the rimraf range at all?

`"^3.0.2 "` has a space before the closing quote. npm trims it, so the build works today, but a stricter parser may not, and a manifest Dependabot is about to read on a schedule should be clean. The pull request names the change so it is not mistaken for an accident.

### Will the first week open too many pull requests?

The groups cut the count to one per toolchain plus `@types/chrome` and the actions, and Dependabot's open pull request limit caps the rest. A maintainer who wants fewer can add an `ignore` rule for the two major bumps the description points out.

### Why Dependabot and not Renovate?

The repository has two ecosystems, npm and GitHub Actions, and both are covered by Dependabot with grouping, scheduling and a versioning strategy, with nothing to install. Renovate earns its extra configuration when a manager Dependabot lacks is needed, and nothing here needs one.

## More Chrome extension jobs

- [Add Playwright End-to-End Tests to a Chrome Extension](https://getrush.ai/run/add-e2e-tests/chrome-extension/)
- [Add ESLint to a Chrome Extension](https://getrush.ai/run/add-eslint/chrome-extension/)
- [Make a Chrome Extension Work in Firefox](https://getrush.ai/run/add-firefox-support/chrome-extension/)

## The same job on other stacks

- [Add Dependabot to a CMake C++ Project](https://getrush.ai/run/add-dependabot/cmake/)
- [Add Dependabot to a Cobra CLI](https://getrush.ai/run/add-dependabot/cobra/)
- [Set Up Dependabot for a Dagster Workspace with uv](https://getrush.ai/run/add-dependabot/dagster/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
