Skip to content

Latest commit

 

History

History
198 lines (138 loc) · 4.69 KB

commit-trailers.md

File metadata and controls

198 lines (138 loc) · 4.69 KB

Commit Trailers Reference

SPDX-License-Identifier: GPL-3.0-only

Copy-paste templates for every common scenario. No guessing needed.

Required Trailers

DCO Sign-Off (always required)

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

Use git commit -s to add this automatically.

Human Review (required at Tier 1 and 2)

Human-Reviewed-By: Reviewer Name <reviewer@email.com>

Must be a different person from the submitter.

AI Role Trailers

Use the trailer that best describes AI involvement. Multiple trailers are allowed on a single commit.

AI-Generated-By — entirely AI-generated

AI-Generated-By: Claude Opus 4.6 (Anthropic) <noreply@anthropic.com>

Use when the content was entirely produced by AI with minimal human editing.

AI-Co-Author — substantial collaboration

AI-Co-Author: Claude Opus 4.6 (Anthropic) <noreply@anthropic.com>

Use when you and the AI worked together on the code. Most common for pair-programming with AI.

AI-Assisted-By — suggestions and research

AI-Assisted-By: GitHub Copilot (GitHub/Microsoft) <noreply@github.com>

Use when AI provided completions, suggestions, or helped with research, but you wrote most of the code.

AI-Reviewed-By — AI reviewed human code

AI-Reviewed-By: Claude Opus 4.6 (Anthropic) <noreply@anthropic.com>

Use when you asked AI to review code you wrote.

Self-Hosted Models

AI-Co-Author: Llama 3.3 70B (self-hosted) <noreply@localhost>

Self-hosted models use (self-hosted) as the provider and <noreply@localhost> as the email.

Complete Examples

Human-only commit

Fix typo in README contributing section

Signed-off-by: Hugo Antonio Sepulveda Manriquez <hugo@neatnerds.be>

AI-assisted commit (most common)

Add SPDX header validation tool

Implements validation for SPDX license headers in Ruby source files.
Uses the SPDX license list v3.25 for identifier validation.

Signed-off-by: Hugo Antonio Sepulveda Manriquez <hugo@neatnerds.be>
AI-Assisted-By: Claude Opus 4.6 (Anthropic) <noreply@anthropic.com>

AI co-authored commit with review

Implement commit trailer parser

Parser extracts and validates all recognized AI trailers from
git commit messages. Supports multi-line trailers and multiple
AI tools per commit.

Signed-off-by: Hugo Antonio Sepulveda Manriquez <hugo@neatnerds.be>
AI-Co-Author: Claude Opus 4.6 (Anthropic) <noreply@anthropic.com>
Human-Reviewed-By: Jane Smith <jane@example.com>

Multiple AI tools

Refactor HTTP transport configuration

Signed-off-by: Hugo Antonio Sepulveda Manriquez <hugo@neatnerds.be>
AI-Assisted-By: GitHub Copilot (GitHub/Microsoft) <noreply@github.com>
AI-Reviewed-By: Claude Opus 4.6 (Anthropic) <noreply@anthropic.com>
Human-Reviewed-By: Jane Smith <jane@example.com>

Self-hosted model

Add Puppet type validation

Signed-off-by: Hugo Antonio Sepulveda Manriquez <hugo@neatnerds.be>
AI-Co-Author: Llama 3.3 70B (self-hosted) <noreply@localhost>
Human-Reviewed-By: Jane Smith <jane@example.com>

MCP Tool Integration

The MCP server provides tools to help with trailers:

Format a trailer

{
  "method": "tools/call",
  "params": {
    "name": "format_trailer",
    "arguments": {
      "type": "AI-Co-Author",
      "tool": "Claude Opus 4.5",
      "provider": "Anthropic"
    }
  }
}

Returns: AI-Co-Author: Claude Opus 4.5 (Anthropic) <noreply@anthropic.com>

Validate a commit message

{
  "method": "tools/call",
  "params": {
    "name": "validate_commit",
    "arguments": {
      "message": "Your commit message here...",
      "tier": "core"
    }
  }
}

Returns validation result with any missing trailers identified.

Trailer Format Specification

<Type>: <Tool> <Version> (<Provider>) <email>
Field Required Example
Type Yes AI-Co-Author
Tool Yes Claude Opus
Version Yes 4.5
Provider Yes Anthropic, self-hosted
Email Yes noreply@anthropic.com

Provider Email Reference

Provider Email
Anthropic noreply@anthropic.com
OpenAI noreply@openai.com
Google noreply@google.com
GitHub/Microsoft noreply@github.com
Mistral noreply@mistral.ai
Self-hosted noreply@localhost

Validation Rules

  1. DCO sign-off: Always required, use git commit -s
  2. AI disclosure: Required for any AI involvement (no threshold)
  3. Human review: Required at Tier 1 and 2, must be different person
  4. Multiple AI tools: Use separate trailer for each tool
  5. Version format: Semantic versioning preferred (e.g., 4.5, 3.3.70B)

See AI_POLICY.md Section A for the full attribution policy.