mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #34] [MERGED] feat: reusable AGENTS.md integrity CI workflow (SHA-pinnable) #45
Labels
No labels
cursor-review-catalog-drift
groom
groom
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/github-workflows#45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/github-workflows/pull/34
Author: @mattmillerai
Created: 7/18/2026
Status: ✅ Merged
Merged: 7/19/2026
Merged by: @mattmillerai
Base:
main← Head:matt/be-3368-agents-md-integrity📝 Commits (2)
9b12546feat(agents-md-integrity): reusable CI workflow enforcing the AGENTS.md standardc3aa656feat(agents-md-integrity): fail on a missing root CLAUDE.md shim (require_shim, default true)📊 Changes
6 files changed (+778 additions, -0 deletions)
View changed files
➕
.github/agents-md-integrity/README.md(+25 -0)➕
.github/agents-md-integrity/check_agents_md.py(+318 -0)➕
.github/agents-md-integrity/tests/test_check_agents_md.py(+219 -0)➕
.github/workflows/agents-md-integrity.yml(+154 -0)➕
.github/workflows/test-agents-md-integrity.yml(+61 -0)📝
README.md(+1 -0)📄 Description
ELI-5
We're standardizing on one thin
AGENTS.mdper repo as the single source of truth for agent instructions, withCLAUDE.mdreduced to a one-line@AGENTS.mdshim, no stray.cursorrules, and a hard under-200-line ceiling (per Anthropic guidance). Nothing enforces that today, so files quietly drift back over the limit and shims diverge. This adds a reusable CI workflow any Comfy repo can pin (by commit SHA) to fail its build when itsAGENTS.mddrifts out of spec.What this adds
.github/workflows/agents-md-integrity.yml— aworkflow_callreusable workflow. It runs in the caller's context, soactions/checkoutchecks out the calling repo and the checks operate on that repo's files. The checker itself is loaded from a pinned ref of this repo (workflows_ref), never the caller's checkout, so a PR can't rewrite the check..github/agents-md-integrity/check_agents_md.py— the checker (stdlib-only Python), the single source of truth so consumers carry only a thin caller. EmitsFAIL:/WARN:lines plus GitHub::error::/::warning::annotations and exits non-zero on any hard failure, so it wires in as a required status check..github/agents-md-integrity/tests/+.github/workflows/test-agents-md-integrity.yml— aunittestsuite (16 cases) plus a self-test workflow (mirroringtest-cursor-review-scripts.yml) that also runs a passing-repo and a failing-repo CLI smoke test.v1conventions.Checks enforced (all acceptance criteria)
AGENTS.mdpresentagents_file(AGENTS.md)> max_linesfails;> warn_lines(but≤ max_lines) warnsmax_lines(200),warn_lines(150)CLAUDE.mdexists, it must contain@AGENTS.md; a divergent copy fails.cursorrules.cursorrulesfailsforbid_cursorrules(true)AGENTS.mdneeds a sibling@AGENTS.mdshim and≤ max_linescheck_nested(true)AGENTS.mdmatched by a CODEOWNERS rule; warn-only unless escalatedrequire_codeowners(false → warn)All inputs are documented in the workflow's header comment.
Usage
Testing
python3 -m unittest discover -s .github/agents-md-integrity/tests→ 16 passing.AGENTS.md, divergentCLAUDE.md,.cursorrules) exits 1 with clear per-check output.Judgment calls / notes
require_codeownersis a boolean (defaultfalse= warn-only,true= fail), which reads as the ticket's "input-gated, default: warn only"./anchoring, basename-at-any-depth,*/**, last-match-wins incl. owner-less unassign). It's a warn-only check by default, so approximate matching is acceptable; exotic patterns may under-match.workflows_refdefaults tomainand must be pinned by the caller to match theuses:SHA for full reproducibility — same limitation/pattern ascursor-review.yml. Documented in the header + README.splitlines()(number of text lines), which iswc -l-equivalent for newline-terminated files and one more (correctly) for a file with no trailing newline.v1tag is cut), semantic/drift checks, and content-quality checks.Scoped to
Comfy-Org/github-workflows; no consumer repos are modified.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.