Skill schema — AI Protocol property reference
Defines programmatic conditions under which a skill becomes active. Allows context-aware activation based on object type, user role, etc.
Skill Trigger Condition Schema
Defines programmatic conditions under which a skill becomes active. Allows context-aware activation based on object type, user role, etc.
Source: packages/spec/src/ai/skill.zod.ts
TypeScript Usage
import { SkillSchema, SkillTriggerConditionSchema } from '@objectstack/spec/ai';
import type { Skill, SkillTriggerCondition } from '@objectstack/spec/ai';
// Validate data
const result = SkillSchema.parse(data);Skill
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | Skill unique identifier (snake_case) |
| label | string | ✅ | Skill display name |
| description | string | optional | Skill description |
| surface | Enum<'ask' | 'build' | 'both'> | optional (default: "ask") | Agent surface this skill binds to ('ask' | 'build' | 'both') — ADR-0063 §3; read by the cloud agent runtime only |
| instructions | string | optional | LLM instructions when skill is active — also served as an MCP prompt unless mcpPrompt is false |
| tools | string[] | ✅ | Tool names belonging to this skill (supports trailing wildcard, e.g. action_*) — bound by the cloud agent runtime; an MCP server whose prompts registerSkillPrompts installs offers the skill only when it serves every tool named here (an action_ entry also through run_action); mcpPrompt: false withholds it from MCP whatever this binding |
| triggerConditions | { field: string; operator: Enum<'eq' | 'neq' | 'in' | 'not_in' | 'contains'>; value: string | string[] }[] | optional | Programmatic activation conditions — evaluated by the cloud agent runtime only. The context fields a condition reads are reported by the client: a condition is routing, never access control |
| active | boolean | optional (default: true) | Whether the skill is enabled |
| mcpPrompt | boolean | optional | Whether this skill is offered as an MCP prompt. false = written for the in-product agents only: never listed by prompts/list and unknown to prompts/get on any MCP connection, whatever its tools binding. Absent or true = offered where the server serves its tools |
| context | string | optional | The context pack (ai_context, by its bare name) this skill works from. Requires get_record_context in tools. Over MCP the skill's prompt then takes an optional record id and asks the model to read that record through the pack |
| protection | { lock: Enum<'none' | 'no-overlay' | 'no-delete' | 'full'>; reason: string; docsUrl?: string } | optional | Package author protection block — lock policy for this skill. |
| _lock | Enum<'none' | 'no-overlay' | 'no-delete' | 'full'> | optional | Item-level lock — controls overlay & delete (ADR-0010). |
| _lockReason | string | optional | Human-readable reason shown when a write is refused by _lock. |
| _lockSource | Enum<'artifact' | 'package' | 'env-forced'> | optional | Layer that set _lock (artifact | package | env-forced). |
| _provenance | Enum<'package' | 'org' | 'env-forced' | 'platform'> | optional | Origin of the item (package | org | env-forced | platform). |
| _packageId | string | optional | Owning package machine id. |
| _packageVersion | string | optional | Owning package version. |
| _lockDocsUrl | string | optional | Optional documentation link surfaced next to _lockReason. |
Nested Shape: Skill.triggerConditions[number]
| Property | Type | Required | Description |
|---|---|---|---|
| field | string | ✅ | Context field to evaluate |
| operator | Enum<'eq' | 'neq' | 'in' | 'not_in' | 'contains'> | ✅ | Comparison operator |
| value | string | string[] | ✅ | Expected value or values |
Nested Shape: Skill.protection
| Property | Type | Required | Description |
|---|---|---|---|
| lock | Enum<'none' | 'no-overlay' | 'no-delete' | 'full'> | ✅ | Lock policy — none | no-overlay | no-delete | full. |
| reason | string | ✅ | User-visible reason shown when the lock blocks an action. |
| docsUrl | string | optional | Optional URL the Studio banner links to for more context. |
SkillTriggerCondition
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| field | string | ✅ | Context field to evaluate |
| operator | Enum<'eq' | 'neq' | 'in' | 'not_in' | 'contains'> | ✅ | Comparison operator |
| value | string | string[] | ✅ | Expected value or values |