Skip to content

feat(studio): skills inventory, detail page, and learned-skill review - #2154

Merged
kantord merged 8 commits into
mainfrom
issue-1853
Oct 7, 2026
Merged

kantord merged 8 commits into
mainfrom
issue-1853

Conversation

@kantord

@kantord kantord commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Configured skills get a sortable table (a stacked list below 500px) and a detail page showing the description, slug, and, for agent-owned skills, owner and version, following the Studio design baseline (Studio design review and parity tracking #1779; design PR stacklok/mecatl-prototypes#46).
  • Learned skills move to the baseline's flat list, a review dialog (version diff, body, evidence), and a "Recent changes" ledger. The dialog is still opened from /workspace/skills/learned/<id>, so links and search results keep working.
  • Only lifecycle actions the daemon reports in skill.actions are offered. A failed action (stale revision, conflict) re-reads the inventory and ledger and shows the error in the dialog; it never closes the dialog or reports success.
  • A learned-skill action that the daemon recorded but failed to publish into the live catalog now shows a warning instead of reading as success: the BFF passes the daemon's publication_status and publication_error through the contract.
  • Adds shared table primitives: stock shadcn table (unmodified except header, cn import, and formatting) and a small SortableHead with aria-sort.
  • The disabled Manage controls and the Files note, which exist only because the daemon has no write contract and no file-listing RPC for configured skills, are in the stacked PR on top of this one.

Screenshots

learned-publish-warning-desktop-light learned-conflict-desktop-light learned-confirm-desktop-light learned-list-mobile-light learned-dialog-mobile-light learned-dialog-mobile-dark learned-list-mobile-dark skills-list-desktop-dark learned-list-desktop-dark learned-dialog-desktop-dark learned-dialog-desktop-light learned-list-desktop-light skills-list-mobile-dark skill-detail-mobile-dark skill-detail-mobile-light skills-list-mobile-light skill-detail-desktop-dark skill-detail-desktop-light skills-list-desktop-light skills-list-desktop-light

Stack

  1. This PR: everything the daemon backs today.
  2. Stacked on top: Manage and Files placeholders for the configured skill page (awaiting backend contracts).

Issue relationship

Relates to #1853

(Not closing: the desktop/mobile screenshot evidence #1779 asks for is still to be attached, and the stacked PR completes the Summary/Manage/Files page.)

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

Baseline checks

  • Linting (task lint)
  • Fast offline test suite (task test)
  • Pre-review race suite (task test:race)
  • Offline demo (go run ./cmd/mecademo)
  • Markdown changed: docs generation/link checks (task docs)
  • User docs/user-facing behavior changed: site build (task site:build)
  • Guarded engine API affected: compatibility check (task api:check)
  • Intentional engine API change: task api:update + engine/CHANGELOG.md

Studio-only change, no Go code touched, so the Go gates above were not run. Instead:

  • task studio:check (lint, typecheck, tests, generated-artifact drift): passes.
  • Manually checked the configured table and detail page against a local mecated --skills-conventional in light and dark, at 1280px and 499px.
  • Exercised the learned view in a browser against a local proxy serving fake learned skills: the list and ledger, the review dialog with a version diff, the confirm step, a stale-revision conflict (the error stays in the dialog and the list re-reads), and a recorded-but-not-published warning that survives the dialog closing; in light and dark, at 1280px and 499px. This is what the screenshots show.
  • Not run against a real daemon with real learned skills (the local daemon has none); the BFF-to-daemon action path is covered by unit tests only.

Changes

File Change
apps/web/src/components/ui/table.tsx, sortable-head.tsx Stock shadcn table and a SortableHead with aria-sort
features/knowledge/knowledge-workspace.tsx All/Learned pills, configured table and mobile list
features/knowledge/learned-skills.tsx Learned list, review dialog, recent-changes ledger (split out of the workspace file)
features/knowledge/configured-skill-detail.tsx Configured skill page: back pill, title, pills, Summary
features/knowledge/skill-inventory.ts, humanize-skill-name.ts Client-side sort and filter; slug humanizer
features/knowledge/skill-diff.tsx Diff helpers kept from the removed learned detail page
features/knowledge/skill-tool-disabled-banner.tsx Warning when the daemon reports the Skill tool disabled
features/knowledge/state-card.tsx, format.ts StateCard moved out of the workspace file; shared date/error/empty-description helpers
apps/contracts/src/schemas/knowledge.ts, apps/server/src/mecatl/knowledge.ts, apps/server/src/routes/knowledge.ts (+ regenerated openapi.json and client types) The action response carries publicationStatus and publicationError
routes/workspace.skills_.$view.$item.tsx Configured → detail page; learned → workspace with the dialog open
user-docs/building/deployment/studio.md "Browse and review skills" section

Design graph

Nodes are units; solid edges are interactions. The configured-skills path (bold) was the tracer bullet. Orange nodes are files the first draft did not predict; dashed edges are remaining work.

flowchart LR
  subgraph routes
    R1["routes/workspace.skills.tsx"]
    R2["routes/workspace.skills_.$view.$item.tsx"]
  end
  WS["knowledge-workspace.tsx<br/>pills, configured table, mobile list"]
  DET["configured-skill-detail.tsx"]
  LRN["learned-skills.tsx<br/>list, dialog, ledger"]
  INV["skill-inventory.ts<br/>sort + filter"]
  HUM["humanize-skill-name.ts"]
  DIFF["skill-diff.tsx"]
  BAN["skill-tool-disabled-banner.tsx"]
  SC["state-card.tsx"]
  FMT["format.ts"]
  SH["ui/sortable-head.tsx"]
  TBL["ui/table.tsx<br/>stock shadcn"]
  SET["settings/memory-settings.tsx<br/>settings/storage-settings.tsx"]
  API[("BFF /api/v1<br/>skills, learned-skills,<br/>changes, diff, actions, runtime")]
  DOCS["user-docs/.../studio.md"]
  NEXT["stacked PR:<br/>Manage + Files placeholders"]
  SCHED["schedules run history<br/>(#1852)"]
  FILES["daemon files RPC<br/>(does not exist yet)"]

  R1 ==> WS
  R2 ==> DET
  R2 --> WS
  WS ==> INV
  WS ==> SH
  SH ==> TBL
  WS --> TBL
  WS ==> HUM
  INV --> HUM
  DET --> HUM
  WS --> LRN
  LRN --> DIFF
  WS --> BAN
  WS --> SC
  LRN --> SC
  SET --> SC
  WS --> FMT
  LRN --> FMT
  DET --> FMT
  WS ==>|GET skills| API
  DET --> API
  LRN -->|learned inventory, actions| API
  BAN -->|capabilities| API
  WS -->|capabilities| API
  DET -.-> NEXT
  SCHED -.-> SH
  NEXT -.-> FILES

  classDef traced stroke:#2e7d32,stroke-width:3px;
  classDef unplanned stroke:#e65100,stroke-dasharray:4 3,stroke-width:2px;
  class WS,INV,SH,TBL,HUM traced;
  class SC,FMT,SET,BAN,DIFF unplanned;
Loading

knowledge-workspace.tsx and format.ts are crossed by every path. state-card.tsx was unplanned: moving it out of the workspace file touched two settings pages.

User-facing change

Skills page: sortable table and mobile list for configured skills, a detail page per skill, and a learned-skill review dialog with a recent-changes ledger. The routed learned detail page and its per-skill history block are gone (the ledger replaces the history), and the dialog no longer shows the revision.

Special notes for reviewers

Intentional deviations to record once in #1853:

  • Learned skills have no routed detail page. The issue text says "a detail page" for configured and learned skills; the design baseline folds learned detail into a review dialog, and this PR follows the baseline. The dialog is still opened by /workspace/skills/learned/<id>, so links keep working. The old page's per-skill lifecycle history is replaced by the global "Recent changes" ledger (20 most recent, with a note when truncated), and the revision fact is no longer displayed (the revision is still sent with every action).
  • The mobile list is always alphabetical, as in the baseline, and ignores the table's sort.
  • The Enabled and Disabled pills, the row actions menu, and the status dot are omitted: nothing here can be disabled or managed.
  • A text filter box is kept above the table (the baseline has none); it is one line to remove.
  • Back on the configured page links to the skills list instead of using browser history (a hierarchical Back should not depend on history).
  • Dates in the learned list and ledger are absolute, not relative (no relative-time helper in Studio).
  • Studio's existing card look (rounded-xl border bg-card, px-4 py-3 cells) is kept instead of the baseline's tighter one.
  • The breakpoint uses max-[500px] rather than max-[499px]: Tailwind v4's max-* is strictly below, so max-[499px] leaves a 1px gap at exactly 499px. global-search.tsx has the same off-by-one; left alone here.
  • Opening /workspace/skills/learned/<id> while the daemon reports no learned-skill inventory shows the "Learned skills are unavailable" explanation instead of hiding the view.

Known gaps

Things this PR does not solve and that a reviewer should know:

  • The learned view has not run against a real daemon with real learned skills. It is covered by unit tests and by a local proxy serving fake data. The action path through the BFF and SDK to the daemon is older code this PR does not change, and Studio's integration test only checks that the learned list endpoints return 200 against the mock daemon.
  • There is no reliable way to tell whether learned skills are usable. On a default local mecated with learning.mode: off, the runtime still reports learnedSkills, learningProposals, and reflection as true, so Studio shows an empty Learned view even though no draft can appear. Tracked as Report whether learned skills are deployed and usable #2168, which also lists where Studio will wire the result in.
  • mecak8s without a learning store is unverified. The Helm learning.store.endpoint is empty by default; I did not check what the daemon then reports.
  • No edit or create for skills. The daemon has no edit RPC for learned skills, and configured-skill writes stay read-only pending a write contract (see the stacked PR for the disabled placeholders).

Out of scope, found while testing: Studio's chat has no interface for using skills (typing /<skill-name> or discovering slash commands and agent mentions in the composer). This was not tracked in #1853 or anywhere else we could find, but a design for it already exists in stacklok/mecatl-prototypes#39 (open). It is now tracked as #2160, a sub-issue of #1736 and blocked by #1853, with its own sub-issues per feature.

The schedules run-history table can adopt SortableHead (tracked under #1852).

Fully or partially written by an AI agent.

🤖 Generated with Claude Code

kantord and others added 7 commits October 7, 2026 17:32
…list

Tailwind v4's max-[499px] means width below 499px, so at exactly 499px both the table and the mobile list were visible. Use max-[500px] so it is the exact complement of min-[500px].

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Split the learned-skill half and StateCard out of knowledge-workspace.tsx, keep the Learned view reachable by direct link when the daemon reports no learned-skill inventory so it can explain why, note when the recent-changes ledger is truncated, share the empty-description and format helpers, and reword the Studio skills docs positively.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The disabled Manage controls and the Files note exist only because the daemon has no write contract and no file-listing RPC for configured skills. Move them to a stacked change so this one carries only behavior backed by the daemon.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…blished

The daemon records a lifecycle action and then publishes it into the live skill catalog, and reports the outcome as publication_status and publication_error. The BFF dropped both, so a recorded-but-unpublished skill looked like a clean success. Pass them through the contract and show a warning in the learned view.

Also note at the Learned pill that the learnedSkills capability stays true with learning off (#2168).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…te change

Closing the learned-skill dialog navigates from the item route to the list route, which remounts the list and dropped the warning exactly when an action was recorded but not published. Hold the notice in a small module-level store, add a Dismiss button, and cover the remount in the test.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@kantord
kantord marked this pull request as ready for review October 7, 2026 16:07

@peppescg peppescg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. No blockers. CI is green on c68ef76f1, including Studio, Lint, race and both user-docs gates.

What I checked:

  • BFF/contract: publicationStatus/publicationError pass through from the SDK response (mecatl/knowledge.ts), and the route schema moves to learnedSkillActionResponseSchema. The adapter test asserts the publication outcome reaches the browser for activate and stays empty for the other actions. Additive response fields, so older clients are unaffected.
  • Learned actions: the CAS and rollback semantics of the removed learned-skill-detail.tsx carry over unchanged (expectedRevision, version, ownerAgent, targetVersion: supersedes for rollback). Only actions the daemon reports in skill.actions are offered. On failure the dialog stays open with the error, and both inventory and ledger are invalidated in finally, so a stale revision re-reads instead of reporting success.
  • Routing: /workspace/skills/learned/<id> still opens the dialog, configured items route to the new detail page, and nothing references the deleted LearnedSkillDetail.

Nits (non-blocking):

  1. publicationNotice is module-level. It survives sign-out or a credential switch in the same tab, so the next user could see the previous user's "Recorded, but publishing … failed" warning until they dismiss it. Clearing it on auth/session change, or scoping it per connection, would close that.
  2. If an action fails and the refresh removes the skill from the inventory (for example, someone else rejected it), the dialog unmounts and the error is no longer visible. Only the "not found" card remains. That's an acceptable edge case, but you could keep error visible at list level when selected disappears.
  3. The known gaps in the description (no run against a real daemon with learned skills; #2168 runtime flags reporting learned skills as available with learning.mode: off) are well documented. Worth a real-daemon smoke test before #1853 closes.

@kantord
kantord merged commit 9657d99 into main Oct 7, 2026
55 checks passed
@kantord
kantord deleted the issue-1853 branch October 7, 2026 17:33
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Oct 7, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants