# vladkepkin/llmpack architecture

> Architecture diagram of the GitHub repository vladkepkin/llmpack, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vladkepkin/llmpack
- Repository: https://github.com/vladkepkin/llmpack

## Overview

LLMPack is a CLI and MCP toolset that turns a project into LLM-ready context. The main workflow accepts a path or piped input, scans and filters files, applies security checks and optional symbol or skeleton processing, then writes a selected format and optionally reports token cost. The graph also preserves the documented MCP tools and supported output formats. Relationships are based on the README and shown source references; directory-level paths mark documented capabilities whose implementation was not sampled.

Main entry points: [`internal/app/app.go`](https://github.com/vladkepkin/llmpack/blob/master/internal/app/app.go) (Pack workflow), [`cmd/llmpack/main.go`](https://github.com/vladkepkin/llmpack/blob/master/cmd/llmpack/main.go) (CLI commands), [`internal/mcp/server.go`](https://github.com/vladkepkin/llmpack/blob/master/internal/mcp/server.go) (MCP tools), [`internal/config/config.go`](https://github.com/vladkepkin/llmpack/blob/master/internal/config/config.go) (Config profiles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_cli["CLI commands<br/>[main.go]"]
  node_mcp["MCP tools<br/>[server.go]"]
  node_config["Config profiles<br/>[config.go]"]
end

subgraph group_scan["Input and safety"]
  node_app["Pack workflow<br/>[app.go]"]
  node_walker["File walker<br/>[fs_walker.go]"]
  node_security["Secret scanner<br/>[scanner.go]"]
end

subgraph group_semantic["Symbol processing"]
  node_symbols["Symbol extraction<br/>[extractor.go]"]
  node_skeleton["Skeleton processing"]
  node_treebuild["Tree builder<br/>[tree.go]"]
  node_core["Core contracts<br/>[interfaces.go]"]
end

subgraph group_output["Output and analysis"]
  node_xml["XML output<br/>[xml.go]"]
  node_markdown["Markdown output<br/>[markdown.go]"]
  node_zip["ZIP output<br/>[zip.go]"]
  node_treefmt["Tree output<br/>[tree.go]"]
  node_tokenizer["Token counter<br/>[tokenizer.go]"]
  node_pricing["Cost estimator<br/>[estimator.go]"]
end

node_developer(("Developer"))
node_agent(("AI agent"))

node_developer -->|"runs"| node_cli
node_cli -->|"loads settings"| node_config
node_cli -->|"runs packing"| node_app
node_agent -.->|"invokes tools"| node_mcp
node_mcp -->|"runs tools"| node_app
node_app -->|"walks inputs"| node_walker
node_app -->|"scans content"| node_security
node_app -->|"extracts symbols"| node_symbols
node_app -->|"reduces code"| node_skeleton
node_app -->|"builds tree"| node_treebuild
node_app -->|"uses contracts"| node_core
node_app -->|"selects formatter"| node_xml
node_app -->|"selects formatter"| node_markdown
node_app -->|"selects formatter"| node_zip
node_app -->|"selects formatter"| node_treefmt
node_app -->|"counts tokens"| node_tokenizer
node_app -->|"estimates cost"| node_pricing

click node_cli "https://github.com/vladkepkin/llmpack/blob/master/cmd/llmpack/main.go"
click node_mcp "https://github.com/vladkepkin/llmpack/blob/master/internal/mcp/server.go"
click node_config "https://github.com/vladkepkin/llmpack/blob/master/internal/config/config.go"
click node_app "https://github.com/vladkepkin/llmpack/blob/master/internal/app/app.go"
click node_walker "https://github.com/vladkepkin/llmpack/blob/master/internal/walker/fs_walker.go"
click node_security "https://github.com/vladkepkin/llmpack/blob/master/internal/security/scanner.go"
click node_symbols "https://github.com/vladkepkin/llmpack/blob/master/internal/skeleton/extractor.go"
click node_skeleton "https://github.com/vladkepkin/llmpack/tree/master/internal/skeleton"
click node_treebuild "https://github.com/vladkepkin/llmpack/blob/master/internal/app/tree.go"
click node_core "https://github.com/vladkepkin/llmpack/blob/master/internal/core/interfaces.go"
click node_xml "https://github.com/vladkepkin/llmpack/blob/master/internal/formatter/xml.go"
click node_markdown "https://github.com/vladkepkin/llmpack/blob/master/internal/formatter/markdown.go"
click node_zip "https://github.com/vladkepkin/llmpack/blob/master/internal/formatter/zip.go"
click node_treefmt "https://github.com/vladkepkin/llmpack/blob/master/internal/formatter/tree.go"
click node_tokenizer "https://github.com/vladkepkin/llmpack/blob/master/internal/tokenizer/tokenizer.go"
click node_pricing "https://github.com/vladkepkin/llmpack/blob/master/internal/pricing/estimator.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_mcp,node_config toneBlue
class node_app,node_walker,node_security toneAmber
class node_symbols,node_skeleton,node_treebuild,node_core toneMint
class node_xml,node_markdown,node_zip,node_treefmt,node_tokenizer,node_pricing toneRose
class node_developer,node_agent toneIndigo
```

## Components

### Entry points

- [CLI commands](https://github.com/vladkepkin/llmpack/blob/master/cmd/llmpack/main.go): `cmd/llmpack/main.go`
- [MCP tools](https://github.com/vladkepkin/llmpack/blob/master/internal/mcp/server.go): `internal/mcp/server.go`
- [Config profiles](https://github.com/vladkepkin/llmpack/blob/master/internal/config/config.go): `internal/config/config.go`

### Input and safety

- [Pack workflow](https://github.com/vladkepkin/llmpack/blob/master/internal/app/app.go): `internal/app/app.go`
- [File walker](https://github.com/vladkepkin/llmpack/blob/master/internal/walker/fs_walker.go): `internal/walker/fs_walker.go`
- [Secret scanner](https://github.com/vladkepkin/llmpack/blob/master/internal/security/scanner.go): `internal/security/scanner.go`

### Symbol processing

- [Symbol extraction](https://github.com/vladkepkin/llmpack/blob/master/internal/skeleton/extractor.go): `internal/skeleton/extractor.go`
- [Skeleton processing](https://github.com/vladkepkin/llmpack/tree/master/internal/skeleton): `internal/skeleton`
- [Tree builder](https://github.com/vladkepkin/llmpack/blob/master/internal/app/tree.go): `internal/app/tree.go`
- [Core contracts](https://github.com/vladkepkin/llmpack/blob/master/internal/core/interfaces.go): `internal/core/interfaces.go`

### Output and analysis

- [XML output](https://github.com/vladkepkin/llmpack/blob/master/internal/formatter/xml.go): `internal/formatter/xml.go`
- [Markdown output](https://github.com/vladkepkin/llmpack/blob/master/internal/formatter/markdown.go): `internal/formatter/markdown.go`
- [ZIP output](https://github.com/vladkepkin/llmpack/blob/master/internal/formatter/zip.go): `internal/formatter/zip.go`
- [Tree output](https://github.com/vladkepkin/llmpack/blob/master/internal/formatter/tree.go): `internal/formatter/tree.go`
- [Token counter](https://github.com/vladkepkin/llmpack/blob/master/internal/tokenizer/tokenizer.go): `internal/tokenizer/tokenizer.go`
- [Cost estimator](https://github.com/vladkepkin/llmpack/blob/master/internal/pricing/estimator.go): `internal/pricing/estimator.go`

### Other components

- **Developer**
- **AI agent**

## Connections

- Developer → CLI commands: runs (evidence: `cmd/llmpack/main.go`)
- CLI commands → Config profiles: loads settings (evidence: `cmd/llmpack/main.go`)
- CLI commands → Pack workflow: runs packing (evidence: `cmd/llmpack/main.go`)
- AI agent → MCP tools: invokes tools (evidence: `README.md`)
- MCP tools → Pack workflow: runs tools (evidence: `internal/mcp/server.go`)
- Pack workflow → File walker: walks inputs (evidence: `internal/app/app.go`)
- Pack workflow → Secret scanner: scans content (evidence: `internal/app/app.go`)
- Pack workflow → Symbol extraction: extracts symbols (evidence: `internal/app/app.go`)
- Pack workflow → Skeleton processing: reduces code (evidence: `internal/app/app.go`)
- Pack workflow → Tree builder: builds tree (evidence: `internal/app/app.go`)
- Pack workflow → Core contracts: uses contracts (evidence: `internal/app/app.go`)
- Pack workflow → XML output: selects formatter (evidence: `internal/app/app.go`)
- Pack workflow → Markdown output: selects formatter (evidence: `internal/app/app.go`)
- Pack workflow → ZIP output: selects formatter (evidence: `internal/app/app.go`)
- Pack workflow → Tree output: selects formatter (evidence: `internal/app/app.go`)
- Pack workflow → Token counter: counts tokens (evidence: `internal/app/app.go`)
- Pack workflow → Cost estimator: estimates cost (evidence: `internal/app/app.go`)
