Skip to content

Dual-language linter for Responsible AI commit footers — shared logic for Node (@commitlint) and Python (gitlint).

License

Notifications You must be signed in to change notification settings

ChecKMarKDevTools/rai-lint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CheckMarK RAI Lint Banner

Stop playing hide-and-seek with AI in your commits.

A dual-language validation framework that makes AI attribution non-negotiable.


📊 Project Stats

GitHub Repo Stars GitHub Issues GitHub Release License: Polyform Shield License 1.0.0

Sonar Tech Debt Bugs Code Smells Coverage

🗣️ Languages

JavaScript Badge TypeScript Badge Python Badge

📦 Packages

NPM Version PyPI Version

🤖 AI & Automation

Verdent AI Badge GitHub Copilot Badge ChatGPT Badge GitHub Actions Badge

🔧 Quality & Standards

Conventional Commits Badge commitlint Badge ESLint Badge Lefthook Badge

SonarQube Cloud Badge Codecov Badge


InstallationQuick StartRequired Commit FootersDocumentation


What is this? 🤖

CheckMarK RAI Lint enforces Responsible AI (RAI) attribution in every commit. No more "who wrote this?" moments. No more mystery code. Just honest, trackable AI contributions.

Read the full story: Did AI Erase Attribution? Your Git History Is Missing a Co-Author

%%{init: {'theme':'dark'}}%%
flowchart LR
    A[Developer Commits] --> B{Has AI Footer?}
    B -->|Yes| C[Commit Accepted ✅]
    B -->|No| D[Commit Rejected ❌]
    C --> E[Clear AI Attribution]
    D --> F[Add Footer & Retry]
Loading

Why does this exist?

Because transparency matters. When AI writes code, everyone should know. This isn't about fear or compliance theater—it's about building trust and maintaining clear audit trails.


Features 🎯

🔒 Enforcement by Default

Blocks commits without valid AI attribution footers. No exceptions.

🌍 Dual-Language Support

Native plugins for both JavaScript/TypeScript (commitlint) and Python (gitlint).

📊 Five Attribution Levels

From human-only to AI-generated, track exactly who did what.

Zero Config Start

Works out-of-the-box with sensible defaults. Customize when ready.


Required Commit Footers 🏷️

Every commit must include:

  1. One AI attribution footer (pick the one that fits)
  2. Signed-off-by footer (recommended for complete accountability)

💡 Best Practice: While only the RAI footer is strictly enforced, combining it with Signed-off-by creates a complete audit trail—AI attribution plus human accountability. We strongly recommend enforcing both.

AI Attribution Footers

Pick one of these based on AI involvement:

Footer Format When to Use Example
Authored-by Human-only work, zero AI involvement Authored-by: Jane Doe <jane@example.com>
Commit-generated-by Trivial AI help (docs, messages, reviews) Commit-generated-by: ChatGPT <chatgpt@openai.com>
Assisted-by AI helped, but human did primary work Assisted-by: GitHub Copilot <copilot@github.com>
Co-authored-by Roughly 50/50 AI and human split Co-authored-by: Verdent AI <verdent@verdent.ai>
Generated-by Majority AI-generated code Generated-by: GitHub Copilot <copilot@github.com>

Signed-off-by Footer

Human accountability. This is YOUR stamp confirming you reviewed and take responsibility for the AI attribution above.

Format: Signed-off-by: Your Name <your.email@example.com>

Automate it: git commit -s (or --signoff)

Note

All patterns are case-insensitive and follow the Git trailer format. Email addresses must use angle brackets (Name <email@example.com>) — this is stricter than Git's spec but matches Git's own convention and ensures consistency.

By default, only RAI footers are enforced. The signed-off-by-exists rule is available separately and can be enabled in your configuration for complete accountability.


Installation 📦

Node.js / Commitlint

npm install --save-dev @checkmarkdevtools/commitlint-plugin-rai

Configure in commitlint.config.js:

export default {
  extends: ['@commitlint/config-conventional'],
  plugins: ['@checkmarkdevtools/commitlint-plugin-rai'],
  rules: {
    'rai-footer-exists': [2, 'always'],
    'signed-off-by-exists': [2, 'always'],
  },
};

Python / Gitlint

uv add gitlint-rai

Configure in .gitlint:

[general]
contrib = gitlint_rai.rules.RaiFooterExists,gitlint_rai.rules.SignedOffByExists

Quick Start 🚀

Hook Integration

Lefthook
pre-push:
  commands:
    sonar-scan:
      run: npx dotenv -- npx sonar-scanner

commit-msg:
  commands:
    commitlint:
      run: npx --no-install commitlint --edit {1}
Husky
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit $1'
pre-commit
repos:
  - repo: local
    hooks:
      - id: gitlint
        name: gitlint
        entry: gitlint
        args: [--msg-filename]
        language: python
        stages: [commit-msg]

Monorepo Structure 🛠️

rai-lint/
├── packages/
│   ├── node-commitlint/          # Node.js/ESM plugin
│   │   ├── src/
│   │   │   ├── rules/
│   │   │   │   └── rai-footer-exists.ts
│   │   │   └── index.ts
│   │   |── package.json
│   │   ├── tests/
│   │
│   └── python-gitlint/            # Python plugin
│       ├── gitlint_rai/
│       │   ├── __init__.py
│       │   └── rules.py
│       ├── tests/
│       └── pyproject.toml
│
├── docs/                          # Documentation

Contributing 🤝

Contributions welcome! See CONTRIBUTING.md for guidelines.


License 📄

Look, I'm not gonna hide behind a wall of legalese here.

This runs on Polyform Shield License 1.0.0. That's not open source — but before you rage-quit, hear me out.

What this means in actual English:

Use it. Break it. Fix it. Ship it in your CI pipeline at work. Hell, use it to enforce commit messages on your team and become the office villain. I'm cool with all of that.

What I'm not cool with? Someone spinning this up as "AI Lint Pro" with a $99/month subscription and a fancy landing page. If you want to make money off this code, we should probably have a conversation first.

The vibe: This is a tool to solve a real problem — AI attribution in commits is messy, and someone needed to standardize it. If you're using it for that purpose, internal or otherwise, you're good. If you're thinking about monetizing it... let's chat.

Sound fair? Cool. Now go lint some commits. 🚀


Show Some Love 🫶

If you find this project useful or want to support its development, consider starring the repo or connecting with me!

BuyMeACoffee dev.to Badge LinkedIn


Stop guessing. Start tracking.

Co-authored-by: Verdent AI & GitHub Copilot

About

Dual-language linter for Responsible AI commit footers — shared logic for Node (@commitlint) and Python (gitlint).

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors 6