Saltar al contenido principal
Y

dsh-skill-shelf

yituojuanjuana/dsh-skill-shelf

In-GUI skill shelf for DeepSeek Harness that tracks per-skill call counts (day / week / total) and success rate from a local ledger, audits imported skill content at install time, detects local edits against synced source snapshots, organises skills into a restorable trash, and offers a flat project-workspace view; evolution proposals can be applied into a project workspace after manual review. This package uses the independent name dsh-skill-shelf and mount id skill-shelf, so it can be installed alongside other skill-hub plugins.

Instalar

dsh plugin --profile web add github:yituojuanjuana/dsh-skill-shelf

README

dsh-skill-shelf

中文版 | English

npm version downloads license node

Skill Shelf panel: four directory group rows, each with day / week / total call counts and last-used time

In-GUI skill shelf for DeepSeek Harness — browse and govern the full ctx.skills catalog from the Web GUI: grouped by directory / role / workspace or as a flat list, with day / week / total call counts and success rate from a local ledger. Imports are content-audited first, tracked sources can be synced with local-edit detection, removals land in a restorable trash, diagnostics locate and repair loading problems, and evolution proposals are applied into the owning project workspace after human review.

Host runs in the dsh process via official SDKs only; browser renders through official slots. No dsh source changes.

Quick start

dsh plugin --profile web add dsh-skill-shelf
# restart dsh web → Settings → Skill Shelf → Market → scan → import

Requires Node ^22.19 || >=24 + dsh web >=0.1.7-alpha.1 <0.3. dsh 0.2.2 and later require Node >=24.9.

Two surfaces — the hub panel lives at Settings → Skill Shelf, and this plugin's own configuration card sits on the plugin's page in the Plugins manager (sidebar → 插件 → dsh-skill-shelf). The card is registered by the plugin itself into the plugins.bundle.config slot — dsh has no auto-generated config page — and covers the master switch, announce-to-agent, dot colors, the GitHub token and which usage figures are shown.

Features

Settings → Skill Shelf — 4 tabs: General (all skills, viewed all / by source / by location / by role), Workspace (project skills for the selected workspace), Market (install + update), Trash (restorable removed skills).

The same hub is available as a 960px sidebar panel (left rail → Plugins area → Skill Shelf), so skills can be browsed without leaving the conversation.

  • Browse — every root of the ctx.skills registry: project / user / bundled + third-party providers. Search across name, description, displayName; filter by source, status (enabled / disabled), and invocation (model / user); sort by usage (the default), name, or added time. Every row has a ⋯ menu for detail / toggle / delete, so actions do not depend on edit mode. Same-name skills from different sources get a duplicate badge instead of silently hiding.
  • Content audit — enabled skills' bodies (SKILL.md) are checked too: raw ESC control characters, Unicode tag characters, bidirectional controls, and encoding disguises (NUL bytes / UTF-16 / invalid UTF-8 in a text file) — these make "reviewed" not equal "seen" and are refused outright — plus zero-width characters, curl … | sh remote execution, SSH/cloud-credential/keychain paths, over-long descriptions, and the 2 MiB per-file / 10 MiB per-skill / 500-file limits. Only findings with no legitimate use block the install; the rest are warnings for a human to judge. Pure local static matching: no model call, no network. A market import scans the whole bundle (including scripts/); the standing check only reads SKILL.md — it runs on every 5-second poll, and walking every directory would slow the panel down.
  • Announcement budget — the name + description total that the first progressive-disclosure layer injects comes back with the catalog, so the panel can show characters and an estimated token count; past 8000 characters it turns red (clients truncate the tail there, which shows up as "installed but never triggers").
  • Toggle — per-skill switches and per-group tri-state switches with a conflict dialog (close all / keep on). Disabling is a sidecar policy: the discovery file is never renamed or deleted; an invocation override turns off model auto-invocation while /name keeps working. Paused skills stay in the catalog, are inspectable and re-enableable, and can be moved to trash from edit mode. Only ~/.dsh/skills & ~/.agents/skills are writable; everything else is read-only.
  • Organize — three independent axes: source (the upstream repo a skill was installed from), location (the discovery root, e.g. ~/.dsh/skills / Codex), and roles (automatic keyword grouping). Source collections auto-aggregate; locations get their own by location view, one card per discovery root with a whole-root switch (when a skill is discovered in several roots, it belongs to the registry's winning root — the same one the row badge shows); roles are derived by classifyRole from weighted keywords over each skill's name and description (name hits weigh more). That is a presentation-only fold: nothing is written to disk and no model is called, so installing a skill puts it in a group on the next poll. The role view shares its row source with the other views and therefore honours the status, invocation and search filters; when the filters empty it out you get "no skills match the current filters" plus a clear filters button instead of a blank pane. Source collections and hand-curated roles persist in ~/.dsh/dsh-skill-shelf.json; the restore snapshot lives in browser localStorage. Edit mode reveals delete/reorder without cluttering the read view.
  • Diagnose & fix — files the provider skips (missing frontmatter, bad YAML, name mismatch, short description) show up with reasons; every entry is tagged broken (the provider skips the file, so the skill never appears in the list) or warning (it loads, but has an issue), the section header counts both levels, and broken rows are red; auto-fixable ones (e.g. unquoted : in descriptions) get a one-click Fix button.
  • Scaffold — new-skill wizard writing to ~/.dsh/skills or ~/.agents/skills (SKILL.md template below).
  • Market — built-in curated repos plus custom owner/repo sources. Any top-level directory containing SKILL.md scans as a root (no allowlist), and a SKILL.md at the repo root itself scans as a single skill named after the repo (minus repo tooling such as .github/). Async import with byte-level progress and cancel. Each source pins a version — click the ref badge to switch between releases, branches, or a custom ref. Every import passes the content audit first: a skill with a blocking finding is refused as a whole and its temp directory is removed (nothing left on disk).
  • skills.sh search — beyond the built-in catalog, search the skills.sh index by skill name; results show the hosting repo and its install count, with two actions per row: Install pulls that one skill straight in (one step, but it does not track upstream — the index gives a skill directory name, never its path inside the repo, so no source record can be registered), while Add source registers the repo and scans it, after which update tracking, version pinning and trash behave exactly like a hand-added source. Both paths pass the same content audit. Requests are proxied server-side — the upstream sends no CORS headers, and a search should not hand the user's egress IP to a third party — and both source and package paths are validated against strict shapes before use.
  • Track updates — imported skills record a repo + commit snapshot. Check all / update-all (covering both new releases and skill updates), per-source badges (installed / updatable / deleted upstream / new release). When a new release is out, Update re-pins to that release first and then syncs (pin the version badge by hand to stay on an older one). The sync dialog preselects only skills that actually changed upstream and marks locally edited ones before they are overwritten; upstream deletions move into a restorable trash that keeps source and role membership.
  • Local-edit detection — a content hash of the whole skill (path + size + body) is sampled right after the bytes land and compared on every check: skills that no longer match get an "edited locally" badge, and the sync dialog marks exactly which ones the overwrite will discard. Records without a hash are treated as unknown, never as edited.
  • Import from another agent — read-only scan of the skill folders of Claude Code / Codex / WorkBuddy / Cursor / Gemini CLI / Copilot / OpenCode / Goose, at two levels: user-level (~/.claude/skills and friends) into ~/.dsh/skills, and project-level (<projectRoot>/.claude/skills and friends, project roots derived from registered workspaces) into that project's .dsh/skills. The originals are untouched; flat skills land as directory bundles; the same content audit and size caps apply. Symlinked folders resolving to the same file (cc-switch style central management) are merged into one row with an "also in" badge; WorkBuddy display metadata (workbuddy.json or SKILL.md frontmatter) maps onto the hub's display name / short description, and stale absolute paths in _skillhub_meta.json are stripped from the copy.
  • Project skill toggles — project skills can be switched off via an invocation override: the hub registers its provider once more into every live agent's skill layer (nearer than the preset layer) and publishes a same-name entry that outranks the host's native one, flipping that skill's modelInvocable to false. The model stops auto-invoking it, "/name" keeps working, and not a single byte of the project changes (zero git pollution). The state lives in the hub's sidecar; flipping the switch again restores it.
  • Import from ZIP — pick a .zip: every directory containing a SKILL.md becomes one skill, so a single-skill archive and a collection both work, each passing the content audit independently. Before anything is unpacked the reader rejects path traversal, symlinks, encrypted and ZIP64 archives, and decompression bombs; writes go through a temp directory plus an atomic rename, so a failure leaves nothing behind. A name that is already enabled is skipped — only a disabled placeholder or an empty shell steps aside into the restorable trash.
  • Skill evolution (off by default) — after a turn ends, an idle window opens; once the conversation has been idle for 20 seconds the hub replays that conversation's user, assistant and tool messages through one tool-less model call and asks whether anything in it is worth reusing. A suggestion that comes back has to pass a hard gate before it queues: kebab-case name, non-empty description/body/rationale, confidence ≥ 0.6, create must not collide with an existing name and update must target one. Each suggestion carries the real ledger counts (today / week / total) of the skills it touches, so "this is worth a skill" rests on evidence rather than the model's opinion. Suggestions only queue — adopting one is a click, and only create can be adopted automatically (improving an existing skill means merging into a file a human wrote, which is never overwritten for you). Every proposal shows its occurrence probability (how often the same lesson has come up before), so you can tell a recurring pattern from a one-off. Every decision lands in a ledger (adopted / rejected / ignored, with time and reason), so "why did this one not land" survives a refresh or a restart. Review runs outside the conversation: no turn, no tools, no prompt-cache change, and every failure degrades to "nothing learned this turn".
  • Usage stats — an append-only local ledger (~/.dsh/skill-usage-manager/usage-ledger.jsonl) records every skill invocation and is aggregated into day / week / total, with the same three figures summed on group headers. The ledger is independent of session logs, so deleting a session loses nothing; history is backfilled from the session logs once at plugin startup. The success rate comes from each call's actual result: tool/ptc-dispatch carries isError inline, tool/call pairs with tool/result through message.toolCallId and reads message.isError, and /skill-name has no result event so it records no outcome — entries without a recorded result show unknown rather than 0%, so the two stay distinguishable. Which figures and the last-used time are shown stays live-configurable from the settings card.
  • Invocation switches write back to the source file — the per-row model / user chips edit that skill's SKILL.md frontmatter (disable-model-invocation / user-invocable). The write is in place (open('r+') + truncate + write) rather than temp-file-plus-rename: a rename swaps the inode and Windows resets birthtime with it, which made the panel show the install time as "just now". Each write backs up first and rolls back in place on failure; a persisted firstSeenAt is the second line of defence and takes min(recorded, birthtime), so the install time no longer drifts when a switch is toggled. Skills in external agent roots (Trae and friends) are writable too; rows that genuinely cannot be written render as static text instead of a button that errors.
  • Settings card — registered on the plugin's own page in the Plugins manager (sidebar → 插件 → dsh-skill-shelf; collapsed until you expand the title): master switch, announce-to-agent, invocation dot colors, GitHub token, usage display toggles. The version badge in the title row flags a newer published version (update check reads the npm registry latest tag — the version dsh plugin add would actually install — with the GitHub release only as a fallback, cached for 10 minutes), next to an Update now button: a copy installed inside a profile upgrades in place and asks for a restart; a copy link:ed from a working directory is refused on purpose (replacing it would break the development loop), and an Electron-managed profile is refused by the host itself.

Content audit and announcement budget

CapabilityWhat it does
Content auditRaw ESC / Unicode tag characters / bidirectional controls / zero-width characters / curl … | sh / SSH and cloud credential paths / 2 MiB per file, 10 MiB per skill, 500 files. Blocking (refuses the write; a market import is refused as a whole and its temp directory removed): raw ESC / Unicode tags / bidirectional controls / encoding disguises / size caps. Warnings (flagged, not blocked — these have legitimate uses): zero-width characters, curl … | sh, credential paths, over-long description. Pure local static matching: no network, no model call.
Announcement budgetThe name + description total of the first progressive-disclosure layer comes back with the catalog, so the panel shows characters and an estimated token count; past 8000 it turns red — clients truncate the tail there, which shows up as "installed but never triggers".
Plugin announcementWith "announce to agent" on, one 340-character Chinese blurb goes into the system prompt (where the hub lives, a capability overview, the writable scope and the sidecar-toggle rule, trigger words). Chinese only: the English paragraph was a sentence-by-sentence translation of it, pure redundancy — the pair was 5023 characters, 46.8% of the whole system prompt (issue #23).

Scaffold format (SKILL.md):

---
name: my-skill
description: One line when the agent should use this skill.
---
# my-skill
Body...

How it works

GitHub repo ──scan/import──▶ ~/.dsh/skills
     ▲                          │
     └─check/sync/delete── ctx.skills ◀─ provider
                                │ snapshot/get
                                ▼
                    /api/skill-shelf/* ──▶ Panel (Settings → Skill Shelf)

Host uses only ctx.skills.snapshot/get, ctx.webServer.register, ctx.systemPrompt.section. Routes sit behind dsh's own /api trust fence (loopback / the listener's bind address / --trusted-host), JSON; write routes (POST) additionally require an x-dsh-skill-shelf: 1 header — a cross-site page cannot forge a custom header, and a same-origin request skips the CORS preflight so it costs no extra round trip. The provider registers in the global skill layer and once more into every live agent's skill layer (nearer than the preset layer), so an invocation override can outrank the host's native entries.

HTTP API

EndpointMethodPurpose
/api/skill-shelf/catalog?cwd=GETskills + disabled + diagnostics + duplicates
/api/skill-shelf/skill?name=&cwd=GETskill body (works for disabled too)
/api/skill-shelf/skill/deletePOSTmove to trash (snapshots source+roles)
/api/skill-shelf/togglePOST{name, enabled}
/api/skill-shelf/toggle-batchPOST{names, enabled}
/api/skill-shelf/createPOST{name, description?, root?}
/api/skill-shelf/diagnostic/fixPOST{path} auto-fix frontmatter
/api/skill-shelf/permanent-statsGETledger-aggregated day / week / total invocation counts
/api/skill-shelf/evolutionGETpending skill suggestions, handled history, review runs
/api/skill-shelf/evolution/adoptPOST{id, root?} writes one create suggestion as a real skill
/api/skill-shelf/evolution/dismissPOST{id} drops a suggestion
/api/skill-shelf/evolution/runPOST{sessionId?} reviews immediately, bypassing the cooldown
/api/skill-shelf/configGET/POSTruntime config (null clears)
/api/skill-shelf/groupsGETtags + collections + orders
/api/skill-shelf/tag etc.POSTcreate/rename, delete, set members, reorder
/api/skill-shelf/market etc.GET/POSTlist/add/delete/pin sources; …/source/check + …/source/sync update them
/api/skill-shelf/market/source/versions?repo=GETreleases + branches for the version picker
/api/skill-shelf/market/skills-sh?q=GETskills.sh index search (server-side proxy, ≥2 chars; results validated as strict owner/repo)
/api/skill-shelf/market/skills-sh/installPOST{source, skillId} installs one skill directly (no source record, so no update tracking)
/api/skill-shelf/repo?repo=GETdiscover (any root)
/api/skill-shelf/repo/importPOSTasync job {jobId, total, totalBytes}
/api/skill-shelf/repo/import/progress?jobId=GETpoll job
/api/skill-shelf/repo/import/cancelPOSTcancel job
/api/skill-shelf/sources etc.GET/POSTlist/check/sync/delete/restore/clear trash
/api/skill-shelf/foreignGETread-only scan of other agents' skill folders (user-level + project-level; project roots derived from registered workspaces)
/api/skill-shelf/foreign/importPOST{items:[{agent,name,scope?,projectRoot?}]} copied into ~/.dsh/skills (user-level) or that project's .dsh/skills (project-level)
/api/skill-shelf/import/zipPOSTraw .zip bytes (content-type: application/zip, ≤32 MiB); every directory holding a SKILL.md becomes one skill, audited and installed independently
/api/skill-shelf/updateGETplugin latest release (?refresh=1 bypasses the 10-minute cache)
/api/skill-shelf/update/applyPOST{version} installs that version into the current profile; link: copies and Electron-managed profiles are refused (reason in error, HTTP stays 200)
unknown /api/skill-shelf/*GET/POST404 {error} naming the path — a typo must not read as an auth failure (the SPA fallback answers 401 for /api/* it does not own)

Development

npm run typecheck  # tsc --noEmit
npm test           # 576 tests, 41 suites
npm run build      # tsc + tsdown → lib/index.js + lib/client.js

Display metadata for the Plugins manager page ships beside the code and is read without activating the plugin: locale/en.json + locale/zh.json (meta.title / meta.description / meta.detail), icon.svg, and the one-image detail document DETAIL.md / DETAIL.zh.md with its preview-real.png screenshot. engines.dsh is kept as wide as the peer ranges on purpose — once declared it alone decides compatibility, so a narrower floor would refuse hosts that work today. market/index.json is the format-1 entry for a community index; regenerate its publishTimestamp and version when releasing.

Don't run two dsh web on the same $DSH_HOME + cwd — no session-log lock (seq gap corruption). Use separate DSH_HOME.

Troubleshooting

  • duplicate loader entry id: skill-hub — remove the duplicate install (keep one dsh plugin add method).
  • Skill missing — check the diagnostics section (frontmatter / name mismatch / short description / two discovery forms claiming the same name: a <name>/SKILL.md bundle and a <name>.md file can coexist on disk, and the registry keeps only one of them).
  • Empty source group — its skills were deleted, or their paused records were lost (sidecar restored/hand-edited). Startup first migrates any legacy .disabled file into a policy override, then reconciles records and prunes records whose file is gone. Source groups with no visible member are no longer rendered.
  • A skill cannot be created / stays "paused" — the paused record pointed at a file that no longer exists. Startup drops the stale record so the name is free again; enabling a paused skill simply clears the override and the record.
  • Dots missing in / menu — dsh internals changed; catalog still works.
  • Settings card missing — open the plugin in the Plugins manager (sidebar → 插件 → dsh-skill-shelf) and expand the 「技能书架」 card at the top of the page (collapsed by default). On dsh older than 0.1.7-alpha.1 this plugin does not load at all (the settings API it targets does not exist there).

Community

Issues · Discussions · Showcase · Market PR · Discord

License

MIT — LICENSE.

Plugins relacionados