Context Memory Keeper logo

Context Memory Keeper

Community
yushui2022
context-memory-keeper

维护跨会话的项目记忆,记录长期规则与当前任务清单,供后续阶段恢复上下文。当长对话需要压缩、已确认的决策与约束需要落盘、或用户要求记住或恢复之前进展时使用。

Overview

Publisheryushui2022
RepositoryMathModel-Skill
Skill namecontext-memory-keeper
Stars
455
Forks
28
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by yushui2022 on GitHub. Read the source before you install it.

Installation

Install the Context Memory Keeper AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/yushui2022/MathModel-Skill/tree/standard/skills/context-memory-keeper
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/yushui2022/MathModel-Skill.git /tmp/MathModel-Skill
mkdir -p .claude/skills
cp -r /tmp/MathModel-Skill/skills/context-memory-keeper .claude/skills/context-memory-keeper
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Context Memory Keeper in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Context Memory Keeper on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Context Memory Keeper is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Context Memory Keeper

Resolve <SKILL_ROOT> to the parent directory of this loaded skill folder, using its actual absolute path. Run commands from the contest project root, never from the installed skill directory. The placeholder is not a shell environment variable.

全局流程协作约束(长对话防漂移)

  • 本 skill 不得作为孤立入口。用户要求完整论文、生成 Word、继续流程或不确定阶段时,先回到 paper-workflow-orchestrator 判断当前 S0-S8 阶段。
  • 启动或继续本 skill 的正式任务前,必须运行:
    bash
    python "<SKILL_ROOT>/paper-workflow-orchestrator/scripts/workflow_guard.py" --skill context-memory-keeper
  • 如果输出 [WORKFLOW FAIL] 或报告 status != "PASS",停止本 skill,按 paper_output/qa/workflow_guard_report.json 的失败项回补前置阶段,不得凭记忆继续。
  • 本 skill 只写入自己契约范围内的 paper_output/ 产物;完成后必须回到 paper-workflow-orchestrator 判断下一步,并用 context-memory-keeper 记录已完成产物、阻塞项和下一步。
  • 长对话中如果上下文变长、阶段不确定或用户分开调用 skill,先运行:
    bash
    python "<SKILL_ROOT>/paper-workflow-orchestrator/scripts/workflow_guard.py" --status
    再读取 paper_output/qa/workflow_guard_report.json、paper_output/preflight_report.json、paper_output/input_manifest.json、paper_output/results/run_manifest.json 和本 skill 的上游 JSON 契约,按报告里的 recommended_skill 与 next_action 继续。
  • 继续流程前,必须把 paper_output/context/workflow_memory.json 视为长期断点记录;若其中的 current_step、next_step、recommended_skill 与 workflow_guard.py --status 不一致,以 guard 报告为准。
  • 每次完成本 skill 的产物后,先回到 paper-workflow-orchestrator 或运行 workflow_guard.py --status,再更新 workflow memory:
    bash
    python "<SKILL_ROOT>/context-memory-keeper/scripts/update_workflow_memory.py"
    更新后读取 paper_output/context/workflow_memory.json / .md,确认下一步和推荐 skill 已记录。

执行契约

  • 上游输入:当前赛题约束、模型路线、数据源、图表路径、QA 结论、用户新增偏好和流程断点。
  • 必须输出:更新后的 memoryskill.md;当短期工作台过长时,将旧任务摘要归档到 memory_archive.md。
  • 下游交接:其他 skill 在复杂任务开始前读取 memoryskill.md,避免遗忘当前模型路线、数据来源和用户要求。
  • 推荐下一步:完成记忆更新后回到调用它的当前 skill;若目标是完整论文,回到 paper-workflow-orchestrator 判断后续阶段。
  • 失败回退:若无法安全更新记忆文件,应在本轮回复中明确保留关键结论,并提示后续手动补写到记忆文件。

Description

此 Skill 维护双层记忆结构,旨在解决模型上下文遗忘问题,同时保持上下文窗口的整洁。

Files Structure

Executable Workflow Memory

  • After workflow_guard.py --status or after a skill handoff, run:
    bash
    python "<SKILL_ROOT>/context-memory-keeper/scripts/update_workflow_memory.py"
  • The script reads paper_output/qa/workflow_guard_report.json plus key workflow artifacts and writes:
    • paper_output/context/workflow_memory.json
    • paper_output/context/workflow_memory.md
  • Long conversations and resumed sessions should read workflow_memory.json before relying on chat history.
  1. memoryskill.md (Active Memory):
    • 长期准则: 用户偏好、角色设定、全局约束 (Read-Only mostly)。
    • 短期工作台: 当前任务状态、变量、正在进行的步骤、外部文献/数据索引 (Read-Write frequently)。
  2. memory_archive.md (Archive):
    • 历史记录、已完成的任务详情 (Write-Only mostly)。

When to Invoke

  • Read: 每次开始复杂任务前,或感到上下文模糊时,读取 memoryskill.md。
  • Update:
    • 获得新指令或完成小步骤 -> 更新 memoryskill.md 的“短期工作台”。
    • 用户修改全局规则 -> 更新 memoryskill.md 的“长期准则”。
  • Archive (Cleanup):
    • 当“短期工作台”内容过长或阶段性任务结束 -> 将旧内容剪切到 memory_archive.md,并在 memoryskill.md 中仅保留关键结论。

Compression Policy (Auto-Cleanup)

  • 触发条件: 当 memoryskill.md 超过 100 行 时,必须执行压缩。
  • 保留原则:
    1. User Imperatives: 用户强烈要求的命令、偏好、红线(High Priority)。
    2. Project Skeleton: 项目核心框架、关键路径、当前阶段里程碑(Medium Priority)。
    3. Active Blockers: 正在阻碍当前任务的问题(High Priority)。
  • 丢弃/归档原则:
    1. Details: 已完成任务的执行细节 -> 移至 memory_archive.md。
    2. Logs: 过程性的成功/失败日志 -> 移至 memory_archive.md 或直接删除。
    3. Expired Context: 已失效的临时变量或不再相关的上下文 -> 直接删除。

Usage Tips

  • 保持 memoryskill.md 轻量(建议 < 100 行),以便随时快速读取。
  • 归档是手动触发的动作(由模型决定何时剪切粘贴)。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Context Memory Keeper AI skill do?

维护跨会话的项目记忆,记录长期规则与当前任务清单,供后续阶段恢复上下文。当长对话需要压缩、已确认的决策与约束需要落盘、或用户要求记住或恢复之前进展时使用。

Why use Context Memory Keeper on TypingMind?

Because you install it once and use it with any model. Context Memory Keeper is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Context Memory Keeper in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/yushui2022/MathModel-Skill/tree/standard/skills/context-memory-keeper. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Context Memory Keeper?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Context Memory Keeper?

As many as you like. As long as a model supports skills, you can use Context Memory Keeper with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Context Memory Keeper AI skill free?

Yes. It is published on GitHub by yushui2022 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇