with one click
prek-setup-petems
Set up prek git hooks with sensible defaults and language-specific linters
Menu
Set up prek git hooks with sensible defaults and language-specific linters
Download and verify a Three UK bill PDF via Chrome DevTools, using the My3 JSON API directly (resilient to SPA UI changes)
Build conference talk outlines and MARP slides using the Story Circle framework, tuned to Peter's DevOps/infra community voice. Use when the user wants to structure a tech talk, create presentation slides, or needs help organising talk ideas.
Transform brain dumps into blog posts in Peter's casual, self-deprecating British voice. Use when the user says "write a blog post," "draft a post," "write about [topic]," or provides scattered ideas that need shaping into a cohesive narrative.
Download and verify Hyperoptic broadband bill PDFs via Chrome DevTools browser automation. Use this skill whenever the user mentions Hyperoptic bills, broadband invoices, internet bill downloads, or wants to grab/fetch/save a bill from their Hyperoptic account. Also trigger when the user asks to download bills for expense tracking, filing, or record-keeping from Hyperoptic.
Commit and push with Peter's conventional commit format (50-char titles, * bullet details, imperative mood)
| name | prek-setup-petems |
| description | Set up prek git hooks with sensible defaults and language-specific linters |
| license | MIT |
| allowed-tools | ["Bash","Glob"] |
When the user asks you to set up prek (or pre-commit hooks using prek), follow these steps carefully.
Look for existing hook configuration files:
prek.toml.pre-commit-config.yamlIf either exists, ask the user whether to overwrite, merge with the new config, or leave it unchanged. Do not proceed until the user confirms. If the user chooses leave it unchanged, stop the workflow and report that no changes were made.
Check if prek is available:
command -v prek
If not found, ask the user which installation method they prefer:
brew install prek (macOS/Linuxbrew)cargo install prek (Rust toolchain)pipx install prek (Python)After installation, verify with:
prek --version
Use Glob to check for marker files that indicate which languages the project uses:
| Marker files | Language |
|---|---|
pyproject.toml, setup.py, requirements.txt, Pipfile | Python |
package.json | JavaScript/TypeScript |
go.mod | Go |
Cargo.toml | Rust |
Gemfile, *.gemspec | Ruby |
**/*.tf | Terraform |
Package.swift, *.xcodeproj | Swift |
pom.xml, build.gradle, build.gradle.kts | Java/Kotlin |
**/*.sh | Shell |
**/*.md, hugo.toml, hugo.yaml, config.toml (Hugo), mkdocs.yml | Markdown/Blog |
Report detected languages to the user before continuing.
prek.tomlBuild a prek.toml config file using the native TOML format (recommended by prek).
[[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-json" },
{ id = "check-merge-conflict" },
{ id = "detect-private-key" },
{ id = "check-added-large-files" },
]
Only include sections for detected languages:
Python:
[[repos]]
repo = "https://github.com/astral-sh/ruff-pre-commit"
rev = "v0.15.7"
hooks = [
{ id = "ruff", args = ["--fix"] },
{ id = "ruff-format" },
]
JavaScript/TypeScript:
[[repos]]
repo = "https://github.com/pre-commit/mirrors-prettier"
rev = "v3.1.0"
hooks = [
{ id = "prettier" },
]
Go:
[[repos]]
repo = "https://github.com/golangci/golangci-lint"
rev = "v2.11.3"
hooks = [
{ id = "golangci-lint" },
]
Rust:
[[repos]]
repo = "local"
hooks = [
{ id = "cargo-fmt", name = "cargo fmt", entry = "cargo fmt --", language = "system", types = ["rust"] },
{ id = "cargo-clippy", name = "cargo clippy", entry = "cargo clippy --all-targets --all-features -- -D warnings", language = "system", types = ["rust"], pass_filenames = false },
]
Ruby:
[[repos]]
repo = "https://github.com/rubocop/rubocop"
rev = "v1.85.1"
hooks = [
{ id = "rubocop" },
]
Terraform:
[[repos]]
repo = "https://github.com/antonbabenko/pre-commit-terraform"
rev = "v1.105.0"
hooks = [
{ id = "terraform_fmt" },
{ id = "terraform_validate" },
{ id = "terraform_tflint" },
]
Swift:
[[repos]]
repo = "https://github.com/nicklockwood/SwiftFormat"
rev = "0.60.1"
hooks = [
{ id = "swiftformat" },
]
[[repos]]
repo = "https://github.com/realm/SwiftLint"
rev = "0.63.2"
hooks = [
{ id = "swiftlint" },
]
Shell:
[[repos]]
repo = "https://github.com/shellcheck-py/shellcheck-py"
rev = "v0.11.0.1"
hooks = [
{ id = "shellcheck" },
]
Java/Kotlin:
[[repos]]
repo = "https://github.com/macisamuele/language-formatters-pre-commit-hooks"
rev = "v2.16.0"
hooks = [
{ id = "pretty-format-java", args = ["--autofix"] },
{ id = "pretty-format-kotlin", args = ["--autofix"] },
]
Markdown/Blog:
[[repos]]
repo = "https://github.com/igorshubovych/markdownlint-cli"
rev = "v0.48.0"
hooks = [
{ id = "markdownlint", args = ["--fix"] },
]
[[repos]]
repo = "https://github.com/pre-commit/mirrors-prettier"
rev = "v3.1.0"
hooks = [
{ id = "prettier", types_or = ["markdown", "yaml"], args = ["--prose-wrap", "preserve"] },
]
Show the assembled prek.toml to the user and ask for confirmation before writing it. Make any requested adjustments first.
Run prek install, handling potential global hooksPath conflicts:
git -c core.hooksPath=.git/hooks prek install
Run prek across all files to catch and auto-fix issues:
prek run --all-files
If there are auto-fixable issues, let prek fix them and re-run up to 3 times. If issues still remain (or output does not converge), stop and report remaining failures for manual intervention.
Stage only the new prek.toml and files modified by this prek run (do not stage unrelated pre-existing changes), then do not commit.
Tell the user:
prek autoupdate later to pin hooks to the latest revisions