Deterministic contribution-policy preflight for humans, CI systems, and coding agents.
npx contribpreflight .That's it. ContribPreflight scans your repository and surfaces contribution requirements with exact file and line evidence.
Repository contribution requirements are scattered across CONTRIBUTING.md, AGENTS.md, AI policy documents, pull request templates, and other files. Missing a requirement can mean rejected pull requests, wasted effort, or compliance issues.
ContribPreflight reads those files as data and surfaces high-confidence requirements before contribution work begins. It is:
- Deterministic — same input always produces the same output
- Local — reads files only, never executes repository content
- Explainable — every finding includes file, line, and evidence
- Bounded — scans a defined set of likely policy surfaces
Given a CONTRIBUTING.md containing:
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.
Running npx contribpreflight . produces:
Policy: conditional
Requirements:
CP002 disclosure CONTRIBUTING.md:1 "AI-assisted contributions are allowed only if their use is disclosed."
CP003 responsibility CONTRIBUTING.md:2 "Contributors remain responsible for code they submit."
CP005 verification CONTRIBUTING.md:3 "Run npm test before opening a pull request."
Commands:
npm test (CONTRIBUTING.md:3)
# Scan current directory
npx contribpreflight .
# Scan a specific path
npx contribpreflight ./my-repo
# JSON output
npx contribpreflight . --json
# Agent-friendly output
npx contribpreflight . --agentcontribpreflight [path] # Scan repository
contribpreflight files [path] # List discovered policy surfaces
contribpreflight rules # List CP001-CP010 rule definitionsHuman-readable terminal output with color and formatting.
contribpreflight . --jsonSingle valid JSON document to stdout. No ANSI, no decorations. Suitable for CI pipelines and tooling.
contribpreflight . --agentConcise plain text for supplying to a coding agent before repository work. No ANSI escape sequences. Does not replace reading original repository policies.
| Rule | Type | Description |
|---|---|---|
| CP001 | ai-prohibition | Explicit AI contribution prohibition |
| CP002 | disclosure | AI assistance disclosure required |
| CP003 | human-responsibility | Human responsibility/understanding required |
| CP004 | human-review | Human review/approval/sign-off required |
| CP005 | verification | Verification/tests required before contribution |
| CP006 | dco | Developer Certificate of Origin / Signed-off-by required |
| CP007 | cla | Contributor License Agreement requirement |
| CP008 | provenance | AI output provenance/copyright/licensing requirement |
| CP009 | ai-condition | AI contribution condition/restriction detected |
| CP010 | ai-permission | Explicit AI-assisted contributions allowed |
ContribPreflight scans these files:
CONTRIBUTING.md,CONTRIBUTING.*AGENTS.md,CLAUDE.mdAI.md,AI_POLICY.md,AI-POLICY.mdAI_CONTRIBUTION_POLICY.md,AI-CONTRIBUTION-POLICY.mdGOVERNANCE.md,README.md.github/PULL_REQUEST_TEMPLATE.md.github/PULL_REQUEST_TEMPLATE/*docs/contributing/**,docs/CONTRIBUTING*
Excluded directories: node_modules, .git, dist, build, coverage, vendor
| Classification | Meaning |
|---|---|
| FORBIDDEN | AI contributions explicitly prohibited |
| CONDITIONAL | AI contributions allowed with conditions |
| ALLOWED | AI contributions explicitly allowed |
| UNKNOWN | No explicit AI policy detected |
Precedence: FORBIDDEN > CONDITIONAL > ALLOWED > UNKNOWN
| Code | Meaning |
|---|---|
| 0 | No CP001 AI prohibition detected |
| 1 | CP001 AI prohibition detected |
| 2 | CLI/configuration error |
- Target repositories are treated as untrusted input
- ContribPreflight reads text files only
- No code execution from target repositories
- No
child_process,eval, dynamicimport, orrequireof target content - Symlinked policy files are skipped
ContribPreflight uses deterministic heuristics, not AI. It:
- Does NOT determine whether code was AI-generated
- Does NOT identify which model created code
- Does NOT provide legal advice
- Does NOT guarantee complete policy interpretation
- Does NOT enforce copyright law
- Does NOT replace reading repository contribution policies
- May miss policies or occasionally classify ambiguous language incorrectly
- Only scans a bounded set of likely policy surfaces
- Symlinked policy files are skipped
- Cannot interpret ambiguous or implicit policies
- CRLF handling normalizes line endings (line numbers reference original lines)
- Contributors checking a repository before coding
- Maintainers validating that policies are discoverable
- Coding agents receiving a deterministic preflight before repository work
- CI/tooling consuming JSON output for policy checks
- Broader policy phrase corpus via community-submitted fixtures
- Additional safe policy surface formats
- Richer machine-readable diagnostics
- Agent and CI workflow integrations
Found a policy phrase ContribPreflight misses or misclassifies? Open an issue with the minimal policy wording and expected result. This is especially useful for improving deterministic heuristics.
See CONTRIBUTING.md for development setup.