Skills
Skills extend agent capabilities with custom logic. There are three skill types:
Prompt Skills
Section titled “Prompt Skills”Return text content when called by the agent. Useful for injecting domain knowledge, templates, or instructions.
Example: A “greeting_policy” prompt skill that returns your company’s greeting guidelines.
Webhook Skills
Section titled “Webhook Skills”Call an external HTTP endpoint when invoked. The endpoint receives the skill name, arguments, and context, and returns a JSON response the agent can use.
Example: A “check_inventory” webhook skill that calls your inventory API.
JavaScript Module Skills
Section titled “JavaScript Module Skills”Execute custom JavaScript code in the agent’s sandbox. Module skills are registered as callable functions that the agent invokes during its reasoning loop.
How it works
Section titled “How it works”Your code runs as a function body with args as the input parameter. All sandbox primitives are available:
search(query, topK?, storeID?)— Semantic searchfetch(url, opts?)— HTTP requests (whitelist enforced)remember(key, value)/recall(key)/memories()— Session memorylistStores()/getDocument(id)— Document accesslog(message)— Console outputdata— Persistent object across calls
Example
Section titled “Example”A skill named summarize_search with this code:
var results = search(args.query, args.top_k || 3);if (results.length === 0) { return "No results found for: " + args.query;}var summaries = results.map(function(r) { return "- " + r.content.substring(0, 200);});return "Found " + results.length + " results:\n" + summaries.join("\n");The agent calls it via think: summarize_search({query: "refund policy", top_k: 5})
Creating a module skill
Section titled “Creating a module skill”- Go to Space Config > Skills
- Click New Skill
- Select type JavaScript Module
- Enter a name (must be a valid JS identifier, e.g.
fetch_weather) - Write your code in the editor
- Click Validate to check for syntax errors
- Click Create
Constraints
Section titled “Constraints”- ES5.1 only — The Goja runtime supports ES5.1 JavaScript (no arrow functions, no
let/const, no template literals) - 30-second timeout — Long-running code is terminated
- No direct network access — Use the
fetch()primitive (whitelist enforced) - No filesystem access — The sandbox is isolated
Via SDK
Section titled “Via SDK”client.CreateSkill(ctx, sdk.CreateSkillInput{ Name: "summarize_search", Description: "Search and summarize results", Type: "module", Prompt: `var results = search(args.query, 3); return results.map(function(r) { return r.content; }).join("\n");`,})