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.

feat(platform): list knowledge skills in the marketplace and install them to AutoPilot (#14431)

Reinier van der Leer658b63cb9655
diff --git a/autogpt_platform/backend/backend/api/features/store/skill_db.py b/autogpt_platform/backend/backend/api/features/store/skill_db.py
new file mode 100644
index 0000000000..d71081f9f1
--- /dev/null
+++ b/autogpt_platform/backend/backend/api/features/store/skill_db.py
@@ -0,0 +1,129 @@
+"""Database access for marketplace skill listings.
+
+Browse is rooted at :class:`SkillListingVersion` rather than the listing because
+every filter and the ordering read version columns; ``ActiveFor`` constrains the
+row to the listing's live version. Install count is displayed but is not a sort
+key — a catalogue this size gains nothing from it, and it lives on the listing
+because installs accumulate across versions. It counts distinct installers: a
+re-install overwrites the user's copy and is not counted again.
+"""
+
+import prisma.enums
+import prisma.models
+import prisma.types
+
+from backend.copilot.tools.skills import list_user_skills, store_user_skill
+from backend.util.exceptions import NotFoundError
+from backend.util.models import Pagination
+
+from . import skill_model
+from .categories import category_filter_values
+
+_LISTING_INCLUDE: prisma.types.SkillListingInclude = {
+ "ActiveVersion": True,
+ "CreatorProfile": True,
+}
+
+
+async def get_marketplace_skills(
+ *,
+ category: str | None = None,
+ search_query: str | None = None,
+ page: int = 1,
+ page_size: int = 20,
+) -> skill_model.MarketplaceSkillsResponse:
+ where = _live_version_where(category, search_query)
+ total = await prisma.models.SkillListingVersion.prisma().count(where=where)
+ versions = await prisma.models.SkillListingVersion.prisma().find_many(
+ where=where,
+ include={"ActiveFor": {"include": _LISTING_INCLUDE}},
+ # Seeded versions share a timestamp, and an undefined order between
+ # pages then drops or repeats a row; `id` is the uuid primary key.
+ order=[{"updatedAt": "desc"}, {"id": "desc"}],
+ skip=(page - 1) * page_size,
+ take=page_size,
+ )
+ listings = [v.ActiveFor for v in versions if v.ActiveFor is not None]
+ return skill_model.MarketplaceSkillsResponse(
+ skills=[skill_model.MarketplaceSkill.from_db(listing) for listing in listings],
+ pagination=Pagination(
+ total_items=total,
+ total_pages=(total + page_size - 1) // page_size,
+ current_page=page,
+ page_size=page_size,
+ ),
+ )
+
+
+async def get_marketplace_skill(slug: str) -> skill_model.MarketplaceSkillDetails:
+ listing = await _find_live_listing(slug)
+ return skill_model.MarketplaceSkillDetails.from_db(listing)
+
+
+async def install_marketplace_skill(
+ user_id: str, slug: str
+) -> skill_model.InstalledSkill:
+ """Copy a listing's SKILL.md into the caller's own skill library.
+
+ The listing's slug becomes the installed skill's name, so an install is
+ idempotent and a re-install picks up a newer approved version.
+ """
+ listing = await _find_live_listing(slug)
+ active = skill_model.active_version(listing)
+ # A re-install overwrites the user's existing copy, so counting it again
+ # would report installs rather than installers.
+ is_new = all(s.name != listing.slug for s in await list_user_skills(user_id))
+ # The one call site the expert-owned install passes `expert_id` through
+ # once #14414 lands; `store_user_skill` already takes it as a keyword.
+ await store_user_skill(
+ user_id,
+ name=listing.slug,
+ description=active.description,
+ body=active.body,
+ triggers=list(active.triggers),
+ version=str(active.version),
+ )
+ if is_new:
+ await prisma.models.SkillListing.prisma().update(
+ where={"id": listing.id}, data={"installCount": {"increment": 1}}
+ )
+ return skill_model.InstalledSkill(
+ name=listing.slug, required_providers=list(active.requiredProviders)
+ )
+
+
+async def _find_live_listing(slug: str) -> prisma.models.SkillListing:
+ listing = await prisma.models.SkillListing.prisma().find_first(
+ where={"slug": slug, "isDeleted": False, "hasApprovedVersion": True},
+ include=_LISTING_INCLUDE,
+ )
+ if listing is None or listing.ActiveVersion is None:
+ raise NotFoundError(f"Skill '{slug}' not found")
+ active = listing.ActiveVersion
+ if (
+ active.submissionStatus != prisma.enums.SubmissionStatus.APPROVED
+ or not active.isAvailable
+ or active.isDeleted
+ ):
+ raise NotFoundError(f"Skill '{slug}' not found")
+ return listing
+
+
+def _live_version_where(
+ category: str | None, search_query: str | None
+) -> prisma.types.SkillListingVersionWhereInput:
+ where: prisma.types.SkillListingVersionWhereInput = {
+ "submissionStatus": prisma.enums.SubmissionStatus.APPROVED,
+ "isAvailable": True,
+ "isDeleted": False,
+ "ActiveFor": {"is": {"isDeleted": False, "hasApprovedVersion": True}},
+ }
+ if category_values := category_filter_values(category):
+ where["categories"] = {"has_some": category_values}
+ if search_query and search_query.strip():
+ needle = search_query.strip()
+ where["OR"] = [
+ {"name": {"contains": needle, "mode": "insensitive"}},
+ {"description": {"contains": needle, "mode": "insensitive"}},
+ ]
+ return where
diff --git a/autogpt_platform/backend/backend/api/features/store/skill_db_test.py b/autogpt_platform/backend/backend/api/features/store/skill_db_test.py
new file mode 100644
index 0000000000..ee2ab03f3c
--- /dev/null
+++ b/autogpt_platform/backend/backend/api/features/store/skill_db_test.py
@@ -0,0 +1,240 @@
+import datetime
+from types import SimpleNamespace
+
+import prisma.enums
+import prisma.models
+import pytest
+
+from backend.util.exceptions import NotFoundError
+from backend.util.test import SpinTestServer
+
+from . import skill_db, skill_seed
+
+
+async def _make_listing(
+ slug: str,
+ *,
+ approved: bool = True,
+ has_approved_version: bool | None = None,
+ updated_at: datetime.datetime | None = None,
+ available: bool = True,
+ categories: list[str] | None = None,
+ body: str = "# body\n",
+) -> prisma.models.SkillListing:
+ listing = await prisma.models.SkillListing.prisma().create(
+ data={
+ "slug": slug,
+ "hasApprovedVersion": (
+ approved if has_approved_version is None else has_approved_version
+ ),
+ }
+ )
+ version = await prisma.models.SkillListingVersion.prisma().create(
+ data={
+ "skillListingId": listing.id,
+ "name": slug.replace("-", " ").title(),
+ "description": f"{slug} description",
+ "body": body,
+ "triggers": ["t1"],
+ "categories": categories or ["content"],
+ "requiredProviders": ["google"],
+ "isAvailable": available,
+ "submissionStatus": (
+ prisma.enums.SubmissionStatus.APPROVED
+ if approved
+ else prisma.enums.SubmissionStatus.PENDING
+ ),
+ }
+ )
+ if updated_at is not None:
+ await prisma.models.SkillListingVersion.prisma().update(
+ where={"id": version.id}, data={"updatedAt": updated_at}
+ )
+ updated = await prisma.models.SkillListing.prisma().update(
+ where={"id": listing.id},
+ data={"activeVersionId": version.id},
+ include={"ActiveVersion": True},
+ )
+ assert updated is not None
+ return updated
+
+
[email protected](autouse=True)
+async def clean_skill_listings(server: SpinTestServer):
+ await prisma.models.SkillListingVersion.prisma().delete_many()
+ await prisma.models.SkillListing.prisma().delete_many()
+ yield
+ await prisma.models.SkillListingVersion.prisma().delete_many()
+ await prisma.models.SkillListing.prisma().delete_many()
+
+
+async def test_browse_puts_the_most_recently_updated_first():
+ # Created oldest-first, so insertion order alone would fail this.
+ utc = datetime.timezone.utc
+ await _make_listing(
+ "older-one", updated_at=datetime.datetime(2026, 1, 1, tzinfo=utc)
+ )
+ await _make_listing(
+ "newer-one", updated_at=datetime.datetime(2026, 6, 1, tzinfo=utc)
+ )
+
+ result = await skill_db.get_marketplace_skills()
+
+ assert [s.slug for s in result.skills] == ["newer-one", "older-one"]
+ assert result.pagination.total_items == 2
+
+
+async def test_browse_hides_unapproved_and_unavailable_listings():
+ await _make_listing("live-one")
+ await _make_listing("pending-one", approved=False)
+ await _make_listing("withdrawn-one", available=False)
+
+ result = await skill_db.get_marketplace_skills()
+
+ assert [s.slug for s in result.skills] == ["live-one"]
+
+
+async def test_browse_hides_a_listing_whose_live_version_was_rejected():
+ """`hasApprovedVersion` means some version was approved once, not that the
+ active one still is — a version rejected on re-review must leave the shelf."""
+ await _make_listing("re-rejected-one", approved=False, has_approved_version=True)
+
+ result = await skill_db.get_marketplace_skills()
+
+ assert [s.slug for s in result.skills] == []
+
+
+async def test_browse_filters_by_category():
+ await _make_listing("sales-one", categories=["sales"])
+ await _make_listing("content-one", categories=["content"])
+
+ result = await skill_db.get_marketplace_skills(category="sales")
+
+ assert [s.slug for s in result.skills] == ["sales-one"]
+
+
+async def test_browse_matches_a_legacy_category_alias():
+ """`writing` folds onto `content`, so a filter finds it before the backfill."""
+ await _make_listing("legacy-one", categories=["writing"])
+
+ result = await skill_db.get_marketplace_skills(category="content")
+
+ assert [s.slug for s in result.skills] == ["legacy-one"]
+
+
+async def test_detail_carries_the_body_and_providers():
+ await _make_listing("detail-one", body="# how to\nsteps\n")
+
+ detail = await skill_db.get_marketplace_skill("detail-one")
+
+ assert detail.body == "# how to\nsteps\n"
+ assert detail.required_providers == ["google"]
+ assert detail.triggers == ["t1"]
+
+
+# Two ways a listing can be off the shelf: never approved (the listing flag is
+# false) and approved once but rejected on re-review (the flag stays true and
+# only the live version's status says so).
+OFF_SHELF = [
+ pytest.param(False, id="never-approved"),
+ pytest.param(True, id="live-version-rejected"),
+]
+
+
[email protected]("has_approved_version", OFF_SHELF)
+async def test_detail_of_an_off_shelf_listing_is_not_found(has_approved_version: bool):
+ await _make_listing(
+ "off-shelf-one", approved=False, has_approved_version=has_approved_version
+ )
+
+ with pytest.raises(NotFoundError):
+ await skill_db.get_marketplace_skill("off-shelf-one")
+
+
+async def test_install_stores_under_the_listing_slug_and_counts(mocker):
+ listing = await _make_listing("install-one", body="# do this\n")
+ stored = mocker.patch.object(skill_db, "store_user_skill")
+ mocker.patch.object(skill_db, "list_user_skills", return_value=[])
+
+ result = await skill_db.install_marketplace_skill("user-1", "install-one")
+
+ stored.assert_awaited_once()
+ assert stored.await_args.kwargs["name"] == "install-one"
+ assert stored.await_args.kwargs["body"] == "# do this\n"
+ assert result.name == "install-one"
+ assert result.required_providers == ["google"]
+
+ refreshed = await prisma.models.SkillListing.prisma().find_unique(
+ where={"id": listing.id}
+ )
+ assert refreshed is not None
+ assert refreshed.installCount == 1
+
+
+async def test_reinstalling_stores_again_but_does_not_count_again(mocker):
+ listing = await _make_listing("install-twice", body="# do this\n")
+ stored = mocker.patch.object(skill_db, "store_user_skill")
+ mocker.patch.object(
+ skill_db,
+ "list_user_skills",
+ return_value=[SimpleNamespace(name="install-twice")],
+ )
+
+ await skill_db.install_marketplace_skill("user-1", "install-twice")
+
+ stored.assert_awaited_once()
+ refreshed = await prisma.models.SkillListing.prisma().find_unique(
+ where={"id": listing.id}
+ )
+ assert refreshed is not None
+ assert refreshed.installCount == 0
+
+
[email protected]("has_approved_version", OFF_SHELF)
+async def test_install_of_an_off_shelf_listing_never_reaches_the_library(
+ mocker, has_approved_version: bool
+):
+ await _make_listing(
+ "off-shelf-one", approved=False, has_approved_version=has_approved_version
+ )
+ stored = mocker.patch.object(skill_db, "store_user_skill")
+
+ with pytest.raises(NotFoundError):
+ await skill_db.install_marketplace_skill("user-1", "off-shelf-one")
+
+ stored.assert_not_awaited()
+
+
+async def test_seed_is_idempotent_and_keeps_one_version_per_listing():
+ first = await skill_seed.seed_starter_skills()
+ second = await skill_seed.seed_starter_skills()
+
+ assert first == second
+ versions = await prisma.models.SkillListingVersion.prisma().count()
+ assert versions == len(skill_seed.STARTER_SKILLS)
+
+
+async def test_seeded_skills_are_installable_under_their_own_slug(mocker):
+ await skill_seed.seed_starter_skills()
+ stored = mocker.patch.object(skill_db, "store_user_skill")
+ mocker.patch.object(skill_db, "list_user_skills", return_value=[])
+
+ result = await skill_db.install_marketplace_skill("user-1", "brand-voice-guide")
+
+ assert result.name == "brand-voice-guide"
+ assert stored.await_args.kwargs["name"] == "brand-voice-guide"
+
+
+def test_seed_rejects_a_file_whose_frontmatter_name_is_not_the_slug(
+ monkeypatch, tmp_path
+):
+ """The frontmatter name becomes the installed skill's name, so a mismatch
+ would install a starter skill under a name the marketplace never shows."""
+ (tmp_path / "mismatched.md").write_text(
+ '---\nname: "something-else"\ndescription: "d"\n---\n\nbody\n',
+ encoding="utf-8",
+ )
+ monkeypatch.setattr(skill_seed, "_CONTENT_DIR", tmp_path)
+
+ with pytest.raises(ValueError, match="must match"):
+ skill_seed._load("mismatched")
diff --git a/autogpt_platform/backend/backend/api/features/store/skill_model.py b/autogpt_platform/backend/backend/api/features/store/skill_model.py
new file mode 100644
index 0000000000..dedfbef4b3
--- /dev/null
+++ b/autogpt_platform/backend/backend/api/features/store/skill_model.py
@@ -0,0 +1,84 @@
+"""API models for marketplace skill listings.
+
+A skill listing publishes a ``SKILL.md`` — instructions and examples the
+copilot reads — 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.
+"""
+
+import datetime
+
+import prisma.models
+import pydantic
+
+from backend.util.models import Pagination
+
+
+class MarketplaceSkill(pydantic.BaseModel):
+ slug: str
+ name: str
+ description: str
+ categories: list[str]
+ required_providers: list[str]
+ install_count: int
+ creator: str | None = None
+ creator_avatar: str | None = None
+
+ @classmethod
+ def from_db(cls, listing: prisma.models.SkillListing) -> "MarketplaceSkill":
+ version = active_version(listing)
+ profile = listing.CreatorProfile
+ return cls(
+ slug=listing.slug,
+ name=version.name,
+ description=version.description,
+ categories=list(version.categories),
+ required_providers=list(version.requiredProviders),
+ install_count=listing.installCount,
+ creator=profile.username if profile else None,
+ creator_avatar=profile.avatarUrl if profile else None,
+ )
+
+
+class MarketplaceSkillsResponse(pydantic.BaseModel):
+ skills: list[MarketplaceSkill]
+ pagination: Pagination
+
+
+class MarketplaceSkillDetails(MarketplaceSkill):
+ skill_listing_version_id: str
+ body: str
+ triggers: list[str]
+ updated_at: datetime.datetime
+
+ @classmethod
+ def from_db(cls, listing: prisma.models.SkillListing) -> "MarketplaceSkillDetails":
+ version = active_version(listing)
+ summary = MarketplaceSkill.from_db(listing)
+ return cls(
+ **summary.model_dump(),
+ skill_listing_version_id=version.id,
+ body=version.body,
+ triggers=list(version.triggers),
+ updated_at=version.updatedAt,
+ )
+
+
+class InstalledSkill(pydantic.BaseModel):
+ name: str = pydantic.Field(
+ description="Name the skill was installed under, for a link into the library."
+ )
+ required_providers: list[str] = pydantic.Field(
+ description=(
+ "Integrations the skill's instructions assume. Not a precondition — "
+ "the install has already succeeded."
+ )
+ )
+
+
+def active_version(
+ listing: prisma.models.SkillListing,
+) -> prisma.models.SkillListingVersion:
+ if listing.ActiveVersion is None:
+ raise ValueError(f"Skill listing '{listing.slug}' has no active version")
+ return listing.ActiveVersion
diff --git a/autogpt_platform/backend/backend/api/features/store/skill_routes.py b/autogpt_platform/backend/backend/api/features/store/skill_routes.py
new file mode 100644
index 0000000000..005d56d7ca
--- /dev/null
+++ b/autogpt_platform/backend/backend/api/features/store/skill_routes.py
@@ -0,0 +1,86 @@
+"""Public browse and install for marketplace skill listings."""
+
+import autogpt_libs.auth
+import fastapi
+from fastapi import Depends, Path, Query, Security
+
+from backend.copilot.tools.skills import SkillLimitError
+from backend.util.feature_flag import Flag, is_feature_enabled
+
+from . import skill_db, skill_model
+
+# Browse is anonymous, and LaunchDarkly needs a context key: a non-UUID key is
+# evaluated as an anonymous context, which with the flag off answers False.
+_ANONYMOUS_FLAG_KEY = "anonymous"
+
+
+async def require_skills_hub_flag(
+ user_id: str | None = Security(autogpt_libs.auth.get_optional_user_id),
+) -> None:
+ """Gate every skills route on the skills-hub flag, fail-closed.
+
+ Deliberately not ``create_feature_flag_dependency``: that helper 404s
+ whenever LaunchDarkly has no SDK key, before consulting the
+ ``FORCE_FLAG_SKILLS_HUB`` override every local environment relies on.
+ """
+ if not await is_feature_enabled(Flag.SKILLS_HUB, user_id or _ANONYMOUS_FLAG_KEY):
+ raise fastapi.HTTPException(status_code=404, detail="Feature not available")
+
+
+router = fastapi.APIRouter(dependencies=[Depends(require_skills_hub_flag)])
+
+
+ "",
+ summary="List marketplace skills",
+ tags=["store", "public"],
+)
+async def list_marketplace_skills(
+ category: str | None = Query(default=None),
+ search_query: str | None = Query(default=None, alias="search_query"),
+ page: int = Query(default=1, ge=1),
+ page_size: int = Query(default=20, ge=1, le=100),
+) -> skill_model.MarketplaceSkillsResponse:
+ """Approved skill listings, most recently updated first."""
+ return await skill_db.get_marketplace_skills(
+ category=category,
+ search_query=search_query,
+ page=page,
+ page_size=page_size,
+ )
+
+
+ "/{slug}",
+ summary="Get marketplace skill",
+ tags=["store", "public"],
+ responses={404: {"description": "Skill not found"}},
+)
+async def get_marketplace_skill(
+ slug: str = Path(..., description="Slug of the skill listing"),
+) -> skill_model.MarketplaceSkillDetails:
+ """One listing with the full SKILL.md body the install will copy."""
+ return await skill_db.get_marketplace_skill(slug)
+
+
+ "/{slug}/install",
+ summary="Install marketplace skill",
+ tags=["store", "private"],
+ responses={
+ 404: {"description": "Skill not found"},
+ 409: {"description": "Per-user skill limit reached"},
+ },
+ dependencies=[Security(autogpt_libs.auth.requires_user)],
+)
+async def install_marketplace_skill(
+ slug: str = Path(..., description="Slug of the skill listing"),
+ user_id: str = Security(autogpt_libs.auth.get_user_id),
+) -> skill_model.InstalledSkill:
+ """Copy the listing's skill into the caller's AutoPilot skill library."""
+ try:
+ return await skill_db.install_marketplace_skill(user_id, slug)
+ except SkillLimitError as exc:
+ raise fastapi.HTTPException(status_code=409, detail=str(exc))
+ except ValueError as exc:
+ raise fastapi.HTTPException(status_code=400, detail=str(exc))
diff --git a/autogpt_platform/backend/backend/api/features/store/skill_routes_test.py b/autogpt_platform/backend/backend/api/features/store/skill_routes_test.py
new file mode 100644
index 0000000000..bb7f2abe1f
--- /dev/null
+++ b/autogpt_platform/backend/backend/api/features/store/skill_routes_test.py
@@ -0,0 +1,58 @@
+"""The skills-hub gate in front of the marketplace skill routes."""
+
+import fastapi
+import fastapi.testclient
+import pytest
+
+from . import skill_routes
+
+app = fastapi.FastAPI()
+app.include_router(skill_routes.router, prefix="/api/store/skills")
+client = fastapi.testclient.TestClient(app)
+
+# ``require_skills_hub_flag`` runs the real ``is_feature_enabled``, which
+# consults this env override before LaunchDarkly — so the gate is driven here
+# exactly the way it is driven locally, with no mock in the path.
+FLAG_ENV_VAR = "FORCE_FLAG_SKILLS_HUB"
+
+
+ "call",
+ [
+ lambda: client.get("/api/store/skills"),
+ lambda: client.get("/api/store/skills/any-slug"),
+ lambda: client.post("/api/store/skills/any-slug/install"),
+ ],
+ ids=["browse", "detail", "install"],
+)
+def test_every_endpoint_is_404_when_the_flag_is_off(
+ monkeypatch: pytest.MonkeyPatch, call
+):
+ monkeypatch.setenv(FLAG_ENV_VAR, "false")
+
+ response = call()
+
+ assert response.status_code == 404
+ assert response.json()["detail"] == "Feature not available"
+
+
+def test_install_still_needs_auth_when_the_flag_is_on(
+ monkeypatch: pytest.MonkeyPatch,
+):
+ """The gate takes an optional user, so it must not stand in for auth."""
+ monkeypatch.setenv(FLAG_ENV_VAR, "true")
+
+ response = client.post("/api/store/skills/any-slug/install")
+
+ assert response.status_code == 401
+
+
+async def test_the_gate_opens_when_the_flag_is_on(monkeypatch: pytest.MonkeyPatch):
+ """Without this the 404s above would also pass on a permanently shut gate.
+
+ Called directly rather than through the router: past the gate the handler
+ reaches Prisma, which the sync TestClient drives on the wrong event loop.
+ """
+ monkeypatch.setenv(FLAG_ENV_VAR, "true")
+
+ assert await skill_routes.require_skills_hub_flag(user_id=None) is None
diff --git a/autogpt_platform/backend/backend/api/features/store/skill_seed.py b/autogpt_platform/backend/backend/api/features/store/skill_seed.py
new file mode 100644
index 0000000000..11c0c5992e
--- /dev/null
+++ b/autogpt_platform/backend/backend/api/features/store/skill_seed.py
@@ -0,0 +1,145 @@
+"""Seed the platform-authored starter skill listings.
+
+Run as ``python -m backend.api.features.store.skill_seed``, like the expert
+roster seed. Idempotent: re-running updates the live version in place rather
+than stacking a new one, so the catalogue can be edited by editing the
+markdown.
+
+Each listing's content is its ``SKILL.md`` under ``starter_skills/``, parsed
+with the same :func:`parse_skill_markdown` the copilot and the upload endpoint
+use, so a starter skill cannot drift from the format an installed skill has.
+The seed adds only what a listing needs beyond the file: its categories and
+the integrations its instructions assume.
+"""
+
+import asyncio
+import logging
+from pathlib import Path
+from typing import TypedDict
+
+import prisma.enums
+import prisma.models
+
+from backend.copilot.tools.skills import ParsedSkill, parse_skill_markdown
+from backend.data import db as database
+
+logger = logging.getLogger(__name__)
+
+_CONTENT_DIR = Path(__file__).parent / "starter_skills"
+
+
+class StarterSkill(TypedDict):
+ slug: str
+ categories: list[str]
+ required_providers: list[str]
+
+
+STARTER_SKILLS: list[StarterSkill] = [
+ {
+ "slug": "brand-voice-guide",
+ "categories": ["content"],
+ "required_providers": [],
+ },
+ {
+ "slug": "outreach-playbook",
+ "categories": ["sales"],
+ "required_providers": ["google"],
+ },
+]
+
+
+async def seed_starter_skills() -> list[str]:
+ """Upsert every starter listing. Returns the listing ids."""
+ listing_ids = []
+ for entry in STARTER_SKILLS:
+ parsed = _load(entry["slug"])
+ listing = await _upsert_listing(entry, parsed)
+ listing_ids.append(listing.id)
+ logger.info(f"Seeded starter skill '{entry['slug']}' (#{listing.id})")
+ return listing_ids
+
+
+async def _upsert_listing(
+ entry: StarterSkill, parsed: ParsedSkill
+) -> prisma.models.SkillListing:
+ listing = await prisma.models.SkillListing.prisma().upsert(
+ where={"slug": entry["slug"]},
+ data={
+ "create": {"slug": entry["slug"], "hasApprovedVersion": True},
+ "update": {"hasApprovedVersion": True, "isDeleted": False},
+ },
+ include={"ActiveVersion": True},
+ )
+ version = await _upsert_version(listing, entry, parsed)
+ if listing.activeVersionId != version.id:
+ listing = (
+ await prisma.models.SkillListing.prisma().update(
+ where={"id": listing.id},
+ data={"activeVersionId": version.id},
+ include={"ActiveVersion": True},
+ )
+ or listing
+ )
+ return listing
+
+
+async def _upsert_version(
+ listing: prisma.models.SkillListing,
+ entry: StarterSkill,
+ parsed: ParsedSkill,
+) -> prisma.models.SkillListingVersion:
+ """Rewrite the listing's live version in place.
+
+ A starter skill is platform-authored, so there is no review to preserve and
+ no creator waiting on a version history — editing the markdown should change
+ what installers get, not add a row.
+ """
+ content: dict = {
+ "name": parsed.name,
+ "description": parsed.description,
+ "body": parsed.body,
+ "triggers": list(parsed.triggers),
+ "categories": entry["categories"],
+ "requiredProviders": entry["required_providers"],
+ "sourceSkillSlug": entry["slug"],
+ "isAvailable": True,
+ "isDeleted": False,
+ "submissionStatus": prisma.enums.SubmissionStatus.APPROVED,
+ }
+ existing = listing.ActiveVersion
+ if existing is not None:
+ updated = await prisma.models.SkillListingVersion.prisma().update(
+ where={"id": existing.id}, data=content
+ )
+ if updated is not None:
+ return updated
+ return await prisma.models.SkillListingVersion.prisma().create(
+ data={**content, "skillListingId": listing.id}
+ )
+
+
+def _load(slug: str) -> ParsedSkill:
+ path = _CONTENT_DIR / f"{slug}.md"
+ parsed = parse_skill_markdown(path.read_text(encoding="utf-8"))
+ if parsed is None:
+ raise ValueError(f"starter_skills/{slug}.md is not a valid SKILL.md")
+ if parsed.name != slug:
+ raise ValueError(
+ f"starter_skills/{slug}.md declares name '{parsed.name}'; the "
+ "frontmatter name is the installed skill's name and must match "
+ "the listing slug"
+ )
+ return parsed
+
+
+async def main() -> None:
+ await database.connect()
+ try:
+ await seed_starter_skills()
+ finally:
+ await database.disconnect()
+
+
+if __name__ == "__main__":
+ logging.basicConfig(level=logging.INFO)
+ asyncio.run(main())
diff --git a/autogpt_platform/backend/backend/api/features/store/starter_skills/brand-voice-guide.md b/autogpt_platform/backend/backend/api/features/store/starter_skills/brand-voice-guide.md
new file mode 100644
index 0000000000..16b3bc9b09
--- /dev/null
+++ b/autogpt_platform/backend/backend/api/features/store/starter_skills/brand-voice-guide.md
@@ -0,0 +1,51 @@
+---
+name: "brand-voice-guide"
+description: "Write in a consistent brand voice: capture the voice once, then apply it to any draft and flag where a draft drifts off it."
+triggers: ["brand voice", "tone of voice", "write copy", "on-brand", "style guide", "rewrite this"]
+version: "1"
+---
+
+# Brand voice guide
+
+Use this whenever you write or edit anything a customer will read.
+
+## First, get the voice on paper
+
+If the user has not given you a voice guide, ask for three things and nothing
+more — people abandon long intake forms:
+
+1. Two or three pieces of writing they think sound right.
+2. Who the reader is, in one sentence.
+3. Three words the brand is, and one word it is not.
+
+Infer the rest from the samples. Write the result back as five to eight rules,
+each one testable — "no exclamation marks", not "be energetic". Store it so you
+do not ask again.
+
+## Applying the voice
+
+Work in this order. Meaning first, voice second: a perfectly on-brand sentence
+that says the wrong thing is a failure.
+
+- Draft for the reader's question, not the brand's message.
+- Cut every sentence that survives only because it sounds good.
+- Replace abstract nouns with the concrete thing they stand for.
+- Read the opening line alone. If it could open any competitor's page, rewrite it.
+
+## Checking a draft
+
+When asked to review rather than write, return the draft with each drift marked
+and a one-line reason, then a corrected version. Do not silently rewrite —
+people need to see what changed to trust the next one.
+
+Flag these:
+
+- A claim with no evidence behind it.
+- A word from the "is not" list.
+- Two adjectives where one carries the meaning.
+- A sentence over about 25 words that could be two.
+
+## What not to do
+
+Never invent customer numbers, testimonials or results. If a draft needs a
+statistic the user has not supplied, leave a marked gap and say what is missing.
diff --git a/autogpt_platform/backend/backend/api/features/store/starter_skills/outreach-playbook.md b/autogpt_platform/backend/backend/api/features/store/starter_skills/outreach-playbook.md
new file mode 100644
index 0000000000..44c82f4df1
--- /dev/null
+++ b/autogpt_platform/backend/backend/api/features/store/starter_skills/outreach-playbook.md
@@ -0,0 +1,53 @@
+---
+name: "outreach-playbook"
+description: "Run cold outreach that gets replies: research the account, write a short specific first message, and follow up on a fixed schedule without nagging."
+triggers: ["cold email", "outreach", "prospecting", "follow up", "sales sequence", "reach out to"]
+version: "1"
+---
+
+# Outreach playbook
+
+Use this for any first contact with someone who did not ask to hear from us.
+
+## Before writing anything
+
+Spend the research effort on one question: what changed for this account
+recently that makes now the moment? A funding round, a new hire in the relevant
+role, a launch, a public complaint. Outreach with no trigger reads as a
+mail-merge because it is one.
+
+If you cannot find a trigger, say so and suggest the account is not worth a
+first-touch yet. Volume is not the goal.
+
+## The first message
+
+Four sentences, in this order, and no more:
+
+1. The trigger, stated as a fact about them.
+2. What that usually causes — the problem, in their words, not ours.
+3. One sentence on what we did about it for someone comparably sized.
+4. A question that is answerable in one line.
+
+Rules that matter more than they look:
+
+- No greeting beyond their first name; no "I hope this finds you well".
+- Never ask for a 30-minute call in the first message. Ask a question.
+- One link at most, and only if it answers the question you just asked.
+- Subject line is the trigger, lowercase, under six words.
+
+## Following up
+
+Three follow-ups, then stop and mark the account dormant for a quarter.
+
+- Day 3: forward your own message with one new fact, not a nudge.
+- Day 8: a different angle on the same problem. Never "just bumping this".
+- Day 17: one line closing the loop and giving them an easy out.
+
+A reply of "not now" ends the sequence. Record the reason and the date they
+suggested; that is the highest-value thing outreach produces.
+
+## What not to do
+
+Never claim a mutual connection, a prior conversation, or a result you cannot
+name the customer for. Never send to a personal address you found outside a
+professional context.
diff --git a/autogpt_platform/backend/backend/api/rest_api.py b/autogpt_platform/backend/backend/api/rest_api.py
index 59b159e78a..d914b44352 100644
--- a/autogpt_platform/backend/backend/api/rest_api.py
+++ b/autogpt_platform/backend/backend/api/rest_api.py
@@ -56,6 +56,7 @@ import backend.api.features.push.routes as push_routes
import backend.api.features.search.routes as search_routes
import backend.api.features.store.model
import backend.api.features.store.routes
+import backend.api.features.store.skill_routes
import backend.api.features.subscription_trial_routes as subscription_trial_routes
import backend.api.features.transfers.routes as transfer_routes
import backend.api.features.v1
@@ -405,6 +406,11 @@ app.include_router(
app.include_router(
backend.api.features.store.routes.router, tags=["v2"], prefix="/api/store"
)
+app.include_router(
+ backend.api.features.store.skill_routes.router,
+ tags=["v2"],
+ prefix="/api/store/skills",
+)
app.include_router(
backend.api.features.builder.routes.router, tags=["v2"], prefix="/api/builder"
)
diff --git a/autogpt_platform/backend/backend/util/feature_flag.py b/autogpt_platform/backend/backend/util/feature_flag.py
index 3120d758ce..026fe1c94a 100644
--- a/autogpt_platform/backend/backend/util/feature_flag.py
+++ b/autogpt_platform/backend/backend/util/feature_flag.py
@@ -106,6 +106,11 @@ class Flag(str, Enum):
# experts cohort.
HIRE_EXPERTS = "hire-experts"
+ # Mirror of the frontend `skills-hub` flag. Gates marketplace skill
+ # browse and install end-to-end: the routes 404 when off, so the dark
+ # launch is not reachable by URL with the shelf hidden. Fail-closed.
+ SKILLS_HUB = "skills-hub"
+
# Per-feature gate for the web-fact-check tool (P0.5). The tool
# can only DEMOTE memories on contradiction; new web-derived
# facts ride the ratification loop as tentative. Off on the
diff --git a/autogpt_platform/backend/migrations/20260908120000_add_skill_listing/migration.sql b/autogpt_platform/backend/migrations/20260908120000_add_skill_listing/migration.sql
new file mode 100644
index 0000000000..5a83e2c6ed
--- /dev/null
+++ b/autogpt_platform/backend/migrations/20260908120000_add_skill_listing/migration.sql
@@ -0,0 +1,102 @@
+-- Marketplace listings for knowledge skills.
+--
+-- A skill is instructions and examples, not a runnable graph, so it cannot ride
+-- StoreListing: that table's "agentGraphId" is NOT NULL and the StoreAgent view
+-- exposes the graph as non-null. These tables mirror its shape — slug, version,
+-- submission status, review fields — and hold the SKILL.md instead.
+--
+-- No view accompanies them. StoreAgent exists to aggregate run counts and
+-- review stats from materialized views; a skill has neither, and its install
+-- count lives on the listing row.
+
+-- CreateTable
+CREATE TABLE "SkillListing" (
+ "id" TEXT NOT NULL,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "isDeleted" BOOLEAN NOT NULL DEFAULT false,
+ "hasApprovedVersion" BOOLEAN NOT NULL DEFAULT false,
+ "slug" TEXT NOT NULL,
+ "activeVersionId" TEXT,
+ "installCount" INTEGER NOT NULL DEFAULT 0,
+ "owningUserId" TEXT,
+ "owningOrgId" TEXT,
+
+ CONSTRAINT "SkillListing_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "SkillListingVersion" (
+ "id" TEXT NOT NULL,
+ "version" INTEGER NOT NULL DEFAULT 1,
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "name" TEXT NOT NULL,
+ "description" TEXT NOT NULL,
+ "body" TEXT NOT NULL,
+ "triggers" TEXT[] DEFAULT ARRAY[]::TEXT[],
+ "categories" TEXT[],
+ "requiredProviders" TEXT[] DEFAULT ARRAY[]::TEXT[],
+ "sourceSkillSlug" TEXT,
+ "isDeleted" BOOLEAN NOT NULL DEFAULT false,
+ "isAvailable" BOOLEAN NOT NULL DEFAULT true,
+ "submissionStatus" "SubmissionStatus" NOT NULL DEFAULT 'DRAFT',
+ "submittedAt" TIMESTAMP(3),
+ "skillListingId" TEXT NOT NULL,
+ "changesSummary" TEXT,
+ "reviewerId" TEXT,
+ "internalComments" TEXT,
+ "reviewComments" TEXT,
+ "reviewedAt" TIMESTAMP(3),
+ "organizationId" TEXT,
+
+ CONSTRAINT "SkillListingVersion_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateIndex
+CREATE UNIQUE INDEX "SkillListing_activeVersionId_key" ON "SkillListing"("activeVersionId");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "SkillListing_slug_key" ON "SkillListing"("slug");
+
+-- CreateIndex
+CREATE INDEX "SkillListing_owningUserId_idx" ON "SkillListing"("owningUserId");
+
+-- CreateIndex
+CREATE INDEX "SkillListing_isDeleted_hasApprovedVersion_idx" ON "SkillListing"("isDeleted", "hasApprovedVersion");
+
+-- CreateIndex
+CREATE INDEX "SkillListing_owningOrgId_idx" ON "SkillListing"("owningOrgId");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "SkillListingVersion_skillListingId_version_key" ON "SkillListingVersion"("skillListingId", "version");
+
+-- CreateIndex
+CREATE INDEX "SkillListingVersion_skillListingId_submissionStatus_isAvail_idx" ON "SkillListingVersion"("skillListingId", "submissionStatus", "isAvailable");
+
+-- CreateIndex
+CREATE INDEX "SkillListingVersion_submissionStatus_idx" ON "SkillListingVersion"("submissionStatus");
+
+-- CreateIndex
+CREATE INDEX "SkillListingVersion_reviewerId_idx" ON "SkillListingVersion"("reviewerId");
+
+-- CreateIndex
+CREATE INDEX "SkillListingVersion_organizationId_idx" ON "SkillListingVersion"("organizationId");
+
+-- AddForeignKey
+ALTER TABLE "SkillListing" ADD CONSTRAINT "SkillListing_activeVersionId_fkey" FOREIGN KEY ("activeVersionId") REFERENCES "SkillListingVersion"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "SkillListing" ADD CONSTRAINT "SkillListing_owningUserId_fkey" FOREIGN KEY ("owningUserId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "SkillListing" ADD CONSTRAINT "SkillListing_owner_Profile_fkey" FOREIGN KEY ("owningUserId") REFERENCES "Profile"("userId") ON DELETE CASCADE ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "SkillListing" ADD CONSTRAINT "SkillListing_owningOrgId_fkey" FOREIGN KEY ("owningOrgId") REFERENCES "Organization"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "SkillListingVersion" ADD CONSTRAINT "SkillListingVersion_skillListingId_fkey" FOREIGN KEY ("skillListingId") REFERENCES "SkillListing"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "SkillListingVersion" ADD CONSTRAINT "SkillListingVersion_reviewerId_fkey" FOREIGN KEY ("reviewerId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
diff --git a/autogpt_platform/backend/schema.prisma b/autogpt_platform/backend/schema.prisma
index a3a89e88df..a23ce96bde 100644
--- a/autogpt_platform/backend/schema.prisma
+++ b/autogpt_platform/backend/schema.prisma
@@ -165,6 +165,8 @@ model User {
StoreListings StoreListing[]
StoreListingReviews StoreListingReview[]
StoreVersionsReviewed StoreListingVersion[]
+ SkillListings SkillListing[]
+ SkillVersionsReviewed SkillListingVersion[] @relation("SkillVersionsReviewed")
APIKeys APIKey[]
IntegrationWebhooks IntegrationWebhook[]
NotificationBatches UserNotificationBatch[]
@@ -1741,6 +1743,7 @@ model Profile {
LibraryAgents LibraryAgent[]
StoreListings StoreListing[]
+ SkillListings SkillListing[]
@@index([userId])
}
@@ -2015,6 +2018,98 @@ model StoreListingVersion {
@@index([organizationId])
}
+// A marketplace listing for a knowledge skill: instructions and examples the
+// copilot reads, never a runnable graph. Separate from StoreListing because
+// that model's agentGraphId is required and its StoreAgent view exposes the
+// graph as non-null.
+model SkillListing {
+ id String @id @default(uuid())
+ createdAt DateTime @default(now())
+ updatedAt DateTime @default(now()) @updatedAt
+
+ isDeleted Boolean @default(false)
+ hasApprovedVersion Boolean @default(false)
+
+ // Globally unique, not scoped to a creator: a platform listing has no
+ // creator segment to disambiguate it, so the URL is /marketplace/skills/{slug}.
+ slug String @unique
+
+ activeVersionId String? @unique
+ ActiveVersion SkillListingVersion? @relation("SkillActiveVersion", fields: [activeVersionId], references: [id])
+
+ // Popularity for browse ordering. Skills have no executions, so there is no
+ // run count to aggregate — installs are counted on the row instead.
+ installCount Int @default(0)
+
+ // Null for platform-authored starter listings, the way a roster Expert has
+ // no owner until it is hired. A creator listing carries both.
+ owningUserId String?
+ OwningUser User? @relation(fields: [owningUserId], references: [id])
+ CreatorProfile Profile? @relation(fields: [owningUserId], references: [userId], map: "SkillListing_owner_Profile_fkey", onDelete: Cascade)
+
+ Versions SkillListingVersion[] @relation("SkillListingVersions")
+
+ // Tenancy
+ owningOrgId String?
+ OwningOrg Organization? @relation("OrgSkillListings", fields: [owningOrgId], references: [id])
+
+ @@index([isDeleted, hasApprovedVersion])
+ @@index([owningUserId])
+ @@index([owningOrgId])
+}
+
+model SkillListingVersion {
+ id String @id @default(uuid())
+ version Int @default(1)
+ createdAt DateTime @default(now())
+ updatedAt DateTime @default(now()) @updatedAt
+
+ // The SKILL.md this version publishes: frontmatter fields plus the body.
+ // Snapshotted at submission, so editing the creator's library skill never
+ // changes what installers get.
+ name String
+ description String
+ body String
+ triggers String[] @default([])
+ categories String[]
+
+ // Integrations the skill's instructions assume the installer has connected;
+ // provider names as used by the credentials system.
+ requiredProviders String[] @default([])
+
+ // The creator's own library skill slug this was published from, so a
+ // re-publish can find its listing again. Null once that skill is deleted.
+ sourceSkillSlug String?
+
+ isDeleted Boolean @default(false)
+ isAvailable Boolean @default(true)
+
+ submissionStatus SubmissionStatus @default(DRAFT)
+ submittedAt DateTime?
+
+ skillListingId String
+ SkillListing SkillListing @relation("SkillListingVersions", fields: [skillListingId], references: [id], onDelete: Cascade)
+
+ ActiveFor SkillListing? @relation("SkillActiveVersion")
+
+ changesSummary String?
+
+ reviewerId String?
+ Reviewer User? @relation("SkillVersionsReviewed", fields: [reviewerId], references: [id])
+ internalComments String?
+ reviewComments String?
+ reviewedAt DateTime?
+
+ // Tenancy
+ organizationId String?
+
+ @@unique([skillListingId, version])
+ @@index([skillListingId, submissionStatus, isAvailable])
+ @@index([submissionStatus])
+ @@index([reviewerId])
+ @@index([organizationId])
+}
+
// Content type enum for unified search across store agents, blocks, docs
// Note: BLOCK/INTEGRATION are file-based (Python classes), not DB records
// DOCUMENTATION are file-based (.md files), not DB records
@@ -2296,6 +2391,7 @@ model Organization {
CreditTransactions OrgCreditTransaction[]
Invitations OrgInvitation[]
StoreListings StoreListing[] @relation("OrgStoreListings")
+ SkillListings SkillListing[] @relation("OrgSkillListings")
Credentials IntegrationCredential[]
Profile OrganizationProfile?
Subscription OrganizationSubscription?
diff --git a/autogpt_platform/frontend/orval.config.ts b/autogpt_platform/frontend/orval.config.ts
index 55e26d42f2..5895e181e6 100644
--- a/autogpt_platform/frontend/orval.config.ts
+++ b/autogpt_platform/frontend/orval.config.ts
@@ -41,6 +41,12 @@ export default defineConfig({
useInfiniteQueryParam: "page",
},
},
+ "getV2List marketplace skills": {
+ query: {
+ useInfinite: true,
+ useInfiniteQueryParam: "page",
+ },
+ },
"getV2List favorite library agents": {
query: {
useInfinite: true,
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
new file mode 100644
index 0000000000..693d4bc989
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/skills-section.test.tsx
@@ -0,0 +1,280 @@
+import { getListExpertTemplatesMockHandler } from "@/app/api/__generated__/endpoints/experts/experts.msw";
+import { getListCopilotSkillsMockHandler200 } from "@/app/api/__generated__/endpoints/skills/skills.msw";
+import {
+ getGetV2ListMarketplaceSkillsMockHandler200,
+ getGetV2ListStoreAgentsMockHandler,
+ getGetV2ListStoreCreatorsMockHandler,
+} from "@/app/api/__generated__/endpoints/store/store.msw";
+import type { MarketplaceSkill } from "@/app/api/__generated__/models/marketplaceSkill";
+import { server } from "@/mocks/mock-server";
+import { HttpResponse, http } from "msw";
+import {
+ configure,
+ render,
+ screen,
+ waitFor,
+} from "@/tests/integrations/test-utils";
+import { beforeEach, describe, expect, test, vi } from "vitest";
+
+import { MainMarkeplacePage } from "../components/MainMarketplacePage/MainMarketplacePage";
+
+// These pages wait on several queries before anything renders, and CI is
+// slower than a dev machine; the testing-library default is one second.
+configure({ asyncUtilTimeout: 10000 });
+
+const mockUseAuth = vi.hoisted(() => vi.fn());
+const flags = vi.hoisted(() => ({
+ skillsHub: true,
+ skillsHubReady: true,
+ hireExperts: false,
+}));
+
+vi.mock("next/navigation", () => ({
+ useRouter: () => ({
+ back: vi.fn(),
+ forward: vi.fn(),
+ prefetch: vi.fn(),
+ push: vi.fn(),
+ refresh: vi.fn(),
+ replace: vi.fn(),
+ }),
+ usePathname: () => "/marketplace",
+ useSearchParams: () => new URLSearchParams(),
+ useParams: () => ({}),
+}));
+
+vi.mock("@/lib/auth/hooks/useAuth", () => ({ useAuth: mockUseAuth }));
+
+vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
+ const actual =
+ await importOriginal<
+ typeof import("@/services/feature-flags/use-get-flag")
+ >();
+ return {
+ ...actual,
+ useGetFlag: (flag: string) => {
+ if (flag === "skills-hub") return flags.skillsHub;
+ if (flag === "hire-experts") return flags.hireExperts;
+ return actual.useGetFlag(flag as never);
+ },
+ useFlagStatus: (flag: string) => {
+ if (flag === "skills-hub")
+ return { enabled: flags.skillsHub, ready: flags.skillsHubReady };
+ return actual.useFlagStatus(flag as never);
+ },
+ };
+});
+
+const brandVoice: MarketplaceSkill = {
+ slug: "brand-voice-guide",
+ name: "brand-voice-guide",
+ description: "Write in a consistent brand voice.",
+ categories: ["content"],
+ required_providers: [],
+ install_count: 12,
+ creator: null,
+ creator_avatar: null,
+};
+
+const outreach: MarketplaceSkill = {
+ ...brandVoice,
+ slug: "outreach-playbook",
+ name: "outreach-playbook",
+ categories: ["sales"],
+ required_providers: ["google"],
+};
+
+function listing(skills: MarketplaceSkill[], totalItems = skills.length) {
+ return getGetV2ListMarketplaceSkillsMockHandler200({
+ skills,
+ pagination: {
+ total_items: totalItems,
+ total_pages: 1,
+ current_page: 1,
+ page_size: 4,
+ },
+ });
+}
+
+describe("Marketplace SkillsSection", () => {
+ beforeEach(() => {
+ flags.skillsHub = true;
+ flags.skillsHubReady = true;
+ flags.hireExperts = false;
+ mockUseAuth.mockReturnValue({ user: { id: "user-1" }, isLoggedIn: true });
+ server.use(
+ getGetV2ListStoreAgentsMockHandler(),
+ getGetV2ListStoreCreatorsMockHandler(),
+ getListExpertTemplatesMockHandler([]),
+ getListCopilotSkillsMockHandler200([]),
+ );
+ });
+
+ test("shows skills as their own shelf, linked to the skill page", async () => {
+ server.use(listing([brandVoice]));
+
+ render(<MainMarkeplacePage />);
+
+ expect(
+ await screen.findByText("AutoPilot Skills", undefined, {
+ timeout: 10000,
+ }),
+ ).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",
+ );
+ });
+
+ test("sits above the workflow catalogue, not below it", async () => {
+ server.use(listing([brandVoice]));
+
+ render(<MainMarkeplacePage />);
+
+ const skills = await screen.findByText("AutoPilot Skills", undefined, {
+ timeout: 10000,
+ });
+ const workflows = await screen.findByText("All AI Workflows");
+ // Node.DOCUMENT_POSITION_FOLLOWING === 4: the workflows heading comes after.
+ expect(skills.compareDocumentPosition(workflows) & 4).toBe(4);
+ });
+
+ test("shows the compatibility line only for a skill that needs one", async () => {
+ server.use(listing([brandVoice, outreach]));
+
+ render(<MainMarkeplacePage />);
+
+ await screen.findAllByTestId("skill-card", undefined, { timeout: 10000 });
+ const card = await screen.findByRole("link", { name: /Outreach playbook/ });
+ expect(card.textContent).toContain("Works with");
+ expect(card.textContent).toContain("Google");
+ const brand = await screen.findByRole("link", {
+ name: /Brand voice guide/,
+ });
+ expect(brand.textContent).not.toContain("Works with");
+ });
+
+ test("marks a skill the user already has as Added", async () => {
+ server.use(
+ listing([brandVoice, outreach]),
+ // An install lands under the listing slug.
+ getListCopilotSkillsMockHandler200([
+ { name: "outreach-playbook", description: "Installed copy" },
+ ]),
+ );
+
+ render(<MainMarkeplacePage />);
+
+ const card = await screen.findByRole("link", { name: /Outreach playbook/ });
+ await waitFor(() => expect(card.textContent).toContain("Added"));
+ const brand = await screen.findByRole("link", {
+ name: /Brand voice guide/,
+ });
+ expect(brand.textContent).not.toContain("Added");
+ expect(brand.textContent).toContain("View");
+ });
+
+ test("offers no Browse all while the catalogue fits the shelf", async () => {
+ server.use(listing([brandVoice, outreach], 2));
+
+ render(<MainMarkeplacePage />);
+
+ await screen.findAllByTestId("skill-card", undefined, { timeout: 10000 });
+ expect(
+ screen.queryByRole("link", { name: /Browse all skills/ }),
+ ).toBeNull();
+ });
+
+ test("offers Browse all once the catalogue outgrows the shelf", async () => {
+ server.use(listing([brandVoice, outreach], 9));
+
+ render(<MainMarkeplacePage />);
+
+ expect(
+ await screen.findByRole(
+ "link",
+ { name: /Browse all skills/ },
+ { timeout: 10000 },
+ ),
+ ).toBeDefined();
+ });
+
+ test("keeps the header and offers a retry when the shelf fails", async () => {
+ server.use(
+ http.get("/api/proxy/api/store/skills", () =>
+ HttpResponse.json({ detail: "Unavailable" }, { status: 500 }),
+ ),
+ );
+
+ render(<MainMarkeplacePage />);
+
+ expect(
+ await screen.findByText("AutoPilot Skills", undefined, {
+ timeout: 10000,
+ }),
+ ).toBeDefined();
+ expect(await screen.findByRole("button", { name: "Retry" })).toBeDefined();
+ });
+
+ test("points a signed-in user at their own skills when none are published", async () => {
+ server.use(listing([]));
+
+ render(<MainMarkeplacePage />);
+
+ expect(
+ await screen.findByTestId("skills-shelf-empty", undefined, {
+ timeout: 10000,
+ }),
+ ).toBeDefined();
+ });
+
+ test("says nothing at all to a visitor when there are no skills", async () => {
+ mockUseAuth.mockReturnValue({ user: null, isLoggedIn: false });
+ server.use(listing([]));
+
+ render(<MainMarkeplacePage />);
+
+ expect(await screen.findByText("All AI Workflows")).toBeDefined();
+ await waitFor(() =>
+ expect(screen.queryByText("AutoPilot Skills")).toBeNull(),
+ );
+ });
+
+ test("stays hidden and fetches nothing outside the beta", async () => {
+ flags.skillsHub = false;
+ let requested = false;
+ server.use(
+ getGetV2ListMarketplaceSkillsMockHandler200(() => {
+ requested = true;
+ return {
+ skills: [brandVoice],
+ pagination: {
+ total_items: 1,
+ total_pages: 1,
+ current_page: 1,
+ page_size: 4,
+ },
+ };
+ }),
+ );
+
+ render(<MainMarkeplacePage />);
+
+ expect(await screen.findByText("All AI Workflows")).toBeDefined();
+ expect(screen.queryByText("AutoPilot Skills")).toBeNull();
+ await waitFor(() => expect(requested).toBe(false));
+ });
+
+ test("does not paint the shelf before the flag has answered", async () => {
+ flags.skillsHubReady = false;
+ server.use(listing([brandVoice]));
+
+ render(<MainMarkeplacePage />);
+
+ expect(await screen.findByText("All AI Workflows")).toBeDefined();
+ await waitFor(() =>
+ expect(screen.queryByText("AutoPilot Skills")).toBeNull(),
+ );
+ });
+});
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/helpers.ts
index 84dc7e8cf0..cff7bb3b2c 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/helpers.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/ExpertsSection/helpers.ts
@@ -1,8 +1,13 @@
import {
Briefcase01Icon,
ChartIncreaseIcon,
+ Coins01Icon,
+ HeadsetIcon,
Megaphone01Icon,
+ QuillWrite01Icon,
+ Search01Icon,
Settings01Icon,
+ SourceCodeIcon,
} from "@hugeicons/core-free-icons";
import type { IconSvgElement } from "@hugeicons/react";
import { findColorOption } from "@/app/(platform)/raise/components/ColorStep/helpers";
@@ -67,6 +72,30 @@ const ROLE_ACCENTS: Array<[RegExp, string]> = [
[/ops|operations|support/i, "sky"],
];
+/** A skill's category is its identity mark, the way an expert's role is:
+ * the eight canonical categories fold onto the same four accents, so
+ * "Outreach playbook · Sales" carries the amber a Sales expert already has.
+ * An unknown or missing category keeps the neutral wash and shows no pill. */
+export function getCategoryAccent(category: string | undefined): {
+ accent: ExpertAccent;
+ icon: IconSvgElement | null;
+} {
+ const entry = category ? CATEGORY_ACCENTS[category.toLowerCase()] : undefined;
+ if (!entry) return { accent: ACCENTS.zinc, icon: null };
+ return { accent: ACCENTS[entry[0]], icon: entry[1] };
+}
+
+const CATEGORY_ACCENTS: Record<string, [string, IconSvgElement]> = {
+ marketing: ["violet", Megaphone01Icon],
+ content: ["violet", QuillWrite01Icon],
+ sales: ["amber", ChartIncreaseIcon],
+ finance: ["amber", Coins01Icon],
+ operations: ["sky", Settings01Icon],
+ support: ["sky", HeadsetIcon],
+ research: ["zinc", Search01Icon],
+ development: ["zinc", SourceCodeIcon],
+};
+
export function getExpertAccent(role: string): ExpertAccent {
for (const [pattern, key] of ROLE_ACCENTS) {
if (pattern.test(role)) return ACCENTS[key];
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsx
index b47252a50a..dc1911fc8f 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsx
@@ -1,7 +1,11 @@
"use client";
import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
import { useAuth } from "@/lib/auth/hooks/useAuth";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
+import {
+ Flag,
+ useFlagStatus,
+ useGetFlag,
+} from "@/services/feature-flags/use-get-flag";
import { AICatalogIcon } from "../AICatalogIcon";
import { AgentsSection } from "../AgentsSection/AgentsSection";
import { CategoryFilter } from "../CategoryFilter/CategoryFilter";
@@ -9,6 +13,7 @@ import { BecomeACreator } from "../BecomeACreator/BecomeACreator";
import { FeaturedCreators } from "../FeaturedCreators/FeaturedCreators";
import { FeaturedSection } from "../FeaturedSection/FeaturedSection";
import { ExpertsSection } from "../ExpertsSection/ExpertsSection";
+import { SkillsSection } from "../SkillsSection/SkillsSection";
import { HeroSection } from "../HeroSection/HeroSection";
import { MainMarketplacePageLoading } from "../MainMarketplacePageLoading";
import { MarketplaceTabIntro } from "../MarketplaceTabIntro/MarketplaceTabIntro";
@@ -27,6 +32,9 @@ export const MainMarkeplacePage = () => {
} = useMainMarketplacePage();
const { isLoggedIn, isUserLoading } = useAuth();
const isHireExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);
+ // Branch on `ready` so the shelf does not pop in after LaunchDarkly
+ // answers and push the whole workflow catalogue down.
+ const skillsHub = useFlagStatus(Flag.SKILLS_HUB);
// Hiring is still behind the flag, but the expert pages are public: a
// visitor browsing the marketplace needs a way to reach them. Signed-in
// users keep the flag gate so the beta stays invisible to them.
@@ -60,6 +68,7 @@ export const MainMarkeplacePage = () => {
<main className="px-6 pb-16 md:px-10 lg:px-14">
<HeroSection />
{showExperts ? <ExpertsSection /> : null}
+ {skillsHub.ready && skillsHub.enabled ? <SkillsSection /> : null}
{topAgents && (
<div className="mb-20" id={AGENTS_SECTION_ID}>
<AgentsSection
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SearchBar/SearchBar.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SearchBar/SearchBar.tsx
index d20f9e79ff..444556901a 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SearchBar/SearchBar.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SearchBar/SearchBar.tsx
@@ -7,14 +7,21 @@ interface SearchBarProps {
placeholder?: string;
width?: string;
height?: string;
+ defaultValue?: string;
+ onSubmit?: (query: string) => void;
}
export function SearchBar({
placeholder = 'Search for tasks like "optimise SEO"',
width = "w-full lg:w-[56.25rem]",
height = "h-[3.8rem]",
+ defaultValue,
+ onSubmit,
}: SearchBarProps) {
- const { handleSubmit, setSearchQuery, searchQuery } = useSearchbar();
+ const { handleSubmit, setSearchQuery, searchQuery } = useSearchbar({
+ defaultValue,
+ onSubmit,
+ });
return (
<form
@@ -30,6 +37,7 @@ export function SearchBar({
/>
<input
type="text"
+ aria-label={placeholder}
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
placeholder={placeholder}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SearchBar/useSearchBar.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SearchBar/useSearchBar.ts
index 4945f8bed3..802c4051a9 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SearchBar/useSearchBar.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SearchBar/useSearchBar.ts
@@ -1,14 +1,25 @@
import { useRouter } from "next/navigation";
import { useState } from "react";
-export const useSearchbar = () => {
+interface Args {
+ defaultValue?: string;
+ /** Search a single surface in place; without it the bar goes to the
+ * marketplace-wide results page. */
+ onSubmit?: (query: string) => void;
+}
+
+export const useSearchbar = ({ defaultValue = "", onSubmit }: Args = {}) => {
const router = useRouter();
- const [searchQuery, setSearchQuery] = useState("");
+ const [searchQuery, setSearchQuery] = useState(defaultValue);
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
+ if (onSubmit) {
+ onSubmit(searchQuery.trim());
+ return;
+ }
if (searchQuery.trim()) {
const encodedTerm = encodeURIComponent(searchQuery);
router.push(`/marketplace/search?searchTerm=${encodedTerm}`);
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SectionHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SectionHeader.tsx
index 754b938f8c..f9e3e5b8d6 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SectionHeader.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SectionHeader.tsx
@@ -8,6 +8,7 @@ interface Props {
eyebrowIcon?: ReactNode;
title: string;
titleIcon?: ReactNode;
+ titleId?: string;
subtitle?: string;
action?: { label: string; href: string };
}
@@ -17,6 +18,7 @@ export function SectionHeader({
eyebrowIcon,
title,
titleIcon,
+ titleId,
subtitle,
action,
}: Props) {
@@ -29,7 +31,10 @@ export function SectionHeader({
{eyebrow}
</div>
) : null}
- <h2 className="flex items-center gap-2.5 text-3xl font-semibold tracking-[-0.02em] text-zinc-900">
+ <h2
+ id={titleId}
+ className="flex items-center gap-2.5 text-3xl font-semibold tracking-[-0.02em] text-zinc-900"
+ >
{titleIcon}
{title}
</h2>
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/SkillsSection.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/SkillsSection.tsx
new file mode 100644
index 0000000000..a2de8470df
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/SkillsSection.tsx
@@ -0,0 +1,142 @@
+"use client";
+
+import { Icon } from "@/components/atoms/Icon/Icon";
+import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";
+import { Text } from "@/components/atoms/Text/Text";
+import { BookOpen01Icon } from "@hugeicons/core-free-icons";
+import Link from "next/link";
+import { SectionHeader } from "../SectionHeader";
+import { SkillCard } from "./components/SkillCard";
+import { SHELF_SIZE } from "./helpers";
+import { useSkillsSection } from "./useSkillsSection";
+
+const HEADING_ID = "skills-heading";
+
+export function SkillsSection() {
+ const {
+ isLoggedIn,
+ skills,
+ total,
+ installedSlugs,
+ isLoading,
+ isError,
+ refetch,
+ } = useSkillsSection();
+
+ // Visitors get nothing when there is nothing to show, as Experts does.
+ if (!isLoading && !isError && skills.length === 0 && !isLoggedIn) return null;
+
+ return (
+ <section
+ id="skills"
+ aria-labelledby={HEADING_ID}
+ className="mb-20 scroll-mt-24"
+ >
+ <SectionHeader
+ titleIcon={<Icon icon={BookOpen01Icon} size={30} aria-hidden />}
+ title="AutoPilot Skills"
+ titleId={HEADING_ID}
+ subtitle="Playbooks your AutoPilot follows — from brand voice to cold outreach. Install one and it knows how."
+ action={sectionAction({ isLoggedIn, total })}
+ />
+ {isLoggedIn ? (
+ <div className="-mt-3 mb-6">
+ <Link
+ href="/library/skills"
+ className="text-sm font-medium text-accent transition-colors hover:text-accent/80"
+ >
+ …or teach it one of your own
+ </Link>
+ </div>
+ ) : null}
+
+ {isLoading ? (
+ <div
+ role="status"
+ aria-busy="true"
+ aria-label="Loading skills"
+ className="grid grid-cols-1 gap-5 md:grid-cols-2"
+ >
+ {[0, 1].map((i) => (
+ <Skeleton key={i} className="h-[18rem] w-full rounded-2xl" />
+ ))}
+ </div>
+ ) : isError ? (
+ <ShelfError onRetry={refetch} />
+ ) : skills.length === 0 ? (
+ <EmptyShelf />
+ ) : (
+ <div className="grid grid-cols-1 gap-5 md:grid-cols-2">
+ {skills.map((skill) => (
+ <SkillCard
+ key={skill.slug}
+ skill={skill}
+ isInstalled={installedSlugs.has(skill.slug)}
+ />
+ ))}
+ </div>
+ )}
+ </section>
+ );
+}
+
+function sectionAction({
+ isLoggedIn,
+ total,
+}: {
+ isLoggedIn: boolean;
+ total: number;
+}) {
+ if (total > SHELF_SIZE)
+ return { label: "Browse all skills", href: "/marketplace/skills" };
+ if (isLoggedIn) return { label: "Your skills", href: "/library/skills" };
+ return undefined;
+}
+
+// The shelf is secondary on this page, so a failure is one line — the page
+// already reserves the full ErrorCard for its own failure.
+function ShelfError({ onRetry }: { onRetry: () => void }) {
+ return (
+ <div className="flex items-center gap-2 text-sm text-zinc-600">
+ <span>Couldn&apos;t load skills right now.</span>
+ <button
+ type="button"
+ onClick={onRetry}
+ className="font-medium text-accent underline-offset-2 transition-colors hover:underline"
+ >
+ Retry
+ </button>
+ </div>
+ );
+}
+
+function EmptyShelf() {
+ return (
+ <div
+ className="flex flex-col items-center justify-center gap-3 rounded-large border border-dashed border-zinc-200 px-6 py-16 text-center"
+ data-testid="skills-shelf-empty"
+ >
+ <div className="flex h-12 w-12 items-center justify-center rounded-full bg-violet-50">
+ <Icon
+ icon={BookOpen01Icon}
+ size={24}
+ className="text-violet-700"
+ aria-hidden
+ />
+ </div>
+ <Text variant="h4" className="text-zinc-900">
+ Nothing published yet
+ </Text>
+ <Text variant="body" className="max-w-md !text-zinc-600">
+ Skills from the community will show up here. In the meantime you can
+ teach your AutoPilot one of your own.
+ </Text>
+ <Link
+ href="/library/skills"
+ className="text-sm font-medium text-accent transition-colors hover:text-accent/80"
+ >
+ Go to your skills →
+ </Link>
+ </div>
+ );
+}
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
new file mode 100644
index 0000000000..eabf9fa997
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/components/SkillCard.tsx
@@ -0,0 +1,141 @@
+import type { MarketplaceSkill } from "@/app/api/__generated__/models/marketplaceSkill";
+import {
+ Avatar,
+ AvatarFallback,
+ AvatarImage,
+} from "@/components/atoms/Avatar/Avatar";
+import { Icon } from "@/components/atoms/Icon/Icon";
+import { IntegrationLogo } from "@/components/molecules/IntegrationLogo/IntegrationLogo";
+import { formatProviderName } from "@/components/contextual/IntegrationsPanel/helpers";
+import { cn } from "@/lib/utils";
+import {
+ ArrowRight02Icon,
+ BookOpen01Icon,
+ CheckmarkCircle02Icon,
+ Download04Icon,
+} from "@hugeicons/core-free-icons";
+import Link from "next/link";
+import { getCategoryAccent } from "../../ExpertsSection/helpers";
+import { formatSkillTitle } from "../helpers";
+
+interface Props {
+ skill: MarketplaceSkill;
+ isInstalled: boolean;
+}
+
+export function SkillCard({ skill, isInstalled }: Props) {
+ const { accent, icon } = getCategoryAccent(skill.categories[0]);
+ const title = formatSkillTitle(skill.name);
+ const providers = skill.required_providers;
+
+ return (
+ <Link
+ href={`/marketplace/skills/${skill.slug}`}
+ data-testid="skill-card"
+ className="group relative flex h-full flex-col overflow-hidden rounded-2xl border border-zinc-200/80 bg-white text-left shadow-[0_1px_2px_rgba(16,24,40,0.04)] outline-none transition-[transform,box-shadow,border-color] duration-200 ease-out [touch-action:manipulation] hover:-translate-y-0.5 hover:border-zinc-300 hover:shadow-[0_16px_40px_-16px_rgba(16,24,40,0.18)] focus-visible:ring-2 focus-visible:ring-violet-600 focus-visible:ring-offset-2 motion-reduce:transition-none motion-reduce:hover:transform-none"
+ >
+ <div
+ className={cn(
+ "pointer-events-none absolute inset-x-0 top-0 h-28 opacity-60 transition-opacity duration-200 group-hover:opacity-100",
+ accent.wash,
+ )}
+ />
+ <div className="relative flex flex-1 flex-col gap-4 p-6">
+ <div className="flex items-start justify-between gap-3">
+ <span className="inline-flex h-12 w-12 items-center justify-center rounded-xl bg-white ring-1 ring-inset ring-zinc-200/70">
+ <Icon
+ icon={BookOpen01Icon}
+ size={24}
+ className={accent.icon}
+ aria-hidden
+ />
+ </span>
+ {icon && skill.categories[0] ? (
+ <span
+ className={cn(
+ "inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-sm font-medium",
+ accent.pill,
+ )}
+ >
+ <Icon icon={icon} size={14} aria-hidden />
+ {formatSkillTitle(skill.categories[0])}
+ </span>
+ ) : null}
+ </div>
+
+ <div className="min-w-0">
+ <h3
+ title={title}
+ className="line-clamp-1 text-lg font-semibold tracking-[-0.01em] text-zinc-900"
+ >
+ {title}
+ </h3>
+ <div className="mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[13px] text-zinc-500">
+ <span className="inline-flex items-center gap-1.5">
+ <Avatar className="h-5 w-5">
+ {skill.creator_avatar ? (
+ <AvatarImage
+ src={skill.creator_avatar}
+ alt={skill.creator ?? "AutoGPT"}
+ />
+ ) : null}
+ <AvatarFallback>{skill.creator ?? "AutoGPT"}</AvatarFallback>
+ </Avatar>
+ by {skill.creator ?? "AutoGPT"}
+ </span>
+ {providers.length > 0 ? (
+ <span className="inline-flex items-center gap-1.5">
+ <span aria-hidden>·</span>
+ Works with
+ <IntegrationLogo provider={providers[0]} size={14} alt="" />
+ {formatProviderList(providers)}
+ </span>
+ ) : null}
+ </div>
+ <p className="mt-2 line-clamp-3 text-sm leading-relaxed text-zinc-600">
+ {skill.description}
+ </p>
+ </div>
+
+ <div className="mt-auto flex items-center justify-between pt-2">
+ <span className="flex items-center gap-2 text-base text-zinc-600">
+ <Icon
+ icon={Download04Icon}
+ size={18}
+ className={accent.icon}
+ aria-hidden
+ />
+ {/* Nobody having installed it yet makes a listing new, not failing. */}
+ {skill.install_count === 0
+ ? "New"
+ : `${skill.install_count.toLocaleString()} installed`}
+ </span>
+ {isInstalled ? (
+ <span className="flex items-center gap-1.5 text-base font-medium text-emerald-600">
+ <Icon icon={CheckmarkCircle02Icon} size={18} aria-hidden />
+ Added
+ </span>
+ ) : (
+ <span className="flex items-center gap-1.5 text-base font-medium text-zinc-500 transition-colors duration-200 group-hover:text-zinc-900">
+ View
+ <Icon
+ icon={ArrowRight02Icon}
+ size={16}
+ aria-hidden
+ className="transition-transform duration-200 group-hover:translate-x-0.5 motion-reduce:transition-none"
+ />
+ </span>
+ )}
+ </div>
+ </div>
+ </Link>
+ );
+}
+
+function formatProviderList(providers: string[]): string {
+ const names = providers.map(formatProviderName).filter(Boolean);
+ return new Intl.ListFormat("en", {
+ style: "long",
+ type: "conjunction",
+ }).format(names);
+}
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
new file mode 100644
index 0000000000..00aea47c68
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/helpers.ts
@@ -0,0 +1,14 @@
+/** Two rows of two; past this the header offers "Browse all skills". */
+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;
+ return words.charAt(0).toUpperCase() + words.slice(1);
+}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/useSkillsSection.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/useSkillsSection.ts
new file mode 100644
index 0000000000..cb675a95e5
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/SkillsSection/useSkillsSection.ts
@@ -0,0 +1,30 @@
+import { useListCopilotSkills } from "@/app/api/__generated__/endpoints/skills/skills";
+import { useGetV2ListMarketplaceSkills } from "@/app/api/__generated__/endpoints/store/store";
+import { okData } from "@/app/api/helpers";
+import { useAuth } from "@/lib/auth/hooks/useAuth";
+import { SHELF_SIZE } from "./helpers";
+
+export function useSkillsSection() {
+ const { isLoggedIn } = useAuth();
+
+ const query = useGetV2ListMarketplaceSkills(
+ { page_size: SHELF_SIZE },
+ { query: { select: (response) => okData(response) } },
+ );
+
+ // An install lands under the listing's slug, so the user's own skill names
+ // are what says which shelf cards are already added.
+ const installed = useListCopilotSkills({
+ query: { select: (res) => okData(res) ?? [], enabled: isLoggedIn },
+ });
+
+ return {
+ isLoggedIn,
+ skills: query.data?.skills ?? [],
+ total: query.data?.pagination.total_items ?? 0,
+ installedSlugs: new Set((installed.data ?? []).map((skill) => skill.name)),
+ isLoading: query.isLoading,
+ isError: query.isError,
+ refetch: query.refetch,
+ };
+}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/page.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/page.tsx
index 1b6913f8c2..6a180fef06 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/page.tsx
@@ -1,7 +1,9 @@
import {
+ prefetchGetV2ListMarketplaceSkillsQuery,
prefetchGetV2ListStoreAgentsQuery,
prefetchGetV2ListStoreCreatorsQuery,
} from "@/app/api/__generated__/endpoints/store/store";
+import { SHELF_SIZE } from "./components/SkillsSection/helpers";
import { getQueryClient } from "@/lib/react-query/queryClient";
import { buildPageMetadata } from "@/lib/metadata";
import { dehydrate, HydrationBoundary } from "@tanstack/react-query";
@@ -73,6 +75,18 @@ export default async function MarketplacePage(): Promise<React.ReactElement> {
},
},
),
+ // With the flag off the endpoint 404s; prefetch swallows that and the
+ // client gate hides the shelf either way.
+ prefetchGetV2ListMarketplaceSkillsQuery(
+ queryClient,
+ { page_size: SHELF_SIZE },
+ {
+ query: {
+ staleTime: 60 * 1000, // 60 seconds
+ gcTime: 5 * 60 * 1000, // 5 minutes
+ },
+ },
+ ),
]);
return (
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
new file mode 100644
index 0000000000..b89c7869b6
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/__tests__/skills-in-search.test.tsx
@@ -0,0 +1,126 @@
+import {
+ getGetV2ListMarketplaceSkillsMockHandler200,
+ getGetV2ListStoreAgentsMockHandler,
+ getGetV2ListStoreCreatorsMockHandler,
+} from "@/app/api/__generated__/endpoints/store/store.msw";
+import type { MarketplaceSkill } from "@/app/api/__generated__/models/marketplaceSkill";
+import { server } from "@/mocks/mock-server";
+import {
+ configure,
+ render,
+ screen,
+ waitFor,
+} from "@/tests/integrations/test-utils";
+import { beforeEach, describe, expect, test, vi } from "vitest";
+
+import { MainSearchResultPage } from "../components/MainSearchResultPage/MainSearchResultPage";
+
+// These pages wait on several queries before anything renders, and CI is
+// slower than a dev machine; the testing-library default is one second.
+configure({ asyncUtilTimeout: 10000 });
+
+const mockUseAuth = vi.hoisted(() => vi.fn());
+const flag = vi.hoisted(() => ({ enabled: true, ready: true }));
+
+vi.mock("next/navigation", () => ({
+ useRouter: () => ({
+ back: vi.fn(),
+ forward: vi.fn(),
+ prefetch: vi.fn(),
+ push: vi.fn(),
+ refresh: vi.fn(),
+ replace: vi.fn(),
+ }),
+ usePathname: () => "/marketplace/search",
+ useSearchParams: () => new URLSearchParams(),
+ useParams: () => ({}),
+}));
+
+vi.mock("@/lib/auth/hooks/useAuth", () => ({ useAuth: mockUseAuth }));
+
+vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
+ const actual =
+ await importOriginal<
+ typeof import("@/services/feature-flags/use-get-flag")
+ >();
+ return { ...actual, useFlagStatus: () => flag };
+});
+
+const outreach: MarketplaceSkill = {
+ slug: "outreach-playbook",
+ name: "outreach-playbook",
+ description: "Run cold outreach that gets replies.",
+ categories: ["sales"],
+ required_providers: [],
+ install_count: 3,
+ creator: null,
+ creator_avatar: null,
+};
+
+describe("Skills in marketplace search", () => {
+ beforeEach(() => {
+ flag.enabled = true;
+ flag.ready = true;
+ mockUseAuth.mockReturnValue({ user: { id: "user-1" }, isLoggedIn: true });
+ server.use(
+ getGetV2ListStoreAgentsMockHandler(),
+ getGetV2ListStoreCreatorsMockHandler(),
+ );
+ });
+
+ test("returns matching skills alongside agents and creators", async () => {
+ server.use(
+ getGetV2ListMarketplaceSkillsMockHandler200({
+ skills: [outreach],
+ pagination: {
+ total_items: 1,
+ total_pages: 1,
+ current_page: 1,
+ page_size: 20,
+ },
+ }),
+ );
+
+ render(<MainSearchResultPage searchTerm="outreach" sort="runs" />);
+
+ expect(
+ await screen.findByRole(
+ "heading",
+ { name: "Skills" },
+ { timeout: 10000 },
+ ),
+ ).toBeDefined();
+ const card = await screen.findByRole("link", { name: /Outreach playbook/ });
+ expect(card.getAttribute("href")).toBe(
+ "/marketplace/skills/outreach-playbook",
+ );
+ expect(screen.getByRole("button", { name: /Skills/ })).toBeDefined();
+ });
+
+ test("asks for no skills and offers no chip outside the beta", async () => {
+ flag.enabled = false;
+ let requested = false;
+ server.use(
+ getGetV2ListMarketplaceSkillsMockHandler200(() => {
+ requested = true;
+ return {
+ skills: [outreach],
+ pagination: {
+ total_items: 1,
+ total_pages: 1,
+ current_page: 1,
+ page_size: 20,
+ },
+ };
+ }),
+ );
+
+ render(<MainSearchResultPage searchTerm="outreach" sort="runs" />);
+
+ await screen.findByText(/Showing results for/, undefined, {
+ timeout: 10000,
+ });
+ await waitFor(() => expect(requested).toBe(false));
+ expect(screen.queryByRole("heading", { name: "Skills" })).toBeNull();
+ });
+});
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/MainSearchResultPage.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/MainSearchResultPage.tsx
index b4eaf9f6e6..d099664b64 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/MainSearchResultPage.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/MainSearchResultPage.tsx
@@ -7,6 +7,9 @@ import { AgentsSection } from "../../../components/AgentsSection/AgentsSection";
import { FeaturedCreators } from "../../../components/FeaturedCreators/FeaturedCreators";
import { MainSearchResultPageLoading } from "../../../components/MainSearchResultPageLoading";
import { SearchBar } from "../../../components/SearchBar/SearchBar";
+import { SectionHeader } from "../../../components/SectionHeader";
+import { SkillCard } from "../../../components/SkillsSection/components/SkillCard";
+import { BookOpen01Icon } from "@hugeicons/core-free-icons";
import { useMainSearchResultPage } from "./useMainSearchResultPage";
import { ArrowLeft02Icon } from "@hugeicons/core-free-icons";
import { Icon } from "@/components/atoms/Icon/Icon";
@@ -23,13 +26,17 @@ export const MainSearchResultPage = ({
const {
agents,
creators,
+ skills,
totalCount,
agentsCount,
creatorsCount,
+ skillsCount,
handleFilterChange,
handleSortChange,
showAgents,
showCreators,
+ showSkills,
+ isSkillsHubEnabled,
isAgentsLoading,
isCreatorsLoading,
isAgentsError,
@@ -90,6 +97,7 @@ export const MainSearchResultPage = ({
totalCount={totalCount}
agentsCount={agentsCount}
creatorsCount={creatorsCount}
+ skillsCount={isSkillsHubEnabled ? skillsCount : undefined}
onFilterChange={handleFilterChange}
/>
<div className="mt-4 md:!mt-0">
@@ -101,6 +109,26 @@ export const MainSearchResultPage = ({
{showAgents && agentsCount > 0 && agents && (
<AgentsSection agents={agents} />
)}
+ {showSkills && skillsCount > 0 ? (
+ <section aria-labelledby="search-skills-heading">
+ <SectionHeader
+ titleIcon={
+ <Icon icon={BookOpen01Icon} size={30} aria-hidden />
+ }
+ title="Skills"
+ titleId="search-skills-heading"
+ />
+ <div className="grid grid-cols-1 gap-5 md:grid-cols-2">
+ {skills.map((skill) => (
+ <SkillCard
+ key={skill.slug}
+ skill={skill}
+ isInstalled={false}
+ />
+ ))}
+ </div>
+ </section>
+ ) : null}
<div className="h-[1rem] w-full" />
{showCreators && creatorsCount > 0 && creators && (
<FeaturedCreators
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/useMainSearchResultPage.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/useMainSearchResultPage.ts
index df09196446..e19bff4b43 100644
--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/useMainSearchResultPage.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/useMainSearchResultPage.ts
@@ -1,11 +1,14 @@
import {
+ useGetV2ListMarketplaceSkills,
useGetV2ListStoreAgents,
useGetV2ListStoreCreators,
} from "@/app/api/__generated__/endpoints/store/store";
+import { okData } from "@/app/api/helpers";
import { CreatorsResponse } from "@/app/api/__generated__/models/creatorsResponse";
import { GetV2ListStoreAgentsParams } from "@/app/api/__generated__/models/getV2ListStoreAgentsParams";
import { GetV2ListStoreCreatorsParams } from "@/app/api/__generated__/models/getV2ListStoreCreatorsParams";
import { StoreAgentsResponse } from "@/app/api/__generated__/models/storeAgentsResponse";
+import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
import { useState, useMemo } from "react";
type MarketplaceSearchSort = GetV2ListStoreAgentsParams["sorted_by"];
@@ -22,6 +25,8 @@ export const useMainSearchResultPage = ({
}: useMainSearchResultPageType) => {
const [showAgents, setShowAgents] = useState(true);
const [showCreators, setShowCreators] = useState(true);
+ const [showSkills, setShowSkills] = useState(true);
+ const skillsHub = useFlagStatus(Flag.SKILLS_HUB);
const [clientSortBy, setClientSortBy] = useState<string>(
sort ?? "updated_at",
);
@@ -72,6 +77,17 @@ export const useMainSearchResultPage = ({
},
);
+ const { data: skillsData, isLoading: isSkillsLoading } =
+ useGetV2ListMarketplaceSkills(
+ { search_query: searchTerm },
+ {
+ query: {
+ enabled: skillsHub.ready && skillsHub.enabled,
+ select: (response) => okData(response)?.skills ?? [],
+ },
+ },
+ );
+
// This is the strategy, we are using for sorting the agents and creators.
// currently we are doing it client side but maybe we will shift it to the server side.
// we will store the sortBy state in the url params, and then refetch the data with the new sortBy.
@@ -104,21 +120,16 @@ export const useMainSearchResultPage = ({
}
}, [creatorsData, clientSortBy]);
+ const skills = skillsData ?? [];
const agentsCount = agents?.length ?? 0;
const creatorsCount = creators?.length ?? 0;
- const totalCount = agentsCount + creatorsCount;
+ const skillsCount = skills.length;
+ const totalCount = agentsCount + creatorsCount + skillsCount;
const handleFilterChange = (value: string) => {
- if (value === "agents") {
- setShowAgents(true);
- setShowCreators(false);
- } else if (value === "creators") {
- setShowAgents(false);
- setShowCreators(true);
- } else {
- setShowAgents(true);
- setShowCreators(true);
- }
+ setShowAgents(value === "all" || value === "agents");
+ setShowCreators(value === "all" || value === "creators");
+ setShowSkills(value === "all" || value === "skills");
};
const handleSortChange = (sortValue: string) => {
@@ -128,15 +139,20 @@ export const useMainSearchResultPage = ({
return {
agents,
creators,
+ skills,
handleFilterChange,
handleSortChange,
agentsCount,
creatorsCount,
+ skillsCount,
totalCount,
showAgents,
showCreators,
+ showSkills,
+ isSkillsHubEnabled: skillsHub.ready && skillsHub.enabled,
isAgentsLoading,
isCreatorsLoading,
+ isSkillsLoading,
isAgentsError,
isCreatorsError,
};
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/helpers.test.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/helpers.test.ts
new file mode 100644
index 0000000000..cfe75148e5
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/helpers.test.ts
@@ -0,0 +1,47 @@
+import { describe, expect, test } from "vitest";
+import { prepareSkillBody } from "../components/helpers";
+
+describe("prepareSkillBody", () => {
+ test("drops a leading title that repeats the page's", () => {
+ const body = "# Outreach playbook\n\nFour sentences, no more.";
+
+ expect(prepareSkillBody(body, "Outreach playbook")).toBe(
+ "Four sentences, no more.",
+ );
+ });
+
+ test("keeps a leading heading that says something else", () => {
+ const body = "# Before you start\n\nRead this.";
+
+ expect(prepareSkillBody(body, "Outreach playbook")).toContain(
+ "### Before you start",
+ );
+ });
+
+ test("lands the shallowest heading on h3 whatever level it starts at", () => {
+ // A "##"-only body must not start at h4 just because it skipped h1.
+ const shifted = prepareSkillBody("## Research\n\n### Notes", "Anything");
+
+ expect(shifted).toContain("### Research");
+ expect(shifted).toContain("#### Notes");
+ });
+
+ test("keeps relative depth when the body starts at h1", () => {
+ const shifted = prepareSkillBody("# Top\n\n## Under", "Anything");
+
+ expect(shifted).toContain("### Top");
+ expect(shifted).toContain("#### Under");
+ });
+
+ test("leaves hashes inside a fenced block alone", () => {
+ const body = "## Real\n\n```bash\n# not a heading\n```";
+ const shifted = prepareSkillBody(body, "Anything");
+
+ expect(shifted).toContain("### Real");
+ expect(shifted).toContain("# not a heading");
+ });
+
+ test("returns a body with no headings unchanged", () => {
+ expect(prepareSkillBody("Just prose.", "Anything")).toBe("Just prose.");
+ });
+});
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
new file mode 100644
index 0000000000..a8c9d5dc23
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/main.test.tsx
@@ -0,0 +1,263 @@
+import {
+ getGetV2GetMarketplaceSkillMockHandler200,
+ getPostV2InstallMarketplaceSkillMockHandler200,
+ getGetV2GetMarketplaceSkillMockHandler404,
+ getPostV2InstallMarketplaceSkillMockHandler401,
+} from "@/app/api/__generated__/endpoints/store/store.msw";
+import { getGetV1ListCredentialsMockHandler200 } from "@/app/api/__generated__/endpoints/integrations/integrations.msw";
+import type { CredentialsMetaResponse } from "@/app/api/__generated__/models/credentialsMetaResponse";
+import type { MarketplaceSkillDetails } from "@/app/api/__generated__/models/marketplaceSkillDetails";
+import { server } from "@/mocks/mock-server";
+import { HttpResponse, http } from "msw";
+import {
+ configure,
+ render,
+ screen,
+ waitFor,
+} from "@/tests/integrations/test-utils";
+import userEvent from "@testing-library/user-event";
+import { beforeEach, describe, expect, test, vi } from "vitest";
+
+import { SkillPage } from "../components/SkillPage";
+
+// These pages wait on several queries before anything renders, and CI is
+// slower than a dev machine; the testing-library default is one second.
+configure({ asyncUtilTimeout: 10000 });
+
+const mockUseAuth = vi.hoisted(() => vi.fn());
+const mockNotFound = vi.hoisted(() => vi.fn());
+const skillsHubFlag = vi.hoisted(() => ({ enabled: true, ready: true }));
+
+vi.mock("next/navigation", () => ({
+ useRouter: () => ({
+ back: vi.fn(),
+ forward: vi.fn(),
+ prefetch: vi.fn(),
+ push: vi.fn(),
+ refresh: vi.fn(),
+ replace: vi.fn(),
+ }),
+ usePathname: () => "/marketplace/skills/outreach-playbook",
+ useSearchParams: () => new URLSearchParams(),
+ useParams: () => ({ slug: "outreach-playbook" }),
+ notFound: mockNotFound,
+}));
+
+vi.mock("@/lib/auth/hooks/useAuth", () => ({ useAuth: mockUseAuth }));
+
+vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
+ const actual =
+ await importOriginal<
+ typeof import("@/services/feature-flags/use-get-flag")
+ >();
+ return { ...actual, useFlagStatus: () => skillsHubFlag };
+});
+
+const outreach: MarketplaceSkillDetails = {
+ slug: "outreach-playbook",
+ name: "Outreach playbook",
+ description: "Run cold outreach that gets replies.",
+ categories: ["sales"],
+ required_providers: ["google"],
+ install_count: 3,
+ creator: null,
+ creator_avatar: null,
+ skill_listing_version_id: "version-1",
+ body: [
+ "# Outreach playbook",
+ "Four sentences, no more.",
+ "## Before writing anything",
+ "### Research",
+ "Look for a **trigger** and record it as `trigger_note`.",
+ "- No greeting beyond their first name",
+ "1. The trigger, stated as a fact",
+ ].join("\n\n"),
+ triggers: ["cold email"],
+ updated_at: new Date("2026-09-07T00:00:00Z"),
+};
+
+const googleCredential = {
+ id: "cred-1",
+ provider: "google",
+ type: "oauth2",
+ title: "Google",
+} as CredentialsMetaResponse;
+
+/** The user's own skills, which is where "Added" comes from. Mutable so a
+ * test can let the install land the way the app does. */
+const userSkills: Array<{ name: string; description: string }> = [];
+
+function userSkillsHandler() {
+ return http.get("/api/proxy/api/skills", () => HttpResponse.json(userSkills));
+}
+
+function renderPage(credentials: CredentialsMetaResponse[]) {
+ server.use(
+ getGetV2GetMarketplaceSkillMockHandler200(outreach),
+ getPostV2InstallMarketplaceSkillMockHandler200({
+ name: "outreach-playbook",
+ required_providers: ["google"],
+ }),
+ getGetV1ListCredentialsMockHandler200(credentials),
+ userSkillsHandler(),
+ );
+ render(<SkillPage slug="outreach-playbook" />);
+}
+
+describe("Marketplace skill page", () => {
+ beforeEach(() => {
+ mockUseAuth.mockReturnValue({ user: { id: "user-1" }, isLoggedIn: true });
+ mockNotFound.mockClear();
+ skillsHubFlag.enabled = true;
+ skillsHubFlag.ready = true;
+ userSkills.length = 0;
+ server.use(userSkillsHandler());
+ });
+
+ test("is not found when the skills-hub flag is off", async () => {
+ skillsHubFlag.enabled = false;
+ renderPage([]);
+
+ // A bookmarked URL reaches this page without passing the marketplace
+ // shelf, so the shelf being hidden is not what keeps the feature dark.
+ expect(mockNotFound).toHaveBeenCalled();
+ expect(screen.queryByTestId("skill-install-button")).toBeNull();
+ });
+
+ test("shows the instructions the AutoPilot will follow", async () => {
+ renderPage([]);
+
+ expect(
+ await screen.findByText("Run cold outreach that gets replies."),
+ ).toBeDefined();
+ // The SKILL.md renders as prose, not as a wall of raw markdown: its own
+ // "# Outreach playbook" becomes a heading rather than literal text.
+ expect(await screen.findByText(/Four sentences, no more/)).toBeDefined();
+ // The body's own leading "# Outreach playbook" is dropped, so the title
+ // is the page's <h1> and nothing repeats it.
+ expect(
+ screen.getAllByRole("heading", { name: "Outreach playbook" }),
+ ).toHaveLength(1);
+ });
+
+ test("installs in one click and offers the connect step afterwards", async () => {
+ renderPage([]);
+
+ const button = await screen.findByTestId(
+ "skill-install-button",
+ undefined,
+ {
+ timeout: 10000,
+ },
+ );
+ server.use(
+ http.get("/api/proxy/api/skills", () =>
+ HttpResponse.json([
+ { name: "outreach-playbook", description: "Installed copy" },
+ ]),
+ ),
+ );
+ await userEvent.click(button);
+
+ expect(await screen.findByText("Added to AutoPilot")).toBeDefined();
+ const connectStep = await screen.findByTestId("skill-connect-step");
+ // The unconnected case is the normal path, so it must not read as a
+ // failure: no error/warning wording, and the install already succeeded.
+ expect(connectStep.textContent).toMatch(/Connect when you first need it/);
+ expect(connectStep.textContent).not.toMatch(/error|required|must|cannot/i);
+ });
+
+ test("offers no connect step when the integration is already connected", async () => {
+ renderPage([googleCredential]);
+
+ const button = await screen.findByTestId(
+ "skill-install-button",
+ undefined,
+ {
+ timeout: 10000,
+ },
+ );
+ server.use(
+ http.get("/api/proxy/api/skills", () =>
+ HttpResponse.json([
+ { name: "outreach-playbook", description: "Installed copy" },
+ ]),
+ ),
+ );
+ await userEvent.click(button);
+
+ expect(await screen.findByText("Added to AutoPilot")).toBeDefined();
+ expect(screen.queryByTestId("skill-connect-step")).toBeNull();
+ });
+
+ test("sends a signed-out visitor to sign up, and back here afterwards", async () => {
+ mockUseAuth.mockReturnValue({ user: null, isLoggedIn: false });
+ renderPage([]);
+
+ const cta = await screen.findByRole("link", { name: "Add to AutoPilot" });
+ expect(cta.getAttribute("href")).toBe(
+ "/signup?next=%2Fmarketplace%2Fskills%2Foutreach-playbook",
+ );
+ expect(screen.queryByTestId("skill-install-button")).toBeNull();
+ });
+
+ test("marks a skill the user already has without them clicking", async () => {
+ userSkills.push({ name: "outreach-playbook", description: "Installed" });
+ renderPage([]);
+
+ expect(
+ await screen.findByText("Added to AutoPilot", undefined, {
+ timeout: 10000,
+ }),
+ ).toBeDefined();
+ expect(screen.queryByTestId("skill-install-button")).toBeNull();
+ });
+
+ test("renders every part of the SKILL.md, not just its paragraphs", async () => {
+ renderPage([]);
+
+ expect(await screen.findByText("Before writing anything")).toBeDefined();
+ expect(await screen.findByText("Research")).toBeDefined();
+ expect(await screen.findByText("trigger")).toBeDefined();
+ expect(await screen.findByText("trigger_note")).toBeDefined();
+ expect(
+ await screen.findByText("No greeting beyond their first name"),
+ ).toBeDefined();
+ expect(
+ await screen.findByText("The trigger, stated as a fact"),
+ ).toBeDefined();
+ });
+
+ test("is a 404 when the listing is gone, not an error card", async () => {
+ server.use(getGetV2GetMarketplaceSkillMockHandler404());
+ render(<SkillPage slug="outreach-playbook" />);
+
+ await waitFor(() => expect(mockNotFound).toHaveBeenCalled());
+ });
+
+ test("keeps the panel usable when the install fails", async () => {
+ renderPage([]);
+ await screen.findByTestId("skill-install-button", undefined, {
+ timeout: 10000,
+ });
+ // A rejected install must not leave an unhandled rejection or a stuck
+ // spinner: the button comes back and no success state is claimed.
+ server.use(getPostV2InstallMarketplaceSkillMockHandler401());
+
+ await userEvent.click(screen.getByTestId("skill-install-button"));
+
+ expect(await screen.findByTestId("skill-install-button")).toBeDefined();
+ expect(screen.queryByText("Added to AutoPilot")).toBeNull();
+ expect(screen.queryByTestId("skill-connect-step")).toBeNull();
+ });
+
+ test("shows no connect step before the skill is installed", async () => {
+ renderPage([]);
+
+ await screen.findByTestId("skill-install-button", undefined, {
+ timeout: 10000,
+ });
+
+ expect(screen.queryByTestId("skill-connect-step")).toBeNull();
+ });
+});
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
new file mode 100644
index 0000000000..c5ec5a430c
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/__tests__/page.test.tsx
@@ -0,0 +1,55 @@
+import { getGetV2GetMarketplaceSkillMockHandler200 } from "@/app/api/__generated__/endpoints/store/store.msw";
+import type { MarketplaceSkillDetails } from "@/app/api/__generated__/models/marketplaceSkillDetails";
+import { server } from "@/mocks/mock-server";
+import { describe, expect, test, vi } from "vitest";
+import MarketplaceSkillPage, { generateMetadata } from "../page";
+
+vi.mock("next/navigation", () => ({
+ useRouter: () => ({ push: vi.fn(), replace: vi.fn(), prefetch: vi.fn() }),
+ usePathname: () => "/marketplace/skills/outreach-playbook",
+ useSearchParams: () => new URLSearchParams(),
+ useParams: () => ({ slug: "outreach-playbook" }),
+}));
+
+const outreach = {
+ slug: "outreach-playbook",
+ name: "Outreach playbook",
+ description: "Run cold outreach that gets replies.",
+ categories: ["sales"],
+ required_providers: ["google"],
+ install_count: 3,
+ creator: null,
+ creator_avatar: null,
+ skill_listing_version_id: "version-1",
+ body: "# Outreach playbook\n",
+ triggers: ["cold email"],
+ updated_at: new Date("2026-09-07T00:00:00Z"),
+} as MarketplaceSkillDetails;
+
+const params = Promise.resolve({ slug: "outreach-playbook" });
+
+describe("marketplace skill page module", () => {
+ test("titles the tab and describes the page from the listing itself", async () => {
+ server.use(getGetV2GetMarketplaceSkillMockHandler200(outreach));
+
+ const metadata = await generateMetadata({ params });
+
+ expect(metadata.title).toBe("Outreach playbook - AutoGPT Marketplace");
+ expect(metadata.description).toBe("Run cold outreach that gets replies.");
+ });
+
+ test("prefetches the listing so the page arrives populated", async () => {
+ let requested = 0;
+ server.use(
+ getGetV2GetMarketplaceSkillMockHandler200(() => {
+ requested += 1;
+ return outreach;
+ }),
+ );
+
+ const element = await MarketplaceSkillPage({ params });
+
+ expect(requested).toBeGreaterThan(0);
+ expect(element).toBeDefined();
+ });
+});
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/ConnectStep.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/ConnectStep.tsx
new file mode 100644
index 0000000000..740bcd0a59
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/ConnectStep.tsx
@@ -0,0 +1,43 @@
+import { Button } from "@/components/atoms/Button/Button";
+import { Icon } from "@/components/atoms/Icon/Icon";
+import { Text } from "@/components/atoms/Text/Text";
+import { PlugSocketIcon } from "@hugeicons/core-free-icons";
+
+interface Props {
+ names: string[];
+ onConnect: () => void;
+}
+
+/** Offered after the install has already succeeded, so it reads as the next
+ * thing worth doing rather than something that went wrong. */
+export function ConnectStep({ names, onConnect }: Props) {
+ const providers = new Intl.ListFormat("en", {
+ style: "long",
+ type: "conjunction",
+ }).format(names);
+
+ return (
+ <div
+ className="mt-6 flex flex-wrap items-center gap-3 rounded-xl border border-zinc-200 bg-white p-4"
+ data-testid="skill-connect-step"
+ >
+ <Icon
+ icon={PlugSocketIcon}
+ size={18}
+ className="text-zinc-500"
+ aria-hidden
+ />
+ <Text variant="small" className="!text-zinc-600">
+ Its steps use {providers}. Connect when you first need it.
+ </Text>
+ <Button
+ variant="secondary"
+ size="small"
+ onClick={onConnect}
+ className="ml-auto"
+ >
+ Connect
+ </Button>
+ </div>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillActions.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillActions.tsx
new file mode 100644
index 0000000000..dd7799627d
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillActions.tsx
@@ -0,0 +1,76 @@
+import { Badge } from "@/components/atoms/Badge/Badge";
+import { Button } from "@/components/atoms/Button/Button";
+import { Icon } from "@/components/atoms/Icon/Icon";
+import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";
+import { CheckmarkCircle02Icon } from "@hugeicons/core-free-icons";
+
+// Sized and shaped like the small button beside it so the pair reads as one row.
+const STATUS_CLASS = "h-9 rounded-full px-3.5 text-sm";
+
+const SECONDARY_CLASS =
+ "border-zinc-200 bg-white shadow-[0_1px_2px_rgba(16,24,40,0.05)] hover:border-zinc-300 hover:bg-zinc-50";
+
+interface Props {
+ slug: string;
+ isLoggedIn: boolean;
+ isReady: boolean;
+ isAdded: boolean;
+ isAdding: boolean;
+ onAdd: () => void;
+}
+
+/** The page's one call to action, in the header beside the title. A visitor
+ * gets the same promise, with a return path that makes it true. */
+export function SkillActions({
+ slug,
+ isLoggedIn,
+ isReady,
+ isAdded,
+ isAdding,
+ onAdd,
+}: Props) {
+ return (
+ <div aria-live="polite" className="w-full sm:w-auto">
+ {!isReady ? (
+ <Skeleton className="h-9 w-28 rounded-full" />
+ ) : !isLoggedIn ? (
+ <Button
+ as="NextLink"
+ href={`/signup?next=${encodeURIComponent(`/marketplace/skills/${slug}`)}`}
+ variant="primary"
+ size="small"
+ className="w-full sm:w-auto"
+ >
+ Add to AutoPilot
+ </Button>
+ ) : isAdded ? (
+ <div className="flex flex-wrap items-center gap-3">
+ <Badge variant="success" className={STATUS_CLASS}>
+ <Icon icon={CheckmarkCircle02Icon} size={16} aria-hidden />
+ Added to AutoPilot
+ </Badge>
+ <Button
+ as="NextLink"
+ href="/library/skills"
+ variant="secondary"
+ size="small"
+ className={SECONDARY_CLASS}
+ >
+ Your skills
+ </Button>
+ </div>
+ ) : (
+ <Button
+ variant="primary"
+ size="small"
+ onClick={onAdd}
+ loading={isAdding}
+ className="w-full sm:w-auto"
+ data-testid="skill-install-button"
+ >
+ Add to AutoPilot
+ </Button>
+ )}
+ </div>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillBody.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillBody.tsx
new file mode 100644
index 0000000000..3c804d6948
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillBody.tsx
@@ -0,0 +1,99 @@
+import ReactMarkdown, { type Components } from "react-markdown";
+import remarkGfm from "remark-gfm";
+import { prepareSkillBody } from "./helpers";
+
+interface Props {
+ body: string;
+ title: string;
+}
+
+export function SkillBody({ body, title }: Props) {
+ return (
+ <div className="text-[15px] leading-6 text-zinc-700 [overflow-wrap:anywhere]">
+ <ReactMarkdown remarkPlugins={[remarkGfm]} components={components}>
+ {prepareSkillBody(body, title)}
+ </ReactMarkdown>
+ </div>
+ );
+}
+
+const components: Components = {
+ h1: ({ children }) => <Heading level={3}>{children}</Heading>,
+ h2: ({ children }) => <Heading level={3}>{children}</Heading>,
+ h3: ({ children }) => <Heading level={3}>{children}</Heading>,
+ h4: ({ children }) => <Heading level={4}>{children}</Heading>,
+ h5: ({ children }) => <Heading level={5}>{children}</Heading>,
+ h6: ({ children }) => <Heading level={5}>{children}</Heading>,
+ p: ({ children }) => <p className="mb-3">{children}</p>,
+ ul: ({ children }) => (
+ <ul className="mb-3 ml-5 list-disc space-y-1">{children}</ul>
+ ),
+ ol: ({ children }) => (
+ <ol className="mb-3 ml-5 list-decimal space-y-1">{children}</ol>
+ ),
+ strong: ({ children }) => (
+ <strong className="font-semibold text-zinc-900">{children}</strong>
+ ),
+ a: ({ children, href }) => {
+ const isExternal = /^https?:\/\//i.test(href ?? "");
+ return (
+ <a
+ href={href}
+ rel="noreferrer"
+ {...(isExternal ? { target: "_blank" } : {})}
+ className="text-zinc-900 underline underline-offset-2 transition-colors hover:text-violet-600"
+ >
+ {children}
+ </a>
+ );
+ },
+ // Creator markdown carries no dimensions, so the shift is contained by the
+ // radius and max-width rather than eliminated.
+ img: ({ src, alt }) => (
+ <img
+ src={typeof src === "string" ? src : undefined}
+ alt={alt ?? ""}
+ loading="lazy"
+ className="my-3 h-auto max-w-full rounded-lg"
+ />
+ ),
+ table: ({ children }) => (
+ <div className="mb-3 overflow-x-auto">
+ <table className="w-full border-collapse text-sm">{children}</table>
+ </div>
+ ),
+ th: ({ children }) => (
+ <th className="border-b border-zinc-200 py-1.5 pr-4 text-left align-top font-medium text-zinc-900">
+ {children}
+ </th>
+ ),
+ td: ({ children }) => <td className="py-1.5 pr-4 align-top">{children}</td>,
+ code: ({ children }) => (
+ <code className="break-words rounded bg-zinc-100 px-1 py-0.5 font-mono text-xs">
+ {children}
+ </code>
+ ),
+ // The fenced block styles the frame; the code inside keeps only its font.
+ pre: ({ children }) => (
+ <pre className="mb-3 overflow-x-auto rounded-md bg-zinc-50 p-3 text-[13px] [&_code]:bg-transparent [&_code]:p-0">
+ {children}
+ </pre>
+ ),
+};
+
+const HEADING_CLASS: Record<number, string> = {
+ 3: "mb-2 mt-6 text-base font-semibold text-zinc-900 first:mt-0",
+ 4: "mb-2 mt-5 text-[15px] font-semibold text-zinc-900 first:mt-0",
+ 5: "mb-1.5 mt-4 text-sm font-medium text-zinc-800 first:mt-0",
+};
+
+function Heading({
+ level,
+ children,
+}: {
+ level: 3 | 4 | 5;
+ children: React.ReactNode;
+}) {
+ const Tag = `h${level}` as "h3" | "h4" | "h5";
+ return <Tag className={HEADING_CLASS[level]}>{children}</Tag>;
+}
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
new file mode 100644
index 0000000000..a1962c8faa
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/SkillPage.tsx
@@ -0,0 +1,267 @@
+"use client";
+
+import {
+ Avatar,
+ AvatarFallback,
+ AvatarImage,
+} from "@/components/atoms/Avatar/Avatar";
+import { Icon } from "@/components/atoms/Icon/Icon";
+import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";
+import { ConnectServiceDialog } from "@/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/ConnectServiceDialog";
+import { formatProviderName } from "@/components/contextual/IntegrationsPanel/helpers";
+import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
+import { IntegrationLogo } from "@/components/molecules/IntegrationLogo/IntegrationLogo";
+import { cn } from "@/lib/utils";
+import { formatTimeAgo } from "@/lib/utils/time";
+import { ArrowLeft02Icon, BookOpen01Icon } from "@hugeicons/core-free-icons";
+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 { ExpertSection } from "../../../experts/[expertId]/components/ExpertSection";
+import { ConnectStep } from "./ConnectStep";
+import { SkillActions } from "./SkillActions";
+import { SkillBody } from "./SkillBody";
+import { useSkillPage } from "./useSkillPage";
+
+const MAIN_CLASS =
+ "mx-auto flex w-full max-w-[760px] flex-col px-6 pb-24 pt-8 md:px-8";
+
+interface Props {
+ slug: string;
+}
+
+export function SkillPage({ slug }: Props) {
+ const {
+ skill,
+ isLoggedIn,
+ isLoading,
+ isError,
+ isNotFound,
+ refetch,
+ isReady,
+ flagEnabled,
+ flagReady,
+ isAdded,
+ isAdding,
+ addToAutoPilot,
+ pendingConnections,
+ moreSkills,
+ isConnectOpen,
+ openConnect,
+ setIsConnectOpen,
+ handleConnected,
+ } = useSkillPage(slug);
+
+ // A bookmarked URL reaches this page without passing the marketplace shelf,
+ // so the shelf being hidden is not what keeps the feature dark.
+ if (flagReady && !flagEnabled) notFound();
+ if (isNotFound) notFound();
+
+ if (!flagReady || isLoading) return <SkillPageSkeleton />;
+
+ if (isError || !skill) {
+ return (
+ <main className={MAIN_CLASS}>
+ <BackToMarketplaceLink />
+ <ErrorCard
+ isSuccess={false}
+ responseError={{ message: "Couldn't load this skill right now" }}
+ context="marketplace skill"
+ onRetry={() => refetch()}
+ className="max-w-md"
+ />
+ </main>
+ );
+ }
+
+ const title = formatSkillTitle(skill.name);
+ const { accent, icon } = getCategoryAccent(skill.categories[0]);
+ const providers = skill.required_providers;
+
+ return (
+ <main className={MAIN_CLASS}>
+ <BackToMarketplaceLink />
+
+ <header>
+ <div className="flex flex-wrap items-center gap-4 sm:gap-5">
+ <span className="inline-flex h-18 w-18 shrink-0 items-center justify-center rounded-2xl bg-white shadow-sm ring-1 ring-black/5">
+ <Icon
+ icon={BookOpen01Icon}
+ size={32}
+ className={accent.icon}
+ aria-hidden
+ />
+ </span>
+ <div className="min-w-0 flex-1">
+ <h1 className="text-[28px] font-semibold leading-8 tracking-[-0.02em] text-zinc-900">
+ {title}
+ </h1>
+ {icon && skill.categories[0] ? (
+ <span
+ className={cn(
+ "mt-2 inline-flex items-center gap-1.5 rounded-md px-2 py-0.5 text-xs font-medium",
+ accent.pill,
+ )}
+ >
+ <Icon icon={icon} size={12} aria-hidden />
+ {formatSkillTitle(skill.categories[0])}
+ </span>
+ ) : null}
+ </div>
+ <SkillActions
+ slug={slug}
+ isLoggedIn={isLoggedIn}
+ isReady={isReady}
+ isAdded={isAdded}
+ isAdding={isAdding}
+ onAdd={addToAutoPilot}
+ />
+ </div>
+
+ <p className="mt-5 max-w-[60ch] text-[17px] leading-7 text-zinc-600">
+ {skill.description}
+ </p>
+
+ <div className="mt-3 flex flex-wrap items-center gap-x-2 gap-y-1 text-[13px] text-zinc-600">
+ <span className="inline-flex items-center gap-1.5">
+ <Avatar className="h-5 w-5">
+ {skill.creator_avatar ? (
+ <AvatarImage
+ src={skill.creator_avatar}
+ alt={skill.creator ?? "AutoGPT"}
+ />
+ ) : null}
+ <AvatarFallback>{skill.creator ?? "AutoGPT"}</AvatarFallback>
+ </Avatar>
+ by {skill.creator ?? "AutoGPT"}
+ </span>
+ <span aria-hidden>·</span>
+ <span>
+ {skill.install_count === 0
+ ? "New"
+ : `${skill.install_count.toLocaleString()} installed`}
+ </span>
+ {skill.updated_at ? (
+ <>
+ <span aria-hidden>·</span>
+ <span>Updated {formatTimeAgo(String(skill.updated_at))}</span>
+ </>
+ ) : null}
+ {providers.length > 0 ? (
+ <>
+ <span aria-hidden>·</span>
+ <span className="inline-flex items-center gap-1.5">
+ Works with
+ <IntegrationLogo provider={providers[0]} size={14} alt="" />
+ {formatProviderList(providers)}
+ </span>
+ </>
+ ) : null}
+ </div>
+
+ {isAdded && pendingConnections.length > 0 ? (
+ <ConnectStep names={pendingConnections} onConnect={openConnect} />
+ ) : null}
+ </header>
+
+ <div className="mt-8 flex flex-col gap-10 border-t border-zinc-200 pt-8">
+ <ExpertSection
+ title="Instructions"
+ description={
+ skill.body.trim()
+ ? "What your AutoPilot follows once this skill is added."
+ : "This skill has no instructions yet."
+ }
+ >
+ {skill.body.trim() ? (
+ <SkillBody body={skill.body} title={title} />
+ ) : null}
+ </ExpertSection>
+
+ {skill.triggers.length > 0 ? (
+ <ExpertSection
+ title="Triggers"
+ count={skill.triggers.length}
+ description="Phrases that make your AutoPilot reach for it."
+ >
+ <div className="flex flex-wrap gap-2">
+ {skill.triggers.map((trigger) => (
+ <span
+ key={trigger}
+ className="rounded-lg bg-zinc-100 px-2.5 py-1 text-sm font-medium text-zinc-600"
+ >
+ {trigger}
+ </span>
+ ))}
+ </div>
+ </ExpertSection>
+ ) : null}
+
+ {moreSkills.length > 0 ? (
+ <ExpertSection title="More skills">
+ <div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
+ {moreSkills.map((other) => (
+ <SkillCard key={other.slug} skill={other} isInstalled={false} />
+ ))}
+ </div>
+ </ExpertSection>
+ ) : null}
+ </div>
+
+ <ConnectServiceDialog
+ open={isConnectOpen}
+ onOpenChange={setIsConnectOpen}
+ title={`Connect ${formatProviderList(providers)}`}
+ description={`${title}'s steps use ${formatProviderList(providers)}.`}
+ onConnected={handleConnected}
+ />
+ </main>
+ );
+}
+
+function BackToMarketplaceLink() {
+ return (
+ <Link
+ href="/marketplace#skills"
+ className="mb-6 inline-flex w-fit items-center gap-1.5 text-[13px] text-zinc-500 transition-colors hover:text-zinc-900"
+ data-testid="skill-back-to-marketplace"
+ >
+ <Icon icon={ArrowLeft02Icon} size={14} aria-hidden />
+ Back to marketplace
+ </Link>
+ );
+}
+
+// Matches the loaded page's shape so nothing shifts when the data lands.
+function SkillPageSkeleton() {
+ return (
+ <main className={MAIN_CLASS} role="status" aria-busy="true">
+ <Skeleton className="mb-6 h-4 w-40" />
+ <div className="flex flex-wrap items-center gap-4 sm:gap-5">
+ <Skeleton className="h-18 w-18 shrink-0 rounded-2xl" />
+ <div className="min-w-0 flex-1 space-y-2">
+ <Skeleton className="h-7 w-2/3" />
+ <Skeleton className="h-5 w-24 rounded-md" />
+ </div>
+ <Skeleton className="h-9 w-28 rounded-full" />
+ </div>
+ <Skeleton className="mt-5 h-6 w-4/5" />
+ <Skeleton className="mt-3 h-4 w-3/5" />
+ <div className="mt-8 space-y-3 border-t border-zinc-200 pt-8">
+ <Skeleton className="h-4 w-full" />
+ <Skeleton className="h-4 w-full" />
+ <Skeleton className="h-4 w-2/3" />
+ </div>
+ </main>
+ );
+}
+
+function formatProviderList(providers: string[]): string {
+ const names = providers.map(formatProviderName).filter(Boolean);
+ return new Intl.ListFormat("en", {
+ style: "long",
+ type: "conjunction",
+ }).format(names);
+}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/helpers.ts
new file mode 100644
index 0000000000..88870cea1b
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/helpers.ts
@@ -0,0 +1,58 @@
+const HEADING = /^(#{1,6})\s+(.*)$/;
+const FENCE = /^\s*(```|~~~)/;
+
+/** Strip the body's own leading title when it repeats the page's, then shift
+ * every heading so the shallowest lands on `<h3>` — the page owns `<h1>` and
+ * each section owns `<h2>`, and a `##`-only body should not start at `<h4>`.
+ * A leading `# ` that says something else is kept. */
+export function prepareSkillBody(body: string, title: string): string {
+ const lines = body.split("\n");
+ const headings = collectHeadings(lines);
+
+ const first = headings[0];
+ const isLeadingTitle =
+ first !== undefined &&
+ first.level === 1 &&
+ lines.slice(0, first.index).every((line) => line.trim() === "") &&
+ first.text.trim().toLowerCase() === title.trim().toLowerCase();
+
+ const kept = isLeadingTitle ? headings.slice(1) : headings;
+ if (kept.length === 0)
+ return isLeadingTitle ? dropLine(lines, first.index) : body;
+
+ const shallowest = Math.min(...kept.map((heading) => heading.level));
+ const shift = 3 - shallowest;
+
+ const shifted = lines.map((line, index) => {
+ const heading = kept.find((entry) => entry.index === index);
+ if (!heading) return line;
+ const level = Math.min(6, Math.max(1, heading.level + shift));
+ return `${"#".repeat(level)} ${heading.text}`;
+ });
+
+ return isLeadingTitle ? dropLine(shifted, first.index) : shifted.join("\n");
+}
+
+function collectHeadings(lines: string[]) {
+ const headings: Array<{ index: number; level: number; text: string }> = [];
+ let inFence = false;
+ lines.forEach((line, index) => {
+ if (FENCE.test(line)) {
+ inFence = !inFence;
+ return;
+ }
+ if (inFence) return;
+ const match = HEADING.exec(line);
+ if (match) {
+ headings.push({ index, level: match[1].length, text: match[2] });
+ }
+ });
+ return headings;
+}
+
+function dropLine(lines: string[], index: number): string {
+ return lines
+ .filter((_, position) => position !== index)
+ .join("\n")
+ .replace(/^\n+/, "");
+}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/useSkillPage.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/useSkillPage.ts
new file mode 100644
index 0000000000..a837d9a020
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/components/useSkillPage.ts
@@ -0,0 +1,122 @@
+import {
+ getGetV1ListCredentialsQueryKey,
+ useGetV1ListCredentials,
+} from "@/app/api/__generated__/endpoints/integrations/integrations";
+import {
+ getListCopilotSkillsQueryKey,
+ useListCopilotSkills,
+} from "@/app/api/__generated__/endpoints/skills/skills";
+import {
+ useGetV2GetMarketplaceSkill,
+ useGetV2ListMarketplaceSkills,
+ usePostV2InstallMarketplaceSkill,
+} from "@/app/api/__generated__/endpoints/store/store";
+import { okData } from "@/app/api/helpers";
+import { formatProviderName } from "@/components/contextual/IntegrationsPanel/helpers";
+import { useToast } from "@/components/molecules/Toast/use-toast";
+import { useAuth } from "@/lib/auth/hooks/useAuth";
+import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
+import { useQueryClient } from "@tanstack/react-query";
+import { useState } from "react";
+
+/** Two others, so the shelf under the body is one row. */
+const MORE_SKILLS_PAGE_SIZE = 3;
+
+export function useSkillPage(slug: string) {
+ const queryClient = useQueryClient();
+ const { isLoggedIn, isUserLoading } = useAuth();
+ const { toast } = useToast();
+ const flag = useFlagStatus(Flag.SKILLS_HUB);
+ const [isConnectOpen, setIsConnectOpen] = useState(false);
+
+ const query = useGetV2GetMarketplaceSkill(slug, {
+ query: { select: (response) => okData(response) ?? null },
+ });
+
+ // The install lands under the listing slug, so the user's own skill names
+ // are the truth about whether this one is already added — a reload no
+ // longer offers to install it again.
+ const installedSkills = useListCopilotSkills({
+ query: { select: (res) => okData(res) ?? [], enabled: isLoggedIn },
+ });
+ const isAdded = (installedSkills.data ?? []).some(
+ (skill) => skill.name === slug,
+ );
+
+ const credentials = useGetV1ListCredentials({
+ query: {
+ enabled: isLoggedIn,
+ select: (response) => okData(response) ?? [],
+ },
+ });
+ const connected = new Set(
+ (credentials.data ?? []).map((credential) => credential.provider),
+ );
+
+ const more = useGetV2ListMarketplaceSkills(
+ { page_size: MORE_SKILLS_PAGE_SIZE },
+ { query: { select: (response) => okData(response)?.skills ?? [] } },
+ );
+
+ const { mutate: install, isPending: isAdding } =
+ usePostV2InstallMarketplaceSkill({
+ mutation: {
+ onSuccess: (response) => {
+ if (response.status !== 200) return;
+ queryClient.invalidateQueries({
+ queryKey: getListCopilotSkillsQueryKey(),
+ });
+ },
+ onError: (error) => {
+ const status = (error as { status?: number }).status;
+ toast({
+ title: "Couldn't add this skill",
+ description:
+ status === 401
+ ? "Sign in and try again."
+ : error instanceof Error
+ ? error.message
+ : "Please try again.",
+ variant: "destructive",
+ });
+ },
+ },
+ });
+
+ const requiredProviders = query.data?.required_providers ?? [];
+
+ return {
+ skill: query.data ?? null,
+ isLoggedIn,
+ isLoading: query.isLoading,
+ isError: query.isError,
+ isNotFound: (query.error as { status?: number } | null)?.status === 404,
+ refetch: query.refetch,
+ // Nothing renders "Add" before auth, the flag and the user's own skills
+ // have all answered, so it never flashes into "Added".
+ isReady:
+ !isUserLoading &&
+ flag.ready &&
+ (!isLoggedIn || !installedSkills.isLoading),
+ flagEnabled: flag.enabled,
+ flagReady: flag.ready,
+ isAdded,
+ isAdding,
+ addToAutoPilot: () => install({ slug }),
+ // Connecting is a next step, never a precondition: the list only offers
+ // what is still worth setting up, after the install landed.
+ pendingConnections: requiredProviders
+ .filter((provider) => !connected.has(provider))
+ .map(formatProviderName),
+ moreSkills: (more.data ?? []).filter((skill) => skill.slug !== slug),
+ isConnectOpen,
+ openConnect: () => setIsConnectOpen(true),
+ setIsConnectOpen,
+ handleConnected: () => {
+ setIsConnectOpen(false);
+ queryClient.invalidateQueries({
+ queryKey: getGetV1ListCredentialsQueryKey(),
+ });
+ },
+ };
+}
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
new file mode 100644
index 0000000000..9612e2eb07
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/[slug]/page.tsx
@@ -0,0 +1,55 @@
+import {
+ getV2GetMarketplaceSkill,
+ 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";
+import { Metadata } from "next";
+import { SkillPage } from "./components/SkillPage";
+
+export const dynamic = "force-dynamic";
+
+type PageParams = { slug: string };
+
+export async function generateMetadata({
+ params: _params,
+}: {
+ params: Promise<PageParams>;
+}): Promise<Metadata> {
+ const { slug } = await _params;
+ // The generated client throws on any non-2xx, so an unknown or gated slug
+ // would render a 500 here instead of the page's own not-found.
+ try {
+ const { data } = await getV2GetMarketplaceSkill(slug);
+ const skill = data as MarketplaceSkillDetails;
+ return {
+ title: `${formatSkillTitle(skill.name)} - AutoGPT Marketplace`,
+ description: skill.description,
+ };
+ } catch {
+ return { title: "Skill - AutoGPT Marketplace" };
+ }
+}
+
+export default async function MarketplaceSkillPage({
+ params: _params,
+}: {
+ params: Promise<PageParams>;
+}) {
+ const { slug } = await _params;
+ const queryClient = getQueryClient();
+ await Promise.all([
+ prefetchGetV2GetMarketplaceSkillQuery(queryClient, slug),
+ // The "More skills" shelf under the body.
+ prefetchGetV2ListMarketplaceSkillsQuery(queryClient, { page_size: 3 }),
+ ]);
+
+ return (
+ <HydrationBoundary state={dehydrate(queryClient)}>
+ <SkillPage slug={slug} />
+ </HydrationBoundary>
+ );
+}
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
new file mode 100644
index 0000000000..6070cee9fd
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/__tests__/browse.test.tsx
@@ -0,0 +1,165 @@
+import { getListCopilotSkillsMockHandler200 } from "@/app/api/__generated__/endpoints/skills/skills.msw";
+import {
+ getGetV2ListMarketplaceSkillsMockHandler200,
+ getGetV2ListStoreCategoriesMockHandler,
+} from "@/app/api/__generated__/endpoints/store/store.msw";
+import type { MarketplaceSkill } from "@/app/api/__generated__/models/marketplaceSkill";
+import { server } from "@/mocks/mock-server";
+import {
+ configure,
+ render,
+ screen,
+ waitFor,
+} from "@/tests/integrations/test-utils";
+import userEvent from "@testing-library/user-event";
+import { HttpResponse, http } from "msw";
+import { beforeEach, describe, expect, test, vi } from "vitest";
+
+import { SkillsBrowsePage } from "../components/SkillsBrowsePage/SkillsBrowsePage";
+
+// These pages wait on several queries before anything renders, and CI is
+// slower than a dev machine; the testing-library default is one second.
+configure({ asyncUtilTimeout: 10000 });
+
+const mockUseAuth = vi.hoisted(() => vi.fn());
+const mockPush = vi.hoisted(() => vi.fn());
+const mockNotFound = vi.hoisted(() => vi.fn());
+const searchParams = vi.hoisted(() => ({ value: "" }));
+const flag = vi.hoisted(() => ({ enabled: true, ready: true }));
+
+vi.mock("next/navigation", () => ({
+ useRouter: () => ({
+ back: vi.fn(),
+ forward: vi.fn(),
+ prefetch: vi.fn(),
+ push: mockPush,
+ refresh: vi.fn(),
+ replace: vi.fn(),
+ }),
+ usePathname: () => "/marketplace/skills",
+ useSearchParams: () => new URLSearchParams(searchParams.value),
+ useParams: () => ({}),
+ notFound: mockNotFound,
+}));
+
+vi.mock("@/lib/auth/hooks/useAuth", () => ({ useAuth: mockUseAuth }));
+
+vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
+ const actual =
+ await importOriginal<
+ typeof import("@/services/feature-flags/use-get-flag")
+ >();
+ return { ...actual, useFlagStatus: () => flag };
+});
+
+const brandVoice: MarketplaceSkill = {
+ slug: "brand-voice-guide",
+ name: "brand-voice-guide",
+ description: "Write in a consistent brand voice.",
+ categories: ["content"],
+ required_providers: [],
+ install_count: 12,
+ creator: null,
+ creator_avatar: null,
+};
+
+const CATEGORIES = [
+ { value: "content", label: "Content", description: "Writing and assets" },
+ { value: "finance", label: "Finance", description: "Money and reporting" },
+];
+
+function listing(skills: MarketplaceSkill[]) {
+ return getGetV2ListMarketplaceSkillsMockHandler200({
+ skills,
+ pagination: {
+ total_items: skills.length,
+ total_pages: 1,
+ current_page: 1,
+ page_size: 20,
+ },
+ });
+}
+
+describe("Marketplace skills browse page", () => {
+ beforeEach(() => {
+ searchParams.value = "";
+ flag.enabled = true;
+ flag.ready = true;
+ mockPush.mockClear();
+ mockNotFound.mockClear();
+ mockUseAuth.mockReturnValue({ user: { id: "user-1" }, isLoggedIn: true });
+ server.use(
+ getListCopilotSkillsMockHandler200([]),
+ getGetV2ListStoreCategoriesMockHandler(CATEGORIES),
+ );
+ });
+
+ test("lists the catalogue with a count", async () => {
+ server.use(listing([brandVoice]));
+
+ render(<SkillsBrowsePage />);
+
+ expect(
+ await screen.findByRole("heading", { name: /AutoPilot Skills/ }),
+ ).toBeDefined();
+ const card = await screen.findByRole("link", { name: /Brand voice guide/ });
+ expect(card.getAttribute("href")).toBe(
+ "/marketplace/skills/brand-voice-guide",
+ );
+ expect(await screen.findByText("1 skill")).toBeDefined();
+ });
+
+ test("sends a category choice to the URL", async () => {
+ server.use(listing([brandVoice]));
+
+ render(<SkillsBrowsePage />);
+
+ await screen.findByRole("link", { name: /Brand voice guide/ });
+ await userEvent.click(screen.getByRole("button", { name: "Content" }));
+
+ expect(mockPush).toHaveBeenCalledWith(
+ "/marketplace/skills?category=content",
+ );
+ });
+
+ test("asks a filtered empty result to show all", async () => {
+ searchParams.value = "category=finance";
+ server.use(listing([]));
+
+ render(<SkillsBrowsePage />);
+
+ expect(
+ await screen.findByTestId("skills-browse-empty", undefined, {
+ timeout: 10000,
+ }),
+ ).toBeDefined();
+ expect(screen.getByText(/No Finance skills yet/)).toBeDefined();
+ await userEvent.click(screen.getByRole("button", { name: "Show all" }));
+ expect(mockPush).toHaveBeenCalledWith("/marketplace/skills");
+ });
+
+ test("keeps a retry on the page when the catalogue fails", async () => {
+ server.use(
+ http.get("/api/proxy/api/store/skills", () =>
+ HttpResponse.json({ detail: "Unavailable" }, { status: 500 }),
+ ),
+ );
+
+ render(<SkillsBrowsePage />);
+
+ expect(
+ await screen.findByText(/Couldn't load skills right now/, undefined, {
+ timeout: 10000,
+ }),
+ ).toBeDefined();
+ });
+
+ test("is not found when the skills-hub flag is off", async () => {
+ flag.enabled = false;
+ server.use(listing([brandVoice]));
+
+ render(<SkillsBrowsePage />);
+
+ await waitFor(() => expect(mockNotFound).toHaveBeenCalled());
+ });
+});
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/components/SkillsBrowsePage/SkillsBrowsePage.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/components/SkillsBrowsePage/SkillsBrowsePage.tsx
new file mode 100644
index 0000000000..98d0e6e9e6
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/components/SkillsBrowsePage/SkillsBrowsePage.tsx
@@ -0,0 +1,169 @@
+"use client";
+
+import { Icon } from "@/components/atoms/Icon/Icon";
+import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";
+import { Text } from "@/components/atoms/Text/Text";
+import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";
+import { InfiniteList } from "@/components/molecules/InfiniteList/InfiniteList";
+import { useStoreCategories } from "@/hooks/useStoreCategories";
+import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";
+import { ArrowLeft02Icon, BookOpen01Icon } from "@hugeicons/core-free-icons";
+import Link from "next/link";
+import { notFound } from "next/navigation";
+import { CategoryFilter } from "../../../components/CategoryFilter/CategoryFilter";
+import { SearchBar } from "../../../components/SearchBar/SearchBar";
+import { SkillCard } from "../../../components/SkillsSection/components/SkillCard";
+import { useSkillsBrowsePage } from "./useSkillsBrowsePage";
+
+const GRID_CLASS = "grid grid-cols-1 gap-5 md:grid-cols-2";
+
+export function SkillsBrowsePage() {
+ const { enabled, ready } = useFlagStatus(Flag.SKILLS_HUB);
+ const {
+ search,
+ category,
+ skills,
+ total,
+ installedSlugs,
+ isLoading,
+ isError,
+ refetch,
+ hasMore,
+ isFetchingMore,
+ loadMore,
+ setSearch,
+ setCategory,
+ } = useSkillsBrowsePage();
+ const { categories } = useStoreCategories();
+
+ if (ready && !enabled) notFound();
+
+ return (
+ <main className="mx-auto w-full max-w-[1360px] px-6 pb-16 pt-8 md:px-10 lg:px-14">
+ <Link
+ href="/marketplace#skills"
+ className="mb-6 inline-flex w-fit items-center gap-1.5 text-[13px] text-zinc-500 transition-colors hover:text-zinc-900"
+ >
+ <Icon icon={ArrowLeft02Icon} size={14} aria-hidden />
+ Back to marketplace
+ </Link>
+
+ <div className="mb-7 flex flex-col gap-4 md:flex-row md:items-end md:justify-between">
+ <div>
+ <h1 className="flex items-center gap-2.5 text-3xl font-semibold tracking-[-0.02em] text-zinc-900">
+ <Icon icon={BookOpen01Icon} size={30} aria-hidden />
+ AutoPilot Skills
+ </h1>
+ <p className="mt-2 text-base text-zinc-500">
+ Playbooks your AutoPilot follows. Install one and it knows how.
+ </p>
+ </div>
+ <SearchBar
+ placeholder="Search skills"
+ height="h-[2.75rem]"
+ width="w-full md:w-[439px]"
+ defaultValue={search}
+ onSubmit={setSearch}
+ />
+ </div>
+
+ <CategoryFilter selected={category} onSelect={setCategory} />
+
+ {!ready || isLoading ? (
+ <div
+ role="status"
+ aria-busy="true"
+ aria-label="Loading skills"
+ className={GRID_CLASS}
+ >
+ {[0, 1, 2, 3, 4, 5, 6, 7].map((i) => (
+ <Skeleton key={i} className="h-[18rem] w-full rounded-2xl" />
+ ))}
+ </div>
+ ) : isError ? (
+ <ErrorCard
+ isSuccess={false}
+ responseError={{ message: "Couldn't load skills right now" }}
+ context="marketplace skills"
+ onRetry={() => refetch()}
+ className="max-w-md"
+ />
+ ) : skills.length === 0 ? (
+ <EmptyResult
+ category={category}
+ categoryLabel={
+ categories.find((entry) => entry.value === category)?.label
+ }
+ onShowAll={() => setCategory(null)}
+ />
+ ) : (
+ <>
+ <p className="mb-4 text-sm text-zinc-500">
+ {total.toLocaleString()} {total === 1 ? "skill" : "skills"}
+ </p>
+ <InfiniteList
+ items={skills}
+ className={GRID_CLASS}
+ hasMore={hasMore}
+ isFetchingMore={isFetchingMore}
+ onEndReached={loadMore}
+ renderItem={(skill) => (
+ <SkillCard
+ key={skill.slug}
+ skill={skill}
+ isInstalled={installedSlugs.has(skill.slug)}
+ />
+ )}
+ />
+ </>
+ )}
+ </main>
+ );
+}
+
+function EmptyResult({
+ category,
+ categoryLabel,
+ onShowAll,
+}: {
+ category: string | null;
+ categoryLabel: string | undefined;
+ onShowAll: () => void;
+}) {
+ return (
+ <div
+ className="flex flex-col items-center justify-center gap-3 rounded-large border border-dashed border-zinc-200 px-6 py-16 text-center"
+ data-testid="skills-browse-empty"
+ >
+ <div className="flex h-12 w-12 items-center justify-center rounded-full bg-violet-50">
+ <Icon
+ icon={BookOpen01Icon}
+ size={24}
+ className="text-violet-700"
+ aria-hidden
+ />
+ </div>
+ <Text variant="h4" className="text-zinc-900">
+ {category
+ ? `No ${categoryLabel ?? category} skills yet`
+ : "Nothing published yet"}
+ </Text>
+ {category ? (
+ <button
+ type="button"
+ onClick={onShowAll}
+ className="text-sm font-medium text-accent transition-colors hover:text-accent/80"
+ >
+ Show all
+ </button>
+ ) : (
+ <Link
+ href="/library/skills"
+ className="text-sm font-medium text-accent transition-colors hover:text-accent/80"
+ >
+ Go to your skills →
+ </Link>
+ )}
+ </div>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/components/SkillsBrowsePage/useSkillsBrowsePage.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/components/SkillsBrowsePage/useSkillsBrowsePage.ts
new file mode 100644
index 0000000000..b8ff34e8f5
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/components/SkillsBrowsePage/useSkillsBrowsePage.ts
@@ -0,0 +1,59 @@
+import { useListCopilotSkills } from "@/app/api/__generated__/endpoints/skills/skills";
+import { useGetV2ListMarketplaceSkillsInfinite } from "@/app/api/__generated__/endpoints/store/store";
+import {
+ getPaginationNextPageNumber,
+ okData,
+ unpaginate,
+} from "@/app/api/helpers";
+import { useAuth } from "@/lib/auth/hooks/useAuth";
+import { useRouter, useSearchParams } from "next/navigation";
+import { BROWSE_PAGE_SIZE } from "../../../components/SkillsSection/helpers";
+
+export function useSkillsBrowsePage() {
+ const router = useRouter();
+ const params = useSearchParams();
+ const { isLoggedIn } = useAuth();
+
+ const search = params.get("q") ?? "";
+ const category = params.get("category");
+
+ const query = useGetV2ListMarketplaceSkillsInfinite(
+ {
+ page: 1,
+ page_size: BROWSE_PAGE_SIZE,
+ ...(search ? { search_query: search } : {}),
+ ...(category ? { category } : {}),
+ },
+ { query: { getNextPageParam: getPaginationNextPageNumber } },
+ );
+
+ const installed = useListCopilotSkills({
+ query: { select: (res) => okData(res) ?? [], enabled: isLoggedIn },
+ });
+
+ // Both filters live in the URL so a filtered shelf can be linked and the
+ // back button steps through them.
+ function push(next: { search: string; category: string | null }) {
+ const qs = new URLSearchParams();
+ if (next.search) qs.set("q", next.search);
+ if (next.category) qs.set("category", next.category);
+ const query = qs.toString();
+ router.push(query ? `/marketplace/skills?${query}` : "/marketplace/skills");
+ }
+
+ return {
+ search,
+ category,
+ skills: query.data ? unpaginate(query.data, "skills") : [],
+ total: okData(query.data?.pages[0])?.pagination.total_items ?? 0,
+ installedSlugs: new Set((installed.data ?? []).map((skill) => skill.name)),
+ isLoading: query.isLoading,
+ isError: query.isError,
+ refetch: query.refetch,
+ hasMore: Boolean(query.hasNextPage),
+ isFetchingMore: query.isFetchingNextPage,
+ loadMore: query.fetchNextPage,
+ setSearch: (value: string) => push({ search: value, category }),
+ setCategory: (value: string | null) => push({ search, category: value }),
+ };
+}
diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/page.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/page.tsx
new file mode 100644
index 0000000000..c0869540a9
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/skills/page.tsx
@@ -0,0 +1,31 @@
+import { prefetchGetV2ListMarketplaceSkillsInfiniteQuery } from "@/app/api/__generated__/endpoints/store/store";
+import { getQueryClient } from "@/lib/react-query/queryClient";
+import { dehydrate, HydrationBoundary } from "@tanstack/react-query";
+import { Metadata } from "next";
+import { SkillsBrowsePage } from "./components/SkillsBrowsePage/SkillsBrowsePage";
+import { BROWSE_PAGE_SIZE } from "../components/SkillsSection/helpers";
+
+export const dynamic = "force-dynamic";
+
+export const metadata: Metadata = {
+ title: "AutoPilot Skills - AutoGPT Marketplace",
+ description:
+ "Playbooks your AutoPilot follows. Install one and it knows how.",
+};
+
+export default async function MarketplaceSkillsPage() {
+ const queryClient = getQueryClient();
+
+ // Only the unfiltered first page is worth prefetching: a category or search
+ // arrives in the URL and would miss this key anyway.
+ await prefetchGetV2ListMarketplaceSkillsInfiniteQuery(queryClient, {
+ page: 1,
+ page_size: BROWSE_PAGE_SIZE,
+ });
+
+ return (
+ <HydrationBoundary state={dehydrate(queryClient)}>
+ <SkillsBrowsePage />
+ </HydrationBoundary>
+ );
+}
diff --git a/autogpt_platform/frontend/src/app/api/openapi.json b/autogpt_platform/frontend/src/app/api/openapi.json
index 6a03e2f206..0625b25979 100644
--- a/autogpt_platform/frontend/src/app/api/openapi.json
+++ b/autogpt_platform/frontend/src/app/api/openapi.json
@@ -14611,6 +14611,166 @@
}
}
},
+ "/api/store/skills": {
+ "get": {
+ "tags": ["v2", "store", "public"],
+ "summary": "List marketplace skills",
+ "description": "Approved skill listings, most recently updated first.",
+ "operationId": "getV2List marketplace skills",
+ "security": [{ "HTTPBearer": [] }],
+ "parameters": [
+ {
+ "name": "category",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "title": "Category"
+ }
+ },
+ {
+ "name": "search_query",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "title": "Search Query"
+ }
+ },
+ {
+ "name": "page",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "minimum": 1,
+ "default": 1,
+ "title": "Page"
+ }
+ },
+ {
+ "name": "page_size",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "type": "integer",
+ "maximum": 100,
+ "minimum": 1,
+ "default": 20,
+ "title": "Page Size"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MarketplaceSkillsResponse"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/store/skills/{slug}": {
+ "get": {
+ "tags": ["v2", "store", "public"],
+ "summary": "Get marketplace skill",
+ "description": "One listing with the full SKILL.md body the install will copy.",
+ "operationId": "getV2Get marketplace skill",
+ "security": [{ "HTTPBearer": [] }],
+ "parameters": [
+ {
+ "name": "slug",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "Slug of the skill listing",
+ "title": "Slug"
+ },
+ "description": "Slug of the skill listing"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MarketplaceSkillDetails"
+ }
+ }
+ }
+ },
+ "404": { "description": "Skill not found" },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/store/skills/{slug}/install": {
+ "post": {
+ "tags": ["v2", "store", "private"],
+ "summary": "Install marketplace skill",
+ "description": "Copy the listing's skill into the caller's AutoPilot skill library.",
+ "operationId": "postV2Install marketplace skill",
+ "security": [{ "HTTPBearer": [] }, { "HTTPBearerJWT": [] }],
+ "parameters": [
+ {
+ "name": "slug",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "description": "Slug of the skill listing",
+ "title": "Slug"
+ },
+ "description": "Slug of the skill listing"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": { "$ref": "#/components/schemas/InstalledSkill" }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
+ },
+ "404": { "description": "Skill not found" },
+ "409": { "description": "Per-user skill limit reached" },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ }
+ }
+ }
+ }
+ }
+ },
"/api/store/submissions": {
"get": {
"tags": ["v2", "store", "private"],
@@ -22507,6 +22667,24 @@
"title": "InstallWorkflowRequest",
"description": "One workflow source: a marketplace listing, or the caller's own agent."
},
+ "InstalledSkill": {
+ "properties": {
+ "name": {
+ "type": "string",
+ "title": "Name",
+ "description": "Name the skill was installed under, for a link into the library."
+ },
+ "required_providers": {
+ "items": { "type": "string" },
+ "type": "array",
+ "title": "Required Providers",
+ "description": "Integrations the skill's instructions assume. Not a precondition — the install has already succeeded."
+ }
+ },
+ "type": "object",
+ "required": ["name", "required_providers"],
+ "title": "InstalledSkill"
+ },
"IntroCardResponse": {
"properties": {
"path": { "type": "string", "title": "Path" },
@@ -23477,6 +23655,110 @@
"title": "MarketplaceListingCreator",
"description": "Creator information for a marketplace listing."
},
+ "MarketplaceSkill": {
+ "properties": {
+ "slug": { "type": "string", "title": "Slug" },
+ "name": { "type": "string", "title": "Name" },
+ "description": { "type": "string", "title": "Description" },
+ "categories": {
+ "items": { "type": "string" },
+ "type": "array",
+ "title": "Categories"
+ },
+ "required_providers": {
+ "items": { "type": "string" },
+ "type": "array",
+ "title": "Required Providers"
+ },
+ "install_count": { "type": "integer", "title": "Install Count" },
+ "creator": {
+ "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "title": "Creator"
+ },
+ "creator_avatar": {
+ "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "title": "Creator Avatar"
+ }
+ },
+ "type": "object",
+ "required": [
+ "slug",
+ "name",
+ "description",
+ "categories",
+ "required_providers",
+ "install_count"
+ ],
+ "title": "MarketplaceSkill"
+ },
+ "MarketplaceSkillDetails": {
+ "properties": {
+ "slug": { "type": "string", "title": "Slug" },
+ "name": { "type": "string", "title": "Name" },
+ "description": { "type": "string", "title": "Description" },
+ "categories": {
+ "items": { "type": "string" },
+ "type": "array",
+ "title": "Categories"
+ },
+ "required_providers": {
+ "items": { "type": "string" },
+ "type": "array",
+ "title": "Required Providers"
+ },
+ "install_count": { "type": "integer", "title": "Install Count" },
+ "creator": {
+ "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "title": "Creator"
+ },
+ "creator_avatar": {
+ "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "title": "Creator Avatar"
+ },
+ "skill_listing_version_id": {
+ "type": "string",
+ "title": "Skill Listing Version Id"
+ },
+ "body": { "type": "string", "title": "Body" },
+ "triggers": {
+ "items": { "type": "string" },
+ "type": "array",
+ "title": "Triggers"
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time",
+ "title": "Updated At"
+ }
+ },
+ "type": "object",
+ "required": [
+ "slug",
+ "name",
+ "description",
+ "categories",
+ "required_providers",
+ "install_count",
+ "skill_listing_version_id",
+ "body",
+ "triggers",
+ "updated_at"
+ ],
+ "title": "MarketplaceSkillDetails"
+ },
+ "MarketplaceSkillsResponse": {
+ "properties": {
+ "skills": {
+ "items": { "$ref": "#/components/schemas/MarketplaceSkill" },
+ "type": "array",
+ "title": "Skills"
+ },
+ "pagination": { "$ref": "#/components/schemas/Pagination" }
+ },
+ "type": "object",
+ "required": ["skills", "pagination"],
+ "title": "MarketplaceSkillsResponse"
+ },
"MemoryFact": {
"properties": {
"uuid": { "type": "string", "title": "Uuid" },
diff --git a/autogpt_platform/frontend/src/components/__legacy__/SearchFilterChips.tsx b/autogpt_platform/frontend/src/components/__legacy__/SearchFilterChips.tsx
index 7d6e35954e..84fcd977b9 100644
--- a/autogpt_platform/frontend/src/components/__legacy__/SearchFilterChips.tsx
+++ b/autogpt_platform/frontend/src/components/__legacy__/SearchFilterChips.tsx
@@ -12,6 +12,8 @@ interface SearchFilterChipsProps {
totalCount?: number;
agentsCount?: number;
creatorsCount?: number;
+ /** Omitted where skills are not searchable, which drops the chip. */
+ skillsCount?: number;
onFilterChange?: (value: string) => void;
}
@@ -19,6 +21,7 @@ export const SearchFilterChips: React.FC<SearchFilterChipsProps> = ({
totalCount = 10,
agentsCount = 8,
creatorsCount = 2,
+ skillsCount,
onFilterChange,
}) => {
const [selected, setSelected] = React.useState("all");
@@ -26,13 +29,15 @@ export const SearchFilterChips: React.FC<SearchFilterChipsProps> = ({
const filters: FilterOption[] = [
{ label: "All", count: totalCount, value: "all" },
{ label: "Agents", count: agentsCount, value: "agents" },
+ ...(skillsCount === undefined
+ ? []
+ : [{ label: "Skills", count: skillsCount, value: "skills" }]),
{ label: "Creators", count: creatorsCount, value: "creators" },
];
const handleFilterClick = (value: string) => {
setSelected(value);
onFilterChange?.(value);
- console.log(`Filter selected: ${value}`);
};
return (
diff --git a/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts b/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
index 56dbeda2e2..3121337bbb 100644
--- a/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
+++ b/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
@@ -22,6 +22,8 @@ export enum Flag {
CHAT_PINNING = "chat-pinning",
TASK_PROGRESS_BAR = "task-progress-bar",
HIRE_EXPERTS = "hire-experts",
+ // Reveals the marketplace Skills shelf and the skill listing pages.
+ SKILLS_HUB = "skills-hub",
// Reveals the notification-preferences card on /settings/account. The card
// is built but its design is still being reworked, so it ships dark and is
// targeted at AGPT staff in LaunchDarkly. Until this is on for everyone,
@@ -75,6 +77,7 @@ const defaultFlags = {
[Flag.CHAT_PINNING]: false,
[Flag.TASK_PROGRESS_BAR]: false,
[Flag.HIRE_EXPERTS]: false,
+ [Flag.SKILLS_HUB]: false,
// Off by default so a LaunchDarkly outage or a missing key hides the card
// rather than exposing the in-progress design to everyone.
[Flag.SETTINGS_NOTIFICATIONS]: false,
@@ -119,6 +122,8 @@ function readEnvOverride(flag: Flag): string | undefined {
return process.env.NEXT_PUBLIC_FORCE_FLAG_MARKETPLACE_SEARCH_TERMS;
case Flag.ENABLE_PLATFORM_PAYMENT:
return process.env.NEXT_PUBLIC_FORCE_FLAG_ENABLE_PLATFORM_PAYMENT;
+ case Flag.SKILLS_HUB:
+ return process.env.NEXT_PUBLIC_FORCE_FLAG_SKILLS_HUB;
case Flag.ARTIFACTS:
return process.env.NEXT_PUBLIC_FORCE_FLAG_ARTIFACTS;
case Flag.ARTIFACTS_PAGE: