Vai al contenuto principale
J

dsh-self-evolve

jianghuife/dsh-self-evolve

Hermes-style self-evolution for DeepSeek Harness: a skill_manage tool that lets the agent save proven procedures as skills, prompt guidance for when to save them, usage tracking, and a background curator that keeps the self-authored skill library healthy

Installazione

dsh plugin --profile web add github:jianghuife/dsh-self-evolve

README

dsh-self-evolve

中文 | English

Hermes-style self-evolution for DeepSeek Harness: the agent saves proven procedures as skills, a background curator keeps the self-authored library healthy, and future sessions follow the proven procedure instead of rediscovering it.

The loop

  1. The agent solves a non-trivial problem (multi-step fix, hard-won root cause, user correction).
  2. Prompt guidance nudges it to call skill_manage(create) with the proven procedure: steps, pitfalls, verification.
  3. The skill lands as <skills root>/<name>/SKILL.md — the exact directory-package shape dsh-skill-filesystem scans — so it enters the next session's skill catalog with no extra wiring and full progressive disclosure (catalog shows name + description; the body loads only on demand).
  4. When a loaded skill turns out wrong, the agent patches it in the same session (patch is exact-text replace — token-cheap, like an Edit tool for skills).
  5. The curator ages out what stops earning its place.

Installation

Node.js 22.19 or later. Install the npm package into a DSH profile (replace web as needed):

dsh plugin --profile web add dsh-self-evolve

Installing through dsh plugin add activates the bundled default configuration automatically. Verify the composed config without starting DSH:

dsh --profile web --dump-config

Install a local checkout instead of the npm release:

dsh plugin --profile web add /path/to/dsh-self-evolve

What's registered

  • skill_manage tool — actions create / patch (preferred) / edit / delete / write_file / remove_file / pin / unpin. Every write stamps metadata.authoredBy: dsh-self-evolve plus createdAt / updatedAt / version; only skills carrying that stamp can ever be modified — bundled and human-authored skills are read-only. delete archives (moves into the state dir), never destroys. SKILL.md is capped at 15 KB by default; resource files at 64 KB.
  • Prompt guidance — one static system-prompt section (order 160) stating when to save, when to patch, and the memory-vs-skill rule ("skills store procedures; facts belong in memory"). Static text ⇒ cache-stable. Loads only where a systemPrompt service is composed.
  • Usage tracking — a tools/result observer records every successful skill tool load of a skill living in this root into <state dir>/usage.json. The ledger is separate from frontmatter so recording a use never rewrites SKILL.md.
  • Curator — one pass per curatorIntervalHours (default 24 h, 30 s after startup): agent-authored skills unused for staleDays (30) get metadata.status: stale; unused for archiveDays (90) are moved to <state dir>/archive/<name>-<timestamp>/. Pinned skills are exempt; nothing is ever hard-deleted; foreign skills are never touched. Status writes restore the file's mtime so curation bookkeeping never counts as activity.

Config

keydefaultmeaning
skillsRoot<dsh home>/skillsWhere agent-authored skills are written (must be a scanned skill root).
stateDir<dsh home>/self-evolveUsage ledger + archive.
staleDays30Days without use before a skill is marked stale.
archiveDays90Days without use before a skill is archived.
maxSkillBytes15360SKILL.md size cap.
maxResourceBytes65536Per-resource-file size cap.
curatorIntervalHours24Minimum hours between curator passes; 0 disables.
guidancetrueContribute the self-improvement prompt section.

Out of scope (by design)

Hermes layers two more mechanisms on top; both are deliberately separate systems:

  • LLM-review curation (a forked agent voting keep / patch / consolidate / archive per skill) — the mechanical phase here leaves the hooks in place (metadata.status, the ledger, the ownership gate).
  • Offline GEPA evolution (trace-driven optimization of skills proposed as PRs) — belongs in a pipeline that reads session logs (ctx.sessionQuery), not in the runtime plugin.

License

MIT

Plugin correlati