From df787f42ae5783319cea02d50d5c637e64380cbf Mon Sep 17 00:00:00 2001 From: arno Date: Mon, 29 Jun 2026 17:45:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD(ClaudeCode):=20prompt-submit?= =?UTF-8?q?=20=E8=AF=86=E5=88=AB=E5=B9=B6=E8=B7=B3=E8=BF=87=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当用户输入匹配 .claude/skills/ 下的技能时直接退出,避免对技能命令执行额外处理 --- .claude/tools/user-prompt-submit.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.claude/tools/user-prompt-submit.sh b/.claude/tools/user-prompt-submit.sh index 12f1593..a763eb7 100755 --- a/.claude/tools/user-prompt-submit.sh +++ b/.claude/tools/user-prompt-submit.sh @@ -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')