Skip to content

: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.

feat(skills): move skills backend into products/skills (#62920)

Andrew Maguire2053a30db02b
diff --git a/ee/hogai/chat_agent/toolkit.py b/ee/hogai/chat_agent/toolkit.py
index 5ccbe471a771..563336c7eb59 100644
--- a/ee/hogai/chat_agent/toolkit.py
+++ b/ee/hogai/chat_agent/toolkit.py
@@ -6,7 +6,7 @@ from django.conf import settings
from langchain_core.runnables import RunnableConfig
-from products.ai_observability.backend.tools.skills import GetLLMSkillFileTool, GetLLMSkillTool, ListLLMSkillsTool
+from products.skills.backend.tools.skills import GetLLMSkillFileTool, GetLLMSkillTool, ListLLMSkillsTool
from products.tasks.backend.max_tools import (
CreateTaskTool,
GetTaskRunLogsTool,
diff --git a/ee/hogai/core/agent_modes/presets/ai_observability.py b/ee/hogai/core/agent_modes/presets/ai_observability.py
index e14e23f77ecd..0b1ad2e97671 100644
--- a/ee/hogai/core/agent_modes/presets/ai_observability.py
+++ b/ee/hogai/core/agent_modes/presets/ai_observability.py
@@ -150,11 +150,7 @@ class AIObservabilityAgentToolkit(AgentToolkit):
@property
def tools(self) -> list[type["MaxTool"]]:
from products.ai_observability.backend.tools.run_hog_eval import RunHogEvalTestTool
- from products.ai_observability.backend.tools.skills import (
- ArchiveLLMSkillTool,
- CreateLLMSkillTool,
- UpdateLLMSkillTool,
- )
+ from products.skills.backend.tools.skills import ArchiveLLMSkillTool, CreateLLMSkillTool, UpdateLLMSkillTool
return [
SearchLLMTracesTool,
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index d9c7cfe1c79e..3f456f4c3ad7 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -2165,9 +2165,9 @@ snapshots:
filters-taxonomic-filter-menu-rebuild--properties--light:
hash: v1.k794b7964.d34e4efbf39b777cea753e09d6b6676279568fc8149b0150d38212ecea25ebae.00tWwmV_ZtFEKmK0-hgMIyVtRyGl4_88ZF9_iz3_T-k
filters-taxonomic-filter-menu-rebuild--recents-bare-key-expansion--dark:
- hash: v1.k794b7964.cc3b845bfe2b965e59141f710893998621d01c063142723621448e35e09c8d7c.65PiOvdxhTsaujscK1Xe-MPtxHjqeaMhA7SCnWoZaO8
+ hash: v1.k794b7964.ea50a7beff34bc4e953b625a4edf12bca69b6849c5b1a78f11002c973f6b3c90.IFWFrwM8maHSl4zUuOyeaBoEMTiP3NCiAag1ydXra7k
filters-taxonomic-filter-menu-rebuild--recents-bare-key-expansion--light:
- hash: v1.k794b7964.ac72ea7dcc07282f4ade675a6099524699367bdd14b0d64202fb77ca7375a95f.qnS6G_IMFEvW0ViNb2MQuv8Ytomdv_AiBBYEQ6sZl3A
+ hash: v1.k794b7964.1ed0f75c3a0480005dea3df32256890a335aac22a66cf4a4baed82dc6fc25854.Zdi4U-3WRmlIToDecZBZVqjap7rYrCGHzuwQP-brtkY
filters-taxonomic-filter-menu-rebuild--series-plus-data-warehouse--dark:
hash: v1.k794b7964.5364889863d936006f0c97c11ae97ac04c301fcf51c664fb2e47be556f8b0314.DyFJNAuMFjmc4NK-8KbMb3CEQ3F4l9ZdaRi4lqkUsWc
filters-taxonomic-filter-menu-rebuild--series-plus-data-warehouse--light:
diff --git a/posthog/settings/web.py b/posthog/settings/web.py
index b1f09340c50b..20f9b1ed30a2 100644
--- a/posthog/settings/web.py
+++ b/posthog/settings/web.py
@@ -40,6 +40,7 @@ PRODUCTS_APPS = [
"products.user_interviews.backend.apps.UserInterviewsConfig",
"products.ai_observability.backend.apps.AIObservabilityConfig",
"products.llm_analytics.backend.apps.LlmAnalyticsConfig",
+ "products.skills.backend.apps.SkillsConfig",
"products.endpoints.backend.apps.EndpointsConfig",
"products.marketing_analytics.backend.apps.MarketingAnalyticsConfig",
"products.error_tracking.backend.apps.ErrorTrackingConfig",
diff --git a/products/ai_observability/backend/migrations/0005_release_skills_to_skills_app.py b/products/ai_observability/backend/migrations/0005_release_skills_to_skills_app.py
new file mode 100644
index 000000000000..f0d562b574b1
--- /dev/null
+++ b/products/ai_observability/backend/migrations/0005_release_skills_to_skills_app.py
@@ -0,0 +1,34 @@
+# Generated by Django 5.2.14, then manually wrapped in SeparateDatabaseAndState.
+#
+# This is the ai_observability half of moving LLMSkill / LLMSkillFile into the
+# standalone skills product. It releases the models from ai_observability's
+# Django state without touching the database. The matching adopt happens in
+# products/skills/backend/migrations/0001_adopt_skills_models.py, which
+# declares the same models under the new `skills` app label and keeps
+# db_table="llm_analytics_..." so the physical tables stay where they are.
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("ai_observability", "0004_parserrecipe"),
+ ]
+
+ operations = [
+ migrations.SeparateDatabaseAndState(
+ state_operations=[
+ migrations.RemoveField(
+ model_name="llmskillfile",
+ name="skill",
+ ),
+ migrations.DeleteModel(
+ name="LLMSkill",
+ ),
+ migrations.DeleteModel(
+ name="LLMSkillFile",
+ ),
+ ],
+ database_operations=[],
+ ),
+ ]
diff --git a/products/ai_observability/backend/migrations/max_migration.txt b/products/ai_observability/backend/migrations/max_migration.txt
index 2763f38a008a..bb43d9adb48c 100644
--- a/products/ai_observability/backend/migrations/max_migration.txt
+++ b/products/ai_observability/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0004_parserrecipe
+0005_release_skills_to_skills_app
diff --git a/products/ai_observability/backend/models/__init__.py b/products/ai_observability/backend/models/__init__.py
index 8cfd844f4f9b..281239b40423 100644
--- a/products/ai_observability/backend/models/__init__.py
+++ b/products/ai_observability/backend/models/__init__.py
@@ -11,7 +11,6 @@ from .parser_recipe import ParserRecipe
from .provider_keys import LLMProvider, LLMProviderKey
from .review_queues import ReviewQueue, ReviewQueueItem
from .score_definitions import ScoreDefinition, ScoreDefinitionVersion
-from .skills import LLMSkill, LLMSkillFile
from .taggers import Tagger
from .trace_reviews import TraceReview, TraceReviewScore
@@ -30,8 +29,6 @@ __all__ = [
"LLMProvider",
"LLMProviderKey",
"LLMTraceSummary",
- "LLMSkill",
- "LLMSkillFile",
"ReviewQueue",
"ReviewQueueItem",
"ScoreDefinition",
diff --git a/products/ai_observability/backend/routes.py b/products/ai_observability/backend/routes.py
index 3d3f47b1de79..1ca60f2681fe 100644
--- a/products/ai_observability/backend/routes.py
+++ b/products/ai_observability/backend/routes.py
@@ -29,7 +29,6 @@ from products.ai_observability.backend.api import (
TaggerViewSet,
TraceReviewViewSet,
)
-from products.ai_observability.backend.api.skills import LLMSkillViewSet
def register_routes(routers: RouterRegistry) -> None:
@@ -42,7 +41,6 @@ def register_routes(routers: RouterRegistry) -> None:
routers.projects.register(
r"llm_analytics/parser_recipes", ParserRecipeViewSet, "project_llm_analytics_parser_recipes", ["team_id"]
)
- routers.register_legacy_dual_route(r"llm_skills", LLMSkillViewSet, "project_llm_skills", ["team_id"])
routers.register_legacy_dual_route(r"datasets", DatasetViewSet, "environment_datasets", ["team_id"])
routers.register_legacy_dual_route(r"dataset_items", DatasetItemViewSet, "environment_dataset_items", ["team_id"])
routers.register_legacy_dual_route(r"evaluations", EvaluationViewSet, "project_evaluations", ["team_id"])
diff --git a/products/ai_observability/frontend/generated/api.schemas.ts b/products/ai_observability/frontend/generated/api.schemas.ts
index fa459c31f8e5..762ed1026a5e 100644
--- a/products/ai_observability/frontend/generated/api.schemas.ts
+++ b/products/ai_observability/frontend/generated/api.schemas.ts
@@ -2001,319 +2001,6 @@ export interface LLMPromptResolveResponseApi {
has_more: boolean
}
-export interface LLMSkillOutlineEntryApi {
- /**
- * Markdown heading level (1-6).
- * @minimum 1
- * @maximum 6
- */
- level: number
- /** Heading text. */
- text: string
-}
-
-/**
- * Arbitrary key-value metadata.
- */
-export type LLMSkillListApiMetadata = { [key: string]: unknown }
-
-/**
- * List serializer that omits body and file manifest — progressive disclosure (Level 1).
- */
-export interface LLMSkillListApi {
- readonly id: string
- /**
- * Unique skill name. Lowercase letters, numbers, and hyphens only. Max 64 characters.
- * @maxLength 64
- */
- name: string
- /**
- * What this skill does and when to use it. Max 4096 characters.
- * @maxLength 4096
- */
- description: string
- /**
- * License name or reference to a bundled license file.
- * @maxLength 255
- */
- license?: string
- /**
- * Environment requirements (intended product, system packages, network access, etc.).
- * @maxLength 500
- */
- compatibility?: string
- /** List of pre-approved tools the skill may use. */
- allowed_tools?: string[]
- /** Arbitrary key-value metadata. */
- metadata?: LLMSkillListApiMetadata
- /** Flat list of markdown headings parsed from the skill body. Useful as a lightweight table of contents. */
- readonly outline: readonly LLMSkillOutlineEntryApi[]
- readonly version: number
- readonly created_by: UserBasicApi
- readonly created_at: string
- readonly updated_at: string
- readonly deleted: boolean
- readonly is_latest: boolean
- readonly latest_version: number
- readonly version_count: number
- readonly first_version_created_at: string
-}
-
-export interface PaginatedLLMSkillListListApi {
- count: number
- /** @nullable */
- next?: string | null
- /** @nullable */
- previous?: string | null
- results: LLMSkillListApi[]
-}
-
-/**
- * Arbitrary key-value metadata.
- */
-export type LLMSkillCreateApiMetadata = { [key: string]: unknown }
-
-export interface LLMSkillFileInputApi {
- /**
- * File path relative to skill root, e.g. 'scripts/setup.sh' or 'references/guide.md'.
- * @maxLength 500
- */
- path: string
- /** Text content of the file. */
- content: string
- /**
- * MIME type of the file content.
- * @maxLength 100
- */
- content_type?: string
-}
-
-/**
- * Create serializer — accepts bundled files as write-only input on POST.
- */
-export interface LLMSkillCreateApi {
- readonly id: string
- /**
- * Unique skill name. Lowercase letters, numbers, and hyphens only. Max 64 characters.
- * @maxLength 64
- */
- name: string
- /**
- * What this skill does and when to use it. Max 4096 characters.
- * @maxLength 4096
- */
- description: string
- /** The SKILL.md instruction content (markdown). */
- body: string
- /**
- * License name or reference to a bundled license file.
- * @maxLength 255
- */
- license?: string
- /**
- * Environment requirements (intended product, system packages, network access, etc.).
- * @maxLength 500
- */
- compatibility?: string
- /** List of pre-approved tools the skill may use. */
- allowed_tools?: string[]
- /** Arbitrary key-value metadata. */
- metadata?: LLMSkillCreateApiMetadata
- /** 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. */
- readonly outline: readonly LLMSkillOutlineEntryApi[]
- readonly version: number
- readonly created_by: UserBasicApi
- readonly created_at: string
- readonly updated_at: string
- readonly deleted: boolean
- readonly is_latest: boolean
- readonly latest_version: number
- readonly version_count: number
- readonly first_version_created_at: string
-}
-
-/**
- * Arbitrary key-value metadata.
- */
-export type LLMSkillApiMetadata = { [key: string]: unknown }
-
-export interface LLMSkillFileManifestApi {
- /** @maxLength 500 */
- path: string
- /** @maxLength 100 */
- content_type?: string
-}
-
-export interface LLMSkillApi {
- readonly id: string
- /**
- * Unique skill name. Lowercase letters, numbers, and hyphens only. Max 64 characters.
- * @maxLength 64
- */
- name: string
- /**
- * What this skill does and when to use it. Max 4096 characters.
- * @maxLength 4096
- */
- description: string
- /** The SKILL.md instruction content (markdown). */
- body: string
- /**
- * License name or reference to a bundled license file.
- * @maxLength 255
- */
- license?: string
- /**
- * Environment requirements (intended product, system packages, network access, etc.).
- * @maxLength 500
- */
- compatibility?: string
- /** List of pre-approved tools the skill may use. */
- allowed_tools?: string[]
- /** Arbitrary key-value metadata. */
- metadata?: LLMSkillApiMetadata
- /** 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. */
- readonly outline: readonly LLMSkillOutlineEntryApi[]
- readonly version: number
- readonly created_by: UserBasicApi
- readonly created_at: string
- readonly updated_at: string
- readonly deleted: boolean
- readonly is_latest: boolean
- readonly latest_version: number
- readonly version_count: number
- readonly first_version_created_at: string
-}
-
-/**
- * Arbitrary key-value metadata.
- */
-export type PatchedLLMSkillPublishApiMetadata = { [key: string]: unknown }
-
-export interface LLMSkillEditOperationApi {
- /** Text to find in the target content. Must match exactly once. */
- old: string
- /** Replacement text. */
- new: string
-}
-
-export interface LLMSkillFileEditApi {
- /**
- * Path of the bundled file to edit. Must match an existing file on the current skill version.
- * @maxLength 500
- */
- path: string
- /** Sequential find/replace operations to apply to this file's content. */
- edits: LLMSkillEditOperationApi[]
-}
-
-export interface PatchedLLMSkillPublishApi {
- /** Full skill body (SKILL.md instruction content) to publish as a new version. Mutually exclusive with edits. */
- body?: string
- /** List of find/replace operations to apply to the current skill body. Each edit's 'old' text must match exactly once. Edits are applied sequentially. Mutually exclusive with body. */
- edits?: LLMSkillEditOperationApi[]
- /**
- * Updated description for the new version.
- * @maxLength 4096
- */
- description?: string
- /**
- * License name or reference.
- * @maxLength 255
- */
- license?: string
- /**
- * Environment requirements.
- * @maxLength 500
- */
- compatibility?: string
- /** List of pre-approved tools the skill may use. */
- allowed_tools?: string[]
- /** Arbitrary key-value metadata. */
- metadata?: PatchedLLMSkillPublishApiMetadata
- /** Bundled files to include with this version. Replaces all files from the previous version. Mutually exclusive with file_edits. */
- files?: LLMSkillFileInputApi[]
- /** Per-file find/replace updates. Each entry targets one existing file by path and applies sequential edits to its content. Non-targeted files carry forward unchanged. Cannot add, remove, or rename files — use 'files' for that. Mutually exclusive with files. */
- file_edits?: LLMSkillFileEditApi[]
- /**
- * Latest version you are editing from. Used for optimistic concurrency checks.
- * @minimum 1
- */
- base_version?: number
-}
-
-export interface LLMSkillDuplicateApi {
- /**
- * Name for the duplicated skill. Must be unique.
- * @maxLength 64
- */
- new_name: string
-}
-
-export interface LLMSkillFileCreateApi {
- /**
- * File path relative to skill root, e.g. 'scripts/setup.sh' or 'references/guide.md'.
- * @maxLength 500
- */
- path: string
- /** Text content of the file. */
- content: string
- /**
- * MIME type of the file content.
- * @maxLength 100
- */
- content_type?: string
- /**
- * Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.
- * @minimum 1
- */
- base_version?: number
-}
-
-export interface LLMSkillFileRenameApi {
- /**
- * Current file path to rename.
- * @maxLength 500
- */
- old_path: string
- /**
- * New file path. Must not already exist in the skill.
- * @maxLength 500
- */
- new_path: string
- /**
- * Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.
- * @minimum 1
- */
- base_version?: number
-}
-
-export interface LLMSkillFileApi {
- /** @maxLength 500 */
- path: string
- content: string
- /** @maxLength 100 */
- content_type?: string
-}
-
-export interface LLMSkillVersionSummaryApi {
- readonly id: string
- readonly version: number
- readonly created_by: UserBasicApi
- readonly created_at: string
- readonly is_latest: boolean
-}
-
-export interface LLMSkillResolveResponseApi {
- skill: LLMSkillApi
- versions: LLMSkillVersionSummaryApi[]
- has_more: boolean
-}
-
/**
* * `llm` - LLM
* * `hog` - Hog
@@ -3003,77 +2690,6 @@ export type LlmPromptsResolveNameRetrieveParams = {
version_id?: string
}
-export type LlmSkillsListParams = {
- /**
- * Filter skills by the ID of the user who created them.
- */
- created_by_id?: number
- /**
- * Number of results to return per page.
- */
- limit?: number
- /**
- * The initial index from which to return the results.
- */
- offset?: number
- /**
- * Optional substring filter applied to skill names and descriptions.
- */
- search?: string
-}
-
-export type LlmSkillsNameRetrieveParams = {
- /**
- * Specific skill version to fetch. If omitted, the latest version is returned.
- * @minimum 1
- */
- version?: number
-}
-
-export type LlmSkillsNameFilesRetrieveParams = {
- /**
- * Specific skill version to fetch. If omitted, the latest version is returned.
- * @minimum 1
- */
- version?: number
-}
-
-export type LlmSkillsNameFilesDestroyParams = {
- /**
- * Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.
- * @minimum 1
- */
- base_version?: number
-}
-
-export type LlmSkillsResolveNameRetrieveParams = {
- /**
- * Return versions older than this version number. Mutually exclusive with offset.
- * @minimum 1
- */
- before_version?: number
- /**
- * Maximum number of versions to return per page (1-100).
- * @minimum 1
- * @maximum 100
- */
- limit?: number
- /**
- * Zero-based offset into version history for pagination. Mutually exclusive with before_version.
- * @minimum 0
- */
- offset?: number
- /**
- * Specific skill version to fetch. If omitted, the latest version is returned.
- * @minimum 1
- */
- version?: number
- /**
- * Exact skill version UUID to resolve.
- */
- version_id?: string
-}
-
export type TaggersListParams = {
/**
* Filter by enabled status
diff --git a/products/ai_observability/frontend/generated/api.ts b/products/ai_observability/frontend/generated/api.ts
index a25d38e9e6c1..5be27c5672cb 100644
--- a/products/ai_observability/frontend/generated/api.ts
+++ b/products/ai_observability/frontend/generated/api.ts
@@ -32,13 +32,6 @@ import type {
LLMPromptPublicApi,
LLMPromptResolveResponseApi,
LLMProviderKeyApi,
- LLMSkillApi,
- LLMSkillCreateApi,
- LLMSkillDuplicateApi,
- LLMSkillFileApi,
- LLMSkillFileCreateApi,
- LLMSkillFileRenameApi,
- LLMSkillResolveResponseApi,
LlmAnalyticsClusteringConfigRetrieve200,
LlmAnalyticsClusteringConfigSetEventFiltersCreate200,
LlmAnalyticsClusteringJobsListParams,
@@ -57,11 +50,6 @@ import type {
LlmPromptsListParams,
LlmPromptsNameRetrieveParams,
LlmPromptsResolveNameRetrieveParams,
- LlmSkillsListParams,
- LlmSkillsNameFilesDestroyParams,
- LlmSkillsNameFilesRetrieveParams,
- LlmSkillsNameRetrieveParams,
- LlmSkillsResolveNameRetrieveParams,
OfflineExperimentItemsRequestApi,
OfflineExperimentItemsResponseApi,
PaginatedClusteringJobListApi,
@@ -72,7 +60,6 @@ import type {
PaginatedEvaluationReportRunListApi,
PaginatedLLMPromptListListApi,
PaginatedLLMProviderKeyListApi,
- PaginatedLLMSkillListListApi,
PaginatedParserRecipeListApi,
PaginatedReviewQueueItemListApi,
PaginatedReviewQueueListApi,
@@ -87,7 +74,6 @@ import type {
PatchedEvaluationReportApi,
PatchedLLMPromptPublishApi,
PatchedLLMProviderKeyApi,
- PatchedLLMSkillPublishApi,
PatchedParserRecipeApi,
PatchedReviewQueueItemUpdateApi,
PatchedReviewQueueUpdateApi,
@@ -2050,269 +2036,6 @@ export const llmPromptsResolveNameRetrieve = async (
})
}
-export const getLlmSkillsListUrl = (projectId: string, params?: LlmSkillsListParams) => {
- const normalizedParams = new URLSearchParams()
-
- Object.entries(params || {}).forEach(([key, value]) => {
- if (value !== undefined) {
- normalizedParams.append(key, value === null ? 'null' : String(value))
- }
- })
-
- const stringifiedParams = normalizedParams.toString()
-
- return stringifiedParams.length > 0
- ? `/api/projects/${projectId}/llm_skills/?${stringifiedParams}`
- : `/api/projects/${projectId}/llm_skills/`
-}
-
-export const llmSkillsList = async (
- projectId: string,
- params?: LlmSkillsListParams,
- options?: RequestInit
-): Promise<PaginatedLLMSkillListListApi> => {
- return apiMutator<PaginatedLLMSkillListListApi>(getLlmSkillsListUrl(projectId, params), {
- ...options,
- method: 'GET',
- })
-}
-
-export const getLlmSkillsCreateUrl = (projectId: string) => {
- return `/api/projects/${projectId}/llm_skills/`
-}
-
-export const llmSkillsCreate = async (
- projectId: string,
- lLMSkillCreateApi: NonReadonly<LLMSkillCreateApi>,
- options?: RequestInit
-): Promise<LLMSkillCreateApi> => {
- return apiMutator<LLMSkillCreateApi>(getLlmSkillsCreateUrl(projectId), {
- ...options,
- method: 'POST',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(lLMSkillCreateApi),
- })
-}
-
-export const getLlmSkillsNameRetrieveUrl = (
- projectId: string,
- skillName: string,
- params?: LlmSkillsNameRetrieveParams
-) => {
- const normalizedParams = new URLSearchParams()
-
- Object.entries(params || {}).forEach(([key, value]) => {
- if (value !== undefined) {
- normalizedParams.append(key, value === null ? 'null' : String(value))
- }
- })
-
- const stringifiedParams = normalizedParams.toString()
-
- return stringifiedParams.length > 0
- ? `/api/projects/${projectId}/llm_skills/name/${skillName}/?${stringifiedParams}`
- : `/api/projects/${projectId}/llm_skills/name/${skillName}/`
-}
-
-export const llmSkillsNameRetrieve = async (
- projectId: string,
- skillName: string,
- params?: LlmSkillsNameRetrieveParams,
- options?: RequestInit
-): Promise<LLMSkillApi> => {
- return apiMutator<LLMSkillApi>(getLlmSkillsNameRetrieveUrl(projectId, skillName, params), {
- ...options,
- method: 'GET',
- })
-}
-
-export const getLlmSkillsNamePartialUpdateUrl = (projectId: string, skillName: string) => {
- return `/api/projects/${projectId}/llm_skills/name/${skillName}/`
-}
-
-export const llmSkillsNamePartialUpdate = async (
- projectId: string,
- skillName: string,
- patchedLLMSkillPublishApi?: PatchedLLMSkillPublishApi,
- options?: RequestInit
-): Promise<LLMSkillApi> => {
- return apiMutator<LLMSkillApi>(getLlmSkillsNamePartialUpdateUrl(projectId, skillName), {
- ...options,
- method: 'PATCH',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(patchedLLMSkillPublishApi),
- })
-}
-
-export const getLlmSkillsNameArchiveCreateUrl = (projectId: string, skillName: string) => {
- return `/api/projects/${projectId}/llm_skills/name/${skillName}/archive/`
-}
-
-export const llmSkillsNameArchiveCreate = async (
- projectId: string,
- skillName: string,
- options?: RequestInit
-): Promise<void> => {
- return apiMutator<void>(getLlmSkillsNameArchiveCreateUrl(projectId, skillName), {
- ...options,
- method: 'POST',
- })
-}
-
-export const getLlmSkillsNameDuplicateCreateUrl = (projectId: string, skillName: string) => {
- return `/api/projects/${projectId}/llm_skills/name/${skillName}/duplicate/`
-}
-
-export const llmSkillsNameDuplicateCreate = async (
- projectId: string,
- skillName: string,
- lLMSkillDuplicateApi: LLMSkillDuplicateApi,
- options?: RequestInit
-): Promise<LLMSkillApi> => {
- return apiMutator<LLMSkillApi>(getLlmSkillsNameDuplicateCreateUrl(projectId, skillName), {
- ...options,
- method: 'POST',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(lLMSkillDuplicateApi),
- })
-}
-
-export const getLlmSkillsNameFilesCreateUrl = (projectId: string, skillName: string) => {
- return `/api/projects/${projectId}/llm_skills/name/${skillName}/files/`
-}
-
-export const llmSkillsNameFilesCreate = async (
- projectId: string,
- skillName: string,
- lLMSkillFileCreateApi: LLMSkillFileCreateApi,
- options?: RequestInit
-): Promise<LLMSkillApi> => {
- return apiMutator<LLMSkillApi>(getLlmSkillsNameFilesCreateUrl(projectId, skillName), {
- ...options,
- method: 'POST',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(lLMSkillFileCreateApi),
- })
-}
-
-export const getLlmSkillsNameFilesRenameCreateUrl = (projectId: string, skillName: string) => {
- return `/api/projects/${projectId}/llm_skills/name/${skillName}/files-rename/`
-}
-
-export const llmSkillsNameFilesRenameCreate = async (
- projectId: string,
- skillName: string,
- lLMSkillFileRenameApi: LLMSkillFileRenameApi,
- options?: RequestInit
-): Promise<LLMSkillApi> => {
- return apiMutator<LLMSkillApi>(getLlmSkillsNameFilesRenameCreateUrl(projectId, skillName), {
- ...options,
- method: 'POST',
- headers: { 'Content-Type': 'application/json', ...options?.headers },
- body: JSON.stringify(lLMSkillFileRenameApi),
- })
-}
-
-export const getLlmSkillsNameFilesRetrieveUrl = (
- projectId: string,
- skillName: string,
- filePath: string,
- params?: LlmSkillsNameFilesRetrieveParams
-) => {
- const normalizedParams = new URLSearchParams()
-
- Object.entries(params || {}).forEach(([key, value]) => {
- if (value !== undefined) {
- normalizedParams.append(key, value === null ? 'null' : String(value))
- }
- })
-
- const stringifiedParams = normalizedParams.toString()
-
- return stringifiedParams.length > 0
- ? `/api/projects/${projectId}/llm_skills/name/${skillName}/files/${filePath}/?${stringifiedParams}`
- : `/api/projects/${projectId}/llm_skills/name/${skillName}/files/${filePath}/`
-}
-
-export const llmSkillsNameFilesRetrieve = async (
- projectId: string,
- skillName: string,
- filePath: string,
- params?: LlmSkillsNameFilesRetrieveParams,
- options?: RequestInit
-): Promise<LLMSkillFileApi> => {
- return apiMutator<LLMSkillFileApi>(getLlmSkillsNameFilesRetrieveUrl(projectId, skillName, filePath, params), {
- ...options,
- method: 'GET',
- })
-}
-
-export const getLlmSkillsNameFilesDestroyUrl = (
- projectId: string,
- skillName: string,
- filePath: string,
- params?: LlmSkillsNameFilesDestroyParams
-) => {
- const normalizedParams = new URLSearchParams()
-
- Object.entries(params || {}).forEach(([key, value]) => {
- if (value !== undefined) {
- normalizedParams.append(key, value === null ? 'null' : String(value))
- }
- })
-
- const stringifiedParams = normalizedParams.toString()
-
- return stringifiedParams.length > 0
- ? `/api/projects/${projectId}/llm_skills/name/${skillName}/files/${filePath}/?${stringifiedParams}`
- : `/api/projects/${projectId}/llm_skills/name/${skillName}/files/${filePath}/`
-}
-
-export const llmSkillsNameFilesDestroy = async (
- projectId: string,
- skillName: string,
- filePath: string,
- params?: LlmSkillsNameFilesDestroyParams,
- options?: RequestInit
-): Promise<LLMSkillApi> => {
- return apiMutator<LLMSkillApi>(getLlmSkillsNameFilesDestroyUrl(projectId, skillName, filePath, params), {
- ...options,
- method: 'DELETE',
- })
-}
-
-export const getLlmSkillsResolveNameRetrieveUrl = (
- projectId: string,
- skillName: string,
- params?: LlmSkillsResolveNameRetrieveParams
-) => {
- const normalizedParams = new URLSearchParams()
-
- Object.entries(params || {}).forEach(([key, value]) => {
- if (value !== undefined) {
- normalizedParams.append(key, value === null ? 'null' : String(value))
- }
- })
-
- const stringifiedParams = normalizedParams.toString()
-
- return stringifiedParams.length > 0
- ? `/api/projects/${projectId}/llm_skills/resolve/name/${skillName}/?${stringifiedParams}`
- : `/api/projects/${projectId}/llm_skills/resolve/name/${skillName}/`
-}
-
-export const llmSkillsResolveNameRetrieve = async (
- projectId: string,
- skillName: string,
- params?: LlmSkillsResolveNameRetrieveParams,
- options?: RequestInit
-): Promise<LLMSkillResolveResponseApi> => {
- return apiMutator<LLMSkillResolveResponseApi>(getLlmSkillsResolveNameRetrieveUrl(projectId, skillName, params), {
- ...options,
- method: 'GET',
- })
-}
-
export const getTaggersListUrl = (projectId: string, params?: TaggersListParams) => {
const normalizedParams = new URLSearchParams()
diff --git a/products/ai_observability/frontend/generated/api.zod.ts b/products/ai_observability/frontend/generated/api.zod.ts
index c11f23605963..2bcc8405382d 100644
--- a/products/ai_observability/frontend/generated/api.zod.ts
+++ b/products/ai_observability/frontend/generated/api.zod.ts
@@ -1685,214 +1685,6 @@ export const LlmPromptsNameDuplicateCreateBody = /* @__PURE__ */ zod.object({
),
})
-export const llmSkillsCreateBodyNameMax = 64
-
-export const llmSkillsCreateBodyDescriptionMax = 4096
-
-export const llmSkillsCreateBodyLicenseMax = 255
-
-export const llmSkillsCreateBodyCompatibilityMax = 500
-
-export const llmSkillsCreateBodyFilesItemPathMax = 500
-
-export const llmSkillsCreateBodyFilesItemContentTypeDefault = `text/plain`
-export const llmSkillsCreateBodyFilesItemContentTypeMax = 100
-
-export const LlmSkillsCreateBody = /* @__PURE__ */ zod
- .object({
- name: zod
- .string()
- .max(llmSkillsCreateBodyNameMax)
- .describe('Unique skill name. Lowercase letters, numbers, and hyphens only. Max 64 characters.'),
- description: zod
- .string()
- .max(llmSkillsCreateBodyDescriptionMax)
- .describe('What this skill does and when to use it. Max 4096 characters.'),
- body: zod.string().describe('The SKILL.md instruction content (markdown).'),
- license: zod
- .string()
- .max(llmSkillsCreateBodyLicenseMax)
- .optional()
- .describe('License name or reference to a bundled license file.'),
- compatibility: zod
- .string()
- .max(llmSkillsCreateBodyCompatibilityMax)
- .optional()
- .describe('Environment requirements (intended product, system packages, network access, etc.).'),
- allowed_tools: zod.array(zod.string()).optional().describe('List of pre-approved tools the skill may use.'),
- metadata: zod.record(zod.string(), zod.unknown()).optional().describe('Arbitrary key-value metadata.'),
- files: zod
- .array(
- zod.object({
- path: zod
- .string()
- .max(llmSkillsCreateBodyFilesItemPathMax)
- .describe(
- "File path relative to skill root, e.g. 'scripts\/setup.sh' or 'references\/guide.md'."
- ),
- content: zod.string().describe('Text content of the file.'),
- content_type: zod
- .string()
- .max(llmSkillsCreateBodyFilesItemContentTypeMax)
- .default(llmSkillsCreateBodyFilesItemContentTypeDefault)
- .describe('MIME type of the file content.'),
- })
- )
- .optional()
- .describe('Bundled files to include with the initial version (scripts, references, assets).'),
- })
- .describe('Create serializer — accepts bundled files as write-only input on POST.')
-
-export const llmSkillsNamePartialUpdateBodyDescriptionMax = 4096
-
-export const llmSkillsNamePartialUpdateBodyLicenseMax = 255
-
-export const llmSkillsNamePartialUpdateBodyCompatibilityMax = 500
-
-export const llmSkillsNamePartialUpdateBodyFilesItemPathMax = 500
-
-export const llmSkillsNamePartialUpdateBodyFilesItemContentTypeDefault = `text/plain`
-export const llmSkillsNamePartialUpdateBodyFilesItemContentTypeMax = 100
-
-export const llmSkillsNamePartialUpdateBodyFileEditsItemPathMax = 500
-
-export const LlmSkillsNamePartialUpdateBody = /* @__PURE__ */ zod.object({
- body: zod
- .string()
- .optional()
- .describe(
- 'Full skill body (SKILL.md instruction content) to publish as a new version. Mutually exclusive with edits.'
- ),
- edits: zod
- .array(
- zod.object({
- old: zod.string().describe('Text to find in the target content. Must match exactly once.'),
- new: zod.string().describe('Replacement text.'),
- })
- )
- .optional()
- .describe(
- "List of find\/replace operations to apply to the current skill body. Each edit's 'old' text must match exactly once. Edits are applied sequentially. Mutually exclusive with body."
- ),
- description: zod
- .string()
- .max(llmSkillsNamePartialUpdateBodyDescriptionMax)
- .optional()
- .describe('Updated description for the new version.'),
- license: zod
- .string()
- .max(llmSkillsNamePartialUpdateBodyLicenseMax)
- .optional()
- .describe('License name or reference.'),
- compatibility: zod
- .string()
- .max(llmSkillsNamePartialUpdateBodyCompatibilityMax)
- .optional()
- .describe('Environment requirements.'),
- allowed_tools: zod.array(zod.string()).optional().describe('List of pre-approved tools the skill may use.'),
- metadata: zod.record(zod.string(), zod.unknown()).optional().describe('Arbitrary key-value metadata.'),
- files: zod
- .array(
- zod.object({
- path: zod
- .string()
- .max(llmSkillsNamePartialUpdateBodyFilesItemPathMax)
- .describe("File path relative to skill root, e.g. 'scripts\/setup.sh' or 'references\/guide.md'."),
- content: zod.string().describe('Text content of the file.'),
- content_type: zod
- .string()
- .max(llmSkillsNamePartialUpdateBodyFilesItemContentTypeMax)
- .default(llmSkillsNamePartialUpdateBodyFilesItemContentTypeDefault)
- .describe('MIME type of the file content.'),
- })
- )
- .optional()
- .describe(
- 'Bundled files to include with this version. Replaces all files from the previous version. Mutually exclusive with file_edits.'
- ),
- file_edits: zod
- .array(
- zod.object({
- path: zod
- .string()
- .max(llmSkillsNamePartialUpdateBodyFileEditsItemPathMax)
- .describe(
- 'Path of the bundled file to edit. Must match an existing file on the current skill version.'
- ),
- edits: zod
- .array(
- zod.object({
- old: zod.string().describe('Text to find in the target content. Must match exactly once.'),
- new: zod.string().describe('Replacement text.'),
- })
- )
- .describe("Sequential find\/replace operations to apply to this file's content."),
- })
- )
- .optional()
- .describe(
- "Per-file find\/replace updates. Each entry targets one existing file by path and applies sequential edits to its content. Non-targeted files carry forward unchanged. Cannot add, remove, or rename files — use 'files' for that. Mutually exclusive with files."
- ),
- base_version: zod
- .number()
- .min(1)
- .optional()
- .describe('Latest version you are editing from. Used for optimistic concurrency checks.'),
-})
-
-export const llmSkillsNameDuplicateCreateBodyNewNameMax = 64
-
-export const LlmSkillsNameDuplicateCreateBody = /* @__PURE__ */ zod.object({
- new_name: zod
- .string()
- .max(llmSkillsNameDuplicateCreateBodyNewNameMax)
- .describe('Name for the duplicated skill. Must be unique.'),
-})
-
-export const llmSkillsNameFilesCreateBodyPathMax = 500
-
-export const llmSkillsNameFilesCreateBodyContentTypeDefault = `text/plain`
-export const llmSkillsNameFilesCreateBodyContentTypeMax = 100
-
-export const LlmSkillsNameFilesCreateBody = /* @__PURE__ */ zod.object({
- path: zod
- .string()
- .max(llmSkillsNameFilesCreateBodyPathMax)
- .describe("File path relative to skill root, e.g. 'scripts\/setup.sh' or 'references\/guide.md'."),
- content: zod.string().describe('Text content of the file.'),
- content_type: zod
- .string()
- .max(llmSkillsNameFilesCreateBodyContentTypeMax)
- .default(llmSkillsNameFilesCreateBodyContentTypeDefault)
- .describe('MIME type of the file content.'),
- base_version: zod
- .number()
- .min(1)
- .optional()
- .describe(
- 'Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.'
- ),
-})
-
-export const llmSkillsNameFilesRenameCreateBodyOldPathMax = 500
-
-export const llmSkillsNameFilesRenameCreateBodyNewPathMax = 500
-
-export const LlmSkillsNameFilesRenameCreateBody = /* @__PURE__ */ zod.object({
- old_path: zod.string().max(llmSkillsNameFilesRenameCreateBodyOldPathMax).describe('Current file path to rename.'),
- new_path: zod
- .string()
- .max(llmSkillsNameFilesRenameCreateBodyNewPathMax)
- .describe('New file path. Must not already exist in the skill.'),
- base_version: zod
- .number()
- .min(1)
- .optional()
- .describe(
- 'Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.'
- ),
-})
-
export const taggersCreateBodyNameMax = 400
export const taggersCreateBodyTaggerTypeDefault = `llm`
diff --git a/products/ai_observability/mcp/tools.yaml b/products/ai_observability/mcp/tools.yaml
index b80208abd22c..673f408a6978 100644
--- a/products/ai_observability/mcp/tools.yaml
+++ b/products/ai_observability/mcp/tools.yaml
@@ -792,194 +792,6 @@ tools:
of trace or generation IDs and an analysis_level ("trace" or "generation"). Returns per-ID sentiment labels
with confidence scores and per-message breakdowns. Results are cached — use force_refresh to recompute.
Rate-limited.
- llma-skill-archive:
- operation: llm_skills_name_archive_create
- enabled: true
- scopes:
- - llm_skill:write
- annotations:
- readOnly: false
- destructive: true
- idempotent: false
- title: Archive skill
- description: >
- Archive every active version of an agent skill by name. This hides the skill from default lists and cannot
- be undone. Use llma-skill-get first if you need to inspect the skill before archiving it.
- param_overrides:
- skill_name:
- description: The kebab-case name of the skill to archive.
- llma-skill-create:
- operation: llm_skills_create
- enabled: true
- scopes:
- - llm_skill:write
- annotations:
- readOnly: false
- destructive: false
- idempotent: false
- title: Create skill
- description: >
- Create a new agent skill. Requires a unique kebab-case name (lowercase letters, numbers, hyphens), a
- description explaining when to use it, and the skill body (SKILL.md instruction content as markdown).
- Optionally include license, compatibility, allowed_tools, metadata, and bundled files.
- include_params:
- - name
- - description
- - body
- - license
- - compatibility
- - allowed_tools
- - metadata
- - files
- llma-skill-duplicate:
- operation: llm_skills_name_duplicate_create
- enabled: true
- scopes:
- - llm_skill:write
- annotations:
- readOnly: false
- destructive: false
- idempotent: false
- title: Duplicate skill
- description: >
- Duplicate an existing agent skill under a new name. Copies the latest version's content, metadata, and
- bundled files to create a new skill at version 1.
- llma-skill-file-create:
- operation: llm_skills_name_files_create
- enabled: true
- scopes:
- - llm_skill:write
- annotations:
- readOnly: false
- destructive: false
- idempotent: false
- title: Create skill file
- description: >
- Add a new bundled file to an agent skill. Fails with 409 if a file at the given path already exists — use
- llma-skill-update with files to replace, or llma-skill-file-delete followed by llma-skill-file-create to
- overwrite. Publishes a new skill version and returns the updated skill (read its 'version' field to chain
- further edits via base_version). Supply base_version for optimistic concurrency.
- llma-skill-file-delete:
- operation: llm_skills_name_files_destroy
- enabled: true
- scopes:
- - llm_skill:write
- annotations:
- readOnly: false
- destructive: true
- idempotent: false
- title: Delete skill file
- description: >
- Remove a bundled file from an agent skill by path. Fails with 404 if the file is not in the latest version.
- Publishes a new skill version and returns 200 with the updated skill body (not 204) — read its 'version'
- field to chain further edits via base_version. Supply base_version for optimistic concurrency.
- llma-skill-file-get:
- operation: llm_skills_name_files_retrieve
- enabled: true
- scopes:
- - llm_skill:read
- annotations:
- readOnly: true
- destructive: false
- idempotent: true
- title: Get skill file
- description: >
- Fetch a single bundled file from an agent skill by its path. Use the file manifest from llma-skill-get to
- discover available files. Supports progressive disclosure — only load files when needed rather than fetching
- all content upfront.
- llma-skill-file-rename:
- operation: llm_skills_name_files_rename_create
- enabled: true
- scopes:
- - llm_skill:write
- annotations:
- readOnly: false
- destructive: false
- idempotent: false
- title: Rename skill file
- description: >
- Rename a bundled file within an agent skill. Fails with 404 if old_path is not in the latest version, and
- with 409 if new_path already exists. Use this to move a file without rewriting its content. Publishes a new
- skill version and returns the updated skill (read its 'version' field to chain further edits via
- base_version). Supply base_version for optimistic concurrency.
- llma-skill-get:
- operation: llm_skills_name_retrieve
- enabled: true
- scopes:
- - llm_skill:read
- annotations:
- readOnly: true
- destructive: false
- idempotent: true
- title: Get skill
- description: >
- Get a specific agent skill by name, including its full body content, metadata, and file manifest. Follows
- the Agent Skills specification (agentskills.io). To link a user to this skill in the PostHog app, build the
- URL from the skill `name`, not its `id`: `/llm-analytics/skills/<name>` (e.g.
- `/llm-analytics/skills/pr-shepherd`). The `id` (UUID) is not a valid route segment and will 404.
- llma-skill-list:
- operation: llm_skills_list
- enabled: true
- scopes:
- - llm_skill:read
- annotations:
- readOnly: true
- destructive: false
- idempotent: true
- title: List skills
- description: >
- List all agent skills stored for the current team. Returns skill names and descriptions for discovery — use
- descriptions to determine which skill to fetch for a given task. Does not return skill body content (use
- llma-skill-get to fetch full content). To link a user to a skill in the PostHog app, build the URL from the
- skill `name`, not its `id`: `/llm-analytics/skills/<name>` (e.g. `/llm-analytics/skills/pr-shepherd`). The
- `id` (UUID) is not a valid route segment and will 404.
- llma-skill-resolve:
- operation: llm_skills_resolve_name_retrieve
- enabled: false
- llma-skill-update:
- operation: llm_skills_name_partial_update
- enabled: true
- scopes:
- - llm_skill:write
- annotations:
- readOnly: false
- destructive: false
- idempotent: true
- title: Update skill
- description: |
- Publish a new version of an existing agent skill by name. Any field not provided
- is carried forward from the current latest version. Requires base_version for
- optimistic concurrency.
-
- For the body, you can either provide the full content via 'body', or use 'edits'
- for incremental find/replace updates. Each edit must have 'old' (text to find,
- must match exactly once) and 'new' (replacement text). Edits are applied
- sequentially. Only one of 'body' or 'edits' may be provided.
-
- For file changes, prefer the per-file tools rather than passing a 'files' list:
- llma-skill-file-create / llma-skill-file-delete / llma-skill-file-rename handle
- add/remove/rename one file at a time and return the updated skill (including the
- bumped version) so callers can chain further edits via base_version.
-
- For per-file content updates, use 'file_edits' to apply find/replace updates to
- individual files without resending the full file set — each entry targets one
- existing file by path. Non-targeted files carry forward unchanged. 'file_edits'
- cannot add, remove, or rename files; use the per-file tools or 'files' (replace-all)
- for that. 'files' and 'file_edits' are mutually exclusive.
-
- Passing a 'files' list here replaces ALL files and risks data loss if any file is
- omitted — use it only when you intentionally want to replace the entire bundle.
- include_params:
- - body
- - edits
- - description
- - license
- - compatibility
- - allowed_tools
- - metadata
- - files
- - file_edits
- - base_version
llma-summarization-batch-check-create:
operation: llm_analytics_summarization_batch_check_create
enabled: false
diff --git a/products/signals/backend/scout_harness/config_registry.py b/products/signals/backend/scout_harness/config_registry.py
index 264daa2e504a..587d984dad0d 100644
--- a/products/signals/backend/scout_harness/config_registry.py
+++ b/products/signals/backend/scout_harness/config_registry.py
@@ -11,10 +11,10 @@ from __future__ import annotations
import structlog
-from products.ai_observability.backend.models.skills import LLMSkill
from products.signals.backend.models import SignalScoutConfig
from products.signals.backend.scout_harness.limits import MAX_ENABLED_SCOUTS_PER_TEAM
from products.signals.backend.scout_harness.skill_loader import SIGNALS_SCOUT_SKILL_PREFIX
+from products.skills.backend.models.skills import LLMSkill
logger = structlog.get_logger(__name__)
diff --git a/products/signals/backend/scout_harness/lazy_seed.py b/products/signals/backend/scout_harness/lazy_seed.py
index 65b6a0c535b4..00b764d26768 100644
--- a/products/signals/backend/scout_harness/lazy_seed.py
+++ b/products/signals/backend/scout_harness/lazy_seed.py
@@ -13,8 +13,8 @@ import yaml
from posthog.models.team.team import Team
-from products.ai_observability.backend.models.skills import LLMSkill, LLMSkillFile
from products.signals.backend.scout_harness.skill_loader import SIGNALS_SCOUT_SKILL_PREFIX
+from products.skills.backend.models.skills import LLMSkill, LLMSkillFile
logger = logging.getLogger(__name__)
@@ -34,7 +34,7 @@ _FRONTMATTER_RE = re.compile(r"^---\s*\n(.*?)\n---\s*\n", re.DOTALL)
# support binary attachments, add to both consumers in the same change.
_ALLOWED_BUNDLE_SUBDIRS = ("references", "scripts")
# Mirror the per-skill contract limits enforced by the REST API at
-# `products/ai_observability/backend/api/skill_services.py` (`MAX_SKILL_*`). The seed
+# `products/skills/backend/api/skill_services.py` (`MAX_SKILL_*`). The seed
# bypasses the service layer (no "create from scratch with files" helper exists), so
# these are inlined and checked at parse time. Inlined rather than imported because
# `skill_services.py` pulls in Django app surface that triggers a circular import
diff --git a/products/signals/backend/scout_harness/skill_loader.py b/products/signals/backend/scout_harness/skill_loader.py
index a8d3a7612780..77abe61f9a82 100644
--- a/products/signals/backend/scout_harness/skill_loader.py
+++ b/products/signals/backend/scout_harness/skill_loader.py
@@ -4,7 +4,7 @@ from dataclasses import dataclass
from posthog.models.team.team import Team
-from products.ai_observability.backend.models.skills import LLMSkill, LLMSkillFile
+from products.skills.backend.models.skills import LLMSkill, LLMSkillFile
# Naming contract for skills that steer a Signals-agent run.
SIGNALS_SCOUT_SKILL_PREFIX = "signals-scout-"
@@ -46,10 +46,10 @@ def load_skill_for_run(team: Team, skill_name: str, *, version: int | None = Non
Pass `version=None` to follow-latest. The `signals-scout-*` prefix is not enforced
here — the management command can hand-trigger any skill on the team.
"""
- # Lazy import: `products.ai_observability.backend.api` triggers a temporal module load
+ # Lazy import: `products.skills.backend.api` triggers a temporal module load
# that this package is itself imported from at temporal-worker boot, so a top-level
# import here cycles. Models only is fine.
- from products.ai_observability.backend.api.skill_services import get_skill_by_name_from_db
+ from products.skills.backend.api.skill_services import get_skill_by_name_from_db
skill = get_skill_by_name_from_db(team, skill_name, version=version)
if skill is None:
diff --git a/products/signals/backend/scout_harness/views.py b/products/signals/backend/scout_harness/views.py
index 15af9fa189c0..ba147a28e2f6 100644
--- a/products/signals/backend/scout_harness/views.py
+++ b/products/signals/backend/scout_harness/views.py
@@ -40,7 +40,6 @@ from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.auth import OAuthAccessTokenAuthentication, PersonalAPIKeyAuthentication, SessionAuthentication
from posthog.permissions import APIScopePermission
-from products.ai_observability.backend.models.skills import LLMSkill
from products.signals.backend.models import SignalProjectProfile, SignalScoutConfig, SignalScoutEmission, SignalScoutRun
from products.signals.backend.scout_harness.config_registry import enabled_scout_count
from products.signals.backend.scout_harness.limits import MAX_ENABLED_SCOUTS_PER_TEAM
@@ -71,6 +70,7 @@ from products.signals.backend.scout_harness.tools.scratchpad import (
remember,
search_scratchpad,
)
+from products.skills.backend.models.skills import LLMSkill
# Hard cap on the per-run emissions response. Far above any realistic run (a scout emits a
# handful of findings), so it never truncates in practice — it just bounds a pathological
diff --git a/products/signals/backend/test/test_management_sync_signals_scout_skills.py b/products/signals/backend/test/test_management_sync_signals_scout_skills.py
index 09c1b3f29189..14caeab9c352 100644
--- a/products/signals/backend/test/test_management_sync_signals_scout_skills.py
+++ b/products/signals/backend/test/test_management_sync_signals_scout_skills.py
@@ -16,9 +16,9 @@ from unittest.mock import patch
from django.core.management import call_command
from django.core.management.base import CommandError
-from products.ai_observability.backend.models.skills import LLMSkill
from products.signals.backend.models import SignalScoutConfig
from products.signals.backend.scout_harness.lazy_seed import CanonicalSkill
+from products.skills.backend.models.skills import LLMSkill
def _fake_canonical(name: str, body: str = "# canonical body\n") -> CanonicalSkill:
diff --git a/products/signals/backend/test/test_scout_coordinator.py b/products/signals/backend/test/test_scout_coordinator.py
index 47a1ebd318e7..6e38ac793a9e 100644
--- a/products/signals/backend/test/test_scout_coordinator.py
+++ b/products/signals/backend/test/test_scout_coordinator.py
@@ -19,7 +19,6 @@ from posthog.models import Organization, Team
from posthog.models.scoping import team_scope
from posthog.sync import database_sync_to_async
-from products.ai_observability.backend.models.skills import LLMSkill
from products.signals.backend.models import SignalScoutConfig
from products.signals.backend.scout_harness.lazy_seed import sync_canonical_skills
from products.signals.backend.temporal.agentic.scout_coordinator import (
@@ -35,6 +34,7 @@ from products.signals.backend.temporal.agentic.scout_coordinator import (
fetch_enabled_signals_scout_runs_activity,
stamp_dispatched_signals_scout_runs_activity,
)
+from products.skills.backend.models.skills import LLMSkill
_PAYLOAD_PATH = "products.signals.backend.temporal.agentic.scout_coordinator.posthoganalytics.get_feature_flag_payload"
_IS_CLOUD_PATH = "products.signals.backend.temporal.agentic.scout_coordinator.is_cloud"
diff --git a/products/signals/backend/test/test_scout_harness.py b/products/signals/backend/test/test_scout_harness.py
index 80b8f28727c0..2b03b841916c 100644
--- a/products/signals/backend/test/test_scout_harness.py
+++ b/products/signals/backend/test/test_scout_harness.py
@@ -16,7 +16,6 @@ from posthog.models import Organization, Team
from posthog.models.scoping import team_scope
from posthog.sync import database_sync_to_async
-from products.ai_observability.backend.models.skills import LLMSkill, LLMSkillFile
from products.signals.backend.models import SignalScoutConfig, SignalScoutRun
from products.signals.backend.scout_harness.prompt import build_run_prompt
from products.signals.backend.scout_harness.runner import RunResult, arun_signals_scout
@@ -27,6 +26,7 @@ from products.signals.backend.scout_harness.skill_loader import (
)
from products.signals.backend.scout_harness.tools.runs import _build_task_url, _to_detail, _to_summary
from products.signals.backend.temporal.agentic.scout_scheduler import RunSignalsScoutInput, run_signals_scout_activity
+from products.skills.backend.models.skills import LLMSkill, LLMSkillFile
from products.tasks.backend.models import Task, TaskRun
diff --git a/products/signals/backend/test/test_scout_harness_api.py b/products/signals/backend/test/test_scout_harness_api.py
index b0a973e9fec4..277ab76b0b0e 100644
--- a/products/signals/backend/test/test_scout_harness_api.py
+++ b/products/signals/backend/test/test_scout_harness_api.py
@@ -15,7 +15,6 @@ from posthog.temporal.oauth import (
create_oauth_access_token_for_user,
)
-from products.ai_observability.backend.models.skills import LLMSkill
from products.signals.backend.models import (
SignalProjectProfile,
SignalScoutConfig,
@@ -24,6 +23,7 @@ from products.signals.backend.models import (
SignalScratchpad,
)
from products.signals.backend.scout_harness.tools.profile import compute_project_profile
+from products.skills.backend.models.skills import LLMSkill
from products.tasks.backend.models import Task, TaskRun
diff --git a/products/signals/backend/test/test_scout_harness_lazy_seed.py b/products/signals/backend/test/test_scout_harness_lazy_seed.py
index 6eee8ac1e4ef..6976341eae79 100644
--- a/products/signals/backend/test/test_scout_harness_lazy_seed.py
+++ b/products/signals/backend/test/test_scout_harness_lazy_seed.py
@@ -7,7 +7,6 @@ import pytest
from posthog.test.base import BaseTest
from unittest.mock import patch
-from products.ai_observability.backend.models.skills import LLMSkill, LLMSkillFile
from products.signals.backend.scout_harness.lazy_seed import (
CanonicalSkill,
CanonicalSkillFile,
@@ -20,6 +19,7 @@ from products.signals.backend.scout_harness.lazy_seed import (
sync_canonical_skills,
)
from products.signals.backend.scout_harness.skill_loader import load_skill_for_run
+from products.skills.backend.models.skills import LLMSkill, LLMSkillFile
def _write_canonical_skill(
diff --git a/products/skills/__init__.py b/products/skills/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/skills/backend/__init__.py b/products/skills/backend/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/skills/backend/api/__init__.py b/products/skills/backend/api/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/ai_observability/backend/api/skill_serializers.py b/products/skills/backend/api/skill_serializers.py
similarity index 99%
rename from products/ai_observability/backend/api/skill_serializers.py
rename to products/skills/backend/api/skill_serializers.py
index c58dddfec71b..808435ff204e 100644
--- a/products/ai_observability/backend/api/skill_serializers.py
+++ b/products/skills/backend/api/skill_serializers.py
@@ -8,7 +8,8 @@ from rest_framework import serializers
from posthog.api.shared import UserBasicSerializer
-from ..markdown_outline import get_markdown_outline
+from products.ai_observability.backend.markdown_outline import get_markdown_outline
+
from ..models.skills import LLMSkill, LLMSkillFile
RESERVED_SKILL_NAMES = {"new"}
diff --git a/products/ai_observability/backend/api/skill_services.py b/products/skills/backend/api/skill_services.py
similarity index 100%
rename from products/ai_observability/backend/api/skill_services.py
rename to products/skills/backend/api/skill_services.py
diff --git a/products/ai_observability/backend/api/skills.py b/products/skills/backend/api/skills.py
similarity index 99%
rename from products/ai_observability/backend/api/skills.py
rename to products/skills/backend/api/skills.py
index 96feb8b4b056..49f6598fe11f 100644
--- a/products/ai_observability/backend/api/skills.py
+++ b/products/skills/backend/api/skills.py
@@ -28,8 +28,9 @@ from posthog.permissions import AccessControlPermission, get_organization_from_v
from posthog.rate_limit import BurstRateThrottle, SustainedRateThrottle
from posthog.rbac.access_control_api_mixin import AccessControlViewSetMixin
+from products.ai_observability.backend.api.metrics import llma_track_latency
+
from ..models.skills import LLMSkill, LLMSkillFile
-from .metrics import llma_track_latency
from .skill_serializers import (
LLMSkillCreateSerializer,
LLMSkillDuplicateSerializer,
diff --git a/products/skills/backend/api/test/__init__.py b/products/skills/backend/api/test/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/ai_observability/backend/api/test/test_skills.py b/products/skills/backend/api/test/test_skills.py
similarity index 99%
rename from products/ai_observability/backend/api/test/test_skills.py
rename to products/skills/backend/api/test/test_skills.py
index d679c4e804e9..45ed7c25d172 100644
--- a/products/ai_observability/backend/api/test/test_skills.py
+++ b/products/skills/backend/api/test/test_skills.py
@@ -1,3 +1,5 @@
+import uuid
+
from posthog.test.base import APIBaseTest
from unittest.mock import patch
@@ -6,10 +8,11 @@ from rest_framework import status
from posthog.models import User
+from ...api.skill_services import MAX_SKILL_FILE_COUNT
from ...models.skills import LLMSkill, LLMSkillFile
-@patch("products.ai_observability.backend.api.skills.posthoganalytics.feature_enabled", return_value=True)
+@patch("products.skills.backend.api.skills.posthoganalytics.feature_enabled", return_value=True)
class TestLLMSkillAPI(APIBaseTest):
def _url(self, path: str = "") -> str:
return f"/api/environments/{self.team.id}/llm_skills/{path}"
@@ -339,8 +342,6 @@ class TestLLMSkillAPI(APIBaseTest):
assert query_suffix.lstrip("?") in response["Location"]
def test_get_skill_by_uuid_not_found_returns_404(self, mock_feature_enabled):
- import uuid
-
nonexistent_id = str(uuid.uuid4())
response = self.client.get(self._url(f"name/{nonexistent_id}"))
@@ -868,8 +869,6 @@ class TestLLMSkillAPI(APIBaseTest):
assert response.status_code == status.HTTP_400_BAD_REQUEST
def test_create_file_enforces_max_file_count(self, mock_feature_enabled):
- from ..skill_services import MAX_SKILL_FILE_COUNT
-
skill = self.create_skill(name="crud-max")
LLMSkillFile.objects.bulk_create(
[LLMSkillFile(skill=skill, path=f"f{i}.md", content="x") for i in range(MAX_SKILL_FILE_COUNT)]
diff --git a/products/skills/backend/apps.py b/products/skills/backend/apps.py
new file mode 100644
index 000000000000..71071cf59846
--- /dev/null
+++ b/products/skills/backend/apps.py
@@ -0,0 +1,7 @@
+from django.apps import AppConfig
+
+
+class SkillsConfig(AppConfig):
+ default_auto_field = "django.db.models.BigAutoField"
+ name = "products.skills.backend"
+ label = "skills"
diff --git a/products/skills/backend/migrations/0001_adopt_skills_models.py b/products/skills/backend/migrations/0001_adopt_skills_models.py
new file mode 100644
index 000000000000..7d9deb27cfba
--- /dev/null
+++ b/products/skills/backend/migrations/0001_adopt_skills_models.py
@@ -0,0 +1,169 @@
+# Generated by Django 5.2.14, then manually wrapped in SeparateDatabaseAndState.
+#
+# This is the skills half of moving LLMSkill / LLMSkillFile out of
+# ai_observability into the standalone skills product. The matching release
+# happens in products/ai_observability/backend/migrations/
+# 0005_release_skills_to_skills_app.py. Both halves are state-only: every model
+# keeps db_table="llm_analytics_..." so the underlying tables never move.
+#
+# The RunPython step at the bottom moves ContentType rows from
+# app_label='ai_observability' to 'skills' so permissions, audit logs and
+# anything else keyed off ContentType keep working.
+
+import django.utils.timezone
+import django.db.models.deletion
+from django.conf import settings
+from django.db import migrations, models
+
+import posthog.models.utils
+
+MODELS_TO_MOVE = (
+ "llmskill",
+ "llmskillfile",
+)
+
+
+def _move_content_types(apps, schema_editor, from_label, to_label):
+ """Move ContentTypes between apps idempotently.
+
+ If a target row already exists (e.g. Django auto-created it before this
+ migration ran, or a prior failed attempt left a partial state behind),
+ merge the source's permissions onto the target and delete the source —
+ that avoids the (app_label, model) unique constraint blowing up.
+ """
+ db_alias = schema_editor.connection.alias
+ ContentType = apps.get_model("contenttypes", "ContentType")
+ Permission = apps.get_model("auth", "Permission")
+
+ for model_name in MODELS_TO_MOVE:
+ source = ContentType.objects.using(db_alias).filter(app_label=from_label, model=model_name).first()
+ target = ContentType.objects.using(db_alias).filter(app_label=to_label, model=model_name).first()
+ if source and target:
+ Permission.objects.using(db_alias).filter(content_type=source).update(content_type=target)
+ source.delete(using=db_alias)
+ elif source:
+ source.app_label = to_label
+ source.save(using=db_alias)
+
+
+def forward_content_types(apps, schema_editor):
+ _move_content_types(apps, schema_editor, "ai_observability", "skills")
+
+
+def reverse_content_types(apps, schema_editor):
+ _move_content_types(apps, schema_editor, "skills", "ai_observability")
+
+
+class Migration(migrations.Migration):
+ initial = True
+
+ dependencies = [
+ ("ai_observability", "0005_release_skills_to_skills_app"),
+ ("posthog", "1218_team_ingested_production_event_last_checked_at"),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ]
+
+ operations = [
+ migrations.SeparateDatabaseAndState(
+ state_operations=[
+ migrations.CreateModel(
+ name="LLMSkill",
+ fields=[
+ (
+ "id",
+ models.UUIDField(
+ default=posthog.models.utils.uuid7,
+ editable=False,
+ primary_key=True,
+ serialize=False,
+ ),
+ ),
+ ("name", models.CharField(max_length=64)),
+ ("description", models.CharField(max_length=4096)),
+ ("body", models.TextField()),
+ ("license", models.CharField(blank=True, default="", max_length=255)),
+ (
+ "compatibility",
+ models.CharField(blank=True, default="", max_length=500),
+ ),
+ ("allowed_tools", models.JSONField(blank=True, default=list)),
+ ("metadata", models.JSONField(blank=True, default=dict)),
+ ("version", models.PositiveIntegerField(default=1)),
+ ("is_latest", models.BooleanField(default=True)),
+ ("created_at", models.DateTimeField(default=django.utils.timezone.now)),
+ ("updated_at", models.DateTimeField(auto_now=True)),
+ ("deleted", models.BooleanField(default=False)),
+ (
+ "created_by",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.SET_NULL,
+ to=settings.AUTH_USER_MODEL,
+ ),
+ ),
+ (
+ "team",
+ models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="posthog.team"),
+ ),
+ ],
+ options={
+ "db_table": "llm_analytics_llmskill",
+ },
+ ),
+ migrations.CreateModel(
+ name="LLMSkillFile",
+ fields=[
+ (
+ "id",
+ models.UUIDField(
+ default=posthog.models.utils.uuid7,
+ editable=False,
+ primary_key=True,
+ serialize=False,
+ ),
+ ),
+ ("path", models.CharField(max_length=500)),
+ ("content", models.TextField()),
+ (
+ "content_type",
+ models.CharField(default="text/plain", max_length=100),
+ ),
+ (
+ "skill",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="files",
+ to="skills.llmskill",
+ ),
+ ),
+ ],
+ options={
+ "db_table": "llm_analytics_llmskillfile",
+ },
+ ),
+ migrations.AddConstraint(
+ model_name="llmskill",
+ constraint=models.UniqueConstraint(
+ condition=models.Q(("deleted", False)),
+ fields=("team", "name", "version"),
+ name="unique_llm_skill_version_per_team",
+ ),
+ ),
+ migrations.AddConstraint(
+ model_name="llmskill",
+ constraint=models.UniqueConstraint(
+ condition=models.Q(("deleted", False), ("is_latest", True)),
+ fields=("team", "name"),
+ name="unique_llm_skill_latest_per_team",
+ ),
+ ),
+ migrations.AddConstraint(
+ model_name="llmskillfile",
+ constraint=models.UniqueConstraint(fields=("skill", "path"), name="unique_skill_file_path"),
+ ),
+ ],
+ database_operations=[],
+ ),
+ migrations.RunPython(forward_content_types, reverse_content_types),
+ ]
diff --git a/products/skills/backend/migrations/__init__.py b/products/skills/backend/migrations/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/skills/backend/migrations/max_migration.txt b/products/skills/backend/migrations/max_migration.txt
new file mode 100644
index 000000000000..59e8afb62a8e
--- /dev/null
+++ b/products/skills/backend/migrations/max_migration.txt
@@ -0,0 +1 @@
+0001_adopt_skills_models
diff --git a/products/skills/backend/models/__init__.py b/products/skills/backend/models/__init__.py
new file mode 100644
index 000000000000..9f04a59cfe0f
--- /dev/null
+++ b/products/skills/backend/models/__init__.py
@@ -0,0 +1,3 @@
+from .skills import LLMSkill, LLMSkillFile
+
+__all__ = ["LLMSkill", "LLMSkillFile"]
diff --git a/products/ai_observability/backend/models/skills.py b/products/skills/backend/models/skills.py
similarity index 100%
rename from products/ai_observability/backend/models/skills.py
rename to products/skills/backend/models/skills.py
diff --git a/products/skills/backend/routes.py b/products/skills/backend/routes.py
new file mode 100644
index 000000000000..51f692b74413
--- /dev/null
+++ b/products/skills/backend/routes.py
@@ -0,0 +1,7 @@
+from posthog.api.routing import RouterRegistry
+
+from products.skills.backend.api.skills import LLMSkillViewSet
+
+
+def register_routes(routers: RouterRegistry) -> None:
+ routers.register_legacy_dual_route(r"llm_skills", LLMSkillViewSet, "project_llm_skills", ["team_id"])
diff --git a/products/skills/backend/tools/__init__.py b/products/skills/backend/tools/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/products/ai_observability/backend/tools/skills.py b/products/skills/backend/tools/skills.py
similarity index 99%
rename from products/ai_observability/backend/tools/skills.py
rename to products/skills/backend/tools/skills.py
index f187dfd55b8b..fcafb70a7a8a 100644
--- a/products/ai_observability/backend/tools/skills.py
+++ b/products/skills/backend/tools/skills.py
@@ -1,6 +1,8 @@
import posixpath
from typing import Any
+from django.db.models import Q
+
from pydantic import BaseModel, Field
from posthog.schema import AssistantTool
@@ -9,7 +11,7 @@ from posthog.rbac.user_access_control import AccessControlLevel
from posthog.scopes import APIScopeObject
from posthog.sync import database_sync_to_async
-from products.ai_observability.backend.api.skill_services import (
+from products.skills.backend.api.skill_services import (
LLMSkillDuplicateNameConflictError,
LLMSkillEditError,
LLMSkillFileLimitError,
@@ -23,7 +25,7 @@ from products.ai_observability.backend.api.skill_services import (
get_skill_by_name_from_db,
publish_skill_version,
)
-from products.ai_observability.backend.models.skills import LLMSkill, LLMSkillFile
+from products.skills.backend.models.skills import LLMSkill, LLMSkillFile
from ee.hogai.tool import MaxTool
from ee.hogai.tool_errors import MaxToolFatalError
@@ -286,8 +288,6 @@ class ListLLMSkillsTool(MaxTool):
def _list_skills(self, search: str | None) -> list[LLMSkill]:
queryset = get_latest_skills_queryset(self._team)
if search:
- from django.db.models import Q
-
queryset = queryset.filter(Q(name__icontains=search) | Q(description__icontains=search))
# Fetch one extra row so we can distinguish "exactly at the cap" from "truncated".
return list(queryset.order_by("name")[: MAX_LIST_RESULTS + 1])
diff --git a/products/ai_observability/backend/tools/test_skills.py b/products/skills/backend/tools/test_skills.py
similarity index 98%
rename from products/ai_observability/backend/tools/test_skills.py
rename to products/skills/backend/tools/test_skills.py
index 369adb9223d1..03df7a26aaf2 100644
--- a/products/ai_observability/backend/tools/test_skills.py
+++ b/products/skills/backend/tools/test_skills.py
@@ -4,8 +4,8 @@ from asgiref.sync import async_to_sync
from posthog.models import Team
-from products.ai_observability.backend.models.skills import LLMSkill, LLMSkillFile
-from products.ai_observability.backend.tools.skills import (
+from products.skills.backend.models.skills import LLMSkill, LLMSkillFile
+from products.skills.backend.tools.skills import (
ArchiveLLMSkillTool,
CreateLLMSkillTool,
GetLLMSkillFileTool,
diff --git a/products/skills/frontend/LLMSkillScene.stories.tsx b/products/skills/frontend/LLMSkillScene.stories.tsx
index 90c5f463cf06..10130f07479e 100644
--- a/products/skills/frontend/LLMSkillScene.stories.tsx
+++ b/products/skills/frontend/LLMSkillScene.stories.tsx
@@ -12,7 +12,7 @@ import type {
LLMSkillResolveResponseApi,
LLMSkillVersionSummaryApi,
UserBasicApi,
-} from 'products/ai_observability/frontend/generated/api.schemas'
+} from 'products/skills/frontend/generated/api.schemas'
const MOCK_AUTHOR: UserBasicApi = {
id: 178,
diff --git a/products/skills/frontend/LLMSkillScene.tsx b/products/skills/frontend/LLMSkillScene.tsx
index 7520dd75f65c..fce59e0163f2 100644
--- a/products/skills/frontend/LLMSkillScene.tsx
+++ b/products/skills/frontend/LLMSkillScene.tsx
@@ -26,10 +26,7 @@ import { ProductKey } from '~/queries/schema/schema-general'
import { AccessControlLevel, AccessControlResourceType } from '~/types'
import { MarkdownOutline } from 'products/ai_observability/frontend/components/MarkdownOutline'
-import type {
- LLMSkillFileManifestApi,
- LLMSkillVersionSummaryApi,
-} from 'products/ai_observability/frontend/generated/api.schemas'
+import type { LLMSkillFileManifestApi, LLMSkillVersionSummaryApi } from 'products/skills/frontend/generated/api.schemas'
import type { SkillFormFileValues } from './llmSkillLogic'
import { SkillLogicProps, SkillMode, isSkill, llmSkillLogic } from './llmSkillLogic'
diff --git a/products/skills/frontend/LLMSkillsScene.tsx b/products/skills/frontend/LLMSkillsScene.tsx
index 273b6532dc84..8c803327bd7e 100644
--- a/products/skills/frontend/LLMSkillsScene.tsx
+++ b/products/skills/frontend/LLMSkillsScene.tsx
@@ -25,7 +25,7 @@ import { atColumn } from '~/lib/lemon-ui/LemonTable/columnUtils'
import { ProductKey } from '~/queries/schema/schema-general'
import { AccessControlLevel, AccessControlResourceType } from '~/types'
-import type { LLMSkillListApi } from 'products/ai_observability/frontend/generated/api.schemas'
+import type { LLMSkillListApi } from 'products/skills/frontend/generated/api.schemas'
import { SKILLS_GROUP_LIMIT, SKILLS_PER_PAGE, SkillGroupNode, SkillGroupTree, llmSkillsLogic } from './llmSkillsLogic'
import { SKILL_NAME_MAX_LENGTH, validateSkillName } from './skillConstants'
diff --git a/products/skills/frontend/generated/api.schemas.ts b/products/skills/frontend/generated/api.schemas.ts
new file mode 100644
index 000000000000..ef497d14bf5a
--- /dev/null
+++ b/products/skills/frontend/generated/api.schemas.ts
@@ -0,0 +1,447 @@
+/**
+ * Auto-generated from the Django backend OpenAPI schema.
+ * To modify these types, update the Django serializers or views, then run:
+ * hogli build:openapi
+ * Questions or issues? #team-devex on Slack
+ *
+ * PostHog API - generated
+ * OpenAPI spec version: 1.0.0
+ */
+export interface LLMSkillOutlineEntryApi {
+ /**
+ * Markdown heading level (1-6).
+ * @minimum 1
+ * @maximum 6
+ */
+ level: number
+ /** Heading text. */
+ text: string
+}
+
+/**
+ * * `engineering` - Engineering
+ * * `data` - Data
+ * * `product` - Product Management
+ * * `founder` - Founder
+ * * `leadership` - Leadership
+ * * `marketing` - Marketing
+ * * `sales` - Sales / Success
+ * * `other` - Other
+ */
+export type RoleAtOrganizationEnumApi = (typeof RoleAtOrganizationEnumApi)[keyof typeof RoleAtOrganizationEnumApi]
+
+export const RoleAtOrganizationEnumApi = {
+ Engineering: 'engineering',
+ Data: 'data',
+ Product: 'product',
+ Founder: 'founder',
+ Leadership: 'leadership',
+ Marketing: 'marketing',
+ Sales: 'sales',
+ Other: 'other',
+} as const
+
+export type BlankEnumApi = (typeof BlankEnumApi)[keyof typeof BlankEnumApi]
+
+export const BlankEnumApi = {
+ '': '',
+} as const
+
+/**
+ * @nullable
+ */
+export type UserBasicApiHedgehogConfig = { [key: string]: unknown } | null
+
+export interface UserBasicApi {
+ readonly id: number
+ readonly uuid: string
+ /**
+ * @maxLength 200
+ * @nullable
+ */
+ distinct_id?: string | null
+ /** @maxLength 150 */
+ first_name?: string
+ /** @maxLength 150 */
+ last_name?: string
+ /** @maxLength 254 */
+ email: string
+ /** @nullable */
+ is_email_verified?: boolean | null
+ /** @nullable */
+ readonly hedgehog_config: UserBasicApiHedgehogConfig
+ role_at_organization?: RoleAtOrganizationEnumApi | BlankEnumApi | null
+}
+
+/**
+ * Arbitrary key-value metadata.
+ */
+export type LLMSkillListApiMetadata = { [key: string]: unknown }
+
+/**
+ * List serializer that omits body and file manifest — progressive disclosure (Level 1).
+ */
+export interface LLMSkillListApi {
+ readonly id: string
+ /**
+ * Unique skill name. Lowercase letters, numbers, and hyphens only. Max 64 characters.
+ * @maxLength 64
+ */
+ name: string
+ /**
+ * What this skill does and when to use it. Max 4096 characters.
+ * @maxLength 4096
+ */
+ description: string
+ /**
+ * License name or reference to a bundled license file.
+ * @maxLength 255
+ */
+ license?: string
+ /**
+ * Environment requirements (intended product, system packages, network access, etc.).
+ * @maxLength 500
+ */
+ compatibility?: string
+ /** List of pre-approved tools the skill may use. */
+ allowed_tools?: string[]
+ /** Arbitrary key-value metadata. */
+ metadata?: LLMSkillListApiMetadata
+ /** Flat list of markdown headings parsed from the skill body. Useful as a lightweight table of contents. */
+ readonly outline: readonly LLMSkillOutlineEntryApi[]
+ readonly version: number
+ readonly created_by: UserBasicApi
+ readonly created_at: string
+ readonly updated_at: string
+ readonly deleted: boolean
+ readonly is_latest: boolean
+ readonly latest_version: number
+ readonly version_count: number
+ readonly first_version_created_at: string
+}
+
+export interface PaginatedLLMSkillListListApi {
+ count: number
+ /** @nullable */
+ next?: string | null
+ /** @nullable */
+ previous?: string | null
+ results: LLMSkillListApi[]
+}
+
+/**
+ * Arbitrary key-value metadata.
+ */
+export type LLMSkillCreateApiMetadata = { [key: string]: unknown }
+
+export interface LLMSkillFileInputApi {
+ /**
+ * File path relative to skill root, e.g. 'scripts/setup.sh' or 'references/guide.md'.
+ * @maxLength 500
+ */
+ path: string
+ /** Text content of the file. */
+ content: string
+ /**
+ * MIME type of the file content.
+ * @maxLength 100
+ */
+ content_type?: string
+}
+
+/**
+ * Create serializer — accepts bundled files as write-only input on POST.
+ */
+export interface LLMSkillCreateApi {
+ readonly id: string
+ /**
+ * Unique skill name. Lowercase letters, numbers, and hyphens only. Max 64 characters.
+ * @maxLength 64
+ */
+ name: string
+ /**
+ * What this skill does and when to use it. Max 4096 characters.
+ * @maxLength 4096
+ */
+ description: string
+ /** The SKILL.md instruction content (markdown). */
+ body: string
+ /**
+ * License name or reference to a bundled license file.
+ * @maxLength 255
+ */
+ license?: string
+ /**
+ * Environment requirements (intended product, system packages, network access, etc.).
+ * @maxLength 500
+ */
+ compatibility?: string
+ /** List of pre-approved tools the skill may use. */
+ allowed_tools?: string[]
+ /** Arbitrary key-value metadata. */
+ metadata?: LLMSkillCreateApiMetadata
+ /** 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. */
+ readonly outline: readonly LLMSkillOutlineEntryApi[]
+ readonly version: number
+ readonly created_by: UserBasicApi
+ readonly created_at: string
+ readonly updated_at: string
+ readonly deleted: boolean
+ readonly is_latest: boolean
+ readonly latest_version: number
+ readonly version_count: number
+ readonly first_version_created_at: string
+}
+
+/**
+ * Arbitrary key-value metadata.
+ */
+export type LLMSkillApiMetadata = { [key: string]: unknown }
+
+export interface LLMSkillFileManifestApi {
+ /** @maxLength 500 */
+ path: string
+ /** @maxLength 100 */
+ content_type?: string
+}
+
+export interface LLMSkillApi {
+ readonly id: string
+ /**
+ * Unique skill name. Lowercase letters, numbers, and hyphens only. Max 64 characters.
+ * @maxLength 64
+ */
+ name: string
+ /**
+ * What this skill does and when to use it. Max 4096 characters.
+ * @maxLength 4096
+ */
+ description: string
+ /** The SKILL.md instruction content (markdown). */
+ body: string
+ /**
+ * License name or reference to a bundled license file.
+ * @maxLength 255
+ */
+ license?: string
+ /**
+ * Environment requirements (intended product, system packages, network access, etc.).
+ * @maxLength 500
+ */
+ compatibility?: string
+ /** List of pre-approved tools the skill may use. */
+ allowed_tools?: string[]
+ /** Arbitrary key-value metadata. */
+ metadata?: LLMSkillApiMetadata
+ /** 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. */
+ readonly outline: readonly LLMSkillOutlineEntryApi[]
+ readonly version: number
+ readonly created_by: UserBasicApi
+ readonly created_at: string
+ readonly updated_at: string
+ readonly deleted: boolean
+ readonly is_latest: boolean
+ readonly latest_version: number
+ readonly version_count: number
+ readonly first_version_created_at: string
+}
+
+/**
+ * Arbitrary key-value metadata.
+ */
+export type PatchedLLMSkillPublishApiMetadata = { [key: string]: unknown }
+
+export interface LLMSkillEditOperationApi {
+ /** Text to find in the target content. Must match exactly once. */
+ old: string
+ /** Replacement text. */
+ new: string
+}
+
+export interface LLMSkillFileEditApi {
+ /**
+ * Path of the bundled file to edit. Must match an existing file on the current skill version.
+ * @maxLength 500
+ */
+ path: string
+ /** Sequential find/replace operations to apply to this file's content. */
+ edits: LLMSkillEditOperationApi[]
+}
+
+export interface PatchedLLMSkillPublishApi {
+ /** Full skill body (SKILL.md instruction content) to publish as a new version. Mutually exclusive with edits. */
+ body?: string
+ /** List of find/replace operations to apply to the current skill body. Each edit's 'old' text must match exactly once. Edits are applied sequentially. Mutually exclusive with body. */
+ edits?: LLMSkillEditOperationApi[]
+ /**
+ * Updated description for the new version.
+ * @maxLength 4096
+ */
+ description?: string
+ /**
+ * License name or reference.
+ * @maxLength 255
+ */
+ license?: string
+ /**
+ * Environment requirements.
+ * @maxLength 500
+ */
+ compatibility?: string
+ /** List of pre-approved tools the skill may use. */
+ allowed_tools?: string[]
+ /** Arbitrary key-value metadata. */
+ metadata?: PatchedLLMSkillPublishApiMetadata
+ /** Bundled files to include with this version. Replaces all files from the previous version. Mutually exclusive with file_edits. */
+ files?: LLMSkillFileInputApi[]
+ /** Per-file find/replace updates. Each entry targets one existing file by path and applies sequential edits to its content. Non-targeted files carry forward unchanged. Cannot add, remove, or rename files — use 'files' for that. Mutually exclusive with files. */
+ file_edits?: LLMSkillFileEditApi[]
+ /**
+ * Latest version you are editing from. Used for optimistic concurrency checks.
+ * @minimum 1
+ */
+ base_version?: number
+}
+
+export interface LLMSkillDuplicateApi {
+ /**
+ * Name for the duplicated skill. Must be unique.
+ * @maxLength 64
+ */
+ new_name: string
+}
+
+export interface LLMSkillFileCreateApi {
+ /**
+ * File path relative to skill root, e.g. 'scripts/setup.sh' or 'references/guide.md'.
+ * @maxLength 500
+ */
+ path: string
+ /** Text content of the file. */
+ content: string
+ /**
+ * MIME type of the file content.
+ * @maxLength 100
+ */
+ content_type?: string
+ /**
+ * Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.
+ * @minimum 1
+ */
+ base_version?: number
+}
+
+export interface LLMSkillFileRenameApi {
+ /**
+ * Current file path to rename.
+ * @maxLength 500
+ */
+ old_path: string
+ /**
+ * New file path. Must not already exist in the skill.
+ * @maxLength 500
+ */
+ new_path: string
+ /**
+ * Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.
+ * @minimum 1
+ */
+ base_version?: number
+}
+
+export interface LLMSkillFileApi {
+ /** @maxLength 500 */
+ path: string
+ content: string
+ /** @maxLength 100 */
+ content_type?: string
+}
+
+export interface LLMSkillVersionSummaryApi {
+ readonly id: string
+ readonly version: number
+ readonly created_by: UserBasicApi
+ readonly created_at: string
+ readonly is_latest: boolean
+}
+
+export interface LLMSkillResolveResponseApi {
+ skill: LLMSkillApi
+ versions: LLMSkillVersionSummaryApi[]
+ has_more: boolean
+}
+
+export type LlmSkillsListParams = {
+ /**
+ * Filter skills by the ID of the user who created them.
+ */
+ created_by_id?: number
+ /**
+ * Number of results to return per page.
+ */
+ limit?: number
+ /**
+ * The initial index from which to return the results.
+ */
+ offset?: number
+ /**
+ * Optional substring filter applied to skill names and descriptions.
+ */
+ search?: string
+}
+
+export type LlmSkillsNameRetrieveParams = {
+ /**
+ * Specific skill version to fetch. If omitted, the latest version is returned.
+ * @minimum 1
+ */
+ version?: number
+}
+
+export type LlmSkillsNameFilesRetrieveParams = {
+ /**
+ * Specific skill version to fetch. If omitted, the latest version is returned.
+ * @minimum 1
+ */
+ version?: number
+}
+
+export type LlmSkillsNameFilesDestroyParams = {
+ /**
+ * Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.
+ * @minimum 1
+ */
+ base_version?: number
+}
+
+export type LlmSkillsResolveNameRetrieveParams = {
+ /**
+ * Return versions older than this version number. Mutually exclusive with offset.
+ * @minimum 1
+ */
+ before_version?: number
+ /**
+ * Maximum number of versions to return per page (1-100).
+ * @minimum 1
+ * @maximum 100
+ */
+ limit?: number
+ /**
+ * Zero-based offset into version history for pagination. Mutually exclusive with before_version.
+ * @minimum 0
+ */
+ offset?: number
+ /**
+ * Specific skill version to fetch. If omitted, the latest version is returned.
+ * @minimum 1
+ */
+ version?: number
+ /**
+ * Exact skill version UUID to resolve.
+ */
+ version_id?: string
+}
diff --git a/products/skills/frontend/generated/api.ts b/products/skills/frontend/generated/api.ts
new file mode 100644
index 000000000000..a85a3e0b8331
--- /dev/null
+++ b/products/skills/frontend/generated/api.ts
@@ -0,0 +1,306 @@
+import { apiMutator } from '../../../../frontend/src/lib/api-orval-mutator'
+/**
+ * Auto-generated from the Django backend OpenAPI schema.
+ * To modify these types, update the Django serializers or views, then run:
+ * hogli build:openapi
+ * Questions or issues? #team-devex on Slack
+ *
+ * PostHog API - generated
+ * OpenAPI spec version: 1.0.0
+ */
+import type {
+ LLMSkillApi,
+ LLMSkillCreateApi,
+ LLMSkillDuplicateApi,
+ LLMSkillFileApi,
+ LLMSkillFileCreateApi,
+ LLMSkillFileRenameApi,
+ LLMSkillResolveResponseApi,
+ LlmSkillsListParams,
+ LlmSkillsNameFilesDestroyParams,
+ LlmSkillsNameFilesRetrieveParams,
+ LlmSkillsNameRetrieveParams,
+ LlmSkillsResolveNameRetrieveParams,
+ PaginatedLLMSkillListListApi,
+ PatchedLLMSkillPublishApi,
+} from './api.schemas'
+
+// https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir/49579497#49579497
+type IfEquals<X, Y, A = X, B = never> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? A : B
+
+type WritableKeys<T> = {
+ [P in keyof T]-?: IfEquals<{ [Q in P]: T[P] }, { -readonly [Q in P]: T[P] }, P>
+}[keyof T]
+
+type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never
+type DistributeReadOnlyOverUnions<T> = T extends any ? NonReadonly<T> : never
+
+type Writable<T> = Pick<T, WritableKeys<T>>
+type NonReadonly<T> = [T] extends [UnionToIntersection<T>]
+ ? {
+ [P in keyof Writable<T>]: T[P] extends object ? NonReadonly<NonNullable<T[P]>> : T[P]
+ }
+ : DistributeReadOnlyOverUnions<T>
+
+export const getLlmSkillsListUrl = (projectId: string, params?: LlmSkillsListParams) => {
+ const normalizedParams = new URLSearchParams()
+
+ Object.entries(params || {}).forEach(([key, value]) => {
+ if (value !== undefined) {
+ normalizedParams.append(key, value === null ? 'null' : String(value))
+ }
+ })
+
+ const stringifiedParams = normalizedParams.toString()
+
+ return stringifiedParams.length > 0
+ ? `/api/projects/${projectId}/llm_skills/?${stringifiedParams}`
+ : `/api/projects/${projectId}/llm_skills/`
+}
+
+export const llmSkillsList = async (
+ projectId: string,
+ params?: LlmSkillsListParams,
+ options?: RequestInit
+): Promise<PaginatedLLMSkillListListApi> => {
+ return apiMutator<PaginatedLLMSkillListListApi>(getLlmSkillsListUrl(projectId, params), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getLlmSkillsCreateUrl = (projectId: string) => {
+ return `/api/projects/${projectId}/llm_skills/`
+}
+
+export const llmSkillsCreate = async (
+ projectId: string,
+ lLMSkillCreateApi: NonReadonly<LLMSkillCreateApi>,
+ options?: RequestInit
+): Promise<LLMSkillCreateApi> => {
+ return apiMutator<LLMSkillCreateApi>(getLlmSkillsCreateUrl(projectId), {
+ ...options,
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(lLMSkillCreateApi),
+ })
+}
+
+export const getLlmSkillsNameRetrieveUrl = (
+ projectId: string,
+ skillName: string,
+ params?: LlmSkillsNameRetrieveParams
+) => {
+ const normalizedParams = new URLSearchParams()
+
+ Object.entries(params || {}).forEach(([key, value]) => {
+ if (value !== undefined) {
+ normalizedParams.append(key, value === null ? 'null' : String(value))
+ }
+ })
+
+ const stringifiedParams = normalizedParams.toString()
+
+ return stringifiedParams.length > 0
+ ? `/api/projects/${projectId}/llm_skills/name/${skillName}/?${stringifiedParams}`
+ : `/api/projects/${projectId}/llm_skills/name/${skillName}/`
+}
+
+export const llmSkillsNameRetrieve = async (
+ projectId: string,
+ skillName: string,
+ params?: LlmSkillsNameRetrieveParams,
+ options?: RequestInit
+): Promise<LLMSkillApi> => {
+ return apiMutator<LLMSkillApi>(getLlmSkillsNameRetrieveUrl(projectId, skillName, params), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getLlmSkillsNamePartialUpdateUrl = (projectId: string, skillName: string) => {
+ return `/api/projects/${projectId}/llm_skills/name/${skillName}/`
+}
+
+export const llmSkillsNamePartialUpdate = async (
+ projectId: string,
+ skillName: string,
+ patchedLLMSkillPublishApi?: PatchedLLMSkillPublishApi,
+ options?: RequestInit
+): Promise<LLMSkillApi> => {
+ return apiMutator<LLMSkillApi>(getLlmSkillsNamePartialUpdateUrl(projectId, skillName), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(patchedLLMSkillPublishApi),
+ })
+}
+
+export const getLlmSkillsNameArchiveCreateUrl = (projectId: string, skillName: string) => {
+ return `/api/projects/${projectId}/llm_skills/name/${skillName}/archive/`
+}
+
+export const llmSkillsNameArchiveCreate = async (
+ projectId: string,
+ skillName: string,
+ options?: RequestInit
+): Promise<void> => {
+ return apiMutator<void>(getLlmSkillsNameArchiveCreateUrl(projectId, skillName), {
+ ...options,
+ method: 'POST',
+ })
+}
+
+export const getLlmSkillsNameDuplicateCreateUrl = (projectId: string, skillName: string) => {
+ return `/api/projects/${projectId}/llm_skills/name/${skillName}/duplicate/`
+}
+
+export const llmSkillsNameDuplicateCreate = async (
+ projectId: string,
+ skillName: string,
+ lLMSkillDuplicateApi: LLMSkillDuplicateApi,
+ options?: RequestInit
+): Promise<LLMSkillApi> => {
+ return apiMutator<LLMSkillApi>(getLlmSkillsNameDuplicateCreateUrl(projectId, skillName), {
+ ...options,
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(lLMSkillDuplicateApi),
+ })
+}
+
+export const getLlmSkillsNameFilesCreateUrl = (projectId: string, skillName: string) => {
+ return `/api/projects/${projectId}/llm_skills/name/${skillName}/files/`
+}
+
+export const llmSkillsNameFilesCreate = async (
+ projectId: string,
+ skillName: string,
+ lLMSkillFileCreateApi: LLMSkillFileCreateApi,
+ options?: RequestInit
+): Promise<LLMSkillApi> => {
+ return apiMutator<LLMSkillApi>(getLlmSkillsNameFilesCreateUrl(projectId, skillName), {
+ ...options,
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(lLMSkillFileCreateApi),
+ })
+}
+
+export const getLlmSkillsNameFilesRenameCreateUrl = (projectId: string, skillName: string) => {
+ return `/api/projects/${projectId}/llm_skills/name/${skillName}/files-rename/`
+}
+
+export const llmSkillsNameFilesRenameCreate = async (
+ projectId: string,
+ skillName: string,
+ lLMSkillFileRenameApi: LLMSkillFileRenameApi,
+ options?: RequestInit
+): Promise<LLMSkillApi> => {
+ return apiMutator<LLMSkillApi>(getLlmSkillsNameFilesRenameCreateUrl(projectId, skillName), {
+ ...options,
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(lLMSkillFileRenameApi),
+ })
+}
+
+export const getLlmSkillsNameFilesRetrieveUrl = (
+ projectId: string,
+ skillName: string,
+ filePath: string,
+ params?: LlmSkillsNameFilesRetrieveParams
+) => {
+ const normalizedParams = new URLSearchParams()
+
+ Object.entries(params || {}).forEach(([key, value]) => {
+ if (value !== undefined) {
+ normalizedParams.append(key, value === null ? 'null' : String(value))
+ }
+ })
+
+ const stringifiedParams = normalizedParams.toString()
+
+ return stringifiedParams.length > 0
+ ? `/api/projects/${projectId}/llm_skills/name/${skillName}/files/${filePath}/?${stringifiedParams}`
+ : `/api/projects/${projectId}/llm_skills/name/${skillName}/files/${filePath}/`
+}
+
+export const llmSkillsNameFilesRetrieve = async (
+ projectId: string,
+ skillName: string,
+ filePath: string,
+ params?: LlmSkillsNameFilesRetrieveParams,
+ options?: RequestInit
+): Promise<LLMSkillFileApi> => {
+ return apiMutator<LLMSkillFileApi>(getLlmSkillsNameFilesRetrieveUrl(projectId, skillName, filePath, params), {
+ ...options,
+ method: 'GET',
+ })
+}
+
+export const getLlmSkillsNameFilesDestroyUrl = (
+ projectId: string,
+ skillName: string,
+ filePath: string,
+ params?: LlmSkillsNameFilesDestroyParams
+) => {
+ const normalizedParams = new URLSearchParams()
+
+ Object.entries(params || {}).forEach(([key, value]) => {
+ if (value !== undefined) {
+ normalizedParams.append(key, value === null ? 'null' : String(value))
+ }
+ })
+
+ const stringifiedParams = normalizedParams.toString()
+
+ return stringifiedParams.length > 0
+ ? `/api/projects/${projectId}/llm_skills/name/${skillName}/files/${filePath}/?${stringifiedParams}`
+ : `/api/projects/${projectId}/llm_skills/name/${skillName}/files/${filePath}/`
+}
+
+export const llmSkillsNameFilesDestroy = async (
+ projectId: string,
+ skillName: string,
+ filePath: string,
+ params?: LlmSkillsNameFilesDestroyParams,
+ options?: RequestInit
+): Promise<LLMSkillApi> => {
+ return apiMutator<LLMSkillApi>(getLlmSkillsNameFilesDestroyUrl(projectId, skillName, filePath, params), {
+ ...options,
+ method: 'DELETE',
+ })
+}
+
+export const getLlmSkillsResolveNameRetrieveUrl = (
+ projectId: string,
+ skillName: string,
+ params?: LlmSkillsResolveNameRetrieveParams
+) => {
+ const normalizedParams = new URLSearchParams()
+
+ Object.entries(params || {}).forEach(([key, value]) => {
+ if (value !== undefined) {
+ normalizedParams.append(key, value === null ? 'null' : String(value))
+ }
+ })
+
+ const stringifiedParams = normalizedParams.toString()
+
+ return stringifiedParams.length > 0
+ ? `/api/projects/${projectId}/llm_skills/resolve/name/${skillName}/?${stringifiedParams}`
+ : `/api/projects/${projectId}/llm_skills/resolve/name/${skillName}/`
+}
+
+export const llmSkillsResolveNameRetrieve = async (
+ projectId: string,
+ skillName: string,
+ params?: LlmSkillsResolveNameRetrieveParams,
+ options?: RequestInit
+): Promise<LLMSkillResolveResponseApi> => {
+ return apiMutator<LLMSkillResolveResponseApi>(getLlmSkillsResolveNameRetrieveUrl(projectId, skillName, params), {
+ ...options,
+ method: 'GET',
+ })
+}
diff --git a/products/skills/frontend/generated/api.zod.ts b/products/skills/frontend/generated/api.zod.ts
new file mode 100644
index 000000000000..b8fe2ef81717
--- /dev/null
+++ b/products/skills/frontend/generated/api.zod.ts
@@ -0,0 +1,218 @@
+/**
+ * Auto-generated Zod validation schemas from the Django backend OpenAPI schema.
+ * To modify these schemas, update the Django serializers or views, then run:
+ * hogli build:openapi
+ * Questions or issues? #team-devex on Slack
+ *
+ * PostHog API - generated
+ * OpenAPI spec version: 1.0.0
+ */
+import * as zod from 'zod'
+
+export const llmSkillsCreateBodyNameMax = 64
+
+export const llmSkillsCreateBodyDescriptionMax = 4096
+
+export const llmSkillsCreateBodyLicenseMax = 255
+
+export const llmSkillsCreateBodyCompatibilityMax = 500
+
+export const llmSkillsCreateBodyFilesItemPathMax = 500
+
+export const llmSkillsCreateBodyFilesItemContentTypeDefault = `text/plain`
+export const llmSkillsCreateBodyFilesItemContentTypeMax = 100
+
+export const LlmSkillsCreateBody = /* @__PURE__ */ zod
+ .object({
+ name: zod
+ .string()
+ .max(llmSkillsCreateBodyNameMax)
+ .describe('Unique skill name. Lowercase letters, numbers, and hyphens only. Max 64 characters.'),
+ description: zod
+ .string()
+ .max(llmSkillsCreateBodyDescriptionMax)
+ .describe('What this skill does and when to use it. Max 4096 characters.'),
+ body: zod.string().describe('The SKILL.md instruction content (markdown).'),
+ license: zod
+ .string()
+ .max(llmSkillsCreateBodyLicenseMax)
+ .optional()
+ .describe('License name or reference to a bundled license file.'),
+ compatibility: zod
+ .string()
+ .max(llmSkillsCreateBodyCompatibilityMax)
+ .optional()
+ .describe('Environment requirements (intended product, system packages, network access, etc.).'),
+ allowed_tools: zod.array(zod.string()).optional().describe('List of pre-approved tools the skill may use.'),
+ metadata: zod.record(zod.string(), zod.unknown()).optional().describe('Arbitrary key-value metadata.'),
+ files: zod
+ .array(
+ zod.object({
+ path: zod
+ .string()
+ .max(llmSkillsCreateBodyFilesItemPathMax)
+ .describe(
+ "File path relative to skill root, e.g. 'scripts\/setup.sh' or 'references\/guide.md'."
+ ),
+ content: zod.string().describe('Text content of the file.'),
+ content_type: zod
+ .string()
+ .max(llmSkillsCreateBodyFilesItemContentTypeMax)
+ .default(llmSkillsCreateBodyFilesItemContentTypeDefault)
+ .describe('MIME type of the file content.'),
+ })
+ )
+ .optional()
+ .describe('Bundled files to include with the initial version (scripts, references, assets).'),
+ })
+ .describe('Create serializer — accepts bundled files as write-only input on POST.')
+
+export const llmSkillsNamePartialUpdateBodyDescriptionMax = 4096
+
+export const llmSkillsNamePartialUpdateBodyLicenseMax = 255
+
+export const llmSkillsNamePartialUpdateBodyCompatibilityMax = 500
+
+export const llmSkillsNamePartialUpdateBodyFilesItemPathMax = 500
+
+export const llmSkillsNamePartialUpdateBodyFilesItemContentTypeDefault = `text/plain`
+export const llmSkillsNamePartialUpdateBodyFilesItemContentTypeMax = 100
+
+export const llmSkillsNamePartialUpdateBodyFileEditsItemPathMax = 500
+
+export const LlmSkillsNamePartialUpdateBody = /* @__PURE__ */ zod.object({
+ body: zod
+ .string()
+ .optional()
+ .describe(
+ 'Full skill body (SKILL.md instruction content) to publish as a new version. Mutually exclusive with edits.'
+ ),
+ edits: zod
+ .array(
+ zod.object({
+ old: zod.string().describe('Text to find in the target content. Must match exactly once.'),
+ new: zod.string().describe('Replacement text.'),
+ })
+ )
+ .optional()
+ .describe(
+ "List of find\/replace operations to apply to the current skill body. Each edit's 'old' text must match exactly once. Edits are applied sequentially. Mutually exclusive with body."
+ ),
+ description: zod
+ .string()
+ .max(llmSkillsNamePartialUpdateBodyDescriptionMax)
+ .optional()
+ .describe('Updated description for the new version.'),
+ license: zod
+ .string()
+ .max(llmSkillsNamePartialUpdateBodyLicenseMax)
+ .optional()
+ .describe('License name or reference.'),
+ compatibility: zod
+ .string()
+ .max(llmSkillsNamePartialUpdateBodyCompatibilityMax)
+ .optional()
+ .describe('Environment requirements.'),
+ allowed_tools: zod.array(zod.string()).optional().describe('List of pre-approved tools the skill may use.'),
+ metadata: zod.record(zod.string(), zod.unknown()).optional().describe('Arbitrary key-value metadata.'),
+ files: zod
+ .array(
+ zod.object({
+ path: zod
+ .string()
+ .max(llmSkillsNamePartialUpdateBodyFilesItemPathMax)
+ .describe("File path relative to skill root, e.g. 'scripts\/setup.sh' or 'references\/guide.md'."),
+ content: zod.string().describe('Text content of the file.'),
+ content_type: zod
+ .string()
+ .max(llmSkillsNamePartialUpdateBodyFilesItemContentTypeMax)
+ .default(llmSkillsNamePartialUpdateBodyFilesItemContentTypeDefault)
+ .describe('MIME type of the file content.'),
+ })
+ )
+ .optional()
+ .describe(
+ 'Bundled files to include with this version. Replaces all files from the previous version. Mutually exclusive with file_edits.'
+ ),
+ file_edits: zod
+ .array(
+ zod.object({
+ path: zod
+ .string()
+ .max(llmSkillsNamePartialUpdateBodyFileEditsItemPathMax)
+ .describe(
+ 'Path of the bundled file to edit. Must match an existing file on the current skill version.'
+ ),
+ edits: zod
+ .array(
+ zod.object({
+ old: zod.string().describe('Text to find in the target content. Must match exactly once.'),
+ new: zod.string().describe('Replacement text.'),
+ })
+ )
+ .describe("Sequential find\/replace operations to apply to this file's content."),
+ })
+ )
+ .optional()
+ .describe(
+ "Per-file find\/replace updates. Each entry targets one existing file by path and applies sequential edits to its content. Non-targeted files carry forward unchanged. Cannot add, remove, or rename files — use 'files' for that. Mutually exclusive with files."
+ ),
+ base_version: zod
+ .number()
+ .min(1)
+ .optional()
+ .describe('Latest version you are editing from. Used for optimistic concurrency checks.'),
+})
+
+export const llmSkillsNameDuplicateCreateBodyNewNameMax = 64
+
+export const LlmSkillsNameDuplicateCreateBody = /* @__PURE__ */ zod.object({
+ new_name: zod
+ .string()
+ .max(llmSkillsNameDuplicateCreateBodyNewNameMax)
+ .describe('Name for the duplicated skill. Must be unique.'),
+})
+
+export const llmSkillsNameFilesCreateBodyPathMax = 500
+
+export const llmSkillsNameFilesCreateBodyContentTypeDefault = `text/plain`
+export const llmSkillsNameFilesCreateBodyContentTypeMax = 100
+
+export const LlmSkillsNameFilesCreateBody = /* @__PURE__ */ zod.object({
+ path: zod
+ .string()
+ .max(llmSkillsNameFilesCreateBodyPathMax)
+ .describe("File path relative to skill root, e.g. 'scripts\/setup.sh' or 'references\/guide.md'."),
+ content: zod.string().describe('Text content of the file.'),
+ content_type: zod
+ .string()
+ .max(llmSkillsNameFilesCreateBodyContentTypeMax)
+ .default(llmSkillsNameFilesCreateBodyContentTypeDefault)
+ .describe('MIME type of the file content.'),
+ base_version: zod
+ .number()
+ .min(1)
+ .optional()
+ .describe(
+ 'Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.'
+ ),
+})
+
+export const llmSkillsNameFilesRenameCreateBodyOldPathMax = 500
+
+export const llmSkillsNameFilesRenameCreateBodyNewPathMax = 500
+
+export const LlmSkillsNameFilesRenameCreateBody = /* @__PURE__ */ zod.object({
+ old_path: zod.string().max(llmSkillsNameFilesRenameCreateBodyOldPathMax).describe('Current file path to rename.'),
+ new_path: zod
+ .string()
+ .max(llmSkillsNameFilesRenameCreateBodyNewPathMax)
+ .describe('New file path. Must not already exist in the skill.'),
+ base_version: zod
+ .number()
+ .min(1)
+ .optional()
+ .describe(
+ 'Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.'
+ ),
+})
diff --git a/products/skills/frontend/llmSkillLogic.ts b/products/skills/frontend/llmSkillLogic.ts
index 22571f20815a..01e8bbd9b6e5 100644
--- a/products/skills/frontend/llmSkillLogic.ts
+++ b/products/skills/frontend/llmSkillLogic.ts
@@ -14,14 +14,14 @@ import {
llmSkillsNameFilesRetrieve,
llmSkillsNamePartialUpdate,
llmSkillsResolveNameRetrieve,
-} from 'products/ai_observability/frontend/generated/api'
+} from 'products/skills/frontend/generated/api'
import type {
LLMSkillApi,
LLMSkillFileApi,
LLMSkillFileInputApi,
LLMSkillListApi,
LLMSkillVersionSummaryApi,
-} from 'products/ai_observability/frontend/generated/api.schemas'
+} from 'products/skills/frontend/generated/api.schemas'
import type { llmSkillLogicType } from './llmSkillLogicType'
import { llmSkillsLogic, LLM_SKILLS_FORCE_RELOAD_PARAM } from './llmSkillsLogic'
diff --git a/products/skills/frontend/llmSkillsLogic.ts b/products/skills/frontend/llmSkillsLogic.ts
index 0bdcb7430f11..b93f45ac9350 100644
--- a/products/skills/frontend/llmSkillsLogic.ts
+++ b/products/skills/frontend/llmSkillsLogic.ts
@@ -15,11 +15,8 @@ import {
llmSkillsList,
llmSkillsNameArchiveCreate,
llmSkillsNameDuplicateCreate,
-} from 'products/ai_observability/frontend/generated/api'
-import type {
- LLMSkillListApi,
- PaginatedLLMSkillListListApi,
-} from 'products/ai_observability/frontend/generated/api.schemas'
+} from 'products/skills/frontend/generated/api'
+import type { LLMSkillListApi, PaginatedLLMSkillListListApi } from 'products/skills/frontend/generated/api.schemas'
import type { llmSkillsLogicType } from './llmSkillsLogicType'
diff --git a/products/skills/frontend/skillFileLogic.ts b/products/skills/frontend/skillFileLogic.ts
index 8e775cce37d4..7b349399cda4 100644
--- a/products/skills/frontend/skillFileLogic.ts
+++ b/products/skills/frontend/skillFileLogic.ts
@@ -3,8 +3,8 @@ import { loaders } from 'kea-loaders'
import { ApiConfig } from '~/lib/api'
-import { llmSkillsNameFilesRetrieve } from 'products/ai_observability/frontend/generated/api'
-import type { LLMSkillFileApi } from 'products/ai_observability/frontend/generated/api.schemas'
+import { llmSkillsNameFilesRetrieve } from 'products/skills/frontend/generated/api'
+import type { LLMSkillFileApi } from 'products/skills/frontend/generated/api.schemas'
import type { skillFileLogicType } from './skillFileLogicType'
diff --git a/products/skills/mcp/tools.yaml b/products/skills/mcp/tools.yaml
new file mode 100644
index 000000000000..1ed649939cde
--- /dev/null
+++ b/products/skills/mcp/tools.yaml
@@ -0,0 +1,199 @@
+# MCP tool definition — tool entries are scaffolded from the OpenAPI schema.
+# The tool list and operation IDs are kept in sync automatically:
+# pnpm --filter=@posthog/mcp run scaffold-yaml -- --sync-all
+#
+# To enable a tool, set enabled: true and add required scopes + annotations.
+# All other fields (title, description, enrich_url, etc.) are yours to configure.
+category: Skills
+feature: skills
+url_prefix: /skills
+ui_apps: {}
+tools:
+ llma-skill-archive:
+ operation: llm_skills_name_archive_create
+ enabled: true
+ scopes:
+ - llm_skill:write
+ annotations:
+ readOnly: false
+ destructive: true
+ idempotent: false
+ title: Archive skill
+ description: >
+ Archive every active version of an agent skill by name. This hides the skill from default lists and cannot
+ be undone. Use llma-skill-get first if you need to inspect the skill before archiving it.
+ param_overrides:
+ skill_name:
+ description: The kebab-case name of the skill to archive.
+ llma-skill-create:
+ operation: llm_skills_create
+ enabled: true
+ scopes:
+ - llm_skill:write
+ annotations:
+ readOnly: false
+ destructive: false
+ idempotent: false
+ title: Create skill
+ description: >
+ Create a new agent skill. Requires a unique kebab-case name (lowercase letters, numbers, hyphens), a
+ description explaining when to use it, and the skill body (SKILL.md instruction content as markdown).
+ Optionally include license, compatibility, allowed_tools, metadata, and bundled files.
+ include_params:
+ - name
+ - description
+ - body
+ - license
+ - compatibility
+ - allowed_tools
+ - metadata
+ - files
+ llma-skill-duplicate:
+ operation: llm_skills_name_duplicate_create
+ enabled: true
+ scopes:
+ - llm_skill:write
+ annotations:
+ readOnly: false
+ destructive: false
+ idempotent: false
+ title: Duplicate skill
+ description: >
+ Duplicate an existing agent skill under a new name. Copies the latest version's content, metadata, and
+ bundled files to create a new skill at version 1.
+ llma-skill-file-create:
+ operation: llm_skills_name_files_create
+ enabled: true
+ scopes:
+ - llm_skill:write
+ annotations:
+ readOnly: false
+ destructive: false
+ idempotent: false
+ title: Create skill file
+ description: >
+ Add a new bundled file to an agent skill. Fails with 409 if a file at the given path already exists — use
+ llma-skill-update with files to replace, or llma-skill-file-delete followed by llma-skill-file-create to
+ overwrite. Publishes a new skill version and returns the updated skill (read its 'version' field to chain
+ further edits via base_version). Supply base_version for optimistic concurrency.
+ llma-skill-file-delete:
+ operation: llm_skills_name_files_destroy
+ enabled: true
+ scopes:
+ - llm_skill:write
+ annotations:
+ readOnly: false
+ destructive: true
+ idempotent: false
+ title: Delete skill file
+ description: >
+ Remove a bundled file from an agent skill by path. Fails with 404 if the file is not in the latest version.
+ Publishes a new skill version and returns 200 with the updated skill body (not 204) — read its 'version'
+ field to chain further edits via base_version. Supply base_version for optimistic concurrency.
+ llma-skill-file-get:
+ operation: llm_skills_name_files_retrieve
+ enabled: true
+ scopes:
+ - llm_skill:read
+ annotations:
+ readOnly: true
+ destructive: false
+ idempotent: true
+ title: Get skill file
+ description: >
+ Fetch a single bundled file from an agent skill by its path. Use the file manifest from llma-skill-get to
+ discover available files. Supports progressive disclosure — only load files when needed rather than fetching
+ all content upfront.
+ llma-skill-file-rename:
+ operation: llm_skills_name_files_rename_create
+ enabled: true
+ scopes:
+ - llm_skill:write
+ annotations:
+ readOnly: false
+ destructive: false
+ idempotent: false
+ title: Rename skill file
+ description: >
+ Rename a bundled file within an agent skill. Fails with 404 if old_path is not in the latest version, and
+ with 409 if new_path already exists. Use this to move a file without rewriting its content. Publishes a new
+ skill version and returns the updated skill (read its 'version' field to chain further edits via
+ base_version). Supply base_version for optimistic concurrency.
+ llma-skill-get:
+ operation: llm_skills_name_retrieve
+ enabled: true
+ scopes:
+ - llm_skill:read
+ annotations:
+ readOnly: true
+ destructive: false
+ idempotent: true
+ title: Get skill
+ description: >
+ Get a specific agent skill by name, including its full body content, metadata, and file manifest. Follows
+ the Agent Skills specification (agentskills.io). To link a user to this skill in the PostHog app, build the
+ URL from the skill `name`, not its `id`: `/llm-analytics/skills/<name>` (e.g.
+ `/llm-analytics/skills/pr-shepherd`). The `id` (UUID) is not a valid route segment and will 404.
+ llma-skill-list:
+ operation: llm_skills_list
+ enabled: true
+ scopes:
+ - llm_skill:read
+ annotations:
+ readOnly: true
+ destructive: false
+ idempotent: true
+ title: List skills
+ description: >
+ List all agent skills stored for the current team. Returns skill names and descriptions for discovery — use
+ descriptions to determine which skill to fetch for a given task. Does not return skill body content (use
+ llma-skill-get to fetch full content). To link a user to a skill in the PostHog app, build the URL from the
+ skill `name`, not its `id`: `/llm-analytics/skills/<name>` (e.g. `/llm-analytics/skills/pr-shepherd`). The
+ `id` (UUID) is not a valid route segment and will 404.
+ llma-skill-resolve:
+ operation: llm_skills_resolve_name_retrieve
+ enabled: false
+ llma-skill-update:
+ operation: llm_skills_name_partial_update
+ enabled: true
+ scopes:
+ - llm_skill:write
+ annotations:
+ readOnly: false
+ destructive: false
+ idempotent: true
+ title: Update skill
+ description: |
+ Publish a new version of an existing agent skill by name. Any field not provided
+ is carried forward from the current latest version. Requires base_version for
+ optimistic concurrency.
+
+ For the body, you can either provide the full content via 'body', or use 'edits'
+ for incremental find/replace updates. Each edit must have 'old' (text to find,
+ must match exactly once) and 'new' (replacement text). Edits are applied
+ sequentially. Only one of 'body' or 'edits' may be provided.
+
+ For file changes, prefer the per-file tools rather than passing a 'files' list:
+ llma-skill-file-create / llma-skill-file-delete / llma-skill-file-rename handle
+ add/remove/rename one file at a time and return the updated skill (including the
+ bumped version) so callers can chain further edits via base_version.
+
+ For per-file content updates, use 'file_edits' to apply find/replace updates to
+ individual files without resending the full file set — each entry targets one
+ existing file by path. Non-targeted files carry forward unchanged. 'file_edits'
+ cannot add, remove, or rename files; use the per-file tools or 'files' (replace-all)
+ for that. 'files' and 'file_edits' are mutually exclusive.
+
+ Passing a 'files' list here replaces ALL files and risks data loss if any file is
+ omitted — use it only when you intentionally want to replace the entire bundle.
+ include_params:
+ - body
+ - edits
+ - description
+ - license
+ - compatibility
+ - allowed_tools
+ - metadata
+ - files
+ - file_edits
+ - base_version
diff --git a/products/skills/package.json b/products/skills/package.json
index a4a08605449d..75372f7f09ea 100644
--- a/products/skills/package.json
+++ b/products/skills/package.json
@@ -1,5 +1,8 @@
{
"name": "@posthog/products-skills",
+ "scripts": {
+ "backend:test": "pytest -c ../../pytest.ini --rootdir ../.. backend/ -v --tb=short"
+ },
"dependencies": {
"kea": "catalog:",
"kea-forms": "catalog:",
diff --git a/products/skills/product.yaml b/products/skills/product.yaml
new file mode 100644
index 000000000000..3408bb766e5f
--- /dev/null
+++ b/products/skills/product.yaml
@@ -0,0 +1,3 @@
+name: Skills
+owners:
+ - team-ai-observability
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index 6ff7b018f36c..2d7336ffe734 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -3802,8 +3802,8 @@
},
"llma-skill-archive": {
"description": "Archive every active version of an agent skill by name. This hides the skill from default lists and cannot be undone. Use llma-skill-get first if you need to inspect the skill before archiving it.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Archive skill",
"title": "Archive skill",
"required_scopes": ["llm_skill:write"],
@@ -3816,8 +3816,8 @@
},
"llma-skill-create": {
"description": "Create a new agent skill. Requires a unique kebab-case name (lowercase letters, numbers, hyphens), a description explaining when to use it, and the skill body (SKILL.md instruction content as markdown). Optionally include license, compatibility, allowed_tools, metadata, and bundled files.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Create skill",
"title": "Create skill",
"required_scopes": ["llm_skill:write"],
@@ -3830,8 +3830,8 @@
},
"llma-skill-duplicate": {
"description": "Duplicate an existing agent skill under a new name. Copies the latest version's content, metadata, and bundled files to create a new skill at version 1.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Duplicate skill",
"title": "Duplicate skill",
"required_scopes": ["llm_skill:write"],
@@ -3844,8 +3844,8 @@
},
"llma-skill-file-create": {
"description": "Add a new bundled file to an agent skill. Fails with 409 if a file at the given path already exists — use llma-skill-update with files to replace, or llma-skill-file-delete followed by llma-skill-file-create to overwrite. Publishes a new skill version and returns the updated skill (read its 'version' field to chain further edits via base_version). Supply base_version for optimistic concurrency.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Create skill file",
"title": "Create skill file",
"required_scopes": ["llm_skill:write"],
@@ -3858,8 +3858,8 @@
},
"llma-skill-file-delete": {
"description": "Remove a bundled file from an agent skill by path. Fails with 404 if the file is not in the latest version. Publishes a new skill version and returns 200 with the updated skill body (not 204) — read its 'version' field to chain further edits via base_version. Supply base_version for optimistic concurrency.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Delete skill file",
"title": "Delete skill file",
"required_scopes": ["llm_skill:write"],
@@ -3872,8 +3872,8 @@
},
"llma-skill-file-get": {
"description": "Fetch a single bundled file from an agent skill by its path. Use the file manifest from llma-skill-get to discover available files. Supports progressive disclosure — only load files when needed rather than fetching all content upfront.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Get skill file",
"title": "Get skill file",
"required_scopes": ["llm_skill:read"],
@@ -3886,8 +3886,8 @@
},
"llma-skill-file-rename": {
"description": "Rename a bundled file within an agent skill. Fails with 404 if old_path is not in the latest version, and with 409 if new_path already exists. Use this to move a file without rewriting its content. Publishes a new skill version and returns the updated skill (read its 'version' field to chain further edits via base_version). Supply base_version for optimistic concurrency.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Rename skill file",
"title": "Rename skill file",
"required_scopes": ["llm_skill:write"],
@@ -3900,8 +3900,8 @@
},
"llma-skill-get": {
"description": "Get a specific agent skill by name, including its full body content, metadata, and file manifest. Follows the Agent Skills specification (agentskills.io). To link a user to this skill in the PostHog app, build the URL from the skill `name`, not its `id`: `/llm-analytics/skills/<name>` (e.g. `/llm-analytics/skills/pr-shepherd`). The `id` (UUID) is not a valid route segment and will 404.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Get skill",
"title": "Get skill",
"required_scopes": ["llm_skill:read"],
@@ -3914,8 +3914,8 @@
},
"llma-skill-list": {
"description": "List all agent skills stored for the current team. Returns skill names and descriptions for discovery — use descriptions to determine which skill to fetch for a given task. Does not return skill body content (use llma-skill-get to fetch full content). To link a user to a skill in the PostHog app, build the URL from the skill `name`, not its `id`: `/llm-analytics/skills/<name>` (e.g. `/llm-analytics/skills/pr-shepherd`). The `id` (UUID) is not a valid route segment and will 404.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "List skills",
"title": "List skills",
"required_scopes": ["llm_skill:read"],
@@ -3928,8 +3928,8 @@
},
"llma-skill-update": {
"description": "Publish a new version of an existing agent skill by name. Any field not provided\nis carried forward from the current latest version. Requires base_version for\noptimistic concurrency.\n\nFor the body, you can either provide the full content via 'body', or use 'edits'\nfor incremental find/replace updates. Each edit must have 'old' (text to find,\nmust match exactly once) and 'new' (replacement text). Edits are applied\nsequentially. Only one of 'body' or 'edits' may be provided.\n\nFor file changes, prefer the per-file tools rather than passing a 'files' list:\nllma-skill-file-create / llma-skill-file-delete / llma-skill-file-rename handle\nadd/remove/rename one file at a time and return the updated skill (including the\nbumped version) so callers can chain further edits via base_version.\n\nFor per-file content updates, use 'file_edits' to apply find/replace updates to\nindividual files without resending the full file set — each entry targets one\nexisting file by path. Non-targeted files carry forward unchanged. 'file_edits'\ncannot add, remove, or rename files; use the per-file tools or 'files' (replace-all)\nfor that. 'files' and 'file_edits' are mutually exclusive.\n\nPassing a 'files' list here replaces ALL files and risks data loss if any file is\nomitted — use it only when you intentionally want to replace the entire bundle.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Update skill",
"title": "Update skill",
"required_scopes": ["llm_skill:write"],
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 454bc4fe4732..df5a160fb766 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -4070,8 +4070,8 @@
},
"llma-skill-archive": {
"description": "Archive every active version of an agent skill by name. This hides the skill from default lists and cannot be undone. Use llma-skill-get first if you need to inspect the skill before archiving it.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Archive skill",
"title": "Archive skill",
"required_scopes": ["llm_skill:write"],
@@ -4084,8 +4084,8 @@
},
"llma-skill-create": {
"description": "Create a new agent skill. Requires a unique kebab-case name (lowercase letters, numbers, hyphens), a description explaining when to use it, and the skill body (SKILL.md instruction content as markdown). Optionally include license, compatibility, allowed_tools, metadata, and bundled files.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Create skill",
"title": "Create skill",
"required_scopes": ["llm_skill:write"],
@@ -4098,8 +4098,8 @@
},
"llma-skill-duplicate": {
"description": "Duplicate an existing agent skill under a new name. Copies the latest version's content, metadata, and bundled files to create a new skill at version 1.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Duplicate skill",
"title": "Duplicate skill",
"required_scopes": ["llm_skill:write"],
@@ -4112,8 +4112,8 @@
},
"llma-skill-file-create": {
"description": "Add a new bundled file to an agent skill. Fails with 409 if a file at the given path already exists — use llma-skill-update with files to replace, or llma-skill-file-delete followed by llma-skill-file-create to overwrite. Publishes a new skill version and returns the updated skill (read its 'version' field to chain further edits via base_version). Supply base_version for optimistic concurrency.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Create skill file",
"title": "Create skill file",
"required_scopes": ["llm_skill:write"],
@@ -4126,8 +4126,8 @@
},
"llma-skill-file-delete": {
"description": "Remove a bundled file from an agent skill by path. Fails with 404 if the file is not in the latest version. Publishes a new skill version and returns 200 with the updated skill body (not 204) — read its 'version' field to chain further edits via base_version. Supply base_version for optimistic concurrency.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Delete skill file",
"title": "Delete skill file",
"required_scopes": ["llm_skill:write"],
@@ -4140,8 +4140,8 @@
},
"llma-skill-file-get": {
"description": "Fetch a single bundled file from an agent skill by its path. Use the file manifest from llma-skill-get to discover available files. Supports progressive disclosure — only load files when needed rather than fetching all content upfront.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Get skill file",
"title": "Get skill file",
"required_scopes": ["llm_skill:read"],
@@ -4154,8 +4154,8 @@
},
"llma-skill-file-rename": {
"description": "Rename a bundled file within an agent skill. Fails with 404 if old_path is not in the latest version, and with 409 if new_path already exists. Use this to move a file without rewriting its content. Publishes a new skill version and returns the updated skill (read its 'version' field to chain further edits via base_version). Supply base_version for optimistic concurrency.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Rename skill file",
"title": "Rename skill file",
"required_scopes": ["llm_skill:write"],
@@ -4168,8 +4168,8 @@
},
"llma-skill-get": {
"description": "Get a specific agent skill by name, including its full body content, metadata, and file manifest. Follows the Agent Skills specification (agentskills.io). To link a user to this skill in the PostHog app, build the URL from the skill `name`, not its `id`: `/llm-analytics/skills/<name>` (e.g. `/llm-analytics/skills/pr-shepherd`). The `id` (UUID) is not a valid route segment and will 404.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Get skill",
"title": "Get skill",
"required_scopes": ["llm_skill:read"],
@@ -4182,8 +4182,8 @@
},
"llma-skill-list": {
"description": "List all agent skills stored for the current team. Returns skill names and descriptions for discovery — use descriptions to determine which skill to fetch for a given task. Does not return skill body content (use llma-skill-get to fetch full content). To link a user to a skill in the PostHog app, build the URL from the skill `name`, not its `id`: `/llm-analytics/skills/<name>` (e.g. `/llm-analytics/skills/pr-shepherd`). The `id` (UUID) is not a valid route segment and will 404.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "List skills",
"title": "List skills",
"required_scopes": ["llm_skill:read"],
@@ -4196,8 +4196,8 @@
},
"llma-skill-update": {
"description": "Publish a new version of an existing agent skill by name. Any field not provided\nis carried forward from the current latest version. Requires base_version for\noptimistic concurrency.\n\nFor the body, you can either provide the full content via 'body', or use 'edits'\nfor incremental find/replace updates. Each edit must have 'old' (text to find,\nmust match exactly once) and 'new' (replacement text). Edits are applied\nsequentially. Only one of 'body' or 'edits' may be provided.\n\nFor file changes, prefer the per-file tools rather than passing a 'files' list:\nllma-skill-file-create / llma-skill-file-delete / llma-skill-file-rename handle\nadd/remove/rename one file at a time and return the updated skill (including the\nbumped version) so callers can chain further edits via base_version.\n\nFor per-file content updates, use 'file_edits' to apply find/replace updates to\nindividual files without resending the full file set — each entry targets one\nexisting file by path. Non-targeted files carry forward unchanged. 'file_edits'\ncannot add, remove, or rename files; use the per-file tools or 'files' (replace-all)\nfor that. 'files' and 'file_edits' are mutually exclusive.\n\nPassing a 'files' list here replaces ALL files and risks data loss if any file is\nomitted — use it only when you intentionally want to replace the entire bundle.",
- "category": "AI observability",
- "feature": "llm_analytics",
+ "category": "Skills",
+ "feature": "skills",
"summary": "Update skill",
"title": "Update skill",
"required_scopes": ["llm_skill:write"],
diff --git a/services/mcp/src/generated/ai_observability/api.ts b/services/mcp/src/generated/ai_observability/api.ts
index 32efe1040e45..db6a31b8e77d 100644
--- a/services/mcp/src/generated/ai_observability/api.ts
+++ b/services/mcp/src/generated/ai_observability/api.ts
@@ -3,7 +3,7 @@
* MCP service uses these Zod schemas for generated tool handlers.
* To regenerate: hogli build:openapi
*
- * PostHog API - MCP 61 enabled ops
+ * PostHog API - MCP 51 enabled ops
* OpenAPI spec version: 1.0.0
*/
import * as zod from 'zod'
@@ -1537,355 +1537,6 @@ export const LlmPromptsNameDuplicateCreateBody = /* @__PURE__ */ zod.object({
),
})
-export const LlmSkillsListParams = /* @__PURE__ */ zod.object({
- project_id: zod
- .string()
- .describe(
- "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
- ),
-})
-
-export const LlmSkillsListQueryParams = /* @__PURE__ */ zod.object({
- 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.'),
- search: zod.string().optional().describe('Optional substring filter applied to skill names and descriptions.'),
-})
-
-export const LlmSkillsCreateParams = /* @__PURE__ */ zod.object({
- project_id: zod
- .string()
- .describe(
- "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
- ),
-})
-
-export const llmSkillsCreateBodyNameMax = 64
-
-export const llmSkillsCreateBodyDescriptionMax = 4096
-
-export const llmSkillsCreateBodyLicenseMax = 255
-
-export const llmSkillsCreateBodyCompatibilityMax = 500
-
-export const llmSkillsCreateBodyFilesItemPathMax = 500
-
-export const llmSkillsCreateBodyFilesItemContentTypeDefault = `text/plain`
-export const llmSkillsCreateBodyFilesItemContentTypeMax = 100
-
-export const LlmSkillsCreateBody = /* @__PURE__ */ zod
- .object({
- name: zod
- .string()
- .max(llmSkillsCreateBodyNameMax)
- .describe('Unique skill name. Lowercase letters, numbers, and hyphens only. Max 64 characters.'),
- description: zod
- .string()
- .max(llmSkillsCreateBodyDescriptionMax)
- .describe('What this skill does and when to use it. Max 4096 characters.'),
- body: zod.string().describe('The SKILL.md instruction content (markdown).'),
- license: zod
- .string()
- .max(llmSkillsCreateBodyLicenseMax)
- .optional()
- .describe('License name or reference to a bundled license file.'),
- compatibility: zod
- .string()
- .max(llmSkillsCreateBodyCompatibilityMax)
- .optional()
- .describe('Environment requirements (intended product, system packages, network access, etc.).'),
- allowed_tools: zod.array(zod.string()).optional().describe('List of pre-approved tools the skill may use.'),
- metadata: zod.record(zod.string(), zod.unknown()).optional().describe('Arbitrary key-value metadata.'),
- files: zod
- .array(
- zod.object({
- path: zod
- .string()
- .max(llmSkillsCreateBodyFilesItemPathMax)
- .describe(
- "File path relative to skill root, e.g. 'scripts/setup.sh' or 'references/guide.md'."
- ),
- content: zod.string().describe('Text content of the file.'),
- content_type: zod
- .string()
- .max(llmSkillsCreateBodyFilesItemContentTypeMax)
- .default(llmSkillsCreateBodyFilesItemContentTypeDefault)
- .describe('MIME type of the file content.'),
- })
- )
- .optional()
- .describe('Bundled files to include with the initial version (scripts, references, assets).'),
- })
- .describe('Create serializer — accepts bundled files as write-only input on POST.')
-
-export const llmSkillsNameRetrievePathSkillNameRegExp = new RegExp('^[^/]+$')
-
-export const LlmSkillsNameRetrieveParams = /* @__PURE__ */ zod.object({
- project_id: zod
- .string()
- .describe(
- "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
- ),
- skill_name: zod.string().regex(llmSkillsNameRetrievePathSkillNameRegExp),
-})
-
-export const LlmSkillsNameRetrieveQueryParams = /* @__PURE__ */ zod.object({
- version: zod
- .number()
- .min(1)
- .optional()
- .describe('Specific skill version to fetch. If omitted, the latest version is returned.'),
-})
-
-export const llmSkillsNamePartialUpdatePathSkillNameRegExp = new RegExp('^[^/]+$')
-
-export const LlmSkillsNamePartialUpdateParams = /* @__PURE__ */ zod.object({
- project_id: zod
- .string()
- .describe(
- "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
- ),
- skill_name: zod.string().regex(llmSkillsNamePartialUpdatePathSkillNameRegExp),
-})
-
-export const llmSkillsNamePartialUpdateBodyDescriptionMax = 4096
-
-export const llmSkillsNamePartialUpdateBodyLicenseMax = 255
-
-export const llmSkillsNamePartialUpdateBodyCompatibilityMax = 500
-
-export const llmSkillsNamePartialUpdateBodyFilesItemPathMax = 500
-
-export const llmSkillsNamePartialUpdateBodyFilesItemContentTypeDefault = `text/plain`
-export const llmSkillsNamePartialUpdateBodyFilesItemContentTypeMax = 100
-
-export const llmSkillsNamePartialUpdateBodyFileEditsItemPathMax = 500
-
-export const LlmSkillsNamePartialUpdateBody = /* @__PURE__ */ zod.object({
- body: zod
- .string()
- .optional()
- .describe(
- 'Full skill body (SKILL.md instruction content) to publish as a new version. Mutually exclusive with edits.'
- ),
- edits: zod
- .array(
- zod.object({
- old: zod.string().describe('Text to find in the target content. Must match exactly once.'),
- new: zod.string().describe('Replacement text.'),
- })
- )
- .optional()
- .describe(
- "List of find/replace operations to apply to the current skill body. Each edit's 'old' text must match exactly once. Edits are applied sequentially. Mutually exclusive with body."
- ),
- description: zod
- .string()
- .max(llmSkillsNamePartialUpdateBodyDescriptionMax)
- .optional()
- .describe('Updated description for the new version.'),
- license: zod
- .string()
- .max(llmSkillsNamePartialUpdateBodyLicenseMax)
- .optional()
- .describe('License name or reference.'),
- compatibility: zod
- .string()
- .max(llmSkillsNamePartialUpdateBodyCompatibilityMax)
- .optional()
- .describe('Environment requirements.'),
- allowed_tools: zod.array(zod.string()).optional().describe('List of pre-approved tools the skill may use.'),
- metadata: zod.record(zod.string(), zod.unknown()).optional().describe('Arbitrary key-value metadata.'),
- files: zod
- .array(
- zod.object({
- path: zod
- .string()
- .max(llmSkillsNamePartialUpdateBodyFilesItemPathMax)
- .describe("File path relative to skill root, e.g. 'scripts/setup.sh' or 'references/guide.md'."),
- content: zod.string().describe('Text content of the file.'),
- content_type: zod
- .string()
- .max(llmSkillsNamePartialUpdateBodyFilesItemContentTypeMax)
- .default(llmSkillsNamePartialUpdateBodyFilesItemContentTypeDefault)
- .describe('MIME type of the file content.'),
- })
- )
- .optional()
- .describe(
- 'Bundled files to include with this version. Replaces all files from the previous version. Mutually exclusive with file_edits.'
- ),
- file_edits: zod
- .array(
- zod.object({
- path: zod
- .string()
- .max(llmSkillsNamePartialUpdateBodyFileEditsItemPathMax)
- .describe(
- 'Path of the bundled file to edit. Must match an existing file on the current skill version.'
- ),
- edits: zod
- .array(
- zod.object({
- old: zod.string().describe('Text to find in the target content. Must match exactly once.'),
- new: zod.string().describe('Replacement text.'),
- })
- )
- .describe("Sequential find/replace operations to apply to this file's content."),
- })
- )
- .optional()
- .describe(
- "Per-file find/replace updates. Each entry targets one existing file by path and applies sequential edits to its content. Non-targeted files carry forward unchanged. Cannot add, remove, or rename files — use 'files' for that. Mutually exclusive with files."
- ),
- base_version: zod
- .number()
- .min(1)
- .optional()
- .describe('Latest version you are editing from. Used for optimistic concurrency checks.'),
-})
-
-export const llmSkillsNameArchiveCreatePathSkillNameRegExp = new RegExp('^[^/]+$')
-
-export const LlmSkillsNameArchiveCreateParams = /* @__PURE__ */ zod.object({
- project_id: zod
- .string()
- .describe(
- "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
- ),
- skill_name: zod.string().regex(llmSkillsNameArchiveCreatePathSkillNameRegExp),
-})
-
-export const llmSkillsNameDuplicateCreatePathSkillNameRegExp = new RegExp('^[^/]+$')
-
-export const LlmSkillsNameDuplicateCreateParams = /* @__PURE__ */ zod.object({
- project_id: zod
- .string()
- .describe(
- "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
- ),
- skill_name: zod.string().regex(llmSkillsNameDuplicateCreatePathSkillNameRegExp),
-})
-
-export const llmSkillsNameDuplicateCreateBodyNewNameMax = 64
-
-export const LlmSkillsNameDuplicateCreateBody = /* @__PURE__ */ zod.object({
- new_name: zod
- .string()
- .max(llmSkillsNameDuplicateCreateBodyNewNameMax)
- .describe('Name for the duplicated skill. Must be unique.'),
-})
-
-export const llmSkillsNameFilesCreatePathSkillNameRegExp = new RegExp('^[^/]+$')
-
-export const LlmSkillsNameFilesCreateParams = /* @__PURE__ */ zod.object({
- project_id: zod
- .string()
- .describe(
- "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
- ),
- skill_name: zod.string().regex(llmSkillsNameFilesCreatePathSkillNameRegExp),
-})
-
-export const llmSkillsNameFilesCreateBodyPathMax = 500
-
-export const llmSkillsNameFilesCreateBodyContentTypeDefault = `text/plain`
-export const llmSkillsNameFilesCreateBodyContentTypeMax = 100
-
-export const LlmSkillsNameFilesCreateBody = /* @__PURE__ */ zod.object({
- path: zod
- .string()
- .max(llmSkillsNameFilesCreateBodyPathMax)
- .describe("File path relative to skill root, e.g. 'scripts/setup.sh' or 'references/guide.md'."),
- content: zod.string().describe('Text content of the file.'),
- content_type: zod
- .string()
- .max(llmSkillsNameFilesCreateBodyContentTypeMax)
- .default(llmSkillsNameFilesCreateBodyContentTypeDefault)
- .describe('MIME type of the file content.'),
- base_version: zod
- .number()
- .min(1)
- .optional()
- .describe(
- 'Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.'
- ),
-})
-
-export const llmSkillsNameFilesRenameCreatePathSkillNameRegExp = new RegExp('^[^/]+$')
-
-export const LlmSkillsNameFilesRenameCreateParams = /* @__PURE__ */ zod.object({
- project_id: zod
- .string()
- .describe(
- "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
- ),
- skill_name: zod.string().regex(llmSkillsNameFilesRenameCreatePathSkillNameRegExp),
-})
-
-export const llmSkillsNameFilesRenameCreateBodyOldPathMax = 500
-
-export const llmSkillsNameFilesRenameCreateBodyNewPathMax = 500
-
-export const LlmSkillsNameFilesRenameCreateBody = /* @__PURE__ */ zod.object({
- old_path: zod.string().max(llmSkillsNameFilesRenameCreateBodyOldPathMax).describe('Current file path to rename.'),
- new_path: zod
- .string()
- .max(llmSkillsNameFilesRenameCreateBodyNewPathMax)
- .describe('New file path. Must not already exist in the skill.'),
- base_version: zod
- .number()
- .min(1)
- .optional()
- .describe(
- 'Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.'
- ),
-})
-
-export const llmSkillsNameFilesRetrievePathFilePathRegExp = new RegExp('^.+$')
-export const llmSkillsNameFilesRetrievePathSkillNameRegExp = new RegExp('^[^/]+$')
-
-export const LlmSkillsNameFilesRetrieveParams = /* @__PURE__ */ zod.object({
- file_path: zod.string().regex(llmSkillsNameFilesRetrievePathFilePathRegExp),
- project_id: zod
- .string()
- .describe(
- "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
- ),
- skill_name: zod.string().regex(llmSkillsNameFilesRetrievePathSkillNameRegExp),
-})
-
-export const LlmSkillsNameFilesRetrieveQueryParams = /* @__PURE__ */ zod.object({
- version: zod
- .number()
- .min(1)
- .optional()
- .describe('Specific skill version to fetch. If omitted, the latest version is returned.'),
-})
-
-export const llmSkillsNameFilesDestroyPathFilePathRegExp = new RegExp('^.+$')
-export const llmSkillsNameFilesDestroyPathSkillNameRegExp = new RegExp('^[^/]+$')
-
-export const LlmSkillsNameFilesDestroyParams = /* @__PURE__ */ zod.object({
- file_path: zod.string().regex(llmSkillsNameFilesDestroyPathFilePathRegExp),
- project_id: zod
- .string()
- .describe(
- "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
- ),
- skill_name: zod.string().regex(llmSkillsNameFilesDestroyPathSkillNameRegExp),
-})
-
-export const LlmSkillsNameFilesDestroyQueryParams = /* @__PURE__ */ zod.object({
- base_version: zod
- .number()
- .min(1)
- .optional()
- .describe(
- 'Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.'
- ),
-})
-
export const TaggersListParams = /* @__PURE__ */ zod.object({
project_id: zod
.string()
diff --git a/services/mcp/src/generated/skills/api.ts b/services/mcp/src/generated/skills/api.ts
new file mode 100644
index 000000000000..5cadeffb5a5f
--- /dev/null
+++ b/services/mcp/src/generated/skills/api.ts
@@ -0,0 +1,358 @@
+/**
+ * Auto-generated from the Django backend OpenAPI schema.
+ * MCP service uses these Zod schemas for generated tool handlers.
+ * To regenerate: hogli build:openapi
+ *
+ * PostHog API - MCP 10 enabled ops
+ * OpenAPI spec version: 1.0.0
+ */
+import * as zod from 'zod'
+
+export const LlmSkillsListParams = /* @__PURE__ */ zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+})
+
+export const LlmSkillsListQueryParams = /* @__PURE__ */ zod.object({
+ 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.'),
+ search: zod.string().optional().describe('Optional substring filter applied to skill names and descriptions.'),
+})
+
+export const LlmSkillsCreateParams = /* @__PURE__ */ zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+})
+
+export const llmSkillsCreateBodyNameMax = 64
+
+export const llmSkillsCreateBodyDescriptionMax = 4096
+
+export const llmSkillsCreateBodyLicenseMax = 255
+
+export const llmSkillsCreateBodyCompatibilityMax = 500
+
+export const llmSkillsCreateBodyFilesItemPathMax = 500
+
+export const llmSkillsCreateBodyFilesItemContentTypeDefault = `text/plain`
+export const llmSkillsCreateBodyFilesItemContentTypeMax = 100
+
+export const LlmSkillsCreateBody = /* @__PURE__ */ zod
+ .object({
+ name: zod
+ .string()
+ .max(llmSkillsCreateBodyNameMax)
+ .describe('Unique skill name. Lowercase letters, numbers, and hyphens only. Max 64 characters.'),
+ description: zod
+ .string()
+ .max(llmSkillsCreateBodyDescriptionMax)
+ .describe('What this skill does and when to use it. Max 4096 characters.'),
+ body: zod.string().describe('The SKILL.md instruction content (markdown).'),
+ license: zod
+ .string()
+ .max(llmSkillsCreateBodyLicenseMax)
+ .optional()
+ .describe('License name or reference to a bundled license file.'),
+ compatibility: zod
+ .string()
+ .max(llmSkillsCreateBodyCompatibilityMax)
+ .optional()
+ .describe('Environment requirements (intended product, system packages, network access, etc.).'),
+ allowed_tools: zod.array(zod.string()).optional().describe('List of pre-approved tools the skill may use.'),
+ metadata: zod.record(zod.string(), zod.unknown()).optional().describe('Arbitrary key-value metadata.'),
+ files: zod
+ .array(
+ zod.object({
+ path: zod
+ .string()
+ .max(llmSkillsCreateBodyFilesItemPathMax)
+ .describe(
+ "File path relative to skill root, e.g. 'scripts/setup.sh' or 'references/guide.md'."
+ ),
+ content: zod.string().describe('Text content of the file.'),
+ content_type: zod
+ .string()
+ .max(llmSkillsCreateBodyFilesItemContentTypeMax)
+ .default(llmSkillsCreateBodyFilesItemContentTypeDefault)
+ .describe('MIME type of the file content.'),
+ })
+ )
+ .optional()
+ .describe('Bundled files to include with the initial version (scripts, references, assets).'),
+ })
+ .describe('Create serializer — accepts bundled files as write-only input on POST.')
+
+export const llmSkillsNameRetrievePathSkillNameRegExp = new RegExp('^[^/]+$')
+
+export const LlmSkillsNameRetrieveParams = /* @__PURE__ */ zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+ skill_name: zod.string().regex(llmSkillsNameRetrievePathSkillNameRegExp),
+})
+
+export const LlmSkillsNameRetrieveQueryParams = /* @__PURE__ */ zod.object({
+ version: zod
+ .number()
+ .min(1)
+ .optional()
+ .describe('Specific skill version to fetch. If omitted, the latest version is returned.'),
+})
+
+export const llmSkillsNamePartialUpdatePathSkillNameRegExp = new RegExp('^[^/]+$')
+
+export const LlmSkillsNamePartialUpdateParams = /* @__PURE__ */ zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+ skill_name: zod.string().regex(llmSkillsNamePartialUpdatePathSkillNameRegExp),
+})
+
+export const llmSkillsNamePartialUpdateBodyDescriptionMax = 4096
+
+export const llmSkillsNamePartialUpdateBodyLicenseMax = 255
+
+export const llmSkillsNamePartialUpdateBodyCompatibilityMax = 500
+
+export const llmSkillsNamePartialUpdateBodyFilesItemPathMax = 500
+
+export const llmSkillsNamePartialUpdateBodyFilesItemContentTypeDefault = `text/plain`
+export const llmSkillsNamePartialUpdateBodyFilesItemContentTypeMax = 100
+
+export const llmSkillsNamePartialUpdateBodyFileEditsItemPathMax = 500
+
+export const LlmSkillsNamePartialUpdateBody = /* @__PURE__ */ zod.object({
+ body: zod
+ .string()
+ .optional()
+ .describe(
+ 'Full skill body (SKILL.md instruction content) to publish as a new version. Mutually exclusive with edits.'
+ ),
+ edits: zod
+ .array(
+ zod.object({
+ old: zod.string().describe('Text to find in the target content. Must match exactly once.'),
+ new: zod.string().describe('Replacement text.'),
+ })
+ )
+ .optional()
+ .describe(
+ "List of find/replace operations to apply to the current skill body. Each edit's 'old' text must match exactly once. Edits are applied sequentially. Mutually exclusive with body."
+ ),
+ description: zod
+ .string()
+ .max(llmSkillsNamePartialUpdateBodyDescriptionMax)
+ .optional()
+ .describe('Updated description for the new version.'),
+ license: zod
+ .string()
+ .max(llmSkillsNamePartialUpdateBodyLicenseMax)
+ .optional()
+ .describe('License name or reference.'),
+ compatibility: zod
+ .string()
+ .max(llmSkillsNamePartialUpdateBodyCompatibilityMax)
+ .optional()
+ .describe('Environment requirements.'),
+ allowed_tools: zod.array(zod.string()).optional().describe('List of pre-approved tools the skill may use.'),
+ metadata: zod.record(zod.string(), zod.unknown()).optional().describe('Arbitrary key-value metadata.'),
+ files: zod
+ .array(
+ zod.object({
+ path: zod
+ .string()
+ .max(llmSkillsNamePartialUpdateBodyFilesItemPathMax)
+ .describe("File path relative to skill root, e.g. 'scripts/setup.sh' or 'references/guide.md'."),
+ content: zod.string().describe('Text content of the file.'),
+ content_type: zod
+ .string()
+ .max(llmSkillsNamePartialUpdateBodyFilesItemContentTypeMax)
+ .default(llmSkillsNamePartialUpdateBodyFilesItemContentTypeDefault)
+ .describe('MIME type of the file content.'),
+ })
+ )
+ .optional()
+ .describe(
+ 'Bundled files to include with this version. Replaces all files from the previous version. Mutually exclusive with file_edits.'
+ ),
+ file_edits: zod
+ .array(
+ zod.object({
+ path: zod
+ .string()
+ .max(llmSkillsNamePartialUpdateBodyFileEditsItemPathMax)
+ .describe(
+ 'Path of the bundled file to edit. Must match an existing file on the current skill version.'
+ ),
+ edits: zod
+ .array(
+ zod.object({
+ old: zod.string().describe('Text to find in the target content. Must match exactly once.'),
+ new: zod.string().describe('Replacement text.'),
+ })
+ )
+ .describe("Sequential find/replace operations to apply to this file's content."),
+ })
+ )
+ .optional()
+ .describe(
+ "Per-file find/replace updates. Each entry targets one existing file by path and applies sequential edits to its content. Non-targeted files carry forward unchanged. Cannot add, remove, or rename files — use 'files' for that. Mutually exclusive with files."
+ ),
+ base_version: zod
+ .number()
+ .min(1)
+ .optional()
+ .describe('Latest version you are editing from. Used for optimistic concurrency checks.'),
+})
+
+export const llmSkillsNameArchiveCreatePathSkillNameRegExp = new RegExp('^[^/]+$')
+
+export const LlmSkillsNameArchiveCreateParams = /* @__PURE__ */ zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+ skill_name: zod.string().regex(llmSkillsNameArchiveCreatePathSkillNameRegExp),
+})
+
+export const llmSkillsNameDuplicateCreatePathSkillNameRegExp = new RegExp('^[^/]+$')
+
+export const LlmSkillsNameDuplicateCreateParams = /* @__PURE__ */ zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+ skill_name: zod.string().regex(llmSkillsNameDuplicateCreatePathSkillNameRegExp),
+})
+
+export const llmSkillsNameDuplicateCreateBodyNewNameMax = 64
+
+export const LlmSkillsNameDuplicateCreateBody = /* @__PURE__ */ zod.object({
+ new_name: zod
+ .string()
+ .max(llmSkillsNameDuplicateCreateBodyNewNameMax)
+ .describe('Name for the duplicated skill. Must be unique.'),
+})
+
+export const llmSkillsNameFilesCreatePathSkillNameRegExp = new RegExp('^[^/]+$')
+
+export const LlmSkillsNameFilesCreateParams = /* @__PURE__ */ zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+ skill_name: zod.string().regex(llmSkillsNameFilesCreatePathSkillNameRegExp),
+})
+
+export const llmSkillsNameFilesCreateBodyPathMax = 500
+
+export const llmSkillsNameFilesCreateBodyContentTypeDefault = `text/plain`
+export const llmSkillsNameFilesCreateBodyContentTypeMax = 100
+
+export const LlmSkillsNameFilesCreateBody = /* @__PURE__ */ zod.object({
+ path: zod
+ .string()
+ .max(llmSkillsNameFilesCreateBodyPathMax)
+ .describe("File path relative to skill root, e.g. 'scripts/setup.sh' or 'references/guide.md'."),
+ content: zod.string().describe('Text content of the file.'),
+ content_type: zod
+ .string()
+ .max(llmSkillsNameFilesCreateBodyContentTypeMax)
+ .default(llmSkillsNameFilesCreateBodyContentTypeDefault)
+ .describe('MIME type of the file content.'),
+ base_version: zod
+ .number()
+ .min(1)
+ .optional()
+ .describe(
+ 'Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.'
+ ),
+})
+
+export const llmSkillsNameFilesRenameCreatePathSkillNameRegExp = new RegExp('^[^/]+$')
+
+export const LlmSkillsNameFilesRenameCreateParams = /* @__PURE__ */ zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+ skill_name: zod.string().regex(llmSkillsNameFilesRenameCreatePathSkillNameRegExp),
+})
+
+export const llmSkillsNameFilesRenameCreateBodyOldPathMax = 500
+
+export const llmSkillsNameFilesRenameCreateBodyNewPathMax = 500
+
+export const LlmSkillsNameFilesRenameCreateBody = /* @__PURE__ */ zod.object({
+ old_path: zod.string().max(llmSkillsNameFilesRenameCreateBodyOldPathMax).describe('Current file path to rename.'),
+ new_path: zod
+ .string()
+ .max(llmSkillsNameFilesRenameCreateBodyNewPathMax)
+ .describe('New file path. Must not already exist in the skill.'),
+ base_version: zod
+ .number()
+ .min(1)
+ .optional()
+ .describe(
+ 'Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.'
+ ),
+})
+
+export const llmSkillsNameFilesRetrievePathFilePathRegExp = new RegExp('^.+$')
+export const llmSkillsNameFilesRetrievePathSkillNameRegExp = new RegExp('^[^/]+$')
+
+export const LlmSkillsNameFilesRetrieveParams = /* @__PURE__ */ zod.object({
+ file_path: zod.string().regex(llmSkillsNameFilesRetrievePathFilePathRegExp),
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+ skill_name: zod.string().regex(llmSkillsNameFilesRetrievePathSkillNameRegExp),
+})
+
+export const LlmSkillsNameFilesRetrieveQueryParams = /* @__PURE__ */ zod.object({
+ version: zod
+ .number()
+ .min(1)
+ .optional()
+ .describe('Specific skill version to fetch. If omitted, the latest version is returned.'),
+})
+
+export const llmSkillsNameFilesDestroyPathFilePathRegExp = new RegExp('^.+$')
+export const llmSkillsNameFilesDestroyPathSkillNameRegExp = new RegExp('^[^/]+$')
+
+export const LlmSkillsNameFilesDestroyParams = /* @__PURE__ */ zod.object({
+ file_path: zod.string().regex(llmSkillsNameFilesDestroyPathFilePathRegExp),
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+ skill_name: zod.string().regex(llmSkillsNameFilesDestroyPathSkillNameRegExp),
+})
+
+export const LlmSkillsNameFilesDestroyQueryParams = /* @__PURE__ */ zod.object({
+ base_version: zod
+ .number()
+ .min(1)
+ .optional()
+ .describe(
+ 'Latest version you are editing from. If provided, the request fails with 409 when another write has landed in the meantime.'
+ ),
+})
diff --git a/services/mcp/src/tools/generated/ai_observability.ts b/services/mcp/src/tools/generated/ai_observability.ts
index 48ea49975f41..fe229ebbc461 100644
--- a/services/mcp/src/tools/generated/ai_observability.ts
+++ b/services/mcp/src/tools/generated/ai_observability.ts
@@ -60,23 +60,6 @@ import {
LlmPromptsNamePartialUpdateParams,
LlmPromptsNameRetrieveParams,
LlmPromptsNameRetrieveQueryParams,
- LlmSkillsCreateBody,
- LlmSkillsListQueryParams,
- LlmSkillsNameArchiveCreateParams,
- LlmSkillsNameDuplicateCreateBody,
- LlmSkillsNameDuplicateCreateParams,
- LlmSkillsNameFilesCreateBody,
- LlmSkillsNameFilesCreateParams,
- LlmSkillsNameFilesDestroyParams,
- LlmSkillsNameFilesDestroyQueryParams,
- LlmSkillsNameFilesRenameCreateBody,
- LlmSkillsNameFilesRenameCreateParams,
- LlmSkillsNameFilesRetrieveParams,
- LlmSkillsNameFilesRetrieveQueryParams,
- LlmSkillsNamePartialUpdateBody,
- LlmSkillsNamePartialUpdateParams,
- LlmSkillsNameRetrieveParams,
- LlmSkillsNameRetrieveQueryParams,
TaggersCreateBody,
TaggersListQueryParams,
TaggersTestHogCreateBody,
@@ -1168,277 +1151,6 @@ const llmaSentimentCreate = (): ToolBase<typeof LlmaSentimentCreateSchema, Schem
},
})
-const LlmaSkillArchiveSchema = LlmSkillsNameArchiveCreateParams.omit({ project_id: true }).extend({
- skill_name: LlmSkillsNameArchiveCreateParams.shape['skill_name'].describe(
- 'The kebab-case name of the skill to archive.'
- ),
-})
-
-const llmaSkillArchive = (): ToolBase<typeof LlmaSkillArchiveSchema, unknown> => ({
- name: 'llma-skill-archive',
- schema: LlmaSkillArchiveSchema,
- handler: async (context: Context, params: z.infer<typeof LlmaSkillArchiveSchema>) => {
- const projectId = await context.stateManager.getProjectId()
- const result = await context.api.request<unknown>({
- method: 'POST',
- path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/archive/`,
- })
- return result
- },
-})
-
-const LlmaSkillCreateSchema = LlmSkillsCreateBody
-
-const llmaSkillCreate = (): ToolBase<typeof LlmaSkillCreateSchema, Schemas.LLMSkillCreate> => ({
- name: 'llma-skill-create',
- schema: LlmaSkillCreateSchema,
- handler: async (context: Context, params: z.infer<typeof LlmaSkillCreateSchema>) => {
- const projectId = await context.stateManager.getProjectId()
- const body: Record<string, unknown> = {}
- if (params.name !== undefined) {
- body['name'] = params.name
- }
- if (params.description !== undefined) {
- body['description'] = params.description
- }
- if (params.body !== undefined) {
- body['body'] = params.body
- }
- if (params.license !== undefined) {
- body['license'] = params.license
- }
- if (params.compatibility !== undefined) {
- body['compatibility'] = params.compatibility
- }
- if (params.allowed_tools !== undefined) {
- body['allowed_tools'] = params.allowed_tools
- }
- if (params.metadata !== undefined) {
- body['metadata'] = params.metadata
- }
- if (params.files !== undefined) {
- body['files'] = params.files
- }
- const result = await context.api.request<Schemas.LLMSkillCreate>({
- method: 'POST',
- path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/`,
- body,
- })
- return result
- },
-})
-
-const LlmaSkillDuplicateSchema = LlmSkillsNameDuplicateCreateParams.omit({ project_id: true }).extend(
- LlmSkillsNameDuplicateCreateBody.shape
-)
-
-const llmaSkillDuplicate = (): ToolBase<typeof LlmaSkillDuplicateSchema, Schemas.LLMSkill> => ({
- name: 'llma-skill-duplicate',
- schema: LlmaSkillDuplicateSchema,
- handler: async (context: Context, params: z.infer<typeof LlmaSkillDuplicateSchema>) => {
- const projectId = await context.stateManager.getProjectId()
- const body: Record<string, unknown> = {}
- if (params.new_name !== undefined) {
- body['new_name'] = params.new_name
- }
- const result = await context.api.request<Schemas.LLMSkill>({
- method: 'POST',
- path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/duplicate/`,
- body,
- })
- return result
- },
-})
-
-const LlmaSkillFileCreateSchema = LlmSkillsNameFilesCreateParams.omit({ project_id: true }).extend(
- LlmSkillsNameFilesCreateBody.shape
-)
-
-const llmaSkillFileCreate = (): ToolBase<typeof LlmaSkillFileCreateSchema, Schemas.LLMSkill> => ({
- name: 'llma-skill-file-create',
- schema: LlmaSkillFileCreateSchema,
- handler: async (context: Context, params: z.infer<typeof LlmaSkillFileCreateSchema>) => {
- const projectId = await context.stateManager.getProjectId()
- const body: Record<string, unknown> = {}
- if (params.path !== undefined) {
- body['path'] = params.path
- }
- if (params.content !== undefined) {
- body['content'] = params.content
- }
- if (params.content_type !== undefined) {
- body['content_type'] = params.content_type
- }
- if (params.base_version !== undefined) {
- body['base_version'] = params.base_version
- }
- const result = await context.api.request<Schemas.LLMSkill>({
- method: 'POST',
- path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/files/`,
- body,
- })
- return result
- },
-})
-
-const LlmaSkillFileDeleteSchema = LlmSkillsNameFilesDestroyParams.omit({ project_id: true }).extend(
- LlmSkillsNameFilesDestroyQueryParams.shape
-)
-
-const llmaSkillFileDelete = (): ToolBase<typeof LlmaSkillFileDeleteSchema, Schemas.LLMSkill> => ({
- name: 'llma-skill-file-delete',
- schema: LlmaSkillFileDeleteSchema,
- handler: async (context: Context, params: z.infer<typeof LlmaSkillFileDeleteSchema>) => {
- const projectId = await context.stateManager.getProjectId()
- const result = await context.api.request<Schemas.LLMSkill>({
- method: 'DELETE',
- path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/files/${encodeURIComponent(String(params.file_path))}/`,
- query: {
- base_version: params.base_version,
- },
- })
- return result
- },
-})
-
-const LlmaSkillFileGetSchema = LlmSkillsNameFilesRetrieveParams.omit({ project_id: true }).extend(
- LlmSkillsNameFilesRetrieveQueryParams.shape
-)
-
-const llmaSkillFileGet = (): ToolBase<typeof LlmaSkillFileGetSchema, Schemas.LLMSkillFile> => ({
- name: 'llma-skill-file-get',
- schema: LlmaSkillFileGetSchema,
- handler: async (context: Context, params: z.infer<typeof LlmaSkillFileGetSchema>) => {
- const projectId = await context.stateManager.getProjectId()
- const result = await context.api.request<Schemas.LLMSkillFile>({
- method: 'GET',
- path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/files/${encodeURIComponent(String(params.file_path))}/`,
- query: {
- version: params.version,
- },
- })
- return result
- },
-})
-
-const LlmaSkillFileRenameSchema = LlmSkillsNameFilesRenameCreateParams.omit({ project_id: true }).extend(
- LlmSkillsNameFilesRenameCreateBody.shape
-)
-
-const llmaSkillFileRename = (): ToolBase<typeof LlmaSkillFileRenameSchema, Schemas.LLMSkill> => ({
- name: 'llma-skill-file-rename',
- schema: LlmaSkillFileRenameSchema,
- handler: async (context: Context, params: z.infer<typeof LlmaSkillFileRenameSchema>) => {
- const projectId = await context.stateManager.getProjectId()
- const body: Record<string, unknown> = {}
- if (params.old_path !== undefined) {
- body['old_path'] = params.old_path
- }
- if (params.new_path !== undefined) {
- body['new_path'] = params.new_path
- }
- if (params.base_version !== undefined) {
- body['base_version'] = params.base_version
- }
- const result = await context.api.request<Schemas.LLMSkill>({
- method: 'POST',
- path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/files-rename/`,
- body,
- })
- return result
- },
-})
-
-const LlmaSkillGetSchema = LlmSkillsNameRetrieveParams.omit({ project_id: true }).extend(
- LlmSkillsNameRetrieveQueryParams.shape
-)
-
-const llmaSkillGet = (): ToolBase<typeof LlmaSkillGetSchema, Schemas.LLMSkill> => ({
- name: 'llma-skill-get',
- schema: LlmaSkillGetSchema,
- handler: async (context: Context, params: z.infer<typeof LlmaSkillGetSchema>) => {
- const projectId = await context.stateManager.getProjectId()
- const result = await context.api.request<Schemas.LLMSkill>({
- method: 'GET',
- path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/`,
- query: {
- version: params.version,
- },
- })
- return result
- },
-})
-
-const LlmaSkillListSchema = LlmSkillsListQueryParams
-
-const llmaSkillList = (): ToolBase<typeof LlmaSkillListSchema, Schemas.PaginatedLLMSkillListList> => ({
- name: 'llma-skill-list',
- schema: LlmaSkillListSchema,
- handler: async (context: Context, params: z.infer<typeof LlmaSkillListSchema>) => {
- const projectId = await context.stateManager.getProjectId()
- const result = await context.api.request<Schemas.PaginatedLLMSkillListList>({
- method: 'GET',
- path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/`,
- query: {
- created_by_id: params.created_by_id,
- limit: params.limit,
- offset: params.offset,
- search: params.search,
- },
- })
- return result
- },
-})
-
-const LlmaSkillUpdateSchema = LlmSkillsNamePartialUpdateParams.omit({ project_id: true }).extend(
- LlmSkillsNamePartialUpdateBody.shape
-)
-
-const llmaSkillUpdate = (): ToolBase<typeof LlmaSkillUpdateSchema, Schemas.LLMSkill> => ({
- name: 'llma-skill-update',
- schema: LlmaSkillUpdateSchema,
- handler: async (context: Context, params: z.infer<typeof LlmaSkillUpdateSchema>) => {
- const projectId = await context.stateManager.getProjectId()
- const body: Record<string, unknown> = {}
- if (params.body !== undefined) {
- body['body'] = params.body
- }
- if (params.edits !== undefined) {
- body['edits'] = params.edits
- }
- if (params.description !== undefined) {
- body['description'] = params.description
- }
- if (params.license !== undefined) {
- body['license'] = params.license
- }
- if (params.compatibility !== undefined) {
- body['compatibility'] = params.compatibility
- }
- if (params.allowed_tools !== undefined) {
- body['allowed_tools'] = params.allowed_tools
- }
- if (params.metadata !== undefined) {
- body['metadata'] = params.metadata
- }
- if (params.files !== undefined) {
- body['files'] = params.files
- }
- if (params.file_edits !== undefined) {
- body['file_edits'] = params.file_edits
- }
- if (params.base_version !== undefined) {
- body['base_version'] = params.base_version
- }
- const result = await context.api.request<Schemas.LLMSkill>({
- method: 'PATCH',
- path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/`,
- body,
- })
- return result
- },
-})
-
const LlmaSummarizationCreateSchema = LlmAnalyticsSummarizationCreateBody
const llmaSummarizationCreate = (): ToolBase<typeof LlmaSummarizationCreateSchema, Schemas.SummarizeResponse> => ({
@@ -1757,16 +1469,6 @@ export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {
'llma-score-definition-new-version': llmaScoreDefinitionNewVersion,
'llma-score-definition-update': llmaScoreDefinitionUpdate,
'llma-sentiment-create': llmaSentimentCreate,
- 'llma-skill-archive': llmaSkillArchive,
- 'llma-skill-create': llmaSkillCreate,
- 'llma-skill-duplicate': llmaSkillDuplicate,
- 'llma-skill-file-create': llmaSkillFileCreate,
- 'llma-skill-file-delete': llmaSkillFileDelete,
- 'llma-skill-file-get': llmaSkillFileGet,
- 'llma-skill-file-rename': llmaSkillFileRename,
- 'llma-skill-get': llmaSkillGet,
- 'llma-skill-list': llmaSkillList,
- 'llma-skill-update': llmaSkillUpdate,
'llma-summarization-create': llmaSummarizationCreate,
'llma-tagger-create': llmaTaggerCreate,
'llma-tagger-list': llmaTaggerList,
diff --git a/services/mcp/src/tools/generated/index.ts b/services/mcp/src/tools/generated/index.ts
index e928a709fd2a..1215e88ada98 100644
--- a/services/mcp/src/tools/generated/index.ts
+++ b/services/mcp/src/tools/generated/index.ts
@@ -37,6 +37,7 @@ import { GENERATED_TOOLS as queryWrappers } from './query-wrappers'
import { GENERATED_TOOLS as replay } from './replay'
import { GENERATED_TOOLS as replay_vision } from './replay_vision'
import { GENERATED_TOOLS as signals } from './signals'
+import { GENERATED_TOOLS as skills } from './skills'
import { GENERATED_TOOLS as subscriptions } from './subscriptions'
import { GENERATED_TOOLS as surveys } from './surveys'
import { GENERATED_TOOLS as tasks } from './tasks'
@@ -83,6 +84,7 @@ export const GENERATED_TOOL_MAP: Record<string, () => ToolBase<ZodObjectAny>> =
...replay,
...replay_vision,
...signals,
+ ...skills,
...subscriptions,
...surveys,
...tasks,
diff --git a/services/mcp/src/tools/generated/skills.ts b/services/mcp/src/tools/generated/skills.ts
new file mode 100644
index 000000000000..06957316d85e
--- /dev/null
+++ b/services/mcp/src/tools/generated/skills.ts
@@ -0,0 +1,308 @@
+// AUTO-GENERATED from products/skills/mcp/tools.yaml + OpenAPI — do not edit
+import { z } from 'zod'
+
+import type { Schemas } from '@/api/generated'
+import {
+ LlmSkillsCreateBody,
+ LlmSkillsListQueryParams,
+ LlmSkillsNameArchiveCreateParams,
+ LlmSkillsNameDuplicateCreateBody,
+ LlmSkillsNameDuplicateCreateParams,
+ LlmSkillsNameFilesCreateBody,
+ LlmSkillsNameFilesCreateParams,
+ LlmSkillsNameFilesDestroyParams,
+ LlmSkillsNameFilesDestroyQueryParams,
+ LlmSkillsNameFilesRenameCreateBody,
+ LlmSkillsNameFilesRenameCreateParams,
+ LlmSkillsNameFilesRetrieveParams,
+ LlmSkillsNameFilesRetrieveQueryParams,
+ LlmSkillsNamePartialUpdateBody,
+ LlmSkillsNamePartialUpdateParams,
+ LlmSkillsNameRetrieveParams,
+ LlmSkillsNameRetrieveQueryParams,
+} from '@/generated/skills/api'
+import type { Context, ToolBase, ZodObjectAny } from '@/tools/types'
+
+const LlmaSkillArchiveSchema = LlmSkillsNameArchiveCreateParams.omit({ project_id: true }).extend({
+ skill_name: LlmSkillsNameArchiveCreateParams.shape['skill_name'].describe(
+ 'The kebab-case name of the skill to archive.'
+ ),
+})
+
+const llmaSkillArchive = (): ToolBase<typeof LlmaSkillArchiveSchema, unknown> => ({
+ name: 'llma-skill-archive',
+ schema: LlmaSkillArchiveSchema,
+ handler: async (context: Context, params: z.infer<typeof LlmaSkillArchiveSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const result = await context.api.request<unknown>({
+ method: 'POST',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/archive/`,
+ })
+ return result
+ },
+})
+
+const LlmaSkillCreateSchema = LlmSkillsCreateBody
+
+const llmaSkillCreate = (): ToolBase<typeof LlmaSkillCreateSchema, Schemas.LLMSkillCreate> => ({
+ name: 'llma-skill-create',
+ schema: LlmaSkillCreateSchema,
+ handler: async (context: Context, params: z.infer<typeof LlmaSkillCreateSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const body: Record<string, unknown> = {}
+ if (params.name !== undefined) {
+ body['name'] = params.name
+ }
+ if (params.description !== undefined) {
+ body['description'] = params.description
+ }
+ if (params.body !== undefined) {
+ body['body'] = params.body
+ }
+ if (params.license !== undefined) {
+ body['license'] = params.license
+ }
+ if (params.compatibility !== undefined) {
+ body['compatibility'] = params.compatibility
+ }
+ if (params.allowed_tools !== undefined) {
+ body['allowed_tools'] = params.allowed_tools
+ }
+ if (params.metadata !== undefined) {
+ body['metadata'] = params.metadata
+ }
+ if (params.files !== undefined) {
+ body['files'] = params.files
+ }
+ const result = await context.api.request<Schemas.LLMSkillCreate>({
+ method: 'POST',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/`,
+ body,
+ })
+ return result
+ },
+})
+
+const LlmaSkillDuplicateSchema = LlmSkillsNameDuplicateCreateParams.omit({ project_id: true }).extend(
+ LlmSkillsNameDuplicateCreateBody.shape
+)
+
+const llmaSkillDuplicate = (): ToolBase<typeof LlmaSkillDuplicateSchema, Schemas.LLMSkill> => ({
+ name: 'llma-skill-duplicate',
+ schema: LlmaSkillDuplicateSchema,
+ handler: async (context: Context, params: z.infer<typeof LlmaSkillDuplicateSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const body: Record<string, unknown> = {}
+ if (params.new_name !== undefined) {
+ body['new_name'] = params.new_name
+ }
+ const result = await context.api.request<Schemas.LLMSkill>({
+ method: 'POST',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/duplicate/`,
+ body,
+ })
+ return result
+ },
+})
+
+const LlmaSkillFileCreateSchema = LlmSkillsNameFilesCreateParams.omit({ project_id: true }).extend(
+ LlmSkillsNameFilesCreateBody.shape
+)
+
+const llmaSkillFileCreate = (): ToolBase<typeof LlmaSkillFileCreateSchema, Schemas.LLMSkill> => ({
+ name: 'llma-skill-file-create',
+ schema: LlmaSkillFileCreateSchema,
+ handler: async (context: Context, params: z.infer<typeof LlmaSkillFileCreateSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const body: Record<string, unknown> = {}
+ if (params.path !== undefined) {
+ body['path'] = params.path
+ }
+ if (params.content !== undefined) {
+ body['content'] = params.content
+ }
+ if (params.content_type !== undefined) {
+ body['content_type'] = params.content_type
+ }
+ if (params.base_version !== undefined) {
+ body['base_version'] = params.base_version
+ }
+ const result = await context.api.request<Schemas.LLMSkill>({
+ method: 'POST',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/files/`,
+ body,
+ })
+ return result
+ },
+})
+
+const LlmaSkillFileDeleteSchema = LlmSkillsNameFilesDestroyParams.omit({ project_id: true }).extend(
+ LlmSkillsNameFilesDestroyQueryParams.shape
+)
+
+const llmaSkillFileDelete = (): ToolBase<typeof LlmaSkillFileDeleteSchema, Schemas.LLMSkill> => ({
+ name: 'llma-skill-file-delete',
+ schema: LlmaSkillFileDeleteSchema,
+ handler: async (context: Context, params: z.infer<typeof LlmaSkillFileDeleteSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const result = await context.api.request<Schemas.LLMSkill>({
+ method: 'DELETE',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/files/${encodeURIComponent(String(params.file_path))}/`,
+ query: {
+ base_version: params.base_version,
+ },
+ })
+ return result
+ },
+})
+
+const LlmaSkillFileGetSchema = LlmSkillsNameFilesRetrieveParams.omit({ project_id: true }).extend(
+ LlmSkillsNameFilesRetrieveQueryParams.shape
+)
+
+const llmaSkillFileGet = (): ToolBase<typeof LlmaSkillFileGetSchema, Schemas.LLMSkillFile> => ({
+ name: 'llma-skill-file-get',
+ schema: LlmaSkillFileGetSchema,
+ handler: async (context: Context, params: z.infer<typeof LlmaSkillFileGetSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const result = await context.api.request<Schemas.LLMSkillFile>({
+ method: 'GET',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/files/${encodeURIComponent(String(params.file_path))}/`,
+ query: {
+ version: params.version,
+ },
+ })
+ return result
+ },
+})
+
+const LlmaSkillFileRenameSchema = LlmSkillsNameFilesRenameCreateParams.omit({ project_id: true }).extend(
+ LlmSkillsNameFilesRenameCreateBody.shape
+)
+
+const llmaSkillFileRename = (): ToolBase<typeof LlmaSkillFileRenameSchema, Schemas.LLMSkill> => ({
+ name: 'llma-skill-file-rename',
+ schema: LlmaSkillFileRenameSchema,
+ handler: async (context: Context, params: z.infer<typeof LlmaSkillFileRenameSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const body: Record<string, unknown> = {}
+ if (params.old_path !== undefined) {
+ body['old_path'] = params.old_path
+ }
+ if (params.new_path !== undefined) {
+ body['new_path'] = params.new_path
+ }
+ if (params.base_version !== undefined) {
+ body['base_version'] = params.base_version
+ }
+ const result = await context.api.request<Schemas.LLMSkill>({
+ method: 'POST',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/files-rename/`,
+ body,
+ })
+ return result
+ },
+})
+
+const LlmaSkillGetSchema = LlmSkillsNameRetrieveParams.omit({ project_id: true }).extend(
+ LlmSkillsNameRetrieveQueryParams.shape
+)
+
+const llmaSkillGet = (): ToolBase<typeof LlmaSkillGetSchema, Schemas.LLMSkill> => ({
+ name: 'llma-skill-get',
+ schema: LlmaSkillGetSchema,
+ handler: async (context: Context, params: z.infer<typeof LlmaSkillGetSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const result = await context.api.request<Schemas.LLMSkill>({
+ method: 'GET',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/`,
+ query: {
+ version: params.version,
+ },
+ })
+ return result
+ },
+})
+
+const LlmaSkillListSchema = LlmSkillsListQueryParams
+
+const llmaSkillList = (): ToolBase<typeof LlmaSkillListSchema, Schemas.PaginatedLLMSkillListList> => ({
+ name: 'llma-skill-list',
+ schema: LlmaSkillListSchema,
+ handler: async (context: Context, params: z.infer<typeof LlmaSkillListSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const result = await context.api.request<Schemas.PaginatedLLMSkillListList>({
+ method: 'GET',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/`,
+ query: {
+ created_by_id: params.created_by_id,
+ limit: params.limit,
+ offset: params.offset,
+ search: params.search,
+ },
+ })
+ return result
+ },
+})
+
+const LlmaSkillUpdateSchema = LlmSkillsNamePartialUpdateParams.omit({ project_id: true }).extend(
+ LlmSkillsNamePartialUpdateBody.shape
+)
+
+const llmaSkillUpdate = (): ToolBase<typeof LlmaSkillUpdateSchema, Schemas.LLMSkill> => ({
+ name: 'llma-skill-update',
+ schema: LlmaSkillUpdateSchema,
+ handler: async (context: Context, params: z.infer<typeof LlmaSkillUpdateSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const body: Record<string, unknown> = {}
+ if (params.body !== undefined) {
+ body['body'] = params.body
+ }
+ if (params.edits !== undefined) {
+ body['edits'] = params.edits
+ }
+ if (params.description !== undefined) {
+ body['description'] = params.description
+ }
+ if (params.license !== undefined) {
+ body['license'] = params.license
+ }
+ if (params.compatibility !== undefined) {
+ body['compatibility'] = params.compatibility
+ }
+ if (params.allowed_tools !== undefined) {
+ body['allowed_tools'] = params.allowed_tools
+ }
+ if (params.metadata !== undefined) {
+ body['metadata'] = params.metadata
+ }
+ if (params.files !== undefined) {
+ body['files'] = params.files
+ }
+ if (params.file_edits !== undefined) {
+ body['file_edits'] = params.file_edits
+ }
+ if (params.base_version !== undefined) {
+ body['base_version'] = params.base_version
+ }
+ const result = await context.api.request<Schemas.LLMSkill>({
+ method: 'PATCH',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/llm_skills/name/${encodeURIComponent(String(params.skill_name))}/`,
+ body,
+ })
+ return result
+ },
+})
+
+export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {
+ 'llma-skill-archive': llmaSkillArchive,
+ 'llma-skill-create': llmaSkillCreate,
+ 'llma-skill-duplicate': llmaSkillDuplicate,
+ 'llma-skill-file-create': llmaSkillFileCreate,
+ 'llma-skill-file-delete': llmaSkillFileDelete,
+ 'llma-skill-file-get': llmaSkillFileGet,
+ 'llma-skill-file-rename': llmaSkillFileRename,
+ 'llma-skill-get': llmaSkillGet,
+ 'llma-skill-list': llmaSkillList,
+ 'llma-skill-update': llmaSkillUpdate,
+}
diff --git a/services/mcp/tests/unit/skills-generated.test.ts b/services/mcp/tests/unit/skills-generated.test.ts
index 894cdf716f01..faf707f11baa 100644
--- a/services/mcp/tests/unit/skills-generated.test.ts
+++ b/services/mcp/tests/unit/skills-generated.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, it, vi } from 'vitest'
import { getToolByName } from '@/shared/test-utils'
-import { GENERATED_TOOLS } from '@/tools/generated/ai_observability'
+import { GENERATED_TOOLS } from '@/tools/generated/skills'
import type { Context } from '@/tools/types'
function createContext(requestReturnValue: unknown): { context: Context; requestMock: ReturnType<typeof vi.fn> } {
diff --git a/tach.toml b/tach.toml
index bb89eae08833..fe4da3c14306 100644
--- a/tach.toml
+++ b/tach.toml
@@ -53,6 +53,7 @@ depends_on = [
"products.product_analytics",
"products.replay",
"products.replay_vision",
+ "products.skills",
"products.revenue_analytics",
"products.surveys",
"products.tasks",
@@ -519,6 +520,7 @@ depends_on = [
"products.feature_flags",
"products.notebooks",
"products.product_analytics",
+ "products.skills",
"products.surveys",
"products.tasks",
"products.warehouse_sources",
@@ -526,6 +528,17 @@ depends_on = [
]
layer = "modules"
+[[modules]]
+# Skills imports ai_observability's shared markdown_outline + API metrics helpers —
+# temporary coupling from the standalone-product extraction, slated for cleanup.
+path = "products.skills"
+depends_on = [
+ "ee",
+ "posthog",
+ "products.ai_observability",
+]
+layer = "modules"
+
[[modules]]
path = "products.slack_app"
depends_on = [