aurora-payments/data-skills/setup-pre-commit-data
Claude Code and agent skill by aurora-payments/data-skills
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Set up pre-commit hooks for a data repo, covering SQL formatting and linting (SQLFluff), YAML linting, dbt metadata checks (dbt-checkpoint), and a destructive-SQL tripwire. Use when user wants to add pre-commit hooks, lint or format SQL at commit time, enforce model descriptions or tests before commit, or block destructive SQL from being committed.
Install
npx vskill@latest install aurora-payments/data-skills/setup-pre-commit-dataSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as aurora-payments/data-skills/setup-pre-commit-data.
Setup Pre-Commit Hooks
Commit-time gates are static and warehouse-free. Anything that needs a warehouse connection (data tests, builds, compilation against live schemas) belongs in CI, not the hook.
What This Sets Up
- pre-commit framework wired into
.git/hooks/pre-commit - SQLFluff fix + lint on SQL files
- yamllint on YAML configs
- dbt-checkpoint metadata gates (descriptions, declared tests,
ref()/source()discipline), dbt repos only - Destructive-SQL tripwire: a local hook that fails the commit on
DROP/TRUNCATE/ bareDELETE
Steps
1. Detect the toolchain
Check for dbt_project.yml (a dbt repo, so include the dbt-checkpoint block in step 3). Check Python dependency management: uv.lock (uv), poetry.lock (poetry), requirements*.txt (pip). Use whichever is present. Default to plain pip if unclear.
2. Install pre-commit
Add pre-commit to dev dependencies with the detected tool. Confirm pre-commit --version runs.
3. Create .pre-commit-config.yaml
Adapt: Drop the dbt-checkpoint repo if there is no dbt_project.yml and tell the user. Drop no-commit-to-branch if the repo commits to main directly. Every rev must be an immutable tag or SHA, never a branch. The revs above were current mid-2026; resolve each repo's latest release tag at install time. The tripwire's types: [sql] matches only files the identify library tags as SQL, and .sqlx (Dataform) gets an empty tag set, so in Dataform repos override both tripwire hooks with files: '\.(sql|sqlx)$' and types: [text] (pre-commit sniffs unknown extensions as text at runtime).
4. Create .sqlfluff (if missing)
Set dialect to the warehouse dialect (bigquery, snowflake, and 28 supported in total as of 4.2.2). Keep templater = jinja in the hook even in dbt repos: the dbt templater needs the warehouse adapter installed and may need database access at compile, so official guidance is jinja for hooks and IDE, dbt templater for CI. The templater can only be set in this root config.
5. Create .yamllint (if missing)
Only create if no yamllint config exists. Add rule overrides only when the defaults are unworkable.
6. Install the hook
This writes .git/hooks/pre-commit. Completion: that file exists.
7. Verify
- [ ]
.pre-commit-config.yamlexists; everyrevis a tag or SHA, not a branch - [ ]
pre-commit run --all-filescompletes (first run builds tool environments, slow once and cached after) - [ ] Tripwire test: stage a scratch
.sqlfile containingDROP TABLE t;and the commit must fail (the tripwire hooks only scan files pre-commit classifies as SQL, so a.txtscratch file proves nothing); then delete the file - [ ] dbt repos:
dbt-parseappears before everycheck-*hook in the config
8. Commit
Stage all changed/created files and commit with message: Add pre-commit hooks (pre-commit + sqlfluff + dbt-checkpoint)
This will run through the new pre-commit hooks: a good smoke test that everything works.
Notes
- Data tests never run in the hook: they execute against the warehouse. Pre-merge code checks and in-flow data audits are separate test planes; the hook owns only the first.
- dbt-checkpoint hooks read
target/manifest.json. A stale manifest is a false pass, which is whydbt-parseleads the block. - SQLFluff ≥3.0:
fixapplies without prompting (--forceis deprecated because its behavior became the default;--checkrestores the prompt) and skips files with parse errors. - dbt-checkpoint was formerly
pre-commit-dbt: old tutorials point at the dead repo name and a different hook set. - Prefer a pure formatter? sqlfmt is Black-style, formats jinja without compiling, and pairs with SQLFluff-as-linter, the dbt-recommended split.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/setup-pre-commit-data/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/aurora-payments/data-skills/setup-pre-commit-data)