# agent_memory_skill **Repository Path**: perry-space/agent_memory_skill ## Basic Information - **Project Name**: agent_memory_skill - **Description**: 一个专注于智能体记忆与技能管理的开源库,支持高效存储、检索与复用代理经验,提升AI代理的上下文感知与持续学习能力。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2026-08-06 - **Last Updated**: 2026-10-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Agent Memory(`.memory`) > A portable `.memory/` convention + skill that lets **every** AI IDE / CLI agent share one project memory — via git, no cloud, no lock-in. 跨 IDE / CLI / 其他 Agent 的 **项目记忆** 开放约定与 Skill 包。 [English](README.en.md) · 中文 [![gitee](https://img.shields.io/badge/gitee-perry--space-blue)](https://gitee.com/perry-space/agent_memory_skill) [![release](https://img.shields.io/badge/release-v0.2.1-green)](https://gitee.com/perry-space/agent_memory_skill/releases/tag/v0.2.1) [![license](https://img.shields.io/badge/license-MIT-green)](LICENSE) [![platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-blue)](#) ## 为什么 换一个 IDE / CLI Agent,上下文就全丢——因为每个工具都在**自己的私有位置**存记忆:Cursor 的 Memories 只有 Cursor 能读,Claude 的 `CLAUDE.md` 只有 Claude 读,互相不通。 `.memory` 的做法:记忆放在仓库根目录、随 git 走,**把所有工具的入口统一软链接到这一份**: | 工具原生入口 | 归一方式 | |------|------| | `AGENTS.md` / `CLAUDE.md` / `GEMINI.md` | 软链接 → `.memory/ENTRY.md` | | `.cursor/rules` / `.codebuddy/rules` / `.windsurf/rules` | 软链接 → `.memory/RULE.md` | - **零依赖**:纯 Markdown + shell + git,无服务、无云端、无向量库 - **真·跨工具**:任何能读文件的 Agent 即刻接入;软链接随 `git clone` 传播,团队开箱即用 - **可审计**:记忆有版本历史,可 diff、可回滚、可 review - **不靠 AI 自觉**:软约束(规则自动注入)+ 硬约束(pre-commit 门禁:改代码未更新记忆则拒绝提交) ``` $ git commit -m "fix: 订单超时" ✗ [agent-memory] 本次提交改了代码,但 .memory/ 没有任何更新 ``` ## 30 秒上手 ```bash # 1. 一次性安装(二选一) # 本地 clone: git clone https://gitee.com/perry-space/agent_memory_skill.git ~/tools/agent-memory bash ~/tools/agent-memory/scripts/install.sh # 或 curl 一键(锁版本用 v0.2.2,裸 master 跟最新): bash <(curl -sL https://gitee.com/perry-space/agent_memory_skill/raw/master/scripts/install.sh) # 锁特定版本: AGENT_MEMORY_REF=v0.2.2 bash <(curl -sL https://gitee.com/perry-space/agent_memory_skill/raw/v0.2.2/scripts/install.sh) # 2. 每个项目一次 cd /path/to/your-project agent-memory-init ``` `init` 结束时会**打印一段可复制的提示词**——粘给任意 Agent(Cursor、Claude Code、Gemini CLI、cursor-agent…)即可继续工作。换工具时续作不断线: ```bash # Cursor 里干到一半,切到 Claude Code: claude # 粘贴 init 打印的提示词 → 从 .memory/CURRENT.md 继续下一步 ``` 换新 IDE / 新智能体时补一次链接(幂等): ```bash agent-memory-link # --force 可强制替换已有入口 ``` ## 目录约定 ``` .memory/ README.md # 索引 ENTRY.md # 各工具根入口软链接的目标 RULE.md # 各工具 rules 目录软链接的目标(带 frontmatter) CURRENT.md # 当前状态 + 下一步(续作必读) conventions.md # 项目协作约定(语言、提交、禁区等) backlog.md # 待办 / 风险 log/ # 会话摘要(YYYY-MM-DD-slug.md) ``` **权威规则**:聊天 transcript 不是真相;`.memory/CURRENT.md` 才是。 **入口归一**:任何 Agent 发现入口缺失或含与 `.memory` 重复的状态,先补链接再干活;收尾只写 `.memory`,不写入口文件。 ## 脚本 | 脚本 | 用途 | |------|------| | `scripts/install.sh` | 一次性全局安装(clone 后 `bash` 即可) | | `scripts/init-memory.sh` | 初始化 `.memory` + 入口软链接 + pre-commit 门禁,末尾打印 Agent 提示词 | | `scripts/link-memory.sh` | 各工具入口软链接到 `.memory`(幂等) | | `scripts/check-memory.sh` | 提交门禁:改代码未更新 `.memory/` 则拒绝提交 | | `scripts/agent-continue.sh` | `cursor-agent` 从 `.memory` 续作 | ## 给 Agent 的 Skill [`SKILL.md`](SKILL.md) — 可复制到 `.cursor/skills/agent-continue/` 或 `~/.cursor/skills/agent-continue/`;`init` 默认软链接到本包目录,包更新即全局生效。 ## 文档 - [`docs/integration.md`](docs/integration.md) — 各工具接入细节、硬约束四层机制、迁移与 CI - [`CHANGELOG.md`](CHANGELOG.md) — 版本历史 ## License [MIT](LICENSE) © 2026 agent-memory-skill contributors