Skip to content

Skill: Create Skill

The Create Skill skill validates and deploys agent-generated skill code to the Horizon platform. It supports a dry-run mode that lets agents test whether their generated code passes validation without actually deploying it — enabling an iterative write-validate-fix-deploy workflow.

ParameterTypeRequiredDescription
categorystringYesThe skill category to deploy the skill under (e.g., web, platform, custom). Must be a valid category name containing only lowercase letters and hyphens.
skill_namestringYesThe name of the skill. Must be unique within the category and version. Must contain only lowercase letters, numbers, and hyphens.
versionstringYesThe version identifier (e.g., v1.0, v2.0). Must follow the vN.N format.
codestringYesThe full source code of the skill. Must export a default async function handler. See validation requirements below.
dry_runbooleanNoWhen true, the skill is validated but not deployed. Defaults to false.

The code parameter must meet the following requirements to pass validation:

  1. Export pattern — the code must export a default async function. The expected pattern is:

    export default async function handler(params, context) {
    // skill logic here
    }
  2. File system restrictions — the code must not attempt to write files outside the designated skills directory. Any fs.writeFile or similar operations are sandboxed.

  3. No prohibited imports — the code must not import modules that are not available in the skill runtime environment. The available runtime modules include standard Node.js built-ins and a curated set of utility libraries.

  4. Parameter schema — the code should declare its parameter schema using a PARAMS export or inline JSDoc annotations so that the platform can validate incoming parameters at execution time.

  5. Return value — the handler function must return a JSON-serializable object.

An agent building a new skill for a user might first validate the code:

“Create a skill that converts temperatures between Fahrenheit and Celsius.”

The agent generates the code and invokes Create Skill with:

  • category: custom
  • skill_name: temperature-converter
  • version: v1.0
  • code: (generated skill code)
  • dry_run: true

If validation passes, the agent informs the user and asks for confirmation before deploying.

After validation and user confirmation:

  • category: custom
  • skill_name: temperature-converter
  • version: v1.0
  • code: (the validated skill code)
  • dry_run: false

The skill is now live and can be invoked by any agent in the workspace with the custom category enabled.

When validation fails, the response includes specific error messages. The agent can fix the issues and re-validate:

  1. Agent generates code and calls Create Skill with dry_run: true.
  2. Validation returns an error: “Missing default export.”
  3. Agent fixes the export and calls Create Skill with dry_run: true again.
  4. Validation passes. Agent calls Create Skill with dry_run: false to deploy.
{
"status": "deployed",
"category": "custom",
"skill_name": "temperature-converter",
"version": "v1.0",
"deployed_at": "2026-03-18T16:00:00Z"
}
{
"status": "valid",
"category": "custom",
"skill_name": "temperature-converter",
"version": "v1.0",
"validation_passed": true
}
{
"status": "invalid",
"errors": [
"Missing default async function export",
"Prohibited import: 'child_process'"
]
}
  • Sandbox enforcement — deployed skills run in a sandboxed environment with limited file system access, no network access outside approved endpoints, and memory/CPU constraints.
  • Overwrite semantics — deploying to an existing category/skill_name/version combination replaces the previous code. The old code is not preserved. Use version increments to maintain history.
  • Workspace scope — deployed skills are available to all agents in the workspace that have the skill’s category enabled.
  • Naming conventions — skill names should be descriptive and use kebab-case (e.g., temperature-converter, invoice-summary). The category should group related skills logically.
  • Code size limit — skill code is limited to 500 KB. Larger skills should be refactored into smaller, composable skills.

POST /api/platform/v1.0/create-skill

See the Skill Execution API for details on authentication and request format.


Related skills: Get Skill | Export File