docs(spec): declarative plugin reconciler#52
Merged
Conversation
added 3 commits
May 27, 2026 20:50
Records the design for converting plugin install/upgrade from imperative (claude plugin install in setup.sh, no-op when something's installed) to declarative (agents/_shared/plugin-manifest.json read by a new scripts/reconcile-plugins.sh on every pod boot). Root cause for the new design: v0.7.0 of matrix-channel was published, the marketplace was updated, but pods stayed on 0.6.0 because `claude plugin install` is idempotent-no-upgrade and there's no --version flag on the install command. Investigation via systematic-debugging skill traced the gap to the missing `claude plugin marketplace update` + uninstall-before-install pattern. Scope: - New agents/_shared/plugin-manifest.json (declares plugin + version) - New scripts/reconcile-plugins.sh (reads manifest, converges install state via marketplace update + uninstall + install on drift) - setup.sh's lines 73-77 replaced with a single reconciler invocation - .mcp.json unchanged (already declarative); mcp-nats stays at Dockerfile build-time pin Out of scope, called out: MCP runtime reconciliation, marketplace SHA pinning (compatible future extension), per-agent overrides, native Claude Code declarative install (separate upstream ask). End-to-end target: bumping plugin-manifest.json to 0.7.0 + rolling pods upgrades matrix-channel from 0.6.0 → 0.7.0 automatically; running the reconciler twice produces zero diffs.
14-task bite-sized TDD plan covering: - Phase 1: feature branch from main - Phase 2: test harness scaffolding (PATH-shimmed claude mock) - Phase 3-4: per-test-case implementation (empty manifest, missing install, in-sync, wrong version, marketplace registration, install failure) - Phase 5: manifest authoring + setup.sh integration - Phase 6: CHANGELOG entry - Phase 7: full suite + push + PR + cluster validation Each task uses TDD: failing test → implementation → passing test. No placeholders. Exact code, exact commands, expected output. Spec: docs/superpowers/specs/2026-05-27-declarative-plugin-reconciler-design.md
…manifest)
Sherod's call: don't maintain two declarative files. Drop
agents/_shared/plugin-manifest.json. The version pin lives inside the
existing settings.json.enabledPlugins map by changing the value shape
from `true` to `{ "version": "X.Y.Z" }`. Reconciler reads marketplaces
+ plugins from the same settings.json.
Spec amended in place (all manifest references gone, schema section
rewritten, file map updated). Plan amended with an AMENDMENT callout
at the top that overrides per-task references — the reconciler
algorithm, test harness shape, and task structure all stay the same;
only the source-of-truth file changes.
Backward compat: plain `true` values for enabledPlugins continue to
mean "enabled, no version pin" — the reconciler installs-if-missing
but skips drift checks on those entries.
5 tasks
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
Records the design for moving plugin install/upgrade from imperative `claude plugin install` (in `setup.sh`, no-op on upgrades) to declarative — a new `agents/_shared/plugin-manifest.json` + a `scripts/reconcile-plugins.sh` that reads it and converges `installed_plugins.json` on every pod boot via `marketplace update` → `uninstall` → `install` on drift.
Why
v0.7.0 of `matrix-channel` was published, marketplace was updated, but pods stayed on 0.6.0. Investigation (systematic-debugging skill) traced the cause to `claude plugin install` being idempotent-no-upgrade with no `--version` flag, and `setup.sh` never running `claude plugin marketplace update`.
Spec
Single doc, 357 lines: `docs/superpowers/specs/2026-05-27-declarative-plugin-reconciler-design.md`
Test plan
🤖 Generated with Claude Code