/ 目录 / 演练场 / mex
● 社区 theDakshJaitly ⚡ 即开即用

mex

作者 theDakshJaitly · theDakshJaitly/mex

项目记忆脚手架 + 漂移检测器——让 AI 编程 agent 始终基于项目的真实状态,而非昨天的快照。

mex 在你的仓库中安装了一套结构化记忆脚手架(架构、规范、进行中的工作、阻塞项),并附带一个 CLI,用于检测记忆与现实之间的漂移。当代码变更与记忆矛盾时,CLI 会标记出来,让你决定是更新记忆还是重新对齐代码。轻量级——设计为存放在仓库中并随团队流转。

为什么要用

核心特性

实时演示

实际使用效果

就绪

安装

选择你的客户端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "mex-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/theDakshJaitly/mex",
        "~/.claude/skills/mex"
      ],
      "_inferred": true
    }
  }
}

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "mex-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/theDakshJaitly/mex",
        "~/.claude/skills/mex"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "mex-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/theDakshJaitly/mex",
        "~/.claude/skills/mex"
      ],
      "_inferred": true
    }
  }
}

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "mex-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/theDakshJaitly/mex",
        "~/.claude/skills/mex"
      ],
      "_inferred": true
    }
  }
}

格式与 Claude Desktop 相同。重启 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "mex-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/theDakshJaitly/mex",
        "~/.claude/skills/mex"
      ]
    }
  ]
}

Continue 使用服务器对象数组,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "mex-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/theDakshJaitly/mex",
          "~/.claude/skills/mex"
        ]
      }
    }
  }
}

加入 context_servers。Zed 保存后热重载。

claude mcp add mex-skill -- git clone https://github.com/theDakshJaitly/mex ~/.claude/skills/mex

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: mex

在项目启动时建立项目记忆

👤 新仓库的负责人 ⏱ ~25 min beginner

何时使用: 项目第一天;你希望 agent 能快速上手。

前置条件
  • Skill 已安装 — git clone https://github.com/theDakshJaitly/mex ~/.claude/skills/mex
步骤
  1. 初始化
    Use mex. Initialize project memory with sections: architecture, conventions, in-flight, blockers.✓ 已复制
    → /.mex/ 脚手架已创建,含模板
  2. 填充初始内容
    Auto-extract architecture from existing code and a starter convention list.✓ 已复制
    → 各章节已填充初始内容
  3. 设置新鲜度标记
    Mark each section verified today.✓ 已复制
    → 新鲜度标记已设置

结果: 新项目从一开始就有共享的 agent 上下文。

注意事项
  • 自动提取抓取了无关细节 — 大力精简——记忆是用来记录原则的,不是用来 grep 的
搭配使用: filesystem

找出项目记忆与代码不一致的地方

👤 长期项目的负责人 ⏱ ~30 min intermediate

何时使用: 记忆是几个月前建立的;没人确定它有多过时。

步骤
  1. 运行漂移检测
    Use mex. Run drift detection. Report claims that no longer match reality.✓ 已复制
    → 漂移报告,含声明 ↔ 证据对照
  2. 更新或移除
    For each drift, decide: update memory or fix the code (claim was right and reality drifted).✓ 已复制
    → 逐项决策;代码侧修复已开 PR
  3. 重新验证
    After resolving, mark sections verified today.✓ 已复制
    → 记忆再次对齐

结果: 记忆保持可靠的契约,而非口耳相传的传说。

注意事项
  • 漂移检测器标记过于激进 — 调整 --strictness;对活跃项目使用 'medium'
搭配使用: github

在团队成员之间交接进行中的工作

👤 即将休假/离职的开发者 ⏱ ~20 min beginner

何时使用: 你有 3 个进行中的功能,别人需要接手。

步骤
  1. 记录进行中的工作
    Use mex. For each open branch, write an in-flight entry: goal, current state, next steps, gotchas.✓ 已复制
    → 条目保存在 /.mex/in-flight/
  2. 用 CLI 验证
    Run drift on in-flight; ensure entries reflect actual branch state.✓ 已复制
    → 漂移检测通过
  3. 交接
    Generate a teammate-ready summary linking each entry to its branch.✓ 已复制
    → 可直接发送到 Slack/邮件的交接摘要

结果: 顺畅的接手;无需考古。

注意事项
  • 进行中的条目过于模糊(「正在处理 X」) — 强制填写模板的「下一步」字段;不具体就没有帮助

组合

与其他 MCP 搭配,撬动十倍杠杆

mex-skill + filesystem

记忆存放在仓库中;提交它

Commit /.mex/ to git so memory travels with the codebase.✓ 已复制
mex-skill + github

在 PR 上进行漂移 CI 检查

On every PR, run mex drift and post the report as a PR comment.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
init scaffold_options 每个项目执行一次 0
drift section?, strictness? 每周/合并长期分支前 0 (uses local checks + LLM for fuzzy claims)
verify section 更新记忆以匹配现实后 0
in_flight_add branch, goal, next_steps 开始一个功能分支时 0
summary format 交接 / 状态报告 0

成本与限制

运行它的成本

API 配额
无——本地
每次调用 Token 数
漂移检测对模糊声明使用 LLM;每次运行有上限
费用
免费
提示
CI 中使用 strict=high 捕获真实漂移;日常本地检查使用 medium

安全

权限、密钥、影响范围

最小权限: filesystem-write
凭据存储:
数据出站: 无,除非漂移 LLM 配置为远程提供商

故障排查

常见错误与修复

漂移检测报告误报过多

降低严格程度;或将声明措辞调整为更可检查的形式

记忆无限增长

每个章节有软上限;定期整合——保留原则,归档细节

CLI 找不到 /.mex/

从仓库根目录运行;或传入 --root <path>

自动提取遗漏了关键不变量

自动提取只是起点;手动编写核心不变量

替代方案

mex 对比其他方案

替代方案何时用它替代权衡
claude-mem-skill你需要的是会话连续性,而非项目知识记忆解决不同问题;mex 针对项目级不变量
Plain CLAUDE.md小型项目,不需要漂移检测没有结构;没有自动化新鲜度检查
pilot-shell-skill你想要规格/计划/质量门加上知识持久化工作流覆盖面更大;约束更多

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills