Skip to main content
Glama
attribution-handler.jsβ€’1.45 kB
#!/usr/bin/env node /** * Attribution Handler * * A utility that detects and removes AI attribution from: * - Commit messages * - PR descriptions * - Code files * * Works with the Git hooks system to enforce project attribution guidelines. */ // Standard attribution patterns const ATTRIBUTION_PATTERNS = [ 'πŸ€– Generated with [Claude Code]', 'Co-Authored-By: Claude', 'Generated with Claude', 'Generated by AI', 'AI-generated', ]; // Standard attribution block that appears at the end of commit messages const STANDARD_BLOCK = `πŸ€– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>`; /** * Remove attribution patterns from text * @param {string} text - The text to clean * @returns {string} - Cleaned text */ function removeAttribution(text) { // First try to remove the standard block if (text.includes(STANDARD_BLOCK)) { console.log('Removed standard attribution block'); return text.replace(STANDARD_BLOCK, ''); } // Then check for individual patterns let modified = false; let result = text; for (const pattern of ATTRIBUTION_PATTERNS) { if (result.includes(pattern)) { console.log(`Removed attribution pattern: "${pattern}"`); result = result.replace(new RegExp(pattern, 'g'), ''); modified = true; } } return result; } module.exports = { removeAttribution, ATTRIBUTION_PATTERNS, STANDARD_BLOCK, };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kesslerio/attio-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server