.opencode/commands/dep-impact.md
Analyze dependency changes and their impact on the codebase.
Arguments: $ARGUMENTS
gh pr diff <number> to get the changes.git diff origin/main...HEAD for local branch changes.git diff <range>.Scan the diff for changes to files that indicate dependency updates:
| File pattern | Dependency type |
|---|---|
MODULE.bazel | Bazel module dependencies (version bumps, new deps) |
build/deps/** | Dependency configuration and BUILD overlays |
deps/rust/crates/BUILD.*.bazel | Rust crate additions, removals, or version bumps |
deps/rust/Cargo.lock, deps/rust/Cargo.toml | Rust dependency tree changes |
patches/** | Patches applied to vendored dependencies |
package.json, pnpm-lock.yaml | JavaScript/TypeScript dependencies |
BUILD.bazel (deps/implementation_deps changes) | Internal dependency wiring changes |
For each changed dependency, extract:
If no dependency changes are found in the diff, say so and exit early.
For each changed dependency, use the bazel-deps tool with direction: "rdeps" to find what workerd code depends on it.
target: "ada-url")rust: qualifier (e.g., target: "rust:base64")patches/ (e.g., patches/v8/ → target: "v8")Run these lookups in parallel when there are multiple dependency changes.
For each dependency change, assess:
## Dependency Impact Analysis
### Summary
- N dependency changes detected
- Overall risk: HIGH/MEDIUM/LOW
- Components affected: list
### Changes
#### 1. dep-name: old-version → new-version [RISK]
- **Change**: description of what changed
- **Blast radius**: N targets across M components
- **Impacted components**:
- component-a/ (N targets) — brief description of what uses this dep
- component-b/ (N targets)
- **Review focus**: What to look for in these components
- **Patch changes** (if applicable): Summary of what changed in patches
### Recommendations
- Prioritized list of review actions
- Specific test targets to run
- Any compatibility concerns
If the change includes patch file modifications (under patches/), read the patch diff carefully and summarize what changed — these are often the highest-risk part of a dependency update since they represent custom modifications to upstream code that must be maintained across versions.