Logo von Valibot

Valibot

Community
tuanductran
valibot

Repository-Leitfaden zur Verwendung von Valibot als Bibliothek zur Schema-Validierung im hr-skills-Monorepo. Verwenden Sie ihn, wenn Sie Schemas in packages/hr-skills-ref/src/client/schema.ts oder packages/hr-skills-build/src/client/shared/schema.ts schreiben oder ändern, geparste YAML-Frontmatter validieren, safeParse-Ergebnisse verarbeiten oder Typen aus Schemas ableiten.

Add to TypingMind

Übersicht

Herausgebertuanductran
Repositoryhr-skills
Skill-Namevalibot
Sterne
78
Forks
20
Mitgelieferte Dateien
Nur Anweisungen
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von tuanductran auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Valibot in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/tuanductran/hr-skills/tree/main/.agents/skills/valibot
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/tuanductran/hr-skills.git /tmp/hr-skills
mkdir -p .claude/skills
cp -r /tmp/hr-skills/.agents/skills/valibot .claude/skills/valibot
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Valibot in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Valibot automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Valibot nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Valibot in hr-skills

This skill covers how Valibot is used within the hr-skills monorepo specifically. It is not a general Valibot reference — see valibot.dev for the full API. The focus here is on the patterns, conventions, and pitfalls that appear in this codebase.

Where Valibot is used

Two files define schemas; all other packages consume them:

  • packages/hr-skills-ref/src/client/schema.ts — SkillPropertiesSchema, the generic Agent Skills shape used by readProperties() in loader.ts
  • packages/hr-skills-build/src/client/shared/schema.ts — MarketplaceJsonSchema (validates .claude-plugin/marketplace.json), SkillFrontmatterSchema (used by parseSkillFrontmatter() in parser.ts), and RegistrySchema (used by validateRegistryConsistency() in validate-registry.ts to check registry/skills.json against its schema)

Import pattern used throughout the repo:

typescript
import * as v from 'valibot';

Never use named imports (import { object, string } from 'valibot') — the wildcard * as v is the established convention here.

Supported tasks

  • Write or extend a schema in schema.ts for a new frontmatter field
  • Add a v.pipe(v.string(), v.trim()) field to an existing object schema
  • Handle a v.safeParse() result correctly in parser.ts or loader.ts
  • Infer the output type from a schema with v.InferOutput<typeof Schema>
  • Add an optional field to SkillPropertiesSchema or SkillFrontmatterSchema
  • Validate marketplace.json shape against MarketplaceJsonSchema in sync.ts
  • Add a v.record() field for arbitrary string metadata
  • Debug a failed v.safeParse() result using v.summarize(result.issues)
  • Make a field optional without breaking the existing type contract
  • Understand why v.safeParse is used instead of v.parse in this repo

Key prompts

Schema authoring

  1. "Add an optional [field] field to SkillPropertiesSchema that accepts a trimmed string."
  2. "Write the Valibot schema for a new marketplace plugin entry with fields [list]."
  3. "I need to validate a [shape] object in hr-skills-build. Write the schema."
  4. "Add a required string field [name] to SkillFrontmatterSchema with trim applied."

Parsing and results

  1. "Show me how parseSkillFrontmatter handles a v.safeParse failure in this repo."
  2. "When should I use v.safeParse vs v.parse in hr-skills-build?"
  3. "How does loader.ts throw a ValidationError from a failed v.safeParse result?"
  4. "Show me the correct way to check result.success and access result.output."

Type inference

  1. "How do I infer the output type from SkillPropertiesSchema?"
  2. "What is the difference between v.InferOutput and v.InferInput in this repo?"
  3. "How do I export both the schema and its type from schema.ts following repo conventions?"
  4. "Show me how SkillFrontmatter is inferred and used in parser.ts."

Optional and record fields

  1. "How is v.optional used in this repo for nullable frontmatter fields?"
  2. "Show me how v.record is used for the metadata field in SkillPropertiesSchema."
  3. "Add an optional field to SkillFrontmatterSchema that defaults to undefined."
  4. "How does toStringRecord convert unknown metadata values before passing to v.safeParse?"

Valibot vs Zod — critical differences

  1. "I accidentally wrote Zod-style chaining. Show me the correct Valibot equivalent."
  2. "How do I use v.pipe with v.trim and v.minLength like the existing schemas do?"
  3. "What is the Valibot equivalent of Zod's z.string().optional()?"
  4. "Show me how v.summarize works on result.issues for error reporting."

Tips

  • Prefer v.safeParse for anything derived from user-authored content (parser.ts's parseSkillFrontmatter, loader.ts) — parser.ts returns an empty object on failure, and loader.ts throws a typed ValidationError using v.summarize(result.issues). Throwing directly from v.parse bypasses that error handling pattern. One deliberate exception: build/sync.ts#syncMarketplace() uses v.parse directly against MarketplaceJsonSchema, since .claude-plugin/marketplace.json is a repo-committed file expected to always be valid — an unhandled throw there is the intended fail-fast behavior, not a bug to fix.
  • Apply v.pipe(v.string(), v.trim()) to every string field that comes from user-authored YAML — frontmatter values frequently have trailing whitespace or newlines that would silently fail downstream string comparisons.
  • Use v.optional() wrapping, not chained methods — v.optional(v.string()) not v.string().optional(). Valibot does not chain; it composes.
  • Infer types with v.InferOutput<typeof Schema> and export the type alongside the schema in the same file. See how SkillProperties and SkillFrontmatter are exported in their respective schema.ts files as the pattern to follow.
  • Never add a new schema file — both packages already have one schema.ts each. Add fields to the existing schemas unless there is a genuinely separate data shape that doesn't belong in either existing file.
  • When a v.safeParse result fails, log v.summarize(result.issues) for a human-readable summary — that is what ValidationError in loader.ts uses and what @clack/prompts surfaces to the terminal.

Common mistakes

  • Using Zod-style chaining such as v.string().trim().email() — Valibot has no method chaining. Use v.pipe(v.string(), v.trim(), v.email()) instead.
  • Calling v.parse(Schema, data) on user-authored content (SKILL.md frontmatter, etc.) instead of v.safeParse — this throws a raw ValiError that bypasses the typed error hierarchy in errors.ts. Use v.safeParse and handle result.success explicitly. (sync.ts's v.parse against a repo-committed marketplace.json is the one intentional exception — see Tips.)
  • Forgetting v.trim() in the pipeline for string fields parsed from YAML — without it, fields with trailing newlines or spaces will pass validation but cause subtle mismatch bugs in downstream string comparisons like author name normalization.
  • Adding v.InferInput instead of v.InferOutput when the schema has no transforms — in this repo all schemas use v.trim() which counts as a transform, so input and output types differ slightly. Prefer InferOutput.

Häufig gestellte Fragen

Was macht der KI-Skill Valibot?

Repository-Leitfaden zur Verwendung von Valibot als Bibliothek zur Schema-Validierung im hr-skills-Monorepo. Verwenden Sie ihn, wenn Sie Schemas in packages/hr-skills-ref/src/client/schema.ts oder packages/hr-skills-build/src/client/shared/schema.ts schreiben oder ändern, geparste YAML-Frontmatter validieren, safeParse-Ergebnisse verarbeiten oder Typen aus Schemas ableiten.

Warum Valibot in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Valibot besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Valibot in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/tuanductran/hr-skills/tree/main/.agents/skills/valibot ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Valibot nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Valibot verwenden?

So viele Sie möchten. In TypingMind können Sie Valibot mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Valibot kostenlos?

Ja. Der Skill wird von tuanductran auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇