fix(plugins): make the 10 focused plugins installable, finish the AgentHub rename

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.
This commit is contained in:
2026-09-10 11:03:14 +07:00
parent 876c6de6d2
commit e972267a42
40 changed files with 290 additions and 170 deletions
+2 -2
View File
@@ -53,8 +53,8 @@ flowchart LR
`npm run setup` ends with a fail-soft `npm link` (the `link-cli` script), so after a normal local setup `agenthub` is on your PATH from any directory:
```bash
git clone https://git.smartgift.io.vn/Smartgift-AI/Claude-Code-Monitor.git
cd Claude-Code-Agent-Monitor
git clone https://git.smartgift.io.vn/Smartgift-AI/AgentHub.git
cd AgentHub
npm run setup # installs deps AND links agenthub globally
agenthub help
```
+23 -16
View File
@@ -9,13 +9,13 @@ Every plugin is powered by the local Agent Monitor REST API at `http://localhost
### Add the marketplace
```bash
claude plugin marketplace add Smartgift-AI/Claude-Code-Monitor
claude plugin marketplace add https://git.smartgift.io.vn/Smartgift-AI/AgentHub.git
```
### Install the dashboard itself
```bash
claude plugin install agenthub@claude-code-agent-monitor-plugins
claude plugin install agenthub@agenthub
```
That is the whole install: no clone, no `npm run setup`, no `npm run install-hooks`, no manual `npm start`. See [The `agenthub` plugin](#the-agenthub-plugin) below for what it does on first session start.
@@ -39,16 +39,16 @@ marketplace name, not per source).
### Install a focused plugin
```bash
claude plugin install agenthub-analytics@claude-code-agent-monitor-plugins
claude plugin install agenthub-cost-guard@claude-code-agent-monitor-plugins
claude plugin install agenthub-productivity@claude-code-agent-monitor-plugins
claude plugin install agenthub-devtools@claude-code-agent-monitor-plugins
claude plugin install agenthub-insights@claude-code-agent-monitor-plugins
claude plugin install agenthub-sessions@claude-code-agent-monitor-plugins
claude plugin install agenthub-workflows@claude-code-agent-monitor-plugins
claude plugin install agenthub-quality@claude-code-agent-monitor-plugins
claude plugin install agenthub-config@claude-code-agent-monitor-plugins
claude plugin install agenthub-dashboard@claude-code-agent-monitor-plugins
claude plugin install agenthub-analytics@agenthub
claude plugin install agenthub-cost-guard@agenthub
claude plugin install agenthub-productivity@agenthub
claude plugin install agenthub-devtools@agenthub
claude plugin install agenthub-insights@agenthub
claude plugin install agenthub-sessions@agenthub
claude plugin install agenthub-workflows@agenthub
claude plugin install agenthub-quality@agenthub
claude plugin install agenthub-config@agenthub
claude plugin install agenthub-dashboard@agenthub
```
### Or install locally during development
@@ -250,7 +250,7 @@ single port.
### Uninstalling
`claude plugin uninstall agenthub@claude-code-agent-monitor-plugins` only removes
`claude plugin uninstall agenthub@agenthub` only removes
the plugin from the enabled list — verified against a real install/uninstall,
not assumed. It does **not**:
@@ -545,6 +545,13 @@ my-plugin/
Structure is validated by `server/__tests__/plugins-marketplace.test.js`, which enforces the marketplace↔directory bijection, `plugin.json` shape, name/dir agreement, and required frontmatter on every agent / skill / command.
Two of those shape rules exist because getting them wrong makes a plugin **listed but uninstallable**, with no other symptom — the marketplace loads fine and only `claude plugin install` fails:
- A subdirectory entry declares **`"source": "./plugins/<name>"`**, never `"path"`. `path` is not a source key the CLI accepts (`This plugin's marketplace entry is invalid: source: Invalid input`).
- A `plugin.json`'s **`repository` is a string**, not npm's `{ "type", "url" }` object (`Validation errors: repository: Invalid input`).
`server/__tests__/repo-links.test.js` guards the link side: no GitHub `owner/repo` marketplace shorthand (it resolves to github.com only — this repo is on Gitea, so the shorthand cannot work and no `GH_HOST`-style env var redirects it), no `raw.githubusercontent.com` / `*.github.io` / GitHub `/blob/<branch>/` URLs, no retired repository name, and no stale committed `openapi.yaml`.
### Testing locally
```bash
@@ -555,20 +562,20 @@ claude --plugin-dir /path/to/my-plugin # then use /my-plugin:my-skill some arg
### Dashboard not reachable
```bash
cd /path/to/Claude-Code-Agent-Monitor
cd /path/to/AgentHub
npm start # or: npm run dev
```
### Hooks not installed
```bash
cd /path/to/Claude-Code-Agent-Monitor
cd /path/to/AgentHub
npm run setup
```
### Plugin not found
```bash
claude plugin marketplace list
claude plugin marketplace add Smartgift-AI/Claude-Code-Monitor
claude plugin marketplace add https://git.smartgift.io.vn/Smartgift-AI/AgentHub.git
```
## License