ci: refuse CLAUDE.md files by hook and keep every AGENTS.md out of the Collection tarball #330

Merged
Defame1297 merged 6 commits from ci/244-refuse-claude-md into main 2026-11-23 19:55:36 +00:00
2 changed files with 18 additions and 0 deletions
Showing only changes of commit 35e780cf79 - Show all commits

No files matched your search

+2
View File
@@ -89,6 +89,8 @@ FORBIDDEN = [
"*.env.*",
"*/.env*",
".env*",
# Contributor rules: a consumer's agent reading an installed role would load them.
"*/agents.md",
]
# Names Windows treats as devices, with or without an extension (and with trailing spaces).
WINDOWS_RESERVED = {
+16
View File
@@ -70,6 +70,22 @@ class TarballTest(unittest.TestCase):
self.assertEqual(len(found), 1, name)
self.assertIn("forbidden pattern", found[0], name)
def test_agents_md_is_refused_at_any_depth(self):
for name in (
"roles/AGENTS.md",
"roles/x/AGENTS.md",
"roles/x/templates/Agents.md",
):
found = check_tarball.problems([name])
self.assertEqual(len(found), 1, name)
self.assertIn("forbidden pattern", found[0], name)
self.assertEqual(
check_tarball.problems(
["roles/x/README.md", "roles/x/files/agents_notes.md"]
),
[],
)
def test_ambiguous_names_are_rejected(self):
cases = {
"roles/a/x ": "ends in a space or a dot",