Specification
The Enterprise AI Agent Skills Specification defines the architectural contract, directory layout, metadata schema, resolution protocol, and cryptographic verification standard for AI Agent Skills compatible with Google Agent Development Kit (ADK) and polyglot agent runtimes.
This specification extends and supersedes baseline specifications (such as agentskills.io) by introducing:
- Canonical Central Registry & Server Registration (
castor://): Registration protocol (POST /api/v1/skills) assigning uniqueskill_idkeys and canonical URIs (castor://skills/{domain}/{category}/{name}/{version}). - Native Build Lifecycle Integration: Client build hooks (
castor-clientfor Maven,castor_client.build_metafor Python PEP 517 /uv,//go:generatefor Go) that audit skills and inject pre-compiled resources directly into application artifacts. - Cryptographic Lockfiles (
.manifest.lock): Deterministic SHA-256 checksum tracking to prevent skill drift or unauthorized agent/developer tampering. - 5-Point SDLC Quality Invariants: Mandatory frontmatter, progressive disclosure sub-trees, CWE security checkpoints, HTTP 429 resilience rules, and strict
file:///link resolution. - Polyglot URI Resolution: Unified URI syntax supporting central servers (
castor://,cstr://), GitHub repositories (github://), Go modules (mod://), Java Maven artifacts (maven://), local packages (pkg://), and local filesystems (file://). - Zero-I/O Pre-compiled Manifests (
skills_manifest.json): In-memory skill registration for low-latency agent startup. - Just-in-Time (JIT) Semantic Discovery: Semantic retrieval mapping user intent to specific skills, eliminating the need to statically load entire registries.
- Human-in-the-Loop (HITL) Intervention Gates: Explicit compliance validation checkpoints designed to isolate read vs. write workloads for AHI safety.
- Repeatable Scenario Verification Framework: Automated test scenario suites located in
scenarios/*.mdverifying agent execution correctness through tool assertions (expected_skills) and token-frequency cosine similarity thresholds.
A compliant skill MUST be structured as a self-contained directory containing a root SKILL.md file alongside supporting progressive disclosure subdirectories:
<skill-directory>/
├── SKILL.md # Primary skill specification & instructions (Required)
├── references/ # Detailed architectural guides & reference docs (Required)
│ └── *.md
├── examples/ # Code snippets, usage patterns & sample payloads (Required)
│ └── *
├── scenarios/ # Repeatable agent verification scenarios (Optional)
│ └── *.md
├── scripts/ # Optional setup or execution scripts
└── resources/ # Optional static assets or schema definitions
Every SKILL.md MUST begin with a YAML frontmatter block enclosed by triple dashes (---). The frontmatter MUST contain the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
Yes | Kebab-case identifier matching the directory name (e.g. python-adk-fastapi). |
description |
string |
Yes | Concise single-line summary of the skill’s purpose and capability. |
license |
string |
Yes | Standard SPDX license identifier (e.g. Apache-2.0). |
author |
string |
Yes | Legacy single-string author name for backwards compatibility. |
authors |
list[object] |
No | Structured list of contributors (name, email, url). |
version |
string |
Yes | Semantic version string (e.g. 1.0.0). |
compatibility |
string |
No | Target runtime or framework compatibility requirement. |
allowed-tools |
string |
No | Legacy flat tool permissions string (e.g. Bash(git:*) Read). |
tool_requirements |
list[object] |
No | Strongly-typed tool permissions (name, scopes, description). |
category |
string |
No | Primary domain classification (e.g. python, devops, database). |
tags |
list[string] |
No | Keywords for registry discovery and indexing. |
trigger_phrases |
list[string] |
No | Intent triggers for agent routers (e.g. ["scaffold Go microservice"]). |
execution_hints |
object |
No | Operational guidelines (preferred_model, requires_human_approval, environment_variables, timeout_seconds). |
Any unrecognized keys in the frontmatter MUST be preserved under a generic metadata dictionary.
A compliant skill loader MUST support resolving qualified skill root URIs:
| Scheme | Example | Resolution Mechanics |
|---|---|---|
castor:// / cstr:// |
castor://skills/example.com/testing/test-skill/1.0.0 |
Queries central Castor Registry HTTP endpoint (GET /api/v1/skills/{id}) using X-API-Key. |
github:// |
github://owner/repo[@ref][/path] |
Fetches git trees via git clone or GitHub zipballs. |
mod:// |
mod://module_path[@version][/path] |
Resolves via $GOPATH/pkg/mod or go mod download. |
maven:// |
maven://groupId:artifactId:version |
Resolves from ~/.m2/repository or mvn dependency:get. |
pkg:// |
pkg://package-name |
Resolves workspace packages within local Bazel runfiles. |
file:// |
file:///path/to/skill |
Resolves directly from local filesystem paths. |
Central server registration publishes source skills and assigns immutable skill_id keys:
- Client Request:
cstr register <source_uri>sendsPOST /api/v1/skillswithX-API-Keyauthentication header. - Server Processing:
Castor Registryvalidates source skill frontmatter, assignsskill_id(e.g.,sk-9b1deb4d), and storessource_uriand canonicaluri(castor://skills/{domain}/{category}/{name}/{version}). - Client Response: Returns HTTP
201 Createdwith canonical URIcastor://skills/{domain}/{category}/{name}/{version}.
Every application registered with Castor Registry MUST be bound to a verified domain authority and assigned a canonical RFC 8141 URN:
- Application URN:
urn:castor:app:<domain>:<app_name>(e.g.urn:castor:app:retailcortex.com:checkout-agent) - Skill URN:
urn:castor:skill:<domain>:<app_name>:<skill_name>:<version>(e.g.urn:castor:skill:retailcortex.com:checkout-agent:payment-gateway:v1.0.0)
- SSO Email Match (
VERIFIED_SSO): If the developer’s email domain matches the requested registration domain (e.g.dev@retailcortex.comregisteringretailcortex.com), domain verification is automatically confirmed. - Freemail Prohibition (
ErrFreemailDomainProhibited): Public freemail provider addresses (gmail.com,yahoo.com,outlook.com,hotmail.com,icloud.com, etc.) are explicitly forbidden from claiming corporate domain namespaces. - DNS Challenge Fallback (
PENDING_DNS): Claiming a custom third-party domain generates a DNS TXT challenge token (castor-domain-verify-<uuid>) that must be published under_castor-challenge.<domain>before activation.
Applications support multi-user collaboration and scoped API credentials governed by strict permission tiers:
| Role | Hierarchy Level | Capabilities |
|---|---|---|
OWNER |
Administrative (Tier 3) | Full administrative control. Invite/remove members, update roles, provision/revoke API keys, and manage skills. |
EDITOR |
Engineering (Tier 2) | Create, update, replace, and delete application skills. Provision non-owner developer/CI keys. |
VIEWER |
Read-Only (Tier 1) | Read-only inspection of application skills, metadata, and search endpoints. Prohibited from mutating skills. |
REST & gRPC Contract Specifications (proto/castor/registration/v1/registration_service.proto)
| Endpoint | Method | gRPC RPC | Required Role | Description |
|---|---|---|---|---|
/api/v1/apps/members |
GET |
ListMembers |
VIEWER |
List team collaborators |
/api/v1/apps/members/invite |
POST |
InviteMember |
OWNER |
Invite user with OWNER, EDITOR, or VIEWER role |
/api/v1/apps/members/accept |
GET/POST |
AcceptInvitation |
Public Token | Activate pending invitation token |
/api/v1/apps/members/{member_id} |
PATCH |
UpdateMemberRole |
OWNER |
Change collaborator role |
/api/v1/apps/members/{member_id} |
DELETE |
RemoveMember |
OWNER |
Revoke collaborator access |
/api/v1/apps/keys |
GET |
ListApiKeys |
OWNER |
List active & revoked scoped API keys |
/api/v1/apps/keys |
POST |
CreateApiKey |
EDITOR |
Provision scoped API key with expiration |
/api/v1/apps/keys/{key_id} |
DELETE |
RevokeApiKey |
OWNER |
Instantly revoke scoped API key |
Central registries MUST compute, index, and maintain multi-modal semantic embeddings for all registered skills:
- Provider Contract & Vector Precision:
- Embedding providers MUST implement the standard
embedding.Providerinterface, emitting $L_2$-normalized[]float64vectors. - Providers MUST support text embedding (
GenerateEmbedding), binary image embedding (GenerateImageEmbedding), multi-chunk skill decomposition (GenerateSkillEmbeddings), and cosine similarity calculation (CosineSimilarity).
- Embedding providers MUST implement the standard
- Poly-Column Dimensions:
embedding_768: 768-dimensional vector for standard text embedding models (text-embedding-004,alloydb-ai).embedding_1408: 1408-dimensional vector for multi-modal image and media models (multimodalembedding).embedding_3072: 3072-dimensional vector reserved for high-dimensional models.
- Multi-Chunk Sliding-Window Decomposition:
- Skill content MUST be decomposed into granular chunks prior to vectorization to support accurate RAG retrieval across complex technical instructions and code snippets.
- Text chunks MUST be capped at at most 900 characters per chunk, with an 80-character sliding step overlap when partitioning large text blocks or code structures.
- Itemized chunks MUST be generated across:
- Skill summary & metadata (name, description, tags, categories).
- System instructions (partitioned into numbered instruction blocks).
- Trigger phrases (individual query match phrases).
- Markdown references (
references/*.md). - Executable examples (
examples/*).
- HNSW Acceleration:
- PostgreSQL/AlloyDB indexes MUST utilize HNSW (
m=16,ef_construction=64) overvector_cosine_opsfor all active vector columns (skills_embedding_768_hnsw_idx,skills_embedding_1408_hnsw_idx).
- PostgreSQL/AlloyDB indexes MUST utilize HNSW (
- Deterministic Offline Fallback:
- In environments without live Google Cloud or AlloyDB AI credentials, registries and test runners MUST fall back to deterministic, normalized semantic hashing (
embedding.GenerateDeterministicVector) to maintain hermetic test isolation.
- In environments without live Google Cloud or AlloyDB AI credentials, registries and test runners MUST fall back to deterministic, normalized semantic hashing (
- Benchmark & Recall Evaluation:
- Provider implementations MUST be verifiable against an evaluation test harness (
pkg/embedding/harness_test.go) evaluating Mean Reciprocal Rank (MRR $\ge 0.85$), Top-1/Top-3 recall accuracy ($\ge 90%$), and P95 latency bounds.
- Provider implementations MUST be verifiable against an evaluation test harness (
All REST list and search endpoints (/api/v1/skills) MUST enforce strict request bounding:
- Parameter Constraints:
page: Integer ≥ 1 (default:1).page_size/max: Integer 1 ≤page_size≤ 25 (default:5).
- Mandatory Response Headers:
X-Total-Count: Total matched entities across the entire dataset.X-Page: Current page index.X-Page-Size: Effective bounded page size.X-Total-Pages: Total calculated page count ($\lceil \text{Total} / \text{PageSize} \rceil$).
- Optional Envelope Parameter: If
?envelope=trueis set, the server MUST wrap items in{ "items": [...], "total_count": N, "page": P, "page_size": S, "total_pages": T }.
Skills may include a scenarios/ directory containing repeatable scenario test definitions (scenarios/*.md) used by developers, evaluation suites, and automated test runners (cstr test) to verify skill execution fidelity and tool grounding.
Each scenario is a Markdown file with a YAML frontmatter block defining execution expectations, followed by a reference markdown body defining the target outcome:
---
prompt: "How do I build a Bazel module hermetically using Bzlmod?"
executes: true
expected_skills:
- bazel
threshold: 0.70
metadata:
category: "build"
---
To build a Bazel module hermetically using Bzlmod:
1. Configure MODULE.bazel and commit MODULE.bazel.lock (CWE-829).
2. Execute `bazel build //...`.
| Field | Type | Required | Description |
|---|---|---|---|
prompt |
string |
Yes | The input prompt provided to the agent under test. |
executes |
boolean |
No | If true, asserts that all expected_skills are invoked during execution. (Default: false). |
expected_skills |
list[string] |
No | List of tool / skill names expected to be invoked. (Alias: skills_applied). |
threshold |
float |
No | Minimum cosine similarity threshold (0.0 ≤ threshold ≤ 1.0). (Default: 0.70). |
metadata |
map[string, string] |
No | Arbitrary key-value metadata for tagging, difficulty, or categorization. |
- Tool Invocation Assertion:
- If
executes: true, the test runner inspects the agent’s actual tool call history. - Every entry in
expected_skillsMUST be present in the recorded tool calls. If any tool is missing, the test fails immediately.
- If
- Output Similarity Scoring:
- The agent’s generated response text is compared against the scenario’s reference
outcomebody. - Text is normalized (tokenized by
[a-zA-Z0-9_]+, lowercased) into word-frequency vectors $\vec{u}$ and $\vec{v}$. - Cosine similarity is computed: $$\text{sim}(\vec{u}, \vec{v}) = \frac{\vec{u} \cdot \vec{v}}{|\vec{u}|_2 |\vec{v}|_2}$$
- If $\text{sim}(\vec{u}, \vec{v}) < \text{threshold}$, the test fails.
- The agent’s generated response text is compared against the scenario’s reference