Agent skill

Memory 3layer

by KimYx0207 in KimYx0207/Kim_Service

为长周期、跨会话的 Agent 工作建立平台中立的三层记忆。适用于加载项目记忆、记录可复用事实与每日进展、维护隐性知识、迁移旧版 .claude/memory、检查记忆状态或清理过时条目;Claude Code 与 Codex 可通过各自 Hooks 自动接线,其他 Agent Skills 宿主只使用手动核心。不要用它保存秘密、完整聊天记录、一次性日志或未经确认的推测。

MITAuto-check passedDevelopment

Install Memory 3layer

skills CLI
$ npx skills add KimYx0207/Kim_Service --skill memory-3layer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install KimYx0207/Kim_Service memory-3layer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/KimYx0207/Kim_Service.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/memory-3layer .claude/skills/memory-3layer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
memory-3layer
GitHub stars
174
Token cost
~1.2k tokens
SKILL.md length
287 words
Files
43 (incl. scripts, references)
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

为长周期、跨会话的 Agent 工作建立平台中立的三层记忆。适用于加载项目记忆、记录可复用事实与每日进展、维护隐性知识、迁移旧版 .claude/memory、检查记忆状态或清理过时条目;Claude Code 与 Codex 可通过各自 Hooks 自动接线,其他 Agent Skills 宿主只使用手动核心。不要用它保存秘密、完整聊天记录、一次性日志或未经确认的推测。

  • Works in 6 steps: 非目标边界:不替代 Git、数据库、备份、宿主原生记忆,也不保存完整聊天历史。 → 事实来源边界:只记录用户确认、文件证据或已知 Hook… → 权限边界:读取项目内公开记忆;写入、迁移、修改状态必须符合用户授权,不修改项目外全… → …
  • Development work in your project
  • SKILL.md covers 目标合同, 触发与非触发, 第一动作 and 输入与输出, plus 8 more sections
  • Runs Python scripts from its folder; calls python

What it does

Memory 3layer is an agent skill from KimYx0207/Kim_Service. 为长周期、跨会话的 Agent 工作建立平台中立的三层记忆。适用于加载项目记忆、记录可复用事实与每日进展、维护隐性知识、迁移旧版 .claude/memory、检查记忆状态或清理过时条目;Claude Code 与 Codex 可通过各自 Hooks 自动接线,其他 Agent Skills 宿主只使用手动核心。不要用它保存秘密、完整聊天记录、一次性日志或未经确认的推测。

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 46 other files, including scripts and reference files (for example `CHANGELOG.md`, `README.md` and `README_CN.md`). Compatibility notes: Requires Python 3.8+. Automatic lifecycle integration requires Claude Code Hooks or trusted Codex Hooks; other Agent Skills hosts use the manual core.

It sits in Development. It works with Git. The repository describes itself as: 面向 Claude Code、Codex 等 AI 编码助手的 Hook 与 Agent Skill 开源合集。 The licence is MIT.

When your agent uses it

  • Development work in your project

Example prompts

  • “/memory-3layer”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Requires Python 3.8+. Automatic lifecycle integration requires Claude Code Hooks or trusted Codex Hooks; other Agent Skills hosts use the manual core.

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. 非目标边界:不替代 Git、数据库、备份、宿主原生记忆,也不保存完整聊天历史。
  2. 事实来源边界:只记录用户确认、文件证据或已知 Hook 字段;模型推断必须标注,不能直接升级为长期事实。
  3. 权限边界:读取项目内公开记忆;写入、迁移、修改状态必须符合用户授权,不修改项目外全局配置。
  4. 副作用边界:默认只改 .memory-3layer/ 和明确选择的平台配置;合并现有配置,不覆盖无关 Hooks;不自动提交 Git。
  5. 停止边界:秘密、路径歧义、格式损坏、迁移冲突、配置无法安全合并或校验失败时立即停止对应写操作。
  6. 降级边界:自动 Hook 不可用或未获信任时,退回 manual;保留核心读写能力,但明确自动加载/提取/压缩保护没有发生。

What it can do on your machine

Read from SKILL.md and the folder at commit 20296f7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires Python 3.8+. Automatic lifecycle integration requires Claude Code Hooks or trusted Codex Hooks; other Agent Skills hosts use the manual core.

    From compatibility in the SKILL.md frontmatter.

Context cost

Memory 3layer loads about 1.2k tokens when it runs, and up to ~3.2k if it reads all its reference files. Until then it costs about 50 tokens; SKILL.md has 287 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~50
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from KimYx0207/Kim_Service at commit 20296f7, republished under its MIT licence (© KimYx0207). 287 words, ~1,205 tokens.

Download SKILL.mdSave it as .claude/skills/memory-3layer/SKILL.md (or your agent's skills folder). This skill also uses 42 other files; get the full folder from GitHub.
name
memory-3layer
description
为长周期、跨会话的 Agent 工作建立平台中立的三层记忆。适用于加载项目记忆、记录可复用事实与每日进展、维护隐性知识、迁移旧版 .claude/memory、检查记忆状态或清理过时条目;Claude Code 与 Codex 可通过各自 Hooks 自动接线,其他 Agent Skills 宿主只使用手动核心。不要用它保存秘密、完整聊天记录、一次性日志或未经确认的推测。
compatibility
Requires Python 3.8+. Automatic lifecycle integration requires Claude Code Hooks or trusted Codex Hooks; other Agent Skills hosts use the manual core.
license
MIT

三层记忆

把会影响后续工作的知识保存为可检查、可迁移、可控制生命周期的项目资产。默认数据目录是项目根目录下的 .memory-3layer/;MEMORY_DIR 可以显式覆盖。

目标合同

为正在进行长期项目、会跨会话切换 Agent 的用户,生成一套人和 Agent 都能检查的三层记忆,并满足以下可观察标准:

  • Layer 1 在 areas/topics/<topic>/items.json 保存带状态的结构化事实。
  • Layer 2 在 memory/YYYY-MM-DD.md 保存按日期追加的工作轨迹。
  • Layer 3 在 MEMORY.md 保存人工确认的长期隐性知识。
  • 新会话只加载受预算约束的 active 内容,不把整个历史塞进上下文。
  • 旧知识可标记为 superseded,不靠删除历史来制造“最新事实”。
  • Claude Code 与 Codex 的自动化都调用同一 Python 核心;其他平台不伪装成自动支持。

触发与非触发

使用本技能:

  • 用户要求“记住这条规则”“下次继续”“跨会话保存”“查看/清理项目记忆”。
  • 项目已有 .memory-3layer/,当前任务需要读取其中的长期上下文。
  • 项目仍有 .claude/memory/,用户要迁移到平台中立目录。
  • 需要为 Claude Code 或 Codex 接入三层记忆生命周期。

不要使用:

  • 只需写一次性日志、缓存、构建输出或完整会话转储。
  • 内容包含口令、令牌、私钥、支付信息、未脱敏个人数据或不应进入版本库的材料。
  • 用户只想使用宿主自己的私有记忆,且不需要项目级共享与生命周期管理。

第一动作

在写入前先确认五项事实:项目根目录、当前宿主、.memory-3layer/ 是否存在、legacy .claude/memory/ 是否存在、当前任务是否授权写入。无法确认项目根目录或写入权限时,只报告发现,不创建或迁移文件。

输入与输出

输入:

  • 项目根目录;默认当前 Git 根,非 Git 项目用当前工作目录。
  • 当前运行平台:claude、codex 或 manual。
  • 用户明确要求记住的内容,或宿主 Hook 提供的事件负载。
  • 可选环境变量:MEMORY_DIR、MEMORY_MAX_ITEMS、MEMORY_DAILY_DAYS、MEMORY_TOPICS。

输出:

  • .memory-3layer/ 中变更后的三层记忆文件。
  • 本次动作摘要:读取了什么、写入了什么、跳过了什么、下一步是什么。
  • 失败时给出具体失败路线,不把“Hook 已配置”说成“Hook 已运行”。

执行步骤合同

步骤输入动作可观察输出转移条件失败路线
1. 定位cwd、Git 状态、宿主标识确定项目根、运行平台、数据目录与写权限输出四项定位结果路径唯一且权限符合任务路径不唯一则询问;无写权限则切换只读状态检查
2. 初始化或迁移当前目录、legacy 目录、用户授权新项目初始化 .memory-3layer/;legacy 仅在显式迁移时复制并校验,默认不覆盖标准目录存在;迁移报告列出 copied/skipped/conflict结构校验通过冲突或目标非空时停止,不删除源目录,转人工处理
3. 加载active facts、近期日记、MEMORY.md、预算参数按 Layer 3 → Layer 2 → Layer 1 组装受限上下文loader 返回可读上下文和条目计数输出未超预算且来源可追溯文件损坏时跳过坏文件并报告;不得静默重写
4. 记录用户明确记忆、受确认的记忆协议、现有条目调用 scripts/record_memory.py,脱敏、分类、去重后追加 Layer 1/2;只把人工确认的长期结论提升到 Layer 3文件 diff 显示新增或去重跳过每条记录有来源、日期与状态普通工具输出不自动持久化;内容含秘密、来源不明或只是推测时拒绝并说明原因
5. 会话保护PreCompact/等价事件或手动请求保存最小可恢复状态,不保存完整聊天记录session state 可解析并含时间与摘要写入原子完成无对应事件的宿主降级为手动保存,不声称自动恢复
6. 复查三层文件、日期、status识别重复、冲突、过时条目,提出 active → superseded 建议review 报告与逐项建议用户确认后再改状态无法判断新旧时保持原状并标记待确认
7. 验证包文件、临时项目、宿主配置运行包校验与目标平台测试;检查 Hook 是否实际触发分别报告 artifact、adapter、runtime 三层结果所需层级都有证据只通过静态校验时只能称“配置完成”,不能称“自动运行已验证”

平台能力矩阵

平台Agent Skills自动生命周期接线位置使用前提
Claude Code是是,适配 SessionStart、PostToolUse、PreCompact.claude/settings.jsonPython 可用;项目 Hooks 已启用
Codex是是,适配同类 Codex Hooks 事件.codex/hooks.jsonPython 可用;安装后在 /hooks 审查并信任项目 Hooks
其他支持 Agent Skills 的宿主视宿主而定否无自动接线使用 manual 核心,显式加载、记录、复查

“支持 Agent Skills”不等于“自动支持其 Hook 协议”。没有适配器或运行证据时,一律标为 manual。

六类边界

  1. 非目标边界:不替代 Git、数据库、备份、宿主原生记忆,也不保存完整聊天历史。
  2. 事实来源边界:只记录用户确认、文件证据或已知 Hook 字段;模型推断必须标注,不能直接升级为长期事实。
  3. 权限边界:读取项目内公开记忆;写入、迁移、修改状态必须符合用户授权,不修改项目外全局配置。
  4. 副作用边界:默认只改 .memory-3layer/ 和明确选择的平台配置;合并现有配置,不覆盖无关 Hooks;不自动提交 Git。
  5. 停止边界:秘密、路径歧义、格式损坏、迁移冲突、配置无法安全合并或校验失败时立即停止对应写操作。
  6. 降级边界:自动 Hook 不可用或未获信任时,退回 manual;保留核心读写能力,但明确自动加载/提取/压缩保护没有发生。

迁移规则

旧版默认路径 .claude/memory/ 只作为只读发现来源,不再作为新写入默认值。只有用户明确要求迁移时才运行:

bash
python scripts/migrate_legacy_memory.py --project-dir <目标项目>

迁移默认复制到 .memory-3layer/、不覆盖现有文件、不删除 legacy。完整冲突规则见 references/migration.md。

显式记录

用户说“记住”时,由 Agent 调用受控记录入口;不要假设普通 PostToolUse 输出会自动变成事实:

bash
python scripts/record_memory.py --project-dir <目标项目> --fact "这个项目统一使用 pnpm" --topic workflow

只有本包受管记录器传入的顶层 memory_fact 可以持久化。任何工具响应中的 summary、fact、confirmed 或其他原始输出都默认忽略。

渐进加载

验证

先验证平台中立核心,再验证目标平台适配器:

bash
python scripts/check_memory_3layer.py
python -m unittest discover -s evals -p "test_*.py"

静态测试不能证明宿主已触发 Hook。Claude Code 需在新会话观察加载事件;Codex 需先通过 /hooks 信任,再在新会话观察加载事件。报告时分开写:

  • artifact_status:文件与结构是否一致。
  • adapter_status:平台配置是否合并成功。
  • runtime_status:真实宿主事件是否触发并产生预期输出。

发布来源

当前公开源是 KimYx0207/Kim_Service 中的 skills/memory-3layer/。旧 KimYx0207/claude-memory-3layer 仅保留历史 provenance,不再作为安装源或当前能力声明依据。

© KimYx0207, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 42 other files (scripts, references) in skills/memory-3layer of KimYx0207/Kim_Service.

  • SKILL.md
  • CHANGELOG.md
  • LICENSE
  • NOTICE
  • README.md
  • README_CN.md
  • capability.json
  • commands/memory-review.md
  • commands/memory-status.md
  • docs/architecture.md
  • docs/images/alipay.jpg
  • docs/images/contact-qr.png
  • docs/images/wechat-pay.jpg
  • docs/platform-support.md
  • docs/quickstart.md
  • evals/test_install_memory_3layer.py
  • evals/test_migrate_legacy_memory.py
  • … and 26 more

Open the folder on GitHubat commit 20296f7

Compare with similar skills

Memory 3layer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Memory 3layer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Memory 3layer this skillKimYx0207/Kim_Service174—~1.2kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k4 repos~1.1kAutomated safety check: PassMIT
Code Design Rationale Investigatorcursor/plugins11k9 repos~2.6kAutomated safety check: PassNone
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Finishing A Development Branchfarm-fe/farm5.6k34 repos~1.8kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 4 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Official

    Digs into why code is shaped the way it is by checking git history, pull requests and connected tools in parallel, then reporting a cited read on the tradeoffs.

    11k GitHub starsUsed in 9 repos~2.6k tokens
    DevelopmentAuto-check passed
  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 34 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    56k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed

More from KimYx0207/Kim_Service

All 8 skills in this repo
  • Meta Skill Creator

    KimYx0207/Kim_Service

    创建、重构或验收可复用技能包。适用于把重复工作流做成跨宿主能力包,并明确触发规则、第一动作、渐进加载、资产模板、脚本校验、触发评测、基线对比、验收证据、闭环治理、公开交付边界和不可伪造的运行证明;也适用于清理冗余参考、拆分人读模板与机器结构数据、补齐首次公开前的验收记录、记录运行反馈、生成写回或不写回决定。当用户提到"做一个 skill / 改 skill / 优化 skill / 评审…

    174 GitHub stars~1.6k tokensUpdated 3 days ago
    Auto-check passed
  • Agent Teams Playbook

    KimYx0207/Kim_Service

    Cross-runtime playbook for multi-agent collaboration, agent teams, swarm orchestration, parallel task distribution, capability discovery, and quality gates on Claude Code, Codex, OpenClaw, and Cursor.

    174 GitHub stars~2.7k tokensUpdated 3 days ago
    Auto-check passed
  • Xiaohongshu Skill

    KimYx0207/Kim_Service

    生成完整的小红书/Rednote 图文发布包:先自动研究内容机会,再完成标题、正文、封面、6-8 页内页、逐页视觉导演表、Image2 优先图片路线、封面 MVP 确认、批量出图和发布前自检。适用于课程、服务、产品、个人 IP、本地商家和知识分享;单点标题、封面字或改写不触发。

    174 GitHub stars~1.9k tokensUpdated 3 days ago
    Auto-check passed
  • Find Skill

    KimYx0207/Kim_Service

    Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities.

    174 GitHub stars~2.5k tokensUpdated 3 days ago
    Auto-check passed
  • Kim Decision

    KimYx0207/Kim_Service

    A skill your agent uses when the user asks for KIM, Kim, laojin, 老金, 问问老金, 老金怎么看, asks for decision analysis, structured reasoning, product/business/content review, PRD, MVP, user path, growth…

    174 GitHub stars~7.1k tokensUpdated 3 days ago
    Auto-check passed
  • Semgrep Skill

    KimYx0207/Kim_Service

    Runs the installed local Semgrep CLI through a bounded JSON wrapper with two bundled non-secret rules.

    174 GitHub stars~1.2k tokensUpdated 3 days ago
    Auto-check passed

Works with

Categories

Questions about Memory 3layer

What does Memory 3layer do?

为长周期、跨会话的 Agent 工作建立平台中立的三层记忆。适用于加载项目记忆、记录可复用事实与每日进展、维护隐性知识、迁移旧版 .claude/memory、检查记忆状态或清理过时条目;Claude Code 与 Codex 可通过各自 Hooks 自动接线,其他 Agent Skills 宿主只使用手动核心。不要用它保存秘密、完整聊天记录、一次性日志或未经确认的推测。. Memory 3layer is an agent skill from KimYx0207/Kim_Service.

When should I use Memory 3layer?

Memory 3layer fits situations like: development work in your project.

How do I install Memory 3layer in Claude Code?

Run `npx skills add KimYx0207/Kim_Service --skill memory-3layer -a claude-code`. Or copy the skill folder (skills/memory-3layer in KimYx0207/Kim_Service) into .claude/skills/memory-3layer in your project. Claude Code loads it when a task matches its description.

How do I install Memory 3layer in Codex?

Run `npx skills add KimYx0207/Kim_Service --skill memory-3layer -a codex`. Or copy the skill folder (skills/memory-3layer in KimYx0207/Kim_Service) into .agents/skills/memory-3layer in your project. Codex loads it when a task matches its description.

Can I use Memory 3layer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add KimYx0207/Kim_Service --skill memory-3layer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/memory-3layer, .gemini/skills/memory-3layer, .github/skills/memory-3layer and .opencode/skills/memory-3layer in your project.

What does Memory 3layer need to run?

Going by SKILL.md and its folder, Memory 3layer needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3. Compatibility (from SKILL.md): Requires Python 3.8+. Automatic lifecycle integration requires Claude Code Hooks or trusted Codex Hooks; other Agent Skills hosts use the manual core..

Does Memory 3layer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Memory 3layer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Memory 3layer use?

Memory 3layer is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Memory 3layer use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2k tokens, read only when the agent opens those files.

What are the alternatives to Memory 3layer?

Skills that share tags, products or a category with Memory 3layer: Finishing a Development Branch (obra/superpowers, 297k stars), Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), Code Design Rationale Investigator (cursor/plugins, 11k stars) and Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Memory 3layer?

KimYx0207 (a GitHub user) maintains it in KimYx0207/Kim_Service, which has 174 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 6, 2026.

Source: KimYx0207/Kim_Service on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.