Skip to content

ci: verify generated agent/skill files stay in sync with their sources#57

Open
YAMRAJ13y wants to merge 1 commit into
JCodesMore:masterfrom
YAMRAJ13y:ci/check-generated-files-in-sync
Open

ci: verify generated agent/skill files stay in sync with their sources#57
YAMRAJ13y wants to merge 1 commit into
JCodesMore:masterfrom
YAMRAJ13y:ci/check-generated-files-in-sync

Conversation

@YAMRAJ13y

Copy link
Copy Markdown

Problem

AGENTS.md documents a required workflow:

  • After editing AGENTS.md, run bash scripts/sync-agent-rules.sh to regenerate platform-specific instruction files.
  • After editing .claude/skills/clone-website/SKILL.md, run node scripts/sync-skills.mjs to regenerate the skill for all platforms.

But nothing enforces it. A contributor can edit a source file and forget to regenerate, silently drifting the 13 committed generated files (Cursor, Windsurf, Gemini, Codex, Copilot, Amazon Q, Continue, Cline, OpenCode, Augment) from their AGENTS.md / SKILL.md sources. The current CI only runs lint / typecheck / build, so this drift ships unnoticed.

Fix

Adds a sync job to the CI workflow that:

  1. Re-runs the two existing sync scripts.
  2. Fails the build with a clear remediation message (and a git diff --stat) if the working tree is now dirty — i.e. the committed generated files don't match their sources.
::error::Generated files are out of sync with their sources (AGENTS.md / SKILL.md).
Run the sync scripts locally and commit the result:
  bash scripts/sync-agent-rules.sh
  node scripts/sync-skills.mjs

Notes

  • Mirrors the documented workflow exactly; no behavior change for branches that are already in sync (verified the scripts are deterministic and produce no diff on a clean master).
  • Runs as a separate parallel job, so it doesn't slow the existing quality job.
  • Single-file change (.github/workflows/ci.yml).

🤖 Generated with Claude Code

AGENTS.md instructs contributors to run the sync scripts after editing
the source files, but nothing enforces it. A contributor can edit
AGENTS.md or the clone-website SKILL.md and forget to regenerate, silently
drifting the 13 committed platform files (Cursor, Windsurf, Gemini, Codex,
Copilot, Amazon Q, Continue, Cline, OpenCode, Augment) from their source.

This adds a `sync` CI job that regenerates everything with the existing
scripts and fails the build with a clear remediation message if the
working tree is dirty, i.e. the committed generated files don't match
their sources. Mirrors the documented workflow in AGENTS.md exactly; no
behavior change for in-sync branches.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant