In the DeepSeek Harness (DSH) plugin ecosystem, handling legacy code usually requires manual analysis and lacks systematic process control. Existing tools often struggle to quantify and execute migration paths in a step-by-step manner. The DSH plugin dsh-modernize-code provides a complete workflow for legacy code modernization, breaking the migration process into four stages: environment checking, pattern scanning, roadmap planning, and block-by-block migration. It aims to reduce refactoring risks through a standardized process.
This DSH skill package is maintained by 988hj7tczd-oss and focuses on modernizing and simplifying legacy code. It provides a complete closed loop, from environment readiness checks (preflight) to legacy pattern scanning (assess), then to migration roadmap planning (map) and incremental block-by-block migration (transform). The plugin implements behavior similar to the preflight behavior in anthropics’ code modernization workflow, emphasizing “ask without blocking, report without omissions,” and supports offline execution.
Core Features¶
The plugin includes the following core capabilities:
- preflight (environment readiness check): Executes 5 non-blocking questions and 6 automated checks, then generates
PREFLIGHT.md. Unanswered questions are listed as-is as open items and are never answered on your behalf. - assess (legacy pattern scanning): Performs static scanning of the project to identify patterns such as nested callbacks, global state, and magic numbers, and generates
legacy-hotspots.mdcontaining impact scope, risk, and cost-based prioritization. - map (migration roadmap): Generates a phased migration roadmap based on the scan results. Each phase includes rollback points and verification commands.
- transform (incremental block-by-block migration): Supports incremental block-by-block migration, avoids big-bang refactoring, and requires user confirmation during code changes.
- Independent composition mounting: Provides a Cordis mounting plugin that can be introduced into the host composition as an independent bundle or bundle patch.
- Offline execution: The scripts are written using the Python standard library, requiring no network access, credentials, or external services.
Installation and Activation¶
The installation steps are as follows:
pnpm install --offline && pnpm build
Before use, ensure that a dsh-src directory (DeepSeek Harness source checkout) exists at the same directory level and has completed its pnpm install && pnpm run build. The plugin depends on core packages such as @deepseek-ai/cordis provided by the host through peerDependencies.
Typical Usage¶
The plugin supports directly invoking its Python scripts to perform operations in each stage of the workflow.
Run the environment preflight check:
python3 skills/dsh-modernize-code/scripts/preflight.py <project-dir> --answers answers.json --targets ts,container
Scan legacy code patterns:
python3 skills/dsh-modernize-code/scripts/detect-patterns.py <project-dir> --out legacy-hotspots.md
The commands above generate two key artifacts in the project directory, PREFLIGHT.md and legacy-hotspots.md, which serve as the basis for creating the migration roadmap.
Applicable Scenarios and Notes¶
This plugin is suitable for teams that need to refactor legacy code systematically. When using it, note the following:
- Dependency prerequisites: In the development environment, it depends on
dsh-srcin the same directory, referencing the official source code through thelink:mechanism. - Permission boundaries: At runtime, it only reads the scanned project directory and writes
PREFLIGHT.mdandlegacy-hotspots.md. It does not make network requests or transfer credentials. - License: This plugin uses the MIT license and is independent of upstream proprietary licensed projects. It only references their process skeleton.
- Runtime environment: Requires Python 3.9+ and Node.js 22.6+ (with type stripping support).
By breaking down legacy code migration into the four stages of preflight, assess, map, and transform, this plugin provides a controlled modernization workflow standard for the DSH ecosystem. Complete documentation and source code are available on GitHub.