功能(ClaudeCode): prompt-submit 识别并跳过技能命令

当用户输入匹配 .claude/skills/ 下的技能时直接退出,避免对技能命令执行额外处理
This commit is contained in:
2026-06-29 17:45:38 +08:00
parent 3fee455e4b
commit df787f42ae
+10
View File
@@ -49,6 +49,16 @@ if [ -d "${COMMANDS_DIR}" ]; then
fi
fi
# 排除 .claude/skills/ 中的技能(/arno-prj-commit 等)
SKILLS_DIR="${PROJECT_ROOT}/.claude/skills"
if [ -d "${SKILLS_DIR}" ]; then
# 提取技能名(去掉参数部分),如 "/arno-prj-commit xxx" -> "arno-prj-commit"
SKILL_NAME=$(echo "${USER_PROMPT}" | sed 's|^/\([^ ]*\).*$|\1|')
if [ -n "${SKILL_NAME}" ] && [ -f "${SKILLS_DIR}/${SKILL_NAME}/SKILL.md" ]; then
exit 0
fi
fi
# 获取当前时间戳
TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S')