Before/After Highlights

Before: Reading library documentation, version histories, and compatibility matrices. Using tools to detect transitive version conflicts and deduplicate them. Experimenting with library versions to find a state where all dependencies are compatible with each other while still satisfying the required feature set.

After: Let AI struggle with this instead. It can iterate on dependency versions much faster, automatically and continuously.

Context of the comparison

One of my recurring struggles with AI-generated code was debugging issues caused by poorly selected dependency versions.

When you let AI add a dependency to a project, it usually does not install the latest version of the library. Instead, it often selects an artifact that is several major versions behind the latest release. This behavior caused two types of issues for me repeatedly:

  1. Usage of already deprecated functions
  2. Version mismatch bugs

If you don’t have proper E2E tests in the project, version mismatch bugs can be very difficult to detect. The feature simply doesn’t behave as expected, usually without any error messages, which makes debugging extremely frustrating.

After running into this situation multiple times across several projects, I asked Opus 4.6 to create a version-checking script and integrated it into a PostToolUse and pre-commit hook, that:

Since I started using this hook, I’ve never had to struggle with dependency versions again.

When AI adds a new dependency for a feature, even if I miss an E2E test for a particular scenario, this hook saves me a lot of time by catching hidden issues caused by version mismatches.

After every change in my dependencies, it runs version checks and automatically iterates on dependency versions until they align and all tests pass.

Goal

Connect a version-checker hook to all our projects, because this appears to be a mandatory feedback loop for maintaining developer productivity when working with AI-generated code.

Guidance for Future

Ask AI to create a version-checker hook in projects that: