Adds experience memory and task planning for DSH agent: automatically retrieves similar past solutions before invocation, with LLM evaluating reuse and dynamically decomposing steps.
- Language
- JavaScript
- License
- MIT
- Branch
- main
Install
$ dsh plugin --profile web add github:ztl34245881-commits/dsh-task-plannerRun the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial
Install via your agent
Install the DeepSeek Harness plugin ztl34245881-commits/dsh-task-planner for me: review the repository at https://github.com/ztl34245881-commits/dsh-task-planner first, then run the install command and verify the plugin loads successfully.
Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.
One-Line Description
Add "muscle memory of experience" to DSH agents: when receiving a task, first search the past experience database, have the LLM evaluate reusability, then dynamically split into steps; automatically accumulate new experience upon task completion, getting smarter with use.
Core Capabilities
- Automatically recall historical solutions for similar tasks without manual search
- Have the LLM determine if historical solutions are usable; if usable, improve and reuse; if not, explain reasons and generate a new plan
- Split tasks into 3-8 steps, matching each step with the most suitable capability/tool, avoiding hardcoded fixed combinations
- Automatically draft experience entries into the experience database during task planning; update execution results at task completion
- Provide a standalone experience query tool supporting save, retrieve, and list all experiences
- Save experiences as pure Markdown files, easy for editor modification, grep search, and Git version control
Technical Implementation
- Language: JavaScript (Node.js ES Module)
- Key Dependencies: Host built-in
shell,llm,toolsthree services (no external npm dependencies) - Architecture Pattern: Declarative dependency injection (inject:
['shell','llm','tools']), register two toolsplan_task/task_memoryviactx.tools.register - Entry File:
index.mjs(cordis bundle patch injects into host viacordis.patch.yml)
Use Cases
Call plan_task before complex cross-tool, cross-step tasks requiring documentation or scripting, letting the agent first recall what was done before deciding how to proceed. If you frequently handle similar tasks (e.g., weekly reports, data reports, batch editing), the experience library will gradually form stable patterns, making subsequent planning faster.
Prerequisites & Compatibility
| Dependency | Min Version | Description |
|---|---|---|
| DSH Harness | Not declared | Requires host to provide shell / llm / tools three built-in services |
| Node.js | Not declared | Code uses node:os, node:path modules and ESM syntax; recommend using Node version currently supported by DSH |
| Platform | Cross-platform | No platform restrictions, pure Node.js implementation |
| Native Modules | None | Does not depend on any native modules |
Installation
dsh plugin --profile web add github:ztl34245881-commits/dsh-task-planner
Configuration Options
| Config | Type | Description | Default |
|---|---|---|---|
| lessonsDir | String path | Experience library storage directory, each experience is a .md file | ~/.dsh/planner-lessons |
| capabilityFile | String path | Optional, points to a capability list (Markdown); during planning, have the LLM match which capability each step uses | Empty (capability matching disabled) |
FAQ
Q: Which host services must be used together?
A: The plugin declares dependencies on shell, llm, tools three services at startup; these must be provided by the official DSH Harness standard environment. If the host lacks these services, the plugin will fail to initialize.
Q: Where does the experience library default to? Can I change the location?
A: Defaults to ~/.dsh/planner-lessons directory, each experience is a Markdown file; can be changed to any path via lessonsDir in cordis configuration.
Q: What is capabilityFile for?
A: Points to a custom capability list (e.g., awesome list style plugin directory); plan_task will match each step against this list to generate a capability mapping. Leave empty to skip capability matching.
Q: What model does plan_task use?
A: Reuses host default model (read via agentDefaultModel.currentSelection); during planning phase increases maxTokens to 8000 to accommodate long-chain reasoning. Returns error prompt if unable to parse default model.
Q: Can experiences be directly edited with an editor?
A: Yes. Experiences are Markdown files with YAML frontmatter, plain text, can be grepped, manually edited, and version-controlled with Git. Manual modifications will be recognized in next retrieval.
Q: When will experiences be promoted to formal skills?
A: The plugin itself does not perform automatic promotion. README convention: experiences successfully reused 3 times can be promoted to skill, rejected 2 times are marked as obsolete; these actions are manually maintained by the caller via task_memory save as needed.
Q: How to completely uninstall?
A: Remove the plugin via dsh plugin remove. To clear historical experiences, delete all .md files in lessonsDir; if only uninstalling the plugin without deleting files, reinstalling will allow continued use.
Learning Curve
Beginner — just one command to install, call plan_task before complex tasks; optional configuration items only need adjustment when customizing capability list or experience library path.
Known Issues & Limitations
- Experience retrieval uses 2-3 character sliding window keyword matching, string matching rather than semantic matching; "周报" (weekly report) and "月报" (monthly report) will match but semantic proximity is not judged
- Experience scoring directly sums keyword hit counts without considering keyword weight; longer experience files naturally have advantage
- Chinese stopword list (STOPWORDS) is hardcoded in source code; extending new stopwords requires code modification and re-release
- Experience filename slug only takes first 40 characters of task; different tasks' slugs may conflict or duplicate
- When saving experience, outcome field is truncated to 100 characters; long reflection content will be lost
- Tool registration failure returns error string instead of throwing exception, may be ignored by caller
- Experience library reading implemented via chained shell commands; entire plugin becomes unavailable when host shell service is unavailable
Task planning with experience muscle-memory for DeepSeek Harness (dsh).
Give a task → the agent recalls past similar solutions (condition reflex), evaluates whether they fit, and produces a dynamic plan matched against its capabilities — never hard-coded combos. Every plan auto-drafts a lesson into the experience library; when the task closes, the agent updates the outcome. The more you work, the smarter the reflex.
Features
- 🧠 Experience library (
task_memory save/recall/list): persistent lessons as plain Markdown with signature keywords. Recall uses a 2–3-char sliding-window tokenizer, so "weekly report" still hits a "daily report" lesson. - ⚡ Condition-reflex planning (
plan_task): recall → LLM evaluates fit (reuse & improve, or explain why not and plan fresh) → decomposed steps with capability matching → risks → next actions. - 🤖 LLM-driven, not rule-driven: the model decides what to use per task; the plugin only supplies context (past experiences + optional capability catalog).
- ✍️ De-AI deliverable standard: any textual output step (docs/sheets/slides/copy/scripts) must include a humanize-then-review pass before delivery.
- 🗂️ Auto-persist:
plan_taskdrafts the lesson automatically (status:draft); the agent marks itverifiedwith the outcome at loop close. - 🔒 Zero keys, zero absolute paths: everything is configurable; the experience library lives in
~/.dsh/planner-lessonsby default.
Install
dsh plugin --profile web add github:<your-user>/dsh-task-planner
or copy the repo and add it as a local bundle:
dsh plugin --profile web add /path/to/dsh-task-planner
Config (optional, in your profile's cordis.patch.yml)
- id: dsh-task-planner
name: dsh-task-planner
config:
lessonsDir: /path/to/your/lessons # default: ~/.dsh/planner-lessons
capabilityFile: /path/to/capability-map.md # optional catalog fed to the LLM
Point capabilityFile at a markdown catalog of your skills/plugins (e.g. an awesome list) and plan_task will match each step against it.
Usage
plan_task { task, goal?, constraints? }— plan before starting complex work.task_memory save { task, plan, outcome }— persist a lesson (auto-called by plan_task for the draft).task_memory recall { task }— condition-reflex lookup.task_memory list— show all lessons.
Lesson lifecycle
plan_taskwrites a draft lesson (status: draft) automatically.- When the task closes, the agent updates it with the outcome (
status: verified). - A lesson reused successfully 3× → promote to a formal skill. A lesson rejected 2× → mark obsolete.
Notes
- Requires the
llm,shell,toolsservices (all present in the standard harness). - The model call uses the harness default model (
agentDefaultModel); reasoning models need a generousmaxTokens(8k is used internally). - Lessons are plain Markdown — human-editable, greppable, portable.
License
MIT
Read the usage guide →
Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.
Listing badge
[](https://deepseek-plugin.org/plugins/ztl34245881-commits/dsh-task-planner)Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.