一键导入
precommit
Run every dbatools quality gate on demand before committing — style scan, command registration, TODO sweep, and a codex review of the working diff.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run every dbatools quality gate on demand before committing — style scan, command registration, TODO sweep, and a codex review of the working diff.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Run codex as an external code reviewer on a commit SHA, uncommitted changes, staged changes, or specific files. Use when the user wants an independent second-opinion review they can iterate on.
Diagnose the Claude Code hook environment for this repo — which tools are present, what each absence disables, and how to fix it. Use when hooks error, block unexpectedly, or seem to do nothing.
基于 SOC 职业分类
| name | precommit |
| description | Run every dbatools quality gate on demand before committing — style scan, command registration, TODO sweep, and a codex review of the working diff. |
| argument-hint | [optional: file paths to limit the check] |
Run the same gates the Stop hooks enforce, but on demand and against the full working diff (including changes made via Bash, which the session-scoped auto-review can't see). Report a single pass/fail summary at the end.
For each changed *.ps1 (from git diff --name-only HEAD + untracked), check the dbatools style rules from CLAUDE.md: no backticks for line continuation, no = $true in parameter attributes, no ::new(), double quotes not single quotes, $splat<Purpose> naming, no ArrayList/List collection, hashtable = alignment, no trailing whitespace. Report violations as path:line — rule.
For each new public/*.ps1, confirm the function name appears in dbatools.psd1 (FunctionsToExport) AND dbatools.psm1.
grep -n -i -E '\b(TODO|FIXME|HACK|XXX|WORKAROUND)\b' across changed code files (exclude .claude/). Each hit must be resolved or explicitly acknowledged by the user.
Invoke the /codex skill with uncommitted scope. Skip with a note if codex is not installed.
Remind that the commit message must include the (do <CommandName>) CI targeting pattern.
Finish with a table: gate | result (PASS / FAIL / SKIPPED-why) | details. If everything passes, say the changes are ready to commit.