Render AI catalog skills in the UI
What does this MR do and why?
Skills are now available in the AI catalog, but the UI didn't show them. This MR adds that UI.
What it adds
ALL THE THINGS!
Seriously though, this does add a lot though most of it is copy/paste from the other catalog items. The tl;dr is that it adds everything flows and agents can do apart from the create and edit pages. The longer list is that it adds:
- Routes for skills at the project and group level
- Links to these pages in the relevant navigation
- An enabled, managed, and AI Catalog tab for skills at both of the above routes
- A tab for skills at the explore level
- A details page for individual skills with versions, stars, enablement, and all the things you get with agents and flows.
- A new (probably temporary) file tree for showing all the skills files on the details page
- Messaging to handle (you guessed it) all the messaging scenarios agents and flows will need
- graphQL fragments for fetching all the data we need to render the pages
- Some automatically generated path helpers
- A util for handling frontmatter in markdown files
Feature flag
ai_catalog_skills, default off, checked on the route and on both sidebars. In a project and group the actor is the project or group; on the Explore page there is no project in scope, so the actor is the current user, which matches how the other flags in that controller are pushed. One consequence worth knowing: with a user actor the flag resolves to its default for anonymous visitors, so anonymous users will not see the Explore Skills tab until the flag is enabled globally.
References
- Closes #630880 (closed)
- Epic: gitlab-org#22961
- Proof of concept: !257276 (closed)
- Staleness follow-up: #630881
- Depends on !260316 (merged), which this targets.
Screenshots or screen recordings
Please watch the Video Walkthrough for the best overview.
Screenshots are pending. The page cannot be captured from this environment, which has no running application.
| Before | After |
|---|---|
| No skills tab | Pending |
How to set up and validate locally
- Enable the flag in the Rails console:
Feature.enable(:ai_catalog_skills) - Create a skill catalog item:
FactoryBot.create(:ai_catalog_skill, :public, project: Project.first) - Visit
/explore/ai-catalog/skillsand select the skill. - Visit the same under a project at
/<project>/-/automate/skillsand check the Skills entry in the Duo sidebar. - Note the file contents and directory listing only resolve if the project repository actually has
skills/<name>/SKILL.mdat the recorded ref.