Token导航 LogoToken导航

Agent Skill · 研究检索

code-visualizer(代码可视化工具)

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

code-visualizer 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 21,046。

总安装 4,993周安装 202GitHub Stars 55下载 1,568核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-visualizer(代码可视化工具)
来源仓库:https://github.com/rysweet/amplihack
仓库路径:skills/code-visualizer
安装命令:
npx skills add https://github.com/rysweet/amplihack --skill code-visualizer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/rysweet/amplihack --skill code-visualizer

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于自动生成和维护代码结构可视化图表。code-visualizer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。基于 Python AST 分析模块关系,输出 mermaid 流程图。监控代码变更与图表同步状态,防止信息滞后。遵循极简原则,仅关注结构展示,不引入复杂依赖。

安装方式:github,通过 npx skills add 命令添加指定仓库技能。

来源仓库内路径:skills/code-visualizer

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/rysweet/amplihack --skill code-visualizer;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

code-visualizer 怎么安装?

在终端执行 npx skills add https://github.com/rysweet/amplihack --skill code-visualizer。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

code-visualizer 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

code-visualizer 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

code-visualizer 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

code-visualizer 用的人多吗?

公开数据是累计安装 4,993 次,近一周安装 202 次,下载 1,568 次,GitHub 55 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

code-visualizer 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
code-visualizer

代码可视化工具 · 本页

4,99355需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Code Visualizer Skill

Purpose

Automatically generate and maintain visual code flow diagrams. This skill analyzes Python module structure, detects import relationships, and generates mermaid diagrams. It also monitors for staleness when code changes but diagrams don't.

Philosophy Alignment

This skill embodies amplihack's core philosophy:

Ruthless Simplicity

  • Single responsibility: Visualize code structure - nothing more
  • Minimal dependencies: Uses only Python AST for analysis, delegates diagram syntax to mermaid-diagram-generator
  • No over-engineering: Timestamp-based staleness is simple and "good enough" for 90% of cases

Zero-BS Implementation

  • Real analysis: Actually parses Python AST to extract imports - no mock data
  • Honest limitations: Staleness detection is timestamp-based, not semantic (see Limitations section)
  • Working code: All algorithms shown are functional, not pseudocode

Modular Design (Bricks & Studs)

  • This skill is one brick: Code analysis and staleness detection
  • Delegates to other bricks: mermaid-diagram-generator for syntax, visualization-architect for complex diagrams
  • Clear studs (public contract): Analyze modules, generate diagrams, check freshness

Skill Delegation Architecture

code-visualizer (this skill)
├── Responsibilities:
│   ├── Python module analysis (AST parsing)
│   ├── Import relationship extraction
│   ├── Staleness detection (timestamp-based)
│   └── Orchestration of diagram generation
│
└── Delegates to:
    ├── mermaid-diagram-generator skill
    │   ├── Mermaid syntax generation
    │   ├── Diagram formatting and styling
    │   └── Markdown embedding
    │
    └── visualization-architect agent
        ├── Complex multi-level architecture
        ├── ASCII art alternatives
        └── Cross-module dependency graphs

Invocation Pattern:

# code-visualizer analyzes code structure
modules = analyze_python_modules("src/")
relationships = extract_import_relationships(modules)

# Then delegates to mermaid-diagram-generator for syntax
Skill(skill="mermaid-diagram-generator")
# Provide: Module relationships, diagram type (flowchart/class), styling preferences
# Receive: Valid mermaid syntax ready for embedding

# For complex architectures, delegates to visualization-architect
Task(subagent_type="visualization-architect", prompt="Create multi-level diagram for...")

When to Use This Skill

  • New Module Creation: Auto-generate architecture diagram for new modules
  • PR Reviews: Show architecture impact of proposed changes
  • Staleness Detection: Check if existing diagrams reflect current code
  • Dependency Analysis: Visualize import relationships
  • Refactoring: Understand module dependencies before changes

Quick Start

Generate Diagram for Module

User: Generate a code flow diagram for the authentication module

Check Diagram Freshness

User: Are my architecture diagrams up to date?

Show PR Impact

User: What architecture changes does this PR introduce?

Core Capabilities

1. Module Analysis

Analyzes Python files to extract:

  • Import statements (internal and external)
  • Class definitions and inheritance
  • Function exports (__all__)
  • Module dependencies

2. Diagram Generation

Creates mermaid diagrams showing:

  • Module relationships (flowchart)
  • Class hierarchies (class diagram)
  • Data flow between components
  • Dependency graphs

3. Staleness Detection

Compares:

  • File modification timestamps
  • Git history for changes
  • Diagram content vs actual code structure
  • Missing modules in diagrams

Analysis Process

Step 1: Discover Modules

# Scan target directory for Python modules
modules = glob("**/*.py")
packages = identify_packages(modules)

Step 2: Extract Relationships

For each module:

  1. Parse import statements
  2. Identify local vs external imports
  3. Build dependency graph
  4. Detect circular dependencies

Step 3: Generate Diagram

flowchart TD
    subgraph core["Core Modules"]
        auth[auth.py]
        users[users.py]
        api[api.py]
    end

    subgraph utils["Utilities"]
        helpers[helpers.py]
        validators[validators.py]
    end

    api --> auth
    api --> users
    auth --> helpers
    users --> validators

Step 4: Check Freshness

Compare diagram timestamps with source files:

  • Diagram older than sources = STALE
  • Missing modules in diagram = INCOMPLETE
  • Extra modules in diagram = OUTDATED

Diagram Types

Module Dependency Graph

Best for: Showing import relationships between files

flowchart LR
    main[main.py] --> auth[auth/]
    main --> api[api/]
    auth --> models[models.py]
    api --> auth

Class Hierarchy

Best for: Showing inheritance and composition

classDiagram
    class BaseService {
        +process()
    }
    class AuthService {
        +login()
        +logout()
    }
    BaseService <|-- AuthService

Data Flow

Best for: Showing how data moves through system

flowchart TD
    Request[HTTP Request] --> Validate{Validate}
    Validate -->|Valid| Process[Process]
    Validate -->|Invalid| Error[Return Error]
    Process --> Response[HTTP Response]

Staleness Detection

How It Works

  1. Find Diagrams: Locate mermaid diagrams in README.md, ARCHITECTURE.md
  2. Extract Modules: Parse diagram for referenced modules
  3. Compare: Check if all current modules are represented
  4. Report: Generate freshness report

Freshness Report Format

## Diagram Freshness Report

### Status: STALE

**Diagrams Checked**: 3
**Fresh**: 1
**Stale**: 2

### Details

| File         | Last Updated | Code Changed | Status |
| ------------ | ------------ | ------------ | ------ |
| README.md    | 2025-01-01   | 2025-01-15   | STALE  |
| docs/ARCH.md | 2025-01-10   | 2025-01-10   | FRESH  |

### Missing from Diagrams

- `new_module.py` (added 2025-01-12)
- `api/v2.py` (added 2025-01-14)

### Recommended Actions

1. Update README.md architecture diagram
2. Add new_module.py to dependency graph

PR Architecture Impact

What It Shows

For a given PR or set of changes:

  1. New modules/files added
  2. Changed import relationships
  3. Deleted dependencies
  4. Modified class hierarchies

Impact Diagram

flowchart TD
    subgraph added["New"]
        style added fill:#90EE90
        new_api[api/v2.py]
    end

    subgraph modified["Modified"]
        style modified fill:#FFE4B5
        auth[auth.py]
    end

    subgraph existing["Unchanged"]
        users[users.py]
        models[models.py]
    end

    new_api --> auth
    auth --> models
    users --> models

Integration with Other Skills

Mermaid Diagram Generator

This skill uses mermaid-diagram-generator for:

  • Syntax generation
  • Diagram formatting
  • Embedding in markdown

Visualization Architect Agent

Delegates to visualization-architect for:

  • Complex architecture visualization
  • ASCII art alternatives
  • Multi-level diagrams

Usage Examples

Example 1: New Module Diagram

User: I just created a new payment module. Generate an architecture diagram.

Claude:
1. Analyzes payment/ directory
2. Extracts imports and dependencies
3. Generates mermaid flowchart
4. Suggests where to embed (README.md)

Example 2: Check Staleness

User: Are my diagrams up to date?

Claude:
1. Finds all mermaid diagrams in docs
2. Compares with current codebase
3. Reports stale diagrams
4. Lists missing modules
5. Suggests updates

Example 3: PR Impact

User: Show architecture impact of this PR

Claude:
1. Gets changed files from PR
2. Identifies new/modified/deleted modules
3. Generates impact diagram
4. Highlights dependency changes

Detection Algorithms

Import Analysis

# Extract imports from Python file
import ast

def extract_imports(file_path):
    """Extract import statements from Python file."""
    tree = ast.parse(Path(file_path).read_text())
    imports = []
    for node in ast.walk(tree):
        if isinstance(node, ast.Import):
            for alias in node.names:
                imports.append(alias.name)
        elif isinstance(node, ast.ImportFrom):
            if node.module:
                imports.append(node.module)
    return imports

Staleness Check

def check_staleness(diagram_file, source_dir):
    """Check if diagram is stale compared to source."""
    diagram_mtime = Path(diagram_file).stat().st_mtime

    for source in Path(source_dir).rglob("*.py"):
        if source.stat().st_mtime > diagram_mtime:
            return True, source  # Stale

    return False, None  # Fresh

Best Practices

When to Update Diagrams

  1. New modules: Add to dependency graph
  2. Changed imports: Update relationships
  3. Deleted files: Remove from diagrams
  4. Architectural changes: Regenerate completely

Diagram Placement

Diagram TypeRecommended Location
Module overviewREADME.md
Detailed architecturedocs/ARCHITECTURE.md
Package structurepackage/README.md
API flowapi/README.md

Naming Conventions

## Architecture

<!-- code-visualizer:auto-generated -->
<!-- last-updated: 2025-01-15 -->
<!-- source-hash: abc123 -->

flowchart TD ...

Success Criteria

A good visualization:

  • Shows all current modules
  • Reflects actual import relationships
  • Uses appropriate diagram type
  • Placed in discoverable location
  • Includes freshness metadata
  • Clear and not overcrowded

Limitations

IMPORTANT: Understand these limitations before relying on this skill:

Staleness Detection Limitations

  1. Timestamp-based, not semantic: Detection compares file modification times, not actual code changes

- A file touched but not meaningfully changed will trigger "stale" - Reformatting code triggers false positives - Git operations that update mtime trigger false positives

  1. Cannot detect logic changes: Adding a function that doesn't change imports won't be detected

- Internal refactoring within a module is invisible - Changes to function signatures not reflected - New class methods added without import changes won't show

  1. Import-centric view: Only tracks import relationships

- Runtime dependencies (dependency injection) not detected - Configuration-based connections invisible - Duck typing relationships not captured

Scope Limitations

  1. Python-only: Currently only analyzes Python files

- No TypeScript, JavaScript, Rust, Go support - Multi-language projects partially covered

  1. Static analysis only: No runtime information

- Dynamic imports (__import__, importlib) not detected - Conditional imports may be missed - Plugin architectures not fully represented

  1. Single-project scope: Cannot analyze cross-repository dependencies

- External package internals not shown - Monorepo relationships require manual configuration

Accuracy Expectations

ScenarioAccuracyNotes
New module detection95%+Reliable for Python modules
Import relationship mapping90%+Misses dynamic imports
Staleness detection70-80%False positives common
Circular dependency detection85%+May miss complex cycles
Class hierarchy extraction85%+Mixins can be tricky

When NOT to Use This Skill

  • Security-critical dependency audits: Use proper security scanning tools
  • Runtime dependency analysis: Use profilers or dynamic analysis tools
  • Cross-language projects: Manual analysis may be more accurate
  • Heavily dynamic codebases: Plugin architectures, metaprogramming

Dependencies

This skill requires:

  1. mermaid-diagram-generator skill: Must be available for diagram syntax generation
  2. Python 3.8+: For AST parsing features used
  3. Git (optional): For enhanced staleness detection using git history

If mermaid-diagram-generator is unavailable, this skill will provide raw relationship data but cannot generate embedded diagrams.

PR Review Integration

How Diagrams Appear in PRs

When reviewing PRs, this skill generates impact diagrams that can be added to PR descriptions:

PR Description Template:

## Architecture Impact

<!-- Generated by code-visualizer -->

### Changed Dependencies

flowchart LR subgraph changed["Modified Modules"] style changed fill:#FFE4B5 auth[auth/service.py] api[api/routes.py] end

subgraph added["New Modules"] style added fill:#90EE90 oauth[auth/oauth.py] end

subgraph unchanged["Existing"] models[models/user.py] db[db/connection.py] end

oauth --> auth auth --> models api --> auth api --> db


### Impact Summary

- **New modules**: 1 (oauth.py)
- **Modified modules**: 2 (auth/service.py, api/routes.py)
- **New dependencies**: oauth.py -> auth/service.py
- **Diagrams to update**: README.md (STALE)

CI Integration Example

Add to .github/workflows/pr-review.yml:

- name: Check Diagram Staleness
  run: |
    # Claude Code analyzes and reports
    # Outputs: STALE diagrams that need updating
    # Generates: Suggested diagram updates

Reviewer Workflow

  1. PR opened -> code-visualizer generates impact diagram
  2. Reviewer sees -> Visual diff of architecture changes
  3. Staleness check -> Warns if existing diagrams need updates
  4. Action items -> Lists diagrams requiring manual update

Remember

This skill automates what developers often forget:

  • Keeping diagrams in sync with code
  • Documenting architecture changes
  • Understanding dependency impacts

The goal is diagrams that stay fresh automatically.

But remember the limitations: Staleness detection is approximate. When accuracy matters, verify manually.

平台分布

Claude Code

27.75%
按下载量换算435

OpenCode

25.84%
按下载量换算405

Antigravity

17.74%
按下载量换算278

Gemini CLI

14.47%
按下载量换算227

windsurf

8.02%
按下载量换算126

Cursor

4.07%
按下载量换算64

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills