Prek agentic onboard
Skill zhutao100/prek-agentic-onboard-skill/prek-agentic-onboard
Agent Skill for onboarding prek with Agent-friendly “one-shot” commits, Copy/paste-ready baseline configs.
npx -y skills add zhutao100/prek-agentic-onboard-skill --skill prek-agentic-onboardAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Onboard or migrate repositories from pre-commit to prek, including workspace-mode polyglot setup and agent-friendly auto-format+auto-stage commit convergence (global shim or per-language wrapper hooks).
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
4.6 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it
prek agentic onboard
When to use this skill
Use this skill when you need to:
- set up prek in a repo (greenfield), or migrate from pre-commit
- structure hooks for polyglot repos (workspace / multi-config)
- eliminate agent churn from formatter hooks by achieving commit convergence:
- run formatters/fixers
- auto-stage updates
- re-run until stable, then proceed
Decision tree
-
Greenfield vs Migration
- Greenfield: create or adopt
.pre-commit-config.yaml, thenprek install --prepare-hooks. - Migration: keep existing
.pre-commit-config.yamlinitially; switch runner to prek; optionally add prek-only features later.
- Greenfield: create or adopt
-
Single-config vs Workspace mode
- Single-config: one root
.pre-commit-config.yamlwith path scoping. - Workspace mode: multiple
.pre-commit-config.yamlfiles per subproject. Preferred default for polyglot repos (Swift/TS/etc), not just monorepos.- Note: workspace discovery is cached; use
--refreshafter adding/removing nested configs.
- Note: workspace discovery is cached; use
- Single-config: one root
-
Agentic auto-stage strategy
- Strategy A (recommended): global self-healing
pre-commitshim- A Git hook script loops
prek run+git adduntil stable (or max rounds). - Pros: works for any mutating hooks (EOF fixers, formatters, etc.).
- Note: once
core.hooksPathis set,prek installrefuses to install hooks; useprek prepare-hooks.
- A Git hook script loops
- Strategy B: per-language wrapper hooks
- Each formatter wrapper formats staged files, stages them, then runs a strict gate.
- Pros: portable to pre-commit too, but requires more wrappers.
- Strategy A (recommended): global self-healing
Step-by-step procedures
All scripts support --repo <path> (default: current working directory) and locate templates relative to the script, so you do not need to copy this skill folder into the target repo.
A) Greenfield bootstrap (portable YAML baseline)
Run:
bash prek-agentic-onboard/scripts/prek_bootstrap.sh --repo <path-to-repo> --install-prek --config portable
This will:
- ensure
prekexists (optionally install via brew/uv/pipx/python) - install a baseline
.pre-commit-config.yamlif missing - validate configuration file(s) (e.g.
prek validate-config .pre-commit-config.yaml) - install git shims + prepare hook envs
B) Migrate pre-commit → prek (keep config unchanged)
Run:
bash prek-agentic-onboard/scripts/migrate_precommit_to_prek.sh --repo <path-to-repo>
This will back up .git/hooks/, run pre-commit uninstall if present, then install prek shims (or run prek prepare-hooks if core.hooksPath is set).
Then (recommended):
- Review the existing
.pre-commit-config.yamland ensure all major languages in the repo have appropriate hooks (format + checks).- Shell repos: add
shfmt+shellcheck(useshellcheck -xwhen scriptssourceshared libraries to avoidSC1091).
- Shell repos: add
- If the repo is polyglot, switch to workspace mode (thin root + per-subproject configs) and verify:
- scaffold missing subproject configs:
bash prek-agentic-onboard/scripts/scaffold_workspace_mode.sh --repo <path-to-repo> - confirm discovery:
prek --refresh list - end-to-end run:
prek run --all-files(re-run until stable if formatters modified files)
- scaffold missing subproject configs:
C) Enable agent-friendly commit convergence (Strategy A)
Run:
bash prek-agentic-onboard/scripts/setup_agentic_autostage_shim.sh --repo <path-to-repo>
This will:
- create
.githooks/pre-committhat runsprek runin a loop and auto-stages if hooks changed staged files - set
git config core.hooksPath .githooks
D) Per-language auto-stage wrappers (Strategy B)
Copy a wrapper from:
prek-agentic-onboard/scripts/hooks/
Wire it into your .pre-commit-config.yaml via repo: local hooks (examples in references/agentic-autostage.md).
References and templates
references/playbook.md— end-to-end playbookassets/templates/— baseline configs, workspace templates,.prekignore, and the self-healing hook shimscripts/hooks/— language wrappers (Swift/Python/JS/Rust/Shell)
What ships with it: 24 files
44.7 KB alongside SKILL.md, 10 of them executable
agents/
- openai.yaml404 B
assets/
- templates/githooks.pre-commit.self-heal.shruns2.9 KB
- templates/pre-commit-config.builtin.yaml431 B
- templates/pre-commit-config.portable.yaml553 B
- templates/prekignore108 B
- templates/workspace.bash.pre-commit-config.yaml221 B
- templates/workspace.frontend.pre-commit-config.yaml409 B
- templates/workspace.python.pre-commit-config.yaml192 B
- templates/workspace.rust.pre-commit-config.yaml455 B
- templates/workspace.swift.pre-commit-config.yaml540 B
- templates/workspace.templates.pre-commit-config.yaml770 B
- templates/workspace.typescript.pre-commit-config.yaml451 B
references/
- agentic-autostage.md3.6 KB
- playbook.md4.4 KB
- workspace-mode.md1.5 KB
scripts/
- hooks/precommit_swift_format_autostage.shruns6.2 KB
- hooks/prettier_autostage_pnpm.shruns1.4 KB
- hooks/ruff_autostage.shruns1.6 KB
- hooks/rustfmt_autostage.shruns1.2 KB
- hooks/shfmt_autostage.shruns1.2 KB
- migrate_precommit_to_prek.shruns3.6 KB
- prek_bootstrap.shruns5.7 KB
- scaffold_workspace_mode.shruns4.4 KB
- setup_agentic_autostage_shim.shruns2.6 KB