locales/zh-TW/skills/sweep/SKILL.md
[UDS] 掃描程式庫的除錯殘留與程式碼品質問題;可自動修正安全模式。 Use when: before committing, during PR review, or periodic codebase cleanup. Keywords: sweep, debug cleanup, console.log, debugger, TODO, ts-any, code quality, 掃描, 清理.
npx skillsauth add asiaostrich/universal-dev-standards sweepInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
語言: English | 繁體中文
掃描程式庫的除錯殘留、程式碼品質問題與技術債標記。 可選擇性自動修正安全模式(console.log、debugger 等語句)。
| Pattern ID | 名稱 | 可自動修正 | 說明 |
|------------|------|-----------|------|
| console-log | console.log / console.debug / console.trace | ✅ 是 | 留在正式環境的除錯輸出 |
| debugger | debugger 語句 | ✅ 是 | 留在程式碼中的中斷點 |
| todo-fixme | TODO / FIXME / HACK / XXX | ❌ 僅回報 | 技術債標記 |
| ts-any | TypeScript any 型別 | ❌ 僅回報 | 型別安全違規 |
/sweep # 掃描目前目錄,回報發現
/sweep --fix # 掃描並自動修正可修復項目
/sweep --report # 掃描並將報告寫入 .uds/sweep-report.json
/sweep --path src/ # 掃描指定目錄
/sweep --exclude "**/*.test.ts" # 排除模式(glob)
使用 Glob tool 找出目標路徑下所有原始碼檔案。
預設排除:node_modules/、dist/、.git/、*.min.js、coverage/。
對每個 pattern 使用 Grep 在所有檔案中尋找比對結果。
彙整發現:{ file, line, column, pattern_id, label, fixable, content }。
輸出結構化摘要:
📊 掃描結果
─────────────────────────────────────
console-log: 12 筆 (可自動修正)
debugger: 2 筆 (可自動修正)
todo-fixme: 28 筆 (僅回報)
ts-any: 5 筆 (僅回報)
─────────────────────────────────────
合計:47 筆 | 可修正:14 筆
若設定 --fix 且可修正發現總數超過 20:
暫停並要求使用者明確確認才套用修正。
顯示將被修改的檔案清單。
對每筆可修正發現:
console-log:若該行僅含 console 語句則刪除該行debugger:若該行僅含 debugger 語句則刪除該行使用 Edit tool 逐檔套用變更。 回報:「已修正 N 筆,影響 M 個檔案。」
將發現寫入 .uds/sweep-report.json:
{
"timestamp": "<ISO8601>",
"total_findings": 47,
"fixable": 14,
"fixed": 14,
"findings_by_pattern": { "console-log": 12, "debugger": 2, "todo-fixme": 28, "ts-any": 5 },
"files_modified": ["src/auth.ts", "src/utils.ts"]
}
透過 uds.project.yaml 設定:
sweep:
default_path: "src/"
exclude_patterns:
- "**/*.test.ts"
- "**/*.spec.ts"
- "**/fixtures/**"
hitl_threshold: 20 # 可修正項目超過此值時需確認
patterns:
enabled:
- console-log
- debugger
- todo-fixme
- ts-any
/sweep 完成後建議:
- 執行
/checkin在提交前驗證整體程式碼品質- 執行
/review審查清理後的變更- 執行
/commit提交修正
| 版本 | 日期 | 變更 | |------|------|------| | 1.0.0 | 2026-04-28 | 初始版本 — XSPEC-097 Phase 1(從上游遷移) |
本 Skill 採用 MIT License 與 CC BY 4.0 雙重授權發布。
development
[UDS] 扫描代码库的调试残留与代码质量问题;可自动修正安全模式。 Use when: before committing, during PR review, or periodic codebase cleanup. Keywords: sweep, debug cleanup, console.log, debugger, TODO, ts-any, code quality, 扫描, 清理.
tools
[UDS] 从规格衍生 BDD 场景、TDD 骨架或 ATDD 表格
development
[UDS] 识别重复流程并以正确的开发深度构建 Skill
tools
[UDS] AI 辅助 git push 安全层:质量门禁 + 协作护栏。 Use when: pushing commits, force pushing, pushing to protected branches, pushing feature branches. Keywords: git push, force push, protected branch, quality gate, push receipt, PR automation, 推送, 保护分支, 质量门禁.