DSH’s plugin-based architecture allows developers to extend capabilities through Host Bundles. When multiple SKILL.md files have accumulated locally, an Agent often struggles to pinpoint the right one in response to a natural-language instruction. dsh-skill-indexer addresses this problem. It is a DSH host bundle plugin that builds a two-level index, allowing an Agent to recall the correct skill from all local SKILL.md files based on a one-sentence intent.

Core Features

The plugin retrieves and routes local skills through the following mechanisms:

  • Two-level recall index: Scans ~/.workbuddy/skills and $DSH_HOME/skills, parses the frontmatter of SKILL.md files (a YAML subset), extracts keywords, clusters them into high-level categories, and generates skills-index.json.
  • One-sentence intent routing: L1 category scoring (keyword coverage × IDF); L2 in-category skill ranking (vocabulary includes keywords/triggers/name, with trigger matches weighted more heavily).
  • Three-state fallback: Three states — hit (hit), low confidence (low, falls back to top-k from the full index), and miss (miss) — with default thresholds θ1=0.35 and θ2=0.12.
  • Technical characteristics: Runs entirely locally, has zero third-party runtime dependencies, reads source directories read-only, and supports hash-based incremental updates.

Installation

Install it with the official command:

dsh plugin --profile web add github:NattoCB/dsh-skill-indexer

After installation, the DSH host automatically builds the index at startup.

Typical Usage

Command-Line Interaction

Within the DSH host, you can manage indexing and queries from the command line:

# 重建索引
/skill-index scan

# 意图召回
/skill-index query 把这周的ETF拉出来画个图

# 查看分类
/skill-index categories

# 查看状态
/skill-index status

Code Tool Invocation

On the Agent side, the model tool can be called directly:

skill_index(query="把这个PDF转成markdown")

The tool returns a result containing state (hit/low/miss), intent, categories, hits, and text, where text can be injected directly as context.

Configuration

Configure it through the config section of cordis.patch.yml. The key settings are as follows:

Key Default Meaning
roots [] (scans two paths by default) Root directories to scan; defaults to ~/.workbuddy/skills and $DSH_HOME/skills.
theta1 0.35 Hit threshold; classified as hit when max_c ≥ θ1.
theta2 0.12 Miss threshold; classified as miss when max_c < θ2.
dataDir $DSH_HOME/skill-indexer Directory for storing the index file skills-index.json and the log file usage.log.
categoriesYaml '' Path to a manually provided category override file, taking higher priority than the built-in vocabulary.

Use Cases and Considerations

  • Chinese tokenization behavior: Chinese keywords are extracted as “continuous Chinese strings.” Long strings can swallow shorter words (for example, “当面对高杠杆” may retain “高杠杆”), which can weaken recall for short queries.
  • Vocabulary coverage: The built-in category vocabulary (10 categories) provides MVP coverage. For multi-machine deployment or specific corpus scenarios, calibrate θ1/θ2 via grid search on the target corpus and expand the vocabulary as needed.
  • Runtime environment: The plugin runs with the permissions of the DSH process, does not modify skill source directories, and writes index files only to dataDir. It has no persistent process, no HTTP service, no UI, and no embedding/GraphRAG.