# ashish7802/ghostskill architecture

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

- Interactive diagram: https://gitdiagram.com/ashish7802/ghostskill
- Repository: https://github.com/ashish7802/ghostskill

## Overview

GhostSkill records browser traffic, compiles it into portable skills, and runs those skills as deterministic MCP/agent tools. The main workflow is initiated through the CLI: recording feeds compilation, and running invokes the executor, which enforces permissions while calling target services. Separate branches cover drift repair, agent installation, the verified skill registry, and Studio. Edges reflect excerpted calls or README descriptions; unsampled wiring is not asserted.

Main entry points: [`packages/cli/src/index.ts`](https://github.com/ashish7802/ghostskill/blob/main/packages/cli/src/index.ts) (GhostSkill CLI), [`packages/runtime/src/executor.ts`](https://github.com/ashish7802/ghostskill/blob/main/packages/runtime/src/executor.ts) (Deterministic Executor), [`packages/installer/src/install.ts`](https://github.com/ashish7802/ghostskill/blob/main/packages/installer/src/install.ts) (Skill Installer), [`packages/core/src/package-loader.ts`](https://github.com/ashish7802/ghostskill/blob/main/packages/core/src/package-loader.ts) (Package Loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and Compile"]
  node_recorder["CDP Recorder<br/>[cdp-recorder.ts]"]
  node_scrubber["Auth Scrubber<br/>[auth-scrubber.ts]"]
  node_noise["Noise Filter<br/>[noise-filter.ts]"]
  node_parameterizer["Input Parameterizer<br/>[parameterizer.ts]"]
  node_compiler["Skill Compiler<br/>[compile.ts]"]
end

subgraph group_execution["Execution and Security"]
  node_executor["Deterministic Executor<br/>[executor.ts]"]
  node_firewall["Permission Firewall<br/>[firewall.ts]"]
  node_keychain[("Secret Keychain<br/>[keychain.ts]")]
  node_metrics[("Execution Metrics<br/>[metrics.ts]")]
end

subgraph group_repair["Drift Repair"]
  node_healer["Drift Repair Engine<br/>[heal.ts]"]
  node_providers["LLM Repair Providers<br/>[providers.ts]"]
end

subgraph group_distribution["Skills and Installation"]
  node_schemas["Skill Schemas<br/>[schemas.ts]"]
  node_package_loader["Package Loader<br/>[package-loader.ts]"]
  node_agents["Agent Detection<br/>[agents.ts]"]
  node_installer["Skill Installer<br/>[install.ts]"]
  node_registry[("Verified Skill Registry")]
end

subgraph group_studio["Studio Dashboard"]
  node_studio_ui["Studio Dashboard<br/>[page.tsx]"]
  node_overview_api["Overview API<br/>[route.ts]"]
  node_firewall_api["Firewall API<br/>[route.ts]"]
  node_install_api["Install API<br/>[route.ts]"]
end

node_user(("Operator / Agent"))
node_cli["GhostSkill CLI<br/>[index.ts]"]
node_target{{"Target Website / API"}}
node_local_store[("Local Skill and Metrics Files")]
node_agent_configs[("AI Agent Configurations")]

node_user -->|"runs commands"| node_cli
node_cli -->|"records session"| node_recorder
node_recorder -->|"filters requests"| node_noise
node_recorder -->|"scrubs credentials"| node_scrubber
node_recorder -->|"parameterizes inputs"| node_parameterizer
node_cli -->|"compiles trace"| node_compiler
node_compiler -->|"validates package"| node_schemas
node_cli -->|"loads skill"| node_package_loader
node_package_loader -->|"validates metadata"| node_schemas
node_cli -->|"runs steps"| node_executor
node_executor -->|"loads package"| node_package_loader
node_executor -->|"checks requests"| node_firewall
node_executor -->|"resolves secrets"| node_keychain
node_executor -->|"records executions"| node_metrics
node_executor -->|"sends HTTP requests"| node_target
node_user -->|"records browser actions"| node_target
node_cli -->|"heals skill"| node_healer
node_healer -->|"requests repair"| node_providers
node_healer -->|"replays repaired steps"| node_executor
node_healer -.->|"retries requests"| node_target
node_cli -.->|"installs skill"| node_installer
node_installer -->|"detects agents"| node_agents
node_installer -->|"loads skill"| node_package_loader
node_installer -->|"updates configuration"| node_agent_configs
node_installer -.->|"resolves registry skill"| node_registry
node_user -->|"opens dashboard"| node_studio_ui
node_studio_ui -.->|"requests overview"| node_overview_api
node_studio_ui -.->|"changes approvals"| node_firewall_api
node_studio_ui -.->|"requests installation"| node_install_api
node_overview_api -->|"loads registry skills"| node_package_loader
node_overview_api -->|"detects agents"| node_agents
node_overview_api -->|"reads summary"| node_metrics
node_firewall_api -->|"validates permissions"| node_schemas
node_firewall_api -->|"updates permissions file"| node_local_store
node_install_api -->|"installs skill"| node_installer

click node_cli "https://github.com/ashish7802/ghostskill/blob/main/packages/cli/src/index.ts"
click node_recorder "https://github.com/ashish7802/ghostskill/blob/main/packages/recorder/src/cdp-recorder.ts"
click node_scrubber "https://github.com/ashish7802/ghostskill/blob/main/packages/recorder/src/auth-scrubber.ts"
click node_noise "https://github.com/ashish7802/ghostskill/blob/main/packages/recorder/src/noise-filter.ts"
click node_parameterizer "https://github.com/ashish7802/ghostskill/blob/main/packages/recorder/src/parameterizer.ts"
click node_compiler "https://github.com/ashish7802/ghostskill/blob/main/packages/compiler/src/compile.ts"
click node_schemas "https://github.com/ashish7802/ghostskill/blob/main/packages/core/src/schemas.ts"
click node_package_loader "https://github.com/ashish7802/ghostskill/blob/main/packages/core/src/package-loader.ts"
click node_executor "https://github.com/ashish7802/ghostskill/blob/main/packages/runtime/src/executor.ts"
click node_firewall "https://github.com/ashish7802/ghostskill/blob/main/packages/runtime/src/firewall.ts"
click node_keychain "https://github.com/ashish7802/ghostskill/blob/main/packages/runtime/src/keychain.ts"
click node_metrics "https://github.com/ashish7802/ghostskill/blob/main/packages/runtime/src/metrics.ts"
click node_healer "https://github.com/ashish7802/ghostskill/blob/main/packages/healer/src/heal.ts"
click node_providers "https://github.com/ashish7802/ghostskill/blob/main/packages/healer/src/providers.ts"
click node_agents "https://github.com/ashish7802/ghostskill/blob/main/packages/installer/src/agents.ts"
click node_installer "https://github.com/ashish7802/ghostskill/blob/main/packages/installer/src/install.ts"
click node_registry "https://github.com/ashish7802/ghostskill/tree/main/registry/skills"
click node_studio_ui "https://github.com/ashish7802/ghostskill/blob/main/apps/studio/app/page.tsx"
click node_overview_api "https://github.com/ashish7802/ghostskill/blob/main/apps/studio/app/api/overview/route.ts"
click node_firewall_api "https://github.com/ashish7802/ghostskill/blob/main/apps/studio/app/api/firewall/route.ts"
click node_install_api "https://github.com/ashish7802/ghostskill/blob/main/apps/studio/app/api/install/route.ts"

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_recorder,node_scrubber,node_noise,node_parameterizer,node_compiler toneBlue
class node_executor,node_firewall,node_keychain,node_metrics,node_local_store,node_agent_configs toneAmber
class node_healer,node_providers,node_target toneMint
class node_schemas,node_package_loader,node_agents,node_installer,node_registry toneRose
class node_studio_ui,node_overview_api,node_firewall_api,node_install_api,node_user toneIndigo
class node_cli toneTeal
```

## Components

### Capture and Compile

- [CDP Recorder](https://github.com/ashish7802/ghostskill/blob/main/packages/recorder/src/cdp-recorder.ts): `packages/recorder/src/cdp-recorder.ts`
- [Auth Scrubber](https://github.com/ashish7802/ghostskill/blob/main/packages/recorder/src/auth-scrubber.ts): `packages/recorder/src/auth-scrubber.ts`
- [Noise Filter](https://github.com/ashish7802/ghostskill/blob/main/packages/recorder/src/noise-filter.ts): `packages/recorder/src/noise-filter.ts`
- [Input Parameterizer](https://github.com/ashish7802/ghostskill/blob/main/packages/recorder/src/parameterizer.ts): `packages/recorder/src/parameterizer.ts`
- [Skill Compiler](https://github.com/ashish7802/ghostskill/blob/main/packages/compiler/src/compile.ts): `packages/compiler/src/compile.ts`

### Execution and Security

- [Deterministic Executor](https://github.com/ashish7802/ghostskill/blob/main/packages/runtime/src/executor.ts): `packages/runtime/src/executor.ts`
- [Permission Firewall](https://github.com/ashish7802/ghostskill/blob/main/packages/runtime/src/firewall.ts): `packages/runtime/src/firewall.ts`
- [Secret Keychain](https://github.com/ashish7802/ghostskill/blob/main/packages/runtime/src/keychain.ts): `packages/runtime/src/keychain.ts`
- [Execution Metrics](https://github.com/ashish7802/ghostskill/blob/main/packages/runtime/src/metrics.ts): `packages/runtime/src/metrics.ts`

### Drift Repair

- [Drift Repair Engine](https://github.com/ashish7802/ghostskill/blob/main/packages/healer/src/heal.ts): `packages/healer/src/heal.ts`
- [LLM Repair Providers](https://github.com/ashish7802/ghostskill/blob/main/packages/healer/src/providers.ts): `packages/healer/src/providers.ts`

### Skills and Installation

- [Skill Schemas](https://github.com/ashish7802/ghostskill/blob/main/packages/core/src/schemas.ts): `packages/core/src/schemas.ts`
- [Package Loader](https://github.com/ashish7802/ghostskill/blob/main/packages/core/src/package-loader.ts): `packages/core/src/package-loader.ts`
- [Agent Detection](https://github.com/ashish7802/ghostskill/blob/main/packages/installer/src/agents.ts): `packages/installer/src/agents.ts`
- [Skill Installer](https://github.com/ashish7802/ghostskill/blob/main/packages/installer/src/install.ts): `packages/installer/src/install.ts`
- [Verified Skill Registry](https://github.com/ashish7802/ghostskill/tree/main/registry/skills): `registry/skills`

### Studio Dashboard

- [Studio Dashboard](https://github.com/ashish7802/ghostskill/blob/main/apps/studio/app/page.tsx): `apps/studio/app/page.tsx`
- [Overview API](https://github.com/ashish7802/ghostskill/blob/main/apps/studio/app/api/overview/route.ts): `apps/studio/app/api/overview/route.ts`
- [Firewall API](https://github.com/ashish7802/ghostskill/blob/main/apps/studio/app/api/firewall/route.ts): `apps/studio/app/api/firewall/route.ts`
- [Install API](https://github.com/ashish7802/ghostskill/blob/main/apps/studio/app/api/install/route.ts): `apps/studio/app/api/install/route.ts`

### Other components

- **Operator / Agent**
- [GhostSkill CLI](https://github.com/ashish7802/ghostskill/blob/main/packages/cli/src/index.ts): `packages/cli/src/index.ts`
- **Target Website / API**
- **Local Skill and Metrics Files**
- **AI Agent Configurations**

## Connections

- Operator / Agent → GhostSkill CLI: runs commands
- GhostSkill CLI → CDP Recorder: records session (evidence: `packages/cli/src/index.ts`)
- CDP Recorder → Noise Filter: filters requests (evidence: `packages/recorder/src/cdp-recorder.ts`)
- CDP Recorder → Auth Scrubber: scrubs credentials (evidence: `packages/recorder/src/cdp-recorder.ts`)
- CDP Recorder → Input Parameterizer: parameterizes inputs (evidence: `packages/recorder/src/cdp-recorder.ts`)
- GhostSkill CLI → Skill Compiler: compiles trace (evidence: `packages/cli/src/index.ts`)
- Skill Compiler → Skill Schemas: validates package (evidence: `packages/compiler/src/compile.ts`)
- GhostSkill CLI → Package Loader: loads skill (evidence: `packages/cli/src/index.ts`)
- Package Loader → Skill Schemas: validates metadata (evidence: `packages/core/src/package-loader.ts`)
- GhostSkill CLI → Deterministic Executor: runs steps (evidence: `packages/cli/src/index.ts`)
- Deterministic Executor → Package Loader: loads package (evidence: `packages/runtime/src/executor.ts`)
- Deterministic Executor → Permission Firewall: checks requests (evidence: `packages/runtime/src/executor.ts`)
- Deterministic Executor → Secret Keychain: resolves secrets (evidence: `packages/runtime/src/executor.ts`)
- Deterministic Executor → Execution Metrics: records executions (evidence: `packages/runtime/src/executor.ts`)
- Deterministic Executor → Target Website / API: sends HTTP requests
- Operator / Agent → Target Website / API: records browser actions
- GhostSkill CLI → Drift Repair Engine: heals skill (evidence: `packages/cli/src/index.ts`)
- Drift Repair Engine → LLM Repair Providers: requests repair (evidence: `packages/healer/src/heal.ts`)
- Drift Repair Engine → Deterministic Executor: replays repaired steps (evidence: `packages/healer/src/heal.ts`)
- Drift Repair Engine → Target Website / API: retries requests
- GhostSkill CLI → Skill Installer: installs skill
- Skill Installer → Agent Detection: detects agents (evidence: `packages/installer/src/install.ts`)
- Skill Installer → Package Loader: loads skill (evidence: `packages/installer/src/install.ts`)
- Skill Installer → AI Agent Configurations: updates configuration (evidence: `packages/installer/src/install.ts`)
- Skill Installer → Verified Skill Registry: resolves registry skill
- Operator / Agent → Studio Dashboard: opens dashboard
- Studio Dashboard → Overview API: requests overview
- Studio Dashboard → Firewall API: changes approvals
- Studio Dashboard → Install API: requests installation
- Overview API → Package Loader: loads registry skills (evidence: `apps/studio/app/api/overview/route.ts`)
- Overview API → Agent Detection: detects agents (evidence: `apps/studio/app/api/overview/route.ts`)
- Overview API → Execution Metrics: reads summary (evidence: `apps/studio/app/api/overview/route.ts`)
- Firewall API → Skill Schemas: validates permissions (evidence: `apps/studio/app/api/firewall/route.ts`)
- Firewall API → Local Skill and Metrics Files: updates permissions file (evidence: `apps/studio/app/api/firewall/route.ts`)
- Install API → Skill Installer: installs skill (evidence: `apps/studio/app/api/install/route.ts`)
