name: memory description: Persist rules, conventions, or lessons into AGENTS.md files so future sessions benefit. Load this skill before writing to global memory (~/.agents/AGENTS.md) or any project AGENTS.md.
The two memory targets
Global memory (~/.agents/AGENTS.md) — rules that apply to every coding session across every project.
Source: ~/.local/share/chezmoi/home/dot_agents/AGENTS.md
Local memory (AGENTS.md in the current project root or nearest ancestor) — rules specific to that codebase.
Source: edit that file directly; it is not managed by chezmoi.
For rules specific to the chezmoi dotfiles repo itself, use ~/.local/share/chezmoi/AGENTS.md.
Updating global memory
Read
~/.local/share/chezmoi/home/dot_agents/AGENTS.md.Edit it with the Edit tool. Never write from scratch; always preserve existing content.
Run
chezmoi apply ~/.agents/AGENTS.mdto deploy just that file. Never run a barechezmoi apply: it sweeps unrelated changes elsewhere in the dotfiles tree and can apply work-in-progress edits you didn't intend.Commit and push:
git -C ~/.local/share/chezmoi add home/dot_agents/AGENTS.md git -C ~/.local/share/chezmoi commit -m "chore(agents): <description>" git -C ~/.local/share/chezmoi pull --rebase git -C ~/.local/share/chezmoi push
Updating local memory
- Read the project AGENTS.md.
- Edit it in place with the Edit tool.
- Commit and push using the project's git repo.
Quality rules
- Never edit
~/.agents/AGENTS.mddirectly; it is managed by chezmoi. - Never remove existing rules unless explicitly instructed.
- Review nearby rules for contradictions, duplication, and scope conflicts; reconcile in the same edit.
- Keep rules at the narrowest correct scope: cross-cutting rules in global memory, project-specific rules in local memory.
- No em dashes. Use commas, colons, or restructured sentences.
- After committing, always push. Work is not complete until pushed.