:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(skills): add Scouts tab backed by a generic skill category (#64796)
Andrew Maguire88efd4a1977b
diff --git a/frontend/src/products.tsx b/frontend/src/products.tsxindex ab6fc12757cb..565ebc66ab8e 100644--- a/frontend/src/products.tsx+++ b/frontend/src/products.tsx@@ -278,6 +278,7 @@ export const productRoutes: Record<string, [string, string]> = {'/session-summaries': ['SessionGroupSummariesTable', 'sessionGroupSummariesTable'],'/session-summaries/:sessionGroupId': ['SessionGroupSummary', 'sessionGroupSummary'],'/skills': ['Skills', 'skills'],+ '/skills/scouts': ['Skills', 'skillsScouts'],'/skills/:name': ['Skill', 'skill'],'/tasks': ['TaskTracker', 'taskTracker'],'/tasks/:taskId': ['TaskDetail', 'taskDetail'],@@ -1221,6 +1222,7 @@ export const productUrls = {sessionSummaries: (): string => '/session-summaries',sessionSummary: (sessionGroupId: string): string => `/session-summaries/${sessionGroupId}`,skills: (): string => '/skills',+ skillsCategoryTab: (categoryTab: string): string => `/skills/${categoryTab}`,skill: (name: string,params?: {diff --git a/products/signals/backend/scout_harness/config_registry.py b/products/signals/backend/scout_harness/config_registry.pyindex f18da8f5d824..3c0df5d0ef6a 100644--- a/products/signals/backend/scout_harness/config_registry.py+++ b/products/signals/backend/scout_harness/config_registry.py@@ -12,7 +12,11 @@ from __future__ import annotationsimport structlogfrom products.signals.backend.models import SignalScoutConfig-from products.signals.backend.scout_harness.lazy_seed import HARNESS_SEEDED_BY, canonical_skill_names+from products.signals.backend.scout_harness.lazy_seed import (+ HARNESS_SEEDED_BY,+ SCOUT_SKILL_CATEGORY,+ canonical_skill_names,+)from products.signals.backend.scout_harness.limits import MAX_ENABLED_SCOUTS_PER_TEAMfrom products.signals.backend.scout_harness.skill_loader import SIGNALS_SCOUT_SKILL_PREFIXfrom products.skills.backend.models.skills import LLMSkill@@ -27,6 +31,23 @@ MIN_RUN_INTERVAL_MINUTES = 10MAX_RUN_INTERVAL_MINUTES = 43200+def ensure_scout_category(team_id: int, skill_name: str | None = None) -> None:+ """Stamp `LLMSkill.category="scout"` on the team's scout skill rows.++ `category` is server-owned, so this is how custom scouts authored via the normal skills API+ get categorized — canonical scouts are already stamped at seed time (`lazy_seed`). Without it+ a freshly authored `signals-scout-*` skill would schedule but stay off the skills UI's Scouts+ tab. Idempotent (skips already-stamped rows). Pass `skill_name` to stamp one scout (e.g. on+ explicit registration), or omit to reconcile every `signals-scout-*` row for the team.+ """+ rows = LLMSkill.objects.filter(team_id=team_id, deleted=False).exclude(category=SCOUT_SKILL_CATEGORY)+ if skill_name is not None:+ rows = rows.filter(name=skill_name)+ else:+ rows = rows.filter(name__startswith=SIGNALS_SCOUT_SKILL_PREFIX)+ rows.update(category=SCOUT_SKILL_CATEGORY)++def enabled_scout_count(team_id: int, *, exclude_skill: str | None = None) -> int:"""Count of enabled scout configs for the team — the quantity the per-team cap bounds.@@ -113,6 +134,9 @@ def register_missing_configs(team_id: int, seed_config_layers: list[dict] | None).values_list("name", "metadata"))skill_names = {name for name, _ in rows}+ # Keep the skills UI's Scouts tab in sync: stamp `category="scout"` on any scout skill rows+ # not yet categorized (custom scouts authored via the skills API). Runs every reconcile tick.+ ensure_scout_category(team_id)# The allowlist governs the canonical fleet only; custom (hand-authored or duplicated) scouts# always auto-enable. A scout is canonical iff it BOTH carries the harness `seeded_by` tag AND# matches an on-disk canonical name — same dual check as `views._scout_origin`. The tag alonediff --git a/products/signals/backend/scout_harness/lazy_seed.py b/products/signals/backend/scout_harness/lazy_seed.pyindex 7762f82126fd..95b4d8d721b4 100644--- a/products/signals/backend/scout_harness/lazy_seed.py+++ b/products/signals/backend/scout_harness/lazy_seed.py@@ -54,6 +54,11 @@ _MAX_SKILL_FILE_PATH_LENGTH = 500# classifying a config's origin downstream. Keep reads of it pointed at this constant.HARNESS_SEEDED_BY = "signals_scout_harness"+# Stamped on `LLMSkill.category` for every scout row so the skills surface can group scouts into+# their own tab without knowing anything about the `signals-scout-*` naming convention. The skills+# product treats `category` as an opaque string; this is the value the harness writes.+SCOUT_SKILL_CATEGORY = "scout"+@dataclass(frozen=True)class CanonicalSkillFile:@@ -324,6 +329,7 @@ def _create_skill_from_canonical(team: Team, canonical: CanonicalSkill, canonica"source": "products/signals/skills","canonical_hash": canonical_hash,},+ category=SCOUT_SKILL_CATEGORY,version=1,is_latest=True,)@@ -375,6 +381,7 @@ def _update_skill_from_canonical(body=canonical.body,allowed_tools=list(canonical.allowed_tools),metadata=new_metadata,+ category=SCOUT_SKILL_CATEGORY,version=new_version,is_latest=True,)diff --git a/products/signals/backend/scout_harness/views.py b/products/signals/backend/scout_harness/views.pyindex 944c7c9150c6..d6423e03ca75 100644--- a/products/signals/backend/scout_harness/views.py+++ b/products/signals/backend/scout_harness/views.py@@ -49,7 +49,7 @@ from products.signals.backend.models import (SignalScoutEmission,SignalScoutRun,)-from products.signals.backend.scout_harness.config_registry import enabled_scout_count+from products.signals.backend.scout_harness.config_registry import enabled_scout_count, ensure_scout_categoryfrom products.signals.backend.scout_harness.lazy_seed import HARNESS_SEEDED_BY, canonical_skill_namesfrom products.signals.backend.scout_harness.limits import MAX_ENABLED_SCOUTS_PER_TEAMfrom products.signals.backend.scout_harness.serializers import (@@ -810,6 +810,9 @@ class SignalScoutConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):raise exceptions.ValidationError({"skill_name": "No skill with this name exists on this project. Author the skill first."})+ # Explicit registration of a scout — stamp the skill's server-owned category so it shows on+ # the skills UI's Scouts tab immediately, without waiting for the next coordinator reconcile.+ ensure_scout_category(team_id, skill_name=skill_name)tunables = {key: value for key, value in serializer.validated_data.items() if key != "skill_name"}# The per-team cap only gates net-new enables: a fresh row defaulting (or set) to# enabled, or an upsert flipping a disabled row on. Tuning an already-enabled scoutdiff --git a/products/signals/backend/test/test_scout_coordinator.py b/products/signals/backend/test/test_scout_coordinator.pyindex a7011ea5938e..1afd3c89b6a8 100644--- a/products/signals/backend/test/test_scout_coordinator.py+++ b/products/signals/backend/test/test_scout_coordinator.py@@ -20,6 +20,7 @@ from posthog.models.scoping import team_scopefrom posthog.sync import database_sync_to_asyncfrom products.signals.backend.models import SignalScoutConfig+from products.signals.backend.scout_harness.config_registry import register_missing_configsfrom products.signals.backend.scout_harness.lazy_seed import HARNESS_SEEDED_BY, sync_canonical_skillsfrom products.signals.backend.temporal.agentic.scout_coordinator import (DEFAULT_ENROLLED_TEAM_IDS,@@ -260,6 +261,26 @@ async def test_non_scout_skills_are_ignored(ateam):assert count == 0+def test_register_missing_configs_stamps_scout_category():+ # The "author a skill, get it on the Scouts tab" path: auto-registration stamps the server-owned+ # `category` so a custom scout authored via the skills API surfaces in the skills UI.+ org = Organization.objects.create(name="cat-stamp-org", is_ai_data_processing_approved=True)+ team = Team.objects.create(organization=org, name="cat-stamp-team")+ with team_scope(team.id, canonical=True):+ scout = _create_skill(team, "signals-scout-custom")+ helper = _create_skill(team, "custom-helper")+ assert scout.category == ""++ register_missing_configs(team.id)++ scout.refresh_from_db()+ helper.refresh_from_db()+ assert scout.category == "scout"+ # Non-scout skills are left untouched.+ assert helper.category == ""++@pytest.mark.asyncio@pytest.mark.django_dbasync def test_config_whose_skill_is_gone_is_skipped(ateam):diff --git a/products/signals/backend/test/test_scout_harness_api.py b/products/signals/backend/test/test_scout_harness_api.pyindex 1c636b2f4a08..4294dfe40320 100644--- a/products/signals/backend/test/test_scout_harness_api.py+++ b/products/signals/backend/test/test_scout_harness_api.py@@ -883,6 +883,16 @@ class TestScoutHarnessConfigAPI(APIBaseTest):assert config.created_by_id == self.user.idassert config.enabled_by_id == self.user.id+ def test_create_stamps_scout_category_on_skill(self) -> None:+ skill = self._make_skill("signals-scout-fresh")+ assert skill.category == ""++ response = self.client.post(self._list_url(), data={"skill_name": "signals-scout-fresh"}, format="json")++ assert response.status_code == status.HTTP_201_CREATED+ skill.refresh_from_db()+ assert skill.category == "scout"+def test_create_disabled_config_does_not_stamp_enabled_by(self) -> None:self._make_skill("signals-scout-fresh")diff --git a/products/skills/backend/api/skill_serializers.py b/products/skills/backend/api/skill_serializers.pyindex b65df4868092..ffd751b761fe 100644--- a/products/skills/backend/api/skill_serializers.py+++ b/products/skills/backend/api/skill_serializers.py@@ -12,7 +12,10 @@ from products.ai_observability.backend.markdown_outline import get_markdown_outlfrom ..models.skills import LLMSkill, LLMSkillFile-RESERVED_SKILL_NAMES = {"new"}+# Skill names that collide with reserved /skills routes and so can't be used: "new" is the create+# form, and the rest mirror the category-tab slugs registered under /skills/<slug> in+# products/skills/manifest.tsx — a skill with such a name would be shadowed by its tab route.+RESERVED_SKILL_NAMES = {"new", "scouts"}# Bundled-file paths that would collide with generated artifacts in the exported skill# tree / plugin marketplace (the rendered SKILL.md). Compared case-insensitively.RESERVED_SKILL_FILE_PATHS = {"skill.md"}@@ -26,7 +29,7 @@ SKILL_NAME_PATTERN = re.compile(r"^[a-z0-9]([a-z0-9-]*[a-z0-9])?$")def validate_skill_name_value(value: str) -> str:if value.lower() in RESERVED_SKILL_NAMES:raise serializers.ValidationError(- "'new' is a reserved name and cannot be used.",+ f"'{value}' is a reserved name and cannot be used.",code="reserved_name",)if len(value) > 64:@@ -119,6 +122,12 @@ class LLMSkillListQuerySerializer(serializers.Serializer):required=False,help_text="Filter skills by the ID of the user who created them.",)+ category = serializers.CharField(+ required=False,+ allow_blank=True,+ help_text='Filter skills to this exact category. Pass "scout" for Signals scouts, or an empty string to '+ "return only uncategorized skills. Omit the parameter entirely to return skills of every category.",+ )class LLMSkillResolveQuerySerializer(LLMSkillFetchQuerySerializer):@@ -331,6 +340,12 @@ class LLMSkillSerializer(serializers.ModelSerializer):default=dict,help_text="Arbitrary key-value metadata.",)+ category = serializers.CharField(+ read_only=True,+ help_text='Server-owned classification — set by the producing system (the Signals harness stamps "scout"), '+ "not writable via the API. Empty for an ordinary skill. Groups skills into their own surface "+ "(e.g. the Scouts tab) independently of the skill name.",+ )files = serializers.SerializerMethodField(help_text="Bundled files manifest. Each entry is path + content_type only; fetch content via /llm_skills/name/{name}/files/{path}/.",)@@ -349,6 +364,7 @@ class LLMSkillSerializer(serializers.ModelSerializer):"compatibility","allowed_tools","metadata",+ "category","files","outline","version",diff --git a/products/skills/backend/api/skill_services.py b/products/skills/backend/api/skill_services.pyindex 2f4d59b3ec12..dc0f2b15138b 100644--- a/products/skills/backend/api/skill_services.py+++ b/products/skills/backend/api/skill_services.py@@ -236,6 +236,9 @@ def publish_skill_version(compatibility=_carry_forward(compatibility, current_latest.compatibility),allowed_tools=_carry_forward(allowed_tools, current_latest.allowed_tools),metadata=_carry_forward(metadata, current_latest.metadata),+ # Categorization is a property of the skill, not the version — carry it forward so editing+ # a scout (or any categorized skill) doesn't drop it out of its tab.+ category=current_latest.category,version=current_latest.version + 1,is_latest=True,created_by=user,@@ -399,6 +402,14 @@ def duplicate_skill(if LLMSkill.objects.filter(team=team, name=new_name, deleted=False).exists():raise LLMSkillDuplicateNameConflictError()+ # A duplicate is a brand-new, user-authored skill under a new name, so it does not inherit the+ # source's provenance or classification: drop the harness seed marker, and leave `category`+ # at its default empty (the copy isn't a registered scout — it would only become one if named+ # `signals-scout-*` and picked up by scout registration). This keeps non-runnable rows out of+ # the Scouts tab and avoids mislabeling a fork as canonical.+ duplicated_metadata = dict(source_latest.metadata or {})+ duplicated_metadata.pop("seeded_by", None)+try:new_skill = LLMSkill.objects.create(team=team,@@ -408,7 +419,7 @@ def duplicate_skill(license=source_latest.license,compatibility=source_latest.compatibility,allowed_tools=source_latest.allowed_tools,- metadata=source_latest.metadata,+ metadata=duplicated_metadata,version=1,is_latest=True,created_by=user,@@ -460,6 +471,7 @@ def _create_next_version_with_files(compatibility=current_latest.compatibility,allowed_tools=current_latest.allowed_tools,metadata=current_latest.metadata,+ category=current_latest.category,version=current_latest.version + 1,is_latest=True,created_by=user,diff --git a/products/skills/backend/api/skills.py b/products/skills/backend/api/skills.pyindex 360c319344e3..4f465cf8bf14 100644--- a/products/skills/backend/api/skills.py+++ b/products/skills/backend/api/skills.py@@ -301,6 +301,11 @@ class LLMSkillViewSet(if created_by_id:queryset = queryset.filter(created_by_id=created_by_id)+ # Presence of the param — even as an empty string — is a filter: `?category=` returns only+ # uncategorized skills, `?category=scout` only scouts. Omitting it returns every category.+ if "category" in request.query_params:+ queryset = queryset.filter(category=params.get("category") or "")+order_by = request.query_params.get("order_by", "-created_at")queryset = queryset.order_by(order_by if order_by in ALLOWED_LIST_ORDERINGS else "-created_at", "-id")return querysetdiff --git a/products/skills/backend/api/test/test_skills.py b/products/skills/backend/api/test/test_skills.pyindex 45ed7c25d172..f57b28bf2357 100644--- a/products/skills/backend/api/test/test_skills.py+++ b/products/skills/backend/api/test/test_skills.py@@ -30,6 +30,7 @@ class TestLLMSkillAPI(APIBaseTest):compatibility: str = "",allowed_tools: list | None = None,metadata: dict | None = None,+ category: str = "",created_by: User | None = None,) -> LLMSkill:return LLMSkill.objects.create(@@ -44,6 +45,7 @@ class TestLLMSkillAPI(APIBaseTest):compatibility=compatibility,allowed_tools=allowed_tools or [],metadata=metadata or {},+ category=category,created_by=created_by or self.user,)@@ -290,6 +292,25 @@ class TestLLMSkillAPI(APIBaseTest):assert response.status_code == status.HTTP_400_BAD_REQUEST+ @parameterized.expand(+ [+ # (label, query_suffix, expected names) — scouts only, uncategorized only, all categories.+ ("scout_only", "?category=scout", ["signals-scout-errors", "signals-scout-web"]),+ ("uncategorized_only", "?category=", ["ordinary-skill"]),+ ("no_param_returns_all", "", ["ordinary-skill", "signals-scout-errors", "signals-scout-web"]),+ ]+ )+ def test_list_skills_filter_by_category(self, mock_feature_enabled, _label, query_suffix, expected_names):+ self.create_skill(name="ordinary-skill", description="Plain.")+ self.create_skill(name="signals-scout-errors", description="A scout.", category="scout")+ self.create_skill(name="signals-scout-web", description="Another scout.", category="scout")++ response = self.client.get(self._url() + query_suffix)++ assert response.status_code == status.HTTP_200_OK+ assert response.json()["count"] == len(expected_names)+ assert sorted(r["name"] for r in response.json()["results"]) == sorted(expected_names)+# --- Get by name ---def test_get_skill_by_name(self, mock_feature_enabled):diff --git a/products/skills/backend/migrations/0002_llmskill_category.py b/products/skills/backend/migrations/0002_llmskill_category.pynew file mode 100644index 000000000000..5bb6fc8a65b9--- /dev/null+++ b/products/skills/backend/migrations/0002_llmskill_category.py@@ -0,0 +1,17 @@+# Generated by Django 5.2.14 on 2026-06-19 08:50++from django.db import migrations, models+++class Migration(migrations.Migration):+ dependencies = [+ ("skills", "0001_adopt_skills_models"),+ ]++ operations = [+ migrations.AddField(+ model_name="llmskill",+ name="category",+ field=models.CharField(blank=True, db_default="", default="", max_length=64),+ ),+ ]diff --git a/products/skills/backend/migrations/0003_backfill_scout_category.py b/products/skills/backend/migrations/0003_backfill_scout_category.pynew file mode 100644index 000000000000..7017bdc66d28--- /dev/null+++ b/products/skills/backend/migrations/0003_backfill_scout_category.py@@ -0,0 +1,25 @@+from django.db import migrations+++def backfill_scout_category(apps, schema_editor):+ # One-time decoupling: existing scouts were only identifiable by the historical+ # `signals-scout-*` name convention. Stamp them with the new generic category so the UI and+ # API can filter on `category` instead of the name prefix going forward. The prefix is used+ # here, and only here, as the source of historical truth.+ LLMSkill = apps.get_model("skills", "LLMSkill")+ LLMSkill.objects.filter(name__startswith="signals-scout-").update(category="scout")+++def unset_scout_category(apps, schema_editor):+ LLMSkill = apps.get_model("skills", "LLMSkill")+ LLMSkill.objects.filter(category="scout").update(category="")+++class Migration(migrations.Migration):+ dependencies = [+ ("skills", "0002_llmskill_category"),+ ]++ operations = [+ migrations.RunPython(backfill_scout_category, unset_scout_category),+ ]diff --git a/products/skills/backend/migrations/max_migration.txt b/products/skills/backend/migrations/max_migration.txtindex 59e8afb62a8e..7c2e7893dc75 100644--- a/products/skills/backend/migrations/max_migration.txt+++ b/products/skills/backend/migrations/max_migration.txt@@ -1 +1 @@-0001_adopt_skills_models+0003_backfill_scout_categorydiff --git a/products/skills/backend/models/skills.py b/products/skills/backend/models/skills.pyindex 43dff8e25a05..7780167fe3b9 100644--- a/products/skills/backend/models/skills.py+++ b/products/skills/backend/models/skills.py@@ -34,6 +34,11 @@ class LLMSkill(UUIDModel):allowed_tools = models.JSONField(blank=True, default=list)metadata = models.JSONField(blank=True, default=dict)+ # Generic classification, decoupled from the skill name. Empty for an ordinary skill; a known+ # value (e.g. "scout") groups the skill into its own surface in the UI. Producers own the value+ # (the Signals harness stamps "scout"); the skills product treats it as an opaque string.+ category = models.CharField(max_length=64, blank=True, default="", db_default="")+# Versioning (same pattern as LLMPrompt)version = models.PositiveIntegerField(default=1)is_latest = models.BooleanField(default=True)diff --git a/products/skills/frontend/LLMSkillScene.stories.tsx b/products/skills/frontend/LLMSkillScene.stories.tsxindex 10130f07479e..a9dc3c8ae1df 100644--- a/products/skills/frontend/LLMSkillScene.stories.tsx+++ b/products/skills/frontend/LLMSkillScene.stories.tsx@@ -66,6 +66,7 @@ const SKILL: LLMSkillApi = {compatibility: 'Requires poppler-utils on the host',allowed_tools: ['read', 'shell'],metadata: {},+ category: '',files: [{ path: 'scripts/extract.sh', content_type: 'text/x-shellscript' },{ path: 'references/pdf-spec.md', content_type: 'text/markdown' },@@ -101,6 +102,7 @@ const SKILL_LIST_ENTRY: LLMSkillListApi = {compatibility: SKILL.compatibility,allowed_tools: SKILL.allowed_tools,metadata: {},+ category: SKILL.category,outline: SKILL.outline,version: SKILL.version,created_by: SKILL.created_by,diff --git a/products/skills/frontend/LLMSkillsScene.tsx b/products/skills/frontend/LLMSkillsScene.tsxindex 6e1051190c83..f1fc76fbcc73 100644--- a/products/skills/frontend/LLMSkillsScene.tsx+++ b/products/skills/frontend/LLMSkillsScene.tsx@@ -3,7 +3,7 @@ import { combineUrl, router } from 'kea-router'import { useMemo, useRef } from 'react'import { IconDownload, IconPlusSmall, IconUpload } from '@posthog/icons'-import { LemonDivider, LemonModal, LemonSwitch, Link } from '@posthog/lemon-ui'+import { LemonDivider, LemonModal, LemonSwitch, LemonTabs, LemonTag, Link } from '@posthog/lemon-ui'import { AccessControlAction } from 'lib/components/AccessControlAction'import { CodeSnippet, Language } from 'lib/components/CodeSnippet/CodeSnippet'@@ -30,7 +30,15 @@ import { AccessControlLevel, AccessControlResourceType } from '~/types'import type { LLMSkillListApi } from 'products/skills/frontend/generated/api.schemas'-import { SKILLS_GROUP_LIMIT, SKILLS_PER_PAGE, SkillGroupNode, SkillGroupTree, llmSkillsLogic } from './llmSkillsLogic'+import {+ DEFAULT_SKILLS_TAB_KEY,+ SKILLS_GROUP_LIMIT,+ SKILLS_PER_PAGE,+ SkillGroupNode,+ SkillGroupTree,+ llmSkillsLogic,+ skillTabUrl,+} from './llmSkillsLogic'import { SKILL_NAME_MAX_LENGTH, validateSkillName } from './skillConstants'import { openArchiveSkillDialog } from './skillSceneComponents'@@ -40,11 +48,20 @@ export const scene: SceneExport = {productKey: ProductKey.AI_OBSERVABILITY,}+// Mirrors `metadata.seeded_by` stamped by the Signals scout harness (kept local so the skills+// product needn't depend on the signals product). Its presence marks a canonical scout.+const HARNESS_SEEDED_BY = 'signals_scout_harness'++function isCanonicalScout(skill: LLMSkillListApi): boolean {+ return (skill.metadata as Record<string, unknown> | undefined)?.seeded_by === HARNESS_SEEDED_BY+}+function buildSkillColumns(skillUrl: (name: string) => string,duplicateSkill: (name: string, newName: string) => void,deleteSkill: (name: string) => void,- downloadSkillZip: (name: string) => void+ downloadSkillZip: (name: string) => void,+ options?: { showScoutOrigin?: boolean }): LemonTableColumns<LLMSkillListApi> {return [{@@ -60,6 +77,23 @@ function buildSkillColumns()},},+ ...(options?.showScoutOrigin+ ? ([+ {+ title: 'Origin',+ key: 'origin',+ width: 110,+ render: function renderOrigin(_, skill) {+ const canonical = isCanonicalScout(skill)+ return (+ <LemonTag type={canonical ? 'completion' : 'default'}>+ {canonical ? 'Canonical' : 'Custom'}+ </LemonTag>+ )+ },+ },+ ] as LemonTableColumns<LLMSkillListApi>)+ : []),{title: 'Description',dataIndex: 'description',@@ -394,18 +428,32 @@ function ConnectToClaudeCodeModal(): JSX.Element {export function LLMSkillsScene(): JSX.Element {const { setFilters, deleteSkill, duplicateSkill, downloadSkillZip, importSkill, setConnectModalOpen } =useActions(llmSkillsLogic)- const { skills, skillsLoading, sorting, pagination, filters, skillCountLabel, groupedSkills, importing } =- useValues(llmSkillsLogic)+ const {+ skills,+ skillsLoading,+ sorting,+ pagination,+ filters,+ skillCountLabel,+ groupedSkills,+ importing,+ activeTabKey,+ activeCategory,+ activeTabDescription,+ visibleCategoryTabs,+ } = useValues(llmSkillsLogic)const { searchParams } = useValues(router)const skillUrl = (name: string): string => combineUrl(urls.skill(name), searchParams).urlconst fileInputRef = useRef<HTMLInputElement | null>(null)+ const showScoutOrigin = activeCategory === 'scout'+// Memoize columns so the array reference doesn't change every render — otherwise every// nested LemonTable inside the grouped tree reconciles on each parent re-render.const columns = useMemo(- () => buildSkillColumns(skillUrl, duplicateSkill, deleteSkill, downloadSkillZip),+ () => buildSkillColumns(skillUrl, duplicateSkill, deleteSkill, downloadSkillZip, { showScoutOrigin }),// eslint-disable-next-line react-hooks/exhaustive-deps- [searchParams, duplicateSkill, deleteSkill, downloadSkillZip]+ [searchParams, duplicateSkill, deleteSkill, downloadSkillZip, showScoutOrigin])const showGroupedView = filters.group_by_prefix && groupedSkills && !skillsLoading@@ -432,12 +480,13 @@ export function LLMSkillsScene(): JSX.Element {<ConnectToClaudeCodeModal /><SceneTitleSectionname="Skills"- description="Manage versioned agent skills that any agent can discover and use."+ description={activeTabDescription}resourceType={{ type: 'llm_analytics' }}actions={<><LemonButtontype="secondary"+ size="small"onClick={() => setConnectModalOpen(true)}data-attr="connect-coding-agent-button">@@ -449,6 +498,7 @@ export function LLMSkillsScene(): JSX.Element {><LemonButtontype="secondary"+ size="small"icon={<IconUpload />}onClick={() => fileInputRef.current?.click()}loading={importing}@@ -464,6 +514,7 @@ export function LLMSkillsScene(): JSX.Element {><LemonButtontype="primary"+ size="small"to={skillUrl('new')}icon={<IconPlusSmall />}data-attr="new-skill-button"@@ -475,6 +526,17 @@ export function LLMSkillsScene(): JSX.Element {}/>+ {visibleCategoryTabs.length > 0 && (+ <LemonTabs+ activeKey={activeTabKey}+ onChange={(key) => router.actions.push(skillTabUrl(key))}+ tabs={[+ { key: DEFAULT_SKILLS_TAB_KEY, label: 'Skills' },+ ...visibleCategoryTabs.map((tab) => ({ key: tab.key, label: tab.label })),+ ]}+ />+ )}+<div className="space-y-4"><div className="flex gap-x-4 gap-y-2 items-center flex-wrap"><LemonInputdiff --git a/products/skills/frontend/generated/api.schemas.ts b/products/skills/frontend/generated/api.schemas.tsindex f67da74b5b4e..7fc1774cabef 100644--- a/products/skills/frontend/generated/api.schemas.ts+++ b/products/skills/frontend/generated/api.schemas.ts@@ -107,6 +107,8 @@ export interface LLMSkillListApi {allowed_tools?: string[]/** Arbitrary key-value metadata. */metadata?: LLMSkillListApiMetadata+ /** Server-owned classification — set by the producing system (the Signals harness stamps "scout"), not writable via the API. Empty for an ordinary skill. Groups skills into their own surface (e.g. the Scouts tab) independently of the skill name. */+ readonly category: string/** Flat list of markdown headings parsed from the skill body. Useful as a lightweight table of contents. */readonly outline: readonly LLMSkillOutlineEntryApi[]readonly version: number@@ -180,6 +182,8 @@ export interface LLMSkillCreateApi {allowed_tools?: string[]/** Arbitrary key-value metadata. */metadata?: LLMSkillCreateApiMetadata+ /** Server-owned classification — set by the producing system (the Signals harness stamps "scout"), not writable via the API. Empty for an ordinary skill. Groups skills into their own surface (e.g. the Scouts tab) independently of the skill name. */+ readonly category: string/** Bundled files to include with the initial version (scripts, references, assets). */files?: LLMSkillFileInputApi[]/** Flat list of markdown headings parsed from the skill body. Useful as a lightweight table of contents. */@@ -240,6 +244,8 @@ export interface LLMSkillApi {allowed_tools?: string[]/** Arbitrary key-value metadata. */metadata?: LLMSkillApiMetadata+ /** Server-owned classification — set by the producing system (the Signals harness stamps "scout"), not writable via the API. Empty for an ordinary skill. Groups skills into their own surface (e.g. the Scouts tab) independently of the skill name. */+ readonly category: string/** Bundled files manifest. Each entry is path + content_type only; fetch content via /llm_skills/name/{name}/files/{path}/. */readonly files: readonly LLMSkillFileManifestApi[]/** Flat list of markdown headings parsed from the skill body. Useful as a lightweight table of contents. */@@ -456,6 +462,10 @@ export interface LLMSkillResolveResponseApi {}export type LlmSkillsListParams = {+ /**+ * Filter skills to this exact category. Pass "scout" for Signals scouts, or an empty string to return only uncategorized skills. Omit the parameter entirely to return skills of every category.+ */+ category?: string/*** Filter skills by the ID of the user who created them.*/diff --git a/products/skills/frontend/llmSkillsLogic.ts b/products/skills/frontend/llmSkillsLogic.tsindex 1e6fd77a9014..10e815b20bd9 100644--- a/products/skills/frontend/llmSkillsLogic.ts+++ b/products/skills/frontend/llmSkillsLogic.ts@@ -73,6 +73,51 @@ export const SKILLS_GROUP_LIMIT = 500export const SKILLS_GROUP_MAX_DEPTH = 4export const LLM_SKILLS_FORCE_RELOAD_PARAM = 'llm_skills_force_reload'+/** URL/UI key for the default tab — the uncategorized skills (everything not pulled into a category tab). */+export const DEFAULT_SKILLS_TAB_KEY: string = 'skills'++/** Sub-title shown for the default "Skills" tab. Category tabs carry their own copy (below). */+export const DEFAULT_SKILLS_TAB_DESCRIPTION = 'Manage versioned agent skills that any agent can discover and use.'++export interface SkillCategoryTab {+ /** Tab key, also the `/skills/<key>` URL segment. */+ key: string+ /** The `LLMSkill.category` value this tab filters to. */+ category: string+ label: string+ /** Sub-title shown under the scene title while this tab is active. */+ description: string+}++/**+ * Category-backed tabs shown alongside the default "Skills" tab. Each entry surfaces one+ * `LLMSkill.category` value as its own tab and removes it from the default list (which only shows+ * uncategorized skills). To add a tab — e.g. official AI-plugin skills — add an entry here, register+ * the matching `/skills/<key>` route in manifest.tsx, and have the producer stamp that `category`.+ */+export const SKILL_CATEGORY_TABS: SkillCategoryTab[] = [+ {+ key: 'scouts',+ category: 'scout',+ label: 'Scouts',+ description:+ "Scouts — scheduled agents that scan your project and surface findings in your inbox. Includes PostHog's canonical scouts and any custom ones you author.",+ },+]++export function skillCategoryForTabKey(tabKey: string): string {+ return SKILL_CATEGORY_TABS.find((tab) => tab.key === tabKey)?.category ?? ''+}++export function skillTabDescription(tabKey: string): string {+ return SKILL_CATEGORY_TABS.find((tab) => tab.key === tabKey)?.description ?? DEFAULT_SKILLS_TAB_DESCRIPTION+}++/** The `/skills` or `/skills/<categoryKey>` path for a tab key. */+export function skillTabUrl(tabKey: string): string {+ return tabKey === DEFAULT_SKILLS_TAB_KEY ? urls.skills() : urls.skillsCategoryTab(tabKey)+}+export interface SkillFilters {page: numbersearch: string@@ -193,6 +238,8 @@ export const llmSkillsLogic = kea<llmSkillsLogicType>([debounce,}),loadSkills: (debounce: boolean = true) => ({ debounce }),+ loadCategoryCounts: true,+ setActiveTab: (tabKey: string) => ({ tabKey }),deleteSkill: (skillName: string) => ({ skillName }),duplicateSkill: (skillName: string, newName: string) => ({ skillName, newName }),importSkill: (file: File) => ({ file }),@@ -208,6 +255,12 @@ export const llmSkillsLogic = kea<llmSkillsLogicType>([}),reducers({+ activeTabKey: [+ DEFAULT_SKILLS_TAB_KEY,+ {+ setActiveTab: (_, { tabKey }) => tabKey,+ },+ ],rawFilters: [null as Partial<SkillFilters> | null,{@@ -264,6 +317,9 @@ export const llmSkillsLogic = kea<llmSkillsLogicType>([}const { filters } = values+ // Always send `category` (even as ""): the default tab shows uncategorized skills,+ // each category tab shows its own category. Presence of the param is the filter.+ const category = values.activeCategoryconst params = filters.group_by_prefix? {search: filters.search,@@ -271,6 +327,7 @@ export const llmSkillsLogic = kea<llmSkillsLogicType>([offset: 0,limit: SKILLS_GROUP_LIMIT,created_by_id: filters.created_by_id,+ category,}: {search: filters.search,@@ -278,6 +335,7 @@ export const llmSkillsLogic = kea<llmSkillsLogicType>([offset: Math.max(0, (filters.page - 1) * SKILLS_PER_PAGE),limit: SKILLS_PER_PAGE,created_by_id: filters.created_by_id,+ category,}if (@@ -294,6 +352,27 @@ export const llmSkillsLogic = kea<llmSkillsLogicType>([},},],+ // Per-category skill counts, used to decide which category tabs to show. Loaded once on+ // mount (and after a delete) with a cheap limit=1 probe per category — we only read `count`.+ categoryCounts: [+ {} as Record<string, number>,+ {+ loadCategoryCounts: async () => {+ const teamId = String(ApiConfig.getCurrentTeamId())+ const entries = await Promise.all(+ SKILL_CATEGORY_TABS.map(async (tab) => {+ const { count } = await llmSkillsList(teamId, {+ category: tab.category,+ limit: 1,+ offset: 0,+ })+ return [tab.category, count] as const+ })+ )+ return Object.fromEntries(entries)+ },+ },+ ],})),selectors({@@ -302,6 +381,27 @@ export const llmSkillsLogic = kea<llmSkillsLogicType>([(rawFilters: Partial<SkillFilters> | null): SkillFilters => cleanFilters(rawFilters || {}),],+ activeCategory: [+ (s) => [s.activeTabKey],+ (activeTabKey: string): string => skillCategoryForTabKey(activeTabKey),+ ],++ activeTabDescription: [+ (s) => [s.activeTabKey],+ (activeTabKey: string): string => skillTabDescription(activeTabKey),+ ],++ // A category tab is shown only once the team has at least one skill in that category.+ // The active tab is always kept visible so direct navigation to /skills/<key> (or deleting+ // the last skill while viewing the tab) doesn't strand the user on a tab that isn't listed.+ visibleCategoryTabs: [+ (s) => [s.categoryCounts, s.activeTabKey],+ (categoryCounts: Record<string, number>, activeTabKey: string): SkillCategoryTab[] =>+ SKILL_CATEGORY_TABS.filter(+ (tab) => (categoryCounts[tab.category] ?? 0) > 0 || tab.key === activeTabKey+ ),+ ],+count: [(s) => [s.skills], (skills: PaginatedLLMSkillListListApi) => skills.count],marketplaceCommand: [@@ -393,6 +493,8 @@ export const llmSkillsLogic = kea<llmSkillsLogicType>([await llmSkillsNameArchiveCreate(String(ApiConfig.getCurrentTeamId()), skillName)lemonToast.info(`${skillName || 'Skill'} has been archived.`)await asyncActions.loadSkills(false)+ // Archiving may have removed the last skill in a category — refresh tab visibility.+ actions.loadCategoryCounts()} catch (e) {console.error('Failed to archive skill', e)lemonToast.error('Failed to archive skill')@@ -485,32 +587,49 @@ export const llmSkillsLogic = kea<llmSkillsLogicType>([const urlValues = cleanFilters(router.values.searchParams)if (!objectsEqual(values.filters, urlValues)) {- return [urls.skills(), nextValues, {}, { replace: true }]+ // Keep filter changes on the active tab's path so editing search/sort on a category+ // tab doesn't bounce the URL back to the default /skills.+ return [skillTabUrl(values.activeTabKey), nextValues, {}, { replace: true }]}}return { setFilters: changeUrl }}),- urlToAction(({ actions, values }) => ({- [urls.skills()]: (_, searchParams, __, { method }) => {- const newFilters = cleanFilters(searchParams)- const forceReload = typeof searchParams?.[LLM_SKILLS_FORCE_RELOAD_PARAM] === 'string'- if (!objectsEqual(values.filters, newFilters)) {- actions.setFilters(newFilters, false)- } else if (forceReload || method !== 'REPLACE') {- actions.loadSkills(false)- }+ urlToAction(({ actions, values }) => {+ const handleTab =+ (tabKey: string) =>+ (_: any, searchParams: Record<string, any>, __: any, { method }: { method: string }): void => {+ // Update the active tab first so the loader picks up the new category. Setting it is a+ // plain reducer (no reload of its own) — handleTab owns the single reload below.+ const tabChanged = values.activeTabKey !== tabKey+ if (tabChanged) {+ actions.setActiveTab(tabKey)+ }+ const newFilters = cleanFilters(searchParams)+ const forceReload = typeof searchParams?.[LLM_SKILLS_FORCE_RELOAD_PARAM] === 'string'+ if (!objectsEqual(values.filters, newFilters)) {+ // setFilters reloads, reading the just-updated activeCategory.+ actions.setFilters(newFilters, false)+ } else if (tabChanged || forceReload || method !== 'REPLACE') {+ actions.loadSkills(false)+ }- if (forceReload) {- const nextSearchParams = { ...searchParams }- delete nextSearchParams[LLM_SKILLS_FORCE_RELOAD_PARAM]- router.actions.replace(urls.skills(), nextSearchParams)+ if (forceReload) {+ const nextSearchParams = { ...searchParams }+ delete nextSearchParams[LLM_SKILLS_FORCE_RELOAD_PARAM]+ router.actions.replace(skillTabUrl(tabKey), nextSearchParams)+ }}- },- })),++ return {+ [urls.skills()]: handleTab(DEFAULT_SKILLS_TAB_KEY),+ ...Object.fromEntries(SKILL_CATEGORY_TABS.map((tab) => [skillTabUrl(tab.key), handleTab(tab.key)])),+ }+ }),afterMount(({ actions }) => {actions.loadSkills()+ actions.loadCategoryCounts()}),])diff --git a/products/skills/frontend/skillConstants.ts b/products/skills/frontend/skillConstants.tsindex e06e214dd6dc..d0de5cb4be0e 100644--- a/products/skills/frontend/skillConstants.ts+++ b/products/skills/frontend/skillConstants.ts@@ -1,12 +1,17 @@export const SKILL_NAME_MAX_LENGTH = 64export const SKILL_DESCRIPTION_MAX_LENGTH = 4096+// Names that collide with reserved /skills routes: 'new' (the create form) and the category-tab+// slugs registered under /skills/<slug> in manifest.tsx. A skill with one of these names would be+// shadowed by its route. Kept in sync with RESERVED_SKILL_NAMES in the backend skill_serializers.+const RESERVED_SKILL_NAMES = new Set(['new', 'scouts'])+export function validateSkillName(name: string): string | undefined {if (!name?.trim()) {return 'Name is required'}- if (name.toLowerCase() === 'new') {- return "'new' is a reserved name"+ if (RESERVED_SKILL_NAMES.has(name.toLowerCase())) {+ return `'${name.toLowerCase()}' is a reserved name`}if (name.length > SKILL_NAME_MAX_LENGTH) {return `Name must be ${SKILL_NAME_MAX_LENGTH} characters or fewer`diff --git a/products/skills/manifest.tsx b/products/skills/manifest.tsxindex d1ff15cfac99..0d3af481fd28 100644--- a/products/skills/manifest.tsx+++ b/products/skills/manifest.tsx@@ -28,6 +28,9 @@ export const manifest: ProductManifest = {},routes: {'/skills': ['Skills', 'skills'],+ // Category tabs (e.g. /skills/scouts) must precede the `/skills/:name` wildcard so they+ // aren't captured as a skill named after the tab. Route order = match precedence.+ '/skills/scouts': ['Skills', 'skillsScouts'],'/skills/:name': ['Skill', 'skill'],},redirects: {@@ -42,6 +45,8 @@ export const manifest: ProductManifest = {},urls: {skills: (): string => '/skills',+ // A category tab under /skills (e.g. /skills/scouts). The tab key is the URL segment.+ skillsCategoryTab: (categoryTab: string): string => `/skills/${categoryTab}`,skill: (name: string, params?: { file?: string; version?: number }): string =>combineUrl(`/skills/${name}`, params).url,},diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 3dfa967ebdef..c707930ec38e 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -26424,6 +26424,8 @@ export namespace Schemas {allowed_tools?: string[];/** Arbitrary key-value metadata. */metadata?: LLMSkillMetadata;+ /** Server-owned classification — set by the producing system (the Signals harness stamps "scout"), not writable via the API. Empty for an ordinary skill. Groups skills into their own surface (e.g. the Scouts tab) independently of the skill name. */+ readonly category: string;/** Bundled files manifest. Each entry is path + content_type only; fetch content via /llm_skills/name/{name}/files/{path}/. */readonly files: readonly LLMSkillFileManifest[];/** Flat list of markdown headings parsed from the skill body. Useful as a lightweight table of contents. */@@ -26490,6 +26492,8 @@ export namespace Schemas {allowed_tools?: string[];/** Arbitrary key-value metadata. */metadata?: LLMSkillCreateMetadata;+ /** Server-owned classification — set by the producing system (the Signals harness stamps "scout"), not writable via the API. Empty for an ordinary skill. Groups skills into their own surface (e.g. the Scouts tab) independently of the skill name. */+ readonly category: string;/** Bundled files to include with the initial version (scripts, references, assets). */files?: LLMSkillFileInput[];/** Flat list of markdown headings parsed from the skill body. Useful as a lightweight table of contents. */@@ -26615,6 +26619,8 @@ export namespace Schemas {allowed_tools?: string[];/** Arbitrary key-value metadata. */metadata?: LLMSkillListMetadata;+ /** Server-owned classification — set by the producing system (the Signals harness stamps "scout"), not writable via the API. Empty for an ordinary skill. Groups skills into their own surface (e.g. the Scouts tab) independently of the skill name. */+ readonly category: string;/** Flat list of markdown headings parsed from the skill body. Useful as a lightweight table of contents. */readonly outline: readonly LLMSkillOutlineEntry[];readonly version: number;@@ -53469,6 +53475,10 @@ export namespace Schemas {};export type EnvironmentsLlmSkillsListParams = {+ /**+ * Filter skills to this exact category. Pass "scout" for Signals scouts, or an empty string to return only uncategorized skills. Omit the parameter entirely to return skills of every category.+ */+ category?: string;/*** Filter skills by the ID of the user who created them.*/@@ -59749,6 +59759,10 @@ export namespace Schemas {};export type LlmSkillsListParams = {+ /**+ * Filter skills to this exact category. Pass "scout" for Signals scouts, or an empty string to return only uncategorized skills. Omit the parameter entirely to return skills of every category.+ */+ category?: string;/*** Filter skills by the ID of the user who created them.*/diff --git a/services/mcp/src/generated/skills/api.ts b/services/mcp/src/generated/skills/api.tsindex 8e4594a3b447..e13d31a720b4 100644--- a/services/mcp/src/generated/skills/api.ts+++ b/services/mcp/src/generated/skills/api.ts@@ -17,6 +17,12 @@ export const LlmSkillsListParams = /* @__PURE__ */ zod.object({})export const LlmSkillsListQueryParams = /* @__PURE__ */ zod.object({+ category: zod+ .string()+ .optional()+ .describe(+ 'Filter skills to this exact category. Pass "scout" for Signals scouts, or an empty string to return only uncategorized skills. Omit the parameter entirely to return skills of every category.'+ ),created_by_id: zod.number().optional().describe('Filter skills by the ID of the user who created them.'),limit: zod.number().optional().describe('Number of results to return per page.'),offset: zod.number().optional().describe('The initial index from which to return the results.'),diff --git a/services/mcp/src/tools/generated/skills.ts b/services/mcp/src/tools/generated/skills.tsindex 158be182ba88..9052978b6bf7 100644--- a/services/mcp/src/tools/generated/skills.ts+++ b/services/mcp/src/tools/generated/skills.ts@@ -236,6 +236,7 @@ const skillList = (): ToolBase<typeof SkillListSchema, Schemas.PaginatedLLMSkillmethod: 'GET',path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/`,query: {+ category: params.category,created_by_id: params.created_by_id,limit: params.limit,offset: params.offset,diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-skill-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-skill-list.jsonindex 427d82032e8c..b2b0e9e06f3a 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-skill-list.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-skill-list.json@@ -1,6 +1,10 @@{"$schema": "https://json-schema.org/draft/2020-12/schema","properties": {+ "category": {+ "description": "Filter skills to this exact category. Pass \"scout\" for Signals scouts, or an empty string to return only uncategorized skills. Omit the parameter entirely to return skills of every category.",+ "type": "string"+ },"created_by_id": {"description": "Filter skills by the ID of the user who created them.","type": "number"diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/skill-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/skill-list.jsonindex 427d82032e8c..b2b0e9e06f3a 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/skill-list.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/skill-list.json@@ -1,6 +1,10 @@{"$schema": "https://json-schema.org/draft/2020-12/schema","properties": {+ "category": {+ "description": "Filter skills to this exact category. Pass \"scout\" for Signals scouts, or an empty string to return only uncategorized skills. Omit the parameter entirely to return skills of every category.",+ "type": "string"+ },"created_by_id": {"description": "Filter skills by the ID of the user who created them.","type": "number"