[Chore] Split divergences and the MCP registry into one file per component

Merged
CI
2d ago
+3577-3387

The last audit PRs (#605 to #610) conflicted with each other in two shared files:

  • audit/divergences.yml: each PR appended its entries at the end of the file.
  • mcp/data/registry.json: one JSON with components in alphabetical order. Breadcrumb, Bubble and Button sit next to each other, so their blocks touched.

This applies the fix #604 used for the component map: one file per component.

Changes

  • audit/divergences/<folder>.yml, plus a README describing the keys. Divergences.for_audit reads the folder and falls back to the single divergences.yml when auditing a checkout from before the split. An entry in the wrong file (e.g. component: dialog inside sheet.yml) raises a ConfigError. Grader lines now cite audit/divergences/<folder>.yml as the source.
  • mcp/data/registry/index.json (version) and mcp/data/registry/components/<slug>.json. The builder deletes JSON files for components the gem no longer has. Registry.load still accepts a single JSON (test fixture, RUBY_UI_MCP_REGISTRY).
  • CI's "MCP registry up to date" check now diffs the folder, and git add -N catches a component file that was never committed.
  • CLAUDE.md, gem/AGENTS.md, the mcp and audit READMEs and the shadcn-audit skill point at the new paths.

The split registry loads to the same data as the old registry.json (compared after parsing). After this, two PRs conflict only when they touch the same component or bump the version.

#585 still edits audit/divergences.yml and will need a rebase that moves its entry to audit/divergences/dialog.yml.

Test steps

  1. cd audit && bundle exec rake
  2. cd mcp && bundle exec rake test
  3. cd mcp && bundle exec exe/ruby-ui-mcp-build && git status mcp/data: nothing changes.

šŸ¤– Generated with Claude Code


Summary by cubic

Splits the audit divergences and MCP registry into one file per component so parallel PRs stop conflicting in shared data files.

  • audit/divergences.yml becomes audit/divergences/<folder>.yml; Divergences.for_audit falls back to the single file for checkouts from before the split, and raises a ConfigError when both exist, an entry is in the wrong file, or a stray non-.yml file (other than README.md) is in the folder. Grader lines cite the new path.
  • mcp/data/registry.json becomes mcp/data/registry/index.json plus components/<slug>.json; the builder deletes files for components the gem no longer has, and Registry.load still accepts a single JSON for test fixtures and RUBY_UI_MCP_REGISTRY. CI now diffs the folder and uses git add -N to catch files never committed.
  • The split registry parses to the same data as the old registry.json, so two PRs conflict only when they touch the same component or bump the version.

Migration

  • #585 still edits audit/divergences.yml and needs a rebase to move its entry to audit/divergences/dialog.yml.