Introduction¶
In DeepSeek Harness (DSH) development, it is common to need a quick understanding of project structure, dependencies, and layered design when working with complex monolithic projects or microservice architectures. Traditional approaches often rely on manually reading code, which is less efficient. dsh-kgraph-plugin is a DSH bundle plugin focused on read-only scanning of project directories to automatically generate module-level and file-level knowledge graphs, helping users understand the architecture.
Plugin Positioning¶
This is a DSH bundle plugin maintained by developer lzhphantom. It analyzes projects in read-only mode and automatically builds module-level and file-level knowledge graphs to support subsequent code optimization and refactoring.
Core Features¶
- Read-only analysis: Uses DSH’s
fsservice throughout the process and never modifies the scanned project. - Multi-module recognition: Automatically splits modules based on manifest files, such as
pom.xml,package.json,go.mod,requirements.txt, andpyproject.toml. - Multi-language dependency resolution: Supports Java/Kotlin (class indexing), TS/JS/Vue (aliases and relative paths), Python (dot-separated paths), and Go (root-relative paths).
- Layer classification: Automatically identifies layers such as controller, service, mapper, entity, dto, config, pages, components, router, store, api, and util.
- Knowledge graph output: Generates module dependency graphs, file-level dependency graphs, technology stack information, entry points, and key files.
- Usage entry points: A visualization panel in the bottom-right corner of the page + the
project_kgraphmodel tool.
Installation and Activation¶
Install the plugin using the official installation command:
dsh plugin --profile web add dsh-kgraph-plugin@0.3.0
After installation is complete, the plugin will be loaded automatically.
Typical Usage¶
After installing and starting the plugin, a “Project Knowledge Graph” floating panel will appear in the bottom-right corner of the page.
- Scan the project: Enter the project path in the panel (for example,
X:/xxx/xxx) and click “Scan”. - View the overview: After scanning is complete, the interface displays module cards, technology stack information, the module dependency graph, and architectural observations.
- View the file-level graph: Click any module to enter the file-level layered graph, such as controller → service → mapper. Click a node to view code details. Full-screen viewing with
⛶and panel collapsing with—are supported. - Agent invocation: Invoke the
project_kgraphtool on the Agent side and pass the path parameter to obtain the complete graph JSON data. This tool shares the scan cache with the panel.
Applicable Scenarios and Notes¶
This plugin is suitable for developers or architects who need to quickly understand the overall project architecture and design approach.
Notes:
* The plugin runs in read-only mode and does not modify the source code of the scanned project.
* The current version is 0.3.0. The /kgraph command has been removed, and the bottom-right panel and the project_kgraph tool are used instead.
To learn more or view the source code, visit the plugin directory or the GitHub repository.