Skip to content
Agentmart
Submit a tool

explain

Deep explanation of complex code, files, or concepts.

Skill by claude-mods

IndexedMIT★ 75
Write a review

Chalk Labs

Need help deploying explain?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code. Read the repository before you give any tool access to your data.

npx agentmarket install skill/0xdarkmatter-explain

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Deep explanation of complex code, files, or concepts. Dispatches skill-preloaded agents, uses structural search, generates mermaid diagrams. Triggers on: explain, deep dive, how does X work, architecture, data flow.

Use cases: data

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/explain

Tools it pre-approves 5

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Read
  • Glob
  • Grep
  • Bash
  • Task

What's inside

Skill name
explain
Description
Deep explanation of complex code, files, or concepts. Dispatches skill-preloaded agents, uses structural search, generates mermaid diagrams. Triggers on: explain, deep dive, how does X work, architecture, data flow.
License
MIT
Compatibility
Uses ast-grep, tokei, rg, fd if available. Falls back to standard tools.
Allowed tools
Read, Glob, Grep, Bash, Task
Metadata
author: claude-mods · related-skills: structural-search, code-stats
Instructions
332 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves any shell command

Files (4)

  • SKILL.md
  • .gitkeep · assets/
  • .gitkeep · references/
  • .gitkeep · scripts/

SKILL.md (first lines)

# Explain - Deep Code Explanation

Get a comprehensive explanation of code, files, directories, or architectural concepts. Automatically dispatches a general-purpose agent preloaded with the most relevant `-ops` skill and uses modern CLI tools for analysis.

## Arguments

$ARGUMENTS

- `<target>` - File path, function name, class name, directory, or concept
- `--depth <shallow|normal|deep|trace>` - Level of detail (default: normal)
- `--focus <arch|flow|deps|api|perf>` - Specific focus area

## Architecture

```
/explain <target> [--depth] [--focus]
    |
    +-> Step 1: Detect & Classify Target
    |     +- File exists? -> Read it
    |     +- Function/class? -> ast-grep to find definition
    |     +- Directory? -> tokei for overview
    |     +- Concept? -> rg search codebase
    |
    +-> Step 2: Gather Context (parallel)
    |     +- structural-search skill -> find usages
    |     +- code-stats skill -> assess scope
    |     +- Find related: tests, types, docs
    |     +- Load: AGENTS.md, CLAUDE.md conventions
    |
    +-> Step 3: Route to Explainer (general-purpose + skill preload)
    |     +- .ts/.tsx -> general-purpose, preload typescript-ops or react-ops
    |     +- .py -> general-purpose, preload python-* skill by topic
    |     +- .vue -> general-purpose, preload vue-ops
    |     +- .sql/migrations -> general-purpose, preload postgres-ops
    |     +- agents/skills/commands -> general-purpose, preload claude-code-ops
    |     +- Default -> general-purpose
    |     +- All explainers preload: debug-ops (systematic analysis)
    |
    +-> Step 4: Generate Explanation
    |     +- Structured markdown with sections
    |     +- Mermaid diagrams (flowchart/sequence/class)
    |     +- Related code paths as file:line refs
    |     +- Design decisions and rationale
    |
    +-> Step 5: Integrate
          +- Offer to save to ARCHITECTURE.md (if significant)
          +- Link to /save if working on related task
```

## Execution Steps

### Step 1: Detect Target Type

```bash
# Check if target is a file
test -f "$TARGET" && echo "FILE" && exit

# Check if target is a directory
test -d "$TARGET" && echo "DIRECTORY" && exit

# Otherwise, search for it as a symbol
```

**For files:** Read directly with bat (syntax highlighted) or Read tool.

**For directories:** Get overview with tokei (if available):
```bash
command -v tokei >/dev/null 2>&1 && tokei "$TARGET" --compact || echo "tokei unavailable"
```

**For symbols (function/class):** Find definition with ast-grep:
```bash
# Try ast-grep first (structural)
command -v ast-grep >/dev/null 2>&1 && ast-grep -p "function $TARGET" -p "class $TARGET" -p "def $TARGET"

# Fallback to ripgrep
rg "(?:function|class|def|const|let|var)\s+$TARGET" --type-add 'code:*.{ts,tsx,js,jsx,py,vue}' -t code
```

### Step 2: Gather Context

Run these in parallel where possible:

**Find usages (structural-search skill):**
```bash
# With ast-grep
ast-grep -p "$TARGET($_)" --json 2>/dev/null | head -20

# Fallback
rg "$TARGET" --type-add 'code:*.{ts,tsx,js,jsx,py,vue}' -t code -l
```

**Find related files:**
```bash
# Tests
fd -e test.ts -e spec.ts -e test.py -e spec.py | xargs rg -l "$TARGET" 2>/dev/null

# Types/interfaces
fd -e d.ts -e types.ts | xargs rg -l "$TARGET" 2>/dev/null
```

**Load project conventions:**
- Read AGENTS.md if exists
- Read CLAUDE.md if exists
- Check for framework-specific patterns

### Step 3: Route to Explainer

Dispatch is skills-first: the generic `general-purpose` subagent preloads the relevant `-ops` skill based on file extension and content:

| Pattern | Dispatch | Preload | Condition |
|---------|----------|---------|-----------|
| `.ts` | general-purpose | `skills/typescript-ops/SKILL.md` | No JSX/React imports |
| `.tsx` | general-purpose | `skills/react-ops/SKILL.md` | JSX present |
| `.js`, `.jsx` | general-purpose | `skills/javascript-ops/SKILL.md` | - |
| `.py` | general-purpose | relevant `skills/python-*/SKILL.md` by topic | - |
| `.vue` | general-purpose | `skills/vue-ops/SKILL.md` | - |
| `.sql`, `migrations/*` | general-purpose | `skills/postgres-ops/SKILL.md` | - |
| `agents/*.md`, `skills/*`, `commands/*` | general-purpose | `skills/claude-code-ops/SKILL.md` | Claude extensions |

From 0xDarkMatter/claude-mods, MIT.

More from 0xDarkMatter/claude-mods

Signals

Stars
75
Forks
8
Open issues
0
Last commit (this folder)
Oct 5, 2026 (1 month ago)
Last release
Oct 14, 2026 (22 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from claude-mods

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get explain running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying explain?

CallGet help
Cite this page

explain skill. Agent Mart. https://agentmart.dev/skills/0xdarkmatter-explain (last updated 2026-10-24)