Assess the impact of changes before refactoring — find dependents, trace ripple effects, and plan safe modifications.
Assess the impact of changes before you make them — find all dependents, trace ripple effects, and plan safe refactoring.
“If I change X, what breaks?”
Graphify answers this by finding all nodes that depend on X, directly or transitively.
1graphify query "what depends on scripts/dictionary/yt-to-content-v2.py?"
2graphify query "what depends on tasks/content.yaml?"
3graphify query "what depends on data/course/meta/providers-ags-storytelling.yaml?"
1graphify query "what calls mergeParams?"
2graphify query "what calls the vocabulary extraction function?"
1graphify query "what imports scripts/dictionary/extract_vocab.py?"
1# Find ALL transitive dependents (not just direct)
2graphify query "show the full dependency tree for scripts/dictionary/yt-to-content-v2.py"
1# For each dependent, trace the path
2graphify path scripts/dictionary/yt-to-content-v2.py tasks/content.yaml
3graphify path scripts/dictionary/yt-to-content-v2.py content/courses/ags/storytelling/j-wiebe/youtube-content/articulate-your-thoughts/index.md
4graphify path scripts/dictionary/yt-to-content-v2.py .github/skills/youtube-content/SKILL.md
1# 1. Signal activity
2mkdir -p graphify-out && touch graphify-out/.graphify-activity
3
4# 2. Find direct dependents
5graphify query "what depends on path/to/file.py?"
6
7# 3. Find function-level dependents
8graphify query "what calls functionName in path/to/file.py?"
9
10# 4. Trace to each dependent
11graphify path path/to/file.py dependent1
12graphify path path/to/file.py dependent2
13
14# 5. Assess risk
15# - How many dependents?
16# - How critical are they?
17# - Are tests covering them?
1# 1. Find all callers
2graphify query "what calls functionName?"
3
4# 2. For each caller, trace the call chain
5graphify path path/to/file.py caller1
6graphify path path/to/file.py caller2
7
8# 3. Check if callers are in tests
9graphify query "which callers of functionName are in test files?"
1# 1. Comprehensive dependent check
2graphify query "what depends on path/to/file.py?"
3
4# 2. Check if it's an entry point
5graphify query "is path/to/file.py an entry point or imported by tasks?"
6
7# 3. Verify no dynamic imports
8grep -r "import.*path/to/file" . --include="*.py" --include="*.js" --include="*.ts"
Scenario: Modify scripts/dictionary/yt-to-content-v2.py to add a new CLI flag.
1# 1. What depends on it?
2graphify query "what depends on scripts/dictionary/yt-to-content-v2.py?"
3
4# Expected: tasks/content.yaml (yt:content task), any wrapper scripts
5
6# 2. Trace to task
7graphify path scripts/dictionary/yt-to-content-v2.py tasks/content.yaml
8
9# 3. Check if flag parsing needs update
10graphify explain scripts/dictionary/yt-to-content-v2.py | grep -A 10 "argparse"
11
12# 4. Risk: LOW - only task invokes it, flag addition is backward compatible
Scenario: Change the output format of scripts/dictionary/extract_vocab.py.
1# 1. What consumes the output?
2graphify query "what reads data/dictionary/*/vocabulary.yaml?"
3
4# 2. Trace from script to consumers
5graphify path scripts/dictionary/extract_vocab.py data/dictionary/capitalism/vocabulary.yaml
6graphify path data/dictionary/capitalism/vocabulary.yaml content/docs/dictionary/capitalism/index.md
7
8# 3. Risk: MEDIUM - Hugo pages consume YAML, need to update both
Scenario: Change variable names in tasks/content.yaml.
1# 1. What reads these variables?
2graphify query "what reads tasks/content.yaml?"
3
4# 2. Trace to scripts
5graphify path tasks/content.yaml scripts/dictionary/yt-to-content-v2.py
6graphify path tasks/content.yaml scripts/dictionary/yt-shorts-prompts.py
7
8# 3. Risk: HIGH - multiple scripts depend on task variables
| Factor | Low Risk | Medium Risk | High Risk |
|---|---|---|---|
| Dependent count | 0-1 | 2-5 | 6+ |
| Dependent criticality | Internal scripts | Content generators | Build/tasks, public APIs |
| Change type | Additive (new flag) | Behavioral (logic change) | Breaking (signature, format) |
| Test coverage | High | Partial | None |
| Rollback ease | Trivial | Manual | Complex |
task validate after changegraphify update . to verify new structure 1# 1. Document current behavior
2graphify query "describe the current behavior of X" > before.md
3
4# 2. Make change
5
6# 3. Rebuild and verify
7graphify update . --code-only
8graphify query "describe the new behavior of X" > after.md
9
10# 4. Compare
11diff before.md after.md
1# .github/workflows/impact-analysis.yml
2name: Impact Analysis
3on:
4 pull_request:
5 paths:
6 - 'scripts/**'
7 - 'tasks/**'
8 - 'data/course/meta/**'
9
10jobs:
11 impact:
12 runs-on: ubuntu-latest
13 steps:
14 - uses: actions/checkout@v4
15 - name: Install Graphify
16 run: uv tool install graphifyy && graphify install
17 - name: Build graph
18 run: graphify . --code-only
19 - name: Check dependents
20 run: |
21 for file in ${{ github.event.pull_request.changed_files }}; do
22 echo "Checking dependents of $file"
23 graphify query "what depends on $file?"
24 done