memory-manage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesememory-manage
内存管理
Unified management of the ai-context/ memory layer. Three modes: init, update, maintain.
Triggers: , , , initialize memory, update memory, maintain memory, memory housekeeping, clean ai-context
/memory-init/memory-update/memory-maintain统一管理ai-context/内存层。包含三种模式:初始化(init)、更新(update)、维护(maintain)。
触发指令:, , , initialize memory, update memory, maintain memory, memory housekeeping, clean ai-context
/memory-init/memory-update/memory-maintainMode Detection
模式检测
Determine the mode from the invocation:
- or "initialize memory" or "generate ai-context" → init mode
/memory-init - or "update memory" or "sync memory" or "record session" → update mode
/memory-update - or "maintain memory" or "memory housekeeping" or "clean ai-context" → maintain mode
/memory-maintain
根据调用指令判断模式:
- 或 "initialize memory" 或 "generate ai-context" → 初始化模式(init mode)
/memory-init - 或 "update memory" 或 "sync memory" 或 "record session" → 更新模式(update mode)
/memory-update - 或 "maintain memory" 或 "memory housekeeping" 或 "clean ai-context" → 维护模式(maintain mode)
/memory-maintain
Mode: init
模式:初始化(init)
Creates the 5 core ai-context/ files from scratch by reading the project.
Use when: Project has no yet, or you want to regenerate from scratch.
ai-context/通过读取项目内容,从头创建5个核心ai-context/文件。
适用场景:项目尚未创建目录,或需要从头重新生成该目录下的文件。
ai-context/Process
执行流程
- Project inventory: Read configuration files, folder structure, README, representative source files, tests, CI/CD configs.
- Generate files:
- — tech stack, versions, key tools
ai-context/stack.md - — architectural decisions and rationale
ai-context/architecture.md - — naming patterns, code conventions
ai-context/conventions.md - — known bugs, tech debt, gotchas
ai-context/known-issues.md - — empty, ready for session entries
ai-context/changelog-ai.md
- Feature stubs: Scan for bounded contexts (directories with domain logic). Create and stub files for discovered domains.
ai-context/features/_template.md - Report: List files created and coverage summary.
- 项目盘点:读取配置文件、文件夹结构、README、代表性源码文件、测试文件、CI/CD配置文件。
- 生成文件:
- — 技术栈、版本信息、核心工具
ai-context/stack.md - — 架构决策及理由
ai-context/architecture.md - — 命名规范、代码约定
ai-context/conventions.md - — 已知Bug、技术债务、注意事项
ai-context/known-issues.md - — 空文件,用于记录会话内容
ai-context/changelog-ai.md
- 功能存根生成:扫描有界上下文(包含领域逻辑的目录)。创建模板文件,并为发现的领域生成存根文件。
ai-context/features/_template.md - 生成报告:列出已创建的文件及覆盖范围总结。
Mode: update
模式:更新(update)
Incrementally updates ai-context/ with work done in the current session.
Use when: After completing significant work (SDD cycles, architecture changes, bug fixes).
根据当前会话完成的工作,增量更新ai-context/目录下的文件。
适用场景:完成重要工作后(如SDD周期迭代、架构变更、Bug修复)。
Process
执行流程
- Analyze session: Review what changed — files created/modified, decisions made, bugs fixed, conventions established.
- Update relevant files:
- — new dependencies, version changes
ai-context/stack.md - — new decisions, pattern changes
ai-context/architecture.md - — new naming patterns, style changes
ai-context/conventions.md - — new issues found, resolved issues marked
ai-context/known-issues.md - — append entry with date, summary, files affected
ai-context/changelog-ai.md - — update if relevant domain was touched
ai-context/features/<domain>.md
- Preserve: Never overwrite sections. Only update
[manual]markers.[auto-updated]
- 会话分析:回顾会话中的变更内容——创建/修改的文件、做出的决策、修复的Bug、确立的规范。
- 更新相关文件:
- — 添加新依赖、更新版本信息
ai-context/stack.md - — 记录新决策、架构模式变更
ai-context/architecture.md - — 更新命名规范、代码风格变更
ai-context/conventions.md - — 添加新发现的问题、标记已解决的问题
ai-context/known-issues.md - — 追加条目,包含日期、内容摘要、受影响的文件
ai-context/changelog-ai.md - — 若相关领域有变更则进行更新
ai-context/features/<domain>.md
- 保留规则:绝不覆盖标记的手动维护部分。仅更新
[manual]标记的自动更新区域。[auto-updated]
Mode: maintain
模式:维护(maintain)
Periodic housekeeping: archive old entries, separate resolved issues, detect gaps.
Use when: changelog-ai.md is long (30+ entries), known-issues has resolved items, or at the start of a new project phase.
定期整理工作:归档旧条目、分离已解决的问题、检测文件缺失。
适用场景:条目过多(超过30条)、中有已解决的问题,或进入项目新阶段时。
changelog-ai.mdknown-issues.mdProcess
执行流程
- Changelog archival: If has more than 30 entries, move older entries to
changelog-ai.md.changelog-ai-archive.md - Known-issues cleanup: Move resolved items from to
known-issues.md.known-issues-archive.md - Index generation: Create/update listing all ai-context/ files with one-line descriptions.
ai-context/index.md - Gap detection: Check if CLAUDE.md references ai-context/ files that don't exist. Report gaps.
- Dry-run first: Present all proposed changes, require user confirmation before applying.
- 变更日志归档:若条目超过30条,将旧条目迁移至
changelog-ai.md。changelog-ai-archive.md - 已知问题清理:将中已解决的问题迁移至
known-issues.md。known-issues-archive.md - 生成索引:创建/更新,列出所有ai-context/文件并添加一行描述。
ai-context/index.md - 缺失检测:检查CLAUDE.md中引用的ai-context/文件是否存在,报告缺失情况。
- 先执行预演:展示所有拟执行的变更,需用户确认后再应用。
Rules
规则
- Init mode MUST NOT run if ai-context/ already exists — warn and suggest update mode instead
- Update mode MUST NOT create new core files — only modify existing ones
- Maintain mode MUST present dry-run before any destructive action (archival, moves)
- All modes are read-heavy, write-light — the goal is accurate, concise documentation
- Never overwrite sections in any file
[manual] - Feature file updates follow the format defined in
skills/feature-domain-expert/SKILL.md
- 若目录已存在,禁止运行初始化模式(init mode)——需发出警告并建议使用更新模式
ai-context/ - 更新模式(update mode)禁止创建新的核心文件——仅可修改现有文件
- 维护模式(maintain mode)在执行任何破坏性操作(归档、迁移)前必须先进行预演
- 所有模式均为“多读少写”——目标是生成准确、简洁的文档
- 绝不覆盖任何文件中标记的手动维护部分
[manual] - 功能文件的更新需遵循中定义的格式
skills/feature-domain-expert/SKILL.md