mot by parcadei/continuous-claude-v3
npx skills add https://github.com/parcadei/continuous-claude-v3 --skill mot对所有 Claude Code 组件运行全面的健康检查。
/mot # 完整审计(所有类别)
/mot skills # 仅检查技能
/mot agents # 仅检查代理
/mot hooks # 仅检查钩子
/mot memory # 仅检查内存系统
/mot --fix # 自动修复简单问题
/mot --quick # 仅运行 P0 检查(快速)
# 统计技能数量
echo "=== SKILLS ==="
SKILL_COUNT=$(find .claude/skills -name "SKILL.md" | wc -l | xargs)
echo "Found $SKILL_COUNT skill files"
# 检查 frontmatter 解析
FAIL=0
for skill in $(find .claude/skills -name "SKILL.md"); do
if ! head -1 "$skill" | grep -q "^---$"; then
echo "FAIL: No frontmatter: $skill"
FAIL=$((FAIL+1))
fi
done
echo "Frontmatter: $((SKILL_COUNT - FAIL)) pass, $FAIL fail"
# 检查名称是否与目录匹配
FAIL=0
for skill in $(find .claude/skills -name "SKILL.md"); do
dir=$(basename $(dirname "$skill"))
name=$(grep "^name:" "$skill" 2>/dev/null | head -1 | cut -d: -f2 | xargs)
if [ -n "$name" ] && [ "$dir" != "$name" ]; then
echo "FAIL: Name mismatch $dir vs $name"
FAIL=$((FAIL+1))
fi
done
echo "Name consistency: $((SKILL_COUNT - FAIL)) pass, $FAIL fail"
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
echo "=== AGENTS ==="
AGENT_COUNT=$(ls .claude/agents/*.md 2>/dev/null | wc -l | xargs)
echo "Found $AGENT_COUNT agent files"
# 检查必填字段
FAIL=0
for agent in .claude/agents/*.md; do
[ -f "$agent" ] || continue
# 检查 name 字段是否存在
if ! grep -q "^name:" "$agent"; then
echo "FAIL: Missing name: $agent"
FAIL=$((FAIL+1))
continue
fi
# 检查 model 是否有效
model=$(grep "^model:" "$agent" | head -1 | cut -d: -f2 | xargs)
case "$model" in
opus|sonnet|haiku) ;;
*) echo "FAIL: Invalid model '$model': $agent"; FAIL=$((FAIL+1)) ;;
esac
done
echo "Agent validation: $((AGENT_COUNT - FAIL)) pass, $FAIL fail"
# 检查悬空引用(引用不存在的代理)
echo "Checking agent cross-references..."
for agent in .claude/agents/*.md; do
[ -f "$agent" ] || continue
# 查找 subagent_type 引用
refs=$(grep -oE 'subagent_type[=:]["'\'']*([a-z-]+)' "$agent" 2>/dev/null | sed 's/.*["'\'']//' | sed 's/["'\'']$//')
for ref in $refs; do
if [ ! -f ".claude/agents/$ref.md" ]; then
echo "WARN: $agent references non-existent agent: $ref"
fi
done
done
echo "=== HOOKS ==="
# 检查 TypeScript 源文件数量
TS_COUNT=$(ls .claude/hooks/src/*.ts 2>/dev/null | wc -l | xargs)
echo "Found $TS_COUNT TypeScript source files"
# 检查打包文件是否存在
BUNDLE_COUNT=$(ls .claude/hooks/dist/*.mjs 2>/dev/null | wc -l | xargs)
echo "Found $BUNDLE_COUNT built bundles"
# 检查 shell 包装器是否可执行
FAIL=0
for sh in .claude/hooks/*.sh; do
[ -f "$sh" ] || continue
if [ ! -x "$sh" ]; then
echo "FAIL: Not executable: $sh"
FAIL=$((FAIL+1))
fi
done
SH_COUNT=$(ls .claude/hooks/*.sh 2>/dev/null | wc -l | xargs)
echo "Shell wrappers: $((SH_COUNT - FAIL)) executable, $FAIL need chmod +x"
# 检查 settings.json 中注册的钩子是否存在
echo "Checking registered hooks..."
FAIL=0
# 从 settings.json 中提取钩子命令并验证文件是否存在
grep -oE '"command":\s*"[^"]*\.sh"' .claude/settings.json 2>/dev/null | \
sed 's/.*"\([^"]*\.sh\)".*/\1/' | \
sed 's|\$CLAUDE_PROJECT_DIR|.claude|g' | \
sed "s|\$HOME|$HOME|g" | \
sort -u | while read hook; do
# 解析为实际路径
resolved=$(echo "$hook" | sed 's|^\./||')
if [ ! -f "$resolved" ] && [ ! -f "./$resolved" ]; then
echo "WARN: Registered hook not found: $hook"
fi
done
echo "=== MEMORY SYSTEM ==="
# 检查 DATABASE_URL
if [ -z "$DATABASE_URL" ]; then
echo "FAIL: DATABASE_URL not set"
else
echo "PASS: DATABASE_URL is set"
# 测试连接
if psql "$DATABASE_URL" -c "SELECT 1" > /dev/null 2>&1; then
echo "PASS: PostgreSQL reachable"
# 检查 pgvector
if psql "$DATABASE_URL" -c "SELECT extname FROM pg_extension WHERE extname='vector'" 2>/dev/null | grep -q vector; then
echo "PASS: pgvector extension installed"
else
echo "FAIL: pgvector extension not installed"
fi
# 检查表是否存在
if psql "$DATABASE_URL" -c "\d archival_memory" > /dev/null 2>&1; then
echo "PASS: archival_memory table exists"
# 统计学习记录数量
COUNT=$(psql "$DATABASE_URL" -t -c "SELECT COUNT(*) FROM archival_memory" 2>/dev/null | xargs)
echo "INFO: $COUNT learnings stored"
else
echo "FAIL: archival_memory table missing"
fi
else
echo "FAIL: PostgreSQL not reachable"
fi
fi
# 检查 Python 依赖
echo "Checking Python dependencies..."
(cd opc && uv run python -c "import psycopg2; import pgvector; import sentence_transformers" 2>/dev/null) && \
echo "PASS: Python dependencies available" || \
echo "WARN: Some Python dependencies missing"
echo "=== CROSS-REFERENCES ==="
# 检查技能是否引用了有效的代理
echo "Checking skill → agent references..."
FAIL=0
for skill in $(find .claude/skills -name "SKILL.md"); do
refs=$(grep -oE 'subagent_type[=:]["'\'']*([a-z-]+)' "$skill" 2>/dev/null | sed 's/.*["'\'']//' | sed 's/["'\'']$//')
for ref in $refs; do
if [ -n "$ref" ] && [ ! -f ".claude/agents/$ref.md" ]; then
echo "FAIL: $skill references missing agent: $ref"
FAIL=$((FAIL+1))
fi
done
done
echo "Skill→Agent refs: $FAIL broken"
如果指定了 --fix,将自动修复:
使 shell 包装器可执行
chmod +x .claude/hooks/*.sh
如果 TypeScript 比打包文件新,则重新构建钩子
cd .claude/hooks && npm run build
创建缺失的缓存目录
mkdir -p .claude/cache/agents/{scout,kraken,oracle,spark}
mkdir -p .claude/cache/mot
将完整报告写入 .claude/cache/mot/report-{timestamp}.md:
# MOT 健康报告
Generated: {timestamp}
## 摘要
| Category | Pass | Fail | Warn |
|----------|------|------|------|
| Skills | 204 | 2 | 0 |
| Agents | 47 | 1 | 3 |
| Hooks | 58 | 2 | 1 |
| Memory | 4 | 0 | 1 |
| X-Refs | 0 | 0 | 2 |
## 发现的问题
### P0 - 严重
- [FAIL] Hook build failed: tldr-context-inject.ts
### P1 - 高
- [FAIL] Agent references missing: scot → scout (typo)
### P2 - 中
- [WARN] 3 hooks need rebuild (dist older than src)
### P3 - 低
- [INFO] VOYAGE_API_KEY not set (using local BGE)
0 - 所有 P0/P1 检查通过1 - 存在任何 P0/P1 失败2 - 仅存在 P2/P3 警告仅运行 P0 检查:
每周安装次数
199
代码仓库
GitHub 星标
3.6K
首次出现
2026年1月22日
安全审计
安装于
opencode190
codex189
cursor187
gemini-cli186
github-copilot183
amp180
Run comprehensive health checks on all Claude Code components.
/mot # Full audit (all categories)
/mot skills # Just skills
/mot agents # Just agents
/mot hooks # Just hooks
/mot memory # Just memory system
/mot --fix # Auto-fix simple issues
/mot --quick # P0 checks only (fast)
# Count skills
echo "=== SKILLS ==="
SKILL_COUNT=$(find .claude/skills -name "SKILL.md" | wc -l | xargs)
echo "Found $SKILL_COUNT skill files"
# Check frontmatter parsing
FAIL=0
for skill in $(find .claude/skills -name "SKILL.md"); do
if ! head -1 "$skill" | grep -q "^---$"; then
echo "FAIL: No frontmatter: $skill"
FAIL=$((FAIL+1))
fi
done
echo "Frontmatter: $((SKILL_COUNT - FAIL)) pass, $FAIL fail"
# Check name matches directory
FAIL=0
for skill in $(find .claude/skills -name "SKILL.md"); do
dir=$(basename $(dirname "$skill"))
name=$(grep "^name:" "$skill" 2>/dev/null | head -1 | cut -d: -f2 | xargs)
if [ -n "$name" ] && [ "$dir" != "$name" ]; then
echo "FAIL: Name mismatch $dir vs $name"
FAIL=$((FAIL+1))
fi
done
echo "Name consistency: $((SKILL_COUNT - FAIL)) pass, $FAIL fail"
echo "=== AGENTS ==="
AGENT_COUNT=$(ls .claude/agents/*.md 2>/dev/null | wc -l | xargs)
echo "Found $AGENT_COUNT agent files"
# Check required fields
FAIL=0
for agent in .claude/agents/*.md; do
[ -f "$agent" ] || continue
# Check name field exists
if ! grep -q "^name:" "$agent"; then
echo "FAIL: Missing name: $agent"
FAIL=$((FAIL+1))
continue
fi
# Check model is valid
model=$(grep "^model:" "$agent" | head -1 | cut -d: -f2 | xargs)
case "$model" in
opus|sonnet|haiku) ;;
*) echo "FAIL: Invalid model '$model': $agent"; FAIL=$((FAIL+1)) ;;
esac
done
echo "Agent validation: $((AGENT_COUNT - FAIL)) pass, $FAIL fail"
# Check for dangling references (agents that reference non-existent agents)
echo "Checking agent cross-references..."
for agent in .claude/agents/*.md; do
[ -f "$agent" ] || continue
# Find subagent_type references
refs=$(grep -oE 'subagent_type[=:]["'\'']*([a-z-]+)' "$agent" 2>/dev/null | sed 's/.*["'\'']//' | sed 's/["'\'']$//')
for ref in $refs; do
if [ ! -f ".claude/agents/$ref.md" ]; then
echo "WARN: $agent references non-existent agent: $ref"
fi
done
done
echo "=== HOOKS ==="
# Check TypeScript source count
TS_COUNT=$(ls .claude/hooks/src/*.ts 2>/dev/null | wc -l | xargs)
echo "Found $TS_COUNT TypeScript source files"
# Check bundles exist
BUNDLE_COUNT=$(ls .claude/hooks/dist/*.mjs 2>/dev/null | wc -l | xargs)
echo "Found $BUNDLE_COUNT built bundles"
# Check shell wrappers are executable
FAIL=0
for sh in .claude/hooks/*.sh; do
[ -f "$sh" ] || continue
if [ ! -x "$sh" ]; then
echo "FAIL: Not executable: $sh"
FAIL=$((FAIL+1))
fi
done
SH_COUNT=$(ls .claude/hooks/*.sh 2>/dev/null | wc -l | xargs)
echo "Shell wrappers: $((SH_COUNT - FAIL)) executable, $FAIL need chmod +x"
# Check hooks registered in settings.json exist
echo "Checking registered hooks..."
FAIL=0
# Extract hook commands from settings.json and verify files exist
grep -oE '"command":\s*"[^"]*\.sh"' .claude/settings.json 2>/dev/null | \
sed 's/.*"\([^"]*\.sh\)".*/\1/' | \
sed 's|\$CLAUDE_PROJECT_DIR|.claude|g' | \
sed "s|\$HOME|$HOME|g" | \
sort -u | while read hook; do
# Resolve to actual path
resolved=$(echo "$hook" | sed 's|^\./||')
if [ ! -f "$resolved" ] && [ ! -f "./$resolved" ]; then
echo "WARN: Registered hook not found: $hook"
fi
done
echo "=== MEMORY SYSTEM ==="
# Check DATABASE_URL
if [ -z "$DATABASE_URL" ]; then
echo "FAIL: DATABASE_URL not set"
else
echo "PASS: DATABASE_URL is set"
# Test connection
if psql "$DATABASE_URL" -c "SELECT 1" > /dev/null 2>&1; then
echo "PASS: PostgreSQL reachable"
# Check pgvector
if psql "$DATABASE_URL" -c "SELECT extname FROM pg_extension WHERE extname='vector'" 2>/dev/null | grep -q vector; then
echo "PASS: pgvector extension installed"
else
echo "FAIL: pgvector extension not installed"
fi
# Check table exists
if psql "$DATABASE_URL" -c "\d archival_memory" > /dev/null 2>&1; then
echo "PASS: archival_memory table exists"
# Count learnings
COUNT=$(psql "$DATABASE_URL" -t -c "SELECT COUNT(*) FROM archival_memory" 2>/dev/null | xargs)
echo "INFO: $COUNT learnings stored"
else
echo "FAIL: archival_memory table missing"
fi
else
echo "FAIL: PostgreSQL not reachable"
fi
fi
# Check Python dependencies
echo "Checking Python dependencies..."
(cd opc && uv run python -c "import psycopg2; import pgvector; import sentence_transformers" 2>/dev/null) && \
echo "PASS: Python dependencies available" || \
echo "WARN: Some Python dependencies missing"
echo "=== CROSS-REFERENCES ==="
# Check skills reference valid agents
echo "Checking skill → agent references..."
FAIL=0
for skill in $(find .claude/skills -name "SKILL.md"); do
refs=$(grep -oE 'subagent_type[=:]["'\'']*([a-z-]+)' "$skill" 2>/dev/null | sed 's/.*["'\'']//' | sed 's/["'\'']$//')
for ref in $refs; do
if [ -n "$ref" ] && [ ! -f ".claude/agents/$ref.md" ]; then
echo "FAIL: $skill references missing agent: $ref"
FAIL=$((FAIL+1))
fi
done
done
echo "Skill→Agent refs: $FAIL broken"
If --fix is specified, automatically fix:
Make shell wrappers executable
chmod +x .claude/hooks/*.sh
Rebuild hooks if TypeScript newer than bundles
cd .claude/hooks && npm run build
Create missing cache directories
mkdir -p .claude/cache/agents/{scout,kraken,oracle,spark}
mkdir -p .claude/cache/mot
Write full report to .claude/cache/mot/report-{timestamp}.md:
# MOT Health Report
Generated: {timestamp}
## Summary
| Category | Pass | Fail | Warn |
|----------|------|------|------|
| Skills | 204 | 2 | 0 |
| Agents | 47 | 1 | 3 |
| Hooks | 58 | 2 | 1 |
| Memory | 4 | 0 | 1 |
| X-Refs | 0 | 0 | 2 |
## Issues Found
### P0 - Critical
- [FAIL] Hook build failed: tldr-context-inject.ts
### P1 - High
- [FAIL] Agent references missing: scot → scout (typo)
### P2 - Medium
- [WARN] 3 hooks need rebuild (dist older than src)
### P3 - Low
- [INFO] VOYAGE_API_KEY not set (using local BGE)
0 - All P0/P1 checks pass1 - Any P0/P1 failure2 - Only P2/P3 warningsOnly run P0 checks:
Weekly Installs
199
Repository
GitHub Stars
3.6K
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
opencode190
codex189
cursor187
gemini-cli186
github-copilot183
amp180