{"slug":"memory-lint","title":"memory-lint","summary":"Use when the user wants to lint a Claude Code memory directory (~/.claude/memory or custom path) for index inconsistency, broken cross-links, stale project state, duplicate / conflicting feedback rules, naming violations, frontmatter gaps, and oversized files. Phase 1 is a read-o","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-18T13:26:55.82157Z","repo":{"url":"https://github.com/KerberosClaw/kc_ai_skills","stars":79,"forks":14,"license":"MIT","updatedAt":"2026-09-23T08:52:42Z"},"bodyHtml":"<hr>\n<p>name: memory-lint\ndescription: \"Use when the user wants to lint a Claude Code memory directory (~/.claude/memory or custom path) for index inconsistency, broken cross-links, stale project state, duplicate / conflicting feedback rules, naming violations, frontmatter gaps, and oversized files. Phase 1 is a read-only scan and report. Phase 2 applies fixes only for findings the user explicitly picks. Phase 3 verifies with an independent process and rolls back if it fails.\"\nversion: 0.3.0\nstatus: mvp\ntriggers:</p>\n<ul>\n<li>\"/memory-lint\"</li>\n<li>\"memory lint\"</li>\n<li>\"掃 memory\"</li>\n<li>\"memory 健檢\"\nargument-hint: \"[path]\"</li>\n</ul>\n<hr>\n<h1>memory-lint — Memory 品質健檢</h1>\n<pre><code>Phase 1  唯讀掃描 ──► 報告（預設只做這段，不動任何檔案）\n                        │  user 逐條拍板要修哪些\nPhase 2  執行修正 ──► commit（開工前先記回退點）\n                        │  改完全部提交 = 凍結\nPhase 3  獨立複驗 ──► 過 → 收工\u3000／\u3000不過 → 回退到 Phase 2 前\n</code></pre>\n<p>\uD83D\uDD34 <strong>收到 lint 觸發詞的預設動作是出報告。</strong> user 必須明確點名要修哪幾條\n（或明說「全部修掉」）才准進 Phase 2。Phase 1 期間不准順手合併、順手刪、順手歸檔。</p>\n<p><strong>跟 llm-wiki-lint 差異</strong>：本 skill 針對 memory 目錄（prefix-based 平鋪結構）；\n<code>llm-wiki-lint</code> 針對 Karpathy LLM Wiki repo（<code>wiki/</code> + <code>raw/</code> + <code>SCHEMA.md</code> 三層）。</p>\n<hr>\n<h1>Phase 1 — 唯讀掃描</h1>\n<h2>Step 1: 找到 memory 目錄</h2>\n<p>依序嘗試，命中第一個就用：</p>\n<table>\n<thead>\n<tr>\n<th>順序</th>\n<th>來源</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>1</td>\n<td><code>$ARGUMENTS</code> 第一個位置參數</td>\n</tr>\n<tr>\n<td>2</td>\n<td>環境變數 <code>$CLAUDE_MEMORY_DIR</code></td>\n</tr>\n<tr>\n<td>3</td>\n<td><code>settings.json</code> 的 <code>autoMemoryDirectory</code></td>\n</tr>\n<tr>\n<td>4</td>\n<td><code>~/.claude/memory/</code></td>\n</tr>\n<tr>\n<td>5</td>\n<td>都找不到 → <strong>停止</strong>，告訴 user「偵測不到 memory 目錄」，不要瞎猜</td>\n</tr>\n</tbody>\n</table>\n<p>第 3 條要看<strong>當前設定目錄</strong>（多帳號並存時 <code>$CLAUDE_CONFIG_DIR</code> 會指到別處）：</p>\n<pre><code>CFG=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"\nMEMORY_PATH=$(jq -r '.autoMemoryDirectory // empty' \"$CFG/settings.json\" | envsubst)\n</code></pre>\n<h2>Step 2: 跑機械掃描</h2>\n<pre><code># &lt;skill_dir&gt; = 本 SKILL.md 所在的目錄；掃描標的由參數帶入，\n# 所以在哪個工作目錄呼叫都不影響結果\npython3 &lt;skill_dir&gt;/scripts/scan.py \"$MEMORY_PATH\"\n</code></pre>\n<p>只用標準函式庫、唯讀、輸出 JSON。<strong>目標目錄由參數帶入</strong>，所以在哪個工作目錄呼叫都一樣。\n沒有 <code>MEMORY.md</code> 會回 <code>{\"fatal\": ...}</code> 並以 exit 1 結束。</p>\n<p>腳本已經處理掉幾個會讓檢查靜默失效的坑，<strong>不要自己在對話裡改寫成 shell 一行流</strong>：</p>\n<ul>\n<li>不用 shell glob（zsh 未匹配 glob 會在指令執行前中止，而且 <code>2&gt;/dev/null</code> 擋不住）</li>\n<li>不用固定路徑暫存檔（並行執行會互相覆蓋、失敗留髒資料）</li>\n<li>不 import 第三方套件（唯讀階段不該動 user 的 Python 環境；離線環境也裝不了）</li>\n<li><code>[[...]]</code> 掃描先剝掉 fenced 與行內 code，且<strong>檔名與 frontmatter <code>name</code> 兩種都算解析成功</strong></li>\n<li>索引目標的 <code>./</code> 前綴會正規化</li>\n</ul>\n<p>輸出欄位：</p>\n<table>\n<thead>\n<tr>\n<th>欄位</th>\n<th>意義</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>layout</code></td>\n<td>單層（只有 <code>MEMORY.md</code>）／兩層（<code>MEMORY.md</code> 只留路由、細目在 <code>index_*.md</code>）</td>\n</tr>\n<tr>\n<td><code>index_declared_missing</code></td>\n<td><code>MEMORY.md</code> 指到但磁碟上沒有的子索引</td>\n</tr>\n<tr>\n<td><code>index_orphaned</code></td>\n<td>磁碟上有、但沒人指向的孤立子索引</td>\n</tr>\n<tr>\n<td><code>orphan</code> / <code>missing</code></td>\n<td>有檔沒被索引／索引指向不存在的檔</td>\n</tr>\n<tr>\n<td><code>frontmatter</code></td>\n<td>缺 <code>name</code>／<code>description</code>（只認頂層）或 <code>type</code>（頂層或 <code>metadata.type</code>）</td>\n</tr>\n<tr>\n<td><code>wiki_broken</code> / <code>wiki_external</code></td>\n<td><code>[[...]]</code> 解析不到的／指向子目錄或外部的</td>\n</tr>\n<tr>\n<td><code>oversize</code></td>\n<td>超過 300 行的檔（行數語意同 <code>wc -l</code>）</td>\n</tr>\n<tr>\n<td><code>prefixes</code> / <code>no_prefix</code></td>\n<td>命名前綴分布與例外</td>\n</tr>\n</tbody>\n</table>\n<p>\uD83D\uDD34 <strong>兩層結構下若只拿 <code>MEMORY.md</code> 當索引來源，會把整庫誤判成 orphan。</strong> 腳本已處理，\n但若你另外手寫檢查，這是最容易踩的一個。</p>\n<h2>Step 3: 判讀（這段才是本 skill 的價值）</h2>\n<p>腳本只給事實，<strong>嚴重度與去留由你判斷</strong>。判斷前先讀 <code>MEMORY.md</code> 與相關索引的說明文字，\n很多「異常」其實是既定決策。</p>\n<table>\n<thead>\n<tr>\n<th>嚴重度</th>\n<th>收什麼</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>\uD83D\uDD34 Error</td>\n<td>結構壞了：<code>index_declared_missing</code>、<code>orphan</code>、<code>missing</code>、<code>frontmatter</code> 缺漏、真正的斷鏈、兩條規則直接互打</td>\n</tr>\n<tr>\n<td>\uD83D\uDFE1 Warning</td>\n<td>沒壞但該看：<code>index_orphaned</code>、過期 dashboard、<code>oversize</code>、命名例外、疑似結束未歸檔</td>\n</tr>\n<tr>\n<td>\uD83D\uDD35 Info</td>\n<td>啟發式：語意相近可能重複、description 與索引描述不符、同一計數寫在多處</td>\n</tr>\n</tbody>\n</table>\n<p>不確定就降一級。<strong>推測與語意相似一律不得標 Error。</strong></p>\n<h3>這些不是缺陷，別報</h3>\n<ul>\n<li><p><strong><code>wiki_external</code> 多半是刻意的</strong> —— 指向 <code>archive/</code> 的歸檔檔案，或指向另一台機器上的\n外部知識庫。報之前先看那個目標像不像檔案路徑，並問 user 一次就好，不要每次重報。\n⚠️ <strong><code>wiki_broken</code> 裡也可能混著刻意的外部連結。</strong> 腳本靠「目標裡有沒有路徑分隔符」分類，\n所以像 <code>[[某個外部條目]]</code> 這種沒有路徑特徵的外部參照會落到 <code>wiki_broken</code>。\n<strong>這無法自動判斷</strong>，一律當成「需要人確認」，確認過就記進已接受例外清單，別每輪重報。</p>\n</li>\n<li><p><strong>超過 300 行有時是刻意的</strong> —— 若某份 canonical 規則檔明文要求「使用前必須完整讀完」，\n拆開就破壞用途。標成「刻意例外」並寫明理由。</p>\n</li>\n<li><p><strong>語意相近的一組規則可能是刻意不合併的</strong> —— 為了精準 recall 而把同一原則拆成多個觸發點\n是常見設計，索引裡通常有明文宣告。看到就標明是既定決策，<strong>不要建議合併</strong>。</p>\n</li>\n<li><p><strong>子目錄不在掃描範圍</strong> —— 腳本只掃根層。<code>archive/</code> 是歸檔；其他子目錄可能是某則 memory\n的附屬資料（例如一份 memory 指向 <code>ref/</code> 底下的參考檔）。<strong>它們沒被索引是正常的。</strong>\n自己補查時記得也要限制在根層，別寫成遞迴：</p>\n<pre><code>find \"$MEMORY_PATH\" -maxdepth 1 -name '*.md' -type f     # ✅\nrg --files -g '*.md' \"$MEMORY_PATH\"                       # ❌ 會遞迴讀到 archive/ 與其他子目錄\n</code></pre>\n</li>\n</ul>\n<h3>這些要另外用眼睛看（腳本測不出來）</h3>\n<ul>\n<li><strong>過時狀態</strong>：<code>project_*</code> 超過 30 天沒動、dashboard 超過 7 天沒更新、內文寫「進行中」\n但檔案很久沒改。\uD83D\uDD34 <strong>先確認時間來源可不可信</strong>：檔案的 mtime 一經複製、還原、\n重新 clone 就會全部變成當下時間。是 git repo 就改用 <code>git -C \"$MEMORY_PATH\" log -1 --format=%ad -- &lt;file&gt;</code>；\n不是 git 又剛搬過家，就<strong>明講這項檢查在本次環境不可靠</strong>，不要拿一批假的日期去下判斷。⚠️ <strong>這是低訊號檢查</strong> —— 黑名單、已完工的側專案、機器後路天生就不會動。\n而且「進行中」命中的可能只是待辦清單裡一個帶日期的項目，不是整個專案的狀態。\n<strong>報告要引出命中的那一行原文</strong>，讓 user 看得出是哪一種。</li>\n<li><strong>規則直接衝突</strong>：\uD83D\uDD34 <strong>不要對全部檔案兩兩比對。</strong> 規則檔一多（例如 80 份以上），\n輸出會直接撐爆而被截斷 —— 那時你既審不完、也不知道漏了什麼，卻很容易誤以為審過了。\n<strong>改成兩段</strong>：先用 description 的字元 bigram 做 Jaccard 粗篩（門檻約 0.16）取出候選配對，\n<strong>只對候選配對讀原文</strong>；一輪最多看 10 對，超過就明講「本輪只看了前 N 對、其餘未檢查」。\n命中後<strong>並列兩邊原句</strong>讓 user 自判，不要自己拍板「這是衝突」。\n\uD83D\uDD34 <strong>絕對不要因為輸出被截斷就當作「沒發現問題」</strong> —— 那是沒檢查，不是通過。</li>\n</ul>\n<h2>Step 4: 出報告</h2>\n<p>繁體中文（語言跟 memory 對齊）。每個 finding 必須有<strong>具體檔名</strong> ＋ 行為描述 ＋\n建議動作（Error 必附）。結尾主動問要不要進 Phase 2，並建議優先序：\n一行就能修的（斷鏈、索引缺漏）→ 每個 session 都會載入的檔 → 大型重構。</p>\n<hr>\n<h1>Phase 2 — 執行修正（需明確授權）</h1>\n<h2>開工前四項，缺一不進</h2>\n<p><strong>1. 判斷是不是 git repo。</strong> Step 1 只要求有 <code>MEMORY.md</code>，而預設的 <code>~/.claude/memory/</code>\n常常<strong>不是</strong> repo。整套回退機制不能預設 git 存在。</p>\n<pre><code># \uD83D\uDD34 要比對 top-level 是不是它自己，不能只問「這裡有沒有 git」——\n#    rev-parse --git-dir 會往上找父層 repo，memory 目錄只要剛好放在某個 repo 底下\n#    就會被誤判成 git 模式，接著把 memory 的改動提交進那個不相干的 repo\ntop=$(git -C \"$MEMORY_PATH\" rev-parse --show-toplevel 2&gt;/dev/null)\n[ -n \"$top\" ] &amp;&amp; [ \"$top\" = \"$(cd \"$MEMORY_PATH\" &amp;&amp; pwd -P)\" ] &amp;&amp; echo git || echo 非git\n</code></pre>\n<p><strong>2. 依上一步建立回退點：</strong></p>\n<table>\n<thead>\n<tr>\n<th>情況</th>\n<th>回退點</th>\n<th>回退方式</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>git repo</td>\n<td><code>git -C \"$MEMORY_PATH\" log --oneline -1</code> 的 commit hash，寫進回報</td>\n<td><code>git -C \"$MEMORY_PATH\" revert</code> 或退回該 commit</td>\n</tr>\n<tr>\n<td>非 git</td>\n<td>見下方備份指令（<strong>放在 memory 目錄外</strong>，免得被自己掃到）</td>\n<td>見下方回復指令</td>\n</tr>\n</tbody>\n</table>\n<pre><code># 建備份：碰撞就停，不要覆蓋既有備份\nBAK=\"$MEMORY_PATH.bak.$(date +%Y%m%d-%H%M%S)\"\n[ -e \"$BAK\" ] &amp;&amp; { echo \"備份路徑已存在，停止\"; exit 1; }\ncp -R \"$MEMORY_PATH\" \"$BAK\" &amp;&amp; echo \"回退點：$BAK\"\n\n# 回復：一定要用 --delete，否則 Phase 2 新增的檔案不會被移除\nrsync -a --delete \"$BAK/\" \"$MEMORY_PATH/\"\ndiff -rq \"$BAK\" \"$MEMORY_PATH\" &amp;&amp; echo \"回復完成且內容一致\"\n</code></pre>\n<p>\uD83D\uDD34 <strong>「把備份複製回去」不等於回復。</strong> 單純覆蓋複製移不掉 Phase 2 新增的檔案，\n回復後會是舊檔與新檔的混合體，而且<strong>看起來像成功了</strong>。一定要用 <code>rsync --delete</code>\n（或等效做法）並用 <code>diff -rq</code> 驗過。</p>\n<p><strong>3. 確認工作區乾淨</strong>（git 情況）：有未提交的改動先問 user。</p>\n<p><strong>4. 把 Phase 3 的驗證管道先定下來並試跑一次。</strong> 三件事都要做完才算過：</p>\n<ol>\n<li><strong>寫下你打算在 Phase 3 用的那一行完整指令</strong>（含唯讀旗標與標的目錄），記進回報。</li>\n<li><strong>用那一行實際發一次最小的唯讀請求</strong>（例如請它回報某個檔案的行數），確認拿得到回應。</li>\n<li>拿不到回應就<strong>停下來問 user</strong>，讓他選：換一個管道、接受「只做自檢、不做外部複驗」，\n或不要進 Phase 2。<strong>user 選了「只做自檢」也可以繼續</strong>，但要在最終回報裡明講\n這次沒有外部複驗。</li>\n</ol>\n<p>\uD83D\uDD34 <strong>只看執行檔在不在是不夠的。</strong> 裝了但沒登入、設定壞掉，<code>command -v</code> 一樣會過，\n然後你會在 Phase 2 已經改完並提交之後才撞到 —— 正好是這道閘門要防的狀態。</p>\n<p>\uD83D\uDD34 <strong>本 skill 不指定用哪一套工具。</strong> 只要求它是<strong>獨立行程</strong>、<strong>可唯讀執行</strong>、\n<strong>可把標的目錄寫死</strong>。至於是哪一套 CLI agent，由執行者依環境決定並記錄下來。</p>\n<h2>動手紀律</h2>\n<p>\uD83D\uDD34 <strong>所有 git 指令一律帶 <code>-C \"$MEMORY_PATH\"</code>。</strong> 裸的 <code>git add</code> / <code>git commit</code> / <code>git status</code>\n會作用在<strong>呼叫端的專案</strong>上（子行程裡的 <code>cd</code> 不會改變父行程的工作目錄），\n結果是把別人的檔案提交掉，而 memory 的改動還躺在那裡沒進版控。</p>\n<p>\uD83D\uDD34 <strong>Edit / Write 可能被背景 session 的隔離守衛擋住。</strong> memory 目錄常伴隨一個\n「Edit/Write 後自動 commit」的 hook，而<strong>用 Bash 改檔不會觸發那個 hook</strong>。\n被擋時的正解：<strong>用 Bash 寫檔，最後手動 <code>git -C \"$MEMORY_PATH\" add -A &amp;&amp; git -C \"$MEMORY_PATH\" commit</code></strong>，\n改完 <code>git -C \"$MEMORY_PATH\" status -s</code> 確認乾淨才算數。</p>\n<p>\uD83D\uDD34 <strong><code>git push</code> 要另外問過，不含在 Phase 2 的授權範圍。</strong> user 同意的是「修這幾條」，\n不是「把 memory 發佈到遠端」。memory 內容通常私密，而推送在多數託管服務上不可逆\n（就算之後刪掉，中間狀態可能已被同步或快取）。<strong>commit 完停手，明確問一句再動。</strong>\n例外：該目錄若本來就掛著自動推送的 hook，那是既有行為 —— 但仍要在回報裡講明。</p>\n<p>\uD83D\uDD34 <strong>不要在 memory 目錄內開 worktree。</strong> 若該目錄的 hook 跑的是 <code>git add -A</code>，\nworktree 會被當成 gitlink 提交進版控。</p>\n<p>\uD83D\uDD34 <strong>「規則漂移」類發現一律先逐檔讀過再決定。</strong> 例如「這幾個檔依規則不該存在」——\n這種規則幾乎都留有例外（文件查不到、跨 session 才需要知道的操作性事實）。\n<strong>報告階段只能標「待判斷」、禁止寫「建議刪除」；Phase 2 也禁止照單無腦刪。</strong></p>\n<p>\uD83D\uDD34 <strong>改名要連帶處理入站引用</strong>，<code>[[...]]</code> 與 markdown 連結都要掃，含 <code>archive/</code> 底下的。</p>\n<h2>收尾</h2>\n<p>重跑一次 <code>scan.py</code>，<strong>全綠才進 Phase 3</strong>。自檢就不過的東西不要浪費一次外部複驗。</p>\n<p>\uD83D\uDD34 <strong>「全綠」不是「JSON 完全是空的」。</strong> 已經跟 user 確認過、決定不處理的項目\n（刻意的外部連結、刻意超長的 canonical 檔、刻意不合併的規則群組）<strong>會一直留在輸出裡</strong>。\n定義是：<strong>輸出裡每一條剩餘項目，都在你這輪明確記錄下來的「已接受例外」清單上。</strong>\n把那份清單寫進回報，Phase 3 的 brief 也要附上，否則外部驗證者會把它們當成新缺陷報回來。</p>\n<p>⚠️ <strong>腳本全綠不代表語意層也通過。</strong> 它只驗結構，改掉一處內容矛盾之後 JSON 完全不會變。\n語意層的判斷（矛盾、過時、重複）沒有機械證據，回報時要分開講。</p>\n<hr>\n<h1>Phase 3 — 獨立複驗</h1>\n<h2>\uD83D\uDD34 先凍結</h2>\n<p><strong>Phase 2 的改動要全部完成並提交（git）或備份定版（非 git）之後，才准派複驗。</strong>\n一邊改一邊驗等於叫對方驗一個會動的目標，結論無效、還浪費一輪。</p>\n<h2>\uD83D\uDD34 要外部行程，不能用同 session 的 subagent</h2>\n<p>subagent 繼承這個 session 的記憶注入，而那是 <strong>session 開始那一刻的快照</strong> ——\n剛改完的東西不在裡面，連檔名都可能還是舊的。<strong>拿吃著舊快照的 agent 去驗磁碟真值，\n邏輯上不成立。</strong> 用獨立行程（例如另一套 CLI agent），它不吃這份注入才算外部視角。</p>\n<p>派工時要<strong>把標的目錄寫死、把寫入權關掉</strong>，否則它可能檢查錯的目錄，或動到剛凍結的檔案。</p>\n<h2>兩種驗證題，抓的東西不重疊</h2>\n<p><strong>A. 機械事實查核</strong> —— 答案非黑即白：<code>MEMORY.md</code> 結構與行數、改名前後的檔名各自存不存在、\n索引差集是否為空、<code>[[...]]</code> 解析失敗數是否為零、frontmatter 是否全數完整。</p>\n<p><strong>B. Recall 可用性測試</strong> —— 測「找不找得到」，設計比題目重要：</p>\n<ul>\n<li><strong>只准從 <code>MEMORY.md</code> 起步</strong>，之後自行決定往下讀什麼</li>\n<li>\uD83D\uDD34 <strong>禁用 <code>grep</code> / <code>find</code> / <code>ls</code> 暴力掃目錄</strong> —— 不禁的話它繞過索引也答得出來，等於沒測到路由</li>\n<li><strong>每組夾一題負面對照</strong>（問一個確定沒有記憶的主題），看它會不會憑常識編一個答案</li>\n<li>要求回報<strong>走過的路徑</strong>：讀了哪些檔、是索引裡哪一行導過去的</li>\n<li>要求給索引好不好用的評語，並明講不要客套</li>\n</ul>\n<h2>\uD83D\uDD34 brief 要先寫明「哪些是刻意的」</h2>\n<p>外部驗證者<strong>沒有脈絡</strong>。不先講，它一定會把既定決策當成缺陷報回來，然後你得逐條解釋 ——\n那正是審查迴圈燒時間的燃料。至少要先交代：刻意的外部連結、刻意超長的 canonical 檔、\n刻意不合併的規則群組、已知但這次不處理的待辦、以及不在掃描範圍的子目錄。</p>\n<h2>判定與回退</h2>\n<table>\n<thead>\n<tr>\n<th>結果</th>\n<th>動作</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>全過</td>\n<td>收工，回報改了什麼、驗了什麼</td>\n</tr>\n<tr>\n<td>只揪出可修的小缺陷</td>\n<td>修掉 → <strong>重新凍結</strong> → 再驗一輪</td>\n</tr>\n<tr>\n<td>結構性失敗（索引導不到、大量斷鏈、走不到答案）</td>\n<td><strong>回退到 Phase 2 前的回退點</strong>，重新設計再來</td>\n</tr>\n</tbody>\n</table>\n<p>⚠️ <strong>驗證結果是輸入、不是結論。</strong> 它報的每一條先自己複核再決定改不改，\n別因為「外部工具說的」就照做。特別留意三種誤判：把 user 刻意的決策當缺陷、\n把不在它視野內的東西（其他機器、已歸檔）當斷鏈、把「規則說不該存在」直接推成「該刪」。</p>\n<p>⚠️ <strong>「審到沒問題為止」不是終止條件。</strong> 每修一次 diff 就更大，下一輪就有更多表面可挑，\n這是正回饋不是收斂。<strong>要收斂就把 diff 變小</strong> —— 與其逐條硬補，不如把出錯表面整類移除\n（例如把散落的檢查邏輯收進一支測過的腳本）。判準改成「這條在實際使用路徑上打得到嗎」，\n打不到就記錄進文件、不動手。</p>\n<hr>\n<h2>Anti-patterns</h2>\n<ul>\n<li>❌ 沒經 user 同意就進 Phase 2</li>\n<li>❌ Phase 1 期間修改 / 刪除 / 合併任何 memory 檔案</li>\n<li>❌ 把 <code>scan.py</code> 的邏輯改寫成對話裡的 shell 一行流（glob、暫存檔、cwd 那幾類坑會全部回來）</li>\n<li>❌ 只把 <code>MEMORY.md</code> 當索引來源</li>\n<li>❌ 一邊改一邊派複驗</li>\n<li>❌ 用同 session 的 subagent 當「獨立」對照組</li>\n<li>❌ 看到「規則漂移」就建議刪檔</li>\n<li>❌ 裸 <code>git</code> 指令不帶 <code>-C \"$MEMORY_PATH\"</code></li>\n<li>❌ 把 <code>git push</code> 當成 Phase 2 授權的一部分</li>\n<li>❌ 在唯讀階段安裝套件</li>\n<li>❌ 把「語意相似」標成 Error</li>\n<li>❌ 掃 <code>archive/</code> 或其他子目錄（除非 user 明確要求）</li>\n<li>❌ 沒 prefix 慣例的目錄硬套命名檢查</li>\n<li>❌ 路徑偵測不到時瞎猜</li>\n<li>❌ 報告用英文模板套中文 memory</li>\n<li>❌ 把結果 append 到任何 ledger 檔</li>\n</ul>\n<h2>Important rules</h2>\n<ol>\n<li><strong>Phase 1 唯讀不可協商</strong> —— 報告階段禁用 Edit / Write / <code>mv</code> / <code>rm</code> / <code>git</code></li>\n<li><strong>Phase 2 需明確授權</strong>，且開工前四項前置缺一不可</li>\n<li><strong>Phase 3 先凍結、要外部行程、標的寫死、寫入關掉</strong></li>\n<li><strong>Path 偵測順序固定</strong> —— 5 級依序，找不到就停</li>\n<li><strong>Severity 寧降勿升</strong></li>\n<li><strong>每個 finding 必須有具體檔名</strong></li>\n<li><strong>衝突永遠並列原句</strong>，不替 user 判定</li>\n<li><strong>報告印到對話即可</strong>，不另存檔</li>\n<li><strong>外部驗證是輸入不是結論</strong>，逐條複核</li>\n<li><strong>未來功能（cron 定排、跨機器比對）目前不存在</strong> —— user 問起就說 v0.x 還沒做</li>\n</ol>\n","files":[{"path":"scripts/scan.py","sizeBytes":5588,"isText":true},{"path":"SKILL.md","sizeBytes":18229,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-18T13:27:28.34153Z","sha256":"5EE5C61E966DDCB2EFEE7D8F60A24A1F0C148B7F6CF03339B93E43D8115F98CE","sizeBytes":12374},"review":null,"source":{"repositoryUrl":"https://github.com/KerberosClaw/kc_ai_skills","path":"memory-lint","license":"MIT","commit":"2b453ffa281dc107732ca7659e863f5da955e07a","subtreeSha":"0E36F8FF0A2CABBC85DCAC088469523F90C2B829511A2576EBC59658CF0B4EF8","lastSyncedAt":"2026-09-27T19:30:37.836842Z"},"reviewedAt":"2026-09-18T13:28:22.578027Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/KerberosClaw/kc_ai_skills/tree/main/memory-lint"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install kerberosclaw-kc-ai-skills@llmmart"},{"target":"git","command":"git clone https://github.com/KerberosClaw/kc_ai_skills.git"}]}