memory-policy
Approve and synchronize durable personal memory writes across Codex, Claude Code, and Cursor. Use for creating, updating, deleting, migrating, or synchronizing memories. Do not invoke for ordinary recall or questions about an already stored preference.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- memory-policy
- description
- Approve and synchronize durable personal memory writes across Codex, Claude Code, and Cursor. Use for creating, updating, deleting, migrating, or synchronizing memories. Do not invoke for ordinary recall or questions about an already stored preference.
02 资源文件 17
- 参考文档references/installation.md3.4 KB
- 参考文档references/native-interfaces.md13.6 KB
- 脚本scripts/activation.py10.6 KB
- 脚本scripts/cursor_context.py3.8 KB
- 脚本scripts/cursor_hooks.py3.4 KB
- 脚本scripts/cursor_projection.py3.2 KB
- 脚本scripts/install.py5.5 KB
- 脚本scripts/layout.py2.1 KB
- 脚本scripts/memory_files.py6.2 KB
- 脚本scripts/native_backends.py17.7 KB
- 脚本scripts/portable.py24.8 KB
- 脚本scripts/status.py6.0 KB
- 脚本scripts/sync.py9.7 KB
- 脚本tests/test_activation.py22.3 KB
- 脚本tests/test_cursor_context.py10.6 KB
- 脚本tests/test_portable.py21.8 KB
- 脚本tests/test_sync.py14.9 KB
03 SKILL.md 正文
Memory policy
Synchronize approved personal memories with one shared command. Codex and Claude use their native memory files. Cursor uses an explicitly configured file bridge. Keep each product's native features enabled. Installing bstack alone does not activate memory or authorize storing personal notes. Once the user authorizes setup or an exact memory operation, do not ask again for that same action.
Optional setup
For installation requests, follow portable setup. Use scripts/portable.py to inspect the installation or preview setup. Apply its unchanged plan only within the user's authorized setup scope. Setup changes user-wide configuration, preserves existing notes, and never migrates their content. A detected legacy installation stays in place; portable setup does not replace it.
The active user skill is ~/.agents/skills/memory-policy. Use its scripts for note operations, even when this document was read from a project bundle. Project updates and removal do not own that runtime. Grok has no memory adapter in this component.
Recall
For a question about an already stored memory, answer directly from supplied context. Do not start the approval workflow, read compatibility references, or run sync status. If this skill was invoked for ordinary recall, return to answering the question. If the fact is missing from context, read the relevant native memory source or Cursor bridge once. Investigate sync only when the user asks for diagnosis or stored copies conflict. Do not narrate routine retrieval or explain storage provenance unless asked.
Cursor receives approved personal notes through ~/.cursor/rules/personal-memories.mdc and a read-only beforeSubmitPrompt hook that supplies the current verified snapshot. The hook avoids cached rule discovery in already-open workspaces and supersedes older snapshots after updates or deletions. The bridge remains the source. Reading it with an agent tool is a fallback, not a startup requirement.
Before a memory change
- Classify the proposed content. Memories may contain personal facts, agent behavior preferences, and general process or operating preferences. App architecture, repository commands, environment setup, debugging discoveries, and project decisions belong in the relevant project rules,
AGENTS.md, skill, or documentation. Route them there under the ordinary task authorization. - Show the exact addition, old/new text for an update, or exact item for deletion. Name the destinations: Codex native memory, Claude native memory, and Cursor's file bridge. Obtain explicit approval from the user for that content and operation before writing anywhere. A direct request to remember or forget exact content can supply approval; do not ask twice when the scope is already clear. Approval to implement a task or this policy does not approve memories inferred from it. Examples of possible preferences are not instructions to save those preferences.
- Keep an unapproved candidate in the current conversation. Do not save it in a native memory, proposal file, persistent queue, rule, or skill to work around approval. Ordinary session transcripts are outside this workflow.
- Check the native interfaces before changing a destination. Read native-interfaces.md and run
python3 ~/.agents/skills/memory-policy/scripts/portable.py statusfor local installation status, thenpython3 ~/.agents/skills/memory-policy/scripts/sync.py statusfor adapter readiness. Recheck compatibility after product updates. File presence does not prove native recall.
Apply approved content
Use scripts/sync.py for every approved create, update, or deletion. All three products are the default destinations. The installed adapters write Codex native files, a user-wide Claude native directory, and Cursor's bridge. The same reviewed operation refreshes Cursor's generated personal-memories.mdc, and the read-only context hook supplies that current approved text before each prompt. Keep the same approved meaning across products; format differences must not add facts or broaden the preference.
Preflight all destinations. If configuration has drifted or a destination is unavailable, repair the authorized installation when possible and retry the same approved operation. Do not silently save a partial copy or switch to private databases/RPCs. Cursor's configured bridge is an intentional installed destination, not a missing native adapter. A reduced destination set requires explicit approval of a partial save.
Preview the operation with the helper before applying it. Keep a stable note ID for later updates and deletion. Review the exact old/new content, destination paths, and plan digest against the user's approval, then apply that unchanged plan. A digest binds the operation and observed files; it is not evidence of human consent. A changed plan needs review before retrying. Never use an apply option to bypass the conversational approval requirement.
After writing, inspect every destination. Report physical file readback separately from fresh-session native or bridge recall. Retry only the unchanged approved meaning and destinations; inspect existing IDs and content first to avoid duplicates. Updates and deletions need the same approval and readback as additions. Never resurrect a deleted memory from a stale copy. If an operation partially fails, report the written copies and pending work; do not pretend separate native files commit atomically.
Leave existing memories intact until the user approves the concrete migration, correction, or removal. Finding a project-specific memory does not authorize deleting it.
Shared command
Use the installed script, so Codex, Claude, and Cursor invoke the same implementation:
python3 ~/.agents/skills/memory-policy/scripts/sync.py status
python3 ~/.agents/skills/memory-policy/scripts/sync.py inspect NOTE_ID
python3 ~/.agents/skills/memory-policy/scripts/sync.py set NOTE_ID --text 'EXACT APPROVED TEXT'
python3 ~/.agents/skills/memory-policy/scripts/sync.py delete NOTE_ID
set and delete only preview. After checking the preview against the user's approval, repeat the unchanged command with --apply-plan PLAN_SHA256 using the returned digest. Quote text safely or use a subprocess argument list. set creates or updates the same stable ID. The helper accepts up to 4096 UTF-8 bytes per note; this is a helper limit, not a product limit.
For an explicitly approved partial save, place --destinations codex,claude before the command. Never add that option merely to work around a failed all-three preflight. --home is for disposable test profiles. Do not edit personal-memories.mdc by hand. It is generated from the managed bridge entries; arbitrary text outside those entries is not copied into it. The helper manages only its own marked entries and topic files; it does not migrate or remove arbitrary preexisting memories. For a portable installation, preview scripts/portable.py setup and apply its reviewed plan to repair an already-authorized setup. For a source-linked legacy installation, use its original scripts/install.py --activate-sync preview and --apply after checking the plan. Do not convert a legacy installation implicitly. Native generation settings must remain unchanged.
Background writers and limits
Apply this policy when extracting, consolidating, dreaming, or maintaining subagent memory whenever this instruction is available. A hook must check human approval for the exact operation; an agent-supplied approved: true is not evidence. Generic permission prompts are not a substitute for reviewing the memory content.
The Cursor context hook only reads approved synchronized content for recall. It does not write, approve, or propagate memories. A skill cannot guarantee control over internal background writers that never receive it. A watcher observes writes after the fact. Report unapproved drift without propagating it or automatically deleting it. Do not claim pre-write enforcement without testing that specific writer and its failure paths.
Do not disable native memory or silently change generation settings to make enforcement appear complete. If enabled native generation and mandatory approval cannot both be enforced, disclose the product limitation. Installation of this policy alone is not evidence that native synchronization works.
04 同仓库更多 Skills
bstack
Install or upgrade the bundled bstack collection when the user asks to set up or update bstack in a project.
why
Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.
unslop
Cut AI tells from any writing. Must always apply.
typescript-best-practices
TypeScript best practices. Use when reading or editing any .ts or .tsx file.
technical-writing
Layered technical-writing standard: Diátaxis structure, Google developer style sentences, STE instruction rules, Global English syntax. Use for /technical-writing or when writing or reviewing docs, RFCs, readmes, PR descriptions, or commit messages.
teach
Explain a body of work plainly so a person actually understands it. Runs the `how` and `why` skills and weaves what they find into one clear explanation. Use for 'teach me this', 'help me really understand X', 'explain this change or subsystem to me'.