context-memory-keeper
Skill455 starsChanged 43 days agoMITView on GitHub
维护跨会话的项目记忆,记录长期规则与当前任务清单,供后续阶段恢复上下文。当长对话需要压缩、已确认的决策与约束需要落盘、或用户要求记住或恢复之前进展时使用。
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- xzwwwwww/Enhanced-mathmodel-Codex-skillsedited, first seen May 6, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- xzwwwwww/Enhanced-mathmodel-Codex-skills★ 11380% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- authoritative-data-harvesterSkill
- data-cleaning-and-visualizationSkill
- model-code-and-result-generatorSkill
- modeling-paper-rubric-and-model-selectorSkill
- paper-formal-writerSkill
- paper-micro-unit-generatorSkill
- paper-workflow-orchestratorSkill
- problem-doc-model-selectorSkill
- quality-assurance-auditorSkill
- MathModel Skill StandardSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
After workflow_guard.py --status or after a skill handoff, run:
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 的正式任务前,必须运行:
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,先运行:
再读取python "<SKILL_ROOT>/paper-workflow-orchestrator/scripts/workflow_guard.py" --statuspaper_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:
更新后读取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 --statusor after a skill handoff, run:python "<SKILL_ROOT>/context-memory-keeper/scripts/update_workflow_memory.py" - The script reads
paper_output/qa/workflow_guard_report.jsonplus key workflow artifacts and writes:paper_output/context/workflow_memory.jsonpaper_output/context/workflow_memory.md
- Long conversations and resumed sessions should read
workflow_memory.jsonbefore relying on chat history.
memoryskill.md(Active Memory):- 长期准则: 用户偏好、角色设定、全局约束 (Read-Only mostly)。
- 短期工作台: 当前任务状态、变量、正在进行的步骤、外部文献/数据索引 (Read-Write frequently)。
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 行 时,必须执行压缩。 - 保留原则:
- User Imperatives: 用户强烈要求的命令、偏好、红线(High Priority)。
- Project Skeleton: 项目核心框架、关键路径、当前阶段里程碑(Medium Priority)。
- Active Blockers: 正在阻碍当前任务的问题(High Priority)。
- 丢弃/归档原则:
- Details: 已完成任务的执行细节 -> 移至
memory_archive.md。 - Logs: 过程性的成功/失败日志 -> 移至
memory_archive.md或直接删除。 - Expired Context: 已失效的临时变量或不再相关的上下文 -> 直接删除。
- Details: 已完成任务的执行细节 -> 移至
Usage Tips
- 保持
memoryskill.md轻量(建议 < 100 行),以便随时快速读取。 - 归档是手动触发的动作(由模型决定何时剪切粘贴)。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

