# x983193082/skidcon architecture

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

- Interactive diagram: https://gitdiagram.com/x983193082/skidcon
- Repository: https://github.com/x983193082/skidcon

## Overview

Pentest Crew is an automated penetration-testing platform. Its principal workflow accepts a scoped scan request, queues work for a worker, coordinates reconnaissance through exploitation and privilege escalation, records findings, and produces an exportable report. The README documents the agent, tool, knowledge, state-control, and report capabilities; sampled source confirms API/WebSocket orchestration, queue consumption, scan-state handling, and database access. Several implementation files were not sampled, so uncertain links between the executor, agents, tools, and knowledge services are omitted.

Main entry points: [`src/orchestration/crew_factory.py`](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/orchestration/crew_factory.py) (Crew factory), [`src/api/main.py`](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/api/main.py) (FastAPI entry), [`src/core/scan_manager.py`](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/core/scan_manager.py) (Scan lifecycle), [`src/agents/exploit_agent.py`](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/agents/exploit_agent.py) (Exploit agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and requests"]
  node_api_main["FastAPI entry<br/>[main.py]"]
  node_scan_route["Scan API<br/>[scan.py]"]
  node_report_route["Report API<br/>[report.py]"]
  node_prompt_route["Prompt API<br/>[prompts.py]"]
end

subgraph group_runtime["Execution orchestration"]
  node_scan_manager["Scan lifecycle<br/>[scan_manager.py]"]
  node_task_queue["Task queue<br/>[queue.py]"]
  node_worker["Worker service<br/>[main.py]"]
  node_queue_handler["Queue consumer<br/>[queue_handler.py]"]
  node_task_executor["Task executor<br/>[task_executor.py]"]
  node_flow_controller["Flow state machine<br/>[flow_controller.py]"]
  node_crew_factory["Crew factory<br/>[crew_factory.py]"]
  node_task_generator["Task generator<br/>[task_generator.py]"]
  node_prompt_manager["Prompt manager<br/>[manager.py]"]
end

subgraph group_testing["Pentest stages"]
  node_recon_agent["Recon agent<br/>[recon_agent.py]"]
  node_exploit_agent["Exploit agent<br/>[exploit_agent.py]"]
  node_privilege_agent["Privilege agent<br/>[privilege_agent.py]"]
  node_report_agent["Report agent<br/>[report_agent.py]"]
  node_security_tools["Security tool wrappers"]
end

subgraph group_knowledge["Security knowledge"]
  node_vector_store[("Vector knowledge<br/>[vector_store.py]")]
  node_cve_fetcher["CVE lookup<br/>[cve_fetcher.py]"]
  node_attack_graph["Attack graph<br/>[attack_graph.py]"]
end

subgraph group_data["State and reporting"]
  node_report_generator["Report generator"]
  node_database[("SQLite database<br/>[database.py]")]
  node_scan_repository["Scan repository<br/>[scan_repository.py]"]
  node_finding_repository["Finding repository"]
  node_task_repository["Task repository<br/>[task_repository.py]"]
end

node_user(("Pentest user"))
node_redis[("Redis")]

node_user -->|"submits requests"| node_api_main
node_api_main -->|"dispatches scans"| node_scan_route
node_api_main -->|"dispatches reports"| node_report_route
node_api_main -->|"dispatches prompts"| node_prompt_route
node_scan_route -->|"manages lifecycle"| node_scan_manager
node_scan_manager -->|"enqueues work"| node_task_queue
node_worker -->|"starts consumer"| node_queue_handler
node_queue_handler -->|"dequeues tasks"| node_task_queue
node_queue_handler -->|"executes tasks"| node_task_executor
node_task_queue -->|"stores queue state"| node_redis
node_scan_manager -->|"stores scan state"| node_redis
node_api_main -->|"creates WebSocket crew"| node_crew_factory
node_crew_factory --> node_task_executor
node_crew_factory --> node_flow_controller
node_crew_factory --> node_task_generator
node_crew_factory --> node_recon_agent
node_crew_factory --> node_exploit_agent
node_crew_factory --> node_privilege_agent
node_crew_factory --> node_report_agent
node_scan_manager -->|"syncs scan records"| node_scan_repository
node_scan_manager -->|"syncs findings"| node_finding_repository
node_report_route -->|"requests report"| node_report_generator
node_api_main -->|"initializes tables"| node_database
node_database -->|"provides sessions"| node_scan_repository
node_database -->|"provides sessions"| node_finding_repository
node_database -->|"provides sessions"| node_task_repository
node_recon_agent --> node_security_tools
node_exploit_agent --> node_security_tools
node_privilege_agent --> node_security_tools
node_recon_agent --> node_vector_store
node_exploit_agent --> node_cve_fetcher
node_exploit_agent --> node_attack_graph
node_prompt_route -->|"updates prompts"| node_prompt_manager

click node_api_main "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/api/main.py"
click node_scan_route "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/api/routes/scan.py"
click node_report_route "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/api/routes/report.py"
click node_prompt_route "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/api/routes/prompts.py"
click node_scan_manager "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/core/scan_manager.py"
click node_task_queue "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/core/queue.py"
click node_worker "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/worker/main.py"
click node_queue_handler "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/worker/queue_handler.py"
click node_task_executor "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/worker/task_executor.py"
click node_flow_controller "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/orchestration/flow_controller.py"
click node_crew_factory "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/orchestration/crew_factory.py"
click node_task_generator "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/orchestration/task_generator.py"
click node_recon_agent "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/agents/recon_agent.py"
click node_exploit_agent "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/agents/exploit_agent.py"
click node_privilege_agent "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/agents/privilege_agent.py"
click node_report_agent "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/agents/report_agent.py"
click node_security_tools "https://github.com/x983193082/skidcon/tree/refactor-Minerva/src/tools"
click node_vector_store "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/knowledge/vector_store.py"
click node_cve_fetcher "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/knowledge/cve_fetcher.py"
click node_attack_graph "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/knowledge/attack_graph.py"
click node_prompt_manager "https://github.com/x983193082/skidcon/blob/refactor-Minerva/config/prompts/manager.py"
click node_report_generator "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/core/report_generator.py"
click node_database "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/database/database.py"
click node_scan_repository "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/database/repositories/scan_repository.py"
click node_finding_repository "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/database/repositories/finding_repository.py"
click node_task_repository "https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/database/repositories/task_repository.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_api_main,node_scan_route,node_report_route,node_prompt_route,node_user toneBlue
class node_scan_manager,node_task_queue,node_worker,node_queue_handler,node_task_executor,node_flow_controller,node_crew_factory,node_task_generator,node_prompt_manager,node_redis toneAmber
class node_recon_agent,node_exploit_agent,node_privilege_agent,node_report_agent,node_security_tools toneMint
class node_vector_store,node_cve_fetcher,node_attack_graph toneRose
class node_report_generator,node_database,node_scan_repository,node_finding_repository,node_task_repository toneIndigo
```

## Components

### API and requests

- [FastAPI entry](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/api/main.py): `src/api/main.py`
- [Scan API](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/api/routes/scan.py): `src/api/routes/scan.py`
- [Report API](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/api/routes/report.py): `src/api/routes/report.py`
- [Prompt API](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/api/routes/prompts.py): `src/api/routes/prompts.py`

### Execution orchestration

- [Scan lifecycle](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/core/scan_manager.py): `src/core/scan_manager.py`
- [Task queue](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/core/queue.py): `src/core/queue.py`
- [Worker service](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/worker/main.py): `src/worker/main.py`
- [Queue consumer](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/worker/queue_handler.py): `src/worker/queue_handler.py`
- [Task executor](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/worker/task_executor.py): `src/worker/task_executor.py`
- [Flow state machine](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/orchestration/flow_controller.py): `src/orchestration/flow_controller.py`
- [Crew factory](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/orchestration/crew_factory.py): `src/orchestration/crew_factory.py`
- [Task generator](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/orchestration/task_generator.py): `src/orchestration/task_generator.py`
- [Prompt manager](https://github.com/x983193082/skidcon/blob/refactor-Minerva/config/prompts/manager.py): `config/prompts/manager.py`

### Pentest stages

- [Recon agent](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/agents/recon_agent.py): `src/agents/recon_agent.py`
- [Exploit agent](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/agents/exploit_agent.py): `src/agents/exploit_agent.py`
- [Privilege agent](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/agents/privilege_agent.py): `src/agents/privilege_agent.py`
- [Report agent](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/agents/report_agent.py): `src/agents/report_agent.py`
- [Security tool wrappers](https://github.com/x983193082/skidcon/tree/refactor-Minerva/src/tools): `src/tools`

### Security knowledge

- [Vector knowledge](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/knowledge/vector_store.py): `src/knowledge/vector_store.py`
- [CVE lookup](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/knowledge/cve_fetcher.py): `src/knowledge/cve_fetcher.py`
- [Attack graph](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/knowledge/attack_graph.py): `src/knowledge/attack_graph.py`

### State and reporting

- [Report generator](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/core/report_generator.py): `src/core/report_generator.py`
- [SQLite database](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/database/database.py): `src/database/database.py`
- [Scan repository](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/database/repositories/scan_repository.py): `src/database/repositories/scan_repository.py`
- [Finding repository](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/database/repositories/finding_repository.py): `src/database/repositories/finding_repository.py`
- [Task repository](https://github.com/x983193082/skidcon/blob/refactor-Minerva/src/database/repositories/task_repository.py): `src/database/repositories/task_repository.py`

### Other components

- **Pentest user**
- **Redis**

## Connections

- Pentest user → FastAPI entry: submits requests
- FastAPI entry → Scan API: dispatches scans
- FastAPI entry → Report API: dispatches reports
- FastAPI entry → Prompt API: dispatches prompts
- Scan API → Scan lifecycle: manages lifecycle
- Scan lifecycle → Task queue: enqueues work
- Worker service → Queue consumer: starts consumer
- Queue consumer → Task queue: dequeues tasks
- Queue consumer → Task executor: executes tasks
- Task queue → Redis: stores queue state
- Scan lifecycle → Redis: stores scan state
- FastAPI entry → Crew factory: creates WebSocket crew
- Crew factory → Task executor
- Crew factory → Flow state machine
- Crew factory → Task generator
- Crew factory → Recon agent
- Crew factory → Exploit agent
- Crew factory → Privilege agent
- Crew factory → Report agent
- Scan lifecycle → Scan repository: syncs scan records
- Scan lifecycle → Finding repository: syncs findings
- Report API → Report generator: requests report
- FastAPI entry → SQLite database: initializes tables
- SQLite database → Scan repository: provides sessions
- SQLite database → Finding repository: provides sessions
- SQLite database → Task repository: provides sessions
- Recon agent → Security tool wrappers
- Exploit agent → Security tool wrappers
- Privilege agent → Security tool wrappers
- Recon agent → Vector knowledge
- Exploit agent → CVE lookup
- Exploit agent → Attack graph
- Prompt API → Prompt manager: updates prompts
