|
5 | 5 | import com.devoxx.genie.ui.settings.DevoxxGenieStateService; |
6 | 6 | import com.intellij.ide.BrowserUtil; |
7 | 7 | import com.intellij.openapi.project.Project; |
| 8 | +import com.intellij.ui.HyperlinkLabel; |
8 | 9 | import com.intellij.ui.JBColor; |
9 | 10 | import com.intellij.ui.components.JBLabel; |
10 | 11 | import com.intellij.ui.components.JBScrollPane; |
@@ -35,6 +36,29 @@ public class SkillsSettingsComponent extends AbstractSettingsComponent { |
35 | 36 |
|
36 | 37 | private static final String DOCS_URL = "https://genie.devoxx.com/docs/features/skills"; |
37 | 38 |
|
| 39 | + /** A curated external source where users can discover and download skills. */ |
| 40 | + private record SkillLink(String title, String url, String description) {} |
| 41 | + |
| 42 | + /** |
| 43 | + * Curated links shown in the "Browse skills online" section. Skills follow the open |
| 44 | + * {@code SKILL.md} standard, so a skill folder downloaded from any of these sources can be |
| 45 | + * dropped into one of the scanned skill directories and picked up by the {@link SkillRegistry}. |
| 46 | + */ |
| 47 | + private static final SkillLink[] SKILL_LINKS = { |
| 48 | + new SkillLink("Anthropic Skills", |
| 49 | + "https://github.com/anthropics/skills", |
| 50 | + "Official Agent Skills published by Anthropic"), |
| 51 | + new SkillLink("Agent Skills standard", |
| 52 | + "https://agentskills.io", |
| 53 | + "The open SKILL.md specification, portable across AI coding tools"), |
| 54 | + new SkillLink("Claude Code Marketplace", |
| 55 | + "https://github.com/netresearch/claude-code-marketplace", |
| 56 | + "40+ community skills for AI-assisted development"), |
| 57 | + new SkillLink("SkillsMP", |
| 58 | + "https://skillsmp.com", |
| 59 | + "Searchable directory of community SKILL.md files"), |
| 60 | + }; |
| 61 | + |
38 | 62 | private final Project project; |
39 | 63 | private final SkillRegistry registry; |
40 | 64 | private final SkillsTableModel tableModel = new SkillsTableModel(); |
@@ -100,6 +124,17 @@ public JPanel createPanel() { |
100 | 124 | gbc.gridy++; |
101 | 125 | panel.add(description, gbc); |
102 | 126 |
|
| 127 | + // Curated links to places where users can find skills to download into the folders above. |
| 128 | + addSection(panel, gbc, "Browse skills online"); |
| 129 | + |
| 130 | + JBLabel linksHint = new JBLabel( |
| 131 | + "Download a skill's folder from one of these sources into a directory above, then click Reload."); |
| 132 | + gbc.gridy++; |
| 133 | + panel.add(linksHint, gbc); |
| 134 | + |
| 135 | + gbc.gridy++; |
| 136 | + panel.add(buildLinksPanel(), gbc); |
| 137 | + |
103 | 138 | // Toolbar: a single "Open Skills Folder" button + dropdown that selects which of the |
104 | 139 | // six skill directories to open, followed by the Reload button on the same row. The |
105 | 140 | // previous layout (six side-by-side buttons in a FlowLayout) overflowed and clipped |
@@ -172,6 +207,36 @@ public JPanel createPanel() { |
172 | 207 | return panel; |
173 | 208 | } |
174 | 209 |
|
| 210 | + /** |
| 211 | + * Builds a panel listing the curated {@link #SKILL_LINKS}, one per row: a clickable |
| 212 | + * {@link HyperlinkLabel} opening the source in the browser, followed by a short description. |
| 213 | + */ |
| 214 | + private JPanel buildLinksPanel() { |
| 215 | + JPanel linksPanel = new JPanel(new GridBagLayout()); |
| 216 | + GridBagConstraints lgbc = new GridBagConstraints(); |
| 217 | + lgbc.gridy = 0; |
| 218 | + lgbc.anchor = GridBagConstraints.WEST; |
| 219 | + lgbc.insets = JBUI.insets(2, 0, 2, 12); |
| 220 | + |
| 221 | + for (SkillLink link : SKILL_LINKS) { |
| 222 | + HyperlinkLabel label = new HyperlinkLabel(link.title()); |
| 223 | + label.setHyperlinkTarget(link.url()); |
| 224 | + label.setToolTipText(link.url()); |
| 225 | + lgbc.gridx = 0; |
| 226 | + lgbc.weightx = 0; |
| 227 | + linksPanel.add(label, lgbc); |
| 228 | + |
| 229 | + JBLabel desc = new JBLabel(link.description()); |
| 230 | + desc.setForeground(JBColor.GRAY); |
| 231 | + lgbc.gridx = 1; |
| 232 | + lgbc.weightx = 1.0; |
| 233 | + linksPanel.add(desc, lgbc); |
| 234 | + |
| 235 | + lgbc.gridy++; |
| 236 | + } |
| 237 | + return linksPanel; |
| 238 | + } |
| 239 | + |
175 | 240 | public boolean isModified() { |
176 | 241 | Set<String> persisted = DevoxxGenieStateService.getInstance().getDisabledSkillNames(); |
177 | 242 | if (persisted == null) { |
|
0 commit comments