plugins/tools/cortex/skills/cortex-memory/SKILL.md
记忆生命周期管理 — 自动维护 (晋级候选扫 / forget 标记 / 弱条目补充 / weight bump / uri-index 整理) + URI 寻址 CRUD 子命令。无入参跑全量维护; 有 verb 走 CRUD。Triggers on "整理记忆", "维护记忆", "记忆体检", "memory maintain", "记忆写入", "memory write/read/update/delete", "forget", "遗忘".
npx skillsauth add lazygophers/ccplugin cortex-memoryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
[AUTO_MODE persistent: 禁询问, 自决执行, 禁中止]
记忆生命周期管理 — 默认跑维护扫 (非破坏); 有显式 verb 才降级到 CRUD。可独立调用, 也由 cortex-digest 阶段 4 委派。
/cortex:memory 无参 → 跑维护cortex-digest 阶段 4 委派 → 跑维护 (其内联 promote-candidates + forget-marker 子集)memory-promote / memory-forget / /cortex:forget → 等价于跑维护 (子集)入参为空 / 仅 --vault → 维护扫 (默认)
入参含 verb=read|write|update|delete → CRUD (走 crud-operations.md)
~/.cortex/scripts/ledger.sh uri_index_rebuild 重建 _meta/uri-index.json; 校验 frontmatter (level/uri/weight/last_recalled 完整 + URI 全局唯一)记忆/L3-短期/episodic/ + 记忆/L2-中期/semantic/:
needs_user_approval: true)记忆/views/candidates.md (覆写整页), 不自动晋examples / body; 不删原内容now - last_recalled > 90 天 且 recall_count < 3 → frontmatter archive_pending: truenow - last_recalled > 365 天 且 recall_count < 5 → 同上记忆/views/alerts.md ## memory-forget <UTC ISO> 列 uri 清单importance ↑; 用户 "不对/错了" → confidence -= 1.0, "对的" → confidence += 0.5 (scripts/cli/lib/evolution.py:update_doc_scores)破坏性操作 (实际归档 / L4 gzip / 腐化删除) 不在维护扫内, 由独立 cron 跑:
memory-archive(月 1st 06:00) — archive_pending 落归档/forgotten/memory-compact(周日 04:00) — L4 ledger gzipmemory-warden(1st/15th 05:00) — 腐化检测
verb=read → 解析 URI → 读 frontmatter + brief (详见 crud-operations.md §read)
verb=write → policy 校验 (L0 拒 / L1 weight≥0.8 / L2 dedupe / L3/L4 自动) → 写 frontmatter + body
verb=update→ 解析 → 校验 immutable_after_confirm → 写回, created 不变
verb=delete→ L0 拒 / L1 force-user / L2-L4 archive_pending=true
URI 解析失败 / 路径越界 → 立即拒绝, 不写盘。
L<N>://<path> (e.g. L2://semantic/go/goroutine)--level, --weight (0.0-1.0), --recall_when (string), --ref (知识库路径), --parents, --children--full (read 时返回完整 full 字段, 默认仅 brief){
"mode": "maintain",
"indexed": <N>, "invalid_frontmatter": <N>, "duplicate_uri": <N>,
"promote_candidates_L3_to_L2": <N>, "promote_candidates_L2_to_L1": <N>, "promote_candidates_L1_to_L0": <N>,
"auto_promoted_L4_to_L3": <N>,
"enriched": <N>,
"forget_marked_L2": <N>, "forget_marked_L3": <N>,
"scores_updated": <N>
}
{"ok": true, "mode": "<verb>", "uri": "<u>", "data": {...}}
auto 后缀触发)~/.cortex/scripts/memory.sh <verb> <uri> --interactive| 文件 | 用途 |
|---|---|
| references/crud-operations.md | CRUD 4 verb 详细流程 + URI 解析 + frontmatter 自动填 + 错误处理 |
| references/forget.md | forget 标记子流程 (维护阶段 4 详细; daily cron / /cortex:forget 触发等价) |
| references/scoring.md | importance / confidence 2 评分字段强制 (lint rule 23) + 启发式 + 衰减规则 |
tools
UI/UX 与布局设计——做界面布局/结构/导航/组件/交互的设计决策。触发:做UI/UX/布局/排版/导航/组件/交互/栅格/响应式/图表选型/字体配对。按媒介路由 HTML/Web、原生 App(iOS/Android/桌面)、CLI、TUI。需后端动态系统不适用;配色/主题/色板走姊妹 skill design-color。
tools
主题与配色设计——做颜色搭配/调色板/主题/品牌色阶/暗模式的设计决策。触发:选配色/调色/主题/色板/品牌色/暗模式/对比度/色盲/UI风格。按媒介路由 HTML/Web(CSS变量)、原生App(平台token)、CLI(ANSI)、TUI(真彩/256/16降级)。保证可访问性(对比度/色盲安全)。需后端动态系统不适用;UI/UX 布局/组件/交互走姊妹 skill design-uiux。
tools
跨任意组件(plugin/skill/agent/command)的验证驱动优化循环纪律 skill。当用户要优化某个已有组件却无明确方向、或要防止改了反而更差(自评乐观偏差 / 多维同改归因失效 / 为凑分加废话膨胀)、或要把一套通用「评分→单变量改→改后验证严格更好才留否则回滚→触顶停」的纪律套到任意组件上时使用。管优化过程本身的纪律(validation gate / ratchet / 独立验证 / 触顶停),不评单组件深度(交 skill-dev),不查插件接线(交 plugin-dev)。仅手动 /optimize-any 触发。
data-ai
两层规则记忆 (基于 .skein/spec)。planning 时 recall 召回相关规则、task finish 后 sediment 沉淀学习 + prune 自动精简过期/重复/断链规则。core 常驻硬规 + recall 按需召回, 经判定门自动写盘 (不逐次问用户)。产出 .skein/spec 下 core/recall 规则文件 + index。另支持空仓 bootstrap 播种规则基线、记忆大面积失效 (大重构/换栈) 时 reconstruct 可逆归档后按项目类型分型重建、maintain 手动体检 (超预算/stale/断链/重复/废弃, --apply 自动修复)、auto-fix (Stop hook 写 .pending-fix 标记 → main 派 skein-specer bg 跑 maintain --apply 全自动修, 断链只报告)。