dsh-lab-skills: Bundling 5 Lab Skills into One Plugin with Conversation-Based Auto-Routing

Preface

When developing agents in DeepSeek Harness (DSH), you often need to combine several categories of tools: drawing chemical structures, typesetting, plotting, and statistical analysis. Breaking these capabilities into individual Skills and then manually toggling them on in a conversation is not only cumbersome but also prone to oversights. dsh-lab-skills bundles 5 lab/typesetting skills into a single plugin and provides automatic routing for each new conversation: based on keywords in the first message, it determines which skills to activate so the model only sees what is currently needed.

What Is This

  • Plugin name: dsh-lab-skills
  • Maintainer: ccyk-hash
  • Category: Workflow
  • Core value: Integrates ChemDraw, LaTeX, Origin, GraphPad Prism, and SPSS into one plugin. Through settings-page toggles and per-conversation auto-detection, the model only sees the skills relevant to the current session context.

Core Features

5 Lab/Typesetting Skills

The plugin ships with 5 skill directories (under skills/):

  • chemdraw-automation: Drives local ChemDraw to draw structures/reaction schemes and export CDXML
  • latex-automation: Compiles LaTeX to PDF, .log diagnostics, layout checks, and template projects
  • origin-plot: Origin plotting and batch export of publication-quality figures
  • prism-analyst-cn: GraphPad Prism statistical analysis (t-test / ANOVA / dose-response)
  • spss-analyst-cn: SPSS Chinese empirical analysis, producing three-line tables and Word reports

All skill bodies (SKILL.md) along with scripts, templates, and other assets are packaged inside the plugin bundle, eliminating the need for copies under ~/.dsh/skills.

Per-Conversation Auto-Detection

  • The plugin listens for agent/inbox/inserted and captures the text of the first user message in the session.
  • Keyword weighted scoring: longer words / multi-character phrases score 2 points, shorter words score 1 point; ASCII trigger words match on word boundaries (to avoid tex matching text or origin matching original).
  • When the score reaches the threshold (default 2), the skill is activated and the result is stored in agent memory (a WeakMap), affecting only that session. Subsequent messages can only add skills, never revoke earlier ones.
  • After detection, the provider’s control.invalidate() is called; the skills service recomputes the catalog, and the skill list for the current turn reflects the detection result.
  • Auto-detection can be disabled entirely; once disabled, only “Force On” skills remain available.

Per-Skill Toggles

In DSH Settings → Lab Skills, each skill has its own toggle:

  • Force On: Regardless of what the conversation says, the skill is always visible to the model.
  • Toggled off and no trigger word matched: the skill disappears from the model-visible catalog, but userInvocable is always true, so it can still be invoked manually via a command like /latex-automation.

Implementation details: Same-named skills in ~/.dsh/skills are registered by the built-in provider under user-dsh (rank 400); the plugin registers a provider at the agent layer (rank 50). Merging is done layer by layer first, and rank is compared only within the same layer — a nearer-layer skill with the same name directly overrides the farther one. Only by registering at the agent layer can it land in the same nearest layer as the built-in provider, winning with rank 50 vs 400. Registering only at the host layer would be overridden by the outer layer, rendering the toggles ineffective. The provider always returns all 5 entries, using invocation.modelInvocable to express the toggle state.

Settings Page

Settings → Lab Skills (a React component inside the settings.section slot, using only --dsw-alias-* theme tokens):

  • Auto-detection master toggle
  • Hit threshold
  • 5 “Force On” toggles
  • Per-skill trigger words, individually editable (separated by ideographic comma or comma)
  • Reset to defaults

The settings page reads and writes state via two local routes: GET/POST /api/lab-skills/state and POST /api/lab-skills/reset (node handlers that use ctx.connection.requestRejection to block cross-site requests before writing).

On the client side, no hardcoded URLs are used. apiBase is resolved once in the following order, then the two routes are constructed:

  1. globalThis.__DSH_LAB_SKILLS_API_BASE__ (an explicit override for debugging or behind a reverse proxy; trailing slashes are stripped)
  2. The entry url of this package in window.__DSH_BOOT__: take its origin plus the path prefix before /plugins/, so it also works when mounted under sub-paths like /app/
  3. location.origin
  4. Empty string (requests degrade to same-origin relative paths, equivalent to hardcoding /api/lab-skills/...)

Both apiBase and apiUrl are exported from the module for offline verification: node test/client-api-base.mjs covers all four mounting scenarios above.

State file: %DSH_HOME% (default ~/.dsh) /dsh-lab-skills/state.json

{
  "version": 1,
  "auto": true,
  "threshold": 2,
  "skills": {
    "latex-automation": { "forceOn": false, "keywords": ["latex", "xelatex", "..."] }
  }
}

Agent Tool lab_skills

A model-side fallback that can also be invoked manually in a conversation:

action Purpose
status Shows the detection source for this conversation, per-skill scores and matched keywords, and the current visible set
catalog Inspects the actual registry resolution result (which provider provides each entry, modelInvocable true/false) for verifying that toggles are truly in effect
enable / disable Force enable/hide specific skills for the current session (skills: ["all"] means all)
reset Forgets the detection result for this conversation; the next message triggers re-detection
set_auto Toggle auto-detection (writes to the state file, takes effect globally)

Installation & Activation

First, meet the environment requirements: DSH ≥ 0.2.1-rc.2, Node ≥ 20.

Choose one of the following installation methods:

# A. Install directly from the GitHub repository
#    In DSH: plugin_manager → action: install_bundle → target: github:ccyk-hash/dsh-lab-skills

# B. Clone first, then install by directory (for offline use or code modifications)
git clone https://github.com/ccyk-hash/dsh-lab-skills.git
#    In DSH: plugin_manager → action: install_bundle → target: <absolute path to the cloned directory>

After installation, navigate to DSH Settings → Lab Skills to find the 5 toggles. Enable the ones you need to activate them.

Typical Usage

  • Turn off auto-detection in the settings page, enable only the skills you need (e.g., only latex-automation), and then invoke it manually via /latex-automation in the conversation.
  • With auto-detection enabled, if the first message contains keywords (e.g., .tex, overfull hbox), latex-automation is automatically activated while other skills remain off by default. Subsequent messages can add skills but cannot revoke the initial detection.
  • In a conversation, call lab_skills action=catalog to inspect the actual registry resolution and confirm that toggles and providers are working as expected.

Applicable Scenarios & Notes

  • Ideal for DSH agent developers who need to use multiple lab/typesetting tools simultaneously.
  • The plugin runs with the permissions of the current DSH process. Review the source code and license before installation.
  • After modifying Host code, a profile restart is required for changes to take effect.

In Short

dsh-lab-skills bundles 5 lab skills into a single plugin and uses settings-page toggles plus per-conversation auto-detection to ensure the model only sees the skills relevant to the current session context, reducing context pollution. See the catalog page and the GitHub repository for project details.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye