feat(plugins): Files → Skills and Agents move to the skills-agents plugin #12

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

Summary

Files → Skills and Files → Agents leave the core and become the pages of the skills-agents live plugin (companion PR in ai-agent-plugins: gabrielvidal/ai-agent-plugins#5). This is move D of the 2026-11-26 "what could migrate into ai-agent-plugins" survey, and it follows the Memories and Plans pattern. The core keeps the data (/api/skills, /api/agents, which the composer, the tag pills, the CLI and MCP read). It gains three owner-only bridges the plugin reads and writes through, and the old routes redirect to the plugin's pages.

Key changes

  • backend/plugins/hubcatalog.py (new): adds three bridges.
    • catalog.read: GET …/hub/skills|agents?account=, …/hub/skills/{name}/prompt and …/hub/agents/{name}. They return the /api answers plus the scope switch's profiles (scope validated).
    • skills.share: POST …/hub/skills/share {ref, on} changes the guests' sharedSkills. A ref the catalog doesn't offer is refused.
    • agents.run: POST …/hub/agents/{name}/run and …/schedule {schedule}. Handler only. Scheduling goes through cron_create with the definition as the prompt file, only when cron accepts the path.
  • backend/plugins/manifest.py: registers the three caps as operator-only, with their consent labels. main.py mounts the router.
  • frontend/src/root.tsx: /skills[?skill=], /agents and /agents/<name> redirect to /plugins/skills-agents/…, keeping the query. Pill links (skill: / agent: tags, a run's agent chip, cron links) keep working unchanged.
  • nav.ts: the files/skills / files/agents drawer keys now point at the plugin pages, so saved bar slots keep their place. sectionOf puts /plugins/skills-agents/* in Files, not Dashboards.
  • FilesPanel / FilesHome: the core Skills/Agents shortcuts are gone (the plugin's nav: files pages list themselves). A renamed map keeps each user's saved arrangement.
  • Removed:
    • business/skills and business/agents (1,480 lines);
    • useSkillPrompt, useAgent, fetchSkillPrompt, fetchAgent and runAgent;
    • their query keys and mock routes;
    • three unused French strings.
  • lib/telemetry/features.ts: page.skills / page.agents now count the plugin paths.
  • Docs: CLAUDE.md (the catalogs section) and the docs/plugins.md capability table.

Key decisions

  • One plugin, two pages (skills-agents), not two plugins. Both pages share one data source, one bridge module and one consent screen.
  • Three narrow caps, not one catalog.write. Reading the catalogs, handing a skill to every guest, and starting runs or cron jobs are different risks. The consent screen names each one.
  • agents.run is handler-only, like machines.wake: an agent's own skill token can't start runs through it.
  • Run now waits on conversations.read, the existing cap (hub/conversations?sids=), polling the same way the core's waitForConversation did. No new "resolve" bridge.
  • The sub-links keep their keys (files/skills, files/agents) and point at the plugin pages. They are not dropped as Memories/Plans were, so a saved bottom-bar drawer stays the same.
  • /api/skills and /api/agents stay core: the composer's mentions, the tag pills, ai-agent skills|agents, the MCP tools and cli/tag_looks.py all read them.
  • What changes from the old pages:
    • Search is a word match, not Fuse fuzzy.
    • Both lists break ties in last-used order by usage, so a skill with calls but no lastUsed no longer sinks among the never-used ones.
    • The profile switch on these pages is local to the page, as on the Environment plugin, seeded from the app's scope.
    • A built-in's prompt opens as a sub-page (/plugins/skills-agents/skills/<name>), not a modal: a tall sandboxed frame can't position a fixed modal in view.
    • Costs are shown in $, like every plugin page, because page init carries no currency.

Changelog

  • Changed: Files → Skills and Files → Agents are now pages of the Skills & agents plugin. Old links (/skills, /skills?skill=…, /agents/<name>) open them, and your Files layout keeps their place.
  • Removed: the built-in Skills and Agents pages. Without the Skills & agents plugin installed, those links show "plugin not installed".

Test notes

  • Not deployed from the EVOX2. Deploy from the Homelab (ai-agent-deploy) after review. The plugin install is a Homelab step too (below).

  • Merge order:

    1. This PR.
    2. The plugins PR (gabrielvidal/ai-agent-plugins#5).
    3. Deploy ai-agent.
    4. Right after, ai-agent plugin install ~/projects/ai-agent-plugins/plugins/skills-agents and approve the operator caps (catalog.read, skills.share, agents.run, conversations.read).

    Between the deploy and the install, Files → Skills/Agents say the plugin isn't installed. Installing first fails, because the caps are unknown until this PR is live.

  • Sibling PRs from the same survey branch off the same main and touch root.tsx, nav.ts, FilesPanel/FilesHome (Goals, move B), manifest.py, main.py, CLAUDE.md and docs/plugins.md in nearby lines. Rebase on whichever merges first. The conflicts are list-entry adjacency, nothing semantic.

  • Backend: test_plugin_catalog.py (new, 16 tests) covers:

    • the manifest caps;
    • the scope pass-through and refusal;
    • the detail and its 404;
    • the prompt;
    • guest and missing-cap refusals;
    • share on/off and an unknown ref;
    • run through agent_run, refused to a run token (handler_only);
    • schedule through cron_create, and the nested-definition refusal;
    • the real route signatures.

    Every backend module was run one per process in bwrap, the same way on the branch and on main. The only failures fail on main too: test_typed_plugins (path-dependent under /home) and test_tool_proxy_media (a date assertion).

  • Frontend:

    • tsc --noEmit is clean.
    • vitest run: 1062 passed. The only failures are the 3 already failing on main (useShareTarget ×2, FreshContext CacheExpiredNotice). The i18n "unused translation" check passes after dropping the 3 strings.
    • npm run build:mock and npm run build both pass.
  • Live: a local hub (bwrap, WORKSPACE=homelab checkout, the EVOX2's transcripts) with the plugin installed from its worktree. The screenshots below are from it.

    • /skills, /skills?skill=open-pr (dark), /agents, /agents/goal-keeper (cron card, definition) and /agents/clarifier (runs per day, recent runs) all redirect and render. Files stays the active section.
    • Through the app's action API:
      • share on/off works, and ../etc is refused;
      • Schedule created a real cron job on lab-digest;
      • Run now reached _send_message (no sidecar locally, so its error surfaced: the expected refusal);
      • a missing agent and a missing prompt give clean errors.

🤖 Generated with Claude Code

Screenshots

skills.png
agents.png
agent-runs.png
agent.png
skill-focus.png

## Summary Files → Skills and Files → Agents leave the core and become the pages of the `skills-agents` live plugin (companion PR in ai-agent-plugins: https://git.gabvdl.xyz/gabrielvidal/ai-agent-plugins/pulls/5). This is move **D** of the 2026-11-26 "what could migrate into ai-agent-plugins" survey, and it follows the Memories and Plans pattern. The core keeps the data (`/api/skills`, `/api/agents`, which the composer, the tag pills, the CLI and MCP read). It gains three owner-only bridges the plugin reads and writes through, and the old routes redirect to the plugin's pages. ## Key changes - **`backend/plugins/hubcatalog.py`** (new): adds three bridges. - `catalog.read`: `GET …/hub/skills|agents?account=`, `…/hub/skills/{name}/prompt` and `…/hub/agents/{name}`. They return the `/api` answers plus the scope switch's `profiles` (scope validated). - `skills.share`: `POST …/hub/skills/share {ref, on}` changes the guests' `sharedSkills`. A ref the catalog doesn't offer is refused. - `agents.run`: `POST …/hub/agents/{name}/run` and `…/schedule {schedule}`. Handler only. Scheduling goes through `cron_create` with the definition as the prompt file, only when cron accepts the path. - **`backend/plugins/manifest.py`**: registers the three caps as operator-only, with their consent labels. `main.py` mounts the router. - **`frontend/src/root.tsx`**: `/skills[?skill=]`, `/agents` and `/agents/<name>` redirect to `/plugins/skills-agents/…`, keeping the query. Pill links (`skill:` / `agent:` tags, a run's agent chip, cron links) keep working unchanged. - **`nav.ts`**: the `files/skills` / `files/agents` drawer keys now point at the plugin pages, so saved bar slots keep their place. `sectionOf` puts `/plugins/skills-agents/*` in **Files**, not Dashboards. - **`FilesPanel` / `FilesHome`**: the core Skills/Agents shortcuts are gone (the plugin's `nav: files` pages list themselves). A `renamed` map keeps each user's saved arrangement. - **Removed**: - `business/skills` and `business/agents` (1,480 lines); - `useSkillPrompt`, `useAgent`, `fetchSkillPrompt`, `fetchAgent` and `runAgent`; - their query keys and mock routes; - three unused French strings. - **`lib/telemetry/features.ts`**: `page.skills` / `page.agents` now count the plugin paths. - **Docs**: CLAUDE.md (the catalogs section) and the `docs/plugins.md` capability table. ## Key decisions - **One plugin, two pages** (`skills-agents`), not two plugins. Both pages share one data source, one bridge module and one consent screen. - **Three narrow caps, not one `catalog.write`.** Reading the catalogs, handing a skill to every guest, and starting runs or cron jobs are different risks. The consent screen names each one. - **`agents.run` is handler-only**, like `machines.wake`: an agent's own skill token can't start runs through it. - **Run now waits on `conversations.read`**, the existing cap (`hub/conversations?sids=`), polling the same way the core's `waitForConversation` did. No new "resolve" bridge. - **The sub-links keep their keys** (`files/skills`, `files/agents`) and point at the plugin pages. They are not dropped as Memories/Plans were, so a saved bottom-bar drawer stays the same. - **`/api/skills` and `/api/agents` stay core**: the composer's mentions, the tag pills, `ai-agent skills|agents`, the MCP tools and `cli/tag_looks.py` all read them. - **What changes from the old pages:** - Search is a word match, not Fuse fuzzy. - Both lists break ties in last-used order by usage, so a skill with calls but no `lastUsed` no longer sinks among the never-used ones. - The profile switch on these pages is local to the page, as on the Environment plugin, seeded from the app's scope. - A built-in's prompt opens as a sub-page (`/plugins/skills-agents/skills/<name>`), not a modal: a tall sandboxed frame can't position a fixed modal in view. - Costs are shown in `$`, like every plugin page, because page `init` carries no currency. ## Changelog - Changed: Files → Skills and Files → Agents are now pages of the Skills & agents plugin. Old links (`/skills`, `/skills?skill=…`, `/agents/<name>`) open them, and your Files layout keeps their place. - Removed: the built-in Skills and Agents pages. Without the Skills & agents plugin installed, those links show "plugin not installed". ## Test notes - **Not deployed from the EVOX2.** Deploy from the Homelab (`ai-agent-deploy`) after review. The plugin install is a Homelab step too (below). - **Merge order:** 1. This PR. 2. The plugins PR (https://git.gabvdl.xyz/gabrielvidal/ai-agent-plugins/pulls/5). 3. Deploy ai-agent. 4. Right after, `ai-agent plugin install ~/projects/ai-agent-plugins/plugins/skills-agents` and approve the operator caps (`catalog.read`, `skills.share`, `agents.run`, `conversations.read`). Between the deploy and the install, Files → Skills/Agents say the plugin isn't installed. Installing first fails, because the caps are unknown until this PR is live. - **Sibling PRs from the same survey** branch off the same main and touch `root.tsx`, `nav.ts`, `FilesPanel`/`FilesHome` (Goals, move B), `manifest.py`, `main.py`, CLAUDE.md and `docs/plugins.md` in nearby lines. Rebase on whichever merges first. The conflicts are list-entry adjacency, nothing semantic. - **Backend**: `test_plugin_catalog.py` (new, 16 tests) covers: - the manifest caps; - the scope pass-through and refusal; - the detail and its 404; - the prompt; - guest and missing-cap refusals; - share on/off and an unknown ref; - run through `agent_run`, refused to a run token (`handler_only`); - schedule through `cron_create`, and the nested-definition refusal; - the real route signatures. Every backend module was run one per process in bwrap, the same way on the branch and on main. The only failures fail on main too: `test_typed_plugins` (path-dependent under `/home`) and `test_tool_proxy_media` (a date assertion). - **Frontend**: - `tsc --noEmit` is clean. - `vitest run`: 1062 passed. The only failures are the 3 already failing on main (`useShareTarget` ×2, `FreshContext` CacheExpiredNotice). The i18n "unused translation" check passes after dropping the 3 strings. - `npm run build:mock` and `npm run build` both pass. - **Live**: a local hub (bwrap, `WORKSPACE`=homelab checkout, the EVOX2's transcripts) with the plugin installed from its worktree. The screenshots below are from it. - `/skills`, `/skills?skill=open-pr` (dark), `/agents`, `/agents/goal-keeper` (cron card, definition) and `/agents/clarifier` (runs per day, recent runs) all redirect and render. Files stays the active section. - Through the app's action API: - share on/off works, and `../etc` is refused; - Schedule created a real cron job on `lab-digest`; - Run now reached `_send_message` (no sidecar locally, so its error surfaced: the expected refusal); - a missing agent and a missing prompt give clean errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Screenshots ![skills.png](https://git.gabvdl.xyz/attachments/ad608463-6350-4398-a30d-3de6d6c4de55) ![agents.png](https://git.gabvdl.xyz/attachments/2ea92559-b93a-41c7-b43e-32fd9ae18a9a) ![agent-runs.png](https://git.gabvdl.xyz/attachments/67120ca2-a98a-447e-bf8e-c3f227bc0f32) ![agent.png](https://git.gabvdl.xyz/attachments/d53ddde9-9d11-4467-a5ee-d3e18e22e70f) ![skill-focus.png](https://git.gabvdl.xyz/attachments/54f348da-35c6-482a-aea9-fd1e5ebf32e4)
gabrielvidal self-assigned this 2026-11-27 00:03:57 +01:00
gabrielvidal added 1 commit 2026-11-27 00:03:57 +01:00
The skills and agents catalogs leave the core for the skills-agents live
plugin (ai-agent-plugins). The core keeps the data and gains the bridges:

- plugins/hubcatalog.py: catalog.read (GET hub/skills, skills/{name}/prompt,
  agents, agents/{name} — the /api answers plus the scope switch's profiles),
  skills.share (POST hub/skills/share {ref, on}), agents.run (handler only:
  POST hub/agents/{name}/run and /schedule). All owner only, operator caps.
- /skills[?skill=], /agents and /agents/<name> redirect to
  /plugins/skills-agents/…; the Files drawer's files/skills / files/agents
  keys and the Files lists' saved slots follow them; sectionOf puts the
  plugin's pages in Files.
- business/skills, business/agents, useSkillPrompt, useAgent,
  fetchSkillPrompt, fetchAgent, runAgent and their mock routes are gone.
  /api/skills and /api/agents stay (composer mentions, tag pills, CLI, MCP,
  tag_looks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Merged into main as b3d54521 (batch merge of the EVOX2 plugin moves on top of main 0797e454, all ai-agent suites green) and deployed: ai-agent @ 7c397fbc live since 2026-11-27 00:57. skills-agents installed.

Merged into `main` as b3d54521 (batch merge of the EVOX2 plugin moves on top of main 0797e454, all ai-agent suites green) and deployed: ai-agent @ 7c397fbc live since 2026-11-27 00:57. skills-agents installed.
gabrielvidal closed this pull request 2026-11-27 00:58:14 +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#12