/ 目錄 / 演練場 / 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(本機檢查)+ LLM 處理模糊聲明
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 用於專案層級的不變量
純 CLAUDE.md小型專案,不需要漂移偵測沒有結構;沒有自動化新鮮度檢查
pilot-shell-skill你需要規格、計畫、閘門,加上知識持久化工作流程面更廣;有更強的主觀意見

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills