A small CLI that checks a repository's contribution rules before you start changing code.
Large repositories often spread requirements across CONTRIBUTING.md, agent instructions, pull-request templates and policy files. ContribPreflight collects the rules it can identify, shows where each one came from, and produces output that can be used by a developer, CI job or coding agent.
It is deterministic and local: it reads a defined set of text files and does not execute repository code.
npx contribpreflight .For machine-readable output:
npx contribpreflight . --jsonFor a shorter agent-oriented report:
npx contribpreflight . --agentGiven a contribution policy like:
AI-assisted contributions are allowed only if their use is disclosed.
Contributors remain responsible for code they submit.
Run npm test before opening a pull request.
ContribPreflight reports the requirements with their rule IDs, source files and line numbers, and extracts commands such as npm test when they are stated explicitly.
The current rule set covers explicit signals such as:
- AI-assisted contribution prohibitions or permissions
- disclosure requirements
- human responsibility/review requirements
- required verification or test commands
- DCO and CLA requirements
- provenance/copyright conditions
Run this to see the current rule definitions:
npx contribpreflight rulesContribPreflight checks common policy locations including:
CONTRIBUTING.mdand variantsAGENTS.mdandCLAUDE.md- common AI-policy filenames
GOVERNANCE.mdREADME.md- GitHub pull-request templates
- contribution docs under
docs/
Generated/vendor directories such as node_modules, dist, build, coverage and vendor are skipped.
The CLI supports human-readable, JSON and agent-oriented output.
0— no explicit AI-contribution prohibition was found1— an explicit prohibition was found2— configuration or CLI error
The policy classification is intentionally conservative: FORBIDDEN, CONDITIONAL, ALLOWED or UNKNOWN based on the text the scanner actually sees.
Target repositories are treated as untrusted input. ContribPreflight reads text only; it does not import target modules, run scripts, follow symlinked policy files or execute shell commands from the repository.
That also means the tool has limits. It cannot interpret every ambiguous policy, determine whether code was AI-generated, provide legal advice, or replace reading the original contribution documents.
Clone the repository, install dependencies and run the test/quality commands defined in package.json. See CONTRIBUTING.md for the development workflow.
If you find a policy phrase that is missed or classified incorrectly, a small reproducible example makes a useful issue or contribution.
MIT — see LICENSE.