Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(platform): keep acronym casing in marketplace skill titles (#14631)

Reinier van der Leercda8bad9ecd4
diff --git a/autogpt_platform/backend/backend/api/features/experts/experts_db.py b/autogpt_platform/backend/backend/api/features/experts/experts_db.py
index db2a2ec52b..b7bdfd18bc 100644
--- a/autogpt_platform/backend/backend/api/features/experts/experts_db.py
+++ b/autogpt_platform/backend/backend/api/features/experts/experts_db.py
@@ -343,7 +343,7 @@ async def _live_bundled_skills(
ExpertBundledSkill(
id=row.skillListingId,
slug=skill.slug,
- name=skill.name,
+ title=skill.title,
description=skill.description,
)
for row in rows
diff --git a/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py b/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py
index 8ac4b61065..36b658c2f9 100644
--- a/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py
+++ b/autogpt_platform/backend/backend/api/features/experts/experts_db_test.py
@@ -476,10 +476,12 @@ async def test_templates_resolve_bundled_skills_by_listing_id_in_roster_order(
)
assert [skill.id for skill in linked.bundled_skills] == [first.id, hub_listing.id]
+ # The title is the body's heading — `_make_listing` writes "# body" — and
+ # never the version's `name`, which is a slug.
assert linked.bundled_skills[1] == ExpertBundledSkill(
id=hub_listing.id,
slug=hub_listing.slug,
- name=hub_listing.slug.replace("-", " ").title(),
+ title="body",
description=f"{hub_listing.slug} description",
)
assert unlinked.bundled_skills == []
diff --git a/autogpt_platform/backend/backend/api/features/experts/models.py b/autogpt_platform/backend/backend/api/features/experts/models.py
index 30ced4882b..d1a472cc8c 100644
--- a/autogpt_platform/backend/backend/api/features/experts/models.py
+++ b/autogpt_platform/backend/backend/api/features/experts/models.py
@@ -246,7 +246,7 @@ class ExpertBundledSkill(BaseModel):
id: str
slug: str
- name: str
+ title: str
description: str
diff --git a/autogpt_platform/backend/backend/api/features/experts/routes_test.py b/autogpt_platform/backend/backend/api/features/experts/routes_test.py
index 4218f08b95..4acfe445b9 100644
--- a/autogpt_platform/backend/backend/api/features/experts/routes_test.py
+++ b/autogpt_platform/backend/backend/api/features/experts/routes_test.py
@@ -200,7 +200,7 @@ def test_list_expert_templates_links_live_hub_skills(
{
"id": "listing-1",
"slug": "brand-voice-guide",
- "name": "brand-voice-guide",
+ "title": "Brand voice guide",
"description": "Keeps every draft on-brand.",
}
]
@@ -249,6 +249,7 @@ def _mock_templates_with_hub_skill(
"listing-1": MarketplaceSkill(
slug="brand-voice-guide",
name="brand-voice-guide",
+ title="Brand voice guide",
description="Keeps every draft on-brand.",
categories=[],
required_providers=[],
diff --git a/autogpt_platform/backend/backend/api/features/store/skill_model.py b/autogpt_platform/backend/backend/api/features/store/skill_model.py
index 033b47c601..7901b8b512 100644
--- a/autogpt_platform/backend/backend/api/features/store/skill_model.py
+++ b/autogpt_platform/backend/backend/api/features/store/skill_model.py
@@ -3,11 +3,12 @@
A skill listing publishes a ``SKILL.md`` — instructions and examples the
copilot reads — and the files beside it, rather than a runnable graph. The
listing's ``slug`` is both its marketplace URL segment and the name the skill
-takes once installed, so the two can never drift; ``name`` is the human title
-shown on the card.
+takes once installed, so the two can never drift. ``name`` is that slug again,
+never a display string: the title on the card is :func:`skill_title`.
"""
import datetime
+import re
import prisma.enums
import prisma.models
@@ -21,6 +22,7 @@ from .categories import validate_canonical_categories
class MarketplaceSkill(pydantic.BaseModel):
slug: str
name: str
+ title: str
description: str
categories: list[str]
required_providers: list[str]
@@ -35,6 +37,7 @@ class MarketplaceSkill(pydantic.BaseModel):
return cls(
slug=listing.slug,
name=version.name,
+ title=skill_title(version.name, version.body),
description=version.description,
categories=list(version.categories),
required_providers=list(version.requiredProviders),
@@ -98,6 +101,28 @@ class InstalledSkill(pydantic.BaseModel):
)
+# A body's title is its first heading, so anything before one rules it out.
+# ATX rules: horizontal space after the `#`, and a trailing run of `#` is a
+# closing marker rather than part of the title.
+_TITLE_HEADING_RE = re.compile(
+ r"\s*#[ \t]+(\S(?:.*?\S)?)(?:[ \t]+#+)?[ \t]*(?:\r?\n|$)"
+)
+
+
+def skill_title(name: str, body: str) -> str:
+ """The listing's display title: the author's own H1.
+
+ A skill's ``name`` is a slug, so deriving a title from it destroys the
+ author's casing — "seo-content-brief" reads back as "Seo content brief".
+ The humanised slug is only the fallback for a body that opens with prose.
+ """
+ heading = _TITLE_HEADING_RE.match(body)
+ if heading:
+ return heading.group(1)
+ words = re.sub(r"[-_]+", " ", name).strip()
+ return words[:1].upper() + words[1:] if words else name
+
+
def active_version(
listing: prisma.models.SkillListing,
) -> prisma.models.SkillListingVersion:
diff --git a/autogpt_platform/backend/backend/api/features/store/skill_model_test.py b/autogpt_platform/backend/backend/api/features/store/skill_model_test.py
new file mode 100644
index 0000000000..e562b38769
--- /dev/null
+++ b/autogpt_platform/backend/backend/api/features/store/skill_model_test.py
@@ -0,0 +1,47 @@
+"""Tests for the display title a listing shows on the marketplace."""
+
+import pytest
+
+from backend.api.features.store.skill_model import skill_title
+
+
+ ("name", "body", "expected"),
+ [
+ (
+ "seo-content-brief",
+ "# SEO content brief\n\nUse this.\n",
+ "SEO content brief",
+ ),
+ ("on-page-seo-audit", "# On-page SEO audit\n", "On-page SEO audit"),
+ # A closed ATX heading: the trailing run is a marker, not the title.
+ ("seo-playbook", "# SEO Playbook #\n", "SEO Playbook"),
+ ("seo-playbook", "# SEO Playbook ###\r\n", "SEO Playbook"),
+ (
+ "icp-and-positioning",
+ "\n\n# ICP and positioning \n",
+ "ICP and positioning",
+ ),
+ ],
+)
+def test_the_authors_heading_is_the_title_acronyms_and_all(name, body, expected):
+ assert skill_title(name, body) == expected
+
+
+ ("name", "body"),
+ [
+ ("brand-voice-guide", "Start with the voice, not the words.\n\n# Later\n"),
+ ("brand-voice-guide", "## Not the top heading\n"),
+ ("brand-voice-guide", "#no-space-is-not-a-heading\n"),
+ # `#` alone is an empty heading; the line under it is a paragraph.
+ ("brand-voice-guide", "#\nBrand voice, not a heading\n"),
+ ("brand_voice_guide", ""),
+ ],
+)
+def test_a_body_that_does_not_open_with_a_heading_falls_back_to_the_slug(name, body):
+ assert skill_title(name, body) == "Brand voice guide"
+
+
+def test_a_nameless_listing_keeps_its_name_rather_than_rendering_empty():
+ assert skill_title("", "") == ""
diff --git a/autogpt_platform/backend/backend/api/features/store/skill_seed_test.py b/autogpt_platform/backend/backend/api/features/store/skill_seed_test.py
index 4fc2ac02d9..117f85dade 100644
--- a/autogpt_platform/backend/backend/api/features/store/skill_seed_test.py
+++ b/autogpt_platform/backend/backend/api/features/store/skill_seed_test.py
@@ -5,6 +5,7 @@ import pathlib
import pytest
+from backend.api.features.store.skill_model import skill_title
from backend.api.features.store.skill_seed import STARTER_SKILLS, _load
from backend.copilot.tools.skills import SkillPackageError
@@ -72,3 +73,19 @@ def test_every_shipped_starter_still_loads(entry):
parsed, files = _load(entry["slug"])
assert parsed.name == entry["slug"]
assert files == []
+
+
+ ("slug", "title"),
+ [
+ ("seo-content-brief", "SEO content brief"),
+ ("on-page-seo-audit", "On-page SEO audit"),
+ ("icp-and-positioning", "ICP and positioning"),
+ ("brand-voice-guide", "Brand voice guide"),
+ ],
+)
+def test_a_shipped_starter_keeps_the_casing_its_author_wrote(slug, title):
+ """A starter's frontmatter name is its slug, so a title derived from it
+ reads back as "Seo content brief"."""
+ parsed, _ = _load(slug)
+ assert skill_title(parsed.name, parsed.body) == title
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-section.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-section.test.tsx
index 7b692687fa..4e72367153 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-section.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/experts-section.test.tsx
@@ -196,7 +196,7 @@ describe("Marketplace ExpertsSection", () => {
{
id: "listing-1",
slug: "brand-voice-guide",
- name: "brand-voice-guide",
+ title: "Brand voice guide",
description: "Keeps every draft on-brand.",
},
],
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/skills-section.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/skills-section.test.tsx
index 663b3fd688..6127203581 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/skills-section.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/skills-section.test.tsx
@@ -71,6 +71,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
const brandVoice: MarketplaceSkill = {
slug: "brand-voice-guide",
name: "brand-voice-guide",
+ title: "Brand voice guide",
description: "Write in a consistent brand voice.",
categories: ["content"],
required_providers: [],
@@ -83,10 +84,19 @@ const outreach: MarketplaceSkill = {
...brandVoice,
slug: "outreach-playbook",
name: "outreach-playbook",
+ title: "Outreach playbook",
categories: ["sales"],
required_providers: ["google"],
};
+const seoAudit: MarketplaceSkill = {
+ ...brandVoice,
+ slug: "on-page-seo-audit",
+ name: "on-page-seo-audit",
+ title: "On-page SEO audit",
+ categories: ["marketing"],
+};
+
const CATEGORIES = [
{ value: "sales", label: "Sales", description: "Leads and outreach" },
{ value: "content", label: "Content", description: "Writing and editing" },
@@ -118,6 +128,17 @@ describe("Marketplace SkillsSection", () => {
);
});
+ test("shows a skill's title as its author cased it, acronyms intact", async () => {
+ server.use(listing([seoAudit]));
+
+ render(<MainMarkeplacePage />);
+
+ expect(
+ await screen.findByRole("link", { name: /On-page SEO audit/ }),
+ ).toBeDefined();
+ expect(screen.queryByText("On page seo audit")).toBeNull();
+ });
+
test("shows skills as their own shelf, linked to the skill page", async () => {
server.use(listing([brandVoice]));
@@ -132,7 +153,6 @@ describe("Marketplace SkillsSection", () => {
},
),
).toBeDefined();
- // The API returns the frontmatter name, which the seed pins to the slug.
const card = await screen.findByRole("link", { name: /Brand voice guide/ });
expect(card.getAttribute("href")).toBe(
"/marketplace/skills/brand-voice-guide",
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/components/ExpertCard.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/components/ExpertCard.tsx
index 766058d79b..37107d03d0 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/components/ExpertCard.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/components/ExpertCard.tsx
@@ -8,7 +8,6 @@ import { cn } from "@/lib/utils";
import { getExpertRoleLabel } from "@/services/experts/expert-role-label";
import Link from "next/link";
import { getExpertAccent } from "../helpers";
-import { formatSkillTitle } from "../../SkillsSection/helpers";
import {
ArrowRight02Icon,
CheckmarkCircle02Icon,
@@ -79,7 +78,7 @@ export function ExpertCard({ expert, isHired }: Props) {
key={skill.id}
className="rounded-full bg-zinc-50 px-2.5 py-1 text-xs font-medium text-zinc-500 ring-1 ring-inset ring-zinc-200/80"
>
- {formatSkillTitle(skill.name)}
+ {skill.title}
</span>
))}
{skills.length > 3 ? (
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/components/SkillCard.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/components/SkillCard.tsx
index eabf9fa997..21c204c5db 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/components/SkillCard.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/components/SkillCard.tsx
@@ -16,7 +16,7 @@ import {
} from "@hugeicons/core-free-icons";
import Link from "next/link";
import { getCategoryAccent } from "../../ExpertsSection/helpers";
-import { formatSkillTitle } from "../helpers";
+import { formatCategoryLabel } from "../helpers";
interface Props {
skill: MarketplaceSkill;
@@ -25,7 +25,7 @@ interface Props {
export function SkillCard({ skill, isInstalled }: Props) {
const { accent, icon } = getCategoryAccent(skill.categories[0]);
- const title = formatSkillTitle(skill.name);
+ const title = skill.title;
const providers = skill.required_providers;
return (
@@ -58,7 +58,7 @@ export function SkillCard({ skill, isInstalled }: Props) {
)}
>
<Icon icon={icon} size={14} aria-hidden />
- {formatSkillTitle(skill.categories[0])}
+ {formatCategoryLabel(skill.categories[0])}
</span>
) : null}
</div>
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/helpers.ts
index 00aea47c68..36a6db864a 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/helpers.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/helpers.ts
@@ -4,11 +4,10 @@ export const SHELF_SIZE = 4;
/** One page of the browse-all grid. */
export const BROWSE_PAGE_SIZE = 20;
-/** The API returns a skill's frontmatter name, which the seed pins to the slug
- * (`skill_seed.py`), so production has "outreach-playbook" where a title
- * belongs. Humanise it until the model carries a display title. */
-export function formatSkillTitle(name: string): string {
- const words = name.replace(/[-_]+/g, " ").trim();
- if (!words) return name;
+/** Categories are stored as slugs ("content", "lead-gen"); a skill's own title
+ * is not, and comes off the API as `title`. */
+export function formatCategoryLabel(category: string): string {
+ const words = category.replace(/[-_]+/g, " ").trim();
+ if (!words) return category;
return words.charAt(0).toUpperCase() + words.slice(1);
}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertSkills.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertSkills.tsx
index a8a46f46ea..f096a67071 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertSkills.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertSkills.tsx
@@ -2,7 +2,6 @@ import type { ExpertBundledSkill } from "@/app/api/__generated__/models/expertBu
import { Icon } from "@/components/atoms/Icon/Icon";
import { BookOpen01Icon } from "@hugeicons/core-free-icons";
import type { ExpertAccent } from "../../../components/ExpertsSection/helpers";
-import { formatSkillTitle } from "../../../components/SkillsSection/helpers";
import { ExpertPill } from "./ExpertPill";
import { ExpertSection } from "./ExpertSection";
@@ -23,7 +22,7 @@ export function ExpertSkills({ skills, accent }: Props) {
icon={
<Icon icon={BookOpen01Icon} size={16} className={accent.icon} />
}
- label={formatSkillTitle(skill.name)}
+ label={skill.title}
href={`/marketplace/skills/${skill.slug}`}
/>
))}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/__tests__/expert-page.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/__tests__/expert-page.test.tsx
index b13d71b566..3c19e012eb 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/__tests__/expert-page.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/__tests__/expert-page.test.tsx
@@ -239,7 +239,7 @@ describe("Marketplace expert page", () => {
{
id: "listing-1",
slug: "brand-voice-guide",
- name: "brand-voice-guide",
+ title: "Brand voice guide",
description: "Keeps every draft on-brand.",
},
],
@@ -259,6 +259,32 @@ describe("Marketplace expert page", () => {
expect(screen.queryByText("Positioning")).toBeNull();
});
+ test("shows a bundled skill's title as its author cased it, acronyms intact", async () => {
+ server.use(
+ getListExpertTemplatesMockHandler([
+ {
+ ...mariaTemplate,
+ bundled_skills: [
+ {
+ id: "listing-1",
+ slug: "seo-content-brief",
+ title: "SEO content brief",
+ description: "Turn a keyword into a brief a writer can use.",
+ },
+ ],
+ },
+ ]),
+ getListExpertsMockHandler([]),
+ );
+
+ renderPage();
+
+ expect(
+ await screen.findByRole("link", { name: "SEO content brief" }),
+ ).toBeDefined();
+ expect(screen.queryByText("Seo content brief")).toBeNull();
+ });
+
test("shows no Skills section when a hire comes with no Hub skills", async () => {
server.use(
getListExpertTemplatesMockHandler([
@@ -337,7 +363,7 @@ describe("Marketplace expert page", () => {
{
id: "listing-1",
slug: "brand-voice-guide",
- name: "brand-voice-guide",
+ title: "Brand voice guide",
description: "Keeps every draft on-brand.",
},
],
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/__tests__/skills-in-search.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/__tests__/skills-in-search.test.tsx
index b89c7869b6..90d56b41dc 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/__tests__/skills-in-search.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/__tests__/skills-in-search.test.tsx
@@ -49,6 +49,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
const outreach: MarketplaceSkill = {
slug: "outreach-playbook",
name: "outreach-playbook",
+ title: "Outreach playbook",
description: "Run cold outreach that gets replies.",
categories: ["sales"],
required_providers: [],
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/install-to-expert.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/install-to-expert.test.tsx
index 2fcd530ae6..4b16243a8d 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/install-to-expert.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/install-to-expert.test.tsx
@@ -44,7 +44,8 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
const outreach: MarketplaceSkillDetails = {
slug: "outreach-playbook",
- name: "Outreach playbook",
+ name: "outreach-playbook",
+ title: "Outreach playbook",
description: "Run cold outreach that gets replies.",
categories: ["sales"],
required_providers: [],
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/main.test.tsx
index 72f783cb5e..30db260d33 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/main.test.tsx
@@ -55,7 +55,8 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
const outreach: MarketplaceSkillDetails = {
slug: "outreach-playbook",
- name: "Outreach playbook",
+ name: "outreach-playbook",
+ title: "Outreach playbook",
description: "Run cold outreach that gets replies.",
categories: ["sales"],
required_providers: ["google"],
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/package-contents.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/package-contents.test.tsx
index 7cf821cb42..c2fc3b837f 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/package-contents.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/package-contents.test.tsx
@@ -211,6 +211,7 @@ function detail(overrides: Partial<MarketplaceSkillDetails>) {
return getGetV2GetMarketplaceSkillMockHandler200({
slug: SLUG,
name: SLUG,
+ title: "Webapp testing",
description: "Test a web app end to end.",
categories: ["development"],
required_providers: [],
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/page.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/page.test.tsx
index c5ec5a430c..2fce1f04f1 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/page.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/page.test.tsx
@@ -13,7 +13,8 @@ vi.mock("next/navigation", () => ({
const outreach = {
slug: "outreach-playbook",
- name: "Outreach playbook",
+ name: "outreach-playbook",
+ title: "Outreach playbook",
description: "Run cold outreach that gets replies.",
categories: ["sales"],
required_providers: ["google"],
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillPage.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillPage.tsx
index 64495c3190..2317718b77 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillPage.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillPage.tsx
@@ -18,7 +18,7 @@ import Link from "next/link";
import { notFound } from "next/navigation";
import { getCategoryAccent } from "../../../components/ExpertsSection/helpers";
import { SkillCard } from "../../../components/SkillsSection/components/SkillCard";
-import { formatSkillTitle } from "../../../components/SkillsSection/helpers";
+import { formatCategoryLabel } from "../../../components/SkillsSection/helpers";
import { ExpertSection } from "../../../experts/[expertId]/components/ExpertSection";
import { SkillFileViewer } from "@/components/contextual/SkillPackage/SkillFileViewer";
import { SkillPackageFileList } from "@/components/contextual/SkillPackage/SkillPackageFileList";
@@ -84,7 +84,7 @@ export function SkillPage({ slug }: Props) {
);
}
- const title = formatSkillTitle(skill.name);
+ const title = skill.title;
const { accent, icon } = getCategoryAccent(skill.categories[0]);
const providers = skill.required_providers;
@@ -114,7 +114,7 @@ export function SkillPage({ slug }: Props) {
)}
>
<Icon icon={icon} size={12} aria-hidden />
- {formatSkillTitle(skill.categories[0])}
+ {formatCategoryLabel(skill.categories[0])}
</span>
) : null}
</div>
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/page.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/page.tsx
index 9612e2eb07..8950e43d79 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/page.tsx
@@ -3,7 +3,6 @@ import {
prefetchGetV2GetMarketplaceSkillQuery,
prefetchGetV2ListMarketplaceSkillsQuery,
} from "@/app/api/__generated__/endpoints/store/store";
-import { formatSkillTitle } from "../../components/SkillsSection/helpers";
import type { MarketplaceSkillDetails } from "@/app/api/__generated__/models/marketplaceSkillDetails";
import { getQueryClient } from "@/lib/react-query/queryClient";
import { dehydrate, HydrationBoundary } from "@tanstack/react-query";
@@ -26,7 +25,7 @@ export async function generateMetadata({
const { data } = await getV2GetMarketplaceSkill(slug);
const skill = data as MarketplaceSkillDetails;
return {
- title: `${formatSkillTitle(skill.name)} - AutoGPT Marketplace`,
+ title: `${skill.title} - AutoGPT Marketplace`,
description: skill.description,
};
} catch {
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/__tests__/browse.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/__tests__/browse.test.tsx
index ad9d8776e2..585a160a34 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/__tests__/browse.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/__tests__/browse.test.tsx
@@ -55,6 +55,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
const brandVoice: MarketplaceSkill = {
slug: "brand-voice-guide",
name: "brand-voice-guide",
+ title: "Brand voice guide",
description: "Write in a consistent brand voice.",
categories: ["content"],
required_providers: [],
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/main.test.tsx
index 865f666a49..b9ff1ba095 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/__tests__/main.test.tsx
@@ -405,7 +405,8 @@ test("keeps the skills beat when only the Hub has something to offer", async ()
hubSkills([
{
slug: "cold-outreach",
- name: "Cold Outreach",
+ name: "cold-outreach",
+ title: "Cold Outreach",
description: "Write cold emails",
categories: ["sales"],
required_providers: [],
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/components/KitStep/helpers.test.ts b/autogpt_platform/frontend/src/app/(platform)/raise/components/KitStep/helpers.test.ts
index 448a71e153..a093c1fc96 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/components/KitStep/helpers.test.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/components/KitStep/helpers.test.ts
@@ -27,9 +27,10 @@ const storeAgent = {
const marketplaceSkill: MarketplaceSkill = {
slug: "seo-playbook",
- // Deliberately unlike the slug: a listing's version name is its SKILL.md
- // frontmatter name, and only the slug addresses the listing.
- name: "SEO Playbook",
+ name: "seo-playbook",
+ // An acronym only survives because the API sends the author's own title;
+ // deriving one from the slug would read "Seo playbook".
+ title: "SEO Playbook",
description: "An SEO playbook",
categories: ["content"],
required_providers: [],
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/components/KitStep/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/raise/components/KitStep/helpers.ts
index c46201dad3..e2790438ee 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/components/KitStep/helpers.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/components/KitStep/helpers.ts
@@ -4,7 +4,6 @@ import type { MarketplaceSkill } from "@/app/api/__generated__/models/marketplac
import type { RaiseAttachment } from "@/app/api/__generated__/models/raiseAttachment";
import type { StoreAgent } from "@/app/api/__generated__/models/storeAgent";
import { parseUsdToCredits } from "@/lib/credits";
-import { formatSkillTitle } from "../../../marketplace/components/SkillsSection/helpers";
import type { RaiseAttachmentDraft } from "../../helpers";
export const MAX_ATTACHMENTS = 20;
@@ -212,7 +211,7 @@ function marketplaceWorkflowHit(agent: StoreAgent): SearchHit {
function marketplaceSkillHit(skill: MarketplaceSkill): SearchHit {
return {
key: `marketplace:skill:${skill.slug}`,
- name: formatSkillTitle(skill.name),
+ name: skill.title,
subtitle: "Marketplace skill",
kind: "skill",
source: "marketplace",
diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/components/SkillsStep/SkillsStep.test.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/components/SkillsStep/SkillsStep.test.tsx
index 033aed2e30..f1100b3764 100644
--- a/autogpt_platform/frontend/src/app/(platform)/raise/components/SkillsStep/SkillsStep.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/raise/components/SkillsStep/SkillsStep.test.tsx
@@ -45,6 +45,7 @@ const storeAgent = {
const outreach: MarketplaceSkill = {
slug: "outreach-playbook",
name: "outreach-playbook",
+ title: "Outreach playbook",
description: "Cold outreach that lands",
categories: ["sales"],
required_providers: [],
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx
index 4ba9fd1842..d76edcf218 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/__tests__/main.test.tsx
@@ -734,7 +734,8 @@ describe("ExpertDetailPage", () => {
skills: [
{
slug: "seo-audit",
- name: "SEO audit",
+ name: "seo-audit",
+ title: "SEO audit",
description: "Audit any page for SEO gaps",
categories: ["marketing"],
required_providers: [],
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/AddSkillDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/AddSkillDialog.tsx
index a3b8e37984..782c89900e 100644
--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/AddSkillDialog.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/AddSkillDialog.tsx
@@ -175,7 +175,7 @@ export function AddSkillDialog({
{marketplaceSkills.map((skill) => (
<SkillOption
key={skill.slug}
- name={skill.name}
+ name={skill.title}
description={skill.description}
icon={Store01Icon}
disabled={isSaving}
diff --git a/autogpt_platform/frontend/src/app/api/openapi.json b/autogpt_platform/frontend/src/app/api/openapi.json
index f9093fae72..6231c622cc 100644
--- a/autogpt_platform/frontend/src/app/api/openapi.json
+++ b/autogpt_platform/frontend/src/app/api/openapi.json
@@ -21532,11 +21532,11 @@
"properties": {
"id": { "type": "string", "title": "Id" },
"slug": { "type": "string", "title": "Slug" },
- "name": { "type": "string", "title": "Name" },
+ "title": { "type": "string", "title": "Title" },
"description": { "type": "string", "title": "Description" }
},
"type": "object",
- "required": ["id", "slug", "name", "description"],
+ "required": ["id", "slug", "title", "description"],
"title": "ExpertBundledSkill",
"description": "A live Skills Hub listing a roster template comes with."
},
@@ -25061,6 +25061,7 @@
"properties": {
"slug": { "type": "string", "title": "Slug" },
"name": { "type": "string", "title": "Name" },
+ "title": { "type": "string", "title": "Title" },
"description": { "type": "string", "title": "Description" },
"categories": {
"items": { "type": "string" },
@@ -25086,6 +25087,7 @@
"required": [
"slug",
"name",
+ "title",
"description",
"categories",
"required_providers",
@@ -25097,6 +25099,7 @@
"properties": {
"slug": { "type": "string", "title": "Slug" },
"name": { "type": "string", "title": "Name" },
+ "title": { "type": "string", "title": "Title" },
"description": { "type": "string", "title": "Description" },
"categories": {
"items": { "type": "string" },
@@ -25143,6 +25146,7 @@
"required": [
"slug",
"name",
+ "title",
"description",
"categories",
"required_providers",