# mov2day/karateplugin architecture

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

- Interactive diagram: https://gitdiagram.com/mov2day/karateplugin
- Repository: https://github.com/mov2day/karateplugin

## Overview

Karate Test Management is a VS Code extension for creating, running, and maintaining Karate API tests. Its principal workflow starts in the extension’s management UI or commands, turns API specifications and other documented inputs into Karate suites, runs suites or exact scenarios, and presents results for ongoing quality and maintenance. The graph also preserves Scout, coverage, workspace management, and automation capabilities described in the README. Some feature wiring is documented rather than sampled; dashed edges mark those relationships, and unsampled implementations are represented only by supported directory paths.

Main entry points: [`src/webview/app/main.tsx`](https://github.com/mov2day/karateplugin/blob/main/src/webview/app/main.tsx) (Management workspace UI), [`src/services/karateGenerator.ts`](https://github.com/mov2day/karateplugin/blob/main/src/services/karateGenerator.ts) (Karate generation), [`src/services/execution/KarateTestController.ts`](https://github.com/mov2day/karateplugin/blob/main/src/services/execution/KarateTestController.ts) (Test controller), [`src/commands`](https://github.com/mov2day/karateplugin/tree/main/src/commands) (Import sources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Test creation"]
  node_openapi["OpenAPI parsing<br/>[openApiParser.ts]"]
  node_generator["Karate generation<br/>[karateGenerator.ts]"]
  node_imports["Import sources"]
  node_ai_routing["AI provider routing"]
  node_shared_styles["Shared generation styles"]
end

subgraph group_execution["Test execution"]
  node_test_controller["Test controller"]
  node_executor["Execution engine<br/>[TestExecutor.ts]"]
  node_cli_executor["Karate CLI executor"]
  node_history[("Run history")]
end

subgraph group_quality["Quality and repair"]
  node_coverage["Coverage analysis"]
  node_health_flaky["Health and flakiness"]
  node_spec_sync["Specification change impact"]
  node_bug_hunter["API Bug Hunter"]
end

subgraph group_workspace["Management workspace"]
  node_extension["Extension commands<br/>[extension.ts]"]
  node_management_ui["Management workspace UI<br/>[main.tsx]"]
  node_workspace_store[("Workspace entities")]
  node_quality_workflow["Quality workflow"]
end

subgraph group_scout["Scout and integrations"]
  node_scout_controller["Scout journey controller<br/>[ScoutController.ts]"]
  node_scout_browser["Browser adapters"]
  node_scout_generator["Scout suite generator<br/>[ScoutGenerator.ts]"]
  node_session_recording["Recorded sessions"]
  node_ci_intake["GitHub Actions repair intake"]
  node_zephyr["Zephyr publishing"]
  node_mcp["MCP tools"]
end

node_user(("VS Code user"))

node_user -->|"invokes commands"| node_extension
node_user -->|"uses workspace"| node_management_ui
node_extension -->|"registers generation"| node_imports
node_imports -->|"parses specification"| node_openapi
node_imports -->|"generates suites"| node_generator
node_generator -->|"reads endpoints"| node_openapi
node_generator -.->|"uses AI enhancement"| node_ai_routing
node_generator -.->|"applies shared styles"| node_shared_styles
node_management_ui -.->|"starts test runs"| node_test_controller
node_test_controller -->|"executes scenarios"| node_executor
node_executor -->|"selects CLI strategy"| node_cli_executor
node_test_controller -->|"saves results"| node_history
node_management_ui -->|"requests coverage"| node_coverage
node_coverage -->|"parses specifications"| node_openapi
node_management_ui -.->|"manages findings"| node_health_flaky
node_management_ui -.->|"reviews changes"| node_spec_sync
node_management_ui -.->|"starts analysis"| node_bug_hunter
node_quality_workflow -->|"stores workflow state"| node_workspace_store
node_management_ui -->|"manages test library"| node_workspace_store
node_user -->|"teaches journey"| node_scout_controller
node_scout_controller -->|"connects browser"| node_scout_browser
node_scout_controller -->|"generates suite"| node_scout_generator
node_user -.->|"records session"| node_session_recording
node_ci_intake -.->|"routes repair intake"| node_extension
node_test_controller -->|"publishes results"| node_zephyr
node_mcp -->|"runs tests"| node_executor

click node_extension "https://github.com/mov2day/karateplugin/blob/main/src/extension.ts"
click node_management_ui "https://github.com/mov2day/karateplugin/blob/main/src/webview/app/main.tsx"
click node_openapi "https://github.com/mov2day/karateplugin/blob/main/src/services/openApiParser.ts"
click node_generator "https://github.com/mov2day/karateplugin/blob/main/src/services/karateGenerator.ts"
click node_imports "https://github.com/mov2day/karateplugin/tree/main/src/commands"
click node_ai_routing "https://github.com/mov2day/karateplugin/blob/main/src/services/ai/AIProviderRegistry.ts"
click node_shared_styles "https://github.com/mov2day/karateplugin/blob/main/src/services/SharedStyleService.ts"
click node_test_controller "https://github.com/mov2day/karateplugin/blob/main/src/services/execution/KarateTestController.ts"
click node_executor "https://github.com/mov2day/karateplugin/blob/main/src/services/execution/TestExecutor.ts"
click node_cli_executor "https://github.com/mov2day/karateplugin/blob/main/src/services/execution/KarateCliExecutor.ts"
click node_history "https://github.com/mov2day/karateplugin/blob/main/src/services/execution/TestHistoryService.ts"
click node_coverage "https://github.com/mov2day/karateplugin/blob/main/src/services/coverageAnalyzer.ts"
click node_health_flaky "https://github.com/mov2day/karateplugin/tree/main/src/services"
click node_spec_sync "https://github.com/mov2day/karateplugin/blob/main/src/services/specDiffAnalyzer.ts"
click node_bug_hunter "https://github.com/mov2day/karateplugin/blob/main/src/services/bugHunter/ApiBugHunterService.ts"
click node_workspace_store "https://github.com/mov2day/karateplugin/blob/main/src/services/workspace/WorkspaceEntityStore.ts"
click node_quality_workflow "https://github.com/mov2day/karateplugin/blob/main/src/services/workspace/QualityWorkflowService.ts"
click node_scout_controller "https://github.com/mov2day/karateplugin/blob/main/src/services/scout/ScoutController.ts"
click node_scout_browser "https://github.com/mov2day/karateplugin/tree/main/src/services/scout"
click node_scout_generator "https://github.com/mov2day/karateplugin/blob/main/src/services/scout/ScoutGenerator.ts"
click node_session_recording "https://github.com/mov2day/karateplugin/blob/main/src/services/session/SessionRecorderService.ts"
click node_ci_intake "https://github.com/mov2day/karateplugin/blob/main/src/services/ci/GitHubActionsPullIngestor.ts"
click node_zephyr "https://github.com/mov2day/karateplugin/blob/main/src/services/zephyr/ZephyrScalePublisher.ts"
click node_mcp "https://github.com/mov2day/karateplugin/blob/main/src/services/mcp/KarateMcpToolService.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_openapi,node_generator,node_imports,node_ai_routing,node_shared_styles,node_user toneBlue
class node_test_controller,node_executor,node_cli_executor,node_history toneAmber
class node_coverage,node_health_flaky,node_spec_sync,node_bug_hunter toneMint
class node_extension,node_management_ui,node_workspace_store,node_quality_workflow toneRose
class node_scout_controller,node_scout_browser,node_scout_generator,node_session_recording,node_ci_intake,node_zephyr,node_mcp toneIndigo
```

## Components

### Test creation

- [OpenAPI parsing](https://github.com/mov2day/karateplugin/blob/main/src/services/openApiParser.ts): `src/services/openApiParser.ts`
- [Karate generation](https://github.com/mov2day/karateplugin/blob/main/src/services/karateGenerator.ts): `src/services/karateGenerator.ts`
- [Import sources](https://github.com/mov2day/karateplugin/tree/main/src/commands): `src/commands`
- [AI provider routing](https://github.com/mov2day/karateplugin/blob/main/src/services/ai/AIProviderRegistry.ts): `src/services/ai/AIProviderRegistry.ts`
- [Shared generation styles](https://github.com/mov2day/karateplugin/blob/main/src/services/SharedStyleService.ts): `src/services/SharedStyleService.ts`

### Test execution

- [Test controller](https://github.com/mov2day/karateplugin/blob/main/src/services/execution/KarateTestController.ts): `src/services/execution/KarateTestController.ts`
- [Execution engine](https://github.com/mov2day/karateplugin/blob/main/src/services/execution/TestExecutor.ts): `src/services/execution/TestExecutor.ts`
- [Karate CLI executor](https://github.com/mov2day/karateplugin/blob/main/src/services/execution/KarateCliExecutor.ts): `src/services/execution/KarateCliExecutor.ts`
- [Run history](https://github.com/mov2day/karateplugin/blob/main/src/services/execution/TestHistoryService.ts): `src/services/execution/TestHistoryService.ts`

### Quality and repair

- [Coverage analysis](https://github.com/mov2day/karateplugin/blob/main/src/services/coverageAnalyzer.ts): `src/services/coverageAnalyzer.ts`
- [Health and flakiness](https://github.com/mov2day/karateplugin/tree/main/src/services): `src/services`
- [Specification change impact](https://github.com/mov2day/karateplugin/blob/main/src/services/specDiffAnalyzer.ts): `src/services/specDiffAnalyzer.ts`
- [API Bug Hunter](https://github.com/mov2day/karateplugin/blob/main/src/services/bugHunter/ApiBugHunterService.ts): `src/services/bugHunter/ApiBugHunterService.ts`

### Management workspace

- [Extension commands](https://github.com/mov2day/karateplugin/blob/main/src/extension.ts): `src/extension.ts`
- [Management workspace UI](https://github.com/mov2day/karateplugin/blob/main/src/webview/app/main.tsx): `src/webview/app/main.tsx`
- [Workspace entities](https://github.com/mov2day/karateplugin/blob/main/src/services/workspace/WorkspaceEntityStore.ts): `src/services/workspace/WorkspaceEntityStore.ts`
- [Quality workflow](https://github.com/mov2day/karateplugin/blob/main/src/services/workspace/QualityWorkflowService.ts): `src/services/workspace/QualityWorkflowService.ts`

### Scout and integrations

- [Scout journey controller](https://github.com/mov2day/karateplugin/blob/main/src/services/scout/ScoutController.ts): `src/services/scout/ScoutController.ts`
- [Browser adapters](https://github.com/mov2day/karateplugin/tree/main/src/services/scout): `src/services/scout`
- [Scout suite generator](https://github.com/mov2day/karateplugin/blob/main/src/services/scout/ScoutGenerator.ts): `src/services/scout/ScoutGenerator.ts`
- [Recorded sessions](https://github.com/mov2day/karateplugin/blob/main/src/services/session/SessionRecorderService.ts): `src/services/session/SessionRecorderService.ts`
- [GitHub Actions repair intake](https://github.com/mov2day/karateplugin/blob/main/src/services/ci/GitHubActionsPullIngestor.ts): `src/services/ci/GitHubActionsPullIngestor.ts`
- [Zephyr publishing](https://github.com/mov2day/karateplugin/blob/main/src/services/zephyr/ZephyrScalePublisher.ts): `src/services/zephyr/ZephyrScalePublisher.ts`
- [MCP tools](https://github.com/mov2day/karateplugin/blob/main/src/services/mcp/KarateMcpToolService.ts): `src/services/mcp/KarateMcpToolService.ts`

### Other components

- **VS Code user**

## Connections

- VS Code user → Extension commands: invokes commands
- VS Code user → Management workspace UI: uses workspace
- Extension commands → Import sources: registers generation (evidence: `src/extension.ts`)
- Import sources → OpenAPI parsing: parses specification (evidence: `src/commands/generateCombined.ts`)
- Import sources → Karate generation: generates suites (evidence: `src/commands/generateCombined.ts`)
- Karate generation → OpenAPI parsing: reads endpoints (evidence: `src/services/karateGenerator.ts`)
- Karate generation → AI provider routing: uses AI enhancement
- Karate generation → Shared generation styles: applies shared styles
- Management workspace UI → Test controller: starts test runs
- Test controller → Execution engine: executes scenarios (evidence: `src/services/execution/KarateTestController.ts`)
- Execution engine → Karate CLI executor: selects CLI strategy (evidence: `src/services/execution/TestExecutor.ts`)
- Test controller → Run history: saves results (evidence: `src/services/execution/KarateTestController.ts`)
- Management workspace UI → Coverage analysis: requests coverage
- Coverage analysis → OpenAPI parsing: parses specifications (evidence: `src/services/coverageAnalyzer.ts`)
- Management workspace UI → Health and flakiness: manages findings
- Management workspace UI → Specification change impact: reviews changes
- Management workspace UI → API Bug Hunter: starts analysis
- Quality workflow → Workspace entities: stores workflow state (evidence: `src/services/workspace/QualityWorkflowService.ts`)
- Management workspace UI → Workspace entities: manages test library
- VS Code user → Scout journey controller: teaches journey
- Scout journey controller → Browser adapters: connects browser (evidence: `src/services/scout/ScoutController.ts`)
- Scout journey controller → Scout suite generator: generates suite (evidence: `src/services/scout/ScoutController.ts`)
- VS Code user → Recorded sessions: records session
- GitHub Actions repair intake → Extension commands: routes repair intake (evidence: `src/extension.ts`)
- Test controller → Zephyr publishing: publishes results (evidence: `src/services/execution/KarateTestController.ts`)
- MCP tools → Execution engine: runs tests (evidence: `src/services/mcp/KarateMcpToolService.ts`)
