cd /news/ai-tools/i-got-tired-of-repeating-myself-on-p… · home › topics › ai-tools › article
[ARTICLE · art-179065] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

I got tired of repeating myself on pull requests, so I built a tiny rule-based gatekeeper

A developer built contrib-gate, a dependency-free GitHub Action and CLI that checks pull requests against a repo's contribution rules using regular expressions and glob matching, then posts a single polite checklist comment that updates in place. The tool verifies four things: a linked issue (optionally carrying a maintainer label like 'accepted'), tests accompanying source changes, a small diff, and an explicit 'AI assistance: yes/no' disclosure line, with no LLM calls or paid services involved. The developer says the tool checks the contribution rather than the code, and disclosed that it was built with heavy help from an AI assistant.

key takeaway

contrib-gate enforces PR hygiene with regex and glob matching instead of an LLM, checking linked issues, tests, diff size and an 'AI assistance: yes/no' disclosure line, and updating one comment in place rather than stacking new ones.

by read2 min views4 publishedDec 1, 2026

Every maintainer knows the loop. A new pull request comes in, and you type the same comments again: please link the issue, please add tests with that source change, please keep the diff small enough to review.

Recently a fourth line joined the list: was this written by AI?

I don't like that question as a vibe check. AI-detection tools flag real newcomers and miss fluent generated code, and accusing a first-time contributor of being a bot is a good way to never see them again. But I do think contributors should say whether they used AI, the same way they say what they changed. So instead of detecting, I made disclosure one of the house rules - and then automated the reminding.

contrib-gate is a GitHub Action (also a CLI) that checks each pull request against your repo's contribution rules and posts one polite checklist comment. It is deliberately boring technology: regular expressions and glob matching, one JavaScript file, zero dependencies, no LLM calls, no paid services.

It checks four things:

Fixes #123). Optionally, the linked issue must carry a maintainer's label like accepted, so drive-by PRs for unwanted features get caught early. AI assistance: yes or AI assistance: no. A PR template makes this a two-second habit. When something fails, the comment says exactly how to fix it, one line per check. When the contributor pushes again or edits the description, the same comment updates in place instead of stacking new ones.

AI code review tools are everywhere now, and some are genuinely useful. For this job I wanted determinism:

The flip side is honesty about scope: contrib-gate checks the contribution, not the code. It will not tell you whether the diff is good. It makes sure the PR is reviewable - linked, tested, disclosed, and small - before a human spends time on it.

name: contrib-gate
on:
  pull_request:
    types: [opened, synchronize, reopened, edited]

permissions:
  pull-requests: read
  issues: write

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: Havertz2/contrib-gate@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

Every rule is configurable from the workflow file, and fail-on-violations: true turns it into a required status check if you want teeth. There's also a CLI mode (node index.js --owner my-org --repo my-repo --pr 123) for testing your rules locally before enforcing them.

The repo has a handful of good first issue tickets if you want to contribute - docs translations, a --version flag, step outputs, test coverage for the glob matcher. Feedback and issues are welcome.

Full disclosure, matching the tool's own rule: I built contrib-gate with heavy help from an AI assistant. The rules, the tests, and this post's opinions are mine; a lot of the typing was not.

── more in #ai-tools 4 stories · sorted by recency
── more on @contrib-gate 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-got-tired-of-repea…] indexed:0 read:2min 2026-12-01 · —