feat(code-visualizer): multi-language support (Python, TypeScript, Rust, Go)#4480
Merged
feat(code-visualizer): multi-language support (Python, TypeScript, Rust, Go)#4480
Conversation
…st, Go) Refactor the code-visualizer skill into a language-agnostic dispatcher + per-language analyzer architecture covering Python, TypeScript/JavaScript, Rust, and Go. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Repo Guardian - PassedAll 75 changed files were reviewed. No ephemeral content or temporary scripts were found. Files changed fall into three mirrored locations of the same skill, plus one config update:
Why no violations:
|
This was referenced Apr 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the
code-visualizerskill from Python-only to a language-agnostic architecture covering Python, TypeScript/JavaScript, Rust, and Go, while preserving the existing UX (mermaid import/dependency diagrams + staleness detection).Architecture
scripts/graph.py— SharedNode/Edge/Graphdataclasses (data contract; no inheritance among analyzers).scripts/{python,ts,rust,go}_analyzer.py— Independent bricks; each exposes exactly onenormalize(paths) -> Graphentry point.ast-based..ts/.tsx/.js/.jsx/.mjs/.cjs(ESM, CommonJS, dynamic imports).use/modextraction.import (...)extraction (with aliases).scripts/dispatcher.py— Walks target dir, groups files by extension, lazy-loads analyzers viaimportlib. SkipsIGNORE_DIRS(.git,node_modules,__pycache__,dist,build,target, …) and never follows symlinks.scripts/mermaid_renderer.py— Language-blindrender()andrender_combined()(onesubgraphper language with id namespacing). Sanitizes node ids.scripts/staleness.py— Compares max mtime over detected-language sources vs. diagram mtime.scripts/visualizer.py— CLI:visualizer.py <path> [--output DIR] [--basename NAME] [--combined] [--check-staleness]. Validates basename and rejects bad/missing paths.Tests
36 new tests under
amplifier-bundle/skills/code-visualizer/tests/:--combined, basename validation, nonexistent path.pytest.iniupdated to register the skill'stests/path.Mirror
amplifier-bundle/skills/code-visualizer/is canonical and synced to.claude/skills/code-visualizer/viarsync -a --delete.diff -ris clean.Extending with a new language
Documented in
SKILL.md: drop<lang>_analyzer.pyexposingnormalize()intoscripts/, register its module name + extension set indispatcher.LANGUAGES. No inheritance required.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com