feat(plugins): Context & skills dashboard → context-skills plugin; /dashboards becomes a grid #34

Closed
gabrielvidal wants to merge 0 commits from context-skills-plugin into main
pull from: context-skills-plugin
Owner

Stacked on gabrielvidal/ai-agent#35 (files-plugins, pair 1: file explorer + context editor). Merge #35 first, then this PR. It targets main, so until #35 merges its diff also shows #35's commit b7427475; this PR's own change is the single commit on top (20377003). Plugins side: gabrielvidal/ai-agent-plugins#22, stacked the same way on ai-agent-plugins#23.

Summary

The owner's Context & skills dashboard, the last dashboard still in the core, moves into a standalone live plugin, context-skills (plugins PR: gabrielvidal/ai-agent-plugins#22, gabrielvidal/ai-agent-plugins#22). /dashboards is now a card grid of the active dashboard plugins, the twin of the Files landing. Its empty state points at the Plugins catalogue. GET /api/dashboard is gone: the plugin reads the same figures through a scoped, owner-only hub bridge, contextcost.read. This is pair 2 of the "Migrate Files & Context Dashboard to Plugins" plan (form migrate-files-context-dashboard-to-plugins_imhucu). Pair 1 (files-plugins, #35) moves the file explorer and the context editor; this branch is rebased on it.

Key changes

  • backend/plugins/hubcontextcost.py (new): GET /proxy/tools/plugins/{pid}/hub/context-cost. It answers the old /api/dashboard body unchanged, and each skill now also carries path (its SKILL.md when the file index has it) for a link. Owner only, with operator approval. Registered in main.py; contextcost.read added to plugins/manifest.py.
  • backend/dashboards/routes.py: /api/dashboard removed. _context_by_skill stays there, shared with /api/skills, which the skills-agents plugin reads. The guest Stats routes are untouched.
  • backend/plugins/carryover_context.py (new, called from carryover.run_all): copies the owner's saved stat-card order and bench (listOrders / listStashes["dashboard-stats"]) into the plugin's layout.json, once.
  • frontend/src/business/dashboards/pages/DashboardsHome.tsx (new) at /dashboards, plus dashboardPages.tsx, the single list the grid and the panel both read. DashboardsPanel.tsx has no core page any more; it opens with an All dashboards row and shows a catalogue link when it is empty.
  • Removed: pages/Dashboard.tsx, fetchDashboard, useDashboard, QK.dashboard and the mock's /api/dashboard handler. Added mock/contextSkillsPlugin.ts so the mock still has the dashboard.
  • Telemetry: /dashboards now counts as dash.home ("Dashboards"). The plugin page keeps the old dash.overview id, so its history carries on.
  • Regenerated with the repo's scripts: authz/matrix.golden.txt (−GET /api/dashboard), frontend/openapi.json + src/generated (−/api/dashboard, +the bridge, SkillStat.path), telemetry/features.json.
  • Docs: a CLAUDE.md section "Context & skills: the context-skills plugin"; docs/plugins.md gets the bridge row and the Dashboards landing.

Key decisions

  • A bridge module of its own (hubcontextcost.py) rather than a route in proxyroutes.py. It is separate from pair 1's hubfiles.py / context.read, so either pair can be switched on alone, and the rebase onto files-plugins stays small.
  • The saved stat-card order is carried over instead of dropped. The sandbox has no hold-to-drag, so the plugin offers an Arrange header button: drag on a desktop, arrows on a phone, − to bench, and + to bring a card back. The layout is stored per user in the plugin's data.
  • Links go by opener kind: context-file for a file or a skill's SKILL.md, provided by pair 1's context-editor plugin, so a row opens the editor on that file (/plugins/context-editor/editor?path=…). A built-in skill with no SKILL.md falls back to its skill tag page (skills-agents). With neither plugin on, the rows are plain text.
  • No /dashboards/* redirect. /dashboards itself was the only address, and it now shows the grid with Context & skills on it. A saved panel/drawer slot for /dashboards maps onto the plugin page (DASHBOARDS_RENAMED), so arrangements keep their place.
  • Owner-only strings stay English (no t()), like the page they replace.
  • Parity gaps, deliberate: the digit-roll animation on the stat values is not reproduced in the sandbox. Est. spend per skill stays in the cost cell's tooltip, as before.

Changelog

  • Changed: Dashboards → Context & skills is now a plugin (Context & skills), switchable on its own like Activity or Performance.
  • Added: /dashboards shows a card per dashboard you have, or a link to the Plugins catalogue when you have none.
  • Added: ai-agent plugin context-skills summary | skills | files and the matching MCP tools give the same figures from a terminal or an AI app.
  • Removed: the core /api/dashboard endpoint.

Test notes

Run on the EVOX2 (no Docker), after rebasing onto files-plugins (b7427475):

  • Backend: every module in its own bwrap process with a throwaway /data. Branch 2129 passed, 1 failed vs files-plugins 2118 passed, 0 failed. The difference is this PR's 12 new tests in test_context_skills_bridge.py.
    • The one failure, test_typed_plugins (test_records_carry_kind), depends on where the checkout lives: local plugin paths must live under projects/. It fails from ~/worktrees. The same commit exported to the scratch dir, where the baseline ran, passes 48/48. It fails on main's ~/projects checkout too.
    • The bridge tests cover the figures, owner access, a guest's handler gets a 403 with no data, a missing capability, a disabled plugin, no token, the route gone from the spec, and the carry-over.
  • Frontend: tsc clean. vitest 1104 passed, 1 failed; the failure is FreshContext CacheExpiredNotice, which also fails on main. vite build is clean.
  • Plugins: context-skills 8/8, context-editor and file-explorer tests OK. All three manifests pass the hub's validate_manifest.
  • Live local hub (port 8142, the rebased build, with file-explorer, context-editor, skills-agents, context-skills, activity and performance installed from the rebased plugins branch). Clicks were driven in puppeteer inside the sandboxed page:
    • the skill row "notify" opened /plugins/context-editor/editor?path=.claude/skills/notify/SKILL.md, with the editor on that file (screenshot below);
    • the file row "CLAUDE.md" opened …/editor?path=CLAUDE.md;
    • a built-in skill ("open-pr", no SKILL.md) opened /plugins/skills-agents/skills/open-pr.
  • Rendering:
    • /dashboards and the Files landing/drawer read well together (4 dashboard cards; Files lists Notifications, Context files, Skills, Agents).
    • On a 390 px phone, the foot of the Context & skills page and the context editor's status line both end 24 px above the floating composer.
    • Arrange inside the sandbox moved and hid cards and saved layout.json.
    • The carry-over moved a seeded dashboard-stats order into the plugin.

Rebase conflicts. All were the two pairs removing or adding next to each other; both changes were kept:

  • api.ts / queries.ts: fetchBundle, fetchFile and fetchDashboard all gone.
  • root.tsx: LegacyFileRedirect plus DashboardsHome.
  • mock/plugins.ts: the file-explorer and context-editor briefs plus context-skills.
  • manifest.py: hostfiles.read, context.* and contextcost.read.
  • schemas/files.py, CLAUDE.md.
  • Dashboard.tsx: pair 1's edit is dropped with the file.

The generated files (openapi.json, src/generated, matrix.golden.txt, features.json) were taken from files-plugins and regenerated with the repo's scripts.

Not deployed from the EVOX2. From the Homelab, after review:

  1. Merge ai-agent #35 and ai-agent-plugins #23 (pair 1), then this PR and ai-agent-plugins #22.
  2. Deploy: ~/homelab/services/ai-agent/deploy.sh --detach && ~/homelab/services/ai-agent/deploy.sh --watch.
  3. ai-agent plugin install ~/projects/ai-agent-plugins/plugins/context-skills --approve. It needs operator approval for contextcost.read. Install it right after the deploy: until then /dashboards lists only the other dashboard plugins.
  4. Deploy and install pair 1's plugins as #35 says. Without context-editor, the file rows stay plain text.

Screenshots

link-skill-to-editor.png
rebased-grid.png
rebased-files.png
page-desktop.png
page-arrange.png
page-dark.png
phone-context-skills-foot.png
phone-editor-foot.png
rebased-grid-mobile-dark.png
grid-empty.png

> **Stacked on gabrielvidal/ai-agent#35 (`files-plugins`, pair 1: file explorer + context editor). Merge #35 first, then this PR.** It targets `main`, so until #35 merges its diff also shows #35's commit `b7427475`; this PR's own change is the single commit on top (`20377003`). Plugins side: gabrielvidal/ai-agent-plugins#22, stacked the same way on ai-agent-plugins#23. ## Summary The owner's **Context & skills** dashboard, the last dashboard still in the core, moves into a standalone live plugin, `context-skills` (plugins PR: gabrielvidal/ai-agent-plugins#22, https://git.gabvdl.xyz/gabrielvidal/ai-agent-plugins/pulls/22). `/dashboards` is now a **card grid of the active dashboard plugins**, the twin of the Files landing. Its empty state points at the Plugins catalogue. `GET /api/dashboard` is gone: the plugin reads the same figures through a scoped, owner-only hub bridge, `contextcost.read`. This is pair 2 of the "Migrate Files & Context Dashboard to Plugins" plan (form `migrate-files-context-dashboard-to-plugins_imhucu`). Pair 1 (`files-plugins`, #35) moves the file explorer and the context editor; this branch is rebased on it. ## Key changes - `backend/plugins/hubcontextcost.py` (new): `GET /proxy/tools/plugins/{pid}/hub/context-cost`. It answers the old `/api/dashboard` body unchanged, and each skill now also carries `path` (its `SKILL.md` when the file index has it) for a link. Owner only, with operator approval. Registered in `main.py`; `contextcost.read` added to `plugins/manifest.py`. - `backend/dashboards/routes.py`: `/api/dashboard` removed. `_context_by_skill` stays there, shared with `/api/skills`, which the `skills-agents` plugin reads. The guest Stats routes are untouched. - `backend/plugins/carryover_context.py` (new, called from `carryover.run_all`): copies the owner's saved stat-card order and bench (`listOrders` / `listStashes["dashboard-stats"]`) into the plugin's `layout.json`, once. - `frontend/src/business/dashboards/pages/DashboardsHome.tsx` (new) at `/dashboards`, plus `dashboardPages.tsx`, the single list the grid and the panel both read. `DashboardsPanel.tsx` has no core page any more; it opens with an *All dashboards* row and shows a catalogue link when it is empty. - Removed: `pages/Dashboard.tsx`, `fetchDashboard`, `useDashboard`, `QK.dashboard` and the mock's `/api/dashboard` handler. Added `mock/contextSkillsPlugin.ts` so the mock still has the dashboard. - Telemetry: `/dashboards` now counts as `dash.home` ("Dashboards"). The plugin page keeps the old `dash.overview` id, so its history carries on. - Regenerated with the repo's scripts: `authz/matrix.golden.txt` (−`GET /api/dashboard`), `frontend/openapi.json` + `src/generated` (−`/api/dashboard`, +the bridge, `SkillStat.path`), `telemetry/features.json`. - Docs: a `CLAUDE.md` section "Context & skills: the `context-skills` plugin"; `docs/plugins.md` gets the bridge row and the Dashboards landing. ## Key decisions - **A bridge module of its own** (`hubcontextcost.py`) rather than a route in `proxyroutes.py`. It is separate from pair 1's `hubfiles.py` / `context.read`, so either pair can be switched on alone, and the rebase onto `files-plugins` stays small. - **The saved stat-card order is carried over** instead of dropped. The sandbox has no hold-to-drag, so the plugin offers an **Arrange** header button: drag on a desktop, arrows on a phone, − to bench, and + to bring a card back. The layout is stored per user in the plugin's data. - **Links go by opener kind**: `context-file` for a file or a skill's `SKILL.md`, provided by pair 1's `context-editor` plugin, so a row opens the editor on that file (`/plugins/context-editor/editor?path=…`). A built-in skill with no `SKILL.md` falls back to its `skill` tag page (skills-agents). With neither plugin on, the rows are plain text. - **No `/dashboards/*` redirect.** `/dashboards` itself was the only address, and it now shows the grid with Context & skills on it. A saved panel/drawer slot for `/dashboards` maps onto the plugin page (`DASHBOARDS_RENAMED`), so arrangements keep their place. - **Owner-only strings stay English** (no `t()`), like the page they replace. - Parity gaps, deliberate: the digit-roll animation on the stat values is not reproduced in the sandbox. Est. spend per skill stays in the cost cell's tooltip, as before. ## Changelog - Changed: Dashboards → Context & skills is now a plugin (*Context & skills*), switchable on its own like Activity or Performance. - Added: `/dashboards` shows a card per dashboard you have, or a link to the Plugins catalogue when you have none. - Added: `ai-agent plugin context-skills summary | skills | files` and the matching MCP tools give the same figures from a terminal or an AI app. - Removed: the core `/api/dashboard` endpoint. ## Test notes Run on the EVOX2 (no Docker), **after rebasing onto `files-plugins` (`b7427475`)**: - **Backend**: every module in its own bwrap process with a throwaway `/data`. Branch **2129 passed, 1 failed** vs `files-plugins` **2118 passed, 0 failed**. The difference is this PR's 12 new tests in `test_context_skills_bridge.py`. - The one failure, `test_typed_plugins` (`test_records_carry_kind`), depends on where the checkout lives: `local plugin paths must live under projects/`. It fails from `~/worktrees`. The same commit exported to the scratch dir, where the baseline ran, passes 48/48. It fails on main's `~/projects` checkout too. - The bridge tests cover the figures, owner access, **a guest's handler gets a 403 with no data**, a missing capability, a disabled plugin, no token, the route gone from the spec, and the carry-over. - **Frontend**: `tsc` clean. vitest **1104 passed, 1 failed**; the failure is `FreshContext` CacheExpiredNotice, which also fails on main. `vite build` is clean. - **Plugins**: context-skills 8/8, context-editor and file-explorer tests OK. All three manifests pass the hub's `validate_manifest`. - **Live local hub** (port 8142, the rebased build, with file-explorer, context-editor, skills-agents, context-skills, activity and performance installed from the rebased plugins branch). Clicks were driven in puppeteer inside the sandboxed page: - the skill row "notify" opened `/plugins/context-editor/editor?path=.claude/skills/notify/SKILL.md`, with the editor on that file (screenshot below); - the file row "CLAUDE.md" opened `…/editor?path=CLAUDE.md`; - a built-in skill ("open-pr", no `SKILL.md`) opened `/plugins/skills-agents/skills/open-pr`. - **Rendering**: - `/dashboards` and the Files landing/drawer read well together (4 dashboard cards; Files lists Notifications, Context files, Skills, Agents). - On a 390 px phone, the foot of the Context & skills page and the context editor's status line both end 24 px above the floating composer. - Arrange inside the sandbox moved and hid cards and saved `layout.json`. - The carry-over moved a seeded `dashboard-stats` order into the plugin. **Rebase conflicts.** All were the two pairs removing or adding next to each other; both changes were kept: - `api.ts` / `queries.ts`: `fetchBundle`, `fetchFile` and `fetchDashboard` all gone. - `root.tsx`: `LegacyFileRedirect` plus `DashboardsHome`. - `mock/plugins.ts`: the file-explorer and context-editor briefs plus context-skills. - `manifest.py`: `hostfiles.read`, `context.*` and `contextcost.read`. - `schemas/files.py`, `CLAUDE.md`. - `Dashboard.tsx`: pair 1's edit is dropped with the file. The generated files (`openapi.json`, `src/generated`, `matrix.golden.txt`, `features.json`) were taken from `files-plugins` and regenerated with the repo's scripts. **Not deployed from the EVOX2.** From the Homelab, after review: 1. Merge ai-agent #35 and ai-agent-plugins #23 (pair 1), then this PR and ai-agent-plugins #22. 2. Deploy: `~/homelab/services/ai-agent/deploy.sh --detach && ~/homelab/services/ai-agent/deploy.sh --watch`. 3. `ai-agent plugin install ~/projects/ai-agent-plugins/plugins/context-skills --approve`. It needs operator approval for `contextcost.read`. Install it right after the deploy: until then `/dashboards` lists only the other dashboard plugins. 4. Deploy and install pair 1's plugins as #35 says. Without `context-editor`, the file rows stay plain text. ## Screenshots ![link-skill-to-editor.png](https://git.gabvdl.xyz/attachments/d439b79e-37a0-4c9d-8e38-f85403a8e7a4) ![rebased-grid.png](https://git.gabvdl.xyz/attachments/1e43e154-7cf2-475c-b45c-bd55f0220a8a) ![rebased-files.png](https://git.gabvdl.xyz/attachments/be4692e3-e6c1-47f8-8a2e-8428eb23bd35) ![page-desktop.png](https://git.gabvdl.xyz/attachments/33ac9847-7a37-49a4-9f7e-e0e116031635) ![page-arrange.png](https://git.gabvdl.xyz/attachments/815f2c35-5f5a-4091-9f4e-6cf9332f8cb1) ![page-dark.png](https://git.gabvdl.xyz/attachments/a472ec00-2c38-439b-85b5-4e857c1e08a1) ![phone-context-skills-foot.png](https://git.gabvdl.xyz/attachments/f64a3aee-3ae8-4287-a867-c3aaa3a33e40) ![phone-editor-foot.png](https://git.gabvdl.xyz/attachments/35dffe31-c066-482b-8db9-e6853f77d054) ![rebased-grid-mobile-dark.png](https://git.gabvdl.xyz/attachments/ce8edca1-23e4-4337-b063-b4af764f56e0) ![grid-empty.png](https://git.gabvdl.xyz/attachments/1e4d7079-66b2-49bf-affe-1fcfa3cbab19)
gabrielvidal self-assigned this 2026-11-28 13:33:08 +01:00
gabrielvidal added 2 commits 2026-11-28 13:53:51 +01:00
The host file browser + viewer (/file/*, HostFilePage, the project Files
card) and the context tree + editor (/_/*, Editor, the FilesPanel tree) are
the file-explorer and context-editor plugins' now.

- bridges (plugins/hubfiles.py): hostfiles.read (as the caller; operator-
  approved; machine tokens refused), context.read / context.write (owner)
- /api/bundle, /api/file, /api/host-file, /api/host-files[/recent] retired;
  /api/host-file/raw stays for media and downloads
- pages that route themselves: aiAgentPlugin.setRoute / onRoute; download,
  back; plugin pages pad above the phone composer
- /file/* and /_/* redirect through opens (host-file, context-file)
- mock: filesPlugins.ts; docs and CLAUDE.md updated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- GET /api/dashboard → owner-only contextcost.read bridge (plugins/hubcontextcost.py)
- /dashboards becomes DashboardsHome, a card grid of the dashboard plugins' pages
- one-time carry-over of the stat-card order/bench into the plugin's layout.json
- telemetry: /dashboards is dash.home; the plugin page keeps dash.overview

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gabrielvidal force-pushed context-skills-plugin from 13a7f62188 to 2037700317 2026-11-28 13:53:51 +01:00 Compare
Author
Owner
Merged into `main` as 5afcb5f0 by the auto-ship batch https://ai-agent.lab.gabvdl.xyz/conversation/91782f5a-872e-4531-8bde-f4031df38c26.
gabrielvidal closed this pull request 2026-11-28 14:13:22 +01:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gabrielvidal/ai-agent#34