Skip to content

Repository files navigation

ContribPreflight

CI npm version license

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.

Quick start

npx contribpreflight .

For machine-readable output:

npx contribpreflight . --json

For a shorter agent-oriented report:

npx contribpreflight . --agent

Example

Given 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.

What it looks for

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 rules

Files scanned

ContribPreflight checks common policy locations including:

  • CONTRIBUTING.md and variants
  • AGENTS.md and CLAUDE.md
  • common AI-policy filenames
  • GOVERNANCE.md
  • README.md
  • GitHub pull-request templates
  • contribution docs under docs/

Generated/vendor directories such as node_modules, dist, build, coverage and vendor are skipped.

Output and exit codes

The CLI supports human-readable, JSON and agent-oriented output.

  • 0 — no explicit AI-contribution prohibition was found
  • 1 — an explicit prohibition was found
  • 2 — configuration or CLI error

The policy classification is intentionally conservative: FORBIDDEN, CONDITIONAL, ALLOWED or UNKNOWN based on the text the scanner actually sees.

Security model

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.

Development

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.

License

MIT — see LICENSE.

About

Deterministic contribution-policy preflight for humans, CI systems, and coding agents.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages