Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计提醒

mem-skill记忆技能

Agent Skill

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

总安装

250

周安装

10

GitHub Stars

公开资料未说明

下载量

81
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/oliguo/mem-skill --skill mem-skill

简介

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

  • 它可辅助记忆技能的聚合与初步筛选,提升 Agent 在认知增强阶段的效率。
  • 通过 npx skills add 命令从指定仓库安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • mem-skill 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Mem-Skill: Self-Evolving Knowledge System

Initialization

When the user runs /mem-skill init, execute the following setup:

  1. Determine the current workspace root directory.
  2. Create the directory structure: <workspace>/ ├── knowledge-base/ │ └── _index.json └── experience/ └── _index.json
  3. Populate knowledge-base/_index.json with the starter template (see "Knowledge Base Index Format" below).
  4. Populate experience/_index.json with the starter template (see "Experience Index Format" below).
  5. Confirm to the user: "mem-skill initialized. Knowledge base and experience directories created."

Engine Selection

When the user runs /mem-skill init --mem-engine=qmd, optionally with extra --qmd-* flags:

Supported flags (all optional):

FlagValuesDefault
--qmd-scope=<scope>project, global*(ask user)*
--qmd-knowledge=<name>any string*(ask user)*
--qmd-experience=<name>any string*(ask user)*
--qmd-mask=<pattern>glob pattern**/*.md

Examples:

/mem-skill init --mem-engine=qmd
/mem-skill init --mem-engine=qmd --qmd-scope=project
/mem-skill init --mem-engine=qmd --qmd-scope=global --qmd-knowledge=my-kb --qmd-experience=my-exp
/mem-skill init --mem-engine=qmd --qmd-mask="**/*.md,**/*.txt"

Init procedure:

  1. Perform all standard init steps above.
  2. Check if QMD is installed: run which qmd or npx @tobilu/qmd status.
  3. If QMD is not installed, prompt: "QMD is not installed. Install it now with npm install -g @tobilu/qmd? (QMD requires Node.js >= 22)"
  4. Determine collection scope:

- If --qmd-scope was provided, use that value. - Otherwise, you MUST ask the user (do NOT guess or auto-choose): "Where should QMD collections be stored? Project — scoped to this workspace (recommended for multi-project setups) Global — shared across all workspaces" - If project: default collection name prefix is the sanitized workspace folder name (e.g., folder my-app → prefix my-app). - If global: default collection name prefix is mem.

  1. Determine collection names:

- If --qmd-knowledge was provided, use that value. - If --qmd-experience was provided, use that value. - For any name NOT provided via flags, you MUST ask the user (do NOT auto-generate): "What name for the knowledge collection? (default: <prefix>-knowledge)" "What name for the experience collection? (default: <prefix>-experience)" - Accept user input or use the defaults if the user confirms.

  1. Determine file mask:

- If --qmd-mask was provided, use that value. - Otherwise use **/*.md.

  1. After all values are confirmed, create the QMD collections: qmd collection add <workspace>/knowledge-base --name <knowledge-name> --mask "<mask>" qmd collection add <workspace>/experience --name <experience-name> --mask "<mask>" qmd context add qmd://<knowledge-name> "General knowledge base: reusable workflows, preferences, best practices" qmd context add qmd://<experience-name> "Skill-specific experience: pitfalls, parameters, solutions" qmd embed
  2. Create a .mem-skill.config.json at the workspace root: {"engine": "qmd", "version": "1.0.0", "scope": "<project|global>", "mask": "<mask>", "collections": {"knowledge": "<knowledge-name>", "experience": "<experience-name>"}}
  3. Confirm: "mem-skill initialized with QMD memory engine. Collections created and embeddings generated."

IMPORTANT: Never silently create QMD collections without confirming scope and names with the user. If no --qmd-* flags were provided, every question above MUST be asked interactively.

For the default engine (no --mem-engine flag), create .mem-skill.config.json with:

{
  "engine": "default",
  "version": "1.0.0"
}

For detailed engine-specific behavior, see references/qmd-engine.md and references/engines.md.

Manual Recording Command

When the user runs /mem-skill recordnow, immediately trigger the recording flow for the current conversation — even if Step 5 was not triggered automatically.

This is useful when:

  • Multiple tasks were completed in one session and the agent forgot to ask.
  • The user wants to record something that didn't trigger the satisfaction keywords.
  • The user remembers later that a solution was worth saving.

Procedure:

  1. Review the full conversation history for completed tasks.
  2. For each completed task, summarize it into a one-line essence.
  3. Evaluate: "Will this save time next time?"
  4. Present all recordable items to the user as a numbered list: "I found these completed tasks worth recording: [summary of task 1] → knowledge-base [summary of task 2] → knowledge-base [summary of skill usage] → experience Which ones should I record? (all / 1,2 / none)"
  5. On approval, write each selected item following the same write procedure as Step 5 (including QMD post-write sync if applicable).
  6. If no recordable tasks are found, respond: "I reviewed the conversation but didn't find any completed tasks worth recording. Is there something specific you'd like me to save?"

Core Loop (Mandatory Every Turn)

Execute these steps on every conversation turn. Do not display internal cache state to the user.

Step 0: In-Conversation Cache (Internal)

Maintain these variables silently within the conversation:

  • last_keywords — keywords from the previous turn
  • last_topic_fingerprint — top 3 keywords as a fingerprint
  • last_index_lastUpdated — timestamp of last index read
  • last_matched_categories — categories matched on last read
  • last_used_skills — non-mem-skill skills used this turn
  • missing_experience_skills — skills with no experience entry
  • loaded_experience_skills — skills whose experience has been loaded this session

Step 1: Extract Keywords (No File I/O)

  • Extract 3–8 core nouns/phrases from the user's current message.
  • Deduplicate and normalize casing.
  • Generate topic_fingerprint from the top 3 keywords.

Step 2: Detect Topic Switch (No File I/O)

A topic switch occurs when any of these conditions are met:

  • Explicit transition words: "also", "switch to", "by the way", "next", "instead"
  • Current keywords differ from last_keywords by >= 40%
  • User explicitly requests a new category or topic

Step 3: Cross-Skill Experience Read (Forced — Ignores Topic Switch)

Whenever a non-mem-skill skill is used this turn:

  • If the skill-id is already in loaded_experience_skills, skip (do not re-read or re-announce).
  • Otherwise:

1. Read experience/_index.json. 2. If a matching skill-id entry exists, load experience/skill-<skill-id>.md. 3. Add the skill-id to loaded_experience_skills. 4. Include in response: "Loaded experience: skill-<skill-id>.md" 5. If no entry exists, add to missing_experience_skills.

Engine-specific retrieval:

  • Default engine: Read experience/_index.json and match by skillId.
  • QMD engine: Read collection names from .mem-skill.config.json, then run qmd search "<skill-id>" -c <experience-collection> --json -n 5 for keyword match, or qmd query "<skill-id> <context>" -c <experience-collection> --json -n 5 for deeper retrieval.

Step 4: Knowledge Base Read (Only on Topic Switch)

Execute only on the first turn of the conversation or when a topic switch is detected:

Default engine:

  1. Read knowledge-base/_index.json.
  2. Match current keywords against all category keywords arrays.
  3. Load every matched category file (no priority ranking — load all matches).
  4. If no category matches, follow the "Dynamic Category" flow (see below).
  5. If any files were loaded, include in response: "Loaded knowledge: <file1>.md, <file2>.md"

If no topic switch occurred, reuse last_matched_categories without re-reading.

QMD engine:

  1. Read collection names from .mem-skill.config.json.
  2. Run qmd query "<keywords joined by space>" -c <knowledge-collection> --json -n 10 --min-score 0.3.
  3. Load top results as context.
  4. Include in response: "Retrieved knowledge via QMD: <titles>"

Step 5: Proactive Recording (Most Important)

Trigger conditions:

  • The current task is clearly completed at high quality.
  • The user expresses satisfaction ("great", "perfect", "that works", etc.).

Recording procedure:

  1. Summarize: Distill the solution into a one-line essence.
  2. Evaluate value: "Will this save time next time?"
  3. Ask permission: Always say something like: "We solved [problem description]. I'd like to record this experience so I can reference it next time. Is that okay?"
  4. Write on approval:

- Skill experience (if a non-mem-skill skill was used and the skill has no entry or has new techniques): Write to experience/skill-<skill-id>.md and update experience/_index.json. - General knowledge (if it's a reusable workflow, preference, or solution): Write to knowledge-base/<category>.md and update knowledge-base/_index.json.

QMD engine post-write: After writing any .md file, run:

qmd update
qmd embed

Forced rule — always ask when experience is missing: If a non-mem-skill skill was used this turn and that skill has no entry in experience/_index.json, you must ask at task completion:

"We used this time, but there's no experience record yet. Can I record this session's approach for future reference?"

If Step 5 was not triggered (e.g., multi-task sessions where satisfaction signals were missed), the user can run /mem-skill recordnow at any time to manually trigger recording. See "Manual Recording Command" above.

Index Formats

Knowledge Base Index Format

knowledge-base/_index.json:

{
  "lastUpdated": "YYYY-MM-DD",
  "version": "1.0.0",
  "totalEntries": 0,
  "categories": [
    {
      "id": "category-id",
      "name": "Category Name",
      "keywords": ["keyword1", "keyword2"],
      "file": "category-id.md",
      "count": 0
    }
  ]
}

Experience Index Format

experience/_index.json:

{
  "lastUpdated": "YYYY-MM-DD",
  "version": "1.0.0",
  "skills": [
    {
      "skillId": "skill-id",
      "file": "skill-<skill-id>.md",
      "keywords": ["keyword1", "keyword2"],
      "count": 0
    }
  ]
}

Entry Formats

Knowledge Base Entry

## [Short Title]
**Date:** YYYY-MM-DD
**Context:** One-line description of the use case
**Best Practice:**
- Key point 1
- Key point 2 — parameter notes and tuning guidance
**Keywords:** keyword1, keyword2, keyword3

Experience Entry

## [Problem/Technique Title]
**Date:** YYYY-MM-DD
**Skill:** <skill-id>
**Context:** One-line description of the issue
**Solution:**
- Concrete step 1
- Concrete step 2
**Key Files/Paths:**
- /path/to/relevant/file
**Keywords:** keyword1, keyword2, keyword3

Dynamic Category (Knowledge Base Only)

When user keywords do not match any existing category:

  1. Suggest creating a new category.
  2. Ask the user for a category name and keywords.
  3. Create a new <category-id>.md file and update knowledge-base/_index.json.

Recording Criteria

Core question: Will this save the user time next time?

Knowledge Base — Should Record:

  • Reusable workflows and decision steps (cross-domain procedures)
  • High-cost mistakes and their correction paths
  • Critical parameters, settings, or prerequisites
  • User preferences and style rules (tone, format, design)
  • Multi-attempt solutions (include failure reasons and success conditions)
  • Reusable templates, checklists, and output formats
  • External dependencies or resource locations

Knowledge Base — Should NOT Record:

  • Single Q&A with no reusable process
  • Pure conceptual explanations without concrete steps
  • Context-free, non-reusable conclusions

Experience — Should Record:

  • Pitfalls and their fixes when using a specific skill (include error messages)
  • Critical parameters or configurations that affect outcomes
  • Reusable templates, prompts, or workflows for that skill
  • Dependency or asset paths (fonts, images, project entry points)
  • Steps requiring a specific order or technique to succeed

Experience — Should NOT Record:

  • Pure theory or conceptual explanations (those belong in knowledge-base)
  • Conclusions without reproducible steps
  • One-off, non-reusable operations

Storage Paths

  • Knowledge index: knowledge-base/_index.json
  • Knowledge content: knowledge-base/<category-id>.md
  • Experience index: experience/_index.json
  • Experience content: experience/skill-<skill-id>.md
  • Config: .mem-skill.config.json

QMD Upgrade Suggestion

When the knowledge base exceeds 50 entries, proactively suggest upgrading to QMD:

"Your knowledge base has grown to [N] entries. For faster semantic search, consider upgrading to QMD: run /mem-skill init --mem-engine=qmd."

For full QMD engine details, see references/qmd-engine.md. For the engine abstraction and adding new engines, see references/engines.md.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.32%
按下载量换算29

Claude

31.58%
按下载量换算26

Cursor

19.53%
按下载量换算16

Gemini CLI

11.02%
按下载量换算9

安全审计

Gen Agent Trust Hub

可疑

Socket

可疑

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

来源信息

继续浏览同类 Skills