precommit-setup
Configures pre-commit hooks for linting, type checking, formatting, and testing
Rank
62
Safety
84
Downloads
1.8k
Updated
Oct 10, 2026
Version
1.9.19
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.8K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 10, 2026
- Adoption signal
- 1.8K downloadsadoption · observed Oct 10, 2026
- Latest release
- 1.9.19release · observed Aug 26, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-attune-precommit-setup- Install using `clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-attune-precommit-setup` in an isolated environment before connecting it to live workloads.
- No published capability contract is available yet, so validate auth and request/response behavior manually.
- Review the upstream CLAWHUB listing at https://clawhub.ai/athola/nm-attune-precommit-setup before using production credentials.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-attune-precommit-setup/snapshot"
Documentation
CLAWHUB
145,829 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: precommit-setup
description: Configures pre-commit hooks for linting, type checking, formatting, and testing
version: 1.9.8
triggers:
- pre-commit
- quality-gates
- linting
- type-checking
- testing
- setting up a new project or adding quality gates to an existing one
metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/attune", "emoji": "\ud83e\udd9e"}}
source: claude-night-market
source_plugin: attune
---
> **Night Market Skill** — ported from [claude-night-market/attune](https://github.com/athola/claude-night-market/tree/master/plugins/attune). For the full experience with agents, hooks, and commands, install the Claude Code plugin.
# Pre-commit Setup Skill
Configure a three-layer pre-commit quality system that
enforces linting, type checking, and testing before every
commit.
## When To Use
- Setting up a new project with code-quality enforcement
- Adding pre-commit hooks to an existing project
- Upgrading from basic linting to a full quality system
- Setting up monorepo or plugin architecture with
per-component quality checks
- Updating pre-commit hook versions
## When NOT To Use
- Pre-commit hooks already configured and working optimally
- Project does not use git version control
- Team explicitly avoids pre-commit hooks for workflow reasons
## Philosophy: Three-Layer Defense
The system is organised in three layers, each with a
different cost / coverage tradeoff:
- **Layer 1 -- Standard hooks**: fast global checks
(50-200ms total). Lints and type-checks every staged file.
- **Layer 2 -- Component-specific checks**: per-component
lint, typecheck, and test (10-30s total). Only the
components touched by the staged files are run.
- **Layer 3 -- Validation hooks**: project-specific
structure and pattern checks (varies). Catches violations
that generic linters miss.
This layering keeps the fast feedback loop fast while still
catching the slow / project-specific bugs before they land.
## Module Loading
The detailed configuration patterns are in modules; load
only the ones you need:
- `modules/standard-hooks.md` -- Layer 1 patterns for
Python, Rust, and TypeScript (load when configuring base
linters).
- `modules/component-level-hooks.md` -- Layer 2 monorepo
scripts and pre-commit wiring (load when project has
multiple components / plugins).
- `modules/validation-hooks.md` -- Layer 3 custom hooks
and SKIP patterns (load when enforcing project conventions
beyond linting).
- `modules/ci-integration.md` -- GitHub Actions workflow
plus a complete `.pre-commit-config.yaml` example (load
when wiring CI to mirror local checks).
- `modules/troubleshooting.md` -- timing tables, cache
clearing, hook-failure recovery (load when hooks are slow
or failing).
## Workflow
### 1. Create Configuration Files
\`\`\`bash
# Create .pre-commit-config.yaml
python3 plugins/attune/scripts/attune_init.py \\
--lang python \\
--name my-project \\
--path_meta.json
{
"ownerId": "kn7d107jg9jv602h9ytsegydq184a42s",
"slug": "nm-attune-precommit-setup",
"version": "1.9.19",
"publishedAt": 1787749612113
}modules/ci-integration.md
---
name: ci-integration
description: GitHub Actions and GitLab CI workflow patterns mirroring local pre-commit checks.
parent: precommit-setup
load_when: configuring CI to run the same checks as pre-commit
---
# CI Integration
Verify CI runs the same comprehensive checks that pre-commit
runs locally. Drift between local hooks and CI is the most
common cause of "works on my machine" PRs.
## GitHub Actions
\`\`\`yaml
# .github/workflows/quality.yml
name: Code Quality
on: [push, pull_request]
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
run: pip install uv
- name: Install dependencies
run: uv sync
- name: Run Comprehensive Quality Checks
run: ./scripts/check-all-quality.sh
- name: Upload Coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
\`\`\`
## Complete Example: Python Monorepo
\`\`\`yaml
# .pre-commit-config.yaml
repos:
# Layer 1: Fast Global Checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-json
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.2
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
args: [--ignore-missing-imports]
- repo: https://github.com/PyCQA/bandit
rev: 1.8.3
hooks:
- id: bandit
args: [-c, pyproject.toml]
# Layer 2: Component-Specific Checks
- repo: local
hooks:
- id: run-component-lint
name: Lint Changed Components
entry: ./scripts/run-component-lint.sh
language: system
pass_filenames: false
files: ^plugins/.*\\.py\$
- id: run-component-typecheck
name: Type Check Changed Components
entry: ./scripts/run-component-typecheck.sh
language: system
pass_filenames: false
files: ^plugins/.*\\.py\$
- id: run-component-tests
name: Test Changed Components
entry: ./scripts/run-component-tests.sh
language: system
pass_filenames: false
files: ^plugins/.*\\.(py|md)\$
# Layer 3: Validation Hooks
- repo: local
hooks:
- id: validate-plugin-structure
name: Validate Plugin Structure
entry: python3 scripts/validate_plugins.py
language: system
pass_filenames: false
files: ^plugins/.*\$
\`\`\`modules/component-level-hooks.md
---
name: component-level-hooks
description: Layer 2 per-component pre-commit checks for monorepos and plugin architectures.
parent: precommit-setup
load_when: project has multiple components or plugins
---
# Component-Specific Checks (Layer 2)
For monorepos, plugin architectures, or projects with multiple
components, add per-component quality checks. Each script
detects changed components from staged files and runs lint /
typecheck / test only against the affected components.
## Python Monorepo or Plugin Architecture
Create three quality-check scripts under `scripts/`. All three
share the same change-detection pattern.
### 1. Lint Changed Components (`scripts/run-component-lint.sh`)
\`\`\`bash
#!/bin/bash
# Lint only changed components based on staged files
set -euo pipefail
# Detect changed components from staged files
CHANGED_COMPONENTS=\$(git diff --cached --name-only | grep -E '^(plugins|components)/' | cut -d/ -f2 | sort -u) || true
if [ -z "\$CHANGED_COMPONENTS" ]; then
echo "No components changed"
exit 0
fi
echo "Linting changed components: \$CHANGED_COMPONENTS"
FAILED=()
for component in \$CHANGED_COMPONENTS; do
if [ -d "plugins/\$component" ]; then
echo "Linting \$component..."
# Capture exit code to properly propagate failures
local exit_code=0
if [ -f "plugins/\$component/Makefile" ] && grep -q "^lint:" "plugins/\$component/Makefile"; then
(cd "plugins/\$component" && make lint) || exit_code=\$?
else
(cd "plugins/\$component" && uv run ruff check .) || exit_code=\$?
fi
if [ "\$exit_code" -ne 0 ]; then
FAILED+=("\$component")
fi
fi
done
if [ \${#FAILED[@]} -gt 0 ]; then
echo "Lint failed for: \${FAILED[*]}"
exit 1
fi
\`\`\`
### 2. Type Check Changed Components (`scripts/run-component-typecheck.sh`)
\`\`\`bash
#!/bin/bash
# Type check only changed components
set -euo pipefail
CHANGED_COMPONENTS=\$(git diff --cached --name-only | grep -E '^(plugins|components)/' | cut -d/ -f2 | sort -u) || true
if [ -z "\$CHANGED_COMPONENTS" ]; then
exit 0
fi
echo "Type checking changed components: \$CHANGED_COMPONENTS"
FAILED=()
for component in \$CHANGED_COMPONENTS; do
if [ -d "plugins/\$component" ]; then
echo "Type checking \$component..."
# Capture output and exit code separately to properly propagate failures
local output
local exit_code=0
if [ -f "plugins/\$component/Makefile" ] && grep -q "^typecheck:" "plugins/\$component/Makefile"; then
output=\$(cd "plugins/\$component" && make typecheck 2>&1) || exit_code=\$?
else
output=\$(cd "plugins/\$component" && uv run mypy src/ 2>&1) || exit_code=\$?
fi
# Display output (filter make noise)
echo "\$output" | grep -v "^make\[" || true
if [ "\$exit_code" -ne 0 ]; then
FAILED+=("\$component")
fi
fi
done
if [ \${#FAILED[@]} -gt 0 modules/standard-hooks.md
---
name: standard-hooks
description: Layer 1 fast global pre-commit checks for Python, Rust, and TypeScript projects.
parent: precommit-setup
load_when: configuring base linters
---
# Standard Hooks (Layer 1)
Fast global checks that run on every commit (typically 50-200ms total).
## Python Projects
### Basic Quality Checks
1. **pre-commit-hooks** -- file validation (trailing whitespace,
EOF, YAML/TOML/JSON syntax)
2. **ruff** -- ultra-fast linting and formatting (~50ms)
3. **ruff-format** -- code formatting
4. **mypy** -- static type checking (~200ms)
5. **bandit** -- security scanning
### Configuration
\`\`\`yaml
# .pre-commit-config.yaml
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-json
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.2
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
args: [--ignore-missing-imports]
- repo: https://github.com/PyCQA/bandit
rev: 1.8.3
hooks:
- id: bandit
args: [-c, pyproject.toml]
\`\`\`
## Rust Projects
1. **rustfmt** -- code formatting
2. **clippy** -- linting
3. **cargo-check** -- compilation check
## TypeScript Projects
1. **eslint** -- linting
2. **prettier** -- code formatting
3. **tsc** -- type checkingAionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/athola/skills/nm-attune-precommit-setup",
"sourceUrl": "https://clawhub.ai/athola/skills/nm-attune-precommit-setup",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T02:37:23.557Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-attune-precommit-setup/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-attune-precommit-setup/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T02:37:23.557Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.8K downloads",
"href": "https://clawhub.ai/athola/nm-attune-precommit-setup",
"sourceUrl": "https://clawhub.ai/athola/nm-attune-precommit-setup",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T02:37:23.557Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.9.19",
"href": "https://clawhub.ai/athola/nm-attune-precommit-setup",
"sourceUrl": "https://clawhub.ai/athola/nm-attune-precommit-setup",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-08-26T13:06:52.113Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-attune-precommit-setup/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-attune-precommit-setup/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.9.19",
"description": "Release v1.9.19",
"href": "https://clawhub.ai/athola/nm-attune-precommit-setup",
"sourceUrl": "https://clawhub.ai/athola/nm-attune-precommit-setup",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-08-26T13:06:52.113Z",
"isPublic": true
}
]
}Record generated Oct 10, 2026.
