Skip to content

Add CI structure checks for plugin marketplace#6

Merged
gering merged 3 commits into
mainfrom
task/add-ci-structure-checks
Jun 12, 2026
Merged

Add CI structure checks for plugin marketplace#6
gering merged 3 commits into
mainfrom
task/add-ci-structure-checks

Conversation

@gering

@gering gering commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds the repo's first automated verification: a GitHub Actions workflow that mechanically checks structure invariants on every PR and push to main.
  • The plugins are declarative Markdown + JSON with no build step, so structural regressions (broken JSON, version drift, dangling references) were previously only caught in live use.
  • Implements Prio 1 from the 2026-06 architecture review — highest return for lowest effort.

Changes

  • scripts/check-structure.py — single self-contained checker (python3 stdlib + bash only), runs identically in CI and locally:
    • JSON validity for marketplace.json and all plugin.json
    • Version sync: plugin.json version == marketplace.json registry version
    • SKILL.md frontmatter: required name/description, name matches directory, description word budget (>40 = error, >30 = warning)
    • Internal ${CLAUDE_PLUGIN_ROOT}/... references must exist on disk
    • bash -n syntax check on all *.sh
    • Extra invariants: plugin name matches directory, every plugins/<name> is registered in the marketplace
  • .github/workflows/structure-checks.yml — runs on pull_request + push to main; only actions/checkout + preinstalled python3, so well under 1 min.
  • README.md / CLAUDE.md — document the local command and that CI enforces the invariants.

Readiness

  • ✅ Checker passes on the current tree (0 errors, 2 non-fatal word-budget warnings: statusline 37w, open 32w)
  • ✅ Negative-tested: version drift, broken JSON, dangling reference, and shell syntax error are each caught (exit 1)
  • ✅ README + CLAUDE.md updated
  • ➖ No version bump (repo-level infra, no plugin touched)
  • ➖ No changelog / build step in this repo

Test plan

  • CI run on this PR is green
  • Locally: python3 scripts/check-structure.py exits 0
  • Introduce a deliberate version drift and confirm CI fails

🤖 Generated with Claude Code

gering and others added 3 commits June 12, 2026 12:36
- scripts/check-structure.py: single self-contained python3 checker for
  JSON validity, version sync, SKILL.md frontmatter + description word
  budget, internal ${CLAUDE_PLUGIN_ROOT} references, and shell syntax
- .github/workflows/structure-checks.yml: runs on PR + push to main
- Document the checks in README and CLAUDE.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Review follow-up: the validator rejected several valid inputs.

- Strip trailing sentence punctuation (.,;:]) from ${CLAUDE_PLUGIN_ROOT}
  references so a bare ref ending a prose sentence no longer reports a
  dangling path
- Skip templated/example ref paths containing placeholders or globs
- Tolerate a leading UTF-8 BOM or blank lines before SKILL.md frontmatter
- Catch missing bash with a clean error instead of an unhandled traceback
- Add 'from __future__ import annotations' so the list[str] annotation runs
  on Python 3.7+

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codex review follow-up: a marketplace entry with the correct name and
version but a 'source' pointing at a different plugin directory passed all
checks, because the version lookup matched the manifest by name while the
source path was only checked for the presence of any plugin.json.

Load the manifest at the actual 'source' path and verify its name matches
the entry before comparing versions, so a mispointed source is caught.
Drops the now-unused plugins_by_name lookup in favour of a path-keyed map.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gering gering merged commit 1456f2d into main Jun 12, 2026
1 check passed
@gering gering deleted the task/add-ci-structure-checks branch June 12, 2026 14:13
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