Explain

From softspark/ai-toolkit · View interactive version

Explain is an AI agent skill from the GitHub repository softspark/ai-toolkit. Explains code/architecture with Mermaid diagrams and sequence flows. Triggers: what does X do, how does Y work, explain code, sequence diagram.

How to use this skill

Skill file

Explain

$ARGUMENTS

Generates visual architecture explanations.

Output Format

1. High-Level Role

"This module handles [Responsibility]. It interacts with [Dependencies]."

2. Dependency Graph (Mermaid)

Generate a graph showing imports/exports.

graph TD
    A[AuthService] -->|uses| B[UserRepo]
    A -->|validates| C[Schema]
    D[Controller] -->|calls| A

3. Key Flows (Sequence)

If logical flows are detected:

sequenceDiagram
    User->>Controller: Login
    Controller->>Service: Validate
    Service->>DB: Check Creds
    DB-->>Service: Result
    Service-->>Controller: Token

Protocol

  1. Scan: Read file contents to identify classes and functions.
  2. Link: Identify imports to find collaborators.
  3. Visualize: Generate standard Mermaid syntax.

Automated Dependency Graph

Run the bundled script to extract imports and generate a Mermaid diagram:

python3 ${CLAUDE_SKILL_DIR}/scripts/dependency-graph.py src/auth.py

Rules

Gotchas

When NOT to Use

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.