codebase-synclisted
Install: claude install-skill jurislm/jurislm-tools
# Codebase Sync — 深度審計��更新 README.md 與 CLAUDE.md
---
## 核心原則:先審計,後動筆
**所有步驟都必須執行,不得以「看起來沒問題」為由跳過。**
每一項結論必須來自實際命令輸出或讀取檔案,不得憑記憶推斷。
每次修改都必須在 Audit Report 中有對應的 finding。
---
## Step 0:執行自動化偵測(必做,輸出原始結果)
以下指令必須全部執行,並將輸出結果記錄下來供 Step 1 分析使用。
```bash
# 0-A 整體結構快照
ls -la
find . -maxdepth 3 -type d \
-not -path './.git*' \
-not -path './node_modules*' \
-not -path './.next*' \
-not -path './dist*' \
-not -path './.worktrees*' \
| sort
# 0-B package.json 狀態(若存在)
jq '{name, version, scripts, dependencies, devDependencies}' package.json 2>/dev/null || echo "(no package.json)"
# 0-C plugin.json 狀態(若存在)
jq '{name, version}' .claude-plugin/plugin.json 2>/dev/null || \
find . -name "plugin.json" -not -path "*/node_modules/*" -exec echo "Found: {}" \; -exec jq '{name,version}' {} \; 2>/dev/null || \
echo "(no plugin.json found)"
# 0-D README scripts vs package.json scripts 差異
if [ -f README.md ] && [ -f package.json ]; then
grep -oE 'bun run [a-z:_-]+' README.md | sed 's/bun run //' | sort -u > /tmp/_readme_scripts.txt
jq -r '.scripts | keys[]' package.json | sort > /tmp/_pkg_scripts.txt
echo "=== README 提到但 package.json 沒有的 scripts ==="
comm -23 /tmp/_readme_scripts.txt /tmp/_pkg_scripts.txt
echo "=== package.json 有但 README 沒提的 scripts ==="
comm -13 /tmp/_readme_scripts.txt /tmp/_pkg_scripts.txt
rm /tmp/_readme_scripts.txt /tmp/_pkg_scripts.txt
fi
# 0-E CLAUDE.md 中提到但實際不存在的目錄
if [ -f CLAUDE.md ]; then
echo "=== CLAUDE.md 提到的目錄,檢查是否存在 ==="
grep -oE