Dep Map
Prerequisites & Dependencies
- Python 3.10+ (for AST/scanning logic)
- Language-specific parsers optional; regex-based scanning sufficient for JS/TS/Python
- No external runtime dependencies
Execution Steps
Scan import patterns: Detect
import,require,include, or language-specific import syntax across all project files. Build a mapping ofsymbol → [list of files consuming it].Write dep-graph.json: Output a JSON structure:
{ "symbols": { "moduleName": { "imports": ["dep1", "dep2"], "consumers": ["file1.py", "file2.ts"] } } }Before any edit: Re-scan consumers of the symbol being modified. Emit a "blast radius" report listing every file that imports/requires/references the target. Ask for explicit confirmation if the blast radius exceeds a safe threshold (configurable, default 5 files).
After any edit: Re-scan the modified file and its downstream consumers. Check for:
- Orphaned imports (symbol removed but still imported)
- Broken reference chains
- Stale type annotations
Incremental mode: Only re-scan files modified since last run, using file mtime comparison.
Blast Radius Report Example
Symbol: utils.format
Consumers (3 files):
- src/presentation/user-profile.tsx:12
- src/logging/app.logger.ts:5
- scripts/deprecated/old-format.js:1 (deprecated path)
⚠️ Edit will affect 3 consumers. Proceed?
Output Format
dep-graph.json:
{
"symbols": {
"utils.format": {
"imports": ["core.types", "db.models"],
"consumers": ["api/routes.ts", "services/auth.service.ts"]
}
}
}
Windows PowerShell Notes
- Use
python -m dep_mapto invoke the scanner from the skills directory - File paths with spaces must be quoted with
"..."in PowerShell - Incremental scans use
for %f in (%file) dostyle mtime comparison