Extract a repo's contribution gates into machine-readable contribution-gates.json.
Hidden contribution gates, extracted into a file machines can read.
Every repo hides its real rules for outside contributors: comment before you start, wait to be assigned, sign off your commits, get vouched, sign a CLA. Today you discover those rules by getting your PR auto-closed. gatefile extracts them from the repo's own docs into contribution-gates.json, a machine-readable format that tools (like Greenlight) and CI can consume.
A contributor picks an issue, writes the code, opens the PR, and a bot closes it: "you were not assigned", "unvouched authors are auto-closed", "missing Signed-off-by". The rules were always in CONTRIBUTING.md, buried in prose, different on every repo. Maintainers repeat the same corrections; contributors waste the same evenings.
contribution-gates.json against a fresh extraction and reports drift (STALE, MISSING, SEVERITY_CHANGED). Exit code 1 on drift, so CI can enforce it.{
"version": 1,
"repo": "shadcn-labs/pdfcn",
"generatedFrom": ["CONTRIBUTING.md"],
"gates": [
{
"id": "claim_first",
"kind": "claim_first",
"severity": "blocker",
"evidence": "Comment before starting work, and check the thread first in case someone else is already working on it.",
"source": "CONTRIBUTING.md"
}
],
"conventions": {
"branchNaming": "Name your branch feat/block-name",
"prTitleFormat": "PR titles should follow Conventional Commits",
"requiredChecks": []
}
}
| kind | severity | meaning |
|---|---|---|
claim_first | blocker | Comment on the issue before starting work |
assignment_required | blocker | Wait to be assigned before opening a PR |
discuss_first | blocker | Open a discussion or issue before coding |
issue_first | blocker | Every PR must be tied to an issue |
vouch_required | blocker | An existing member must vouch for you |
collaborators_only | blocker | Only repo collaborators may open PRs |
no_direct_prs | blocker | Direct PRs are not accepted |
dco_required | warn | Commits need a Signed-off-by trailer (DCO) |
cla_required | warn | A Contributor License Agreement must be signed |
Severity: blocker gates can get a PR closed or rejected before review. warn gates can be fixed after the PR opens. Evidence is always a real quote from the source file, trimmed to about 140 characters, never invented.
# Extract gates from a repo (GitHub API, GITHUB_TOKEN optional)
gatefile extract shadcn-labs/pdfcn
# Extract from a local clone instead (fully offline)
gatefile extract local --local ./pdfcn --out contribution-gates.json
# Validate the committed file against fresh docs, exit 1 on drift
gatefile validate shadcn-labs/pdfcn --file contribution-gates.json
# Print a README snippet for humans
gatefile badge shadcn-labs/pdfcn
Add to your MCP client config:
{
"mcpServers": {
"gatefile": {
"command": "node",
"args": ["/path/to/gatefile/dist/mcp.js"]
}
}
}
Tools:
| tool | inputs | what it returns |
|---|---|---|
extract_gates | repo or localPath | the full contribution-gates.json object |
validate_gates | recorded, repo or localPath | { ok, drift[] } |
gates_badge | repo or localPath | README markdown snippet |
Keep the gates file honest in a GitHub Actions workflow:
name: gates
on:
pull_request:
paths: ["CONTRIBUTING.md", ".github/**", "contribution-gates.json"]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20 }
- run: npx -y gatefile extract ${{ github.repository }} --out /tmp/fresh.json
- run: npx -y gatefile validate ${{ github.repository }} --file contribution-gates.json
npm install
npm test # tsx --test, offline, 23 tests
npm run build # tsc to dist/
npm run dev -- extract owner/repo --json
TypeScript ESM, Node 20+, zod for schemas, native fetch for the GitHub API. Tests use real-world fixtures in test/fixtures/ modeled on documented cases (comment-before-starting plus DCO plus issue-first; assignment-first; vouch-only; permissive).
MIT, Rene Turcios 2026.
This tool is one of four in a lifecycle for open-source contribution work, all published under the @reneturcios npm scope and each available as a CLI and an MCP server (<tool> mcp):
npx @reneturcios/gatefile) extracts a repo's contribution gates into a committed contribution-gates.json.npx @reneturcios/greenlight) pre-flights issues (GO / RISKY / TAKEN / GATED / STALE), consumes gatefile's output in check and scan, then claims, preps, and opens PRs.npx @reneturcios/claimcheck) watches for stale claims and fixes parked on forks.npx @reneturcios/prwatch) triages your open PRs by what needs you right now.Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y @reneturcios/gatefileMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-cloudcorprecords-gatefile": {
"command": "npx",
"args": [
"-y",
"@reneturcios/gatefile"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceio.github.CloudCorpRecords/gatefile works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.