feat/hash-id-key-subcommand
develop
tools/hash-id
key
hash-id key <計畫名稱> <owner/repo>
|
tools/normalize-name.sh
hash-id
hash-id key "我的計畫" "plugins/sdlc"
hash-id "我的計畫|plugins/sdlc"
ABC 計畫
abc 計畫
bash -n
comment-scope.sh sweep
swagger-detect.sh
為什麼:多個技能各自手動拼接計畫名稱與 owner/repo 字串再算雜湊,重複邏輯容易長出分歧的正規化寫法,也讓 hash-id 混雜了業務規則,職責變得不單純。 做了什麼: - hash-id 新增 key 子命令(hash-id key <計畫名稱> <owner/repo>),將計畫名稱正規化後以 | 分隔接上 owner/repo 再計算雜湊,提供統一的組法入口,讓其他技能不必各自接字串。 - 將正規化規則(Unicode NFC、去除頭尾空白、內部連續空白壓成一個、全形英數轉半形,大小寫維持不變)獨立成 tools/normalize-name.sh,hash-id 只呼叫它,不再內嵌業務規則,保持雜湊職責單純,也方便日後其他工具重用同一套正規化邏輯。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
No dependencies set.
The note is not visible to the blocked user.
摘要
變更內容
tools/hash-idkey子命令(hash-id key <計畫名稱> <owner/repo>),將計畫名稱正規化後以|接上 owner/repo 再算雜湊,提供統一組法入口,讓多個技能不必各自接字串;改為呼叫獨立的正規化模組,不再內嵌業務規則。tools/normalize-name.sh(新增)設計重點
hash-id只呼叫tools/normalize-name.sh,避免發散式變化(同一檔案承擔兩種變動理由)。測試結果
hash-id key "我的計畫" "plugins/sdlc"與手接字串hash-id "我的計畫|plugins/sdlc"輸出同一個 40 碼雜湊,驗證統一組法入口與手動拼接等價。ABC 計畫與abc 計畫正規化後輸出不同雜湊,驗證大小寫不被抹掉。bash -n語法檢查通過;comment-scope.sh sweep掃描通過,無殘留審查痕跡註解。swagger-detect.sh判定此存放庫不支援 Swagger(結束碼 1),已依規則跳過。前置 Push Request