@lmzhen/dsh-tool-memory 0.1.0-rc.62 → 0.1.0-rc.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +16 -15
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { createHash } from "node:crypto";
|
|
|
24
24
|
* changes semantically: the bundle digest is the fail-closed signal for
|
|
25
25
|
* review workers, so a stale id across deployments must be distinguishable.
|
|
26
26
|
*/
|
|
27
|
-
const PROMPT_BUNDLE_ID = "dsh-evolution@
|
|
27
|
+
const PROMPT_BUNDLE_ID = "dsh-evolution@6";
|
|
28
28
|
const MEMORY_REVIEW_PROMPT = `[Auto-review — Memory]
|
|
29
29
|
Review the conversation above and consider saving to memory if appropriate.
|
|
30
30
|
|
|
@@ -129,7 +129,7 @@ Right target shape: class-level skills with rich SKILL.md + references/, templat
|
|
|
129
129
|
|
|
130
130
|
Hard rules:
|
|
131
131
|
1. NEVER hard-delete a skill. Archive (moving to .archive/) is the maximum destructive action; archives are recoverable, deletion is not.
|
|
132
|
-
2. Do not touch bundled, hub-installed, pinned, or scheduled-task-referenced (referenced) skills. Referenced skills
|
|
132
|
+
2. Do not touch bundled, hub-installed, pinned, or scheduled-task-referenced (referenced) skills. Referenced skills are fully protected — never consolidated, never pruned (there is no scheduled-task reference-rewriting pass; a referenced skill stays in place by design).
|
|
133
133
|
3. Do not archive recently-created or never-used skills without strong evidence. "use=0" is NOT evidence either way — it only means the trigger has not come up yet. Never archive a never-used skill unless it is at least 30 days old AND its content is genuinely obsolete or fully absorbed elsewhere.
|
|
134
134
|
4. Do NOT reject consolidation on the grounds that "each skill has a distinct trigger". The right bar is: would a human maintainer write this as N separate skills, or one skill with N labeled subsections? When the answer is the latter, merge.
|
|
135
135
|
5. Judge overlap on CONTENT, not on usage counters.
|
|
@@ -148,15 +148,7 @@ How to work:
|
|
|
148
148
|
4. Flag skills whose NAME is too narrow (contains a PR number, a feature codename, a specific error string, an 'audit'/'diagnosis'/'salvage' session artifact) — they almost always belong as a subsection or support file under a class-level umbrella.
|
|
149
149
|
5. Iterate. After one consolidation round, scan the remaining set and look for the NEXT umbrella opportunity. Don't stop after 3 merges.
|
|
150
150
|
|
|
151
|
-
Your
|
|
152
|
-
- skill_manage action=list / review — read the current landscape.
|
|
153
|
-
- skill_manage action=patch — add sections to the umbrella.
|
|
154
|
-
- skill_manage action=create — create a new umbrella SKILL.md.
|
|
155
|
-
- skill_manage action=write_file — add a references/, templates/, or scripts/ file under an existing skill (the skill must already exist).
|
|
156
|
-
- skill_manage action=delete — archive a skill. MUST pass absorbed_into=<umbrella> when you've merged its content into another skill, or absorbed_into="" when you're truly pruning with no forwarding target.
|
|
157
|
-
- skill_manage action=consolidate — merge source bodies into a target and archive the sources when patching by hand is error-prone.
|
|
158
|
-
- skill_manage action=restore — bring one archived skill back (recoverability is the archive's contract).
|
|
159
|
-
- For moving support files, keep it inside the skill tree: support files move via reading and writing through skill_manage write_file/remove_file.
|
|
151
|
+
You are a NOMINATOR, not an executor: this channel has NO tools. Your single deliverable is the structured YAML block below. Never narrate actions you did not take ("merged", "patched", "archived") — you are proposing, and the deterministic engine executes only names from the candidate pool it gave you. (A future execution view would expose skill_manage; today it does not.)
|
|
160
152
|
|
|
161
153
|
'keep' is a legitimate decision ONLY when the skill is already a class-level umbrella and none of the proposed merges would improve discoverability. 'This is narrow but distinct from its siblings' is NOT a reason to keep — it's a reason to move it under an umbrella as a subsection or support file.
|
|
162
154
|
|
|
@@ -164,7 +156,7 @@ Expected output: real umbrella-ification. Process every obvious cluster. If you
|
|
|
164
156
|
|
|
165
157
|
Keep the umbrella body tight and scannable: exact commands, verbatim paths, ~100-200 lines; never invent flags or APIs.
|
|
166
158
|
|
|
167
|
-
When done, write a human summary
|
|
159
|
+
When done, write a human summary THEN the structured machine-readable block. The block is the contract: every skill you would move to .archive/ MUST appear in exactly one of the two lists. Return ONLY the YAML block after the summary — no post-block prose. Format EXACTLY:
|
|
168
160
|
|
|
169
161
|
## Structured summary (required)
|
|
170
162
|
\`\`\`yaml
|
|
@@ -177,7 +169,7 @@ prunings:
|
|
|
177
169
|
reason: <one short sentence — why archived with no merge target>
|
|
178
170
|
\`\`\`
|
|
179
171
|
|
|
180
|
-
Every skill you
|
|
172
|
+
Every skill you would move to .archive/ MUST appear in exactly one of the two lists. If you consolidated X into umbrella Y (patched Y, wrote a references file to Y, or created Y with X's content absorbed), X goes under consolidations with into: Y. If you archived X with no absorption — truly stale, irrelevant, or obsolete — X goes under prunings. Leave a list empty (consolidations: []) if none. Do not omit the block. The block comes AFTER your human-readable summary of clusters processed, patches made, and decisions left alone.`;
|
|
181
173
|
const COMPLETION_SKILL_REVIEW_PROMPT = `[Auto-review — Skills · task complete]
|
|
182
174
|
Your current task now appears complete. Before wrapping up, review the approach and update the skill library via skill_manage.
|
|
183
175
|
|
|
@@ -194,18 +186,25 @@ Do NOT modify output files or re-run the task. If you are still mid-task, ignore
|
|
|
194
186
|
const SKILLS_GUIDANCE = `Skills guidance:
|
|
195
187
|
• After completing a complex task (5+ tool calls), fixing a tricky error, or discovering a non-trivial workflow, save the approach as a skill with skill_manage so you can reuse it next time.
|
|
196
188
|
• When using a skill and finding it outdated, incomplete, or wrong, patch it immediately with skill_manage (action='patch') — don't wait to be asked. Skills that aren't maintained become liabilities.`;
|
|
189
|
+
const PLAN_CHANNEL_NOTE = `
|
|
190
|
+
|
|
191
|
+
CHANNEL (subagent): this review channel mounts only the read-only \`skill\` tool — you have NO \`skill_manage\`, NO \`memory\`. Your deliverable is the structured JSON plan below (outputSchema). Describe the patches/creates you RECOMMEND in the plan; never narrate actions you took.`;
|
|
192
|
+
/** Subagent-channel variant: same review policy, channel-limited deliverable (M-2). */
|
|
193
|
+
const SKILL_REVIEW_PLAN_PROMPT = `${SKILL_REVIEW_PROMPT}${PLAN_CHANNEL_NOTE}`;
|
|
194
|
+
/** Subagent-channel variant of the combined review (M-2). */
|
|
195
|
+
const COMBINED_REVIEW_PLAN_PROMPT = `${COMBINED_REVIEW_PROMPT}${PLAN_CHANNEL_NOTE}`;
|
|
197
196
|
function sha256(text) {
|
|
198
197
|
return createHash("sha256").update(text).digest("hex");
|
|
199
198
|
}
|
|
200
199
|
function createPromptBundle(prompts) {
|
|
201
200
|
const canonical = JSON.stringify({
|
|
202
201
|
id: PROMPT_BUNDLE_ID,
|
|
203
|
-
version:
|
|
202
|
+
version: 6,
|
|
204
203
|
prompts: Object.fromEntries(Object.entries(prompts).sort())
|
|
205
204
|
});
|
|
206
205
|
return Object.freeze({
|
|
207
206
|
id: PROMPT_BUNDLE_ID,
|
|
208
|
-
version:
|
|
207
|
+
version: 6,
|
|
209
208
|
prompts: Object.freeze({ ...prompts }),
|
|
210
209
|
sha256: sha256(canonical)
|
|
211
210
|
});
|
|
@@ -214,6 +213,8 @@ createPromptBundle({
|
|
|
214
213
|
memory: MEMORY_REVIEW_PROMPT,
|
|
215
214
|
skill: SKILL_REVIEW_PROMPT,
|
|
216
215
|
combined: COMBINED_REVIEW_PROMPT,
|
|
216
|
+
skillPlan: SKILL_REVIEW_PLAN_PROMPT,
|
|
217
|
+
combinedPlan: COMBINED_REVIEW_PLAN_PROMPT,
|
|
217
218
|
curator: CURATOR_PROMPT,
|
|
218
219
|
completion: COMPLETION_SKILL_REVIEW_PROMPT,
|
|
219
220
|
skillsGuidance: SKILLS_GUIDANCE
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-tool-memory",
|
|
3
3
|
"description": "Model-facing memory tool and prompt context (community build)",
|
|
4
|
-
"version": "0.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.64",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
40
40
|
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
|
|
41
41
|
"@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
|
|
42
|
-
"@lmzhen/dsh-memory": "^0.1.0-rc.
|
|
43
|
-
"@lmzhen/dsh-memory-files": "^0.1.0-rc.
|
|
42
|
+
"@lmzhen/dsh-memory": "^0.1.0-rc.64",
|
|
43
|
+
"@lmzhen/dsh-memory-files": "^0.1.0-rc.64"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
|
|
47
47
|
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
|
|
48
48
|
"@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
|
|
49
49
|
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.1-rc.2",
|
|
50
|
-
"@lmzhen/dsh-memory": "^0.1.0-rc.
|
|
51
|
-
"@lmzhen/dsh-memory-files": "^0.1.0-rc.
|
|
50
|
+
"@lmzhen/dsh-memory": "^0.1.0-rc.64",
|
|
51
|
+
"@lmzhen/dsh-memory-files": "^0.1.0-rc.64"
|
|
52
52
|
}
|
|
53
53
|
}
|