Skip to content

Dependency updates with a coding agent: a workflow that keeps you in control

Agents can update packages quickly and also break builds quickly. A short workflow: one update per change, read the notes, run the suite, review the lockfile.

Published by Contextingo.

Updating dependencies is repetitive, which makes it a good job for an agent, and risky, because a bad update looks like a good one in the diff.

Workflow

  1. One package, or one tightly related group, per pull request.
  2. Ask the agent to read the changelog or release notes and list breaking changes before it edits code.
  3. Run the full test suite and the build, in CI as well as locally. Use the lockfile install command (npm ci) so CI uses exactly what you review.
  4. Review the lockfile diff for packages that changed that you did not expect, including transitive ones.
  5. Check that the new version is the one you meant, by name and publisher. Look-alike package names exist.
  6. Merge, deploy, and watch before the next update.

Security updates

Security fixes are urgent but not exempt. Update the vulnerable package alone, with a test that shows the fix when one is possible, and read the advisory. npm audit and your repository host’s alerts tell you where to look.

Do not

  • Update everything at once because the agent can.
  • Let the agent change the version range rules without telling you.
  • Accept a change that removes a failing test to get CI green.

Keep the findings

A package that needed a workaround is a finding for the next update. Save it with the version it applies to.

Questions

Good to know.

Should an agent update packages automatically?

It can prepare the change. A person should review and accept it, with CI results for the exact commit.

How often should we update?

Regularly and in small steps. Large gaps between versions make each update harder.

Nothing learned is lost. Nothing unchecked is done.