💻 Coding
Pre-commit Hook Config from a Stack Brief (No Invented Hooks)
Generate a pre-commit config from a stack brief. No invented hook repos, revs, or secrets.
0Reviews
Prompt
Act as a developer writing a pre-commit configuration from a stack brief. You write a .pre-commit-config.yaml from a stack brief. You do not invent hook repository URLs, revs, or secrets. This is not a full CI pipeline and not a security audit. You work only from Inputs. Do not invent stats, citations, quotes, URLs, names, IDs, or records that are not in Inputs. Inputs: - Stack brief (languages, package managers): [Stack] - Hooks I allow by name: [Hooks] - Python/Node versions I lock (or UNKNOWN): [Versions] - Files or globs to exclude: [Exclude] - Words I must not use: [Banned] - What I must never invent: [Never] - Local hooks I may define (or NONE): [Local] - Output format: [Format] - Default stages I allow: [Stages] - Repo URL allow list for hooks: [Repos] Generate: 1. Honesty ledger: Stack, Hooks, Versions, Exclude, Local, Stages, Repos. Forbidden: hook repos not in Repos, invented revs. 2. Header comment stating Stack and Versions. 3. repos blocks only for Hooks that have a URL in Repos. 4. If a Hook has no Repo URL, mark gap instead of inventing. 5. Local hooks only if Local not NONE. 6. Exclude globs as given. 7. Refuse secrets in the file. 8. Compliance pass: cut Banned and Never. Format as Format. Constraints: - pre-commit config from Stack. Not GitHub Actions and not a vuln scan. - Never invent hook repo URLs or revs. - If Versions UNKNOWN, write unknown rather than picking 3.12. - No emojis.
Instructions
Replace every [bracket] with your details before running. Works on ChatGPT, Claude, and Gemini.
Examples
Example Input
Stack: Python poetry app; Node not used Hooks: ruff; black Versions: Python UNKNOWN Exclude: migrations/ Banned: invent mirrors.example hook URL Never: invent rev hash, invent mypy if not in Hooks Local: NONE Format: yaml fence + gaps Stages: commit Repos: ruff -> https://github.com/astral-sh/ruff-pre-commit ; black -> https://github.com/psf/black
Example Output
1. Ledger. Poetry Python app; no Node. Hooks ruff, black. Python UNKNOWN. Exclude migrations/. Local NONE. Stages commit. Repos ruff and black URLs pasted. Forbidden: mirror URL invent, rev invent, mypy invent. 2. YAML sketch. repos: - repo astral-sh/ruff-pre-commit URL as pasted; hooks id ruff. - repo psf/black URL as pasted; hooks id black. exclude migrations/. default_stages commit. rev: NOT IN INPUTS for both (gap). 3. Versions. Python unknown. 4. Local. NONE. 5. Gaps. rev pins for ruff and black. 6. Refuse. Secrets, invented hooks, invented URLs. 7. Notes. Not Actions CI. 8. Compliance. Cut banned. Format yaml fence + gaps. Missing-data policy: if a field was blank, write NOT IN INPUTS rather than guessing. Lock any tool version named in Inputs; if unnamed, write unknown. No invented testimonials, star ratings, or press logos. If legal, clinical, insurance, HR, education-plan, or veterinary content appears, add a one-line not-advice and de-identify banner. Quote banned-word hits and cut them. End with a gaps list of five bullets the user still owes you. Character and byte caps in the job are hard; print counts when relevant. Refuse to backfill DOIs, exam dumps, PHI, PII, or compensation promises not in Inputs. Missing-data policy: if a field was blank, write NOT IN INPUTS rather than guessing. Lock any tool version named in Inputs; if unnamed, write unknown. No invented testimonials, star ratings, or press logos. If legal, clinical, insurance, HR, education-plan, or veterinary content appears, add a one-line not-advice and de-identify banner. Quote banned-word hits and cut them. End with a gaps list of five bullets the user still owes you. Character and byte caps in the job are hard; print counts when relevant. Refuse to backfill DOIs, exam dumps, PHI, PII, or compensation promises not in Inputs.