Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# CLAUDE.md - Kagenti Automation Repository

## DCO Sign-Off (Mandatory)

All commits **must** include a `Signed-off-by` trailer (Developer Certificate of Origin).
Always use the `-s` flag when committing:

```sh
git commit -s -m "feat: Add new feature"
```

This adds a line like `Signed-off-by: Your Name <your@email.com>` to the commit message.
PRs without DCO sign-off will fail CI checks. To retroactively sign-off existing commits:

```sh
git rebase --signoff main
```

## Commit Attribution Policy

When creating git commits, do NOT use `Co-Authored-By` trailers for AI attribution.
Instead, use `Assisted-By` to acknowledge AI assistance without inflating contributor stats:

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>

Never add `Co-authored-by`, `Made-with`, or similar trailers that GitHub parses as co-authorship.

A `commit-msg` hook in `scripts/hooks/commit-msg` enforces this automatically.
Install it by configuring the hooks path:

```sh
git config core.hooksPath scripts/hooks
```

## PR Description Attribution

When generating PR descriptions, summaries, or any PR metadata, use
`Assisted-By: Claude Code` — never `Generated by Claude Code` or similar phrasing.
The work is the developer's; Claude Code assists. This differs from the commit
trailer format (`Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>`)
because PR body text is human-readable and doesn't need the email for git tooling.
This applies to:

- PR body text (e.g., the footer line)
- Commit message trailers referenced in PR descriptions
- Any auto-generated changelogs or release notes

## Scope Discipline

Only commit files directly related to the PR's stated purpose. Do not bundle
unrelated changes (tooling, configs, hooks, formatting) into a PR unless the
PR is explicitly for that purpose. If a prerequisite change is needed, open a
separate PR for it first.
28 changes: 28 additions & 0 deletions scripts/hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail

COMMIT_MSG_FILE="$1"
TEMP_FILE=$(mktemp)

# Check if any AI co-author trailers exist before stripping
HAS_AI_TRAILER=false
if grep -qi -E '^Co-authored-by:.*(Claude|Cursor|anthropic)' "$COMMIT_MSG_FILE"; then
HAS_AI_TRAILER=true
fi

# Strip Co-authored-by lines for Claude/Cursor and Made-with lines
grep -vi -E '^Co-authored-by:.*(Claude|Cursor|anthropic|cursor)' "$COMMIT_MSG_FILE" \
| grep -vi '^Made-with:' \
> "$TEMP_FILE" || true

# Remove trailing blank lines (awk is portable across macOS/Linux unlike sed labels)
awk '/^[[:space:]]*$/{buf=buf $0 ORS; next} {if(buf) printf "%s",buf; buf=""; print}' "$TEMP_FILE" > "$COMMIT_MSG_FILE"

# If AI trailers were present, add Assisted-By instead
if [ "$HAS_AI_TRAILER" = true ]; then
# Ensure there's a blank line before the trailer
echo "" >> "$COMMIT_MSG_FILE"
echo "Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>" >> "$COMMIT_MSG_FILE"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This line uses Claude (Anthropic AI) but the commit that introduces this PR uses Claude Opus 4.6 as the Assisted-By value. CLAUDE.md (line 24) documents Claude (Anthropic AI) <noreply@anthropic.com> as the canonical form — the hook is correct, but the introducing commit itself doesn't follow it. Consider amending to match.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair call out. The Assisted-By: Claude Opus 4.6 <noreply@anthropic.com> is due to my own local hooks. I will modify the local ones to match the CLAUDE.md one so that the trailers are not tied to a particular model for future commits.

fi

rm -f "$TEMP_FILE"