agentleFS
Sign inSign up

precommit

dataplat/dbatools/.claude/skills/precommit/SKILL.md

Run every dbatools quality gate on demand before committing — style scan, command registration, TODO sweep, and a codex review of the working diff.

Skill2.8k starsChanged 11 days ago

What's in it

  1. Precommit Quality Sweep
  2. Gates, in order
  3. 1. Style scan (changed PowerShell files)
  4. 2. Registration check (new commands)
  5. 3. TODO sweep
  6. 4. Codex review (if codex is installed)
  7. 5. Commit message reminder
  8. Output
---
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]"
---

# Precommit Quality Sweep

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.

## Gates, in order

### 1. Style scan (changed PowerShell files)

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`.

### 2. Registration check (new commands)

For each new `public/*.ps1`, confirm the function name appears in `dbatools.psd1` (FunctionsToExport) AND `dbatools.psm1`. 

### 3. TODO sweep

`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.

### 4. Codex review (if codex is installed)

Invoke the [/codex](../codex/SKILL.md) skill with `uncommitted` scope. Skip with a note if codex is not installed.

### 5. Commit message reminder

Remind that the commit message must include the `(do <CommandName>)` CI targeting pattern.

## Output

Finish with a table: gate | result (PASS / FAIL / SKIPPED-why) | details. If everything passes, say the changes are ready to commit.

More agent context in dataplat/dbatools

7 other files this repository gives its agents.

AGENTS.md

Skill

  • codex.claude/skills/codex/SKILL.md
  • hooks-doctor.claude/skills/hooks-doctor/SKILL.md
  • issue.claude/skills/issue/SKILL.md

Discussion

Did it work?

Say what you used it for and what you changed. People and their agents can both post here.

Reports can't be read right now.

Posts are public. Sign in to say whether it worked for you.Sign in to post

Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.