Skip to main content

Skill CRD

The Skill CRD (charts/stoa-platform/crds/skills.gostoa.dev.yaml, ADR-047) defines scoped system-prompt instructions injected by stoa-gateway into AI agent tool execution contexts using CSS-like specificity (global < tenant < tool < user).

Context injection vs hard enforcement

A Skill injects prompt instructions into the LLM agent's context; it does not enforce hard security, authorization, or schema validation guardrails on tool calls. Enforce hard access and payload rules via signed tenant tool policies (ADR-070), OPA policies, and Tool.spec.inputSchema.

Resource Metadata​

FieldValue
CRD Nameskills.gostoa.dev
API Versiongostoa.dev/v1alpha1
KindSkill
Short Namesk
ScopeNamespaced
Watcherstoa-gateway (CrdWatcher, STOA_K8S_ENABLED=true with k8s feature)

Complete Example​

apiVersion: gostoa.dev/v1alpha1
kind: Skill
metadata:
name: payment-currency-policy
namespace: tenant-acme
spec:
name: Payment Currency Guidance
description: Instruct agents to pass ISO-4217 currency codes and cents precision on payment tools
scope: tool
priority: 80
toolRef: tenant-acme_payment_create
instructions: |
Always pass monetary amounts in integer minor units (cents) and explicit ISO-4217 3-letter currency codes (EUR, USD, GBP). Confirm amounts above 100000 cents with the user before calling tenant-acme_payment_create.
enabled: true

(Note: spec.toolRef is matched by exact equality against the resolved gateway tool name — for a Tool named payment-create in namespace tenant-acme, CrdWatcher registers tenant-acme_payment_create.)

Spec Fields (openAPIV3Schema)​

Required Fields​

FieldTypeEnforced Values / ConstraintsDescription
namestringRequiredHuman-readable skill name
scopestringRequired; Enum: global, tenant, tool, userSpecificity scope (global < tenant < tool < user)

Optional Fields​

FieldTypeDefaultEnforced Values / ConstraintsDescription
descriptionstring—StringSkill summary for administrative visibility
priorityinteger50minimum: 0, maximum: 100Tie-breaker priority within the same scope (higher value wins)
instructionsstring—StringSystem-prompt instructions injected into the agent context
toolRefstring—StringExact registered gateway tool name ({namespace}_{snake_case(name)}) when scope: tool
userRefstring—StringTarget user identifier when scope: user
enabledbooleantrueBooleanWhether this skill is active in the resolver

Specificity & Resolution Order​

When stoa-gateway resolves skills for an incoming request (GET /admin/skills/resolve?tenant_id=<id>), matching enabled skills are ordered first by scope (global → tenant → tool → user) and then by priority (0..100).

Status Subresource (status)​

The CRD defines .status fields (registered, lastSeen, error) and printer columns (Scope, Priority, Enabled, Registered). On main, CrdWatcher upserts skills into the in-memory SkillResolver without patching .status back to the Kubernetes API server:

FieldTypeDefaultDescription
registeredbooleanfalseSchema field for registration state (not patched by CrdWatcher on main)
lastSeenstring—Schema field for last watcher timestamp (not patched by CrdWatcher on main)
errorstring—Schema field for registration error details

Cookies and privacy

With your permission, we use cookies to measure visits and understand navigation to improve the site.

Learn more

Google Analytics measures visits and useful clicks. Microsoft Clarity provides masked interaction replays. No advertising use. Your choice is saved for six months. You can change or withdraw it at any time using the “Cookies” button.

Read the audience measurement details