Skip to main content

defineSkill(input)

Validates and returns a complete SkillManifest from partial input.
import { defineSkill } from "@hitheo/sdk";

export default defineSkill({
  name: "Inventory Check",
  slug: "inventory-check",
  version: "1.0.0",
  description: "Real-time inventory lookup and reorder alerts",
  category: "automation",
  author: { name: "Acme Corp" },
  systemPromptExtension: `
    You are an inventory management specialist. When the user asks about
    stock levels, use the check_stock tool.
  `,
  tools: [
    {
      name: "check_stock",
      description: "Look up current stock levels by SKU",
      inputSchema: {
        type: "object",
        properties: {
          sku: { type: "string" },
          warehouse: { type: "string" },
        },
      },
    },
  ],
  permissions: ["read:artifacts", "external:http", "execute:tools"],
  modelPreference: "theo-1-reason",
  trigger: { type: "keyword", config: { keywords: ["stock", "inventory"] } },
  knowledge: ["./warehouse-rules.json"],
});

Validation

defineSkill validates:
  • Slug format — lowercase alphanumeric with hyphens, no leading/trailing hyphens
  • Version — must follow semver (1.0.0)
  • Tool names — lowercase alphanumeric with underscores
Throws Error on invalid input.

SkillManifestInput Fields

FieldTypeRequiredDescription
namestringHuman-readable skill name
slugstringUnique identifier (lowercase, hyphens)
versionstringSemver version
descriptionstringShort description
categorySkillCategory"productivity", "domain", "integration", "automation", "creative"
author{ name, email?, url? }Author info
systemPromptExtensionstringInjected into the LLM system prompt
toolsSkillToolInput[]Tool definitions
permissionsSkillPermission[]Required permissions
knowledgestring[]Bundled knowledge file paths
modelPreferencestringPreferred model ID
triggerSkillTriggerInputActivation trigger
hooks{ onInstall?, onUninstall? }Lifecycle hooks
readmestringMarkdown README
changelogstringMarkdown changelog
licensestringLicense identifier (default: "MIT")
repositorystringSource repository URL
keywordsstring[]Search keywords
See the Skills deep dive for the full authoring guide.