关于 diagnose
diagnose 是用于 FloatingClock 的技能,通过只读检查生成一页诊断摘要,并要求在检查或路径确实过时时修正技能内容。
主要功能
- 01生成一页诊断摘要
- 02执行只读系统检查
- 03复核并修正可复现问题
适用场景
- 01检查 FloatingClock 安装状态
- 02确认路径变更后更新诊断
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ terrylica/ cc-skills --skill diagnose安装后在 Claude Code 中输入/diagnose确认已加载。
详细介绍
/floating-clock:diagnose
生成一页诊断摘要。
自我演进技能:此技能会在使用过程中不断改进。如果某项检查有误、参数发生偏移,或需要采用变通方案,请立即修复此文件,不要拖延。仅针对真实且可复现的问题进行更新。
步骤
按顺序运行一系列只读检查。可随时安全调用,不会修改文件,也不会触及 NSUserDefaults。
PLUGIN_ROOT="$(cc-plugin-root floating-clock)"
APP_SYS="/Applications/FloatingClock.app"
APP_LOCAL="$PLUGIN_ROOT/build/FloatingClock.app"
echo "=== FloatingClock diagnostic ==="
echo
# Installed app
if [ -d "$APP_SYS" ]; then
echo "[installed] $APP_SYS"
BIN="$APP_SYS/Contents/MacOS/floating-clock"
if [ -x "$BIN" ]; then
file "$BIN" | sed 's/^/ /'
stat -f " size: %z bytes" "$BIN"
fi
codesign -dv --verbose=0 "$APP_SYS" 2>&1 | sed 's/^/ /'
/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" \
-c "Print :CFBundleVersion" "$APP_SYS/Contents/Info.plist" 2>/dev/null \
| paste - - | sed 's/^/ version: /; s/\t/ · build /'
else
echo "[installed] not found (use /floating-clock:install)"
fi
echo
# Local build
if [ -d "$APP_LOCAL" ]; then
echo "[local] $APP_LOCAL"
BIN="$APP_LOCAL/Contents/MacOS/floating-clock"
if [ -x "$BIN" ]; then
stat -f " size: %z bytes" "$BIN"
fi
/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" \
-c "Print :CFBundleVersion" "$APP_LOCAL/Contents/Info.plist" 2>/dev/null \
| paste - - | sed 's/^/ version: /; s/\t/ · build /'
else
echo "[local] not built (run: cd $PLUGIN_ROOT && make all)"
fi
echo
# Running process
PIDS=$(pgrep -f "FloatingClock.app/Contents/MacOS/floating-clock" 2>/dev/null)
if [ -n "$PIDS" ]; then
echo "[process] running · pid(s) $PIDS"
ps -o pid,rss,%cpu,etime -p $PIDS | tail -n +2 | sed 's/^/ /'
else
echo "[process] not running"
fi
echo
# Current profile (if defaults exist)
ACTIVE=$(defaults read com.cc-skills.floating-clock ActiveProfile 2>/dev/null)
if [ -n "$ACTIVE" ]; then
echo "[profile] active: $ACTIVE"
else
echo "[profile] defaults not initialized (run the app first)"
fi
echo
# Test-suite status (quick — just runs existing test binary, skips rebuild)
TEST_BIN="$PLUGIN_ROOT/build/test_session"
if [ -x "$TEST_BIN" ]; then
echo "[tests] running cached test binary…"
"$TEST_BIN" 2>&1 | tail -1 | sed 's/^/ /'
else
echo "[tests] build/test_session not found (run: cd $PLUGIN_ROOT && make check)"
fi
echo
echo "=== diagnostic complete ==="
执行后反思
此技能运行完毕后,在结束前检查:
- 报告是否呈现了用户所需的信息?——如果缺少某个有用字段(签名详情、plist 键、近期崩溃日志),请添加。
- 是否有检查产生了错误信号?——收紧判断条件,或移除该检查。
- 路径或构件名称是否发生偏移?——更新脚本(二进制文件路径、应用包路径、测试二进制文件位置),确保下次调用时与实际情况一致。
仅当问题真实且可复现时才进行更新,不要臆测。
评论
支持 Markdown