fix: make every plugin in the marketplace actually installable, and repoint the repo-rename leftovers #13

Merged
nntrivi2001 merged 1 commits from fix/plugin-install-and-repo-rename into main 2026-09-10 07:11:45 +00:00
Owner

What was broken

1. Ten of eleven plugins were listed but uninstallable. Two nested schema bugs, both present since the first commit (57dc915, 2026-07-29) — so this is not rename fallout:

Bug CLI error
"path": "plugins/<name>" instead of "source" This plugin's marketplace entry is invalid: source: Invalid input
repository as npm's {type, url} object instead of a string Validation errors: repository: Invalid input

The existing test asserted the broken shape, which is exactly why CI stayed green for six weeks. It now asserts the working one, plus that source resolves to a real directory on disk.

2. The documented install command could never work. Six docs told users to run claude plugin marketplace add Smartgift-AI/AgentHub. The owner/repo shorthand resolves to github.com only — verified against the CLI, which rejects host/owner/repo outright and ignores GH_HOST, GITHUB_HOST and CLAUDE_CODE_MARKETPLACE_URL. There is no way to point the shorthand at a self-hosted Gitea, so all six now use the full https://…/AgentHub.git clone URL.

3. Push notification icons were doubly dead — a raw.githubusercontent.com URL for a repo that is not on GitHub, pointing at a favicon.ico this repo does not ship. Grepping the callers turned up the same /favicon.ico in client/src/hooks/useNotifications.ts; both now use the same-origin /favicon.svg.

4. Retired names and stale marketplace handles — Claude-Code-Monitor / Claude-Code-Agent-Monitor, @claude-code-agent-monitor-plugins, @smartgift-claude-code-monitor (a name that never existed in any of the four revisions of marketplace.json), and /Users/son/WebstormProjects/… example paths.

Guards so it cannot rot again silently

Both run in npm run test:server, so the pre-commit hook catches them:

  • server/__tests__/repo-links.test.js — six link rules over every git-tracked text file (GitHub marketplace shorthand, github.com/Smartgift*, raw.githubusercontent.com, *smartgift*.github.io, Gitea /blob/<ref>/ path syntax, retired repo names). It lints the staged index under pre-commit on purpose: no GIT_* scrub, so git ls-files lists what is about to land rather than the previous commit.
  • openapi.yaml drift test — the committed spec had silently fallen a whole minor version behind package.json (1.4.6 vs 1.5.0). scripts/generate-openapi-yaml.js now exports a render() so the test and the generator share one definition of the dump options.

Verification

npm run test:server 1633 pass / 0 fail · npm run test:client 475 pass / 0 fail · prettier --check clean · file-header audit clean. The lint was proven to actually fire by injecting each violation into docs/CLI.md and observing the expected failure, then restoring.

## What was broken **1. Ten of eleven plugins were listed but uninstallable.** Two nested schema bugs, both present since the first commit (`57dc915`, 2026-07-29) — so this is not rename fallout: | Bug | CLI error | |---|---| | `"path": "plugins/<name>"` instead of `"source"` | `This plugin's marketplace entry is invalid: source: Invalid input` | | `repository` as npm's `{type, url}` object instead of a string | `Validation errors: repository: Invalid input` | The existing test asserted the broken shape, which is exactly why CI stayed green for six weeks. It now asserts the working one, plus that `source` resolves to a real directory on disk. **2. The documented install command could never work.** Six docs told users to run `claude plugin marketplace add Smartgift-AI/AgentHub`. The `owner/repo` shorthand resolves to **github.com only** — verified against the CLI, which rejects `host/owner/repo` outright and ignores `GH_HOST`, `GITHUB_HOST` and `CLAUDE_CODE_MARKETPLACE_URL`. There is no way to point the shorthand at a self-hosted Gitea, so all six now use the full `https://…/AgentHub.git` clone URL. **3. Push notification icons were doubly dead** — a `raw.githubusercontent.com` URL for a repo that is not on GitHub, pointing at a `favicon.ico` this repo does not ship. Grepping the callers turned up the same `/favicon.ico` in `client/src/hooks/useNotifications.ts`; both now use the same-origin `/favicon.svg`. **4. Retired names and stale marketplace handles** — `Claude-Code-Monitor` / `Claude-Code-Agent-Monitor`, `@claude-code-agent-monitor-plugins`, `@smartgift-claude-code-monitor` (a name that never existed in any of the four revisions of `marketplace.json`), and `/Users/son/WebstormProjects/…` example paths. ## Guards so it cannot rot again silently Both run in `npm run test:server`, so the pre-commit hook catches them: - **`server/__tests__/repo-links.test.js`** — six link rules over every git-tracked text file (GitHub marketplace shorthand, `github.com/Smartgift*`, `raw.githubusercontent.com`, `*smartgift*.github.io`, Gitea `/blob/<ref>/` path syntax, retired repo names). It lints the **staged index** under pre-commit on purpose: no `GIT_*` scrub, so `git ls-files` lists what is about to land rather than the previous commit. - **openapi.yaml drift test** — the committed spec had silently fallen a whole minor version behind `package.json` (1.4.6 vs 1.5.0). `scripts/generate-openapi-yaml.js` now exports a `render()` so the test and the generator share one definition of the dump options. ## Verification `npm run test:server` 1633 pass / 0 fail · `npm run test:client` 475 pass / 0 fail · `prettier --check` clean · file-header audit clean. The lint was proven to actually fire by injecting each violation into `docs/CLI.md` and observing the expected failure, then restoring.
nntrivi2001 added 1 commit 2026-09-10 07:03:56 +00:00
The ten `agenthub-*` plugins were listed by the marketplace but could never be
installed — two schema mistakes present since the entries were first authored
(57dc915), both invisible until you actually run `claude plugin install`:

- marketplace entries used `"path": "plugins/<name>"`; the CLI only accepts
  `"source"`, so every one failed with
  `This plugin's marketplace entry is invalid: source: Invalid input`
- each `plugin.json` carried npm's `"repository": { "type", "url" }` object;
  the schema wants a plain string, so the next attempt failed with
  `Validation errors: repository: Invalid input`

Verified by installing all 11 entries into a throwaway CLAUDE_CONFIG_DIR:
1/11 before, 11/11 after. `plugins-marketplace.test.js` was asserting the
broken shape, which is why CI stayed green — it now asserts `source` and
rejects `path`.

Marketplace renamed `claude-code-agent-monitor-plugins` -> `agenthub`, so the
install line is `agenthub@agenthub`. ARCHITECTURE.md documented a marketplace
name (`smartgift-claude-code-monitor`) that never existed in any revision.

The documented `/plugin marketplace add Smartgift-AI/Claude-Code-Monitor` also
never worked: the `owner/repo` shorthand resolves to github.com only, and this
repo is self-hosted on Gitea. Confirmed the CLI rejects `host/owner/repo` and
ignores GH_HOST / GITHUB_HOST / CLAUDE_CODE_MARKETPLACE_URL, so the full
https:// clone URL is the only supported form. Same GitHub-habit class fixed
elsewhere: raw.githubusercontent.com icon URLs (404, and the repo ships
favicon.svg not favicon.ico — the client had the same dead /favicon.ico),
a smartgift.github.io docs link (404), and Gitea `/blob/<ref>/` paths that
must be `/src/branch/<ref>/`.

Repository renamed to Smartgift-AI/AgentHub throughout. Gitea 301-redirects
the old name, so these were stale rather than broken; `docs/superpowers/`
keeps the old name because those are dated decision records.

Adds `repo-links.test.js` to guard both classes (it runs under the existing
pre-commit gate) plus an openapi.yaml drift check — the committed spec had
silently fallen a minor version behind package.json. `generate-openapi-yaml.js`
now exports `render()` so the test compares against one definition of the dump
options instead of a second copy.
nntrivi2001 merged commit a146284087 into main 2026-09-10 07:11:45 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Smartgift-AI/AgentHub#13