@lmzhen/dsh-evolution-core 0.39.0 → 0.39.2
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 +63 -158
- package/lib/types/prompts.d.ts +13 -19
- package/lib/types/prompts.js +59 -157
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -6813,112 +6813,76 @@ var MemoryStore = class {
|
|
|
6813
6813
|
* changes semantically: the bundle digest is the fail-closed signal for
|
|
6814
6814
|
* review workers, so a stale id across deployments must be distinguishable.
|
|
6815
6815
|
*/
|
|
6816
|
-
const PROMPT_BUNDLE_VERSION =
|
|
6817
|
-
const PROMPT_BUNDLE_ID = `dsh-evolution@
|
|
6818
|
-
const
|
|
6819
|
-
Review the conversation above and consider saving to memory if appropriate.
|
|
6816
|
+
const PROMPT_BUNDLE_VERSION = 27;
|
|
6817
|
+
const PROMPT_BUNDLE_ID = `dsh-evolution@27`;
|
|
6818
|
+
const MEMORY_REVIEW_BODY = `Focus on durable facts that change future collaboration:
|
|
6820
6819
|
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
2. Has the user expressed expectations about how you should behave, their work style, or ways they want you to operate?
|
|
6820
|
+
1. The user: role, context, stable preferences, constraints, and facts they would want remembered.
|
|
6821
|
+
2. The work: how deliverables should be judged across future tasks — quality bar, format, sources/tools, and collaboration conventions.
|
|
6824
6822
|
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
Review the conversation above and update the skill library.
|
|
6823
|
+
Do not store task progress or reusable procedures; procedures belong in skills.
|
|
6824
|
+
Prefer merging or replacing an existing entry over adding a near-duplicate.
|
|
6825
|
+
Keep the entry compact.`;
|
|
6826
|
+
const SKILL_REVIEW_BODY = `Review the conversation above and update the skill library.
|
|
6829
6827
|
|
|
6830
|
-
|
|
6828
|
+
Update only when the session contains a durable lesson that changes how this class of task should be done. A precise no-op is a valid outcome.
|
|
6831
6829
|
|
|
6832
|
-
|
|
6830
|
+
Target: a class-level skill with a compact SKILL.md and a references/ directory for session-specific detail.
|
|
6833
6831
|
|
|
6834
|
-
|
|
6835
|
-
• User corrected your style, tone, format, legibility, or verbosity. Frustration signals like 'stop doing X', 'this is too verbose', 'don't format like this', 'why are you explaining', 'just give me the answer', 'you always do Y and I hate it', or an explicit 'remember this' are FIRST-CLASS skill signals, not just memory signals. Update the relevant skill(s) to embed the preference so the next session starts already knowing.
|
|
6836
|
-
• User corrected your workflow, approach, or sequence of steps. Encode the correction as a pitfall or explicit step in the skill that governs that class of task.
|
|
6837
|
-
• Non-trivial technique, fix, workaround, debugging path, or tool-usage pattern emerged that a future session would benefit from. Capture it.
|
|
6838
|
-
• A skill that got loaded or consulted this session turned out to be wrong, missing a step, or outdated. Patch it NOW.
|
|
6832
|
+
A skill body contains reusable decisions: when to use it, what to do, and how to verify. Session-specific narratives, dated logs, one-off evidence, and version details that do not change the decision belong in references/. Support files: references/ for detail or knowledge banks; templates/ for starter files; scripts/ for re-runnable checks and generators. When you add a support file, add the SKILL.md line that points to it; a file no pointer reaches is invisible next session. A skill must use only tools, commands, and paths available in this session. If one is unavailable, replace it only with a verified local equivalent; otherwise leave it unchanged and report the limitation. Do not invent command names.
|
|
6839
6833
|
|
|
6840
|
-
|
|
6834
|
+
Signals include:
|
|
6835
|
+
- The user corrected style, tone, format, verbosity, workflow, or approach.
|
|
6836
|
+
- A reusable technique, durable interface or environment fact, repair procedure, or debugging path emerged that will recur.
|
|
6837
|
+
- A loaded skill proved wrong, incomplete, or outdated.
|
|
6841
6838
|
|
|
6842
|
-
|
|
6843
|
-
1. UPDATE A CURRENTLY-LOADED SKILL. Look back through the conversation for skills the user loaded or you read. If any of them covers the territory of the new learning, PATCH that one first. It is the skill that was in play, so it's the right one to extend.
|
|
6844
|
-
2. UPDATE AN EXISTING UMBRELLA. If no loaded skill fits but an existing class-level skill does, patch it. Add a subsection, a pitfall, or broaden a trigger.
|
|
6845
|
-
3. ADD A SUPPORT FILE under an existing umbrella. Skills can be packaged with three kinds of support files — use the right directory per kind:
|
|
6846
|
-
• references/<topic>.md — session-specific detail (error transcripts, reproduction recipes, provider quirks) AND condensed knowledge banks: quoted research, API docs, external authoritative excerpts, or domain notes you found while working on the problem. Write it concise and for the value of the task, not as a full mirror of upstream docs.
|
|
6847
|
-
• templates/<name>.<ext> — starter files meant to be copied and modified (boilerplate configs, scaffolding, a known-good example the agent can reproduce with modifications).
|
|
6848
|
-
• scripts/<name>.<ext> — statically re-runnable actions the skill can invoke directly (verification scripts, fixture generators, deterministic probes, anything the agent should run rather than hand-type each time).
|
|
6849
|
-
Add support files via skill_manage action=write_file with file_path starting 'references/', 'templates/', or 'scripts/'. The umbrella's SKILL.md should gain a one-line pointer to any new support file so future agents know it exists.
|
|
6850
|
-
4. RESTRUCTURE a loaded skill whose body grew log-like — rc/sha/date-dense sections, session-detail spirals, or a fat body with no support files. Use skill_manage action=restructure with restructure: [{"heading": "<the exact ## heading text>", "to_file": "references/<topic>.md"}] — the ENTIRE ## section (from that heading to the next heading) moves into the support file and its position becomes a pointer line. The skill's name and directory never change. Only propose headings that exist verbatim in the body; never invent one, and never restructure a healthy small skill.
|
|
6851
|
-
5. CREATE A NEW CLASS-LEVEL UMBRELLA SKILL only when no existing class-level skill covers the class and no existing umbrella can absorb the learning. The name MUST be at the class level. The name MUST NOT be a specific PR number, error string, feature codename, library-alone name, or 'fix-X / debug-Y / audit-Z-today' session artifact. If the proposed name only makes sense for today's task, it's wrong — fall back to (1), (2), or (3).
|
|
6839
|
+
Any one of these warrants a decision; it does not by itself require a write.
|
|
6852
6840
|
|
|
6853
|
-
|
|
6841
|
+
Read before writing. Update only skills whose body you have read in this review pass. A new skill has no body to read; before choosing, search the existing library with the available skill tools.
|
|
6854
6842
|
|
|
6855
|
-
|
|
6843
|
+
Update when an existing class-level owner shares the lesson's trigger and audience.
|
|
6856
6844
|
|
|
6857
|
-
|
|
6858
|
-
• PATTERN (reusable — symptom → mechanism → fix → verification, still valuable next session) belongs in the SKILL.md body.
|
|
6859
|
-
• LOG (one-off — commit SHAs, npm/profile states, what this release changed, this session's process narrative) belongs in a references/ file, never the body. Body density IS reuse rate. Keep new entries tight: a pattern fits in 2-8 physical lines; prefer changing the current-state pointer over appending history.
|
|
6845
|
+
Create a new class-level skill when the lesson has a distinct trigger or audience and would make that owner heterogeneous. A class-level skill can serve at least two different future events; if the lesson serves only this incident, fold it into an existing owner's body or support file.
|
|
6860
6846
|
|
|
6861
|
-
|
|
6862
|
-
• Bundled skills (shipped with the platform).
|
|
6863
|
-
• Hub-installed skills (installed from a hub).
|
|
6864
|
-
Pinned skills are read-only to THIS background review pass — the pinned write guard refuses background changes, so this pass may not update them. They also cannot be archived by any writer (the foreground included): remove the .pinned marker first. Foreground and delegated-subagent update/patch writes to pinned skills remain allowed.
|
|
6865
|
-
If the only skills that need updating are protected, say 'Nothing to save.' and stop.
|
|
6847
|
+
When only session-specific detail changes, add a support file under the owner.
|
|
6866
6848
|
|
|
6867
|
-
|
|
6868
|
-
• Environment-dependent failures: missing binaries, fresh-install errors, post-migration path mismatches, 'command not found', unconfigured credentials, uninstalled packages. The user can fix these — they are not durable rules.
|
|
6869
|
-
• Negative claims about tools or features ('browser tools do not work', 'X tool is broken', 'cannot use Y'). These harden into refusals the agent cites against itself for months after the actual problem was fixed.
|
|
6870
|
-
• Session-specific transient errors that resolved before the conversation ended. If retrying worked, the lesson is the retry pattern, not the original failure.
|
|
6871
|
-
• One-off task narratives. A user asking 'summarize today's market' or 'analyze this PR' is not a class of work that warrants a skill.
|
|
6849
|
+
Name a new skill for its class, not for a PR number, error string, feature codename, or session artifact.
|
|
6872
6850
|
|
|
6873
|
-
|
|
6851
|
+
A user correction about how a class of task should be done belongs in the skill that governs that task.
|
|
6874
6852
|
|
|
6875
|
-
|
|
6876
|
-
const COMBINED_REVIEW_PROMPT = `[Auto-review]
|
|
6877
|
-
Review the conversation above and update two things:
|
|
6853
|
+
Leave consolidation to the curator; focus this pass on the smallest edit that carries the session's lesson.
|
|
6878
6854
|
|
|
6879
|
-
|
|
6855
|
+
A one-off environment failure, transient error, or "tool X is broken" claim is not a lesson. Capture only a reproducible setup or repair procedure that will recur.
|
|
6880
6856
|
|
|
6881
|
-
|
|
6857
|
+
Write skills only through skill_manage. If its guard refuses a write, report the refusal and do not work around it. Respect protected skills (bundled, hub-installed, pinned) and their guards. If a lesson can only live in a protected skill, report it and leave that lesson unapplied; continue with any other lessons. Do not create a near-duplicate to hold it.`;
|
|
6858
|
+
const COMBINED_REVIEW_BODY = `[Auto-review]
|
|
6859
|
+
Apply both review passes below.
|
|
6882
6860
|
|
|
6883
|
-
|
|
6861
|
+
## Memory
|
|
6862
|
+
${MEMORY_REVIEW_BODY}
|
|
6863
|
+
After the memory pass, continue to the Skills pass. If nothing is worth saving, say "Nothing to save (memory)."
|
|
6884
6864
|
|
|
6885
|
-
|
|
6865
|
+
## Skills
|
|
6866
|
+
${SKILL_REVIEW_BODY}`;
|
|
6867
|
+
const INJECT_MEMORY_REVIEW_PROMPT = `[Auto-review — Memory]
|
|
6868
|
+
${MEMORY_REVIEW_BODY}
|
|
6886
6869
|
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
• A skill that was loaded or consulted turned out wrong, missing, or outdated — patch it now.
|
|
6870
|
+
If nothing is worth saving, say "Nothing to save." and stop.`;
|
|
6871
|
+
const INJECT_SKILL_REVIEW_PROMPT = `[Auto-review — Skills]
|
|
6872
|
+
${SKILL_REVIEW_BODY}
|
|
6891
6873
|
|
|
6892
|
-
|
|
6874
|
+
If nothing durable exists, say "Nothing to save." and stop.`;
|
|
6875
|
+
const INJECT_COMBINED_REVIEW_PROMPT = `${COMBINED_REVIEW_BODY}
|
|
6893
6876
|
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
3. ADD A SUPPORT FILE under an existing umbrella via skill_manage action=write_file. Three kinds: references/<topic>.md for session-specific detail OR condensed knowledge banks (quoted research, API docs excerpts, domain notes) written concise and task-focused; templates/<name>.<ext> for starter files meant to be copied and modified; scripts/<name>.<ext> for statically re-runnable actions (verification, fixture generators, probes). Add a one-line pointer in SKILL.md so future agents find them.
|
|
6898
|
-
4. RESTRUCTURE a loaded skill whose body grew log-like (rc/sha/date-dense sections, session-detail spirals, fat body with no support files) via skill_manage action=restructure with restructure: [{"heading": "<the exact ## heading text>", "to_file": "references/<topic>.md"}] — the ENTIRE ## section moves into the support file and its position becomes a pointer line; the skill's name and directory never change. Only propose headings that exist verbatim in the body.
|
|
6899
|
-
5. CREATE A NEW CLASS-LEVEL UMBRELLA only when no existing class-level skill covers the class and no existing umbrella can absorb the learning. Name at the class level — NOT a PR number, error string, codename, library-alone name, or 'fix-X / debug-Y' session artifact. If the name only fits today's task, fall back to (1), (2), or (3).
|
|
6877
|
+
If nothing durable exists in either pass, say "Nothing to save." and stop.`;
|
|
6878
|
+
const INJECT_COMPLETION_SKILL_REVIEW_PROMPT = `[Auto-review — Skills · task complete]
|
|
6879
|
+
${SKILL_REVIEW_BODY}
|
|
6900
6880
|
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
Protected skills (DO NOT edit these):
|
|
6908
|
-
• Bundled skills (shipped with the platform).
|
|
6909
|
-
• Hub-installed skills (installed from a hub).
|
|
6910
|
-
Pinned skills are read-only to THIS background review pass — the pinned write guard refuses background changes, so this pass may not update them. They also cannot be archived by any writer (the foreground included): remove the .pinned marker first. Foreground and delegated-subagent update/patch writes to pinned skills remain allowed.
|
|
6911
|
-
If the only skills that need updating are protected, say 'Nothing to save.' and stop.
|
|
6912
|
-
|
|
6913
|
-
Do NOT capture as skills (these become persistent self-imposed constraints that bite you later when the environment changes):
|
|
6914
|
-
• Environment-dependent failures: missing binaries, fresh-install errors, post-migration path mismatches, 'command not found', unconfigured credentials, uninstalled packages. The user can fix these — they are not durable rules.
|
|
6915
|
-
• Negative claims about tools or features ('browser tools do not work', 'X tool is broken', 'cannot use Y'). These harden into refusals the agent cites against itself for months after the actual problem was fixed.
|
|
6916
|
-
• Session-specific transient errors that resolved before the conversation ended. If retrying worked, the lesson is the retry pattern, not the original failure.
|
|
6917
|
-
• One-off task narratives. A user asking 'summarize today's market' or 'analyze this PR' is not a class of work that warrants a skill.
|
|
6918
|
-
|
|
6919
|
-
If a tool failed because of setup state, capture the FIX (install command, config step, env var to set) under an existing setup or troubleshooting skill — never 'this tool does not work' as a standalone constraint.
|
|
6920
|
-
|
|
6921
|
-
Act on whichever of the two dimensions has real signal. If genuinely nothing stands out on either, say 'Nothing to save.' and stop — but don't reach for that conclusion as a default.`;
|
|
6881
|
+
If nothing durable exists, say "Nothing to save." and stop.`;
|
|
6882
|
+
const MEMORY_REVIEW_PROMPT = INJECT_MEMORY_REVIEW_PROMPT;
|
|
6883
|
+
const SKILL_REVIEW_PROMPT = INJECT_SKILL_REVIEW_PROMPT;
|
|
6884
|
+
const COMBINED_REVIEW_PROMPT = INJECT_COMBINED_REVIEW_PROMPT;
|
|
6885
|
+
const COMPLETION_SKILL_REVIEW_PROMPT = INJECT_COMPLETION_SKILL_REVIEW_PROMPT;
|
|
6922
6886
|
const CURATOR_PROMPT = `You are the skill curator. Maintain a healthy, class-level skill library, not a flat pile of narrow one-session skills.
|
|
6923
6887
|
|
|
6924
6888
|
This is an UMBRELLA-BUILDING consolidation pass, not a passive audit and not a duplicate-finder.
|
|
@@ -6982,56 +6946,6 @@ This is a PREVIEW pass. Follow every instruction above EXCEPT:
|
|
|
6982
6946
|
Your output IS the deliverable: produce the exact same human-readable summary and YAML block you would on a live run, describing the actions you WOULD take. A reviewer will decide whether to approve a live run.
|
|
6983
6947
|
|
|
6984
6948
|
If you accidentally take a mutating action, say so explicitly in the summary.`;
|
|
6985
|
-
const COMPLETION_SKILL_REVIEW_PROMPT = `[Auto-review — Skills · task complete]
|
|
6986
|
-
Review the conversation above and update the skill library. Be ACTIVE — inspect the session and the existing library thoroughly, and prefer a small, precise update when the session teaches something durable. Activity is not a quota: a precise no-op after checking is better than a vague or forced entry.
|
|
6987
|
-
|
|
6988
|
-
Target shape of the library: CLASS-LEVEL skills, each with a rich SKILL.md and a \`references/\` directory for session-specific detail. Not a long flat list of narrow one-session-one-skill entries. This shapes HOW you update, not WHETHER you update.
|
|
6989
|
-
|
|
6990
|
-
A skill body is a reusable decision rule (when / do / check); dates, versions, incident narratives, and one-off evidence belong in references when they would otherwise dominate the body.
|
|
6991
|
-
|
|
6992
|
-
Signals to look for (any one of these warrants action):
|
|
6993
|
-
• User corrected your style, tone, format, legibility, or verbosity. Frustration signals like 'stop doing X', 'this is too verbose', 'don't format like this', 'why are you explaining', 'just give me the answer', 'you always do Y and I hate it', or an explicit 'remember this' are FIRST-CLASS skill signals, not just memory signals. Update the relevant skill(s) to embed the preference so the next session starts already knowing.
|
|
6994
|
-
• User corrected your workflow, approach, or sequence of steps. Encode the correction as a pitfall or explicit step in the skill that governs that class of task.
|
|
6995
|
-
• Non-trivial technique, fix, workaround, debugging path, or tool-usage pattern emerged that a future session would benefit from. Capture it.
|
|
6996
|
-
• A skill that got loaded or consulted this session turned out to be wrong, missing a step, or outdated. Patch it NOW.
|
|
6997
|
-
|
|
6998
|
-
Preference order — prefer the earliest action that fits, but do pick one when a signal above fired:
|
|
6999
|
-
1. UPDATE A CURRENTLY-LOADED SKILL. Look back through the conversation for skills the user loaded via /skill-name or you read via skill. If any of them covers the territory of the new learning, PATCH that one first. It is the skill that was in play, so it's the right one to extend.
|
|
7000
|
-
2. UPDATE AN EXISTING UMBRELLA (via the skill catalog + skill). If no loaded skill fits but an existing class-level skill does, patch it. Add a subsection, a pitfall, or broaden a trigger.
|
|
7001
|
-
3. ADD A SUPPORT FILE under an existing umbrella. Skills can be packaged with three kinds of support files — use the right directory per kind:
|
|
7002
|
-
• \`references/<topic>.md\` — session-specific detail (error transcripts, reproduction recipes, provider quirks) AND condensed knowledge banks: quoted research, API docs, external authoritative excerpts, or domain notes you found while working on the problem. Write it concise and for the value of the task, not as a full mirror of upstream docs.
|
|
7003
|
-
• \`templates/<name>.<ext>\` — starter files meant to be copied and modified (boilerplate configs, scaffolding, a known-good example the agent can \`reproduce with modifications\`).
|
|
7004
|
-
• \`scripts/<name>.<ext>\` — statically re-runnable actions the skill can invoke directly (verification scripts, fixture generators, deterministic probes, anything the agent should run rather than hand-type each time).
|
|
7005
|
-
Add support files via skill_manage action=write_file with file_path starting 'references/', 'templates/', or 'scripts/'. The umbrella's SKILL.md should gain a one-line pointer to any new support file so future agents know it exists.
|
|
7006
|
-
4. CREATE A NEW CLASS-LEVEL UMBRELLA SKILL only when no existing class-level skill covers the class and no existing umbrella can absorb the learning. The name MUST be at the class level. The name MUST NOT be a specific PR number, error string, feature codename, library-alone name, or 'fix-X / debug-Y / audit-Z-today' session artifact. If the proposed name only makes sense for today's task, it's wrong — fall back to (1), (2), or (3).
|
|
7007
|
-
|
|
7008
|
-
User-preference embedding (important): when the user expressed a style/format/workflow preference, the update belongs in the SKILL.md body, not just in memory. Memory captures 'who the user is and what the current situation and state of your operations are'; skills capture 'how to do this class of task for this user'. When they complain about how you handled a task, the skill that governs that task needs to carry the lesson.
|
|
7009
|
-
|
|
7010
|
-
If you notice two existing skills that overlap, note it in your reply — the background curator handles consolidation at scale.
|
|
7011
|
-
|
|
7012
|
-
Protected skills (DO NOT edit these):
|
|
7013
|
-
• Bundled skills (shipped with the platform).
|
|
7014
|
-
• Hub-installed skills (installed via the platform hub).
|
|
7015
|
-
Pinned skills (marked via skill_manage pin) are read-only to THIS background review pass — the pinned write guard refuses background changes, so this pass may not update them. They also cannot be archived by any writer (the foreground included): remove the .pinned marker first. Foreground and delegated-subagent update/patch writes to pinned skills remain allowed.
|
|
7016
|
-
If the only skills that need updating are protected, say
|
|
7017
|
-
'Nothing to save.' and stop.
|
|
7018
|
-
|
|
7019
|
-
Do NOT capture (these become persistent self-imposed constraints that bite you later when the environment changes):
|
|
7020
|
-
• Environment-dependent failures: missing binaries, fresh-install errors, post-migration path mismatches, 'command not found', unconfigured credentials, uninstalled packages. The user can fix these — they are not durable rules.
|
|
7021
|
-
• Negative claims about tools or features ('browser tools do not work', 'X tool is broken', 'cannot use Y from execute_code'). These harden into refusals the agent cites against itself for months after the actual problem was fixed.
|
|
7022
|
-
• Session-specific transient errors that resolved before the conversation ended. If retrying worked, the lesson is the retry pattern, not the original failure.
|
|
7023
|
-
• One-off task narratives. A user asking 'summarize today's market' or 'analyze this PR' is not a class of work that warrants a skill.
|
|
7024
|
-
|
|
7025
|
-
If a tool failed because of setup state, capture the FIX (install command, config step, env var to set) under an existing setup or troubleshooting skill — never 'this tool does not work' as a standalone constraint.
|
|
7026
|
-
|
|
7027
|
-
'Nothing to save.' is a real option but should NOT be the default. If the session ran smoothly with no corrections and produced no new technique, state what you checked and stop. Otherwise, act.`;
|
|
7028
|
-
/**
|
|
7029
|
-
* Maintenance-subagent persona (design 011 §6). Constants pin the persona
|
|
7030
|
-
* with `{signal:id}` placeholders; the renderer substitutes names from the
|
|
7031
|
-
* drift-signals module (single vocabulary). The model-facing contract is the
|
|
7032
|
-
* persona + the mechanical-facts block; the signature head lets the model
|
|
7033
|
-
* compare the two heads (011 mismatch protocol).
|
|
7034
|
-
*/
|
|
7035
6949
|
const MAINTAIN_PROMPT = `<<<MAINTAIN_PROMPT v={bundle_version} sig={joint_signature}>>>
|
|
7036
6950
|
|
|
7037
6951
|
## 角色
|
|
@@ -7125,20 +7039,13 @@ const MAINTAIN_OUTPUT_INSTRUCTION = "按模板契约输出 JSON 维护计划(v
|
|
|
7125
7039
|
* model to save/repair skills on its own initiative.
|
|
7126
7040
|
*/
|
|
7127
7041
|
const SKILLS_GUIDANCE = `Skills guidance:
|
|
7128
|
-
• After
|
|
7042
|
+
• After a complex task (5+ tool calls), a tricky fix, or a non-trivial workflow, decide whether an existing owner should be updated or a new class-level skill is needed; search the library before creating.
|
|
7129
7043
|
• 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.`;
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
/** Subagent-channel variant of the combined review (M-2). */
|
|
7136
|
-
const COMBINED_REVIEW_PLAN_PROMPT = `${COMBINED_REVIEW_PROMPT}${PLAN_CHANNEL_NOTE}`;
|
|
7137
|
-
function reviewPrompt(kind, channel = "agent") {
|
|
7138
|
-
if (channel === "plan") return kind === "skill" ? SKILL_REVIEW_PLAN_PROMPT : COMBINED_REVIEW_PLAN_PROMPT;
|
|
7139
|
-
if (kind === "memory") return MEMORY_REVIEW_PROMPT;
|
|
7140
|
-
if (kind === "skill") return SKILL_REVIEW_PROMPT;
|
|
7141
|
-
return COMBINED_REVIEW_PROMPT;
|
|
7044
|
+
function reviewPrompt(kind, surface = "inject") {
|
|
7045
|
+
if (surface === "aux") return kind === "memory" ? INJECT_MEMORY_REVIEW_PROMPT : INJECT_COMBINED_REVIEW_PROMPT;
|
|
7046
|
+
if (kind === "memory") return INJECT_MEMORY_REVIEW_PROMPT;
|
|
7047
|
+
if (kind === "skill") return INJECT_SKILL_REVIEW_PROMPT;
|
|
7048
|
+
return INJECT_COMBINED_REVIEW_PROMPT;
|
|
7142
7049
|
}
|
|
7143
7050
|
function sha256(text) {
|
|
7144
7051
|
return createHash("sha256").update(text).digest("hex");
|
|
@@ -7146,34 +7053,32 @@ function sha256(text) {
|
|
|
7146
7053
|
function createPromptBundle(prompts) {
|
|
7147
7054
|
const canonical = JSON.stringify({
|
|
7148
7055
|
id: PROMPT_BUNDLE_ID,
|
|
7149
|
-
version:
|
|
7056
|
+
version: 27,
|
|
7150
7057
|
prompts: Object.fromEntries(Object.entries(prompts).sort())
|
|
7151
7058
|
});
|
|
7152
7059
|
return Object.freeze({
|
|
7153
7060
|
id: PROMPT_BUNDLE_ID,
|
|
7154
|
-
version:
|
|
7061
|
+
version: 27,
|
|
7155
7062
|
prompts: Object.freeze({ ...prompts }),
|
|
7156
7063
|
sha256: sha256(canonical)
|
|
7157
7064
|
});
|
|
7158
7065
|
}
|
|
7159
7066
|
const PROMPT_BUNDLE = createPromptBundle({
|
|
7160
|
-
memory:
|
|
7161
|
-
skill:
|
|
7162
|
-
combined:
|
|
7163
|
-
skillPlan: SKILL_REVIEW_PLAN_PROMPT,
|
|
7164
|
-
combinedPlan: COMBINED_REVIEW_PLAN_PROMPT,
|
|
7067
|
+
memory: INJECT_MEMORY_REVIEW_PROMPT,
|
|
7068
|
+
skill: INJECT_SKILL_REVIEW_PROMPT,
|
|
7069
|
+
combined: INJECT_COMBINED_REVIEW_PROMPT,
|
|
7165
7070
|
curator: CURATOR_PROMPT,
|
|
7166
7071
|
curatorDryRun: CURATOR_DRY_RUN_BANNER,
|
|
7167
|
-
completion:
|
|
7072
|
+
completion: INJECT_COMPLETION_SKILL_REVIEW_PROMPT,
|
|
7168
7073
|
maintain: MAINTAIN_PROMPT,
|
|
7169
7074
|
maintainOutput: MAINTAIN_OUTPUT_INSTRUCTION,
|
|
7170
7075
|
skillsGuidance: SKILLS_GUIDANCE
|
|
7171
7076
|
});
|
|
7172
7077
|
function verifyPromptBundle(bundle = PROMPT_BUNDLE) {
|
|
7173
|
-
if (bundle.id !== PROMPT_BUNDLE_ID || bundle.version !==
|
|
7078
|
+
if (bundle.id !== PROMPT_BUNDLE_ID || bundle.version !== 27) return false;
|
|
7174
7079
|
const canonical = JSON.stringify({
|
|
7175
7080
|
id: PROMPT_BUNDLE_ID,
|
|
7176
|
-
version:
|
|
7081
|
+
version: 27,
|
|
7177
7082
|
prompts: Object.fromEntries(Object.entries(bundle.prompts).sort())
|
|
7178
7083
|
});
|
|
7179
7084
|
return bundle.sha256 === sha256(canonical);
|
|
@@ -17406,4 +17311,4 @@ function isIgnorableEvent(event) {
|
|
|
17406
17311
|
return classifySessionEvent(event) !== "model";
|
|
17407
17312
|
}
|
|
17408
17313
|
//#endregion
|
|
17409
|
-
export { AUTHORING_DESCRIPTION_BAR, AUTHORING_SPLIT_LINE_CHARS, BASELINE_ACTION, CITATION_SUPPORT_DIRS,
|
|
17314
|
+
export { AUTHORING_DESCRIPTION_BAR, AUTHORING_SPLIT_LINE_CHARS, BASELINE_ACTION, CITATION_SUPPORT_DIRS, COMBINED_REVIEW_PROMPT, COMPLETION_SKILL_REVIEW_PROMPT, CONTENT_SPLIT_HINT, COST_ASCII_TOKEN_HIGH, COST_ASCII_TOKEN_LOW, COST_CJK_TOKEN_HIGH, COST_CJK_TOKEN_LOW, CURATOR_DRY_RUN_BANNER, CURATOR_PROMPT, DEDUP_MAX_PAIR_COMPARISONS, DEDUP_SIMILARITY_THRESHOLD, DEFAULT_ADMISSION, DEFAULT_ARCHIVE_AFTER_DAYS, DEFAULT_ARCHIVE_RETENTION_POLICY, DEFAULT_CITATION_POLICY, DEFAULT_CITATION_REF_BUDGET, DEFAULT_CONSOLIDATION_FAILURES, DEFAULT_CURATOR_BOOT_GRACE_SECONDS, DEFAULT_CURATOR_INTERVAL_HOURS, DEFAULT_CURATOR_MODEL, DEFAULT_CURATOR_REVIEW_MAX_TOKENS, DEFAULT_HEALTH_THRESHOLDS, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_MIN_IDLE_HOURS, DEFAULT_MUTATION_CAP, DEFAULT_PROBE_TIMEOUT_MS, DEFAULT_REFERENCE_REWRITE_POLICY, DEFAULT_REVIEW_CONTEXT_MESSAGES, DEFAULT_REVIEW_MEMORY_INTERVAL, DEFAULT_REVIEW_MESSAGE_CHARS, DEFAULT_REVIEW_SKILL_INTERVAL, DEFAULT_REVIEW_TIMEOUT_MS, DEFAULT_RUN_RECORDS, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_SKILL_LIMITS, DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS, DEFAULT_SKILL_REVIEW_TRIGGER, DEFAULT_SKILL_VERSION_KEEP, DEFAULT_STALE_AFTER_DAYS, DEFAULT_SUBSTANTIVE_MIN_AGENT_CHARS, DEFAULT_SUBSTANTIVE_MIN_TOOL_CALLS, DEFAULT_SUBSTANTIVE_MIN_USER_CHARS, DEFAULT_SUPPORT_FILE_CHAR_POLICY, DEFAULT_SUPPORT_READ_TOOL_NAMES, DEFAULT_THREAT_MAX_SCAN_CHARS, DEFAULT_USER_CHAR_LIMIT, DEFAULT_WRITE_CONFIRM_MODE, DEFAULT_WRITE_CONFIRM_TIMEOUT_SECONDS, DIAGNOSTICS_FACT_KEYS, DIAGNOSTICS_RUNTIME_KEYS, DIAGNOSTICS_VIEW_SCHEMA_VERSION, DISPATCH_EVENT_TYPES, DRIFT_MAX_LINE_CHARS, DRIFT_SIGNALS_VERSION, DRIFT_SIGNAL_NOUNS, DSH_AUTHORING_STANDARDS, ENTRY_DELIMITER, EVENT_ARCHIVE_PREFIX, EVENT_LOG_RETAIN_ARCHIVES, EVENT_LOG_ROTATE_AT, EVENT_LOG_VERSION, EVOLUTION_ERRORS, EVOLUTION_PRESET_IDS, EVOLUTION_WRITE_TOOLS, EXTRACT_PROMPT_HASH, EXTRACT_PROMPT_V1, EXTRACT_PROMPT_VERSION, EvolutionGateSet, FAMILY_SESSION_TOOL_NAMES, FORBIDDEN_CONTROL_KEYS, FUZZY_MAX_PATTERN_CHARS, FUZZY_MAX_WORK, HEALTH_STAMP_RE, HISTORY_DIR, HISTORY_INDEX_VERSION, HOOK_LINE_RE, HOST_ROUTES, INJECT_COMBINED_REVIEW_PROMPT, INJECT_COMPLETION_SKILL_REVIEW_PROMPT, INJECT_MEMORY_REVIEW_PROMPT, INJECT_SKILL_REVIEW_PROMPT, INSTANCE_KEYS, KEEP_LINE_RE, LONG_RUNS, LOW_QUALITY_THRESHOLD, MAINTAINER_PRESET_ID, MAINTAIN_OUTPUT_INSTRUCTION, MAINTAIN_PROMPT, MAX_DESCRIPTION_LENGTH, MAX_REQUEST_BODY_BYTES, MAX_RESTRUCTURE_MOVES, MAX_SKILL_CONTENT_CHARS, MAX_SKILL_FILE_BYTES, MAX_SKILL_NAME_LENGTH, MAX_SUPPORT_READ_PATHS, MAX_TIMER_DELAY_MS, MEMORY_GUIDANCE_SECTION_ORDER, MEMORY_REVIEW_PROMPT, MIN_STAMP_BODY_CHARS, MODEL_SESSION_EVENT_TYPES as MODEL_SESSION_EVENTS, MODEL_SESSION_EVENT_TYPES, MUTATIONS_FILE_VERSION, MemoryStore, MutationUnit, NAMESPACE_MIGRATIONS, NATIVE_CALL_EVENT, NATIVE_RESULT_EVENT, PARAM_ALIASES, PARAM_EXPOSURE, PARAM_GROUP_LABELS, PARAM_NAMESPACES, PATTERN_OVERLAP, PLATFORM_CATALOG_DESCRIPTION_DEFAULT, PLATFORM_ESTIMATE_CHARS_PER_TOKEN, PLATFORM_LINE, PLATFORM_SERVICE_PROBES, POLICY_STAGE_DEFAULTS, PROMPT_BUNDLE, PROMPT_BUNDLE_ID, PROMPT_BUNDLE_VERSION, PROTECTED_BUILTIN_SKILLS, PTC_DISPATCH_EVENT, PTC_DISPATCH_START_EVENT, QUALITY_WEIGHTS, READ_REQUIRED_ACTIONS, RESTRICTED_PRESET_DISPLAY, RESTRICTED_TOOLS_ROW_ID, RESTRICTOR_MODULE, RESTRUCTURE_TARGET_RE, RETENTION_FEEDBACK_KEEP_RATIO, RETENTION_FEEDBACK_MIN_CHARS, REVIEWER_PRESET_ID, RULES, RUNS_SCHEMA_VERSION, SKILLS_GUIDANCE, SKILLS_GUIDANCE_SECTION_ORDER, SKILL_ACTION_REQUIRED_FIELDS, SKILL_NAME_RE, SKILL_REVIEW_PROMPT, SNAPSHOT_EXTRA_NAME_RE, STORE_LEDGER, SUMMARY_DUPLICATE_HINT_THRESHOLD, SUPPORT_DIRS, SUPPORT_SPRAWL_FILES, SUPPRESSED_FILE_VERSION, SkillLibrary, SkillModel, TEXT_DIFF_MAX_CHARS, TEXT_DIFF_MAX_LINES, THREAT_EXEMPTION_HINT, TOKEN_ASCII_WEIGHT, TOKEN_CJK_WEIGHT, ToolDispatchNormalizer, ToolDispatchPayloadError, UNIT_JOURNAL_PHASES, UNIT_JOURNAL_SCHEMA_VERSION, UNIT_STORAGE_SCHEMA_VERSION, UNTRUSTED_LINE_BREAK, UNTRUSTED_LINE_MARK, UPSTREAM_LIMIT_CHARS_PER_TOKEN, UnitTransactions, VERSION_SUMMARY_MAX_CHARS, WriteKernel, absentHostServices, acquireTreeWriteLock, admissionVerdict, advanceReview, affinity, ageCopyKey, allowRowCollisions, anchorVerdict, appendEvolutionEvent, applyCuratorLifecycleFields, applyCuratorMetaFields, applyNamespaceMigration, applyReferenceRewrite, asRecord, assertDispatchPayload, assertSkillsRootAliasRetired, assertUnitJournalTransition, assessStructureHealth, atomicWriteFiles, authoringFeedback, authorityFrom, backupsReachability, blobPath, bodyCost, buildCuratorRunReport, buildExtractPlanFromLibrary, buildHealthBaseline, buildLearnPrompt, bumpPatch, bumpSupportRead, bumpUse, bumpView, callingScope, candidateSkills, canonicalWriteId, claimInstance, clampOnce, clampedNumber, classifyNamespaceMigration, classifySessionEvent, clearReviewChannel, collectReadSkillNames, collectReadSupportFiles, computeDedupGroups, computeDriftSignals, computeLifecycleTransitions, computePrefixClusters, computeQualityScores, computeScopeView, contentHash, contentRetentionFeedback, countDispatches, countReferenceFiles, createGateSet, createSubagentChannel, currentReviewContext, daysSinceIso, declaredReportStamp, describeReferenceRewrite, diffFindings, dispatchKeyOf, dispatchPathOf, dispatchStepOf, displayBodyOf, duplicateHeadings, elapsedSince, emptyRecord, ensureSkillFrontmatter, entryTarget, errorText, evaluateThreat, eventsFile, evidenceKindIndex, evolutionActivityProjection, evolutionEventPayloadIssue, evolutionEvidenceProjection, evolutionHome, evolutionIoAdapter, evolutionProjectionHistoryProjection, evolutionReadsProjection, evolutionRoot, evolutionSignalsProjection, executeUnitUndo, externalRefs, fileMutationLock, filterUnreadSkillOps, findDriftSignal, findOwnerCandidate, foldCuratorFields, foldToolDispatches, foldTurnEvent, foldTurnEvents, foldUntrustedLines, frontmatterBlock, frontmatterCatalogInvalid, fuzzyPatch, getRecord, h2Sections, historyIndexFile, historyReachability, historyRoot, hostSurface, identity, idleDays, initialTurnFold, instanceClaimKey, instanceClaimedWriteSites, instanceHolder, isAbsent, isBookkeepingFrame, isCommittedWarning, isDeprecatedParamId, isFileShapedPath, isIgnorableEvent, isLandmark, isMissingPath, isPresent, isProcessAlive, isProgramToolName, isProjectableSession, isRecord, isReviewChannelSession, isSkillReadToolName, isSkillToolName, isUnknown, isUnreadWrite, json, landmarkVerdict, latestActivityAt, latestVersionAt, lifecycleCandidate, lintBody, lintSkill, listEventArchives, liveBool, liveEnum, liveNumber, liveString, loadMutations, loadSuppressedNames, loadUsage, loadVersionContent, loadVersions, makeSerialQueue, mapProbe, markAgentCreated, markReviewChannel, markerEntryName, memoryRoot, methodNotAllowed, missingSupportPointers, mutateUsage, mutationsFile, narrowNameMatches, nearDuplicateSummaries, newRunRegistry, newSkillLibrary, nextHistoryIndex, nodeEvolutionIo, normalizeFrontmatter, normalizeUsageRecord, normalizeVersionSummary, observeEvent, orderVersions, overlongLines, ownerCandidatesFromSummaries, ownerDecisionText, paramNamespace, paramRowId, paramSettingsId, parseCuratorNominations, parseEvolutionEvents, parseFrontmatter, parseHistoryIndex, partitionVersions, payloadText, persistedWriteSite, persistedWriteSites, pickWithPolicy, planExtract, planNamespaceMigration, planReferenceRewrite, planRehoming, planUnitUndoAcross, policyStageLimits, probeAbsent, probeChannelState, probeList, probeMtime, probePresent, probeReason, probeText, probeUnknown, projectExtractBodies, projectionText, proposalFromPlan, proposalReportDir, proposalReportName, protectedSkillNamesOf, pruneTreeChangeUnits, readDispatchSignal, readEvolutionEvents, readEvolutionTimeline, readExternalSupport, readHistoryIndex, readJsonObject, readNumberParam, readParam, readProposalReports, readTreeLock, readUnitEvidence, readUnitIndex, readUnitJournal, readUnitReceipt, readUnitSnapshot, readingStats, recordMutation, recordVersions, redactSecrets, referencedBlobs, registerHostRoutes, registerOwnerSettings, relatedSkillNames, releaseInstance, renameWithRetry, renderCuratorReportMarkdown, renderLongRunTable, reportTime, reportsReachability, reportsSweepLockTarget, resolveCitations, resolveExecOrigins, resolveOrigins, resolveParamId, resolveRootConfig, resolveSkillsRoot, resolveUnitMembers, resolveUnitMembersFromIndexes, restructureCandidates, retainEventArchives, retirementReport, reviewPrompt, revisionAnchor, revisionAnchorOf, revisionFingerprint, revisionSupportDigest, runWriteGates, runsFile, saveSuppressedNames, saveUsage, scanBodyHooks, scanContentThreats, scanMemoryThreats, scanThreats, scopeOfNearestManifest, scopedPackageName, scopedProbeReport, selectSections, sessionAudited, sessionEvidenceIndex, sessionLastEventTime, sessionReadNames, sessionReadSkillNames, sessionReadSupportFiles, sessionSeesFamilyTools, sessionTurnSignals, skillLibraryUnitBackend, skillReadNameOf, skillRowCells, skillStateKey, skillWriteGateContext, skillsRoot, staleRouteStubs, subagentChannelState, supportFileReadFromPath, supportFileReadOf, supportRefs, suppressedFile, sweepReports, sweepReviewChannelSessions, textDiffFacts, tokenLineFor, transactIo, transactTaskGuard, treeLockFile, trimPatternBoundaries, unhookedSupportPointers, unitEvidenceDigest, unitEvidencePath, unitIndexPath, unitJournalPath, unitJournalPhaseRank, unitJournalPort, unitMembersAreComplete, unitReceiptPath, unitSnapshotPath, unitSnapshotPort, unitSnapshotsDir, unitStorageKey, unwrapLive, updateSuppressedNames, upsertUnitIndex, usageFile, usageObserved, userSetKeys, validateFrontmatter, validateMutationRequest, validateRestructureTarget, validateSupportPath, valueOr, verifyPromptBundle, versionActionKind, versionRowCells, versionSummaryPrompt, versionTarget, vocabulary, withReviewContext, withTreeWrite, withTreeWriteLock, writeDurableTmp, writePathSymbols, writeProposalReport, writeUnitEvidence, writeUnitJournal, writeUnitReceipt, writeUnitSnapshot, yamlPlainScalarNeedsQuotes };
|
package/lib/types/prompts.d.ts
CHANGED
|
@@ -3,21 +3,18 @@
|
|
|
3
3
|
* changes semantically: the bundle digest is the fail-closed signal for
|
|
4
4
|
* review workers, so a stale id across deployments must be distinguishable.
|
|
5
5
|
*/
|
|
6
|
-
export declare const PROMPT_BUNDLE_VERSION =
|
|
7
|
-
export declare const PROMPT_BUNDLE_ID = "dsh-evolution@
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
6
|
+
export declare const PROMPT_BUNDLE_VERSION = 27;
|
|
7
|
+
export declare const PROMPT_BUNDLE_ID = "dsh-evolution@27";
|
|
8
|
+
export declare const INJECT_MEMORY_REVIEW_PROMPT = "[Auto-review \u2014 Memory]\nFocus on durable facts that change future collaboration:\n\n1. The user: role, context, stable preferences, constraints, and facts they would want remembered.\n2. The work: how deliverables should be judged across future tasks \u2014 quality bar, format, sources/tools, and collaboration conventions.\n\nDo not store task progress or reusable procedures; procedures belong in skills.\nPrefer merging or replacing an existing entry over adding a near-duplicate.\nKeep the entry compact.\n\nIf nothing is worth saving, say \"Nothing to save.\" and stop.";
|
|
9
|
+
export declare const INJECT_SKILL_REVIEW_PROMPT = "[Auto-review \u2014 Skills]\nReview the conversation above and update the skill library.\n\nUpdate only when the session contains a durable lesson that changes how this class of task should be done. A precise no-op is a valid outcome.\n\nTarget: a class-level skill with a compact SKILL.md and a references/ directory for session-specific detail.\n\nA skill body contains reusable decisions: when to use it, what to do, and how to verify. Session-specific narratives, dated logs, one-off evidence, and version details that do not change the decision belong in references/. Support files: references/ for detail or knowledge banks; templates/ for starter files; scripts/ for re-runnable checks and generators. When you add a support file, add the SKILL.md line that points to it; a file no pointer reaches is invisible next session. A skill must use only tools, commands, and paths available in this session. If one is unavailable, replace it only with a verified local equivalent; otherwise leave it unchanged and report the limitation. Do not invent command names.\n\nSignals include:\n- The user corrected style, tone, format, verbosity, workflow, or approach.\n- A reusable technique, durable interface or environment fact, repair procedure, or debugging path emerged that will recur.\n- A loaded skill proved wrong, incomplete, or outdated.\n\nAny one of these warrants a decision; it does not by itself require a write.\n\nRead before writing. Update only skills whose body you have read in this review pass. A new skill has no body to read; before choosing, search the existing library with the available skill tools.\n\nUpdate when an existing class-level owner shares the lesson's trigger and audience.\n\nCreate a new class-level skill when the lesson has a distinct trigger or audience and would make that owner heterogeneous. A class-level skill can serve at least two different future events; if the lesson serves only this incident, fold it into an existing owner's body or support file.\n\nWhen only session-specific detail changes, add a support file under the owner.\n\nName a new skill for its class, not for a PR number, error string, feature codename, or session artifact.\n\nA user correction about how a class of task should be done belongs in the skill that governs that task.\n\nLeave consolidation to the curator; focus this pass on the smallest edit that carries the session's lesson.\n\nA one-off environment failure, transient error, or \"tool X is broken\" claim is not a lesson. Capture only a reproducible setup or repair procedure that will recur.\n\nWrite skills only through skill_manage. If its guard refuses a write, report the refusal and do not work around it. Respect protected skills (bundled, hub-installed, pinned) and their guards. If a lesson can only live in a protected skill, report it and leave that lesson unapplied; continue with any other lessons. Do not create a near-duplicate to hold it.\n\nIf nothing durable exists, say \"Nothing to save.\" and stop.";
|
|
10
|
+
export declare const INJECT_COMBINED_REVIEW_PROMPT = "[Auto-review]\nApply both review passes below.\n\n## Memory\nFocus on durable facts that change future collaboration:\n\n1. The user: role, context, stable preferences, constraints, and facts they would want remembered.\n2. The work: how deliverables should be judged across future tasks \u2014 quality bar, format, sources/tools, and collaboration conventions.\n\nDo not store task progress or reusable procedures; procedures belong in skills.\nPrefer merging or replacing an existing entry over adding a near-duplicate.\nKeep the entry compact.\nAfter the memory pass, continue to the Skills pass. If nothing is worth saving, say \"Nothing to save (memory).\"\n\n## Skills\nReview the conversation above and update the skill library.\n\nUpdate only when the session contains a durable lesson that changes how this class of task should be done. A precise no-op is a valid outcome.\n\nTarget: a class-level skill with a compact SKILL.md and a references/ directory for session-specific detail.\n\nA skill body contains reusable decisions: when to use it, what to do, and how to verify. Session-specific narratives, dated logs, one-off evidence, and version details that do not change the decision belong in references/. Support files: references/ for detail or knowledge banks; templates/ for starter files; scripts/ for re-runnable checks and generators. When you add a support file, add the SKILL.md line that points to it; a file no pointer reaches is invisible next session. A skill must use only tools, commands, and paths available in this session. If one is unavailable, replace it only with a verified local equivalent; otherwise leave it unchanged and report the limitation. Do not invent command names.\n\nSignals include:\n- The user corrected style, tone, format, verbosity, workflow, or approach.\n- A reusable technique, durable interface or environment fact, repair procedure, or debugging path emerged that will recur.\n- A loaded skill proved wrong, incomplete, or outdated.\n\nAny one of these warrants a decision; it does not by itself require a write.\n\nRead before writing. Update only skills whose body you have read in this review pass. A new skill has no body to read; before choosing, search the existing library with the available skill tools.\n\nUpdate when an existing class-level owner shares the lesson's trigger and audience.\n\nCreate a new class-level skill when the lesson has a distinct trigger or audience and would make that owner heterogeneous. A class-level skill can serve at least two different future events; if the lesson serves only this incident, fold it into an existing owner's body or support file.\n\nWhen only session-specific detail changes, add a support file under the owner.\n\nName a new skill for its class, not for a PR number, error string, feature codename, or session artifact.\n\nA user correction about how a class of task should be done belongs in the skill that governs that task.\n\nLeave consolidation to the curator; focus this pass on the smallest edit that carries the session's lesson.\n\nA one-off environment failure, transient error, or \"tool X is broken\" claim is not a lesson. Capture only a reproducible setup or repair procedure that will recur.\n\nWrite skills only through skill_manage. If its guard refuses a write, report the refusal and do not work around it. Respect protected skills (bundled, hub-installed, pinned) and their guards. If a lesson can only live in a protected skill, report it and leave that lesson unapplied; continue with any other lessons. Do not create a near-duplicate to hold it.\n\nIf nothing durable exists in either pass, say \"Nothing to save.\" and stop.";
|
|
11
|
+
export declare const INJECT_COMPLETION_SKILL_REVIEW_PROMPT = "[Auto-review \u2014 Skills \u00B7 task complete]\nReview the conversation above and update the skill library.\n\nUpdate only when the session contains a durable lesson that changes how this class of task should be done. A precise no-op is a valid outcome.\n\nTarget: a class-level skill with a compact SKILL.md and a references/ directory for session-specific detail.\n\nA skill body contains reusable decisions: when to use it, what to do, and how to verify. Session-specific narratives, dated logs, one-off evidence, and version details that do not change the decision belong in references/. Support files: references/ for detail or knowledge banks; templates/ for starter files; scripts/ for re-runnable checks and generators. When you add a support file, add the SKILL.md line that points to it; a file no pointer reaches is invisible next session. A skill must use only tools, commands, and paths available in this session. If one is unavailable, replace it only with a verified local equivalent; otherwise leave it unchanged and report the limitation. Do not invent command names.\n\nSignals include:\n- The user corrected style, tone, format, verbosity, workflow, or approach.\n- A reusable technique, durable interface or environment fact, repair procedure, or debugging path emerged that will recur.\n- A loaded skill proved wrong, incomplete, or outdated.\n\nAny one of these warrants a decision; it does not by itself require a write.\n\nRead before writing. Update only skills whose body you have read in this review pass. A new skill has no body to read; before choosing, search the existing library with the available skill tools.\n\nUpdate when an existing class-level owner shares the lesson's trigger and audience.\n\nCreate a new class-level skill when the lesson has a distinct trigger or audience and would make that owner heterogeneous. A class-level skill can serve at least two different future events; if the lesson serves only this incident, fold it into an existing owner's body or support file.\n\nWhen only session-specific detail changes, add a support file under the owner.\n\nName a new skill for its class, not for a PR number, error string, feature codename, or session artifact.\n\nA user correction about how a class of task should be done belongs in the skill that governs that task.\n\nLeave consolidation to the curator; focus this pass on the smallest edit that carries the session's lesson.\n\nA one-off environment failure, transient error, or \"tool X is broken\" claim is not a lesson. Capture only a reproducible setup or repair procedure that will recur.\n\nWrite skills only through skill_manage. If its guard refuses a write, report the refusal and do not work around it. Respect protected skills (bundled, hub-installed, pinned) and their guards. If a lesson can only live in a protected skill, report it and leave that lesson unapplied; continue with any other lessons. Do not create a near-duplicate to hold it.\n\nIf nothing durable exists, say \"Nothing to save.\" and stop.";
|
|
12
|
+
export declare const MEMORY_REVIEW_PROMPT = "[Auto-review \u2014 Memory]\nFocus on durable facts that change future collaboration:\n\n1. The user: role, context, stable preferences, constraints, and facts they would want remembered.\n2. The work: how deliverables should be judged across future tasks \u2014 quality bar, format, sources/tools, and collaboration conventions.\n\nDo not store task progress or reusable procedures; procedures belong in skills.\nPrefer merging or replacing an existing entry over adding a near-duplicate.\nKeep the entry compact.\n\nIf nothing is worth saving, say \"Nothing to save.\" and stop.";
|
|
13
|
+
export declare const SKILL_REVIEW_PROMPT = "[Auto-review \u2014 Skills]\nReview the conversation above and update the skill library.\n\nUpdate only when the session contains a durable lesson that changes how this class of task should be done. A precise no-op is a valid outcome.\n\nTarget: a class-level skill with a compact SKILL.md and a references/ directory for session-specific detail.\n\nA skill body contains reusable decisions: when to use it, what to do, and how to verify. Session-specific narratives, dated logs, one-off evidence, and version details that do not change the decision belong in references/. Support files: references/ for detail or knowledge banks; templates/ for starter files; scripts/ for re-runnable checks and generators. When you add a support file, add the SKILL.md line that points to it; a file no pointer reaches is invisible next session. A skill must use only tools, commands, and paths available in this session. If one is unavailable, replace it only with a verified local equivalent; otherwise leave it unchanged and report the limitation. Do not invent command names.\n\nSignals include:\n- The user corrected style, tone, format, verbosity, workflow, or approach.\n- A reusable technique, durable interface or environment fact, repair procedure, or debugging path emerged that will recur.\n- A loaded skill proved wrong, incomplete, or outdated.\n\nAny one of these warrants a decision; it does not by itself require a write.\n\nRead before writing. Update only skills whose body you have read in this review pass. A new skill has no body to read; before choosing, search the existing library with the available skill tools.\n\nUpdate when an existing class-level owner shares the lesson's trigger and audience.\n\nCreate a new class-level skill when the lesson has a distinct trigger or audience and would make that owner heterogeneous. A class-level skill can serve at least two different future events; if the lesson serves only this incident, fold it into an existing owner's body or support file.\n\nWhen only session-specific detail changes, add a support file under the owner.\n\nName a new skill for its class, not for a PR number, error string, feature codename, or session artifact.\n\nA user correction about how a class of task should be done belongs in the skill that governs that task.\n\nLeave consolidation to the curator; focus this pass on the smallest edit that carries the session's lesson.\n\nA one-off environment failure, transient error, or \"tool X is broken\" claim is not a lesson. Capture only a reproducible setup or repair procedure that will recur.\n\nWrite skills only through skill_manage. If its guard refuses a write, report the refusal and do not work around it. Respect protected skills (bundled, hub-installed, pinned) and their guards. If a lesson can only live in a protected skill, report it and leave that lesson unapplied; continue with any other lessons. Do not create a near-duplicate to hold it.\n\nIf nothing durable exists, say \"Nothing to save.\" and stop.";
|
|
14
|
+
export declare const COMBINED_REVIEW_PROMPT = "[Auto-review]\nApply both review passes below.\n\n## Memory\nFocus on durable facts that change future collaboration:\n\n1. The user: role, context, stable preferences, constraints, and facts they would want remembered.\n2. The work: how deliverables should be judged across future tasks \u2014 quality bar, format, sources/tools, and collaboration conventions.\n\nDo not store task progress or reusable procedures; procedures belong in skills.\nPrefer merging or replacing an existing entry over adding a near-duplicate.\nKeep the entry compact.\nAfter the memory pass, continue to the Skills pass. If nothing is worth saving, say \"Nothing to save (memory).\"\n\n## Skills\nReview the conversation above and update the skill library.\n\nUpdate only when the session contains a durable lesson that changes how this class of task should be done. A precise no-op is a valid outcome.\n\nTarget: a class-level skill with a compact SKILL.md and a references/ directory for session-specific detail.\n\nA skill body contains reusable decisions: when to use it, what to do, and how to verify. Session-specific narratives, dated logs, one-off evidence, and version details that do not change the decision belong in references/. Support files: references/ for detail or knowledge banks; templates/ for starter files; scripts/ for re-runnable checks and generators. When you add a support file, add the SKILL.md line that points to it; a file no pointer reaches is invisible next session. A skill must use only tools, commands, and paths available in this session. If one is unavailable, replace it only with a verified local equivalent; otherwise leave it unchanged and report the limitation. Do not invent command names.\n\nSignals include:\n- The user corrected style, tone, format, verbosity, workflow, or approach.\n- A reusable technique, durable interface or environment fact, repair procedure, or debugging path emerged that will recur.\n- A loaded skill proved wrong, incomplete, or outdated.\n\nAny one of these warrants a decision; it does not by itself require a write.\n\nRead before writing. Update only skills whose body you have read in this review pass. A new skill has no body to read; before choosing, search the existing library with the available skill tools.\n\nUpdate when an existing class-level owner shares the lesson's trigger and audience.\n\nCreate a new class-level skill when the lesson has a distinct trigger or audience and would make that owner heterogeneous. A class-level skill can serve at least two different future events; if the lesson serves only this incident, fold it into an existing owner's body or support file.\n\nWhen only session-specific detail changes, add a support file under the owner.\n\nName a new skill for its class, not for a PR number, error string, feature codename, or session artifact.\n\nA user correction about how a class of task should be done belongs in the skill that governs that task.\n\nLeave consolidation to the curator; focus this pass on the smallest edit that carries the session's lesson.\n\nA one-off environment failure, transient error, or \"tool X is broken\" claim is not a lesson. Capture only a reproducible setup or repair procedure that will recur.\n\nWrite skills only through skill_manage. If its guard refuses a write, report the refusal and do not work around it. Respect protected skills (bundled, hub-installed, pinned) and their guards. If a lesson can only live in a protected skill, report it and leave that lesson unapplied; continue with any other lessons. Do not create a near-duplicate to hold it.\n\nIf nothing durable exists in either pass, say \"Nothing to save.\" and stop.";
|
|
15
|
+
export declare const COMPLETION_SKILL_REVIEW_PROMPT = "[Auto-review \u2014 Skills \u00B7 task complete]\nReview the conversation above and update the skill library.\n\nUpdate only when the session contains a durable lesson that changes how this class of task should be done. A precise no-op is a valid outcome.\n\nTarget: a class-level skill with a compact SKILL.md and a references/ directory for session-specific detail.\n\nA skill body contains reusable decisions: when to use it, what to do, and how to verify. Session-specific narratives, dated logs, one-off evidence, and version details that do not change the decision belong in references/. Support files: references/ for detail or knowledge banks; templates/ for starter files; scripts/ for re-runnable checks and generators. When you add a support file, add the SKILL.md line that points to it; a file no pointer reaches is invisible next session. A skill must use only tools, commands, and paths available in this session. If one is unavailable, replace it only with a verified local equivalent; otherwise leave it unchanged and report the limitation. Do not invent command names.\n\nSignals include:\n- The user corrected style, tone, format, verbosity, workflow, or approach.\n- A reusable technique, durable interface or environment fact, repair procedure, or debugging path emerged that will recur.\n- A loaded skill proved wrong, incomplete, or outdated.\n\nAny one of these warrants a decision; it does not by itself require a write.\n\nRead before writing. Update only skills whose body you have read in this review pass. A new skill has no body to read; before choosing, search the existing library with the available skill tools.\n\nUpdate when an existing class-level owner shares the lesson's trigger and audience.\n\nCreate a new class-level skill when the lesson has a distinct trigger or audience and would make that owner heterogeneous. A class-level skill can serve at least two different future events; if the lesson serves only this incident, fold it into an existing owner's body or support file.\n\nWhen only session-specific detail changes, add a support file under the owner.\n\nName a new skill for its class, not for a PR number, error string, feature codename, or session artifact.\n\nA user correction about how a class of task should be done belongs in the skill that governs that task.\n\nLeave consolidation to the curator; focus this pass on the smallest edit that carries the session's lesson.\n\nA one-off environment failure, transient error, or \"tool X is broken\" claim is not a lesson. Capture only a reproducible setup or repair procedure that will recur.\n\nWrite skills only through skill_manage. If its guard refuses a write, report the refusal and do not work around it. Respect protected skills (bundled, hub-installed, pinned) and their guards. If a lesson can only live in a protected skill, report it and leave that lesson unapplied; continue with any other lessons. Do not create a near-duplicate to hold it.\n\nIf nothing durable exists, say \"Nothing to save.\" and stop.";
|
|
11
16
|
export declare const CURATOR_PROMPT = "You are the skill curator. Maintain a healthy, class-level skill library, not a flat pile of narrow one-session skills.\n\nThis is an UMBRELLA-BUILDING consolidation pass, not a passive audit and not a duplicate-finder.\n\nThe goal is a LIBRARY OF CLASS-LEVEL INSTRUCTIONS. A skill collection of many narrow skills where each captures one session's specific bug is a FAILURE of the library. An agent searching skills matches on descriptions, not exact names; one broad umbrella with labeled subsections beats five narrow siblings for discoverability.\n\nRight target shape: class-level skills with rich SKILL.md + references/, templates/, scripts/ support files for session-specific detail.\n\nHard rules:\n1. NEVER hard-delete a skill. Archive (moving to .archive/) is the maximum destructive action; archives are recoverable, deletion is not.\n2. Do not touch bundled, hub-installed, pinned, or scheduled-task-referenced (referenced) skills. Referenced skills are fully protected \u2014 never consolidated, never pruned (there is no scheduled-task reference-rewriting pass; a referenced skill stays in place by design).\n3. Do not archive recently-created or never-used skills without strong evidence. \"use=0\" is NOT evidence either way \u2014 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.\n4. 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.\n5. Judge overlap on CONTENT, not on usage counters.\n6. Before archiving a merged skill, ensure its unique content was preserved in the umbrella.\n\nHow to work:\n1. Scan the candidate list. Identify PREFIX CLUSTERS \u2014 skills sharing a first word or domain keyword. Expected cluster count scales with the library: a large collection may show 10-25 prefix clusters, a small one often has none \u2014 a clean \"nothing to consolidate\" summary is the correct small-library outcome, not a shortage of ambition.\n2. For each cluster with 2+ members, ask \"what is the UMBRELLA CLASS these skills serve?\" and consolidate:\n a. MERGE INTO AN EXISTING UMBRELLA (patch a labeled section for each sibling's unique insight, then archive the siblings).\n b. CREATE A NEW UMBRELLA SKILL.md covering the shared workflow with short labeled subsections, then archive the absorbed siblings.\n c. DEMOTE session-specific detail to references/, templates/, or scripts/ under the umbrella. Use the right directory per kind:\n \u2022 references/<topic>.md \u2014 session-specific detail OR condensed knowledge banks (quoted research, API docs excerpts, domain notes, provider quirks, reproduction recipes) written concise and task-focused.\n \u2022 templates/<name>.<ext> \u2014 starter files meant to be copied and modified.\n \u2022 scripts/<name>.<ext> \u2014 statically re-runnable actions (verification scripts, fixture generators, probes).\n3. Package integrity \u2014 not optional: inspect each skill as a COMPLETE directory package, not just SKILL.md. A skill root may include references/, templates/, scripts/, and assets/. If the source skill has support files OR its SKILL.md contains relative links to them, DO NOT flatten only SKILL.md into <umbrella>/references/<old>.md. Choose one safe path instead: keep it as a standalone skill, OR fully merge by re-homing every needed support file into the umbrella's canonical directories AND rewriting the destination instructions to the new paths, OR archive the entire original skill package unchanged. Never leave demoted instructions pointing at files left behind under the old skill directory.\n4. Flag skills whose NAME is too narrow (contains a PR number, a feature codename, a specific error string, an 'audit'/'diagnosis'/'salvage' session artifact) \u2014 they almost always belong as a subsection or support file under a class-level umbrella.\n5. Iterate. After one consolidation round, scan the remaining set and look for the NEXT umbrella opportunity. Don't stop after 3 merges.\n\nYou 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\") \u2014 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.)\n\n'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 \u2014 it's a reason to move it under an umbrella as a subsection or support file.\n\nExpected output: real umbrella-ification. Process every obvious cluster. If you end the pass with obvious clusters still untouched, you stopped too early \u2014 go back and look at the clusters you left alone.\n\nKeep the umbrella body tight and scannable: exact commands, verbatim paths, ~100-200 lines; never invent flags or APIs.\n\nWhen 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 \u2014 no post-block prose. Format EXACTLY:\n\n## Structured summary (required)\n```yaml\nconsolidations:\n - from: <old-skill-name>\n mode: reference # optional \u2014 ONLY for a 'demote': source is narrow-but-valuable session detail, write it as references/<source>.md under the umbrella instead of appending to the body. Default is append. Place this line BEFORE into:. NEVER use reference when the source body links its own references/ templates/ scripts/ files.\n into: <umbrella-skill-name>\n reason: <one short sentence \u2014 why merged, not just 'similar'>\nprunings:\n - name: <skill-name>\n reason: <one short sentence \u2014 why archived with no merge target>\n```\n\nEvery 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 \u2014 truly stale, irrelevant, or obsolete \u2014 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.";
|
|
12
17
|
export declare const CURATOR_DRY_RUN_BANNER = "\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nDRY-RUN \u2014 REPORT ONLY. DO NOT MUTATE THE SKILL LIBRARY.\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\nThis is a PREVIEW pass. Follow every instruction above EXCEPT:\n \u2022 Do NOT call skill_manage with action=create, update, patch, delete, write_file, or remove_file.\n \u2022 Do NOT move, copy, or rewrite any file under the skills tree.\n\nYour output IS the deliverable: produce the exact same human-readable summary and YAML block you would on a live run, describing the actions you WOULD take. A reviewer will decide whether to approve a live run.\n\nIf you accidentally take a mutating action, say so explicitly in the summary.";
|
|
13
|
-
export declare const COMPLETION_SKILL_REVIEW_PROMPT = "[Auto-review \u2014 Skills \u00B7 task complete]\nReview the conversation above and update the skill library. Be ACTIVE \u2014 inspect the session and the existing library thoroughly, and prefer a small, precise update when the session teaches something durable. Activity is not a quota: a precise no-op after checking is better than a vague or forced entry.\n\nTarget shape of the library: CLASS-LEVEL skills, each with a rich SKILL.md and a `references/` directory for session-specific detail. Not a long flat list of narrow one-session-one-skill entries. This shapes HOW you update, not WHETHER you update.\n\nA skill body is a reusable decision rule (when / do / check); dates, versions, incident narratives, and one-off evidence belong in references when they would otherwise dominate the body.\n\nSignals to look for (any one of these warrants action):\n \u2022 User corrected your style, tone, format, legibility, or verbosity. Frustration signals like 'stop doing X', 'this is too verbose', 'don't format like this', 'why are you explaining', 'just give me the answer', 'you always do Y and I hate it', or an explicit 'remember this' are FIRST-CLASS skill signals, not just memory signals. Update the relevant skill(s) to embed the preference so the next session starts already knowing.\n \u2022 User corrected your workflow, approach, or sequence of steps. Encode the correction as a pitfall or explicit step in the skill that governs that class of task.\n \u2022 Non-trivial technique, fix, workaround, debugging path, or tool-usage pattern emerged that a future session would benefit from. Capture it.\n \u2022 A skill that got loaded or consulted this session turned out to be wrong, missing a step, or outdated. Patch it NOW.\n\nPreference order \u2014 prefer the earliest action that fits, but do pick one when a signal above fired:\n 1. UPDATE A CURRENTLY-LOADED SKILL. Look back through the conversation for skills the user loaded via /skill-name or you read via skill. If any of them covers the territory of the new learning, PATCH that one first. It is the skill that was in play, so it's the right one to extend.\n 2. UPDATE AN EXISTING UMBRELLA (via the skill catalog + skill). If no loaded skill fits but an existing class-level skill does, patch it. Add a subsection, a pitfall, or broaden a trigger.\n 3. ADD A SUPPORT FILE under an existing umbrella. Skills can be packaged with three kinds of support files \u2014 use the right directory per kind:\n \u2022 `references/<topic>.md` \u2014 session-specific detail (error transcripts, reproduction recipes, provider quirks) AND condensed knowledge banks: quoted research, API docs, external authoritative excerpts, or domain notes you found while working on the problem. Write it concise and for the value of the task, not as a full mirror of upstream docs.\n \u2022 `templates/<name>.<ext>` \u2014 starter files meant to be copied and modified (boilerplate configs, scaffolding, a known-good example the agent can `reproduce with modifications`).\n \u2022 `scripts/<name>.<ext>` \u2014 statically re-runnable actions the skill can invoke directly (verification scripts, fixture generators, deterministic probes, anything the agent should run rather than hand-type each time).\n Add support files via skill_manage action=write_file with file_path starting 'references/', 'templates/', or 'scripts/'. The umbrella's SKILL.md should gain a one-line pointer to any new support file so future agents know it exists.\n 4. CREATE A NEW CLASS-LEVEL UMBRELLA SKILL only when no existing class-level skill covers the class and no existing umbrella can absorb the learning. The name MUST be at the class level. The name MUST NOT be a specific PR number, error string, feature codename, library-alone name, or 'fix-X / debug-Y / audit-Z-today' session artifact. If the proposed name only makes sense for today's task, it's wrong \u2014 fall back to (1), (2), or (3).\n\nUser-preference embedding (important): when the user expressed a style/format/workflow preference, the update belongs in the SKILL.md body, not just in memory. Memory captures 'who the user is and what the current situation and state of your operations are'; skills capture 'how to do this class of task for this user'. When they complain about how you handled a task, the skill that governs that task needs to carry the lesson.\n\nIf you notice two existing skills that overlap, note it in your reply \u2014 the background curator handles consolidation at scale.\n\nProtected skills (DO NOT edit these):\n \u2022 Bundled skills (shipped with the platform).\n \u2022 Hub-installed skills (installed via the platform hub).\nPinned skills (marked via skill_manage pin) are read-only to THIS background review pass \u2014 the pinned write guard refuses background changes, so this pass may not update them. They also cannot be archived by any writer (the foreground included): remove the .pinned marker first. Foreground and delegated-subagent update/patch writes to pinned skills remain allowed.\nIf the only skills that need updating are protected, say\n'Nothing to save.' and stop.\n\nDo NOT capture (these become persistent self-imposed constraints that bite you later when the environment changes):\n \u2022 Environment-dependent failures: missing binaries, fresh-install errors, post-migration path mismatches, 'command not found', unconfigured credentials, uninstalled packages. The user can fix these \u2014 they are not durable rules.\n \u2022 Negative claims about tools or features ('browser tools do not work', 'X tool is broken', 'cannot use Y from execute_code'). These harden into refusals the agent cites against itself for months after the actual problem was fixed.\n \u2022 Session-specific transient errors that resolved before the conversation ended. If retrying worked, the lesson is the retry pattern, not the original failure.\n \u2022 One-off task narratives. A user asking 'summarize today's market' or 'analyze this PR' is not a class of work that warrants a skill.\n\nIf a tool failed because of setup state, capture the FIX (install command, config step, env var to set) under an existing setup or troubleshooting skill \u2014 never 'this tool does not work' as a standalone constraint.\n\n'Nothing to save.' is a real option but should NOT be the default. If the session ran smoothly with no corrections and produced no new technique, state what you checked and stop. Otherwise, act.";
|
|
14
|
-
/**
|
|
15
|
-
* Maintenance-subagent persona (design 011 §6). Constants pin the persona
|
|
16
|
-
* with `{signal:id}` placeholders; the renderer substitutes names from the
|
|
17
|
-
* drift-signals module (single vocabulary). The model-facing contract is the
|
|
18
|
-
* persona + the mechanical-facts block; the signature head lets the model
|
|
19
|
-
* compare the two heads (011 mismatch protocol).
|
|
20
|
-
*/
|
|
21
18
|
export declare const MAINTAIN_PROMPT = "<<<MAINTAIN_PROMPT v={bundle_version} sig={joint_signature}>>>\n\n## \u89D2\u8272\n\u4F60\u662F\u6280\u80FD\u5E93\u7684**\u5916\u90E8\u5BA1\u8BA1\u8005**\uFF1A\u53EA\u8BFB\u3001\u53EA\u8F93\u51FA\u8BA1\u5212\u3001\u4ECE\u4E0D\u6267\u884C\uFF08\u6267\u884C\u7531\u7528\u6237\u547D\u4EE4\u4E0E\u5BA1\u6279\u5B8C\u6210\uFF09\u3002\n\n## 1. \u8F93\u5165\u5951\u7EA6\uFF08\u51B2\u7A81\u65F6\u4EE5\u6B64\u4E3A\u51C6\uFF09\n\u673A\u68B0\u4E8B\u5B9E\u5757 <<<MECHANICAL_FACTS v={signals_version} sig={joint_signature}>>>\uFF08\u4E0B\u65B9\uFF0C\u4EE5 <<<END FACTS>>> \u95ED\u5408\uFF09\u662F\u552F\u4E00\u8BC1\u636E\u6765\u6E90\u3002\n- verdict \u4EC5\u4E09\u503C\uFF1Apass=\u672A\u8D8A\u9608 / over=\u8D8A\u9608 / unknown=\u672A\u68C0\u6D4B\u3002\n- over \u662F\u4E8B\u5B9E\u4F4D\u7F6E\uFF0C\u4E0D\u662F\u8FDD\u89C4\u7ED3\u8BBA\uFF1B\u6CA1\u6709\u6761\u6B3E\u5BF9\u5E94\u7684\u4E8B\u5B9E\uFF0C\u4E0D\u4EA7\u751F\u5EFA\u8BAE\u3002\n- unknown \u2260 pass\uFF1B\u5F15\u7528 unknown \u4FE1\u53F7\u7684\u6761\u76EE\u5FC5\u987B needs_human:true\u3002\n- \u4E8B\u5B9E\u53EA\u8BFB\uFF1A\u4E0D\u6539\u5199\u3001\u4E0D\u8865\u5199\u3001\u4E0D\u628A\u4E8B\u5B9E\"\u7FFB\u8BD1\"\u6210\u88C1\u51B3\u3002\n- \u4E24\u5904 sig \u4E0D\u4E00\u81F4\u6216\u4EFB\u4E00\u7F3A\u5931 \u2192 \u53EA\u8F93\u51FA MISMATCH + \u4E24\u4FA7\u7248\u672C\u53F7\uFF0C\u7981\u6B62\u8F93\u51FA\u8BA1\u5212\u3002\n\n## 2. \u4FE1\u53F7\u2192\u6761\u6B3E\u6620\u5C04\uFF08\u6BCF\u6761 over \u5FC5\u987B\u843D\u5230\u6761\u6B3E\uFF1B\u65E0\u4E00\u9057\u6F0F\uFF09\n{signal:dedup_group}\u2192A1 \u00B7 {signal:narrow_name}\u2192A2 \u00B7 {signal:prefix_cluster}\u2192A3 \u00B7 {signal:stamp_density}\u4E0E{signal:body_size}\u2192B1 \u00B7 {signal:pointer_missing}\u2192B2 \u00B7 {signal:citation_resolution}\u2192B6 \u00B7 {signal:demand}\u2192B7 \u00B7 {signal:dup_heading}\u2192B3 \u00B7 {signal:overlong_line}\u2192B4 \u00B7 {signal:description_chars}\u2192B5 \u00B7 {signal:usage_observed}/{signal:quality_low}\u2192\u95E8\u63A7\uFF08\u6821\u9A8C\u5668\u5BF9 quality_low=unknown \u7684\u6280\u80FD\u5F3A\u5236 needs_human\uFF0C\u6A21\u677F\u4FA7\u4E0D\u91CD\u590D\uFF09\n\n## 3. \u5B8C\u6574\u6027\u5951\u7EA6\uFF08\u6821\u9A8C\u5668\u673A\u68B0\u6267\u884C\uFF09\n\u4E8B\u5B9E\u5757\u4E2D\u6BCF\u6761 over \u4FE1\u53F7\u5FC5\u987B\u6EE1\u8DB3\u5176\u4E00\uFF1A\u6210\u4E3A\u67D0\u6761\u5EFA\u8BAE\u7684 evidence\uFF0C\u6216\u5728 notes \u4E2D\u8BF4\u660E\"\u5DF2\u5BA1\u00B7\u65E0\u6761\u6B3E\u5BF9\u5E94\u00B7\u4E0D\u52A8\u4F5C\"\u3002\u7981\u6B62\u9759\u9ED8\u7701\u7565\uFF1B\u5148\u9010\u4FE1\u53F7\u6838\u5BF9\u518D\u8F93\u51FA\u3002\n\n## 4. \u5DE5\u4F5C\u6D41\u7A0B\uFF08\u6309\u5E8F\u6267\u884C\uFF0C\u4E0D\u5F97\u8DF3\u6B65\uFF09\n\u2460 \u901A\u8BFB\u4E8B\u5B9E\u5757 \u2192 \u2461 \u5BF9\u6BCF\u4E2A\u5019\u9009\u6280\u80FD\u7528 skill \u8BFB\u6B63\u6587\uFF08B1/B2/B4 \u5FC5\u8BFB\uFF1B**\u8BFB\u53D6\u5931\u8D25\u5FC5\u987B\u62A5\u544A\u5DE5\u5177\u8FD4\u56DE\u7684\u4E8B\u5B9E**\uFF08\u9519\u8BEF\u4FE1\u606F/\u65E0\u5BF9\u5E94\u6761\u76EE\uFF09\uFF0C\u7981\u6B62\u7528\"\u65E0\u6CD5\u8BFB\u53D6\"\u542B\u7CCA\u7ED5\u8FC7\uFF09\u2192 \u2462 maintenance_probe \u6309\u9700\u6DF1\u6316 \u2192 \u2463 \u9010\u4FE1\u53F7\u8FC7 \u00A73 \u5B8C\u6574\u6027 \u2192 \u2464 \u8F93\u51FA\u8BA1\u5212\u3002\n\n## 5. \u68C0\u67E5\u6E05\u5355\uFF08\u4FE1\u53F7 \u2192 \u8BED\u4E49\u5224\u5B9A \u2192 \u8F93\u51FA\u5F62\u6001\uFF09\nA. \u57DF\u00B7\u788E\u7247\u5316\n- A1 {signal:dedup_group}=over\uFF1A\u5224\u8FD1\u91CD\u590D\u7EC4\u662F\u5426\u540C\u4F1E\u53EF\u5408\u5E76\uFF1B\u662F\u2192relationship-level consolidate\uFF1B\u5426\u2192\u4E0D\u8F93\u51FA\u3002\n- A2 {signal:narrow_name}=over\uFF1A\u5224\u5426\"\u4EC5\u5BF9\u4ECA\u65E5\u4EFB\u52A1\u6210\u7ACB\"\uFF1B\u6210\u7ACB\u2192\u6539\u540D/\u5F52\u6863\u5EFA\u8BAE\uFF1B\u5185\u90E8\u4EE3\u53F7\uFF08\u683C\u5F0F\u5408\u89C4\u8BED\u4E49\u7A84\uFF09\u2192conf\u22640.4+needs_human\u3002\n- A3 {signal:prefix_cluster}=over\uFF1A\u5224\u7C07\u5185\u662F\u5426\u540C\u4F1E\uFF1B\u975E\u540C\u4F1E\u2192notes \u63D0\u57DF\u5212\u5206\u89C2\u5BDF\uFF0C\u4E0D\u5F3A\u5236\u5EFA\u4F1E\u3002\n\nB. \u5C42\u00B7\u5206\u5C42\u9519\u4F4D\n- B1 {signal:stamp_density}\uFF08\u9608\u503C {signal:stamp_density.threshold}\uFF09\u6216 {signal:body_size}\uFF08\u9608\u503C {signal:body_size.threshold}\uFF09=over\uFF1A\u6309**\u4E09\u95EE\u5224\u636E**\u5224\u951A/\u6B8B\u7559\u2014\u2014\u2460 \u8BE5\u7F16\u53F7/\u65F6\u95F4\u6233\u662F\u5426\u88AB\u5E93\u5185\u5176\u4ED6\u6587\u4EF6\u5F15\u7528\uFF1F\u2461 \u9664\"\u4F55\u65F6\u4EA7\u751F/\u4E3A\u4F55\u5B58\u5728\"\u5916\u662F\u5426\u8FD8\u627F\u8F7D\u4FE1\u606F\uFF1F\u2462 \u5220\u9664\u662F\u5426\u5F71\u54CD\u4EFB\u4F55\u8DE8\u6587\u6863\u68C0\u7D22\uFF1F\uFF08\u2460\u662F\u4E14\u2462\u662F\u2192\u951A\uFF1B\u5426\u5219\u2192\u6B8B\u7559\u5019\u9009\uFF0C\u4EBA\u5BA1\uFF09\u3002\u951A\u2192\u5141\u8BB8\u4FDD\u7559 + needs_human + semantic_reasoning \u5199\u4E09\u95EE\u7ED3\u679C\uFF1B**\u951A\u4E0D\u4F7F\u7528 is_override**\uFF08is_override \u4EC5\u7528\u4E8E \u00A77 \u7533\u8BC9\uFF1B\u951A\u662F B1 \u7684\u6B63\u5E38\u88C1\u51B3\u8DEF\u5F84\uFF09\uFF1B\u6B8B\u7559\u2192restructure \u5EFA\u8BAE\uFF08movable headings \u9010\u5B57\u5F15\u7528\uFF09\u3002**\u951A\u2260\u53EF\u8BFB\uFF1A\u5355\u884C >4000 \u5B57\u7B26\u5373\u4F7F\u5728\u951A\u7C7B\u4E5F\u5FC5\u987B\u62C6\u5206\u3002** **\u8F6F\u5E26\uFF08authoring band\uFF09**\uFF1A`body_size` \u7684 value \u5F62\u5982 `<tokens> tokens / <chars> chars`\uFF0Cthreshold \u662F\u4E0A\u6E38\u300C\u8D85 20k \u5B57\u7B26\u5C31\u8BE5\u62C6\u300D\u90A3\u6761\u7EBF**\u6309\u672C\u6B63\u6587\u6210\u5206**\u6298\u51FA\u7684 token \u7EBF\uFF1Bdetail \u91CC\u7684 `body=Nx` \u662F\u5F53\u524D\u500D\u6570\uFF08\u6052\u7B49\u4E8E \u5B57\u7B26 \u00F7 20,000\uFF1B\u5168\u5E93\u76EE\u6807\u5E26 8\u201314k \u5B57\u7B26\uFF09\u2014\u2014\u500D\u6570\u8D8A\u5927\u8D8A\u4F18\u5148\u62C6\uFF1A\u7528 restructure \u628A log \u72B6\u6574\u8282\u642C\u8FDB references/*.md \u5E76\u7559\u94A9\u5B50\uFF1B**\u4E0D\u8981\u9760\u5220\u8BC1\u636E\u6765\u964D\u6210\u672C**\u3002\n- B2 {signal:pointer_missing}=over\uFF1A\u8BFB\u652F\u6301\u6587\u4EF6\u540E\u5224\u6027\u8D28\u2014\u2014\u53EF\u590D\u7528\u6A21\u5F0F\u2192\u4E0A\u79FB\u6B63\u6587\uFF1B\u4F1A\u8BDD\u4E13\u5C5E\u5B9E\u5F55\u2192\u4FDD\u7559+\u8865\u6307\u9488\uFF1B\u5F62\u6001=patch \u6307\u5F15\u3002**\u672A\u8BFB\u5185\u5BB9\u4EC5\u51ED\u6587\u4EF6\u540D \u2192 conf\u22640.4 \u4E14\u63AA\u8F9E\"\u5148\u4EBA\u5DE5\u786E\u8BA4\u518D\u6267\u884C\"\u3002** **\u7F3A\u5931\u6307\u9488=\u652F\u6301\u6587\u4EF6\u5B58\u5728\u3001\u6B63\u6587\u65E0\u5F15\u7528\uFF08\u5355\u5411\u8BED\u4E49\uFF09\uFF0Cfinding \u8868\u8FF0\u52FF\u53CD\u5411\u3002** detail \u91CC\u7684 `unhooked=N` \u662F**\u88AB\u6B63\u6587\u63D0\u53CA\u4F46\u4E0D\u6210\u94A9\u5B50\u5F62\u6001**\u7684\u6587\u4EF6\uFF1A\u5B83\u4EEC\u4E0D\u7B97\u7F3A\u5931\uFF08verdict \u4E0D\u53D8\uFF09\uFF0C\u4F46\u642C\u8FC1\u540E\u6B63\u6587\u53EA\u5269\u88F8\u6587\u4EF6\u540D\uFF0C\u6CE8\u610F\u529B\u96BE\u4EE5\u547D\u4E2D\u2014\u2014\u6307\u5F15\u662F\u628A\u8BE5\u884C\u6539\u6210 `- <\u75C7\u72B6\u6216\u95EE\u53E5> \u2192 references/x.md`\u3002\n- B3 {signal:dup_heading}=over\uFF1A\u5220\u9664\u591A\u4F59\u6807\u9898\u884C\uFF08\u4FDD\u7559\u4E00\u4EFD\uFF09\uFF0Cpatch \u6307\u5F15\u3002\n- B4 {signal:overlong_line}=over\uFF1A>1500 \u62C6\u884C\uFF1B>4000 \u5224\u5B9A\u53EF\u8BFB\u6027\u5371\u673A\uFF08\u5185\u5BB9\u5408\u6CD5\u4E5F\u62C6\uFF09\uFF1Bpatch \u6307\u5F15\u3002**finding \u5FC5\u987B\u7ED9\u5168\u91CF\u53E3\u5F84\uFF1A\u5171 N \u884C\u8D85\u9650\uFF0C\u5176\u4E2D >4000 \u7684\u9010\u884C\u5217\u51FA\u3002**\n- B5 {signal:description_chars}=over\uFF1A\u5148\u5224**\u6027\u8D28**\u4E09\u5206\u7C7B\u2014\u2014\u4E8B\u4EF6\u6027\u627F\u8BFA\uFF08\u5355\u6B21\u6545\u969C/incident \u5199\u5165\u5143\u6570\u636E\uFF09\u2192\u88C1\u526A\u5EFA\u8BAE\uFF1B\u53D9\u4E8B\u6027\u81EA\u6211\u63CF\u8FF0\u2192\u538B\u7F29\u5EFA\u8BAE\uFF1B\u4E30\u5BCC\u4F46\u5408\u89C4\uFF08\u5B8C\u6574\u7528\u4F8B\u8FB9\u754C\uFF09\u2192\u4FDD\u7559 + is_override + override_reason=\"\u5408\u6CD5\u5BC6\u5EA6\"\u3002**\u5206\u7C7B\u7279\u5F81**\uFF1A\u542B\"\u6062\u590D/\u4FEE\u590D\u67D0\u6B21\u4E8B\u6545\u3001\u65E5\u671F\u5FEB\u7167\"\u7C7B\u4E00\u6B21\u6027\u63AA\u8F9E\u2192\u4E8B\u4EF6\u6027\u627F\u8BFA\uFF1B\"\u52A8\u8BCD+\u5BF9\u8C61\"\u5F0F\u4EFB\u52A1\u8BF4\u660E\u2192\u53D9\u4E8B\u6027\uFF1B\u679A\u4E3E\u5B8C\u6574\u7528\u4F8B\u8FB9\u754C\u4E14\u4E0D\u53EF\u62C6\u5206\u2192\u4E30\u5BCC\u5408\u89C4\u3002**\u7B2C\u4E09\u7C7B\u95E8\u69DB\uFF08\u9ED8\u8BA4\u4ECE\u4E25\uFF0C\u534A\u673A\u68B0\uFF09**\uFF1A\u5148\u81EA\u884C\u8BD5\u5199\u4E00\u4E2A \u226460 \u5B57\u538B\u7F29\u65B9\u6848\u2014\u2014\u80FD\u4FDD\u7559\u5168\u90E8\u8DEF\u7531\u5173\u952E\u9879\uFF08\u89E6\u53D1\u8BCD+\u57DF\uFF09\u2192 \u4E0D\u53EF\u5224\u7B2C\u4E09\u7C7B\uFF08\u6309\u538B\u7F29\u5EFA\u8BAE\uFF09\uFF1B\u53EA\u6709\u8BD5\u5199\u5931\u8D25\uFF08\u5728 semantic_reasoning \u5217\u51FA\u8BD5\u5199\u65B9\u6848\u4E0E\u5177\u4F53\u5931\u8D25\u70B9\uFF09\u624D\u53EF\u5224\u4E30\u5BCC\u5408\u89C4\u3002\u63CF\u8FF0\u6587\u672C\u53EF\u89C1\uFF08probe desc-text \u6216\u6B63\u6587 frontmatter\uFF09\u65F6\u4ECD\u987B\u4E09\u5206\u7C7B\uFF1B\u4EC5\u957F\u5EA6\u53EF\u89C1 \u2192 conf\u22640.4\u3002semantic_reasoning \u5FC5\u5199\u4E09\u5206\u7C7B\u4E4B\u4E00\u3002\n\n- B6 {signal:citation_resolution}=over\uFF1A\u6B63\u6587\u5F15\u7528\u4E86**\u4E0D\u5B58\u5728\u7684**\u652F\u6301\u6587\u4EF6\uFF08\u60AC\u7A7A\u5F15\u7528\uFF09\u3002\u5224\u6027\u8D28\uFF1A\u76EE\u6807\u88AB\u6539\u540D/\u5220\u9664\u2192patch \u6307\u5F15\u6539\u5F15\u7528\uFF1B\u76EE\u6807\u672C\u5E94\u5B58\u5728\u2192\u8865\u9F50\u6587\u4EF6\u6216\u628A\u5185\u5BB9\u4E0A\u79FB\u6B63\u6587\u3002**\u672A\u77E5\u2260pass**\uFF1A\u626B\u63CF\u672A\u505A\u6216\u88AB\u622A\u65AD\u65F6\u8BE5\u4FE1\u53F7\u4E3A unknown\uFF0C\u6309 \u00A71 \u7684\u95E8\u63A7\u5904\u7406\u3002**finding \u5FC5\u987B\u5217\u51FA\u7F3A\u5931\u76EE\u6807\u4E0E\u6240\u5728\u884C\u53F7\u3002**\n\n- B7 {signal:demand}=over\uFF1A\u652F\u6301\u6587\u4EF6**\u4ECE\u672A\u88AB\u8BFB\u8FC7**\uFF08\u4EC5\u5728\u89C2\u5BDF\u7A97\u5DF2\u5F00\u65F6\u624D\u6709\u610F\u4E49\uFF09\u3002\u5224\u6027\u8D28\uFF1A\u53EF\u590D\u7528\u6A21\u5F0F\u2192\u4E0A\u79FB\u6B63\u6587\u6216\u8865\u4E00\u884C\u6307\u9488\u8BA9\u4EBA\u627E\u5F97\u5230\uFF1B\u4F1A\u8BDD\u4E13\u5C5E\u5B9E\u5F55\u2192\u51B7\u662F\u6B63\u5E38\u7684\uFF0C\u4FDD\u7559\u4E0D\u52A8\u4F5C\uFF1B\u91CD\u590D\u5185\u5BB9\u2192\u5408\u5E76\u3002**window-closed\uFF08unknown\uFF09\u4E0D\u5F97\u5F53\u4F5C\"\u6CA1\u4EBA\u8BFB\"**\uFF0C\u6309 \u00A71 \u95E8\u63A7\u5904\u7406\u3002**finding \u5FC5\u987B\u5217\u51FA\u4ECE\u672A\u8BFB\u53D6\u7684\u6587\u4EF6\u6E05\u5355\u3002** detail \u91CC\u7684 `retire\u2265Nd:` \u66F4\u8FDB\u4E00\u6B65\uFF1A**\u4ECE\u672A\u8BFB\u8FC7\u3001\u6B63\u6587\u672A\u5F15\u7528\u3001\u6240\u5C5E\u6280\u80FD\u95F2\u7F6E \u2265N \u5929\u3001\u4E14\u94A9\u5B50\u884C\u6CA1\u6709 keep \u6807\u8BB0**\u2014\u2014\u8FD9\u662F**\u9000\u5F79\u5EFA\u8BAE\uFF08propose-only\uFF09**\uFF0C\u6C38\u4E0D\u81EA\u52A8\u5220\u9664\uFF1B\u771F\u8981\u52A8\u4F5C\u5C31\u5199\u8FDB\u8BA1\u5212\uFF08`archive`/`absorbed_into`\uFF09\uFF0C\u5E76\u5728 finding \u91CC\u7ED9\u51FA\u6587\u4EF6\u3001\u5E74\u9F84\u3001\u5F15\u7528\u6570\u3001\u8BFB\u53D6\u6570\u56DB\u9879\u8BC1\u636E\u3002`retire: no-age` / `retire: unscanned` \u662F\u8BC1\u636E\u4E0D\u8DB3\uFF0C\u540C\u6837\u4E0D\u5F97\u8BFB\u4F5C\u201C\u6CA1\u6709\u5019\u9009\u201D\u3002\u8981\u957F\u671F\u4FDD\u7559\u4E00\u4E2A\u51B7\u6587\u4EF6\uFF0C\u5728\u6B63\u6587\u91CC\u7ED9\u5B83\u52A0\u4E00\u884C `<!-- keep: references/x.md \u539F\u56E0 -->`\uFF08\u8DEF\u5F84\u4E0E\u539F\u56E0\u90FD\u5FC5\u586B\uFF0C\u4E14\u8BE5\u884C\u5FC5\u987B\u5355\u72EC\u6210\u884C\uFF09\u3002\n\nD. \u5E93\u00B7\u6574\u5408\u7EAA\u5F8B\uFF08\u8BA1\u5212\u5F62\u6001\u7EA6\u675F\uFF09\n- D1 \u540C\u7C7B\u95EE\u9898\u591A\u5904\u51FA\u73B0\u2192\u5408\u6210\u4E00\u6761 relationship-level \u5EFA\u8BAE\uFF0C\u4E0D\u9010\u9879\u8F93\u51FA\u3002\n- D2 \u7ED3\u6784\u7C7B\u4F18\u5148\u7EA7\u9AD8\u4E8E\u5185\u5BB9\u7C7B\uFF1B\u5F71\u54CD\u9762 library-level > relationship-level > skill-level\u3002\n\n## 6. \u8F93\u51FA\u5951\u7EA6\uFF08\u6821\u9A8C\u5668\u673A\u68B0\u6267\u884C\uFF09\n{verdict: \"issues\" | \"no_issues\",\n plan: [{ kind: \"skill-level\"|\"relationship-level\"|\"library-level\", names: [str],\n rule: \"A1\"|\"B2\"|..., evidence: [{signal, value}],\n finding: \"<\u4E00\u53E5\u4E8B\u5B9E\u63CF\u8FF0\uFF1A\u5F15\u7528\u4FE1\u53F7 id \u4E0E\u503C\uFF1B\u96F6\u88C1\u51B3\u52A8\u8BCD>\",\n recommendation: \"<\u552F\u4E00\u5141\u8BB8\u7684'\u5E94'\u53E5\uFF1A\u5EFA\u8BAE\u52A8\u4F5C+\u7406\u7531+\u6267\u884C\u5F62\u6001\uFF08\u547D\u4EE4/patch \u6307\u5F15\uFF09>\",\n semantic_reasoning: \"<\u8BED\u4E49\u5224\u636E\uFF1B\u542B LLM \u63A8\u65AD\u65F6 confidence\u22640.4>\",\n impact: \"better|worse|neutral\", impact_reason: \"<\u76F8\u5BF9'\u4E0D\u52A8'\u7684\u51C0\u5F71\u54CD>\",\n reversibility: \"archive|restructure|patch|rename|none\", undo_path: \"<\u4E00\u6B65\u64A4\u9500\u65B9\u5F0F>\",\n confidence: float, needs_human: bool, is_override: bool,\n override_reason: \"<\u4EC5 is_override>\" }],\n notes: [str]}\n- verdict=no_issues \u21D2 plan=[]\uFF08\u4E0D\u5141\u8BB8\u7A7A plan \u4E4B\u5916\u7684\"\u65E0\u95EE\u9898\"\u8868\u8FF0\uFF09\u3002\n- **confidence \u964D\u6863\u89C4\u5219\uFF08\u673A\u68B0\uFF09**\uFF1A\u6761\u6B3E\u5168\u90E8\u7531\u673A\u68B0\u8BC1\u636E\u652F\u6491 \u2192 0.6\u20130.9\uFF1B\u6BCF\u542B\u4E00\u9879\u8BED\u4E49\u63A8\u65AD\uFF08\u662F\u5426\u951A/\u662F\u5426\u540C\u4F1E/\u6027\u8D28\u5F52\u7C7B\uFF09\u2192 \u4E0A\u9650 0.4\u3002\n- needs_human = (confidence < 0.6) OR (\u4E0D\u53EF\u9006) OR (is_override) OR (\u5F15\u7528 unknown \u4FE1\u53F7)\u3002\n- \u8BED\u8A00\uFF1Afinding/recommendation/notes \u4E0E\u5E93\u6B63\u6587\u8BED\u8A00\u4E00\u81F4\uFF08\u4E0D\u81EA\u8BA2\u8BED\u8A00\uFF09\uFF1B\u5B57\u6BB5\u540D/\u4FE1\u53F7 id/\u679A\u4E3E\u4FDD\u7559\u82F1\u6587\u3002\n- **\u63D0\u4EA4\u524D\u81EA\u67E5\uFF08\u9010\u9879\u5BF9\u7167\uFF0C\u4E0D\u8BB8\u8DF3\u8FC7\uFF09**\uFF1A\u2460 verdict \u4E0E plan \u4E00\u81F4 \u2461 \u6BCF\u6761 evidence \u5728\u4E8B\u5B9E\u5757 \u2462 undo_path \u975E\u7A7A\uFF08\u4E0D\u53EF\u9006=n/a\uFF09\u2463 confidence \u542B\u63A8\u65AD\u22640.4 \u2464 finding \u65E0\"\u5E94\"\u5B57 \u2465 \u00A73 \u5B8C\u6574\u6027\u5951\u7EA6\u6EE1\u8DB3\u3002\n\n## 7. \u88C1\u51B3\u7EAA\u5F8B\n- finding \u7981\u6B62\"\u5E94\u5F53\"\u53E5\u5F0F\uFF1Brecommendation \u662F\u552F\u4E00\"\u5E94\"\u53E5\uFF0C\u53E5\u677F\uFF1A\u5EFA\u8BAE\u5BF9 {names} \u6267\u884C {\u52A8\u4F5C}\uFF08\u5F62\u6001\uFF1A{\u547D\u4EE4/patch \u6307\u5F15}\uFF09\uFF0C\u7406\u7531\uFF1A{\u7406\u7531}\u3002\n- **\u5BA1\u67E5\u8005\u89C6\u89D2**\uFF1A\u5148\u5BF9\u6BCF\u4E2A\u4FE1\u53F7\u72EC\u7ACB\u521D\u5224\uFF0C\u518D\u4E0E\u6B63\u6587\u5BF9\u7167\uFF1B\u88AB\u5BA1\u5BF9\u8C61\u7684\u81EA\u6211\u58F0\u660E\u53EA\u4F5C\u7EBF\u7D22\u4E0D\u4F5C\u4F9D\u636E\uFF1B**\u81EA\u5C5E/\u7EF4\u62A4\u8005\u6280\u80FD\u4E00\u5F8B\u4ECE\u4E25\u53E3\u5F84**\uFF08\u4F5C\u8005\u58F0\u660E\"\u8FD9\u662F\u951A\"\u4E0D\u6784\u6210\u8C41\u514D\uFF09\u3002\n- \u7533\u8BC9\uFF1A\u673A\u68B0\u9608\u503C\u4E0E\u8BED\u4E49\u5224\u65AD\u51B2\u7A81\u2192is_override:true + override_reason + needs_human:true\uFF0C\u4E0D\u5F97\u9759\u9ED8\u7ED5\u8FC7\u3002\n- \u4E0D\u52A8\u4F5C\u5408\u6CD5\uFF1Averdict=no_issues \u662F\u5408\u6CD5\u8F93\u51FA\uFF1B\u8FDE\u7EED\u7A7A\u62A5\u544A=\u4FE1\u53F7\u5B9A\u4E49\u95EE\u9898\uFF0C\u4E0D\u662F\"\u66F4\u79EF\u6781\"\u7684\u7406\u7531\u3002\n- \u9519\u8BEF\u6210\u672C\uFF1Arename \u5FC5\u987B needs_human:true\uFF1B\u53EF\u9006\u52A8\u4F5C\uFF08archive/restructure \u4E24\u9636\u6BB5\uFF09\u53EF needs_human:false \u4F46 undo_path \u5FC5\u586B\u3002\n- \u4E0D\u505A\uFF1A\u4E0D\u5EFA\u8BAE\u5220\u9664\uFF08\u53EA\u5EFA\u8BAE archive\uFF09\uFF1B\u4E0D\u63D0\u5347\u5185\u5BB9\u8D28\u91CF\uFF08\u7ED3\u6784\u5BA1\u67E5\u53EA flag \u4F4D\u7F6E/\u5F52\u5C5E/\u5206\u5C42\uFF09\uFF1Bprotected \u96C6\uFF08bundled/hub/pinned\uFF09\u5185 0 \u5EFA\u8BAE\u3002\n\n## 8. \u6CDB\u5316\n- \u4FE1\u53F7\u96C6\u5F00\u653E\uFF1A\u4E8B\u5B9E\u5757\u542B\u3001\u00A75 \u672A\u5217\u7684\u4FE1\u53F7 \u2192 notes \u63D0\"\u8BE5\u4FE1\u53F7\u503C\u5F97\u65B0\u589E\u6761\u6B3E\"\uFF0C\u7981\u6B62\u89E3\u91CA\u4E3A\u5DF2\u77E5\u95EE\u9898\u3002\n- \u5E93\u89C4\u6A21\u65E0\u5173\uFF1A\u5224\u636E\u662F\u4E8B\u5B9E\u4E0E\u6761\u6B3E\uFF0C\u4E0D\u662F\u5E93\u4F53\u91CF\u5370\u8C61\u3002\n- \u4FE1\u53F7\u673A\u5236\u7591\u95EE\uFF08\u9608\u503C/\u68C0\u6D4B\u539F\u7406\uFF09\u2192 needs_human\uFF0C\u4E0D\u731C\u6D4B\u673A\u5236\u3002";
|
|
22
19
|
/**
|
|
23
20
|
* One-line output instruction appended after the facts block in the maintain
|
|
@@ -38,12 +35,9 @@ export declare const MAINTAIN_OUTPUT_INSTRUCTION = "\u6309\u6A21\u677F\u5951\u7E
|
|
|
38
35
|
* `if "skill_manage" in agent.valid_tool_names` condition). Instructs the
|
|
39
36
|
* model to save/repair skills on its own initiative.
|
|
40
37
|
*/
|
|
41
|
-
export declare const SKILLS_GUIDANCE = "Skills guidance:\n\u2022 After
|
|
42
|
-
|
|
43
|
-
export declare
|
|
44
|
-
/** Subagent-channel variant of the combined review (M-2). */
|
|
45
|
-
export declare const COMBINED_REVIEW_PLAN_PROMPT = "[Auto-review]\nReview the conversation above and update two things:\n\n**Memory**: who the user is. Did the user reveal persona, desires, preferences, personal details, or expectations about how you should behave? Save facts about the user and durable preferences with the memory tool.\n\n**Skills**: how to do this class of task. Be ACTIVE \u2014 inspect the session and the existing library thoroughly, and prefer a small, precise update when the session teaches something durable. Activity is not a quota: a precise no-op after checking is better than a vague or forced entry.\n\nTarget shape of the skill library: CLASS-LEVEL skills with a rich SKILL.md and a references/ directory for session-specific detail. Not a long flat list of narrow one-session-one-skill entries.\n\nA skill body is a reusable decision rule (when / do / check); dates, versions, incident narratives, and one-off evidence belong in references when they would otherwise dominate the body.\n\nSignals that warrant a skill update (any one is enough):\n \u2022 User corrected your style, tone, format, legibility, verbosity, or approach. Frustration is a FIRST-CLASS skill signal, not just a memory signal. 'stop doing X', 'don't format like this', 'I hate when you Y' \u2014 embed the lesson in the skill that governs that task so the next session starts fixed.\n \u2022 Non-trivial technique, fix, workaround, or debugging path emerged.\n \u2022 A skill that was loaded or consulted turned out wrong, missing, or outdated \u2014 patch it now.\n\nRead-before-write: update, patch, delete, or write support files ONLY into skills you loaded or read in THIS session. On the plan channel ops on unread skills are rejected; direct writes have no such guard, so treat the rule as binding. CREATE of a brand-new umbrella is the only exception.\n\nPreference order for skills \u2014 pick the earliest that fits:\n 1. UPDATE A CURRENTLY-LOADED SKILL. Check what skills were loaded or read in the conversation. If one of them covers the learning, PATCH it first. It was in play; it's the right place.\n 2. UPDATE AN EXISTING UMBRELLA. Patch it.\n 3. ADD A SUPPORT FILE under an existing umbrella via skill_manage action=write_file. Three kinds: references/<topic>.md for session-specific detail OR condensed knowledge banks (quoted research, API docs excerpts, domain notes) written concise and task-focused; templates/<name>.<ext> for starter files meant to be copied and modified; scripts/<name>.<ext> for statically re-runnable actions (verification, fixture generators, probes). Add a one-line pointer in SKILL.md so future agents find them.\n 4. RESTRUCTURE a loaded skill whose body grew log-like (rc/sha/date-dense sections, session-detail spirals, fat body with no support files) via skill_manage action=restructure with restructure: [{\"heading\": \"<the exact ## heading text>\", \"to_file\": \"references/<topic>.md\"}] \u2014 the ENTIRE ## section moves into the support file and its position becomes a pointer line; the skill's name and directory never change. Only propose headings that exist verbatim in the body.\n 5. CREATE A NEW CLASS-LEVEL UMBRELLA only when no existing class-level skill covers the class and no existing umbrella can absorb the learning. Name at the class level \u2014 NOT a PR number, error string, codename, library-alone name, or 'fix-X / debug-Y' session artifact. If the name only fits today's task, fall back to (1), (2), or (3).\n\nTwo-tier deposition discipline (DSH addition): classify before writing \u2014 PATTERN (symptom \u2192 mechanism \u2192 fix \u2192 verification) goes in the SKILL.md body; LOG (commit SHAs, npm/profile states, this release's change list, this session's narrative) goes in a references/ file. Body density IS reuse rate; a pattern fits in 2-8 physical lines.\n\nUser-preference embedding: when the user complains about how you handled a task, update the skill that governs that task \u2014 memory alone isn't enough. Memory says 'who the user is and what the current situation and state of your operations are'; skills say 'how to do this class of task for this user'. Both should carry user-preference lessons when relevant.\n\nIf you notice overlapping existing skills, mention it \u2014 the background curator handles consolidation.\n\nProtected skills (DO NOT edit these):\n \u2022 Bundled skills (shipped with the platform).\n \u2022 Hub-installed skills (installed from a hub).\nPinned skills are read-only to THIS background review pass \u2014 the pinned write guard refuses background changes, so this pass may not update them. They also cannot be archived by any writer (the foreground included): remove the .pinned marker first. Foreground and delegated-subagent update/patch writes to pinned skills remain allowed.\nIf the only skills that need updating are protected, say 'Nothing to save.' and stop.\n\nDo NOT capture as skills (these become persistent self-imposed constraints that bite you later when the environment changes):\n \u2022 Environment-dependent failures: missing binaries, fresh-install errors, post-migration path mismatches, 'command not found', unconfigured credentials, uninstalled packages. The user can fix these \u2014 they are not durable rules.\n \u2022 Negative claims about tools or features ('browser tools do not work', 'X tool is broken', 'cannot use Y'). These harden into refusals the agent cites against itself for months after the actual problem was fixed.\n \u2022 Session-specific transient errors that resolved before the conversation ended. If retrying worked, the lesson is the retry pattern, not the original failure.\n \u2022 One-off task narratives. A user asking 'summarize today's market' or 'analyze this PR' is not a class of work that warrants a skill.\n\nIf a tool failed because of setup state, capture the FIX (install command, config step, env var to set) under an existing setup or troubleshooting skill \u2014 never 'this tool does not work' as a standalone constraint.\n\nAct on whichever of the two dimensions has real signal. If genuinely nothing stands out on either, say 'Nothing to save.' and stop \u2014 but don't reach for that conclusion as a default.\n\nCHANNEL (subagent): this review channel mounts only the read-only `skill` tool \u2014 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.";
|
|
46
|
-
export declare function reviewPrompt(kind: 'memory' | 'skill' | 'combined', channel?: 'agent' | 'plan'): string;
|
|
38
|
+
export declare const SKILLS_GUIDANCE = "Skills guidance:\n\u2022 After a complex task (5+ tool calls), a tricky fix, or a non-trivial workflow, decide whether an existing owner should be updated or a new class-level skill is needed; search the library before creating.\n\u2022 When using a skill and finding it outdated, incomplete, or wrong, patch it immediately with skill_manage (action='patch') \u2014 don't wait to be asked. Skills that aren't maintained become liabilities.";
|
|
39
|
+
export type ReviewSurface = 'inject' | 'aux';
|
|
40
|
+
export declare function reviewPrompt(kind: 'memory' | 'skill' | 'combined', surface?: ReviewSurface): string;
|
|
47
41
|
export interface PromptBundle {
|
|
48
42
|
id: string;
|
|
49
43
|
version: number;
|
package/lib/types/prompts.js
CHANGED
|
@@ -26,114 +26,79 @@ import { createHash } from 'node:crypto';
|
|
|
26
26
|
* changes semantically: the bundle digest is the fail-closed signal for
|
|
27
27
|
* review workers, so a stale id across deployments must be distinguishable.
|
|
28
28
|
*/
|
|
29
|
-
export const PROMPT_BUNDLE_VERSION =
|
|
29
|
+
export const PROMPT_BUNDLE_VERSION = 27;
|
|
30
30
|
// 0.3.16 (S1.12, T-5): the id is DERIVED from the version — a one-number bump
|
|
31
31
|
// can no longer drift the two apart.
|
|
32
32
|
export const PROMPT_BUNDLE_ID = `dsh-evolution@${PROMPT_BUNDLE_VERSION}`;
|
|
33
|
-
|
|
34
|
-
Review the conversation above and consider saving to memory if appropriate.
|
|
33
|
+
const MEMORY_REVIEW_BODY = `Focus on durable facts that change future collaboration:
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
2. Has the user expressed expectations about how you should behave, their work style, or ways they want you to operate?
|
|
35
|
+
1. The user: role, context, stable preferences, constraints, and facts they would want remembered.
|
|
36
|
+
2. The work: how deliverables should be judged across future tasks — quality bar, format, sources/tools, and collaboration conventions.
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
Review the conversation above and update the skill library.
|
|
38
|
+
Do not store task progress or reusable procedures; procedures belong in skills.
|
|
39
|
+
Prefer merging or replacing an existing entry over adding a near-duplicate.
|
|
40
|
+
Keep the entry compact.`;
|
|
41
|
+
const SKILL_REVIEW_BODY = `Review the conversation above and update the skill library.
|
|
44
42
|
|
|
45
|
-
|
|
43
|
+
Update only when the session contains a durable lesson that changes how this class of task should be done. A precise no-op is a valid outcome.
|
|
46
44
|
|
|
47
|
-
|
|
45
|
+
Target: a class-level skill with a compact SKILL.md and a references/ directory for session-specific detail.
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
• User corrected your style, tone, format, legibility, or verbosity. Frustration signals like 'stop doing X', 'this is too verbose', 'don't format like this', 'why are you explaining', 'just give me the answer', 'you always do Y and I hate it', or an explicit 'remember this' are FIRST-CLASS skill signals, not just memory signals. Update the relevant skill(s) to embed the preference so the next session starts already knowing.
|
|
51
|
-
• User corrected your workflow, approach, or sequence of steps. Encode the correction as a pitfall or explicit step in the skill that governs that class of task.
|
|
52
|
-
• Non-trivial technique, fix, workaround, debugging path, or tool-usage pattern emerged that a future session would benefit from. Capture it.
|
|
53
|
-
• A skill that got loaded or consulted this session turned out to be wrong, missing a step, or outdated. Patch it NOW.
|
|
47
|
+
A skill body contains reusable decisions: when to use it, what to do, and how to verify. Session-specific narratives, dated logs, one-off evidence, and version details that do not change the decision belong in references/. Support files: references/ for detail or knowledge banks; templates/ for starter files; scripts/ for re-runnable checks and generators. When you add a support file, add the SKILL.md line that points to it; a file no pointer reaches is invisible next session. A skill must use only tools, commands, and paths available in this session. If one is unavailable, replace it only with a verified local equivalent; otherwise leave it unchanged and report the limitation. Do not invent command names.
|
|
54
48
|
|
|
55
|
-
|
|
49
|
+
Signals include:
|
|
50
|
+
- The user corrected style, tone, format, verbosity, workflow, or approach.
|
|
51
|
+
- A reusable technique, durable interface or environment fact, repair procedure, or debugging path emerged that will recur.
|
|
52
|
+
- A loaded skill proved wrong, incomplete, or outdated.
|
|
56
53
|
|
|
57
|
-
|
|
58
|
-
1. UPDATE A CURRENTLY-LOADED SKILL. Look back through the conversation for skills the user loaded or you read. If any of them covers the territory of the new learning, PATCH that one first. It is the skill that was in play, so it's the right one to extend.
|
|
59
|
-
2. UPDATE AN EXISTING UMBRELLA. If no loaded skill fits but an existing class-level skill does, patch it. Add a subsection, a pitfall, or broaden a trigger.
|
|
60
|
-
3. ADD A SUPPORT FILE under an existing umbrella. Skills can be packaged with three kinds of support files — use the right directory per kind:
|
|
61
|
-
• references/<topic>.md — session-specific detail (error transcripts, reproduction recipes, provider quirks) AND condensed knowledge banks: quoted research, API docs, external authoritative excerpts, or domain notes you found while working on the problem. Write it concise and for the value of the task, not as a full mirror of upstream docs.
|
|
62
|
-
• templates/<name>.<ext> — starter files meant to be copied and modified (boilerplate configs, scaffolding, a known-good example the agent can reproduce with modifications).
|
|
63
|
-
• scripts/<name>.<ext> — statically re-runnable actions the skill can invoke directly (verification scripts, fixture generators, deterministic probes, anything the agent should run rather than hand-type each time).
|
|
64
|
-
Add support files via skill_manage action=write_file with file_path starting 'references/', 'templates/', or 'scripts/'. The umbrella's SKILL.md should gain a one-line pointer to any new support file so future agents know it exists.
|
|
65
|
-
4. RESTRUCTURE a loaded skill whose body grew log-like — rc/sha/date-dense sections, session-detail spirals, or a fat body with no support files. Use skill_manage action=restructure with restructure: [{"heading": "<the exact ## heading text>", "to_file": "references/<topic>.md"}] — the ENTIRE ## section (from that heading to the next heading) moves into the support file and its position becomes a pointer line. The skill's name and directory never change. Only propose headings that exist verbatim in the body; never invent one, and never restructure a healthy small skill.
|
|
66
|
-
5. CREATE A NEW CLASS-LEVEL UMBRELLA SKILL only when no existing class-level skill covers the class and no existing umbrella can absorb the learning. The name MUST be at the class level. The name MUST NOT be a specific PR number, error string, feature codename, library-alone name, or 'fix-X / debug-Y / audit-Z-today' session artifact. If the proposed name only makes sense for today's task, it's wrong — fall back to (1), (2), or (3).
|
|
54
|
+
Any one of these warrants a decision; it does not by itself require a write.
|
|
67
55
|
|
|
68
|
-
|
|
56
|
+
Read before writing. Update only skills whose body you have read in this review pass. A new skill has no body to read; before choosing, search the existing library with the available skill tools.
|
|
69
57
|
|
|
70
|
-
|
|
58
|
+
Update when an existing class-level owner shares the lesson's trigger and audience.
|
|
71
59
|
|
|
72
|
-
|
|
73
|
-
• PATTERN (reusable — symptom → mechanism → fix → verification, still valuable next session) belongs in the SKILL.md body.
|
|
74
|
-
• LOG (one-off — commit SHAs, npm/profile states, what this release changed, this session's process narrative) belongs in a references/ file, never the body. Body density IS reuse rate. Keep new entries tight: a pattern fits in 2-8 physical lines; prefer changing the current-state pointer over appending history.
|
|
60
|
+
Create a new class-level skill when the lesson has a distinct trigger or audience and would make that owner heterogeneous. A class-level skill can serve at least two different future events; if the lesson serves only this incident, fold it into an existing owner's body or support file.
|
|
75
61
|
|
|
76
|
-
|
|
77
|
-
• Bundled skills (shipped with the platform).
|
|
78
|
-
• Hub-installed skills (installed from a hub).
|
|
79
|
-
Pinned skills are read-only to THIS background review pass — the pinned write guard refuses background changes, so this pass may not update them. They also cannot be archived by any writer (the foreground included): remove the .pinned marker first. Foreground and delegated-subagent update/patch writes to pinned skills remain allowed.
|
|
80
|
-
If the only skills that need updating are protected, say 'Nothing to save.' and stop.
|
|
62
|
+
When only session-specific detail changes, add a support file under the owner.
|
|
81
63
|
|
|
82
|
-
|
|
83
|
-
• Environment-dependent failures: missing binaries, fresh-install errors, post-migration path mismatches, 'command not found', unconfigured credentials, uninstalled packages. The user can fix these — they are not durable rules.
|
|
84
|
-
• Negative claims about tools or features ('browser tools do not work', 'X tool is broken', 'cannot use Y'). These harden into refusals the agent cites against itself for months after the actual problem was fixed.
|
|
85
|
-
• Session-specific transient errors that resolved before the conversation ended. If retrying worked, the lesson is the retry pattern, not the original failure.
|
|
86
|
-
• One-off task narratives. A user asking 'summarize today's market' or 'analyze this PR' is not a class of work that warrants a skill.
|
|
64
|
+
Name a new skill for its class, not for a PR number, error string, feature codename, or session artifact.
|
|
87
65
|
|
|
88
|
-
|
|
66
|
+
A user correction about how a class of task should be done belongs in the skill that governs that task.
|
|
89
67
|
|
|
90
|
-
|
|
91
|
-
export const COMBINED_REVIEW_PROMPT = `[Auto-review]
|
|
92
|
-
Review the conversation above and update two things:
|
|
68
|
+
Leave consolidation to the curator; focus this pass on the smallest edit that carries the session's lesson.
|
|
93
69
|
|
|
94
|
-
|
|
70
|
+
A one-off environment failure, transient error, or "tool X is broken" claim is not a lesson. Capture only a reproducible setup or repair procedure that will recur.
|
|
95
71
|
|
|
96
|
-
|
|
72
|
+
Write skills only through skill_manage. If its guard refuses a write, report the refusal and do not work around it. Respect protected skills (bundled, hub-installed, pinned) and their guards. If a lesson can only live in a protected skill, report it and leave that lesson unapplied; continue with any other lessons. Do not create a near-duplicate to hold it.`;
|
|
73
|
+
const COMBINED_REVIEW_BODY = `[Auto-review]
|
|
74
|
+
Apply both review passes below.
|
|
97
75
|
|
|
98
|
-
|
|
76
|
+
## Memory
|
|
77
|
+
${MEMORY_REVIEW_BODY}
|
|
78
|
+
After the memory pass, continue to the Skills pass. If nothing is worth saving, say "Nothing to save (memory)."
|
|
99
79
|
|
|
100
|
-
|
|
80
|
+
## Skills
|
|
81
|
+
${SKILL_REVIEW_BODY}`;
|
|
82
|
+
export const INJECT_MEMORY_REVIEW_PROMPT = `[Auto-review — Memory]
|
|
83
|
+
${MEMORY_REVIEW_BODY}
|
|
101
84
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
• A skill that was loaded or consulted turned out wrong, missing, or outdated — patch it now.
|
|
85
|
+
If nothing is worth saving, say "Nothing to save." and stop.`;
|
|
86
|
+
export const INJECT_SKILL_REVIEW_PROMPT = `[Auto-review — Skills]
|
|
87
|
+
${SKILL_REVIEW_BODY}
|
|
106
88
|
|
|
107
|
-
|
|
89
|
+
If nothing durable exists, say "Nothing to save." and stop.`;
|
|
90
|
+
export const INJECT_COMBINED_REVIEW_PROMPT = `${COMBINED_REVIEW_BODY}
|
|
108
91
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
3. ADD A SUPPORT FILE under an existing umbrella via skill_manage action=write_file. Three kinds: references/<topic>.md for session-specific detail OR condensed knowledge banks (quoted research, API docs excerpts, domain notes) written concise and task-focused; templates/<name>.<ext> for starter files meant to be copied and modified; scripts/<name>.<ext> for statically re-runnable actions (verification, fixture generators, probes). Add a one-line pointer in SKILL.md so future agents find them.
|
|
113
|
-
4. RESTRUCTURE a loaded skill whose body grew log-like (rc/sha/date-dense sections, session-detail spirals, fat body with no support files) via skill_manage action=restructure with restructure: [{"heading": "<the exact ## heading text>", "to_file": "references/<topic>.md"}] — the ENTIRE ## section moves into the support file and its position becomes a pointer line; the skill's name and directory never change. Only propose headings that exist verbatim in the body.
|
|
114
|
-
5. CREATE A NEW CLASS-LEVEL UMBRELLA only when no existing class-level skill covers the class and no existing umbrella can absorb the learning. Name at the class level — NOT a PR number, error string, codename, library-alone name, or 'fix-X / debug-Y' session artifact. If the name only fits today's task, fall back to (1), (2), or (3).
|
|
92
|
+
If nothing durable exists in either pass, say "Nothing to save." and stop.`;
|
|
93
|
+
export const INJECT_COMPLETION_SKILL_REVIEW_PROMPT = `[Auto-review — Skills · task complete]
|
|
94
|
+
${SKILL_REVIEW_BODY}
|
|
115
95
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Protected skills (DO NOT edit these):
|
|
123
|
-
• Bundled skills (shipped with the platform).
|
|
124
|
-
• Hub-installed skills (installed from a hub).
|
|
125
|
-
Pinned skills are read-only to THIS background review pass — the pinned write guard refuses background changes, so this pass may not update them. They also cannot be archived by any writer (the foreground included): remove the .pinned marker first. Foreground and delegated-subagent update/patch writes to pinned skills remain allowed.
|
|
126
|
-
If the only skills that need updating are protected, say 'Nothing to save.' and stop.
|
|
127
|
-
|
|
128
|
-
Do NOT capture as skills (these become persistent self-imposed constraints that bite you later when the environment changes):
|
|
129
|
-
• Environment-dependent failures: missing binaries, fresh-install errors, post-migration path mismatches, 'command not found', unconfigured credentials, uninstalled packages. The user can fix these — they are not durable rules.
|
|
130
|
-
• Negative claims about tools or features ('browser tools do not work', 'X tool is broken', 'cannot use Y'). These harden into refusals the agent cites against itself for months after the actual problem was fixed.
|
|
131
|
-
• Session-specific transient errors that resolved before the conversation ended. If retrying worked, the lesson is the retry pattern, not the original failure.
|
|
132
|
-
• One-off task narratives. A user asking 'summarize today's market' or 'analyze this PR' is not a class of work that warrants a skill.
|
|
133
|
-
|
|
134
|
-
If a tool failed because of setup state, capture the FIX (install command, config step, env var to set) under an existing setup or troubleshooting skill — never 'this tool does not work' as a standalone constraint.
|
|
135
|
-
|
|
136
|
-
Act on whichever of the two dimensions has real signal. If genuinely nothing stands out on either, say 'Nothing to save.' and stop — but don't reach for that conclusion as a default.`;
|
|
96
|
+
If nothing durable exists, say "Nothing to save." and stop.`;
|
|
97
|
+
// Inject aliases kept for the foreground delivery path and existing imports.
|
|
98
|
+
export const MEMORY_REVIEW_PROMPT = INJECT_MEMORY_REVIEW_PROMPT;
|
|
99
|
+
export const SKILL_REVIEW_PROMPT = INJECT_SKILL_REVIEW_PROMPT;
|
|
100
|
+
export const COMBINED_REVIEW_PROMPT = INJECT_COMBINED_REVIEW_PROMPT;
|
|
101
|
+
export const COMPLETION_SKILL_REVIEW_PROMPT = INJECT_COMPLETION_SKILL_REVIEW_PROMPT;
|
|
137
102
|
export const CURATOR_PROMPT = `You are the skill curator. Maintain a healthy, class-level skill library, not a flat pile of narrow one-session skills.
|
|
138
103
|
|
|
139
104
|
This is an UMBRELLA-BUILDING consolidation pass, not a passive audit and not a duplicate-finder.
|
|
@@ -197,56 +162,6 @@ This is a PREVIEW pass. Follow every instruction above EXCEPT:
|
|
|
197
162
|
Your output IS the deliverable: produce the exact same human-readable summary and YAML block you would on a live run, describing the actions you WOULD take. A reviewer will decide whether to approve a live run.
|
|
198
163
|
|
|
199
164
|
If you accidentally take a mutating action, say so explicitly in the summary.`;
|
|
200
|
-
export const COMPLETION_SKILL_REVIEW_PROMPT = `[Auto-review — Skills · task complete]
|
|
201
|
-
Review the conversation above and update the skill library. Be ACTIVE — inspect the session and the existing library thoroughly, and prefer a small, precise update when the session teaches something durable. Activity is not a quota: a precise no-op after checking is better than a vague or forced entry.
|
|
202
|
-
|
|
203
|
-
Target shape of the library: CLASS-LEVEL skills, each with a rich SKILL.md and a \`references/\` directory for session-specific detail. Not a long flat list of narrow one-session-one-skill entries. This shapes HOW you update, not WHETHER you update.
|
|
204
|
-
|
|
205
|
-
A skill body is a reusable decision rule (when / do / check); dates, versions, incident narratives, and one-off evidence belong in references when they would otherwise dominate the body.
|
|
206
|
-
|
|
207
|
-
Signals to look for (any one of these warrants action):
|
|
208
|
-
• User corrected your style, tone, format, legibility, or verbosity. Frustration signals like 'stop doing X', 'this is too verbose', 'don't format like this', 'why are you explaining', 'just give me the answer', 'you always do Y and I hate it', or an explicit 'remember this' are FIRST-CLASS skill signals, not just memory signals. Update the relevant skill(s) to embed the preference so the next session starts already knowing.
|
|
209
|
-
• User corrected your workflow, approach, or sequence of steps. Encode the correction as a pitfall or explicit step in the skill that governs that class of task.
|
|
210
|
-
• Non-trivial technique, fix, workaround, debugging path, or tool-usage pattern emerged that a future session would benefit from. Capture it.
|
|
211
|
-
• A skill that got loaded or consulted this session turned out to be wrong, missing a step, or outdated. Patch it NOW.
|
|
212
|
-
|
|
213
|
-
Preference order — prefer the earliest action that fits, but do pick one when a signal above fired:
|
|
214
|
-
1. UPDATE A CURRENTLY-LOADED SKILL. Look back through the conversation for skills the user loaded via /skill-name or you read via skill. If any of them covers the territory of the new learning, PATCH that one first. It is the skill that was in play, so it's the right one to extend.
|
|
215
|
-
2. UPDATE AN EXISTING UMBRELLA (via the skill catalog + skill). If no loaded skill fits but an existing class-level skill does, patch it. Add a subsection, a pitfall, or broaden a trigger.
|
|
216
|
-
3. ADD A SUPPORT FILE under an existing umbrella. Skills can be packaged with three kinds of support files — use the right directory per kind:
|
|
217
|
-
• \`references/<topic>.md\` — session-specific detail (error transcripts, reproduction recipes, provider quirks) AND condensed knowledge banks: quoted research, API docs, external authoritative excerpts, or domain notes you found while working on the problem. Write it concise and for the value of the task, not as a full mirror of upstream docs.
|
|
218
|
-
• \`templates/<name>.<ext>\` — starter files meant to be copied and modified (boilerplate configs, scaffolding, a known-good example the agent can \`reproduce with modifications\`).
|
|
219
|
-
• \`scripts/<name>.<ext>\` — statically re-runnable actions the skill can invoke directly (verification scripts, fixture generators, deterministic probes, anything the agent should run rather than hand-type each time).
|
|
220
|
-
Add support files via skill_manage action=write_file with file_path starting 'references/', 'templates/', or 'scripts/'. The umbrella's SKILL.md should gain a one-line pointer to any new support file so future agents know it exists.
|
|
221
|
-
4. CREATE A NEW CLASS-LEVEL UMBRELLA SKILL only when no existing class-level skill covers the class and no existing umbrella can absorb the learning. The name MUST be at the class level. The name MUST NOT be a specific PR number, error string, feature codename, library-alone name, or 'fix-X / debug-Y / audit-Z-today' session artifact. If the proposed name only makes sense for today's task, it's wrong — fall back to (1), (2), or (3).
|
|
222
|
-
|
|
223
|
-
User-preference embedding (important): when the user expressed a style/format/workflow preference, the update belongs in the SKILL.md body, not just in memory. Memory captures 'who the user is and what the current situation and state of your operations are'; skills capture 'how to do this class of task for this user'. When they complain about how you handled a task, the skill that governs that task needs to carry the lesson.
|
|
224
|
-
|
|
225
|
-
If you notice two existing skills that overlap, note it in your reply — the background curator handles consolidation at scale.
|
|
226
|
-
|
|
227
|
-
Protected skills (DO NOT edit these):
|
|
228
|
-
• Bundled skills (shipped with the platform).
|
|
229
|
-
• Hub-installed skills (installed via the platform hub).
|
|
230
|
-
Pinned skills (marked via skill_manage pin) are read-only to THIS background review pass — the pinned write guard refuses background changes, so this pass may not update them. They also cannot be archived by any writer (the foreground included): remove the .pinned marker first. Foreground and delegated-subagent update/patch writes to pinned skills remain allowed.
|
|
231
|
-
If the only skills that need updating are protected, say
|
|
232
|
-
'Nothing to save.' and stop.
|
|
233
|
-
|
|
234
|
-
Do NOT capture (these become persistent self-imposed constraints that bite you later when the environment changes):
|
|
235
|
-
• Environment-dependent failures: missing binaries, fresh-install errors, post-migration path mismatches, 'command not found', unconfigured credentials, uninstalled packages. The user can fix these — they are not durable rules.
|
|
236
|
-
• Negative claims about tools or features ('browser tools do not work', 'X tool is broken', 'cannot use Y from execute_code'). These harden into refusals the agent cites against itself for months after the actual problem was fixed.
|
|
237
|
-
• Session-specific transient errors that resolved before the conversation ended. If retrying worked, the lesson is the retry pattern, not the original failure.
|
|
238
|
-
• One-off task narratives. A user asking 'summarize today's market' or 'analyze this PR' is not a class of work that warrants a skill.
|
|
239
|
-
|
|
240
|
-
If a tool failed because of setup state, capture the FIX (install command, config step, env var to set) under an existing setup or troubleshooting skill — never 'this tool does not work' as a standalone constraint.
|
|
241
|
-
|
|
242
|
-
'Nothing to save.' is a real option but should NOT be the default. If the session ran smoothly with no corrections and produced no new technique, state what you checked and stop. Otherwise, act.`;
|
|
243
|
-
/**
|
|
244
|
-
* Maintenance-subagent persona (design 011 §6). Constants pin the persona
|
|
245
|
-
* with `{signal:id}` placeholders; the renderer substitutes names from the
|
|
246
|
-
* drift-signals module (single vocabulary). The model-facing contract is the
|
|
247
|
-
* persona + the mechanical-facts block; the signature head lets the model
|
|
248
|
-
* compare the two heads (011 mismatch protocol).
|
|
249
|
-
*/
|
|
250
165
|
export const MAINTAIN_PROMPT = `<<<MAINTAIN_PROMPT v={bundle_version} sig={joint_signature}>>>
|
|
251
166
|
|
|
252
167
|
## 角色
|
|
@@ -340,27 +255,16 @@ export const MAINTAIN_OUTPUT_INSTRUCTION = '按模板契约输出 JSON 维护计
|
|
|
340
255
|
* model to save/repair skills on its own initiative.
|
|
341
256
|
*/
|
|
342
257
|
export const SKILLS_GUIDANCE = `Skills guidance:
|
|
343
|
-
• After
|
|
258
|
+
• After a complex task (5+ tool calls), a tricky fix, or a non-trivial workflow, decide whether an existing owner should be updated or a new class-level skill is needed; search the library before creating.
|
|
344
259
|
• 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.`;
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
/** Subagent-channel variant: same review policy, channel-limited deliverable (M-2). */
|
|
349
|
-
export const SKILL_REVIEW_PLAN_PROMPT = `${SKILL_REVIEW_PROMPT}${PLAN_CHANNEL_NOTE}`;
|
|
350
|
-
/** Subagent-channel variant of the combined review (M-2). */
|
|
351
|
-
export const COMBINED_REVIEW_PLAN_PROMPT = `${COMBINED_REVIEW_PROMPT}${PLAN_CHANNEL_NOTE}`;
|
|
352
|
-
export function reviewPrompt(kind, channel = 'agent') {
|
|
353
|
-
// 0.3.16 (E-48): kind==='memory' + channel==='plan' used to fall through to
|
|
354
|
-
// MEMORY_REVIEW_PROMPT (the agent-channel prompt whose guidance tells the
|
|
355
|
-
// model to use the memory TOOL) while the plan channel has no memory tool —
|
|
356
|
-
// a silent wrong-channel contract. The plan channel is never memory-only.
|
|
357
|
-
if (channel === 'plan')
|
|
358
|
-
return kind === 'skill' ? SKILL_REVIEW_PLAN_PROMPT : COMBINED_REVIEW_PLAN_PROMPT;
|
|
260
|
+
export function reviewPrompt(kind, surface = 'inject') {
|
|
261
|
+
if (surface === 'aux')
|
|
262
|
+
return kind === 'memory' ? INJECT_MEMORY_REVIEW_PROMPT : INJECT_COMBINED_REVIEW_PROMPT;
|
|
359
263
|
if (kind === 'memory')
|
|
360
|
-
return
|
|
264
|
+
return INJECT_MEMORY_REVIEW_PROMPT;
|
|
361
265
|
if (kind === 'skill')
|
|
362
|
-
return
|
|
363
|
-
return
|
|
266
|
+
return INJECT_SKILL_REVIEW_PROMPT;
|
|
267
|
+
return INJECT_COMBINED_REVIEW_PROMPT;
|
|
364
268
|
}
|
|
365
269
|
function sha256(text) {
|
|
366
270
|
return createHash('sha256').update(text).digest('hex');
|
|
@@ -379,18 +283,16 @@ function createPromptBundle(prompts) {
|
|
|
379
283
|
});
|
|
380
284
|
}
|
|
381
285
|
export const PROMPT_BUNDLE = createPromptBundle({
|
|
382
|
-
memory:
|
|
383
|
-
skill:
|
|
384
|
-
combined:
|
|
385
|
-
skillPlan: SKILL_REVIEW_PLAN_PROMPT,
|
|
386
|
-
combinedPlan: COMBINED_REVIEW_PLAN_PROMPT,
|
|
286
|
+
memory: INJECT_MEMORY_REVIEW_PROMPT,
|
|
287
|
+
skill: INJECT_SKILL_REVIEW_PROMPT,
|
|
288
|
+
combined: INJECT_COMBINED_REVIEW_PROMPT,
|
|
387
289
|
curator: CURATOR_PROMPT,
|
|
388
290
|
// v46 S1.12b (finding T3-07): the curator's dry-run banner rides the bundle too. It is prepended
|
|
389
291
|
// to the curator prompt at run time and used to live outside the digest, so a drifted banner was
|
|
390
292
|
// model-visible text the integrity check could not see. The bundle digest changes with this entry
|
|
391
293
|
// (the intended fail-closed signal), and PROMPT_BUNDLE_VERSION moves 21 -> 22 with it.
|
|
392
294
|
curatorDryRun: CURATOR_DRY_RUN_BANNER,
|
|
393
|
-
completion:
|
|
295
|
+
completion: INJECT_COMPLETION_SKILL_REVIEW_PROMPT,
|
|
394
296
|
maintain: MAINTAIN_PROMPT,
|
|
395
297
|
// F-16: new entry — the maintain subagent's output instruction
|
|
396
298
|
// (see MAINTAIN_OUTPUT_INSTRUCTION). Digest changes with this entry.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-core",
|
|
3
3
|
"description": "Shared stores, prompts, signals and lifecycle logic for the dsh-evolution plugin family (community build)",
|
|
4
|
-
"version": "0.39.
|
|
4
|
+
"version": "0.39.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"yaml": "^2.4.2",
|
|
58
58
|
"zod": "^4.4.3",
|
|
59
59
|
"js-yaml": "^4.1.0",
|
|
60
|
-
"@lmzhen/dsh-evolution-contract": "^0.39.
|
|
60
|
+
"@lmzhen/dsh-evolution-contract": "^0.39.2"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@deepseek-ai/cordis": "^4.0.5",
|