🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
feat(skills): simplify CLI install and import setup (#19128)
tobi_klf836391186c9
diff --git a/web/src/features/skills/components/CliSetupAccordion.tsx b/web/src/features/skills/components/CliSetupAccordion.tsxnew file mode 100644index 0000000000..b1e501c785--- /dev/null+++ b/web/src/features/skills/components/CliSetupAccordion.tsx@@ -0,0 +1,62 @@+import { type ReactNode } from "react";+import { Accordion } from "@/src/components/design-system/Accordion/Accordion";+import { Button } from "@/src/components/design-system/Button/Button";+import { Codeblock } from "@/src/components/design-system/Codeblock/Codeblock";+import { shellQuote } from "../utils/shellQuote";++export function CliSetupAccordion({+ projectId,+ host,+ children,+}: {+ projectId: string;+ host: string;+ children: ReactNode;+}) {+ return (+ <Accordion type="single" collapsible>+ <Accordion.Item value="setup">+ <Accordion.Trigger size="sm">First-time CLI setup</Accordion.Trigger>+ <Accordion.Content>+ <div className="flex flex-col items-start gap-3 py-3">+ <p className="text-muted-foreground">+ Requires Node.js 20+. Run in your project directory.+ </p>+ <Codeblock+ language="bash"+ value="npm install -g @langfuse/cli@beta"+ variant="read-only"+ />+ <p className="text-muted-foreground">+ Replace the placeholders with your project’s API keys. These+ settings apply to your current terminal session.+ </p>+ <Button+ text="Get project API keys"+ href={`/project/${projectId}/settings/api-keys`}+ variant="secondary"+ size="sm"+ />+ <div className="ph-no-capture w-full">+ <Codeblock+ language="bash"+ value={`export LANGFUSE_PUBLIC_KEY='pk-lf-...'\nexport LANGFUSE_SECRET_KEY='sk-lf-...'\nexport LANGFUSE_HOST=${shellQuote(host)}`}+ variant="read-only"+ />+ </div>+ <p className="text-muted-foreground text-xs">+ If LANGFUSE_BASE_URL is already set, use the same host. The CLI is+ in beta.+ </p>+ </div>+ </Accordion.Content>+ </Accordion.Item>+ <Accordion.Item value="updates">+ <Accordion.Trigger size="sm">Updating later</Accordion.Trigger>+ <Accordion.Content>+ <div className="flex flex-col gap-3 py-3">{children}</div>+ </Accordion.Content>+ </Accordion.Item>+ </Accordion>+ );+}diff --git a/web/src/features/skills/components/CliSkillImportInstructions.stories.tsx b/web/src/features/skills/components/CliSkillImportInstructions.stories.tsxnew file mode 100644index 0000000000..97373b3cb2--- /dev/null+++ b/web/src/features/skills/components/CliSkillImportInstructions.stories.tsx@@ -0,0 +1,81 @@+import { expect, spyOn, userEvent, within } from "storybook/test";+import preview from "../../../../.storybook/preview";+import { CliSkillImportInstructions } from "./CliSkillImportInstructions";++const meta = preview.meta({+ component: CliSkillImportInstructions,+ args: {+ projectId: "project",+ host: "https://cloud.langfuse.com",+ },+});++export const Default = meta.story({});++export const ImportScopes = meta.story({+ name: "(Test) Switch import scope and copy prompt",+ play: async ({ args, canvasElement }) => {+ const canvas = within(canvasElement);+ const writeText = spyOn(+ navigator.clipboard,+ "writeText",+ ).mockResolvedValue();+ try {+ const recursiveCommand =+ "langfuse skills push '.agents/skills' --recursive";+ await expect(canvas.getByText(recursiveCommand)).toBeVisible();+ const configure = canvas.getByRole("button", {+ name: "Configure import command",+ });+ await expect(configure).toHaveAttribute("aria-expanded", "false");+ await userEvent.click(configure);+ await userEvent.click(canvas.getByRole("tab", { name: "Single skill" }));+ await userEvent.clear(canvas.getByLabelText("Skill folder"));+ await userEvent.type(+ canvas.getByLabelText("Skill folder"),+ "team's skills/review-code",+ );+ const singleCommand = `langfuse skills push 'team'"'"'s skills/review-code'`;+ await expect(canvas.getByText(singleCommand)).toBeVisible();+ await userEvent.click(+ canvas.getByRole("button", { name: "Copy prompt" }),+ );+ await expect(writeText).toHaveBeenLastCalledWith(+ expect.stringContaining(singleCommand),+ );+ await expect(writeText).toHaveBeenLastCalledWith(+ expect.stringContaining(`Langfuse host: ${JSON.stringify(args.host)}`),+ );+ await userEvent.click(canvas.getByRole("tab", { name: "All skills" }));+ await expect(canvas.getByText(recursiveCommand)).toBeVisible();+ await userEvent.click(canvas.getByRole("tab", { name: "Single skill" }));+ await expect(canvas.getByLabelText("Skill folder")).toHaveValue(+ "team's skills/review-code",+ );+ await expect(canvas.getByText(singleCommand)).toBeVisible();+ } finally {+ writeText.mockRestore();+ }+ },+});++export const EmptyPath = meta.story({+ name: "(Test) Reject blank folder path",+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);+ await userEvent.click(+ canvas.getByRole("button", { name: "Configure import command" }),+ );+ await userEvent.clear(canvas.getByLabelText("Skills directory"));+ await userEvent.type(canvas.getByLabelText("Skills directory"), " ");+ await expect(canvas.getByRole("alert")).toHaveTextContent(+ "Enter a folder path",+ );+ await expect(+ canvas.queryByRole("button", { name: "Copy prompt" }),+ ).not.toBeInTheDocument();+ await expect(+ canvas.queryByText(/langfuse skills push/),+ ).not.toBeInTheDocument();+ },+});diff --git a/web/src/features/skills/components/CliSkillImportInstructions.tsx b/web/src/features/skills/components/CliSkillImportInstructions.tsxindex 90ab5837c8..761adba1da 100644--- a/web/src/features/skills/components/CliSkillImportInstructions.tsx+++ b/web/src/features/skills/components/CliSkillImportInstructions.tsx@@ -1,61 +1,101 @@-import { Button } from "@/src/components/design-system/Button/Button";-import { Codeblock } from "@/src/components/design-system/Codeblock/Codeblock";-import { useLangfuseBaseUrl } from "@/src/features/public-api/hooks/useLangfuseEnvCode";+import { useId, useState, type ChangeEvent } from "react";+import { Accordion } from "@/src/components/design-system/Accordion/Accordion";+import { Input } from "@/src/components/design-system/Input/Input";+import { Tabs } from "@/src/components/design-system/Tabs/Tabs";+import { CopyAgentPromptPanel } from "./CopyAgentPromptPanel";+import { CliSetupAccordion } from "./CliSetupAccordion";import { shellQuote } from "../utils/shellQuote";export function CliSkillImportInstructions({projectId,+ host,}: {projectId: string;+ host: string;}) {- const host = useLangfuseBaseUrl();+ const id = useId();+ const [scope, setScope] = useState("all");+ const [directory, setDirectory] = useState(".agents/skills");+ const [skillPath, setSkillPath] = useState(".agents/skills/my-skill");+ const path = (scope === "all" ? directory : skillPath).trim();+ const command = `langfuse skills push ${shellQuote(path)}${scope === "all" ? " --recursive" : ""}`;+ const prompt = `Import these local skills into Langfuse.++Follow the CLI setup and authentication guidance:+https://github.com/langfuse/langfuse-cli+Use @langfuse/cli@beta for skill import.++Langfuse host: ${JSON.stringify(host)}++Run from the repository root:+${command}++Use local project credentials. If missing, ask me to configure them locally; never paste secrets into chat or commit them.++Check the selected folder contains the intended SKILL.md files before pushing. The name in each SKILL.md identifies the skill in Langfuse. This creates new skills or publishes new versions when files change. Verify the imported skills in Langfuse.`;++ const handlePathChange = (event: ChangeEvent<HTMLInputElement>) => {+ if (scope === "all") setDirectory(event.target.value);+ else setSkillPath(event.target.value);+ };return (- <div className="flex flex-col gap-4">- <p>- Push skills from your local project to Langfuse. Requires Node.js 20 or- later. The Langfuse CLI is in beta.+ <div className="ph-no-capture flex flex-col gap-4">+ <p className="text-muted-foreground">+ Choose what to import, then let your coding agent handle setup or run+ the command yourself.</p>- <div className="flex flex-col gap-2">- <h3 className="font-bold">1. Install or update the CLI</h3>- <Codeblock language="bash" value="npm install -g @langfuse/cli@beta" />+ <div className="flex flex-col gap-3">+ <Accordion type="single" collapsible>+ <Accordion.Item value="configuration">+ <Accordion.Trigger size="sm">+ Configure import command+ </Accordion.Trigger>+ <Accordion.Content>+ <div className="flex flex-col gap-3 py-3">+ <Tabs value={scope} onValueChange={setScope}>+ <Tabs.List+ aria-label="Import scope"+ variant="inset"+ size="md"+ >+ <Tabs.Trigger value="all" label="All skills" />+ <Tabs.Trigger value="single" label="Single skill" />+ </Tabs.List>+ </Tabs>+ <div className="flex flex-col gap-2">+ <label+ className="text-muted-foreground text-xs"+ htmlFor={`${id}-path`}+ >+ {scope === "all" ? "Skills directory" : "Skill folder"}+ </label>+ <Input+ id={`${id}-path`}+ value={scope === "all" ? directory : skillPath}+ onChange={handlePathChange}+ aria-invalid={!path}+ />+ </div>+ </div>+ </Accordion.Content>+ </Accordion.Item>+ </Accordion>+ {!path ? (+ <p role="alert" className="text-destructive">+ Enter a folder path to generate the import command.+ </p>+ ) : (+ <CopyAgentPromptPanel prompt={prompt} command={command} />+ )}</div>- <div className="flex flex-col items-start gap-2">- <h3 className="font-bold">2. Configure your project</h3>+ <CliSetupAccordion projectId={projectId} host={host}><p className="text-muted-foreground">- Replace the placeholders with this project’s API keys. These exports- configure your current terminal session. If you already set{" "}- <code>LANGFUSE_BASE_URL</code>, update it to the same host.+ Run the same import command after editing your local skills. The name+ in SKILL.md identifies each skill in Langfuse. Changed files publish a+ new version; new names create new skills.</p>- <Button- text="Get project API keys"- href={`/project/${projectId}/settings/api-keys`}- variant="secondary"- size="sm"- />- <div className="ph-no-capture w-full">- <Codeblock- language="bash"- value={`export LANGFUSE_PUBLIC_KEY='pk-lf-...'\nexport LANGFUSE_SECRET_KEY='sk-lf-...'\nexport LANGFUSE_HOST=${shellQuote(host)}`}- />- </div>- </div>- <div className="flex flex-col gap-2">- <h3 className="font-bold">3. Import skills</h3>- <p className="text-muted-foreground">- Run from your local project directory. Replace the example path with a- skill folder containing SKILL.md, or push all skills under a- directory. The name in SKILL.md identifies the skill in Langfuse.- </p>- <Codeblock- language="bash"- value={`# Push one skill\nlangfuse skills push .agents/skills/my-skill\n\n# Push all skills in a directory\nlangfuse skills push .agents/skills --recursive`}- />- <p className="text-muted-foreground text-xs">- Creates new skills or publishes a new version of existing skills when- their files change.- </p>- </div>+ </CliSetupAccordion></div>);}diff --git a/web/src/features/skills/components/CopyAgentPromptPanel.tsx b/web/src/features/skills/components/CopyAgentPromptPanel.tsxnew file mode 100644index 0000000000..b4c5dc0925--- /dev/null+++ b/web/src/features/skills/components/CopyAgentPromptPanel.tsx@@ -0,0 +1,52 @@+import { useState } from "react";+import { Button } from "@/src/components/design-system/Button/Button";+import { Codeblock } from "@/src/components/design-system/Codeblock/Codeblock";+import { useCopyToClipboard } from "@/src/hooks/useCopyToClipboard";++export function CopyAgentPromptPanel({+ prompt,+ command,+}: {+ prompt: string;+ command: string;+}) {+ const { copy, isCopied } = useCopyToClipboard();+ const [copyError, setCopyError] = useState(false);+ const handleCopyPrompt = async () => {+ setCopyError(false);+ try {+ await copy(prompt);+ } catch {+ setCopyError(true);+ }+ };++ return (+ <div className="ph-no-capture flex flex-col gap-3">+ <div className="bg-muted/30 flex flex-wrap items-center justify-between gap-3 rounded-md border p-3">+ <div className="flex flex-col gap-1">+ <h3 className="font-bold">Set up with your coding agent</h3>+ <p className="text-muted-foreground text-xs">+ Paste this prompt into Claude, Cursor, Copilot, or another coding+ agent.+ </p>+ </div>+ <Button+ text={isCopied && !copyError ? "Copied" : "Copy prompt"}+ onClick={handleCopyPrompt}+ />+ </div>+ {copyError && (+ <p role="alert" className="text-destructive">+ Could not copy the prompt. Please try again.+ </p>+ )}+ <div className="flex flex-col gap-2">+ <p className="text-muted-foreground text-xs">+ Or run in your project directory:+ </p>+ <Codeblock language="bash" value={command} variant="read-only" />+ </div>+ </div>+ );+}diff --git a/web/src/features/skills/components/ImportSkillsDialog.tsx b/web/src/features/skills/components/ImportSkillsDialog.tsxindex 0e0a034a69..67309d886f 100644--- a/web/src/features/skills/components/ImportSkillsDialog.tsx+++ b/web/src/features/skills/components/ImportSkillsDialog.tsx@@ -15,6 +15,7 @@ import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePosimport { api, getTrpcErrorCode, type RouterOutputs } from "@/src/utils/api";import { LocalSkillImportSource } from "./LocalSkillImportSource";+import { useLangfuseBaseUrl } from "@/src/features/public-api/hooks/useLangfuseEnvCode";import { CliSkillImportInstructions } from "./CliSkillImportInstructions";import type { ComparedSkill, SkillImportDiscovery } from "./skillImportTypes";import { compareImportedSkills } from "../utils/compare-imported-skills";@@ -274,7 +275,7 @@ export function ImportSkillsDialog({</Tabs.List><div className="pt-4"><Tabs.Content value="cli">- <CliSkillImportInstructions projectId={projectId} />+ <CliSkillImportTab projectId={projectId} /></Tabs.Content><Tabs.Content value="local"><div className="flex flex-col gap-4">@@ -442,3 +443,8 @@ export function ImportSkillsDialog({</DialogController>);}++function CliSkillImportTab({ projectId }: { projectId: string }) {+ const host = useLangfuseBaseUrl();+ return <CliSkillImportInstructions projectId={projectId} host={host} />;+}diff --git a/web/src/features/skills/components/InstallSkillDialog.tsx b/web/src/features/skills/components/InstallSkillDialog.tsxindex a82d741f1b..10a73799fc 100644--- a/web/src/features/skills/components/InstallSkillDialog.tsx+++ b/web/src/features/skills/components/InstallSkillDialog.tsx@@ -1,13 +1,13 @@import { Dialog } from "@/src/components/design-system/Dialog/Dialog";import { Codeblock } from "@/src/components/design-system/Codeblock/Codeblock";import { Button } from "@/src/components/design-system/Button/Button";+import { CliSetupAccordion } from "./CliSetupAccordion";import {SkillInstallationOptions,type SkillInstallationOptionsProps,} from "./SkillInstallationOptions";import { useLangfuseBaseUrl } from "@/src/features/public-api/hooks/useLangfuseEnvCode";import { useSkillInstallOptions } from "../hooks/useSkillInstallOptions";-import { shellQuote } from "../utils/shellQuote";type InstallSkillDialogProps = Pick<SkillInstallationOptionsProps,@@ -28,43 +28,15 @@ export function InstallSkillDialog({initialValues.name,);+ const handleRetry = () => skillOptions.refetch();+return (- <Dialog title="Install with CLI" size="lg" closeOnInteractionOutside>+ <Dialog title="Install in your project" size="lg" closeOnInteractionOutside><Dialog.Body>- <p>- Run these commands in your local project directory. Requires Node.js- 20 or later. The Langfuse CLI is in beta.+ <p className="text-muted-foreground">+ Choose what to install, then let your coding agent handle setup or run+ the command yourself.</p>- <div className="flex flex-col gap-2">- <h3 className="font-bold">1. Install the CLI</h3>- <Codeblock- language="bash"- value="npm install -g @langfuse/cli@beta"- />- </div>- <div className="flex flex-col items-start gap-3">- <h3 className="font-bold">- 2. Configure local environment variables- </h3>- <p className="text-muted-foreground">- Replace the placeholders with this project’s public and secret keys.- These exports configure the CLI in your current terminal session. If- you already set <code>LANGFUSE_BASE_URL</code>, update it to the- same host.- </p>- <Button- text="Get project API keys"- href={`/project/${projectId}/settings/api-keys`}- variant="secondary"- size="sm"- />- <div className="ph-no-capture w-full">- <Codeblock- language="bash"- value={`export LANGFUSE_PUBLIC_KEY='pk-lf-...'\nexport LANGFUSE_SECRET_KEY='sk-lf-...'\nexport LANGFUSE_HOST=${shellQuote(host)}`}- />- </div>- </div>{skillOptions.isPending && (<p className="text-muted-foreground">Loading installation options…</p>)}@@ -75,13 +47,14 @@ export function InstallSkillDialog({text="Try again"variant="secondary"size="sm"- onClick={() => skillOptions.refetch()}+ onClick={handleRetry}/></div>)}{!skillOptions.isPending && !skillOptions.isError && (<SkillInstallationOptions{...options}+ host={host}names={names}labels={[...new Set([...labels, ...(skillOptions.data?.labels ?? [])]),@@ -92,6 +65,17 @@ export function InstallSkillDialog({}}/>)}+ <CliSetupAccordion projectId={projectId} host={host}>+ <p className="text-muted-foreground">+ Commit <code>langfuse-skills-lock.json</code> to share your+ selection. Updates follow labels; pinned versions stay fixed.+ </p>+ <Codeblock+ language="bash"+ value="langfuse skills update"+ variant="read-only"+ />+ </CliSetupAccordion></Dialog.Body></Dialog>);diff --git a/web/src/features/skills/components/SkillEditor.tsx b/web/src/features/skills/components/SkillEditor.tsxindex 531d8e366a..b93acc13eb 100644--- a/web/src/features/skills/components/SkillEditor.tsx+++ b/web/src/features/skills/components/SkillEditor.tsx@@ -521,7 +521,7 @@ export function SkillEditor({<InstallSkillDialogprojectId={projectId}initialValues={{- by: "name",+ by: "all",name,version: baseVersion,label: labels.includes("production") ? "production" : "latest",diff --git a/web/src/features/skills/components/SkillInstallationOptions.stories.tsx b/web/src/features/skills/components/SkillInstallationOptions.stories.tsxindex 1087075cbb..eeb2e69cd7 100644--- a/web/src/features/skills/components/SkillInstallationOptions.stories.tsx+++ b/web/src/features/skills/components/SkillInstallationOptions.stories.tsx@@ -1,3 +1,4 @@+import { expect, userEvent, within } from "storybook/test";import preview from "../../../../.storybook/preview";import { SkillInstallationOptions } from "./SkillInstallationOptions";@@ -5,8 +6,9 @@ const meta = preview.meta({ component: SkillInstallationOptions });export const FromSkill = meta.story({args: {+ host: "https://cloud.langfuse.com",initialValues: {- by: "name",+ by: "all",name: "review-code",version: 7,label: "production",@@ -20,8 +22,9 @@ export const FromSkill = meta.story({export const FromList = meta.story({args: {+ host: "https://cloud.langfuse.com",initialValues: {- by: "tag",+ by: "all",name: "review-code",version: null,label: "production",@@ -35,6 +38,7 @@ export const FromList = meta.story({export const NoTags = meta.story({args: {+ host: "https://cloud.langfuse.com",initialValues: {by: "tag",name: "review-code",@@ -47,3 +51,50 @@ export const NoTags = meta.story({tags: [],},});++export const InstallScopes = meta.story({+ name: "(Test) Switch install scope",+ args: {+ host: "https://cloud.langfuse.com",+ initialValues: {+ by: "all",+ name: "review-code",+ version: 7,+ label: "production",+ tag: "engineering",+ },+ names: ["review-code", "refund-policy"],+ labels: ["production"],+ tags: ["engineering"],+ },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);+ await expect(+ canvas.getByText("langfuse skills install --all --label='production'"),+ ).toBeVisible();+ const configure = canvas.getByRole("button", {+ name: "Configure install command",+ });+ await expect(configure).toHaveAttribute("aria-expanded", "false");+ await userEvent.click(configure);+ await expect(canvas.getByRole("tab", { name: "Version" })).toBeDisabled();++ await userEvent.click(canvas.getByRole("tab", { name: "Name" }));+ await expect(+ canvas.getByText("langfuse skills install 'review-code' --version 7"),+ ).toBeVisible();++ await userEvent.click(canvas.getByRole("tab", { name: "Tag" }));+ await expect(+ canvas.getByText(+ "langfuse skills install --tag='engineering' --label='production'",+ ),+ ).toBeVisible();++ await userEvent.click(canvas.getByRole("tab", { name: "All" }));+ await userEvent.click(configure);+ await expect(+ canvas.getByText("langfuse skills install --all --label='production'"),+ ).toBeVisible();+ },+});diff --git a/web/src/features/skills/components/SkillInstallationOptions.tsx b/web/src/features/skills/components/SkillInstallationOptions.tsxindex e27a32c4ad..5061aced93 100644--- a/web/src/features/skills/components/SkillInstallationOptions.tsx+++ b/web/src/features/skills/components/SkillInstallationOptions.tsx@@ -1,14 +1,16 @@-import { useId, useState } from "react";+import { useId, useState, type ChangeEvent } from "react";import { SkillNameSchema } from "@langfuse/shared";import { Tabs } from "@/src/components/design-system/Tabs/Tabs";import { Input } from "@/src/components/design-system/Input/Input";-import { Codeblock } from "@/src/components/design-system/Codeblock/Codeblock";+import { Accordion } from "@/src/components/design-system/Accordion/Accordion";+import { CopyAgentPromptPanel } from "./CopyAgentPromptPanel";import { SkillCliSelector } from "./SkillCliSelector";import { shellQuote } from "../utils/shellQuote";export type SkillInstallationOptionsProps = {+ host: string;initialValues: {- by: "name" | "tag";+ by: "all" | "name" | "tag";name: string;version: number | null;label: string;@@ -20,13 +22,14 @@ export type SkillInstallationOptionsProps = {};export function SkillInstallationOptions({+ host,initialValues,labels,tags,names,}: SkillInstallationOptionsProps) {const id = useId();- const [by, setBy] = useState<string>(initialValues.by);+ const [by, setBy] = useState<"all" | "name" | "tag">(initialValues.by);const [name, setName] = useState(initialValues.name);const [selector, setSelector] = useState<string>(initialValues.version === null ? "label" : "version",@@ -34,21 +37,21 @@ export function SkillInstallationOptions({const [version, setVersion] = useState(String(initialValues.version ?? 1));const [nameLabel, setNameLabel] = useState(initialValues.label);const [tag, setTag] = useState(initialValues.tag);- const [tagLabel, setTagLabel] = useState(initialValues.label);+ const [bulkLabel, setBulkLabel] = useState(initialValues.label);const [directory, setDirectory] = useState(".agents/skills");const directoryFlag =directory === ".agents/skills"? "": ` --directory=${shellQuote(directory)}`;const labelOptions = [...new Set([...labels, "production", "latest"])];- const activeSelector = by === "tag" ? "label" : selector;+ const activeSelector = by === "name" ? selector : "label";const pinnedVersion = activeSelector === "version";const validVersion =/^[1-9]\d*$/.test(version) && Number.isSafeInteger(Number(version));const selectedName = selectedOption(name, names);const selectedTag = tags.length > 0 ? selectedOption(tag, tags) : tag;const selectedNameLabel = selectedOption(nameLabel, labelOptions);- const selectedTagLabel = selectedOption(tagLabel, labelOptions);+ const selectedBulkLabel = selectedOption(bulkLabel, labelOptions);const nameValidation = SkillNameSchema.safeParse(selectedName);const normalizedName = nameValidation.success? nameValidation.data@@ -56,10 +59,12 @@ export function SkillInstallationOptions({const nameTarget = pinnedVersion? `${shellQuote(normalizedName)} --version ${version}`: `${shellQuote(normalizedName)} --label=${shellQuote(selectedNameLabel)}`;- const target =- by === "tag"- ? `--tag=${shellQuote(selectedTag.trim())} --label=${shellQuote(selectedTagLabel)}`- : nameTarget;+ const targets = {+ all: `--all --label=${shellQuote(selectedBulkLabel)}`,+ tag: `--tag=${shellQuote(selectedTag.trim())} --label=${shellQuote(selectedBulkLabel)}`,+ name: nameTarget,+ };+ const target = targets[by];const invalidNameError = nameValidation.success? null: "Select a valid skill name.";@@ -74,145 +79,188 @@ export function SkillInstallationOptions({pinnedVersion && !validVersion? "Enter a positive whole-number version.": null;- const error = by === "name" ? (nameError ?? versionError) : tagError;- const description = getInstallationDescription(by, pinnedVersion);+ const errors = {+ all: names.length === 0 ? "No skills available in this project." : null,+ name: nameError ?? versionError,+ tag: tagError,+ };+ const error = errors[by];+ const command = `langfuse skills install ${target}${directoryFlag}`;+ const prompt = `Install these Langfuse skills in this repository.++Follow the CLI setup and authentication guidance:+https://github.com/langfuse/langfuse-cli+Use @langfuse/cli@beta for skill installation.++Langfuse host: ${JSON.stringify(host)}++Run from the repository root:+${command}++Use local project credentials. If missing, ask me to configure them locally; never paste secrets into chat or commit them.++Verify the skills are installed in ${JSON.stringify(directory)} and retain langfuse-skills-lock.json for reproducible installs.`;+ const handleByChange = (value: string) => {+ if (value === "all" || value === "name" || value === "tag") setBy(value);+ };+ const handleTagChange = (event: ChangeEvent<HTMLInputElement>) =>+ setTag(event.target.value);+ const handleVersionChange = (event: ChangeEvent<HTMLInputElement>) =>+ setVersion(event.target.value);return (<div className="ph-no-capture flex flex-col gap-4"><div className="flex flex-col gap-3">- <h3 className="font-bold">3. Install skills</h3>- <div className="grid min-w-0 gap-4 sm:grid-cols-3">- <Tabs value={by} onValueChange={setBy}>- <Tabs.List aria-label="Install by" variant="inset" size="md">- <Tabs.Trigger value="name" label="Name" />- <Tabs.Trigger value="tag" label="Tag" />- </Tabs.List>- <Tabs.Content value="name">- <div className="pt-3">- <SkillCliSelector- label="Skill name"- options={names.map((name) => ({ value: name, label: name }))}- value={selectedName}- onValueChange={setName}- />- </div>- </Tabs.Content>- <Tabs.Content value="tag">- <div className="pt-3">- {tags.length > 0 ? (- <SkillCliSelector- label="Skill tag"- options={tags.map((tag) => ({ value: tag, label: tag }))}- value={selectedTag}- onValueChange={setTag}- />- ) : (- <div className="flex min-w-0 flex-col gap-2">- <label- className="text-muted-foreground text-xs"- htmlFor={`${id}-tag`}+ <Accordion type="single" collapsible>+ <Accordion.Item value="configuration">+ <Accordion.Trigger size="sm">+ Configure install command+ </Accordion.Trigger>+ <Accordion.Content>+ <div className="flex flex-col gap-3 py-3">+ <div className="grid min-w-0 gap-4 sm:grid-cols-3">+ <Tabs value={by} onValueChange={handleByChange}>+ <Tabs.List+ aria-label="Install by"+ variant="inset"+ size="md"+ >+ <Tabs.Trigger value="all" label="All" />+ <Tabs.Trigger value="name" label="Name" />+ <Tabs.Trigger value="tag" label="Tag" />+ </Tabs.List>+ <Tabs.Content value="name">+ <div className="pt-3">+ <SkillCliSelector+ label="Skill name"+ options={names.map((name) => ({+ value: name,+ label: name,+ }))}+ value={selectedName}+ onValueChange={setName}+ />+ </div>+ </Tabs.Content>+ <Tabs.Content value="tag">+ <div className="pt-3">+ {tags.length > 0 ? (+ <SkillCliSelector+ label="Skill tag"+ options={tags.map((tag) => ({+ value: tag,+ label: tag,+ }))}+ value={selectedTag}+ onValueChange={setTag}+ />+ ) : (+ <div className="flex min-w-0 flex-col gap-2">+ <label+ className="text-muted-foreground text-xs"+ htmlFor={`${id}-tag`}+ >+ Skill tag+ </label>+ <Input+ id={`${id}-tag`}+ value={selectedTag}+ onChange={handleTagChange}+ placeholder="my-tag"+ />+ </div>+ )}+ </div>+ </Tabs.Content>+ </Tabs>+ <Tabs value={activeSelector} onValueChange={setSelector}>+ <Tabs.List+ aria-label="Version selection"+ variant="inset"+ size="md">- Skill tag- </label>- <Input- id={`${id}-tag`}- value={selectedTag}- onChange={(event) => setTag(event.target.value)}- placeholder="my-tag"+ <Tabs.Trigger+ value="version"+ label="Version"+ disabled={by !== "name"}+ />+ <Tabs.Trigger value="label" label="Label" />+ </Tabs.List>+ <Tabs.Content value="version">+ <div className="flex min-w-0 flex-col gap-2 pt-3">+ <label+ className="text-muted-foreground text-xs"+ htmlFor={`${id}-version`}+ >+ Skill version+ </label>+ <Input+ id={`${id}-version`}+ type="number"+ value={version}+ onChange={handleVersionChange}+ aria-invalid={!validVersion}+ />+ </div>+ </Tabs.Content>+ <Tabs.Content value="label">+ <div className="pt-3">+ <SkillCliSelector+ label="Version label"+ options={labelOptions.map((label) => ({+ value: label,+ label,+ }))}+ value={+ by === "name"+ ? selectedNameLabel+ : selectedBulkLabel+ }+ onValueChange={+ by === "name" ? setNameLabel : setBulkLabel+ }+ />+ </div>+ </Tabs.Content>+ </Tabs>+ <div className="flex min-w-0 flex-col gap-3 sm:pt-10">+ <SkillCliSelector+ label="Install to"+ options={[+ { value: ".agents/skills", label: "Default" },+ { value: ".claude/skills", label: "Claude Code" },+ { value: ".cursor/skills", label: "Cursor" },+ ].map(({ value, label }) => ({+ value,+ label: (+ <span className="flex min-w-0 items-center gap-2">+ <span className="shrink-0">{label} </span>+ <span+ className="text-muted-foreground truncate text-xs"+ title={value}+ >+ {value}+ </span>+ </span>+ ),+ }))}+ value={directory}+ onValueChange={setDirectory}/></div>- )}- </div>- </Tabs.Content>- </Tabs>- <Tabs value={activeSelector} onValueChange={setSelector}>- <Tabs.List aria-label="Version selection" variant="inset" size="md">- <Tabs.Trigger- value="version"- label="Version"- disabled={by === "tag"}- />- <Tabs.Trigger value="label" label="Label" />- </Tabs.List>- <Tabs.Content value="version">- <div className="flex min-w-0 flex-col gap-2 pt-3">- <label- className="text-muted-foreground text-xs"- htmlFor={`${id}-version`}- >- Skill version- </label>- <Input- id={`${id}-version`}- type="number"- value={version}- onChange={(event) => setVersion(event.target.value)}- aria-invalid={!validVersion}- />- </div>- </Tabs.Content>- <Tabs.Content value="label">- <div className="pt-3">- <SkillCliSelector- label="Version label"- options={labelOptions.map((label) => ({- value: label,- label,- }))}- value={by === "tag" ? selectedTagLabel : selectedNameLabel}- onValueChange={by === "tag" ? setTagLabel : setNameLabel}- />+ </div></div>- </Tabs.Content>- </Tabs>- <div className="flex min-w-0 flex-col gap-3 sm:pt-10">- <SkillCliSelector- label="Install to"- options={[- { value: ".agents/skills", label: "Default" },- { value: ".claude/skills", label: "Claude Code" },- { value: ".cursor/skills", label: "Cursor" },- ].map(({ value, label }) => ({- value,- label: (- <span className="flex min-w-0 items-center gap-2">- <span className="shrink-0">{label} </span>- <span- className="text-muted-foreground truncate text-xs"- title={value}- >- {value}- </span>- </span>- ),- }))}- value={directory}- onValueChange={setDirectory}- />- </div>- </div>- <p className="text-muted-foreground">{description}</p>+ </Accordion.Content>+ </Accordion.Item>+ </Accordion>{error ? (<p role="alert" className="text-destructive">{error}</p>) : (- <Codeblock- language="bash"- value={`langfuse skills install ${target}${directoryFlag}`}- />+ <CopyAgentPromptPanel prompt={prompt} command={command} />)}</div>- <div className="flex flex-col gap-2">- <h3 className="font-bold">4. Update installed skills</h3>- <p className="text-muted-foreground">- Skills are installed in <code>{directory}</code>. Commit{" "}- <code>langfuse-skills-lock.json</code> to share the selection with- your team. Updates use the saved directories and follow saved labels;- pinned versions stay fixed.- </p>- <Codeblock language="bash" value="langfuse skills update" />- </div></div>);}@@ -220,13 +268,3 @@ export function SkillInstallationOptions({function selectedOption(value: string, options: string[]) {return options.includes(value) ? value : (options[0] ?? "");}--function getInstallationDescription(by: string, pinnedVersion: boolean) {- if (by === "tag") {- return "Installs every skill with this tag at the chosen label. Each skill must have that label.";- }- if (pinnedVersion) {- return "Pins this skill to the selected version.";- }- return "Follows this label when you update, even when it moves to a new version.";-}diff --git a/web/src/features/skills/components/SkillsPage.tsx b/web/src/features/skills/components/SkillsPage.tsxindex f667d6e301..24d3e8a070 100644--- a/web/src/features/skills/components/SkillsPage.tsx+++ b/web/src/features/skills/components/SkillsPage.tsx@@ -74,7 +74,7 @@ export function SkillsPage() {<InstallSkillDialogprojectId={projectId}initialValues={{- by: "tag",+ by: "all",name: "",version: null,label: "production",