refactor: finish the AgentHub rename and drop the MCP server

Two leftovers from the rebrand, done together because they touch the same
docs and manifests.

**Data directory.** `agent-dashboard` could not simply be renamed in the
source: it names a real directory holding the live SQLite database. Startup
now moves it once, via `migrateLegacyDataDir()` in `server/lib/claude-home.js`
— a same-filesystem rename, so it is instant even at multiple gigabytes and
cannot leave two divergent copies. `getDataDir()` stays PURE and resolves to
the legacy path until the move happens; the first version of this put the
rename inside the getter, which meant `npm run test:server` relocated the
developer's real database as a side effect. The call sits behind
`require.main === module` and ahead of the router requires, because those pull
in db.js, which opens SQLite at module load. A failed rename is silent and the
old directory keeps being used: an unfashionable directory name beats a blank
database beside an unreachable one. Same treatment for the port-discovery file
(`.agent-dashboard.json` → `.agenthub.json`, old one dropped on write).

Not renamed on purpose: the Sagi localStorage keys (renaming silently resets
everyone's prefs) and the PWA manifest `id` (changing it orphans an installed
app).

**MCP server.** 4 tool calls in 46 days across 577,132 events, against 4,556
lines of TypeScript, a 2 MB committed build artifact, and a pre-commit guard
that had already blocked commits twice. Deleted: `mcp/`, the maintainer skills
and `mcp-reviewer` agent, the build check, `plugins/agenthub/.mcp.json`,
`docs/MCP.md`, 12 npm scripts, 5 Makefile targets, and every doc section
describing it.

Kept, because they are unrelated things sharing the name: the Config
Explorer's MCP tab and its API, per-lane Playwright MCP, the agenthub-config
plugin's MCP audit, and the historical `mcp__plugin_agenthub_*` events that
analytics must keep attributing.

Verified: server 1432/1432, client 459/459, tsc clean, prettier clean. Both
directions of the migration proven — a sandbox-HOME test run leaves the legacy
directory untouched, and a real boot moves it with its contents intact.
This commit is contained in:
2026-09-08 09:48:40 +07:00
parent 11dcc04ac4
commit c7dbaf2d9f
210 changed files with 405 additions and 59408 deletions
+5 -6
View File
@@ -43,7 +43,7 @@ you dropped back to.
- `agenthub stage intake --status running`
- Restate the requirement and its success criteria.
- Explore the impacted modules: `Explore` agent for breadth, then read the key
files yourself. Identify which layers are hit (server / client / mcp / docs /
files yourself. Identify which layers are hit (server / client / docs /
scripts) — `repo-onboarding` if the area is unfamiliar.
- Requirement fuzzy or open to more than one reading? **superpowers:brainstorming**.
@@ -79,7 +79,7 @@ you dropped back to.
weaken existing tests. Final line: `UNIT-TESTS: PASS — <n> added` or
`UNIT-TESTS: FAIL — <test> :: <defect>`.
- **Suite run.** Backend changed → `npm run test:server`. Frontend →
`npm run test:client`. MCP → `npm run mcp:typecheck` + `npm run mcp:build`.
`npm run test:client`.
A UI snapshot diff is reported for review, **never blindly regenerated**
(`cd client && npx vitest run -u` is yours to run, only after you read the
diff).
@@ -101,15 +101,14 @@ you dropped back to.
Agent calls).** Check `git diff --name-only` (against the base this task
started from) for touched layers and launch every matching one —
FOREGROUND, fresh context, never `fork`, addressed as `agenthub:backend-reviewer`
/ `agenthub:frontend-reviewer` / `agenthub:mcp-reviewer`:
/ `agenthub:frontend-reviewer`:
- Any path under `server/` → `agenthub:backend-reviewer`.
- Any path under `client/` → `agenthub:frontend-reviewer`.
- Any path under `mcp/` → `agenthub:mcp-reviewer`.
- None of those three touched → skip all three; the generic Code Reviewer
- Neither touched → skip both; the generic Code Reviewer
above is the only gate.
- Hand each ONLY the repo path and the working diff — each scopes itself to
its own domain's files. Each ends with its own parseable line:
`BACKEND-REVIEW:` / `FRONTEND-REVIEW:` / `MCP-REVIEW:` — `CLEAN` or
`BACKEND-REVIEW:` / `FRONTEND-REVIEW:` — `CLEAN` or
`FINDINGS — <n>`.
- Apply what is worth applying — the generic review plus every domain
reviewer that ran — with **superpowers:receiving-code-review** judgment:
@@ -2,7 +2,7 @@
- Scope
- Problem and success criteria are explicit.
- Impacted layers identified (server/client/mcp/docs/scripts).
- Impacted layers identified (server/client/docs/scripts).
- Implementation
- Input validation and error handling are explicit.
@@ -12,10 +12,9 @@
- Verification
- Backend: `npm run test:server` when backend changed.
- Frontend: `npm run test:client` when UI changed.
- MCP: `npm run mcp:typecheck` + `npm run mcp:build` when MCP changed.
- Documentation
- `README.md`, `ARCHITECTURE.md`, `SETUP.md`, `INSTALL.md`, `mcp/README.md` updated as needed.
- `README.md`, `ARCHITECTURE.md`, `SETUP.md`, `INSTALL.md` updated as needed.
- Commands in docs match `package.json`.
- Delivery