Skip to content

Commit 8437fef

Browse files
committed
feat: add .pre-commit-config.yaml mirroring CI checks
Wires netresearch/skill-repo-skill@v1.22.0 as a pre-commit hook provider so validate-skill, check-version-parity, and the standard linter set (markdownlint-cli2, yamllint, actionlint, ruff, shellcheck) run locally before commit instead of only in CI. - .yamllint.yml: matches the default config CI injects in the reusable validate.yml workflow, so local and CI lint identically. - package.json scripts.prepare: invokes pre-commit install --install-hooks if pre-commit is on PATH; silent no-op otherwise. Auto-activates hooks on `npm install`. Part of the fleet rollout following netresearch/agent-harness-skill#27 (CI/Hook Parity Principle) and skill-repo-skill v1.22.0 (hook exposure). Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
1 parent bc7b42c commit 8437fef

3 files changed

Lines changed: 76 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Pre-commit hooks — embodies the CI/Hook Parity Principle for this repo.
2+
#
3+
# Every hook below ALSO runs in CI (via the reusable validate.yml workflow
4+
# from netresearch/skill-repo-skill). CI is the authoritative backstop;
5+
# local hooks are pinned by `rev:` and Renovate bumps them automatically.
6+
#
7+
# See netresearch/agent-harness-skill references/enforcement-mechanisms.md
8+
# for the CI/Hook Parity Principle in full.
9+
#
10+
# Install once after clone: `pre-commit install --install-hooks`.
11+
# Bypass (use sparingly): `git commit --no-verify`. If you need this often,
12+
# the hook is wrong — fix it; don't tolerate the bypass.
13+
14+
default_install_hook_types: [pre-commit]
15+
default_stages: [pre-commit]
16+
17+
repos:
18+
- repo: https://github.com/pre-commit/pre-commit-hooks
19+
rev: v6.0.0
20+
hooks:
21+
- id: trailing-whitespace
22+
- id: end-of-file-fixer
23+
- id: check-merge-conflict
24+
- id: check-added-large-files
25+
- id: check-json
26+
- id: check-yaml
27+
args: [--allow-multiple-documents]
28+
29+
- repo: https://github.com/netresearch/skill-repo-skill
30+
rev: v1.22.0
31+
hooks:
32+
- id: validate-skill
33+
- id: check-version-parity
34+
35+
- repo: https://github.com/DavidAnson/markdownlint-cli2
36+
rev: v0.22.1
37+
hooks:
38+
- id: markdownlint-cli2
39+
files: '\.md$'
40+
41+
- repo: https://github.com/adrienverge/yamllint
42+
rev: v1.38.0
43+
hooks:
44+
- id: yamllint
45+
args: [-c, .yamllint.yml]
46+
47+
- repo: https://github.com/rhysd/actionlint
48+
rev: v1.7.12
49+
hooks:
50+
- id: actionlint
51+
52+
- repo: https://github.com/astral-sh/ruff-pre-commit
53+
rev: v0.15.14
54+
hooks:
55+
- id: ruff
56+
- id: ruff-format
57+
58+
- repo: https://github.com/shellcheck-py/shellcheck-py
59+
rev: v0.11.0.1
60+
hooks:
61+
- id: shellcheck

.yamllint.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Match the default config CI injects when no local file is present.
2+
# See netresearch/skill-repo-skill .github/workflows/validate.yml.
3+
extends: default
4+
rules:
5+
comments:
6+
min-spaces-from-content: 1
7+
document-start: disable
8+
indentation: disable
9+
line-length:
10+
max: 200
11+
truthy:
12+
allowed-values: ['true', 'false', 'on']

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@
2929
],
3030
"peerDependencies": {
3131
"@netresearch/agent-skill-coordinator": "^0.1"
32+
},
33+
"scripts": {
34+
"prepare": "command -v pre-commit >/dev/null && pre-commit install --install-hooks 2>/dev/null || true"
3235
}
3336
}

0 commit comments

Comments
 (0)