Skip to content

The agent that grows with you

feat(website): feature the curated pick on /skills and /plugins

Brooklyn Nicholsonabd4136c6bfa
diff --git a/website/src/components/CatalogFeatured/index.tsx b/website/src/components/CatalogFeatured/index.tsx
new file mode 100644
index 00000000000..86282e0754e
--- /dev/null
+++ b/website/src/components/CatalogFeatured/index.tsx
@@ -0,0 +1,63 @@
+import React from "react";
+import Link from "@docusaurus/Link";
+
+import styles from "./styles.module.css";
+
+/** The catalog hero both /skills and /plugins show, laid out like the desktop
+ * app's featured card (author, title, one-line description, tags; action
+ * bottom-right; no artwork). The pick comes from apps/shared `pickFeatured`,
+ * so the site and the app always feature the same entry. */
+export default function CatalogFeatured({
+ label,
+ author,
+ title,
+ description,
+ tags,
+ href,
+ cta,
+}: {
+ /** Section label, e.g. "Featured skill"; names the region for screen readers too. */
+ label: string;
+ author?: string | null;
+ title: string;
+ description: string;
+ /** Falsy entries are dropped, so callers can pass optional fields inline. */
+ tags: Array<string | false | null | undefined>;
+ /** Internal docs route (Link) or an absolute URL (new tab). */
+ href: string;
+ cta: string;
+}) {
+ const external = /^https?:\/\//.test(href);
+ const chips = tags.filter((tag): tag is string => Boolean(tag));
+
+ return (
+ <section aria-label={label} className={styles.featured}>
+ <p className={styles.label}>{label}</p>
+ <div className={styles.card}>
+ <div className={styles.copy}>
+ {author && <p className={styles.author}>{author}</p>}
+ <h2 className={styles.title}>{title}</h2>
+ {description && <p className={styles.description}>{description}</p>}
+ {chips.length > 0 && (
+ <div className={styles.tags}>
+ {chips.map((tag) => (
+ <span className={styles.tag} key={tag}>
+ {tag}
+ </span>
+ ))}
+ </div>
+ )}
+ </div>
+ {external ? (
+ <a className={styles.cta} href={href} rel="noopener noreferrer" target="_blank">
+ {cta} ↗
+ </a>
+ ) : (
+ <Link className={styles.cta} to={href}>
+ {cta} →
+ </Link>
+ )}
+ </div>
+ </section>
+ );
+}
diff --git a/website/src/components/CatalogFeatured/styles.module.css b/website/src/components/CatalogFeatured/styles.module.css
new file mode 100644
index 00000000000..c9c0bc98d5b
--- /dev/null
+++ b/website/src/components/CatalogFeatured/styles.module.css
@@ -0,0 +1,118 @@
+/* Mirrors the desktop app's featured card: one plain card, copy stacked on the
+ left, the action bottom-right, no artwork. Border and radius match the
+ catalog grid cards; a soft accent wash marks it as the featured pick. */
+.featured {
+ margin-bottom: 2rem;
+}
+
+/* The site's own eyebrow (see .heroEyebrow on /skills). */
+.label {
+ margin: 0 0 0.6rem;
+ font-family: "JetBrains Mono", monospace;
+ font-size: 0.72rem;
+ letter-spacing: 0.15em;
+ text-transform: uppercase;
+ color: var(--ifm-color-primary-darker);
+}
+
+[data-theme="dark"] .label {
+ color: rgba(255, 215, 0, 0.5);
+}
+
+.card {
+ display: flex;
+ align-items: flex-end;
+ justify-content: space-between;
+ gap: 1.5rem;
+ padding: 1.25rem 1.5rem;
+ border: 1px solid var(--ifm-color-emphasis-300);
+ border-radius: 10px;
+ background:
+ linear-gradient(135deg, color-mix(in srgb, var(--ifm-color-primary) 10%, transparent), transparent 65%),
+ var(--ifm-card-background-color, var(--ifm-background-surface-color));
+}
+
+[data-theme="dark"] .card {
+ border-color: rgba(255, 255, 255, 0.08);
+ background:
+ linear-gradient(135deg, color-mix(in srgb, var(--ifm-color-primary) 12%, transparent), transparent 65%),
+ #0c0c16;
+}
+
+.copy {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ min-width: 0;
+}
+
+.author {
+ margin: 0;
+ font-size: 0.8rem;
+ color: var(--ifm-color-emphasis-700);
+}
+
+.title {
+ margin: 0.25rem 0 0;
+ font-size: 1.75rem;
+ line-height: 1.15;
+ letter-spacing: -0.02em;
+}
+
+.description {
+ margin: 0;
+ max-width: 42rem;
+ font-size: 0.9rem;
+ /* Same muted tone as the grid cards' description. */
+ color: var(--ifm-font-color-secondary, #9a968e);
+ line-height: 1.55;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+}
+
+.tags {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.3rem;
+ margin-top: 0.25rem;
+}
+
+.tag {
+ padding: 0.12rem 0.5rem;
+ border: 1px solid var(--ifm-color-emphasis-300);
+ border-radius: 999px;
+ font-size: 0.72rem;
+ color: var(--ifm-color-emphasis-800);
+}
+
+/* Same outlined gold action as the grid cards' "Install in Hermes". */
+.cta {
+ flex: none;
+ padding: 0.45rem 0.9rem;
+ border: 1px solid var(--ifm-color-primary);
+ border-radius: 8px;
+ font-size: 0.85rem;
+ font-weight: 600;
+ white-space: nowrap;
+ color: var(--ifm-color-primary);
+ transition: background 0.15s ease, color 0.15s ease;
+}
+
+.cta:hover,
+.cta:focus-visible {
+ background: var(--ifm-color-primary);
+ /* --ifm-background-color is transparent in light mode, so name the ink. */
+ color: var(--ifm-color-emphasis-0, #f7f8fa);
+ text-decoration: none;
+ /* Hover paints instantly; only the return eases. */
+ transition: none;
+}
+
+@media (max-width: 640px) {
+ .card {
+ flex-direction: column;
+ align-items: flex-start;
+ }
+}
diff --git a/website/src/components/PluginCatalog/catalog.ts b/website/src/components/PluginCatalog/catalog.ts
index 8ee1d5b7482..27cad1fb16b 100644
--- a/website/src/components/PluginCatalog/catalog.ts
+++ b/website/src/components/PluginCatalog/catalog.ts
@@ -40,6 +40,8 @@ export interface CatalogPlugin {
/** ISO dates from git history (first listing / last re-pin); present once the dates extractor runs. */
addedAt?: string | null;
updatedAt?: string | null;
+ /** 1-based curated hero rank from catalog-curation.json; absent when uncurated. */
+ featured?: number | null;
/** Lowercase pre-joined haystack for the search filter (built at load). */
_search?: string;
}
diff --git a/website/src/pages/plugins/index.tsx b/website/src/pages/plugins/index.tsx
index 6c482cfd32b..e67a657a96d 100644
--- a/website/src/pages/plugins/index.tsx
+++ b/website/src/pages/plugins/index.tsx
@@ -25,6 +25,9 @@ import {
tierOf,
} from "../../components/PluginCatalog/catalog";
import CopyButton from "../../components/PluginCatalog/CopyButton";
+import CatalogFeatured from "../../components/CatalogFeatured";
+import { groupCatalogPlugins, sortCatalogPlugins } from "../../../../apps/shared/src/catalog-browse";
+import { pickFeatured } from "../../../../apps/shared/src/catalog-featured";
// Routes Docusaurus serves the static API JSON from. `baseUrl` is `/docs/`,
// `static/api/` ends up at `/docs/api/` — same pattern as the Skills Hub.
@@ -45,17 +48,8 @@ const SORT_OPTIONS: { key: SortKey; label: string; title: string }[] = [
{ key: "updated", label: "Recently updated", title: "Most recently re-pinned or edited first" },
];
-function dateMs(iso?: string | null): number {
- const t = iso ? new Date(iso).getTime() : NaN;
- return Number.isFinite(t) ? t : -Infinity;
-}
-
function sortPlugins(list: CatalogPlugin[], sort: SortKey): CatalogPlugin[] {
- if (sort === "stars") return list;
- const field = sort === "newest" ? "addedAt" : "updatedAt";
- return [...list].sort(
- (a, b) => dateMs(b[field]) - dateMs(a[field]) || a.name.localeCompare(b.name),
- );
+ return sortCatalogPlugins(list, sort);
}
function highlightMatch(text: string, query: string): React.ReactNode {
@@ -494,14 +488,23 @@ export default function PluginCatalogPage() {
// than one undifferentiated wall. Filtering or searching flattens to a grid.
const grouped = useMemo(() => {
if (search.trim() || categoryFilter !== "all") return null;
- const buckets = new Map<string, CatalogPlugin[]>();
- for (const p of filtered) {
- const key = CATEGORY_CONFIG[p.category] ? p.category : "general";
- (buckets.get(key) ?? buckets.set(key, []).get(key)!).push(p);
- }
- return CATEGORY_ORDER.filter((c) => buckets.has(c)).map((c) => [c, buckets.get(c)!] as const);
+ return groupCatalogPlugins(filtered);
}, [filtered, search, categoryFilter]);
+ // Same pick as the desktop app (apps/shared pickFeatured): curated ranks from
+ // catalog-curation.json, rotated weekly, shown only while browsing everything.
+ const featured = useMemo(
+ () =>
+ pickFeatured(allPlugins, (p) => ({
+ featured: p.featured,
+ official: p.tier === "official",
+ pictured: Boolean(p.image),
+ addedAt: p.addedAt,
+ stars: p.stars,
+ })),
+ [allPlugins],
+ );
+
const categoryCounts = useMemo(() => {
const counts: Record<string, number> = {};
for (const p of allPlugins) {
@@ -787,7 +790,23 @@ export default function PluginCatalogPage() {
</div>
</div>
) : filtered.length > 0 && grouped ? (
- grouped.map(([cat, plugins]) => {
+ <>
+ {featured && tierFilter === "all" && !pickerMode && (
+ <CatalogFeatured
+ author={featured.maintainer}
+ cta="View plugin"
+ description={featured.description}
+ href={pluginPagePath(featured.name)}
+ label="Featured plugin"
+ tags={[
+ tierOf(featured).label,
+ categoryOf(featured).label,
+ featured.version && `v${featured.version}`,
+ ]}
+ title={featured.name}
+ />
+ )}
+ {grouped.map(([cat, plugins]) => {
const conf = CATEGORY_CONFIG[cat];
return (
<section key={cat} className={styles.categorySection} aria-labelledby={`cat-${cat}`}>
@@ -806,7 +825,8 @@ export default function PluginCatalogPage() {
</div>
</section>
);
- })
+ })}
+ </>
) : filtered.length > 0 ? (
<>
<div className={styles.resultsBar} role="status">
diff --git a/website/src/pages/skills/index.tsx b/website/src/pages/skills/index.tsx
index fbe0f4f8b4c..8dc7f8d8a52 100644
--- a/website/src/pages/skills/index.tsx
+++ b/website/src/pages/skills/index.tsx
@@ -2,6 +2,8 @@ import React, { useState, useMemo, useCallback, useRef, useEffect } from "react"
import Layout from "@theme/Layout";
import Link from "@docusaurus/Link";
import styles from "./styles.module.css";
+import CatalogFeatured from "../../components/CatalogFeatured";
+import { pickFeatured } from "../../../../apps/shared/src/catalog-featured";
import { skillCatalogInstallIdentifier, skillCatalogInstallUrl } from "../../../../apps/shared/src/catalog-install";
interface Skill {
@@ -9,6 +11,8 @@ interface Skill {
description: string;
overview?: string;
image?: string;
+ /** 1-based curated hero rank from catalog-curation.json; absent when uncurated. */
+ featured?: number;
category: string;
categoryLabel: string;
source: string;
@@ -791,6 +795,19 @@ export default function SkillsDashboard() {
const visible = filtered.slice(0, visibleCount);
const hasMore = visibleCount < filtered.length;
+ // Same pick as the desktop app (apps/shared pickFeatured): curated ranks from
+ // catalog-curation.json, rotated weekly, shown only while browsing everything.
+ const featured = useMemo(
+ () =>
+ pickFeatured(allSkillsLocal, (s) => ({
+ featured: s.featured,
+ official: s.source === "built-in" || s.source === "optional",
+ pictured: Boolean(s.image),
+ })),
+ [allSkillsLocal],
+ );
+ const browsing = !search && sourceFilter === "all" && categoryFilter === "all" && !pickerMode;
+
const handleSourceChange = useCallback(
(src: string) => {
setSourceFilter(src);
@@ -1106,6 +1123,21 @@ export default function SkillsDashboard() {
</div>
) : visible.length > 0 ? (
<>
+ {featured && browsing && (
+ <CatalogFeatured
+ author={featured.author}
+ cta="View skill"
+ description={featured.description}
+ href={featured.docsPath ? `/user-guide/skills/${featured.docsPath}` : featured.sourceUrl || "#"}
+ label="Featured skill"
+ tags={[
+ SOURCE_CONFIG[featured.source]?.label || featured.source,
+ featured.categoryLabel,
+ featured.version && `v${featured.version}`,
+ ]}
+ title={featured.name}
+ />
+ )}
<div className={styles.grid}>
{visible.map((skill, i) => {
const key = `${skill.source}-${skill.name}-${i}`;