Skip to main content

agent-memory

Initialize or repair an agentMemory .memory directory and root instruction files for Claude Code, Codex, OpenCode, and Gemini CLI. Use when the user invokes /skills, asks to install agent memory, initialize .memory, set up AGENTS/CLAUDE/GEMINI memory pointers, or avoid repeating the agentMemory install command.

Informations de source

Dépôt
taichuy/agentMemory
Dernière activité de la source
5 mai 2026 à 15:33
Langue détectée de SKILL.md
anglais
Étoiles
24
Forks
3

Options d'installation

Le prompt qui vérifie d'abord la source est sélectionné par défaut. Vous pouvez passer à une commande directe ou télécharger une copie locale.

Vérifiez les fichiers source

Lisez SKILL.md et les fichiers associés affichés par SkillsMP avant de décider de l'installer.

Explorateur de fichiers
16 fichiers

Affichage de SKILL.md

SKILL.md
Instructions source · Aperçu en lecture seule
name
agent-memory
description
Initialize or repair an agentMemory .memory directory and root instruction files for Claude Code, Codex, OpenCode, and Gemini CLI. Use when the user invokes /skills, asks to install agent memory, initialize .memory, set up AGENTS/CLAUDE/GEMINI memory pointers, or avoid repeating the agentMemory install command.
# Agent Memory Initialize the current project with the `taichuy/agentMemory` memory template. The goal is to make project memory available to coding agents without asking the user to paste the remote install command. ## Workflow 1. Treat the current working directory as the target project unless the user gives another path. 2. Do not overwrite an existing `.memory/` directory unless the user explicitly asks for force/overwrite. 3. Prefer the bundled installer from this skill directory. Use the known skill path if the tool exposes it; otherwise try the global paths created by the installer: ```bash python <skill-dir>/scripts/install-memory.py --dest . python "$HOME/.codex/skills/agent-memory/scripts/install-memory.py" --dest . python "$HOME/.claude/skills/agent-memory/scripts/install-memory.py" --dest . python "$HOME/.config/opencode/skills/agent-memory/scripts/install-memory.py" --dest . python "$HOME/.gemini/skills/agent-memory/scripts/install-memory.py" --dest . ``` In Claude Code, `${CLAUDE_SKILL_DIR}` may be used as `<skill-dir>`. If `python` is unavailable, try `python3` or `py`. If the user asked to replace an existing `.memory/`, add `--force`. 4. If the bundled script cannot run, manually copy `assets/memory-template/.memory` into the target project as `.memory`, then create or update these root files: - `AGENTS.md` - `CLAUDE.md` - `GEMINI.md` 5. The root instruction files must contain this block, or an equivalent existing reference: ```markdown # 记忆 命中对应`记忆存储规则`自动更新对应记忆中 @.memory/AGENTS.md ## 用户偏好 @.memory/user-memory.md ``` 6. If a root instruction file already exists and already references `.memory/AGENTS.md` and `.memory/user-memory.md`, leave it unchanged. 7. If a root instruction file exists but lacks the memory references, append the memory block instead of replacing the user's content. 8. Finish by reporting whether `.memory/` was installed, kept, or replaced, and which instruction files were created or updated. 9. Before ending the turn, infer the user's primary communication language from the current conversation and project files. Ask in that language whether to initialize `.memory/user-memory.md`. Do not write user memory before the user confirms. 10. If the user confirms, ask one compact initialization question group adapted to the project context. Include: - Whether the inferred primary communication language is correct. - The user's role or responsibility in this project. - Main programming language, stack, and experience level. If the project reveals likely stack details, mention them as a hypothesis for confirmation. - Preferred collaboration style: discuss first, implement directly with reasonable assumptions, or ask before risky choices. - Preferred output style: concise, detailed, code-first, explanation-first, Chinese/English/bilingual, etc. - Implementation, verification, and git preferences: when to run tests, whether to stage/commit, and what needs confirmation. - Memory boundaries: anything the user does not want stored as long-term user memory. 11. After the user answers, update `.memory/user-memory.md` from the template. Preserve useful existing content, merge rather than replacing non-template memory, and use absolute timestamps in `yyyy-mm-dd hh` format. ## Post-install Prompt Use this shape after installation, translated to the user's inferred language: ```text 我判断你的主流使用语言是:中文。是否现在初始化 `.memory/user-memory.md`? 如果确认,请一次性回答下面这些问题;如果暂时不想初始化,回复“跳过”即可。 1. 你在这个项目里的角色/职责是什么? 2. 你的主力编程语言、技术栈、经验年限和擅长方向是什么? 3. 我从当前项目判断它偏向 <项目类型/技术栈假设>,这个判断是否正确?需要补充什么? 4. 需求不明确时,你希望我先讨论确认,还是先按合理假设推进? 5. 你偏好的输出风格是什么?例如简短结论、详细解释、代码优先、中文/英文/双语。 6. 实现、验证、git stage/commit/push 分别希望我默认怎么处理? 7. 哪些内容不要写入长期用户记忆? ``` ## Notes - `AGENTS.md` covers Codex and other agents that follow the AGENTS.md convention. - `CLAUDE.md` covers Claude Code. - `GEMINI.md` covers Gemini CLI. - OpenCode can use both AGENTS.md-style project context and globally installed Agent Skills.
Voir sur GitHub