In the development workflow of DeepSeek Harness (DSH), as the skill library grows, determining which skills are actually invoked and which can be cleaned up is part of routine maintenance. Traditional log investigation has limited efficiency, and statistics tools implemented as skills usually can only perform post-hoc full scans, without real-time awareness of invocations. The dsh-skill-stats plugin is introduced below. It uses dual-channel data (historical replay + real-time subscription) to track skill invocation counts, helping developers decide which skills are worth keeping.

Core Features

The plugin provides the following features:

  1. Invocation Statistics: Tracks the cumulative invocation count, the number of sessions used, first/last invocation time, and the specific timestamp for each invocation for every skill.
  2. Dual-Channel Data:
    • Historical Replay: On startup, scans session logs in the host environment (session.jsonl / session.jsonl.zstd) and parses skill invocations from tool/call events.
    • Real-Time Subscription: Listens to ongoing tool invocation events and accumulates statistics in real time.
  3. Session View: Displays the list of skills used in an individual session, with sorting supported. Each row includes a mini trend chart; expanding it reveals a larger chart and the timestamp of each invocation. Deleted skills are marked as “Deleted”.
  4. Global Panel: Provides a statistics table for all skills (including 0 uses), with sorting, SVG trend charts, 1/3/7/30-day range filtering, and per-invocation details.
  5. Incremental Cache: Records a watermark based on file size and modification time; on restart, only changed logs are replayed, speeding up startup.
  6. Deleted Indicators: Scans all workspace and global skill root directories to detect skills whose directories no longer exist.
  7. Loading State: Displays a hint while log replay is incomplete, avoiding misreporting an empty snapshot as “unused”.

Installation and Activation

Use the following commands to install and build:

git clone git@github.com:chen-zz20/dsh-skill-stats.git
cd dsh-skill-stats && pnpm install && pnpm run build
dsh plugin --profile web add link:/path/to/dsh-skill-stats

Notes:
* This plugin is a bundle-type plugin. After installation, it is automatically added to the dsh.profile.bundles layer of the profile; no manual configuration line is required.
* The @deepseek-ai/* dependencies are published to the public npm registry, so pnpm install can fetch them directly.
* If pnpm 10.19+ minimumReleaseAge interception occurs, the repository already includes a pnpm-workspace.yaml exemption configuration.

Typical Usage

The plugin provides a REST API for querying statistics:

GET /skill-stats/api/stats                # 全局统计(含已删除技能)
GET /skill-stats/api/stats?scope=current  # 当前磁盘上的技能(含 0 次使用,无已删除)
GET /skill-stats/api/stats?sessionId=...  # 单会话技能使用

Response example:

{
  "skills": [
    { "name": "file-dsh-issue", "invocations": 5, "sessions": 2,
      "firstUsedAt": 1786000000000, "lastUsedAt": 1786009000000,
      "deleted": false, "callTimes": [1786000000000, 1786009000000] }
  ],
  "archivedSessionCount": 0,
  "ready": true,
  "updatedAt": 1786010000000
}

Field descriptions:
* ready: Indicates whether startup replay has fully completed (when incomplete, the frontend displays a loading state).
* callTimes: The timestamp of each invocation, sorted in ascending order.
* sessionId parameter: Query by session; sessions that are not ready replay their logs on demand during the query.

Caveats

  • Read-Only Plugin: The plugin does not modify any session logs or skill files.
  • Real-Time Capability: The unique advantage of the plugin format is that it can accumulate statistics while events are happening, whereas skill-form statistics tools can only perform post-hoc full scans.
  • Dependencies and Compatibility: The @deepseek-ai/* dependencies must be injected by the host environment.

Summary

dsh-skill-stats is a read-only plugin focused on skill usage statistics. Through incremental caching and dual-channel data, it can quickly provide historical data and update in real time, helping developers clean up unnecessary skill files and maintain a healthy skill library.

  • Project Homepage: https://github.com/chen-zz20/dsh-skill-stats
  • Community Catalog: https://www.skillhub.cn/plugins/chen-zz20/dsh-skill-stats