Clear-Mind Skill
Memory hygiene system to prevent MEMORY.md bloat.
When to Use
Activate this skill when:
- - Factual information (portfolio, projects, technical details) accumulates in MEMORY.md — Primary trigger condition
- Memory cleanup is requested
- Periodic maintenance (recommended monthly)
Important: Do NOT use file size (lines/tokens) as the trigger. A large MEMORY.md with only core rules is fine. Only act when factual bloat is detected.
Pre-Flight: First-Run User Check
Before starting the first clear-mind task:
"Note: The following categories will be kept in MEMORY.md for quick access:
- - Installed Skills list — needed for every task
- Technical Setup — agent capabilities and frequent-use configs
Only factual information used for specific scenarios (projects, portfolio, historical events) will be migrated.
Are there any other factual categories you'd like to keep in MEMORY.md?"
Wait for user confirmation before proceeding to Core Workflow.
Content Migration Rules
KEEP in MEMORY.md
- - Core behavioral rules (Honesty, Temporal Verification, etc.) — immutable principles
- Task index (name + path only) — for navigation
- Quick Index table — for factual information access
- Minimal architecture notes — essential system structure
- All Technical Setup — agent capabilities, installed skills, configs, tools that are frequently accessed. If it's about "what I can do," it stays.
- Any information that defines the agent's identity or capabilities — this is core functionality
MOVE to facts/
- - Historical events and incidents — specific past occurrences
- Project details and statuses — concrete project information
- Portfolio holdings — specific investment data
- User preference lists — specific user choices
- Scenario-specific information — data relevant only to particular situations
DELETE
- - Redundant summaries — information already captured elsewhere
- Outdated temporary notes — expired or irrelevant information
- Information already in other systems — duplicate data
Clear Distinction Guidelines
DEFINITELY KEEP in MEMORY.md (NO EXCEPTIONS)
- - Rules that define agent behavior
- Instructions for how the agent should operate
- Capabilities and limitations
- Installed skills list
- Tool descriptions and usage guidelines
- System architecture fundamentals
DEFINITELY MOVE to facts/
- - Specific dates and events
- Project names, deadlines, and statuses
- Financial data and investment holdings
- User-specific preferences (e.g., "I prefer blue themes")
- Historical interactions and their outcomes
Migration Principle: Only move facts that are scenario-specific (this project, that stock, past events). Capabilities stay, specifics go.
Critical Safeguard: When in doubt, KEEP in MEMORY.md. It's safer to retain information in the core memory than to risk losing important capabilities.
Core Workflow
Phase 1: Analyze Current State
- 1. Read current MEMORY.md
- Check for factual bloat: Are there sections containing specific data that belongs elsewhere?
- Identify content categories:
-
Core Rules (keep in MEMORY.md)
-
Factual Information (migrate to facts/)
-
Task Indexes (keep minimal version)
-
Redundant Content (consolidate or remove)
Skip if: MEMORY.md contains only core rules and indexes — even if the file is large.
Phase 2: Create facts/ Directory Structure
Ensure /memory/facts/ exists with these files:
CODEBLOCK0
Note: technical-setup.md is kept for backward compatibility. New technical content goes to MEMORY.md.
Phase 3: Migrate Content
Move factual details from MEMORY.md to appropriate facts/ files:
| Source Section | Target File | Migration Rule |
|---|
| Critical Events | critical-events.md | Move full details, keep index link |
| Projects |
projects.md | Move all project details |
| Technical Setup | technical-setup.md |
KEEP in MEMORY.md — agent capabilities stay; only move niche/deprecated configs if requested |
| Portfolio/Trading | portfolio.md | Move holdings, strategies |
| User Directives | user-directives.md | Move preferences, quotes |
Phase 4: Rewrite MEMORY.md
New structure:
CODEBLOCK1
Phase 5: Verify
Check results:
- - [ ] All facts/ files created with migrated content
- [ ] No information lost
- [ ] Quick Index table complete
- [ ] Core Principles preserved
- [ ] Factual bloat removed (not line count reduced)
Rollback Mechanism
When to Use Rollback
Activate rollback when:
- - User requests to restore specific categories of information
- Migration resulted in unintended data loss
- User wants to revert to previous memory structure
Rollback Workflow
- 1. Assessment: Determine which categories need to be restored
- Backup Current State: Create backup of current MEMORY.md and facts/ directory
- Selective Restoration:
-
Specific Category: Copy content from facts/ file back to MEMORY.md
-
Entire Memory: Restore from backup or rebuild from facts/ files
- 4. Update Quick Index: Adjust links based on new structure
- Verification: Ensure all content is properly restored
Rollback Scenarios
| Scenario | Action |
|---|
| Restore specific category | Copy content from facts/[category].md back to MEMORY.md |
| Rollback entire memory |
Rebuild MEMORY.md from all facts/ files and core rules |
| Undo recent migration | Restore from pre-migration backup if available |
Success Metrics
- - Factual bloat removed — all migrated content is factual, not core rules
- All factual information preserved in facts/ files
- Quick Index enables fast navigation between core memory and facts
- Core rules and capabilities remain intact in MEMORY.md
- Rollback capability maintained with proper backups
- User verification completed at key decision points
- No critical information lost during the process
Critical Safety Metrics:
- - 100% of core behavioral rules remain in MEMORY.md
- 100% of capability definitions are preserved
- 100% of tool descriptions remain unchanged
- 100% of installed skills information is retained
Anti-Goal: Reducing line count is NOT the goal. Removing factual bloat while preserving core capabilities IS.
Template: facts/ Files
critical-events.md
CODEBLOCK2
projects.md
CODEBLOCK3
technical-setup.md
CODEBLOCK4
portfolio.md
CODEBLOCK5
user-directives.md
CODEBLOCK6
Remember
MEMORY.md is for rules and navigation, not storage.
Factual details belong in specialized files.
Rollback capability is essential — always maintain backups and ensure the ability to restore information when requested.
清晰思维技能
防止MEMORY.md文件臃肿的记忆卫生系统。
使用时机
在以下情况激活此技能:
- - 事实信息(作品集、项目、技术细节)在MEMORY.md中积累 — 主要触发条件
- 用户请求清理记忆
- 定期维护(建议每月一次)
重要提示:不要以文件大小(行数/字符数)作为触发条件。一个只包含核心规则的大型MEMORY.md文件是没问题的。仅在检测到事实信息臃肿时才执行操作。
预检:首次运行用户确认
在开始首次清晰思维任务之前:
注意:以下类别将保留在MEMORY.md中以供快速访问:
- - 已安装技能列表 — 每个任务都需要
- 技术配置 — 代理能力和常用配置
仅用于特定场景的事实信息(项目、作品集、历史事件)将被迁移。
您是否还有其他希望保留在MEMORY.md中的事实类别?
等待用户确认后再进入核心工作流程。
内容迁移规则
保留在MEMORY.md中
- - 核心行为规则(诚实、时间验证等)— 不可变更的原则
- 任务索引(仅名称+路径)— 用于导航
- 快速索引表 — 用于访问事实信息
- 最小化架构说明 — 必要的系统结构
- 所有技术配置 — 代理能力、已安装技能、配置、常用工具。如果是关于我能做什么的内容,则保留。
- 任何定义代理身份或能力的信息 — 这是核心功能
迁移到facts/
- - 历史事件和事故 — 具体的过去发生事件
- 项目详情和状态 — 具体的项目信息
- 投资组合持仓 — 具体的投资数据
- 用户偏好列表 — 具体的用户选择
- 场景特定信息 — 仅与特定情况相关的数据
删除
- - 冗余摘要 — 已在其他地方记录的信息
- 过时的临时笔记 — 已过期或不相关的信息
- 已在其他系统中的信息 — 重复数据
清晰区分指南
绝对保留在MEMORY.md中(无例外)
- - 定义代理行为的规则
- 代理如何操作的指令
- 能力和限制
- 已安装技能列表
- 工具描述和使用指南
- 系统架构基础
绝对迁移到facts/
- - 具体日期和事件
- 项目名称、截止日期和状态
- 财务数据和投资持仓
- 用户特定偏好(例如我喜欢蓝色主题)
- 历史交互及其结果
迁移原则:仅迁移场景特定的事实(这个项目、那只股票、过去的事件)。能力保留,具体内容迁移。
关键保障:如有疑问,保留在MEMORY.md中。将信息保留在核心记忆中比冒险丢失重要能力更安全。
核心工作流程
第一阶段:分析当前状态
- 1. 读取当前MEMORY.md
- 检查事实信息臃肿:是否存在包含应属于其他位置的具体数据的章节?
- 识别内容类别:
-
核心规则(保留在MEMORY.md中)
-
事实信息(迁移到facts/)
-
任务索引(保留最小版本)
-
冗余内容(合并或删除)
跳过条件:如果MEMORY.md仅包含核心规则和索引 — 即使文件很大。
第二阶段:创建facts/目录结构
确保/memory/facts/存在以下文件:
memory/facts/
├── critical-events.md # 重要事件和教训
├── projects.md # 活跃项目状态
├── technical-setup.md # 已弃用 — 技术配置现在保留在MEMORY.md中
├── portfolio.md # 股票、投资、策略
└── user-directives.md # 用户偏好和指令
注意:technical-setup.md保留用于向后兼容。新的技术内容应放入MEMORY.md。
第三阶段:迁移内容
将事实细节从MEMORY.md移动到相应的facts/文件:
| 源章节 | 目标文件 | 迁移规则 |
|---|
| 关键事件 | critical-events.md | 移动完整详情,保留索引链接 |
| 项目 |
projects.md | 移动所有项目详情 |
| 技术配置 | technical-setup.md |
保留在MEMORY.md中 — 代理能力保留;仅在请求时移动小众/已弃用的配置 |
| 投资组合/交易 | portfolio.md | 移动持仓、策略 |
| 用户指令 | user-directives.md | 移动偏好、引用 |
第四阶段:重写MEMORY.md
新结构:
markdown
MEMORY.md - 长期记忆
精选规则和索引。详细事实单独存储。
任务、计划和使命
[任务名称]
当前计划:/memory/YYYY-MM-DD.md
快速索引(事实信息)
| 类别 | 位置 |
|---|
| 关键事件 | /memory/facts/critical-events.md |
| 活跃项目 |
/memory/facts/projects.md |
| 技术配置 |
MEMORY.md(代理能力) |
| 投资组合 | /memory/facts/portfolio.md |
| 用户指令 | /memory/facts/user-directives.md |
核心原则(不可变更)
[仅保留必要规则 - 最多6-8项]
认知记忆系统
[架构的最小化参考]
第五阶段:验证
检查结果:
- - [ ] 所有facts/文件已创建并包含迁移内容
- [ ] 无信息丢失
- [ ] 快速索引表完整
- [ ] 核心原则已保留
- [ ] 事实信息臃肿已移除(而非减少行数)
回滚机制
何时使用回滚
在以下情况激活回滚:
- - 用户请求恢复特定类别的信息
- 迁移导致意外数据丢失
- 用户希望恢复到之前的记忆结构
回滚工作流程
- 1. 评估:确定需要恢复哪些类别
- 备份当前状态:创建当前MEMORY.md和facts/目录的备份
- 选择性恢复:
-
特定类别:将内容从facts/文件复制回MEMORY.md
-
整个记忆:从备份恢复或从facts/文件重建
- 4. 更新快速索引:根据新结构调整链接
- 验证:确保所有内容已正确恢复
回滚场景
| 场景 | 操作 |
|---|
| 恢复特定类别 | 将内容从facts/[category].md复制回MEMORY.md |
| 回滚整个记忆 |
从所有facts/文件和核心规则重建MEMORY.md |
| 撤销最近迁移 | 如果可用,从迁移前备份恢复 |
成功指标
- - 事实信息臃肿已移除 — 所有迁移内容均为事实信息,而非核心规则
- 所有事实信息已保留在facts/文件中
- 快速索引支持核心记忆与事实之间的快速导航
- 核心规则和能力在MEMORY.md中保持完整
- 通过适当备份维护回滚能力
- 在关键决策点完成用户验证
- 过程中无关键信息丢失
关键安全指标:
- - 100%的核心行为规则保留在MEMORY.md中
- 100%的能力定义得到保留
- 100%的工具描述保持不变
- 100%的已安装技能信息得到保留
反目标:减少行数不是目标。在保留核心能力的同时移除事实信息臃肿才是。
模板:facts/文件
critical-events.md
markdown
关键事件记录
YYYY-MM-DD:事件名称
- - 发生了什么:[描述]
- 根本原因:[分析]
- 教训:[关键收获]
- 状态:[已解决/进行中]
projects.md
markdown
活跃项目状态
项目:[名称]
- - 状态:[待处理/活跃中/已完成]
- 用户角色:[角色]
- 我的角色:[角色]
- 约束条件:[任何限制]
technical-setup.md
markdown
技术设置与配置(存档)
已弃用:技术配置和已安装技能现在保留在MEMORY.md中以供快速访问。
此文件仅用于历史参考。
已存档内容
[迁移前的任何遗留技术笔记]
portfolio.md
markdown
投资组合与策略
持仓
- - 代码:[股票代码]
- 数量:[数字]
- 买入价格:[金额]
- 当前价格:[金额]
- 状态:[持有/卖出/买入]
策略