SOLID Batch
硬性限制
- 保持
.bat檔案精簡(偏好少於 80 行) - 將真正的邏輯委派給 PowerShell 或 Python
實務操作
- 在檔案頂部使用
setlocal - 使用
cd /d "%~dp0"支援可攜式相對路徑 - 在關鍵呼叫後檢查
errorlevel - 當存在提示或環境變數時,請勿硬編碼機密資訊或私有區域網路預設值
- 在啟動未經驗證的網路工具時,輸出安全提示
檢查清單
- 啟動器僅負責編排
- 失敗時以非零代碼結束
- 路徑相對於
%~dp0
SOLID Batch (.bat/.cmd) 防護規則:基於 PowerShell/Python 的精簡封裝,使用 setlocal、明確的 errorlevel 檢查,不包含機密資訊。適用於編輯 Windows 啟動器或可攜式套件的進入點。
這個技能定義了一套嚴格的規則,用來撰寫符合 SOLID 原則的 Windows 批次檔(.bat / .cmd)。它要求批次檔保持精簡(少於 80 行),並將真正的邏輯委派給 PowerShell 或 Python 指令碼。技能強制執行一系列最佳實踐,例如使用 `setlocal` 確保變數區域化、`cd /d "%~dp0"` 以支援跨目錄的可攜式操作,以及在關鍵呼叫後明確檢查 `errorlevel`。此外,它禁止在批次檔中硬編碼機密資訊或私有區域網路預設值,並要求在啟動未經驗證的網路工具時加入安全提示。此技能特別適合 Claude Code、Cursor 等 AI 代理工具,當需要修改、建立或審查 Windows 系統的啟動批次檔或可攜式軟體進入點時使用。
npx skills add https://github.com/Nutz95/CursorCodingSkills/tree/HEAD/skills/solid-batchInstalled? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →
.bat 檔案精簡(偏好少於 80 行)setlocalcd /d "%~dp0" 支援可攜式相對路徑errorlevel%~dp0This repo contains 3 individual skills — each has its own dedicated page.
>- SOLID C++ / ESP32 firmware guardrails: file/class size, no nested classes, strict DI at composition roots, no UNIT_TEST / test ifdefs in production headers (and avoid them in .cpp), no hardcoded secrets, one type per public header, public API /// comments, dual-core radio pinning (PRO_CPU 0 / APP_CPU 1), FreeRTOS-safe patterns. Use when editing ESP-IDF, Arduino-ESP32, PlatformIO firmware, or ESP-NOW / BLE / Wi-Fi tasks.
>- SOLID CUDA 13 / GPU pipeline guardrails for Python+CUDA apps (e.g. NVDEC): concrete typing at boundaries, small modules, explicit device/resource lifetimes, no silent Any leakage. Use when editing CUDA 13, PyNvCodec, GPU decode/inference code.
>- SOLID Docker/Compose guardrails: small Dockerfiles, non-root when practical, no secrets in images, pinned base tags, clear multi-stage builds. Use when editing Dockerfile or compose files.
Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.
Control Eight Sleep pods (status, temperature, alarms, schedules).
BluOS CLI (blu) for discovery, playback, grouping, and volume.
Create, search, and manage Bear notes via grizzly CLI.
Capture frames or clips from RTSP/ONVIF cameras.
Search GIF providers with CLI/TUI, download results, and extract stills/sheets.