ci: add README package catalog drift check#111
Merged
Conversation
Adds bin/check-readme-packages.sh — a simple guardrail that asserts the root README.md package catalog stays in sync with packages/. Fails fast if a new package lands without a README row, or if the README references a package that no longer exists. The check treats every directory under packages/ as a catalog candidate except composer.json type: project (currently only marko/skeleton, which is an application template rather than a module). Pure shell + jq, no metadata added to package composer.json files — the README stays hand-authored, the check just enforces "every module appears somewhere." Wired into a new readme-package-check workflow that runs on PRs and develop/main pushes that touch packages/, README.md, the script, or the workflow itself. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevents the kind of drift that caused #110 — where ~20 packages had shipped through 0.8.0 without ever being added to the root README catalog. Adds a simple guardrail and wires it into CI.
What it does
bin/check-readme-packages.shenumerates everypackages/*directory (excludingcomposer.jsontype: project, currently onlymarko/skeleton) and the catalog rows inREADME.md. Fails with a specific, actionable diff if either side is out of sync..github/workflows/readme-package-check.ymlruns the script on PRs anddevelop/mainpushes that touchpackages/,README.md, the script, or the workflow.Why not autogenerate the catalog?
Considered and rejected. Autogeneration would require adding
extra.marko.category(or similar) to all 92 packages, locking the README into a build artifact, and forcing editorial decisions into config. This approach keeps the README hand-authored — the check just asserts the invariant "every module appears somewhere." Predictable, no metadata churn, degrades gracefully.Verified locally
bin/check-readme-packages.shexits 0 withREADME.md package catalog is aligned with packages/ (92 modules).Packages present under packages/ but missing from README.md: - testingand exit 1ghostrow producesPackages referenced in README.md but not present under packages/ ... - ghostand exit 1Test plan
git clone