claude-code/claude-zh/commands/verify.md

60 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 驗證指令 (Verification Command)
對目前的程式碼庫狀態執行全面驗證。
## 指令步驟
依據以下確切順序執行驗證:
1. **建置檢查 (Build Check)**
- 執行此專案的建置指令
- 如果失敗,回報錯誤並停止 (STOP)
2. **型別檢查 (Type Check)**
- 執行 TypeScript/型別檢查器
- 回報所有錯誤,包含 檔案:行號
3. **Lint 檢查 (Lint Check)**
- 執行 Linter
- 回報警告與錯誤
4. **測試套件 (Test Suite)**
- 執行所有測試
- 回報通過/失敗計數
- 回報覆蓋率百分比
5. **Console.log 稽核**
- 在原始碼檔案中搜尋 `console.log`
- 回報位置
6. **Git 狀態**
- 顯示未提交的變更
- 顯示自上次提交後修改的檔案
## 輸出結果
產生簡潔的驗證報告:
```
驗證結果:[成功/失敗]
建置 (Build) [OK/失敗]
型別 (Types) [OK/X 個錯誤]
Lint [OK/X 個問題]
測試 (Tests) [X/Y 通過, Z% 覆蓋率]
密鑰 (Secrets) [OK/發現 X 個]
日誌 (Logs) [OK/發現 X 個 console.log]
可進行 PR[是/否]
```
如果存在任何關鍵問題,請列出並提供修復建議。
## 參數說明 (Arguments)
$ARGUMENTS 可以是:
- `quick` - 僅執行建置 + 型別檢查
- `full` - 執行所有檢查 (預設項)
- `pre-commit` - 執行與提交相關的檢查
- `pre-pr` - 執行完整檢查加上安全掃描