Skip to content

Generate .gitattributes to hide generated skills in PR diffs#80

Open
Kush Agrawal (kush-duolingo) wants to merge 3 commits intomasterfrom
gitattributes-generated-skills
Open

Generate .gitattributes to hide generated skills in PR diffs#80
Kush Agrawal (kush-duolingo) wants to merge 3 commits intomasterfrom
gitattributes-generated-skills

Conversation

@kush-duolingo
Copy link
Copy Markdown
Contributor

@kush-duolingo Kush Agrawal (kush-duolingo) commented Apr 30, 2026

Description

  • Each generator now declares gitattributes_patterns via a base class property
  • The orchestrator collects patterns from all generators and writes a single root .gitattributes with a demarcated section
  • Covers .claude/skills/generated_*/SKILL.md, AGENTS.md, and .github/copilot-instructions.md
  • GitHub will collapse these auto-generated files by default in PR diffs

Motivation

Verification steps

  • Tests pass

The sync-ai-rules hook now writes a .claude/skills/.gitattributes file
that marks generated_*/SKILL.md as linguist-generated, so GitHub
collapses them by default in pull request diffs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Each generator now declares its own gitattributes_patterns via a base
class property. The orchestrator collects patterns from all generators
and writes a single root .gitattributes with a demarcated section,
covering skills, AGENTS.md, and copilot-instructions.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@artnc Art Chaidarun (artnc) left a comment

Choose a reason for hiding this comment

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

Thanks! I had mentioned .claude/.gitattributes or .claude/skills/.gitattributes as possible output files because we shouldn't clobber the repo's existing root .gitattributes, which might contain config for unrelated stuff like LFS.

Some possible options:

  • Instead of overwriting the root .gitattributes, append our config to it if absent. This seems doable but a little fragile
  • Use individual .gitattributes files in subdirs like .claude, .cursor and .code_review. This is less invasive but also less complete since AGENTS.md isn't covered. (Do we need AGENTS.md? It seems like every popular tool prefers its own custom config location? I'm not super up to date here)

Copy link
Copy Markdown
Contributor

@clevin95 Carter L (clevin95) left a comment

Choose a reason for hiding this comment

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

this is a great idea, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants