From 8af189167d00524a55415160020cc29ded9cbebc Mon Sep 17 00:00:00 2001 From: asepharyana Date: Sat, 25 Jul 2026 13:01:03 +0700 Subject: [PATCH] fix(hub-guide): make hook output language-neutral Remove English hardcoded sentences from detect-project.sh and detect-file-type.sh. Output is now structured labels (emoji + key: value) without linguistic content. --- hooks/scripts/detect-file-type.sh | 28 +++++++--------------------- hooks/scripts/detect-project.sh | 9 +++------ 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/hooks/scripts/detect-file-type.sh b/hooks/scripts/detect-file-type.sh index 2244903..2677d60 100755 --- a/hooks/scripts/detect-file-type.sh +++ b/hooks/scripts/detect-file-type.sh @@ -9,25 +9,11 @@ FILE_PATH=$(echo "$TOOL_INPUT" | grep -o '"file_path"[[:space:]]*:[[:space:]]*"[ EXT="${FILE_PATH##*.}" case "$EXT" in - ts|tsx) - echo "📐 [hub-guide] TypeScript file — apply typescript skill rules (strict types, no-any, proper generics)" - ;; - py) - echo "📐 [hub-guide] Python file — apply python skill rules (type hints, PEP 8, no wildcard imports)" - ;; - rs) - echo "📐 [hub-guide] Rust file — apply rust skill rules (ownership, error handling, clippy clean)" - ;; - go) - echo "📐 [hub-guide] Go file — apply go skill rules (idiomatic Go, interfaces, error handling)" - ;; - js|jsx) - echo "📐 [hub-guide] JavaScript file — apply typescript skill rules (ESM, modern JS)" - ;; - dockerfile|Dockerfile) - echo "📐 [hub-guide] Dockerfile — apply docker skill rules (multi-stage, minimal layers, no root)" - ;; - yml|yaml) - echo "📐 [hub-guide] YAML file — check ci-cd and docker skill rules" - ;; + ts|tsx) echo "📐 .${EXT} → typescript:strict" ;; + py) echo "📐 .py → python:strict" ;; + rs) echo "📐 .rs → rust:strict" ;; + go) echo "📐 .go → go:strict" ;; + js|jsx) echo "📐 .${EXT} → typescript:esm" ;; + Dockerfile|dockerfile) echo "📐 Dockerfile → docker:minimal" ;; + yml|yaml) echo "📐 .${EXT} → ci-cd+docker" ;; esac diff --git a/hooks/scripts/detect-project.sh b/hooks/scripts/detect-project.sh index f4d6a1f..16938fb 100755 --- a/hooks/scripts/detect-project.sh +++ b/hooks/scripts/detect-project.sh @@ -67,11 +67,8 @@ CORE="engineering-principles, clean-code, clean-architecture, testing, error-han SKILLS="${SKILLS#, }" # strip leading ", " -echo "📐 [hub-guide] detected: ${PROJECT_DIR}" -echo "📐 [hub-guide] core skills: ${CORE}" +echo "📐 [hub-guide] ${PROJECT_DIR}" +echo "📐 core: ${CORE}" if [ -n "$SKILLS" ]; then - echo "📐 [hub-guide] project-specific: ${SKILLS}" + echo "📐 active: ${SKILLS}" fi -echo "📐 [hub-guide] Apply these best-practice rules throughout this session." -echo "📐 [hub-guide] When in doubt about intent or approach — ask instead of assuming." -echo "📐 [hub-guide] All skills work regardless of your spoken language — they trigger from code context and project files, not just English keywords."