Audit codebase syntax and API usage against up-to-date documentation for all project dependencies. Use when the user wants to check if their code follows current library conventions, detect deprecated APIs, or ensure compatibility with installed package versions.
Audit the codebase to ensure all code follows the current documentation standards for each dependency, flagging deprecated APIs, outdated patterns, and version-specific breaking changes.
Read the project's dependency manifest(s) to extract package names and version constraints.
Priority order — read whichever exist:
# Python
cat pyproject.toml
cat requirements.txt
cat requirements*.txt
# Node
cat package.json
# Rust
cat Cargo.toml
# Go
cat go.mod
Extract each dependency name and its pinned or constrained version. For pyproject.toml, parse both [project.dependencies] and [dependency-groups] (or [tool.uv.dev-dependencies]). Record the exact installed version where possible:
# Python — get installed versions
uv pip list --format=json 2>/dev/null || pip list --format=json 2>/dev/null
# Node
cat package-lock.json | python3 -c "import json,sys; d=json.load(sys.stdin); [print(k,v['version']) for k,v in d.get('packages',{}).items() if k and not k.startswith('node_modules/node_modules')]" 2>/dev/null
Build a list of (package, resolved_version) pairs. Skip packages with no public documentation (private packages, local paths).
For each package in the list, spawn a dedicated research agent in parallel. Each agent is responsible for one package only.
Agent prompt template:
You are auditing the dependency: {package_name} version {version}.
1. Find the official documentation or changelog for this exact version.
Search: "{package_name} {version} documentation API reference"
Also check: "{package_name} {version} changelog breaking changes migration"
2. Identify the following for this version:
- Deprecated functions, classes, or patterns (with their replacements)
- Removed APIs compared to prior major versions
- New recommended idioms or patterns introduced in this version
- Import path changes
3. Return a structured summary:
PACKAGE: {package_name}
VERSION: {version}
DEPRECATED_APIS: [list of deprecated items with replacements]
REMOVED_APIS: [list of removed items]
NEW_PATTERNS: [new recommended patterns]
IMPORT_CHANGES: [any import path changes]
DOCS_URL: [URL used]
Launch all agents in a single parallel batch. Collect all results before proceeding.
Common documentation sources to check:
| Ecosystem | Source |
|---|---|
| Python | https://pypi.org/project/{pkg}/ then official docs link |
| Node/npm | https://www.npmjs.com/package/{pkg} then official docs |
| Rust | https://docs.rs/{pkg}/{version} |
| Go | https://pkg.go.dev/{module}@{version} |
With the documentation summaries from Phase 2, scan the codebase for usages of each package.
For each package:
Find all imports and usages:
# Python imports
grep -rn "^import {pkg}\|^from {pkg}" src/ --include="*.py"
# Node imports
grep -rn "require('{pkg}')\|from '{pkg}'" src/ --include="*.{js,ts,jsx,tsx}"
Check for deprecated/removed APIs:
Check import paths:
Check usage patterns:
Output a structured audit report grouped by package. Only include packages where issues were found.
# Dependency Audit Report
**Audited:** {date}
**Dependencies scanned:** {N}
**Issues found:** {total_issues}
---
## {package_name} {version}
**Docs:** {docs_url}
### ⚠️ Deprecated APIs in use
| File | Line | Current Usage | Recommended Replacement |
|------|------|---------------|------------------------|
| `src/foo.py` | 42 | `pkg.old_func()` | `pkg.new_func()` |
### ❌ Removed APIs in use
| File | Line | Usage | Notes |
|------|------|-------|-------|
### 📦 Import path changes
| File | Line | Current Import | Correct Import |
|------|------|----------------|----------------|
### 💡 Pattern improvements
Describe any modern patterns the codebase should migrate to, with before/after examples.
---
## ✅ No issues found
The following packages had no audit findings: {list}
---
## Summary
- {N} deprecated API usages to update
- {N} removed APIs that will break at runtime
- {N} import paths to fix
- {N} pattern improvements recommended
**Suggested next steps:**
1. Fix removed APIs first (runtime breakage)
2. Update deprecated APIs before next major upgrade
3. Adopt new patterns opportunistically during refactors