@lmzhen/dsh-evolution-core 0.50.0 → 0.51.0
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/composition/index.js +3 -3
- package/lib/{composition-DA8XPfMc.js → composition-CtNbVHq3.js} +1 -1
- package/lib/{ensure-Bx4ksgJk.js → ensure-BLmEW0Ju.js} +10 -2
- package/lib/{extract-plan-Bru3c9ec.js → extract-plan-D6o__2Kf.js} +1 -1
- package/lib/extract.js +3 -3
- package/lib/index.js +65 -17
- package/lib/{quality-WAU6YatF.js → quality-DpAS0rd9.js} +1 -1
- package/lib/{skill-health-Bl-MdXZ4.js → skill-health-BQCM4N8z.js} +12 -2
- package/lib/{skill-history-CxrDE3Rb.js → skill-history-CZp8vhyL.js} +46 -2
- package/lib/skills.js +136 -19
- package/lib/subagent/index.js +1 -1
- package/lib/types/composition/preset-ids.d.ts +2 -1
- package/lib/types/composition/preset-ids.js +7 -1
- package/lib/types/events.d.ts +3 -0
- package/lib/types/platform-services.js +1 -0
- package/lib/types/prompts.d.ts +9 -8
- package/lib/types/prompts.js +20 -1
- package/lib/types/review-context.d.ts +8 -0
- package/lib/types/review-context.js +11 -0
- package/lib/types/run-registry.d.ts +2 -1
- package/lib/types/run-registry.js +37 -7
- package/lib/types/section-selection.js +5 -0
- package/lib/types/skill-history.d.ts +29 -3
- package/lib/types/skill-history.js +30 -0
- package/lib/types/skill-store.d.ts +32 -4
- package/lib/types/skill-store.js +109 -15
- package/lib/types/subagent/types.d.ts +1 -1
- package/lib/types/write-gates.js +11 -1
- package/lib/{usage-DdjIBAkm.js → usage-B5a90TKv.js} +5 -0
- package/lib/write.js +1 -1
- package/package.json +1 -1
package/lib/skills.js
CHANGED
|
@@ -2,12 +2,12 @@ import { _ as probeMtime, b as probeText, c as transactIo, d as isAbsent, g as p
|
|
|
2
2
|
import { n as mutationLockFrom } from "./mutation-authority-DQfpXs1O.js";
|
|
3
3
|
import { o as resolveCitations } from "./citations-CZKTUGQF.js";
|
|
4
4
|
import { G as SKILL_NAME_RE, H as PROTECTED_BUILTIN_SKILLS, K as SUPPORT_DIRS, a as DEFAULT_SUPPORT_FILE_CHAR_POLICY, i as DEFAULT_SKILL_LIMITS, n as DEFAULT_CITATION_POLICY, o as POLICY_STAGE_DEFAULTS, r as DEFAULT_REFERENCE_REWRITE_POLICY, s as policyStageLimits, t as DEFAULT_ARCHIVE_RETENTION_POLICY, u as CONTENT_SPLIT_HINT } from "./limits-C9jfvxBl.js";
|
|
5
|
-
import {
|
|
6
|
-
import { A as authoringFeedback, B as validateFrontmatter, E as selectSections, F as normalizeFrontmatter, G as describeReferenceRewrite, I as parseFrontmatter, K as planReferenceRewrite, L as relatedSkillNames, M as exceedsContentLimit, N as frontmatterBlock, P as frontmatterCatalogInvalid, R as shrinksOverLimit, S as suppressedFile, U as supportRefs, V as yamlPlainScalarNeedsQuotes, W as applyReferenceRewrite, f as getRecord, g as loadUsage, j as ensureSkillFrontmatter, q as planRehoming, v as mutateUsage, w as usageFile, z as skillMdOnDisk } from "./usage-
|
|
5
|
+
import { C as trimPatternBoundaries, I as RULES, J as filterUnreadSkillOps, L as diffFindings, O as appendEvolutionEvent, R as lintSkill, S as fuzzyPatch, X as sessionReadSkillNames, Y as isUnreadWrite, Z as sessionReadSupportFiles, a as lintBody, et as authorityFrom, g as scanContentThreats, i as assessStructureHealth, k as eventsFile, n as HEALTH_STAMP_RE, o as currentReviewContext, q as READ_REQUIRED_ACTIONS, r as MIN_STAMP_BODY_CHARS, t as DEFAULT_HEALTH_THRESHOLDS, u as isReviewChannelSession, y as makeSerialQueue } from "./skill-health-BQCM4N8z.js";
|
|
6
|
+
import { A as authoringFeedback, B as validateFrontmatter, E as selectSections, F as normalizeFrontmatter, G as describeReferenceRewrite, I as parseFrontmatter, K as planReferenceRewrite, L as relatedSkillNames, M as exceedsContentLimit, N as frontmatterBlock, P as frontmatterCatalogInvalid, R as shrinksOverLimit, S as suppressedFile, U as supportRefs, V as yamlPlainScalarNeedsQuotes, W as applyReferenceRewrite, f as getRecord, g as loadUsage, j as ensureSkillFrontmatter, q as planRehoming, v as mutateUsage, w as usageFile, z as skillMdOnDisk } from "./usage-B5a90TKv.js";
|
|
7
7
|
import { n as evolutionRoot } from "./state-store-Jpa-iYIZ.js";
|
|
8
8
|
import { i as loadMutations, o as recordMutation, r as contentHash } from "./mutations-DQXddSJd.js";
|
|
9
|
-
import { C as
|
|
10
|
-
import { n as projectExtractBodies } from "./extract-plan-
|
|
9
|
+
import { A as pruneTreeChangeUnits, C as partitionVersions, D as textDiffFacts, E as summaryChars, M as unitSnapshotPort, O as versionActionKind, S as parseHistoryIndex, T as recordVersions, _ as loadVersionContent, a as RETENTION_FEEDBACK_KEEP_RATIO, b as normalizeChangeSummary, c as TEXT_DIFF_MAX_LINES, d as contentRetentionFeedback, f as elapsedSince, g as latestVersionAt, h as historyRoot, i as HISTORY_INDEX_VERSION, j as unitJournalPort, k as versionTarget, l as blobPath, m as historyIndexFile, n as DEFAULT_SKILL_WRITE_SUMMARY_CHARS, nt as fileMutationLock, o as RETENTION_FEEDBACK_MIN_CHARS, p as entryTarget, r as HISTORY_DIR, s as TEXT_DIFF_MAX_CHARS, t as BASELINE_ACTION, tt as MutationUnit, u as clipChangeSummary, v as loadVersions, w as readHistoryIndex, x as orderVersions, y as nextHistoryIndex } from "./skill-history-CZp8vhyL.js";
|
|
10
|
+
import { n as projectExtractBodies } from "./extract-plan-D6o__2Kf.js";
|
|
11
11
|
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
12
12
|
//#region lib/types/skill-row-cells.js
|
|
13
13
|
/**
|
|
@@ -666,7 +666,11 @@ function validateSupportPath(filePath) {
|
|
|
666
666
|
return null;
|
|
667
667
|
}
|
|
668
668
|
function planRestructureSections(body, moves) {
|
|
669
|
-
const selection = selectSections(body, moves.map((move) => ({
|
|
669
|
+
const selection = selectSections(body, moves.map((move) => ({
|
|
670
|
+
heading: move.heading,
|
|
671
|
+
...move.start === void 0 ? {} : { start: move.start },
|
|
672
|
+
...move.end === void 0 ? {} : { end: move.end }
|
|
673
|
+
})));
|
|
670
674
|
if (!selection.ok) return { error: selection.message };
|
|
671
675
|
const lines = body.split("\n");
|
|
672
676
|
const spans = selection.sections.map((section) => {
|
|
@@ -794,7 +798,9 @@ var SkillLibrary = class {
|
|
|
794
798
|
...provenance.get(op.target) === void 0 ? {} : { provenance: provenance.get(op.target) }
|
|
795
799
|
});
|
|
796
800
|
}
|
|
801
|
+
const runId = currentReviewContext()?.runId;
|
|
797
802
|
return {
|
|
803
|
+
...runId === void 0 ? {} : { runId },
|
|
798
804
|
moves,
|
|
799
805
|
sources: roots.map((skill) => ({ skill }))
|
|
800
806
|
};
|
|
@@ -1353,6 +1359,18 @@ var SkillLibrary = class {
|
|
|
1353
1359
|
console.warn("skill-store: hard-cap event not recorded for \"" + name + "\": " + (error instanceof Error ? error.message : String(error)));
|
|
1354
1360
|
}
|
|
1355
1361
|
}
|
|
1362
|
+
/** Host fallback for the user-facing change summary when the writer did not supply one. */
|
|
1363
|
+
hostChangeSummary(action, before, after, path, machine) {
|
|
1364
|
+
const target = path ?? "SKILL.md";
|
|
1365
|
+
let text = machine;
|
|
1366
|
+
if (action === "update" || action === "edit") text = `updated ${target} (${before?.length ?? 0} → ${after?.length ?? 0})`;
|
|
1367
|
+
else if (action === "create") text = `created ${target} (${after?.length ?? 0})`;
|
|
1368
|
+
else if (action === "patch") text = machine.trim() === "" || machine === "patched" ? `patched ${target}` : machine;
|
|
1369
|
+
return {
|
|
1370
|
+
text: clipChangeSummary(text, 50),
|
|
1371
|
+
source: "host"
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1356
1374
|
/** Best-effort audit trail entry; never blocks the mutation.
|
|
1357
1375
|
*
|
|
1358
1376
|
* Two independent best-effort writes run here, because either one failing must not cost the
|
|
@@ -1360,9 +1378,16 @@ var SkillLibrary = class {
|
|
|
1360
1378
|
* mutation ledger that points at it. The history failure is not silent — a deployment whose
|
|
1361
1379
|
* history stopped growing is a degradation worth seeing once (the ledger keeps hashes either
|
|
1362
1380
|
* way). */
|
|
1363
|
-
async audit(skillName, action, before, after, summary, path, unitId, unitHead, origin, fenceHeld = false) {
|
|
1381
|
+
async audit(skillName, action, before, after, summary, path, unitId, unitHead, origin, fenceHeld = false, change) {
|
|
1364
1382
|
const fence = fenceHeld ? void 0 : this.fence;
|
|
1365
1383
|
const at = (/* @__PURE__ */ new Date()).toISOString();
|
|
1384
|
+
const finalSummary = change === void 0 ? this.hostChangeSummary(action, before, after, path, summary) : (() => {
|
|
1385
|
+
const normalized = normalizeChangeSummary(change.text, 50);
|
|
1386
|
+
return normalized.ok ? {
|
|
1387
|
+
text: normalized.text,
|
|
1388
|
+
source: change.source
|
|
1389
|
+
} : this.hostChangeSummary(action, before, after, path, summary);
|
|
1390
|
+
})();
|
|
1366
1391
|
let versions = null;
|
|
1367
1392
|
try {
|
|
1368
1393
|
const keep = this.limits.versionKeep ?? 20;
|
|
@@ -1374,7 +1399,9 @@ var SkillLibrary = class {
|
|
|
1374
1399
|
at,
|
|
1375
1400
|
...path === void 0 ? {} : { path },
|
|
1376
1401
|
...unitId === void 0 ? {} : { unitId },
|
|
1377
|
-
...unitHead === void 0 ? {} : { unitHead }
|
|
1402
|
+
...unitHead === void 0 ? {} : { unitHead },
|
|
1403
|
+
summary: finalSummary.text,
|
|
1404
|
+
summarySource: finalSummary.source
|
|
1378
1405
|
};
|
|
1379
1406
|
versions = await recordVersions(this.root, this.io, input, keep, fence);
|
|
1380
1407
|
} catch (error) {
|
|
@@ -1789,6 +1816,88 @@ var SkillLibrary = class {
|
|
|
1789
1816
|
const name = rawName.trim();
|
|
1790
1817
|
return await this.serial(() => this.patchCore(name, oldString, newString, filePath, replaceAll, origin));
|
|
1791
1818
|
}
|
|
1819
|
+
/**
|
|
1820
|
+
* Replace ONE section's content (or one exact sub-block) in place. Keeps the
|
|
1821
|
+
* H2 heading line for whole-section edits, so a model can compress one
|
|
1822
|
+
* section at a time without re-sending the body. No content-conservation
|
|
1823
|
+
* gate: the version history is the rollback, and existing structural
|
|
1824
|
+
* validation still applies through {@link update}.
|
|
1825
|
+
* @param rawName - skill name.
|
|
1826
|
+
* @param edit - section selector plus replacement text.
|
|
1827
|
+
* @param origin - write face.
|
|
1828
|
+
* @returns the normalized result, with before/after body sizes.
|
|
1829
|
+
*/
|
|
1830
|
+
async patchSection(rawName, edit, origin = this.authority.origin) {
|
|
1831
|
+
await this.ensureRecovered();
|
|
1832
|
+
return await this.patchSectionCore(rawName.trim(), edit, origin);
|
|
1833
|
+
}
|
|
1834
|
+
async patchSectionCore(name, edit, origin) {
|
|
1835
|
+
const badName = this.badName(name);
|
|
1836
|
+
if (badName) return {
|
|
1837
|
+
ok: false,
|
|
1838
|
+
message: badName
|
|
1839
|
+
};
|
|
1840
|
+
if (typeof edit.heading !== "string" || edit.heading.trim() === "") return {
|
|
1841
|
+
ok: false,
|
|
1842
|
+
message: "章节改写需要非空 heading。"
|
|
1843
|
+
};
|
|
1844
|
+
const dir = this.dirOf(name);
|
|
1845
|
+
const path = join(dir, "SKILL.md");
|
|
1846
|
+
let md;
|
|
1847
|
+
try {
|
|
1848
|
+
md = await this.io.readText(path);
|
|
1849
|
+
} catch (error) {
|
|
1850
|
+
return unreadableTarget(name, error);
|
|
1851
|
+
}
|
|
1852
|
+
if (md === null) return {
|
|
1853
|
+
ok: false,
|
|
1854
|
+
message: `技能「${name}」不存在。`
|
|
1855
|
+
};
|
|
1856
|
+
const block = frontmatterBlock(md);
|
|
1857
|
+
if (!block) return {
|
|
1858
|
+
ok: false,
|
|
1859
|
+
message: "SKILL.md 没有有效的 frontmatter;拒绝章节改写。"
|
|
1860
|
+
};
|
|
1861
|
+
const header = block.lines.slice(0, block.end + 1).join("\n");
|
|
1862
|
+
const body = md.slice(header.length).replace(/\r\n/g, "\n");
|
|
1863
|
+
const selection = selectSections(body, [{
|
|
1864
|
+
heading: edit.heading,
|
|
1865
|
+
...edit.start === void 0 ? {} : { start: edit.start },
|
|
1866
|
+
...edit.end === void 0 ? {} : { end: edit.end }
|
|
1867
|
+
}]);
|
|
1868
|
+
if (!selection.ok) return {
|
|
1869
|
+
ok: false,
|
|
1870
|
+
message: `章节改写被拒绝:${selection.message}`
|
|
1871
|
+
};
|
|
1872
|
+
const section = selection.sections[0];
|
|
1873
|
+
if (section === void 0) return {
|
|
1874
|
+
ok: false,
|
|
1875
|
+
message: "章节改写被拒绝:没有匹配的章节。"
|
|
1876
|
+
};
|
|
1877
|
+
const lines = body.split("\n");
|
|
1878
|
+
const start = section.anchorStart === void 0 ? section.start + 1 : section.start;
|
|
1879
|
+
const end = section.end;
|
|
1880
|
+
const replacement = edit.content === "" ? [] : edit.content.replace(/\r\n/g, "\n").split("\n");
|
|
1881
|
+
const next = `${header}${[
|
|
1882
|
+
...lines.slice(0, start),
|
|
1883
|
+
...replacement,
|
|
1884
|
+
...lines.slice(end)
|
|
1885
|
+
].join("\n")}`;
|
|
1886
|
+
const finalMd = block.nl === "\r\n" ? next.replace(/\n/g, "\r\n") : next;
|
|
1887
|
+
if (finalMd.trimEnd() === md.trimEnd()) return {
|
|
1888
|
+
ok: true,
|
|
1889
|
+
message: `技能「${name}」未变更:章节内容一致,未写入。`,
|
|
1890
|
+
noop: true,
|
|
1891
|
+
path: dir
|
|
1892
|
+
};
|
|
1893
|
+
const result = await this.update(name, finalMd, origin, { sha256: contentHash(md) });
|
|
1894
|
+
if (!result.ok) return result;
|
|
1895
|
+
return {
|
|
1896
|
+
ok: true,
|
|
1897
|
+
message: `已更新「${name}」的「${edit.heading}」章节(正文 ${md.length} → ${finalMd.length} 字符)。`,
|
|
1898
|
+
path: dir
|
|
1899
|
+
};
|
|
1900
|
+
}
|
|
1792
1901
|
async patchCore(name, oldString, newString, filePath, replaceAll, origin) {
|
|
1793
1902
|
const badName = this.badName(name);
|
|
1794
1903
|
if (badName) return {
|
|
@@ -2085,10 +2194,10 @@ var SkillLibrary = class {
|
|
|
2085
2194
|
});
|
|
2086
2195
|
} catch {}
|
|
2087
2196
|
}
|
|
2088
|
-
async archive(rawName, options = {}, origin = this.authority.origin) {
|
|
2089
|
-
return await this.archiveCore(rawName, options, origin, false);
|
|
2197
|
+
async archive(rawName, options = {}, origin = this.authority.origin, change) {
|
|
2198
|
+
return await this.archiveCore(rawName, options, origin, false, change);
|
|
2090
2199
|
}
|
|
2091
|
-
async archiveCore(rawName, options, origin, fenceHeld) {
|
|
2200
|
+
async archiveCore(rawName, options, origin, fenceHeld, change) {
|
|
2092
2201
|
const name = rawName.trim();
|
|
2093
2202
|
const badName = this.badName(name, { allowReserved: true });
|
|
2094
2203
|
if (badName) return {
|
|
@@ -2155,7 +2264,7 @@ var SkillLibrary = class {
|
|
|
2155
2264
|
try {
|
|
2156
2265
|
await this.io.writeText(join(dest, ".archive-name"), `${name}\n`);
|
|
2157
2266
|
} catch {}
|
|
2158
|
-
await this.audit(name, "archive", md, null, reason, void 0, options.unitId, options.unitHead, origin, fenceHeld);
|
|
2267
|
+
await this.audit(name, "archive", md, null, reason, void 0, options.unitId, options.unitHead, origin, fenceHeld, change);
|
|
2159
2268
|
this.notifyMutation({
|
|
2160
2269
|
action: "archive",
|
|
2161
2270
|
name,
|
|
@@ -2835,12 +2944,12 @@ var SkillLibrary = class {
|
|
|
2835
2944
|
* support-directory links is refused (those links' files stay behind in the
|
|
2836
2945
|
* same package; the moved text belongs in references/ beside them).
|
|
2837
2946
|
*/
|
|
2838
|
-
async restructure(rawName, moves, origin = this.authority.origin) {
|
|
2947
|
+
async restructure(rawName, moves, origin = this.authority.origin, change) {
|
|
2839
2948
|
const name = rawName.trim();
|
|
2840
2949
|
await this.ensureRecovered();
|
|
2841
|
-
return await this.restructureCore(name, moves, origin);
|
|
2950
|
+
return await this.restructureCore(name, moves, origin, change);
|
|
2842
2951
|
}
|
|
2843
|
-
async restructureCore(name, moves, origin) {
|
|
2952
|
+
async restructureCore(name, moves, origin, change) {
|
|
2844
2953
|
const badName = this.badName(name);
|
|
2845
2954
|
if (badName) return {
|
|
2846
2955
|
ok: false,
|
|
@@ -2864,6 +2973,14 @@ var SkillLibrary = class {
|
|
|
2864
2973
|
ok: false,
|
|
2865
2974
|
message: "每次重构搬移都需要非空的 heading。"
|
|
2866
2975
|
};
|
|
2976
|
+
if (move.start === void 0 !== (move.end === void 0)) return {
|
|
2977
|
+
ok: false,
|
|
2978
|
+
message: "子块搬移必须同时提供 start 和 end。"
|
|
2979
|
+
};
|
|
2980
|
+
if (move.start !== void 0 && (typeof move.start !== "string" || typeof move.end !== "string" || !move.start.trim() || !move.end.trim())) return {
|
|
2981
|
+
ok: false,
|
|
2982
|
+
message: "子块搬移的 start/end 必须是匹配行的非空文本。"
|
|
2983
|
+
};
|
|
2867
2984
|
const targetIssue = validateRestructureTarget(move.toFile);
|
|
2868
2985
|
if (targetIssue) return {
|
|
2869
2986
|
ok: false,
|
|
@@ -2965,7 +3082,7 @@ var SkillLibrary = class {
|
|
|
2965
3082
|
let headPlaced = false;
|
|
2966
3083
|
for (const op of event.ops) {
|
|
2967
3084
|
const rel = relative(dir, op.target).split(String.fromCharCode(92)).join("/");
|
|
2968
|
-
await this.audit(name, "restructure", op.before, op.after, summary, rel === "SKILL.md" ? void 0 : rel, event.unitId, headPlaced ? void 0 : this.unitHeadForOps(event.ops, [name]), origin, true);
|
|
3085
|
+
await this.audit(name, "restructure", op.before, op.after, summary, rel === "SKILL.md" ? void 0 : rel, event.unitId, headPlaced ? void 0 : this.unitHeadForOps(event.ops, [name]), origin, true, change);
|
|
2969
3086
|
headPlaced = true;
|
|
2970
3087
|
}
|
|
2971
3088
|
this.notifyMutation({
|
|
@@ -2994,7 +3111,7 @@ var SkillLibrary = class {
|
|
|
2994
3111
|
};
|
|
2995
3112
|
return {
|
|
2996
3113
|
ok: true,
|
|
2997
|
-
message: `已重构「${name}」:把 ${plan.sections.length} 个章节搬到 references
|
|
3114
|
+
message: `已重构「${name}」:把 ${plan.sections.length} 个章节搬到 references/(正文 ${md.length} → ${finalMd.length} 字符)。`,
|
|
2998
3115
|
path: dir
|
|
2999
3116
|
};
|
|
3000
3117
|
}
|
|
@@ -3013,7 +3130,7 @@ var SkillLibrary = class {
|
|
|
3013
3130
|
* @param origin - write face recorded in the audit ledger.
|
|
3014
3131
|
* @returns the kernel result; a refusal writes nothing.
|
|
3015
3132
|
*/
|
|
3016
|
-
async extract(plan, origin = this.authority.origin) {
|
|
3133
|
+
async extract(plan, origin = this.authority.origin, change) {
|
|
3017
3134
|
await this.ensureRecovered();
|
|
3018
3135
|
if (plan.outcome === "owner-gap" || plan.owner.mode !== "covered") return {
|
|
3019
3136
|
ok: false,
|
|
@@ -3162,7 +3279,7 @@ var SkillLibrary = class {
|
|
|
3162
3279
|
for (const op of event.ops) {
|
|
3163
3280
|
if (op.skill === void 0) continue;
|
|
3164
3281
|
const rel = relative(this.dirOf(op.skill), op.target).split(String.fromCharCode(92)).join("/");
|
|
3165
|
-
await this.audit(op.skill, "extract", op.before, op.after, summary, rel === "SKILL.md" ? void 0 : rel, event.unitId, headPlaced ? void 0 : head, origin, true);
|
|
3282
|
+
await this.audit(op.skill, "extract", op.before, op.after, summary, rel === "SKILL.md" ? void 0 : rel, event.unitId, headPlaced ? void 0 : head, origin, true, change);
|
|
3166
3283
|
headPlaced = true;
|
|
3167
3284
|
}
|
|
3168
3285
|
for (const name of roots) this.notifyMutation({
|
|
@@ -4052,4 +4169,4 @@ function newSkillLibrary(options) {
|
|
|
4052
4169
|
} : void 0, transact, [...threatExemptLabels ?? []], authority, options.mutationLock ?? mutationLockFrom(ctx), options.fence ?? ctx?.get?.("evolutionMutationAuthority")?.homeFence);
|
|
4053
4170
|
}
|
|
4054
4171
|
//#endregion
|
|
4055
|
-
export { BASELINE_ACTION, DEFAULT_ARCHIVE_RETENTION_POLICY, DEFAULT_CITATION_POLICY, DEFAULT_HEALTH_THRESHOLDS, DEFAULT_REFERENCE_REWRITE_POLICY, DEFAULT_SKILL_LIMITS, DEFAULT_SUPPORT_FILE_CHAR_POLICY, HEALTH_STAMP_RE, HISTORY_DIR, HISTORY_INDEX_VERSION, MAX_RESTRUCTURE_MOVES, MIN_STAMP_BODY_CHARS, POLICY_STAGE_DEFAULTS, READ_REQUIRED_ACTIONS, RESTRUCTURE_TARGET_RE, RETENTION_FEEDBACK_KEEP_RATIO, RETENTION_FEEDBACK_MIN_CHARS, RULES, SNAPSHOT_EXTRA_NAME_RE, SkillLibrary, SkillModel, TEXT_DIFF_MAX_CHARS, TEXT_DIFF_MAX_LINES, ageCopyKey, anchorVerdict, assertSkillsRootAliasRetired, assessStructureHealth, authoringFeedback, blobPath, contentRetentionFeedback, diffFindings, elapsedSince, ensureSkillFrontmatter, entryTarget, exceedsContentLimit, filterUnreadSkillOps, frontmatterBlock, frontmatterCatalogInvalid, historyIndexFile, historyRoot, isUnreadWrite, latestVersionAt, lintBody, lintSkill, loadVersionContent, loadVersions, markerEntryName, newSkillLibrary, nextHistoryIndex, normalizeFrontmatter, orderVersions, parseFrontmatter, parseHistoryIndex, partitionVersions, policyStageLimits, readHistoryIndex, recordVersions, relatedSkillNames, resolveExecOrigins, resolveOrigins, resolveRootConfig, resolveSkillsRoot, revisionAnchor, revisionAnchorOf, revisionFingerprint, revisionSupportDigest, sessionReadSkillNames, sessionReadSupportFiles, shrinksOverLimit, skillMdOnDisk, skillRowCells, skillStateKey, skillsRoot, textDiffFacts, validateFrontmatter, validateRestructureTarget, validateSupportPath, versionActionKind, versionRowCells, versionTarget, yamlPlainScalarNeedsQuotes };
|
|
4172
|
+
export { BASELINE_ACTION, DEFAULT_ARCHIVE_RETENTION_POLICY, DEFAULT_CITATION_POLICY, DEFAULT_HEALTH_THRESHOLDS, DEFAULT_REFERENCE_REWRITE_POLICY, DEFAULT_SKILL_LIMITS, DEFAULT_SKILL_WRITE_SUMMARY_CHARS, DEFAULT_SUPPORT_FILE_CHAR_POLICY, HEALTH_STAMP_RE, HISTORY_DIR, HISTORY_INDEX_VERSION, MAX_RESTRUCTURE_MOVES, MIN_STAMP_BODY_CHARS, POLICY_STAGE_DEFAULTS, READ_REQUIRED_ACTIONS, RESTRUCTURE_TARGET_RE, RETENTION_FEEDBACK_KEEP_RATIO, RETENTION_FEEDBACK_MIN_CHARS, RULES, SNAPSHOT_EXTRA_NAME_RE, SkillLibrary, SkillModel, TEXT_DIFF_MAX_CHARS, TEXT_DIFF_MAX_LINES, ageCopyKey, anchorVerdict, assertSkillsRootAliasRetired, assessStructureHealth, authoringFeedback, blobPath, clipChangeSummary, contentRetentionFeedback, diffFindings, elapsedSince, ensureSkillFrontmatter, entryTarget, exceedsContentLimit, filterUnreadSkillOps, frontmatterBlock, frontmatterCatalogInvalid, historyIndexFile, historyRoot, isUnreadWrite, latestVersionAt, lintBody, lintSkill, loadVersionContent, loadVersions, markerEntryName, newSkillLibrary, nextHistoryIndex, normalizeChangeSummary, normalizeFrontmatter, orderVersions, parseFrontmatter, parseHistoryIndex, partitionVersions, policyStageLimits, readHistoryIndex, recordVersions, relatedSkillNames, resolveExecOrigins, resolveOrigins, resolveRootConfig, resolveSkillsRoot, revisionAnchor, revisionAnchorOf, revisionFingerprint, revisionSupportDigest, sessionReadSkillNames, sessionReadSupportFiles, shrinksOverLimit, skillMdOnDisk, skillRowCells, skillStateKey, skillsRoot, summaryChars, textDiffFacts, validateFrontmatter, validateRestructureTarget, validateSupportPath, versionActionKind, versionRowCells, versionTarget, yamlPlainScalarNeedsQuotes };
|
package/lib/subagent/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as restrictedPresetId, n as ensureRestrictedPreset, r as restrictedPresetState } from "../ensure-BLmEW0Ju.js";
|
|
2
2
|
//#region lib/types/subagent/readiness.js
|
|
3
3
|
/** Pure derivation (no side effects): the doctor reads this, the channel re-probes on every run. */
|
|
4
4
|
function probeChannelState(ctx, kind) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export type RestrictedPresetKind = 'reviewer' | 'maintainer';
|
|
1
|
+
export type RestrictedPresetKind = 'reviewer' | 'maintainer' | 'governance';
|
|
2
2
|
export declare const EVOLUTION_PRESET_IDS: readonly ["evolution", "evolution-ptc", "evolution-cordis", "evolution-minimal"];
|
|
3
3
|
export declare const REVIEWER_PRESET_ID: "evolution-reviewer-readonly";
|
|
4
4
|
export declare const MAINTAINER_PRESET_ID: "evolution-maintainer-readonly";
|
|
5
|
+
export declare const GOVERNANCE_PRESET_ID: "evolution-governance";
|
|
5
6
|
export declare const RESTRICTED_TOOLS_ROW_ID: "evolution-restricted-tools";
|
|
6
7
|
export declare const RESTRICTOR_MODULE: string;
|
|
7
8
|
export interface RestrictedPresetDisplay {
|
|
@@ -4,14 +4,20 @@ import { scopedPackageName } from "../package-identity.js";
|
|
|
4
4
|
export const EVOLUTION_PRESET_IDS = ['evolution', 'evolution-ptc', 'evolution-cordis', 'evolution-minimal'];
|
|
5
5
|
export const REVIEWER_PRESET_ID = 'evolution-reviewer-readonly';
|
|
6
6
|
export const MAINTAINER_PRESET_ID = 'evolution-maintainer-readonly';
|
|
7
|
+
export const GOVERNANCE_PRESET_ID = 'evolution-governance';
|
|
7
8
|
export const RESTRICTED_TOOLS_ROW_ID = 'evolution-restricted-tools';
|
|
8
9
|
export const RESTRICTOR_MODULE = scopedPackageName('dsh-evolution-core/restrictor', import.meta.url);
|
|
9
10
|
export const RESTRICTED_PRESET_DISPLAY = {
|
|
10
11
|
reviewer: { name: 'evolution reviewer (read-only)', description: 'Internal restricted preset used by the family review channel.', order: 900 },
|
|
11
12
|
maintainer: { name: 'evolution maintainer (read-only)', description: 'Internal restricted preset used by the family maintenance channel.', order: 901 },
|
|
13
|
+
governance: { name: 'evolution governance (writable)', description: 'Internal restricted preset used by the single-skill governance child.', order: 902 },
|
|
12
14
|
};
|
|
13
15
|
export function restrictedPresetId(kind) {
|
|
14
|
-
|
|
16
|
+
if (kind === 'reviewer')
|
|
17
|
+
return REVIEWER_PRESET_ID;
|
|
18
|
+
if (kind === 'maintainer')
|
|
19
|
+
return MAINTAINER_PRESET_ID;
|
|
20
|
+
return GOVERNANCE_PRESET_ID;
|
|
15
21
|
}
|
|
16
22
|
/** Trim, drop blanks, de-duplicate and sort: ONE spelling for an allow/deny set. */
|
|
17
23
|
export function normalizeAllow(names) {
|
package/lib/types/events.d.ts
CHANGED
|
@@ -58,6 +58,9 @@ export interface EvolutionReviewCompletedEvent {
|
|
|
58
58
|
};
|
|
59
59
|
readonly finalText: string;
|
|
60
60
|
readonly actions: readonly EvolutionReviewAction[];
|
|
61
|
+
/** Model requests actually spent, and tool calls issued inside them. */
|
|
62
|
+
readonly requests?: number | undefined;
|
|
63
|
+
readonly toolCalls?: number | undefined;
|
|
61
64
|
readonly usage?: {
|
|
62
65
|
readonly inputTokens: number;
|
|
63
66
|
readonly outputTokens: number;
|
|
@@ -23,6 +23,7 @@ export const PLATFORM_SERVICE_PROBES = Object.freeze([
|
|
|
23
23
|
{ service: 'configForms', feature: 'the platform config-form seat the settings page renders through', side: 'client' },
|
|
24
24
|
{ service: 'evolutionApproval', feature: 'pending writes: list, approve and reject from the command surface', side: 'host' },
|
|
25
25
|
{ service: 'evolutionCurator', feature: '/evolution curator subcommands, skill undo and history', side: 'host' },
|
|
26
|
+
{ service: 'evolutionFeedback', feature: 'the feedback aggregate and event log behind skill_manage feedback', side: 'host' },
|
|
26
27
|
{ service: 'evolutionIo', feature: 'every durable read and write (the IO seam)', side: 'host' },
|
|
27
28
|
{ service: 'evolutionMerge', feature: 'merge command delegation and the merge doctor fact', side: 'host' },
|
|
28
29
|
{ service: 'evolutionMutationAuthority', feature: 'the family-wide mutation lease, fence and lock authority', side: 'host' },
|
package/lib/types/prompts.d.ts
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
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@
|
|
6
|
+
export declare const PROMPT_BUNDLE_VERSION = 31;
|
|
7
|
+
export declare const PROMPT_BUNDLE_ID = "dsh-evolution@31";
|
|
8
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.";
|
|
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\nBefore adding explanation to a skill, check whether its body is carrying session-specific detail that belongs in references/. When a loaded skill's body has grown past its decision content \u2014 long session logs, dated evidence, or detail that does not change the trigger or the procedure \u2014 move self-contained sections to references/ with skill_manage restructure, keeping the pointer line. Keep the trigger, the decision procedure, commands, and verification in SKILL.md. Offload whole sections; do not rewrite the body to make it shorter. Do at most one skill per review pass; prefer a loaded skill marked [oversize] and do not attempt a library-wide sweep.\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\nBefore adding explanation to a skill, check whether its body is carrying session-specific detail that belongs in references/. When a loaded skill's body has grown past its decision content \u2014 long session logs, dated evidence, or detail that does not change the trigger or the procedure \u2014 move self-contained sections to references/ with skill_manage restructure, keeping the pointer line. Keep the trigger, the decision procedure, commands, and verification in SKILL.md. Offload whole sections; do not rewrite the body to make it shorter. Do at most one skill per review pass; prefer a loaded skill marked [oversize] and do not attempt a library-wide sweep.\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\nBefore adding explanation to a skill, check whether its body is carrying session-specific detail that belongs in references/. When a loaded skill's body has grown past its decision content \u2014 long session logs, dated evidence, or detail that does not change the trigger or the procedure \u2014 move self-contained sections to references/ with skill_manage restructure, keeping the pointer line. Keep the trigger, the decision procedure, commands, and verification in SKILL.md. Offload whole sections; do not rewrite the body to make it shorter. Do at most one skill per review pass; prefer a loaded skill marked [oversize] and do not attempt a library-wide sweep.\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
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.";
|
|
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\nBefore adding explanation to a skill, check whether its body is carrying session-specific detail that belongs in references/. When a loaded skill's body has grown past its decision content \u2014 long session logs, dated evidence, or detail that does not change the trigger or the procedure \u2014 move self-contained sections to references/ with skill_manage restructure, keeping the pointer line. Keep the trigger, the decision procedure, commands, and verification in SKILL.md. Offload whole sections; do not rewrite the body to make it shorter. Do at most one skill per review pass; prefer a loaded skill marked [oversize] and do not attempt a library-wide sweep.\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\nBefore adding explanation to a skill, check whether its body is carrying session-specific detail that belongs in references/. When a loaded skill's body has grown past its decision content \u2014 long session logs, dated evidence, or detail that does not change the trigger or the procedure \u2014 move self-contained sections to references/ with skill_manage restructure, keeping the pointer line. Keep the trigger, the decision procedure, commands, and verification in SKILL.md. Offload whole sections; do not rewrite the body to make it shorter. Do at most one skill per review pass; prefer a loaded skill marked [oversize] and do not attempt a library-wide sweep.\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\nBefore adding explanation to a skill, check whether its body is carrying session-specific detail that belongs in references/. When a loaded skill's body has grown past its decision content \u2014 long session logs, dated evidence, or detail that does not change the trigger or the procedure \u2014 move self-contained sections to references/ with skill_manage restructure, keeping the pointer line. Keep the trigger, the decision procedure, commands, and verification in SKILL.md. Offload whole sections; do not rewrite the body to make it shorter. Do at most one skill per review pass; prefer a loaded skill marked [oversize] and do not attempt a library-wide sweep.\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.";
|
|
16
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.";
|
|
17
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.";
|
|
18
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";
|
|
@@ -38,6 +38,7 @@ export declare const MAINTAIN_OUTPUT_INSTRUCTION = "\u6309\u6A21\u677F\u5951\u7E
|
|
|
38
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
39
|
export type ReviewSurface = 'inject' | 'aux';
|
|
40
40
|
export declare function reviewPrompt(kind: 'memory' | 'skill' | 'combined', surface?: ReviewSurface): string;
|
|
41
|
+
export declare const GOVERNANCE_PROMPT_TEMPLATE = "You are a skill governance worker. Work on exactly one skill.\n\nTarget skill: %SKILL%\nMode: %MODE%\nTarget section: %HEADING%\nDry run: %DRY%\n\nRules:\n- Use the skill tool to read the target before writing.\n- For offload: use skill_manage restructure to move self-contained H2 sections into references/<topic>.md. Keep triggers, decision steps, commands, and verification in SKILL.md. At most five sections per call; include a short summary. When Target section names one heading, only that section may move.\n- For condense: use skill_manage patch with section: {heading, content} one section at a time. Read the result before the next edit. Do not resend the whole body; include a short summary. No content-conservation gate is applied.\n- Keep the H2 heading line for whole-section edits; replace only its content.\n- Do not create, delete, archive, merge, or split skills. Do not touch pinned or protected skills.\n- Dry run: report what you would do; do not write.\n- Finish with: what changed, body characters before/after, and unit id(s).\n";
|
|
41
42
|
export interface PromptBundle {
|
|
42
43
|
id: string;
|
|
43
44
|
version: number;
|
package/lib/types/prompts.js
CHANGED
|
@@ -26,7 +26,7 @@ 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 = 31;
|
|
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}`;
|
|
@@ -46,6 +46,8 @@ Target: a class-level skill with a compact SKILL.md and a references/ directory
|
|
|
46
46
|
|
|
47
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.
|
|
48
48
|
|
|
49
|
+
Before adding explanation to a skill, check whether its body is carrying session-specific detail that belongs in references/. When a loaded skill's body has grown past its decision content — long session logs, dated evidence, or detail that does not change the trigger or the procedure — move self-contained sections to references/ with skill_manage restructure, keeping the pointer line. Keep the trigger, the decision procedure, commands, and verification in SKILL.md. Offload whole sections; do not rewrite the body to make it shorter. Do at most one skill per review pass; prefer a loaded skill marked [oversize] and do not attempt a library-wide sweep.
|
|
50
|
+
|
|
49
51
|
Signals include:
|
|
50
52
|
- The user corrected style, tone, format, verbosity, workflow, or approach.
|
|
51
53
|
- A reusable technique, durable interface or environment fact, repair procedure, or debugging path emerged that will recur.
|
|
@@ -266,6 +268,22 @@ export function reviewPrompt(kind, surface = 'inject') {
|
|
|
266
268
|
return INJECT_SKILL_REVIEW_PROMPT;
|
|
267
269
|
return INJECT_COMBINED_REVIEW_PROMPT;
|
|
268
270
|
}
|
|
271
|
+
export const GOVERNANCE_PROMPT_TEMPLATE = `You are a skill governance worker. Work on exactly one skill.
|
|
272
|
+
|
|
273
|
+
Target skill: %SKILL%
|
|
274
|
+
Mode: %MODE%
|
|
275
|
+
Target section: %HEADING%
|
|
276
|
+
Dry run: %DRY%
|
|
277
|
+
|
|
278
|
+
Rules:
|
|
279
|
+
- Use the skill tool to read the target before writing.
|
|
280
|
+
- For offload: use skill_manage restructure to move self-contained H2 sections into references/<topic>.md. Keep triggers, decision steps, commands, and verification in SKILL.md. At most five sections per call; include a short summary. When Target section names one heading, only that section may move.
|
|
281
|
+
- For condense: use skill_manage patch with section: {heading, content} one section at a time. Read the result before the next edit. Do not resend the whole body; include a short summary. No content-conservation gate is applied.
|
|
282
|
+
- Keep the H2 heading line for whole-section edits; replace only its content.
|
|
283
|
+
- Do not create, delete, archive, merge, or split skills. Do not touch pinned or protected skills.
|
|
284
|
+
- Dry run: report what you would do; do not write.
|
|
285
|
+
- Finish with: what changed, body characters before/after, and unit id(s).
|
|
286
|
+
`;
|
|
269
287
|
function sha256(text) {
|
|
270
288
|
return createHash('sha256').update(text).digest('hex');
|
|
271
289
|
}
|
|
@@ -298,6 +316,7 @@ export const PROMPT_BUNDLE = createPromptBundle({
|
|
|
298
316
|
// (see MAINTAIN_OUTPUT_INSTRUCTION). Digest changes with this entry.
|
|
299
317
|
maintainOutput: MAINTAIN_OUTPUT_INSTRUCTION,
|
|
300
318
|
skillsGuidance: SKILLS_GUIDANCE,
|
|
319
|
+
governance: GOVERNANCE_PROMPT_TEMPLATE,
|
|
301
320
|
});
|
|
302
321
|
export function verifyPromptBundle(bundle = PROMPT_BUNDLE) {
|
|
303
322
|
// Verify against the PINNED constants, not the bundle's own id/version:
|
|
@@ -4,6 +4,8 @@ export interface ReviewExecutionContext {
|
|
|
4
4
|
readonly reviewId: string;
|
|
5
5
|
/** Execution id; currently the same run id. */
|
|
6
6
|
readonly runId: string;
|
|
7
|
+
/** Skills this review has actually read (successful `skill` tool calls). */
|
|
8
|
+
readonly reads?: Set<string>;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* Run one review tool loop under the review write context.
|
|
@@ -17,4 +19,10 @@ export declare function withReviewContext<T>(context: ReviewExecutionContext, ta
|
|
|
17
19
|
* @returns the frozen context, or undefined outside a review loop.
|
|
18
20
|
*/
|
|
19
21
|
export declare function currentReviewContext(): ReviewExecutionContext | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Record a successful skill read in the CURRENT review run. A no-op outside a
|
|
24
|
+
* review loop or when the run has no read set.
|
|
25
|
+
* @param name - the skill name the review actually loaded.
|
|
26
|
+
*/
|
|
27
|
+
export declare function recordReviewRead(name: string): void;
|
|
20
28
|
//# sourceMappingURL=review-context.d.ts.map
|
|
@@ -27,4 +27,15 @@ export function withReviewContext(context, task) {
|
|
|
27
27
|
export function currentReviewContext() {
|
|
28
28
|
return storage.getStore();
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Record a successful skill read in the CURRENT review run. A no-op outside a
|
|
32
|
+
* review loop or when the run has no read set.
|
|
33
|
+
* @param name - the skill name the review actually loaded.
|
|
34
|
+
*/
|
|
35
|
+
export function recordReviewRead(name) {
|
|
36
|
+
const context = storage.getStore();
|
|
37
|
+
if (context?.reads === undefined || name.trim() === '')
|
|
38
|
+
return;
|
|
39
|
+
context.reads.add(name.trim());
|
|
40
|
+
}
|
|
30
41
|
//# sourceMappingURL=review-context.js.map
|