
Workspace Affected
- 1 installs
- 9 repo stars
- Updated January 25, 2026
- patricio0312rev/workspaces
Shows the dependency graph for a workspace project - what depends on it and what it depends on - by parsing WORKSPACE.md relationships.
About
Builds a dependency graph for a project in the workspace, showing dependents and dependencies from the WORKSPACE.md Relationships section. A developer uses it when assessing the impact of changes across a multi-repo workspace.
- Parses consumer -> provider relationships from WORKSPACE.md
- Reports dependents and dependencies for a target project
Workspace Affected by the numbers
- 1 all-time installs (skills.sh)
- Ranked #2,476 of 3,282 Productivity & Planning skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/patricio0312rev/workspaces --skill workspace-affectedAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 9 |
| Last updated | January 25, 2026 |
| Repository | patricio0312rev/workspaces ↗ |
What it does
Shows the dependency graph for a workspace project - what depends on it and what it depends on - by parsing WORKSPACE.md relationships.
Files
Skill: Workspace Affected
Description
Show the dependency graph for a project - what depends on it and what it depends on. Useful for understanding the impact of changes.
Arguments
[project]- Project to analyze (defaults to current project)
Instructions
When the user wants to see affected projects:
Step 1: Identify Target Project
Use the provided project name or detect from current directory.
Step 2: Parse Relationships
Read the ## Relationships section from WORKSPACE.md:
## Relationships
- admin -> api (REST client, consumes /api/v1/*)
- homepage -> api (product catalog, consumes /api/v1/products)
- mobile -> api (REST client, consumes /api/v1/*)Format: consumer -> provider (description)
Step 3: Build Dependency Graph
For the target project, identify: 1. Dependents (what depends on this project) 2. Dependencies (what this project depends on)
Step 4: Display Graph
🔗 Dependency graph for: api
Projects that depend on api (will be affected by changes):
├── admin (REST client, consumes /api/v1/*)
├── homepage (product catalog, consumes /api/v1/products)
└── mobile (REST client, consumes /api/v1/*)
Projects that api depends on:
└── (none)
Impact summary:
• Changes to api may affect 3 projects
• Consider running tests in: admin, homepage, mobileUse Cases
- Before making breaking changes: "I'm changing the API response format, what will break?"
- Planning deployments: "What order should I deploy these changes?"
- Understanding architecture: "How do these projects connect?"
#!/usr/bin/env python3
"""
Analyze workspace dependency graph and show affected projects.
"""
import sys
import re
import os
from pathlib import Path
def parse_relationships(config_path: str) -> list[tuple[str, str, str]]:
"""
Parse relationships from WORKSPACE.md.
Returns list of (consumer, provider, description) tuples.
"""
relationships = []
try:
with open(config_path, 'r') as f:
content = f.read()
except FileNotFoundError:
return relationships
# Find the Relationships section
in_relationships = False
for line in content.split('\n'):
if line.strip().startswith('## Relationships'):
in_relationships = True
continue
if in_relationships and line.strip().startswith('## '):
break
if in_relationships and line.strip().startswith('- '):
# Parse: - consumer -> provider (description)
match = re.match(r'-\s*(\w+)\s*->\s*(\w+)\s*(?:\(([^)]+)\))?', line.strip())
if match:
consumer = match.group(1)
provider = match.group(2)
description = match.group(3) or ""
relationships.append((consumer, provider, description))
return relationships
def get_dependents(project: str, relationships: list[tuple[str, str, str]]) -> list[tuple[str, str]]:
"""Get projects that depend on the given project."""
return [(consumer, desc) for consumer, provider, desc in relationships if provider == project]
def get_dependencies(project: str, relationships: list[tuple[str, str, str]]) -> list[tuple[str, str]]:
"""Get projects that the given project depends on."""
return [(provider, desc) for consumer, provider, desc in relationships if consumer == project]
def print_tree(items: list[tuple[str, str]], empty_message: str = "(none)"):
"""Print items as a tree structure."""
if not items:
print(f" └── {empty_message}")
return
for i, (name, desc) in enumerate(items):
is_last = i == len(items) - 1
prefix = "└──" if is_last else "├──"
if desc:
print(f" {prefix} {name} ({desc})")
else:
print(f" {prefix} {name}")
def main():
if len(sys.argv) < 3:
print("Usage: affected.py <project> <config_file>")
sys.exit(1)
project = sys.argv[1]
config_file = sys.argv[2]
if not os.path.exists(config_file):
print(f"Error: Config file not found: {config_file}")
sys.exit(1)
relationships = parse_relationships(config_file)
dependents = get_dependents(project, relationships)
dependencies = get_dependencies(project, relationships)
print(f"\n🔗 Dependency graph for: {project}\n")
print(f"Projects that depend on {project} (will be affected by changes):")
print_tree(dependents)
print(f"\nProjects that {project} depends on:")
print_tree(dependencies)
# Impact summary
print("\nImpact summary:")
if dependents:
dependent_names = [name for name, _ in dependents]
print(f" • Changes to {project} may affect {len(dependents)} project(s)")
print(f" • Consider running tests in: {', '.join(dependent_names)}")
else:
print(f" • Changes to {project} affect only itself")
if dependencies:
dependency_names = [name for name, _ in dependencies]
print(f" • Ensure these are running when testing: {', '.join(dependency_names)}")
print()
if __name__ == "__main__":
main()