Introduction

When developing agents with DSH, skills tend to accumulate: those used for early debugging, those tried once and discarded, and those replaced by newer approaches. Over time, it becomes unclear which skills are still actually being called—deleting them risks future use, while keeping them turns them into zombie files, making judgment solely based on memory unreliable.

dsh-skill-stats solves this problem: by replaying historical session logs and real-time subscriptions, it accurately counts how many times each skill is invoked via the skill tool, helping you decide which skills are worth keeping. Below is an introduction to its features, installation, and usage.

What is it

dsh-skill-stats is a read-only DSH statistics plugin, version 0.1.0, under the MIT license. It counts the invocation frequency of each skill, with data coming from two channels:

  • Historical Replay: Scans the host environment’s session logs (session.jsonl / session.jsonl.zstd) on startup, parsing skill invocations within tool/call events
  • Real-time Subscription: Listens to in-progress tool call events, accumulating counts instantly

The plugin does not modify any session logs or skill files.

Regarding repository ownership: The main repository is github.com/chen-zz20/dsh-skill-stats, while github.com/omdsh-dev/dsh-skill-stats is just a read-only community mirror that syncs with the main repository; actual ownership follows the main repository.

Core Features

  • Call Statistics: Cumulative invocation count per skill, number of sessions used, first/latest usage time, and specific time for each invocation
  • Session View: List of skills used in a single session, sortable, with a mini trend chart per line; expandable to show a large chart and time of each call
  • Global Dashboard: Statistics table for all current skills (including those with 0 uses), supports sorting, SVG trend charts, 1/3/7/30-day range filtering, and details of each invocation
  • Incremental Caching: Records file size and modification time (size + mtime watermark); on restart, only replays logs that have changed, avoiding a full scan every time
  • Deleted Markers: Marks a skill as “Deleted” when its directory no longer exists in any workspace or global skill root directory; deletion detection scans all workspaces and global skill root directories, not limited to the current working directory
  • Loading State: Displays a loading indicator during replay; prevents the plugin from mistakenly reporting an empty snapshot as “unused”

Installation and Enablement

First, clone the repository and build it, then add the build artifacts to your profile via a link:

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

This is a bundle-type plugin, automatically added to the profile’s dsh.profile.bundles layer; no manual configuration is required.

Regarding dependencies: private: true in package.json means it is not published via npm, so installation is via clone and local build. The declared dependency @deepseek-ai/dsh-home-paths is published to the public npm registry and can be pulled directly via pnpm install; cordis, schemastery, and react are peerDependencies, while other runtime @deepseek-ai/* packages are injected by the host environment. If pnpm 10.19+ intercepts installation due to minimumReleaseAge, the repository includes a pnpm-workspace.yaml exemption configuration.

Statistics API

The plugin exposes a statistics interface GET /skill-stats/api/stats, supporting three query methods:

GET /skill-stats/api/stats                # Global (including deleted skills)
GET /skill-stats/api/stats?scope=current  # Skills currently on disk (including 0 uses, no deleted)
GET /skill-stats/api/stats?sessionId=...  # Skill usage for a single session

The response structure is as follows:

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

Meanings of a few fields:

  • ready: Whether the startup replay has been fully completed; when incomplete, the frontend shows a loading state to avoid mistakenly reporting an empty snapshot as “unused”
  • callTimes: Timestamps for each call, sorted in ascending order (aggregated across sessions by time, not by session)
  • sessionId parameter: Query by session; sessions that are not ready will replay their logs as needed when queried

Local Development

Development commands provided by the repository:

pnpm install        # Pull declared dependencies
pnpm run typecheck  # Type checking
pnpm test           # Test
pnpm run build      # Build lib/
pnpm run check      # All of the above

Note: typecheck and test require a local DSH checkout. Module resolution maps to the local checkout path (../../.dsh/source/current/...) via paths in tsconfig.json and vitest.config.ts; environments without a local checkout can only install and run; the paths must be configured before running typecheck/test.

Use Cases and Notes

Suitable for these groups:

  • DSH users who have accumulated a batch of skills and want to clean up zombie skills
  • Developers who want to see skill usage within a single session
  • Scenarios requiring programmatic access to skill statistics for further analysis; simply call the API above

A few notes:

  • The plugin runs with the permissions of the current dsh process; please review the source code and license (MIT) before installing
  • Please submit stars/issues/PRs to the main repository github.com/chen-zz20/dsh-skill-stats; the one under omdsh-dev is just a read-only mirror
  • The plugin only performs statistics and does not modify any session logs or skill files

Summary

Through the steps above, you now have a continuous numerical basis for skill usage: which are high-frequency, which have never been called, and when usage stopped; everything can be decided based on data rather than memory.

  • Community Directory Page (Third-party maintained): https://www.skillhub.cn/plugins/omdsh-dev/dsh-skill-stats
  • Main Repository: https://github.com/chen-zz20/dsh-skill-stats
  • Community Mirror: https://github.com/omdsh-dev/dsh-skill-stats