dsh-codex-bridge: Bringing Local Codex Skills into DSH

Introduction

DeepSeek Harness (DSH) and Codex both organize skills using SKILL.md, but their directories are independent: Codex stores them in ~/.codex/skills and plugin cache, which DSH cannot read. Maintaining a copy of the same skill on both sides and forgetting to update the other when changing one is a common burden. There is a more subtle issue: the description in Codex skills is often very long (samples in the data are about 900–1500 words), while DSH writes the skill directory into the system prompt; copying the whole paragraph will obviously consume context budget.

Below introduces dsh-codex-bridge (maintainer DanceElephant), which provides scanning, inspection, import, and daily maintenance capabilities within DSH. It registers local Codex skills into the DSH skill system and compresses descriptions according to the budget. Plugins are categorized as workflows; it has zero runtime dependencies and does not execute any scripts contained within the imported skills.

What is this

In one sentence: Codex skills that are already installed do not need to be installed again in DSH.

The plugin is installed into the profile as a DSH bundle, providing 6 DSH tools and a CLI (bridge). The process is: read-only scan of local Codex skills → optional inspection and dry run → write lock file for registration → DSH replay registration on every startup. Imported skills will appear in the DSH skill list and are loaded by the model on demand.

It does not move the Codex runtime, only processes skill files; the body is read from disk, and scripts are only listed in inspection results for your understanding, they will not be executed by the plugin.

Who is this for

  • Use Codex and DSH simultaneously, don’t want to maintain two skill trees;
  • Installed many plugin skills through the market in Codex and want to reuse them in DSH;
  • Care about prompt budget and do not want super-long description permanently in the system prompt.

Who is this not for

  • Machine doesn’t have ~/.codex: scan will prompt root directory doesn’t exist, no import items;
  • Expect to “run the complete Codex agent inside DSH” — this plugin only bridges skill files.

Two types of problems solved

Problem Symptom Plugin Approach
Description too long Long description entering system prompt will fill context Compress into trigger-style short description, default ≤ 220 code points, keeping platform names, tool names, etc., for retrieval
Hardcoded paths in body Common ${CODEX_HOME:-$HOME/.codex}/skills/... in text, invalid when changing environments snapshot mode copies a copy and rewrites various path formats, preserving upstream LICENSE/NOTICE

Compression example in the data: agent-reach original text ~921 characters → compressed to 208 characters; the trigger sentence remains at the front, platform keywords remain at the end, facilitating retrieval hits.

How it works (Brief)

  1. Scan: Enumerate importable skills, count hash, file count, script list, and original description length (source includes ~/.codex/skills and ~/.codex/plugins/cache).
  2. Inspect: Parse frontmatter, provide the first 500 characters before injection and the list of script files.
  3. Dry Run: Default dryRun, only returns the plan, does not write to disk.
  4. Compress: Description compressed into the budget; if it is already short, it is kept as-is (idempotent).
  5. Write to Disk: Atomic write to the lock file; when snapshot, additionally copy and rewrite paths.
  6. Replay: DSH startup reads the lock file and re-runs skills.register(). The description uses the compressed value stored in the lock file, and the body is read from the disk every time.

Installation and Enablement

Requires Node.js ≥ 20. Plugin version refers to the release package (example in the data is v0.1.2). License: MIT.

Recommend one-line bundle installation, then restart DSH:

dsh plugin add https://github.com/DanceElephant/dsh-codex-bridge/releases/download/v0.1.2/dsh-codex-bridge-0.1.2.tgz

This step writes the package into the profile’s dependencies and dsh.profile.bundles, no need to manually modify registration logic.

You can also install from the DSH Plugin Market (search for codex-bridge after the PR is merged); please use the release link above before the merge. Manual npm pack installation into the profile and steps to insert bundles in cordis.patch.yml are detailed in the repository README.

When the bundle is not installed, you can use the CLI for read-only verification:

node bin/bridge.mjs scan

Security & Permissions: The plugin reads the local ~/.codex and writes the profile / lock file with the permissions of the current DSH process; please review the GitHub source code and license before installing to ensure it complies with your environment’s policies.

Typical Usage

After installation and restart, call the tools in DSH sequentially (the return is usually { ok, ...fields, data }).

1. Scan importable items

codex_scan({ "exclude": ["template-creator"] })

Returns items[] (including alreadyImported) and problems[]; items without MCP config or skills/ are skipped.

2. Inspect a single skill

codex_inspect({ "name": "playwright" })

Focus on willInject and scriptFiles (listed but not executed).

3. Dry run import

codex_import({ "names": ["playwright"] })

View planned[]: target name, mode, compressed description, and whether it is already imported.

4. Confirm and write to disk

codex_import({ "names": ["playwright"], "confirm": true, "onConflict": "prefix" })

onConflict defaults to prefix, adding a prefix when names collide.

5. Restart DSH
Imported items appear in skill list, description is compressed sentence.

6. Daily maintenance

codex_list({})
codex_doctor({ "fix": false })
codex_remove({ "names": ["playwright"], "purge": false })

codex_list can compare the upstream hash; codex_doctor checks for broken paths, descriptions exceeding the budget, missing binaries, etc.

Two import modes

reference (default) snapshot
File location Lock file records sourcePath pointing to upstream Copied to ~/.dsh/codex-bridge/<skill-name>/
Upstream updates New version immediately available after startup Need to re-import
Upstream deletion Startup warning and skip Copy still usable
Applicable Most skills without hardcoded paths Body contains Codex home directory hardcoded paths

snapshot rewrites various path formats within a text size of ≤512 KiB and records them in the lock file’s rewrites field for auditing.

Description compression and configuration

Compression logic can be found in the repository’s lib/describe.mjs: clean up markdown noise, place the trigger sentence at the top, retain a limited set of keywords, and fill up to the budget by sentence. Length is calculated in Unicode code points, with a default maximum of 220, which can be adjusted via the configuration item maxDescription (other bundle configurations default to {}).

Six DSH tools cheat sheet

Tool Function
codex_scan Read-only scan
codex_inspect Single skill inspection
codex_import Import / Dry run (dryRun, confirm, mode, onConflict)
codex_list Compare imported items with upstream
codex_remove Unregister (optional purge)
codex_doctor Health check (optional fix)

CLI entry point: bridge (bin/bridge.mjs), with the same logic source as the tools.

Applicable scenarios and notes

  • Workflow positioning: Turning “discover Codex skill → compress description → register → make it available on startup” into a fixed procedure, suitable for unifying the skill surface in DSH.
  • No execution of imported code: Suitable for teams that care about the supply chain; actually running the scripts in the skills is still decided by you and the model within the session, rather than being automatically executed by this plugin.
  • Ecosystem explanation: DSH emphasizes “everything is a plugin”; SkillHub directory page and awesome-dsh-plugin are community directories and have no official affiliation with DeepSeek or FanHai.
  • Known limitations: No import source when using only DSH without a Codex directory; the need for a complete Codex runtime is outside the scope of this plugin. For more limitations, see the “Limitations and Known Issues” section in the repository.

Conclusion

dsh-codex-bridge uses lock files and startup replay to bring local Codex skills into the DSH list, and defaults to compressing descriptions into a budget of approximately 220 code points; reference and snapshot cover the needs of direct upstream connection and path rewriting. Please refer to the repository for the release package version, troubleshooting, and development instructions.

  • Directory page: https://www.skillhub.cn/plugins/DanceElephant/dsh-codex-bridge
  • GitHub: https://github.com/DanceElephant/dsh-codex-bridge
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye