# shobhitbhatnagar/vibescan architecture

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

- Interactive diagram: https://gitdiagram.com/shobhitbhatnagar/vibescan
- Repository: https://github.com/shobhitbhatnagar/vibescan

## Overview

VibeScan is a local security-scanning tool, also usable as a Claude Skill. A user supplies a directory or repository URL; the scanner assesses secrets, source patterns, dependencies, and (when requested) a live web target, then consolidates findings into reports and compares them with a prior scan. Its main internal layers are engine orchestration and finding normalization/rendering. Toolchain pinning and verification form a separate maintenance capability. The README documents the primary stages; some internal scan-to-stage calls are not present in the excerpts, so those links are marked unverified.

Main entry points: [`scripts/scan.py`](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/scan.py) (Scan orchestrator), [`scripts/lockfile.py`](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/lockfile.py) (Pinned toolchain), [`scripts/osv_deps.py`](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/osv_deps.py) (Dependency analysis), [`scripts/web_scan.py`](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/web_scan.py) (Passive web scan)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scan["Scan workflow"]
  node_scanner["Scan orchestrator<br/>[scan.py]"]
end

subgraph group_analysis["Analysis engines"]
  node_secrets["Secret scanning<br/>[scan.py]"]
  node_sast["SAST rules<br/>[ai-patterns.yml]"]
  node_sast_engine["Opengrep engine"]
  node_deps["Dependency analysis<br/>[osv_deps.py]"]
  node_dast["Passive web scan<br/>[web_scan.py]"]
  node_rules_mirror["Rules mirror"]
end

subgraph group_report["Findings and reports"]
  node_normalizer["Finding normalization<br/>[normalize.py]"]
  node_findings["Findings and baseline<br/>[scan.py]"]
  node_html["HTML report renderer<br/>[render_html.py]"]
end

subgraph group_toolchain["Toolchain management"]
  node_updater["Toolchain updater<br/>[update.py]"]
  node_lockfile["Pinned toolchain<br/>[lockfile.py]"]
  node_doctor["Install diagnostics<br/>[doctor.py]"]
end

node_user(("User"))
node_target["Code target"]
node_osv["OSV.dev"]
node_web_target(("Authorized web app"))

node_user -->|"starts scan"| node_scanner
node_scanner -->|"scans target"| node_target
node_scanner -.->|"runs engine"| node_secrets
node_scanner -.->|"runs SAST"| node_sast_engine
node_sast_engine -.->|"loads rules"| node_sast
node_scanner -.->|"runs analysis"| node_deps
node_deps -->|"queries vulnerabilities"| node_osv
node_scanner -->|"invokes web scan"| node_dast
node_dast -->|"probes HTTP"| node_web_target
node_scanner -.->|"normalizes results"| node_normalizer
node_normalizer -->|"writes findings"| node_findings
node_scanner -->|"reads prior baseline"| node_findings
node_findings -.->|"renders report"| node_html
node_scanner -->|"syncs rules"| node_rules_mirror
node_updater -->|"uses lock core"| node_lockfile
node_doctor -->|"checks installation"| node_lockfile
node_scanner -->|"checks pinned state"| node_lockfile
node_user -->|"refreshes tools"| node_updater

click node_scanner "https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/scan.py"
click node_secrets "https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/scan.py"
click node_sast "https://github.com/shobhitbhatnagar/vibescan/blob/main/assets/rules/ai-patterns.yml"
click node_deps "https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/osv_deps.py"
click node_dast "https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/web_scan.py"
click node_normalizer "https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/normalize.py"
click node_findings "https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/scan.py"
click node_html "https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/render_html.py"
click node_updater "https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/update.py"
click node_lockfile "https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/lockfile.py"
click node_doctor "https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/doctor.py"

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_scanner,node_user toneBlue
class node_secrets,node_sast,node_sast_engine,node_deps,node_dast,node_rules_mirror toneAmber
class node_normalizer,node_findings,node_html toneMint
class node_updater,node_lockfile,node_doctor toneRose
class node_target,node_osv,node_web_target toneIndigo
```

## Components

### Scan workflow

- [Scan orchestrator](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/scan.py): `scripts/scan.py`

### Analysis engines

- [Secret scanning](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/scan.py): `scripts/scan.py`
- [SAST rules](https://github.com/shobhitbhatnagar/vibescan/blob/main/assets/rules/ai-patterns.yml): `assets/rules/ai-patterns.yml`
- **Opengrep engine**
- [Dependency analysis](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/osv_deps.py): `scripts/osv_deps.py`
- [Passive web scan](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/web_scan.py): `scripts/web_scan.py`
- **Rules mirror**

### Findings and reports

- [Finding normalization](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/normalize.py): `scripts/normalize.py`
- [Findings and baseline](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/scan.py): `scripts/scan.py`
- [HTML report renderer](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/render_html.py): `scripts/render_html.py`

### Toolchain management

- [Toolchain updater](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/update.py): `scripts/update.py`
- [Pinned toolchain](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/lockfile.py): `scripts/lockfile.py`
- [Install diagnostics](https://github.com/shobhitbhatnagar/vibescan/blob/main/scripts/doctor.py): `scripts/doctor.py`

### Other components

- **User**
- **Code target**
- **OSV.dev**
- **Authorized web app**

## Connections

- User → Scan orchestrator: starts scan (evidence: `README.md`)
- Scan orchestrator → Code target: scans target (evidence: `README.md`)
- Scan orchestrator → Secret scanning: runs engine (evidence: `scripts/scan.py`)
- Scan orchestrator → Opengrep engine: runs SAST
- Opengrep engine → SAST rules: loads rules (evidence: `README.md`)
- Scan orchestrator → Dependency analysis: runs analysis
- Dependency analysis → OSV.dev: queries vulnerabilities (evidence: `scripts/osv_deps.py`)
- Scan orchestrator → Passive web scan: invokes web scan (evidence: `scripts/scan.py`)
- Passive web scan → Authorized web app: probes HTTP (evidence: `scripts/web_scan.py`)
- Scan orchestrator → Finding normalization: normalizes results
- Finding normalization → Findings and baseline: writes findings (evidence: `scripts/normalize.py`)
- Scan orchestrator → Findings and baseline: reads prior baseline (evidence: `scripts/scan.py`)
- Findings and baseline → HTML report renderer: renders report
- Scan orchestrator → Rules mirror: syncs rules (evidence: `scripts/scan.py`)
- Toolchain updater → Pinned toolchain: uses lock core (evidence: `scripts/update.py`)
- Install diagnostics → Pinned toolchain: checks installation (evidence: `scripts/doctor.py`)
- Scan orchestrator → Pinned toolchain: checks pinned state (evidence: `scripts/scan.py`)
- User → Toolchain updater: refreshes tools (evidence: `README.md`)
