Skip to content

Architecture Dependency Rules

YarCraSy edited this page Jul 8, 2026 · 2 revisions

Previous page: Overview

Dependency Rules

Hard rules

  • src/core must not import vscode.
  • src/adapters must not import vscode, React, or HTTP clients.
  • src/ui/chat must not import Node extension code.
  • src/deepseekApi must not import React or VS Code.
  • apiKey must not be stored in settings; it only belongs in SecretStorage.
  • The extension is DeepSeek-only: do not add Ollama branches or a multiprovider selector.

Allowed direction

  • vscodeApi may depend on core, adapters, infrastructure, and deepseekApi.
  • core may depend on adapters.
  • deepseekApi may depend on adapters.
  • ui/chat should communicate with the backend only through the message contract.

When to create an interface

Create an interface when domain logic needs to:

  • read files.
  • write files.
  • list directories.
  • search content.
  • execute commands.
  • access the active workspace.

The concrete implementation should live in src/vscodeApi or src/infrastructure.


Next page: Layers

Clone this wiki locally