Skip to content
Back to skills

Validate Before Commit

ASecurity

Run the full validation sequence before declaring any task done. Use this skill proactively after any code or infrastructure change — run the repository's hooks with prek, then mypy and pulumi preview (where applicable), without waiting to be asked. Never declare success without passing checks.

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
toolspythongobashnodegit

Security analysis

A100/100

Scanned October 4, 2026

npx -y skills add mitodl/agent-kit --skill validate-before-commit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Validate Before Commit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Validate Before Commit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mitodl-validate-before-commit/badge)](https://www.skillsdirectory.com/skills/mitodl-validate-before-commit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: validate-before-commit
description: >
  Run the full validation sequence before declaring any task done. Use this skill
  proactively after any code or infrastructure change — run the repository's
  hooks with prek, then mypy and pulumi preview (where applicable), without
  waiting to be asked. Never declare success without passing checks.
license: BSD-3-Clause
metadata:
  category: workflow
---

# Validate Before Commit

**Do not declare a task done until the full validation sequence has passed.**
Run these checks proactively — do not wait for the human to ask.

## Standard sequence

```bash
# 1. Linting, formatting, and basic static checks
uv run prek run --all-files

# 2. Type checking
uv run mypy <package_or_src_dir>

# 3. Infrastructure plan (if Pulumi files were changed)
pulumi preview --stack <stack-name>
```

mitodl repositories run their hooks with [prek](https://prek.j178.dev), which
reads the same `.pre-commit-config.yaml` (or `prek.toml`) that pre-commit
did. Use the command for the repository's prek pin:

| Repository | Hook command |
|------------|--------------|
| Python with `uv` (prek in the `prek` dependency group) | `uv run prek run --all-files` |
| Node (`@j178/prek` in `devDependencies`) | `npx prek run --all-files` |
| Neither (prek installed as a tool) | `prek run --all-files` |
| Not yet migrated (still uses `pre-commit`) | `uv run pre-commit run --all-files` in a uv project, otherwise `pre-commit run --all-files` |

In a repository with `.github/workflows/autofix.yml`, the same hooks run in CI
as the `prek` check. When the hooks' only problems are ones they fixed
themselves, autofix.ci commits those fixes to the PR, except under `.github/`.
If any hook still fails, nothing is committed and the check stays red.
Running the hooks locally first avoids both.

## Rules

- Run the hooks **before** mypy; they may auto-fix formatting that would
  otherwise produce mypy noise.
- If the hooks auto-fix files, stage the changes and re-run them to confirm
  every hook passes cleanly.
- mypy errors are blocking — do not leave type errors for the human to clean up.
- `pulumi preview` output must be reviewed: unexpected replacements or deletions
  are bugs, not acceptable side effects.

## For Dagster / dg changes

After modifying assets, sensors, or code location structure, also confirm the
workspace loads cleanly:

```bash
dg check
```

## Interpreting failures

Read the full error output before proposing a fix. Do not apply a speculative
patch without understanding the root cause — iterating blindly on the same error
multiple times is worse than pausing to diagnose.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.