Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

memory-protocol内存协议

Agent Skill

memory-protocol 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,896

周安装

225

GitHub Stars

2

下载量

1,568
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:memory-protocol(内存协议)
来源仓库:https://github.com/jwilger/agent-skills
仓库路径:skills/memory-protocol
安装命令:
npx skills add https://github.com/jwilger/agent-skills --skill memory-protocol
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jwilger/agent-skills --skill memory-protocol

简介

memory-protocol 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。

  • 它适用于研究检索类任务,可帮助 Agent 理解和实施记忆相关的协议规范。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法和功能边界。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • 使用时需注意该技能属于研究检索类别,主要功能聚焦于信息定位而非直接执行系统级操作。

SKILL.md

Memory Protocol

Value: Feedback -- accumulated knowledge creates compound feedback loops across sessions. What you learn today should accelerate tomorrow's work.

Purpose

Teaches the agent to systematically store and recall project knowledge across sessions using the Memento MCP knowledge graph.

Your long-term memory (training data) and short-term memory (context window) are excellent, but mid-term memory for project-specific knowledge outside the current context is poor. Memento addresses this gap by persisting a knowledge graph across sessions and projects.

Solves: context loss between sessions, repeated debugging of known issues, rediscovery of established conventions, repeated user corrections for the same mistakes.

Practices

Verify Memento MCP Availability

Before proceeding, confirm that Memento MCP tools are available (mcp__memento__semantic_search, mcp__memento__create_entities, etc.).

If Memento MCP tools are NOT available, stop and inform the user:

"The memory-protocol skill requires Memento MCP, but I don't have access to mcp__memento__* tools. To enable memory persistence, install and configure the Memento MCP server (https://github.com/gannonh/memento-mcp). Without it, this skill cannot function and I will proceed without cross-session memory."

Then continue working without memory protocol practices — do not attempt a file-based workaround.

Anti-Pattern: File-Based Memory When Memento Is Available

When this skill is active and Memento MCP tools are available, do NOT use any file-based memory system for cross-session knowledge storage. This includes the built-in memory/ directory, MEMORY.md index, auto-memory features, or any other file-based persistence mechanism. All cross-session memory storage goes through Memento MCP tools exclusively.

File-based memory systems and Memento serve the same purpose — persisting knowledge across sessions. Using both creates split-brain: knowledge stored in files is invisible to Memento searches, and knowledge in Memento is invisible to file reads. Pick one. When this skill is loaded, Memento is the one.

Note: this does NOT prohibit WORKING_STATE.md (which is crash-recovery infrastructure, not cross-session memory) or project documentation files (which are deliverables, not memory).

Recall Before Acting — NON-NEGOTIABLE

Before starting any non-trivial task, recall relevant past knowledge. This step is mandatory. Do not skip it because "this seems simple" or because you believe you remember from a prior session — you do not retain memory between sessions.

Recall triggers:

  • Starting any non-trivial task
  • Making architectural or design decisions
  • Unsure about a project convention
  • Before asking the user a question (it may already be answered)

For error-triggered recall, see the dedicated section below.

Apply Multi-Dimensional Search (next section) to every recall event.

How to recall — all three steps are required:

  1. Search: mcp__memento__semantic_search — query describing the current work, limit 10. This returns summaries only — not the full picture.
  2. Open: mcp__memento__open_nodes — for EVERY relevant entity returned by search, call open_nodes to retrieve the complete entity: all observations, all relations, full context. Do NOT skip this step. Semantic search returns partial data; the full entity often contains critical details (caveats, corrections, related warnings) that the search summary omits. Skipping open_nodes means you are acting on incomplete information.
  3. Traverse: Follow relations on opened entities to discover connected knowledge. Call open_nodes on each related entity. Continue traversing until results are no longer relevant. Relations like depends_on, contradicts, supersedes, and part_of frequently point to information that changes how you should act — a fix that depends on a workaround, a convention that was later corrected, a decision that was superseded.

Skipping steps 2 or 3 defeats the purpose of a knowledge graph. A flat keyword search could do step 1 alone — the graph's value is in the connections between knowledge. If you only search and never open or traverse, you will miss counter-information, corrections, and dependencies that would have prevented mistakes.

IMPORTANT: Do NOT use mcp__memento__read_graph — memories span all projects and the graph is too large to be useful.

Multi-Dimensional Search

Every recall event requires at least two searches — not just one. The reason: agents consistently search for the technical topic but miss process and workflow learnings that would prevent repeated mistakes. Prior session logs show patterns of the same user corrections recurring (team member usage, ADR process, TDD workflow, build commands, approval process) because agents only searched for the feature name and never for process learnings about the *type of work* being done.

Required search dimensions:

  1. Technical query: the specific topic, error, feature, or domain concept
  2. Process query: learnings about this *type of work* — mistakes, corrections, workflow insights, conventions for this kind of task
About to...Also search for...
Do TDD work"TDD process mistakes", "ping-pong pairing lessons"
Spawn agents/subagents"team member usage", "agent coordination issues"
Debug an error"debugging workflow mistakes", prior error occurrences
Create an ADR"ADR process", "ADR mistakes"
Commit/PR/merge"commit conventions", "approval process"
Any process step"[process] corrections", "[process] lessons learned"

This table is non-exhaustive. The principle: always ask "what have I learned about doing *this kind of thing*?" in addition to "what do I know about *this specific thing*?"

Error-Triggered Recall — NON-NEGOTIABLE

This is separated from the general recall triggers because error-triggered recall is where agents most consistently fail to search memory. The pattern: an error occurs, the agent immediately starts debugging from scratch, burns through multiple fix attempts, and only much later (if ever) thinks to check whether this problem was solved before. This wastes time and repeats past work.

Fires on:

  • Any error message, stack trace, or unexpected behavior
  • Any test failure
  • Any hook failure (pre-commit, CI, linter)
  • Any process correction from the user ("no, you should do X instead")
  • Any issue not resolved by the immediate obvious fix

The rule: Search memory BEFORE attempting a fix. Not after three failed attempts. Not after spending 10 minutes debugging. Before.

Apply multi-dimensional search:

  • Search for the specific error message or symptom
  • Search for process learnings about this type of situation (e.g., "debugging Node.js module errors", "test failure patterns in this project")

If you've been corrected by the user: search for whether this correction (or a similar one) was already stored in memory. If it was, you failed to recall — acknowledge this and reinforce the memory with updated context.

Store After Discovery

After solving a non-obvious problem, learning a convention, or making a decision, store it immediately — do not wait, you will lose context.

What to store:

  • Solutions to non-obvious problems (with error message as search term)
  • Project conventions discovered while working
  • Architectural decisions and their rationale
  • User preferences for workflow or style
  • Tool quirks and workarounds
  • User corrections — especially process corrections

What not to store:

  • Obvious or well-documented information
  • Temporary values or session-specific facts
  • Verbose narratives (keep entries concise and searchable)

Always search before creating — mcp__memento__semantic_search first. If a related entity exists, extend it with mcp__memento__add_observations rather than creating a duplicate.

Entity naming: <Descriptive Name> <Project> <YYYY-MM> (e.g., "Cargo Test Timeout Fix TaskFlow 2026-01")

Observation format:

  • Project-specific: "Project: <name> | Path: <path> | Scope: PROJECT_SPECIFIC | Date: YYYY-MM-DD | <insight>"
  • General: "Scope: GENERAL | Date: YYYY-MM-DD | <insight>"
  • Each observation must be a complete, self-contained statement

Relationships — ALWAYS create at least one after creating or updating an entity. Use mcp__memento__create_relations to link to related entities. Active-voice relation types: implements, extends, depends_on, discovered_during, contradicts, supersedes, validates, part_of, related_to, derived_from.

See references/memento-protocol.md for entity type table, observation format guide, relationship table, traversal strategy, and examples.

Subagent Responsibilities

This protocol applies to both the main agent AND any subagents to which work is delegated. When instructing a subagent, include the memory protocol requirement explicitly.

Subagents must:

  • Search Memento before beginning their delegated task
  • Apply multi-dimensional search (technical + process queries)
  • Store any new insights discovered during their work
  • Create relationships to existing entities when applicable

Factory Memory

When running inside a pipeline or factory workflow, the pipeline stores operational learnings in .factory/memory/ to optimize future runs.

Types of learnings tracked:

  • CI patterns: Which change types cause CI failures
  • Rework patterns: Common rework causes by gate
  • Pair effectiveness: Which engineer pairs are most effective in which domains
  • Domain hotspots: Files and modules that frequently trigger findings

Standalone users can ignore factory memory; the standard memory practices above remain unchanged.

Prune Stale Knowledge

When you encounter a memory that is no longer accurate (API changed, convention abandoned, bug fixed upstream), update or delete it. Wrong memories are worse than no memories.

Pruning triggers:

  • Memory contradicts current observed behavior
  • Referenced files or APIs no longer exist
  • Convention has clearly changed

Store Before Context Loss

Before context compaction or at natural stopping points, proactively store any unsaved discoveries before knowledge is lost to truncation. This is your last chance before the knowledge evaporates.

WORKING_STATE.md for Long-Running Sessions

For sessions lasting beyond a single task (pipeline runs, multi-slice TDD, team coordination), maintain a WORKING_STATE.md file as insurance against context compaction and crashes.

  • Location: .factory/WORKING_STATE.md (pipeline mode) or project root
  • Update cadence: after every significant state change
  • Read cadence: at session start, after compaction, after any interruption

See references/working-state.md for the full format and examples.

Self-Reminder Protocol

See CONSTRAINT-RESOLUTION.md in the template directory for the consolidated self-reminder protocol (frequency, combined re-read list, and post-compaction rules).

Enforcement Note

Advisory in all modes. Recall and storage discipline are self-enforced. The constraint against read_graph is gating: the tool will return unhelpful results, acting as a natural deterrent.

Hard constraints:

  • Recall before acting on non-trivial tasks: [RP] -- if Memento is unavailable, document the gap, continue without memory, inform user.

Constraints

  • "At least two searches -- not just one": Two searches means two semantically different queries exploring different dimensions of the problem. Searching "auth middleware" and "authentication middleware" is one search with a synonym, not two searches. The spirit is: explore both the technical dimension (what technology/pattern) and the process dimension (what decisions/conventions exist).
  • "Non-trivial task" threshold: A task is non-trivial if its outcome depends on project context -- conventions, prior decisions, architectural choices, or domain knowledge. A task is trivial if any competent agent would produce the same output regardless of project history. When in doubt, recall. The cost of an unnecessary search is seconds; the cost of missing relevant context is rework.

Verification

After completing work guided by this skill, verify:

  • Searched memory (semantic_search) before starting the task
  • Searched for process/workflow learnings, not just technical topic (multi-dimensional search)
  • Searched memory on every non-trivial error before attempting fixes
  • Stored discoveries as Memento entities with structured observations
  • Related entities linked with create_relations
  • Subagents instructed to follow the memory protocol
  • No stale or contradicted memories left uncorrected
  • WORKING_STATE.md maintained for long-running sessions
  • Self-reminder protocol followed (state re-read every 5-10 messages)

Dependencies

This skill requires Memento MCP. For enhanced workflows, it integrates with:

  • debugging-protocol: Search memory before starting the 4-phase investigation
  • user-input-protocol: Store user answers to avoid re-asking the same questions
  • tdd: Store test patterns and domain modeling insights between sessions
  • pipeline: Pipeline controllers use WORKING_STATE.md and self-reminder to maintain role discipline across long autonomous runs
  • ensemble-team: Team coordinators use self-reminder to prevent role drift during multi-agent sessions

Missing a dependency? Install with:

npx skills add jwilger/agent-skills --skill debugging-protocol

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.25%
按下载量换算553

Claude

29.28%
按下载量换算459

Cursor

17.52%
按下载量换算275

Gemini CLI

9.12%
按下载量换算143

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/jwilger/agent-skills --skill memory-protocol 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills