Skip to main content

Hub Configuration Schema

This document describes the YAML schema for AI Primitives Hub hub configuration files.

Overview

Hubs are centralized configurations that define bundle sources and profiles for teams or organizations. A hub configuration file allows you to share a curated set of sources and pre-configured profiles.

Schema Version

Current schema version: Based on JSON Schema draft-07

Root Structure

version: "1.0.0"
metadata:
name: "My Hub"
description: "Hub description"
maintainer: "Team Name"
updatedAt: "2025-01-15T10:00:00Z"
sources:
- id: "source-1"
type: "github"
# ... source configuration
profiles:
- id: "profile-1"
name: "Profile Name"
# ... profile configuration
configuration:
autoSync: true
# ... hub configuration
telemetry:
elasticSearch:
node: "https://..."
# ... ES configuration

Required Fields

FieldTypeDescription
versionstringSemantic version of the hub configuration format (e.g., "1.0.0")
metadataobjectHub metadata and descriptive information
sourcesarrayList of bundle sources available in this hub

Metadata Object

The metadata object contains descriptive information about the hub.

Required Fields

FieldTypeDescription
namestringHuman-readable name of the hub (1-100 characters)
descriptionstringDetailed description of the hub's purpose (1-500 characters)
maintainerstringName or identifier of the hub maintainer (1-100 characters)
updatedAtstringISO 8601 timestamp of last update

Optional Fields

FieldTypeDescription
checksumstringIntegrity checksum (format: sha256:abc123... or sha512:abc123...)

Example

metadata:
name: "Engineering Team Hub"
description: "Curated prompt bundles for the engineering team"
maintainer: "Platform Team"
updatedAt: "2025-01-15T10:30:00Z"
checksum: "sha256:abc123def456..."

Sources Array

The sources array defines bundle sources available in the hub.

Required Fields per Source

FieldTypeDescription
idstringUnique identifier (alphanumeric, hyphens, underscores; 1-50 chars)
typestringSource type (see below)
enabledbooleanWhether this source is currently active
prioritynumberPriority order for source resolution (0-100, higher = higher priority)

Source Types

TypeDescription
githubGitHub repository releases
localLocal file system directory
awesome-copilotGitHub-hosted YAML collections
local-awesome-copilotLocal YAML collections
apmAPM package repositories
local-apmLocal APM packages
skillsGitHub repository with skills
local-skillsLocal filesystem skills directory

Optional Fields per Source

FieldTypeDescription
urlstringURL or path to the source
repositorystringGitHub repository in owner/repo format
branchstringGit branch name
namestringHuman-readable name of the source
configobjectSource-specific configuration
metadataobjectAdditional source metadata

Config Object

FieldTypeDescription
branchstringGit branch name (for git-based sources)
collectionsPathstringPath to collections directory (for awesome-copilot)
indexFilestringIndex file name (for awesome-copilot)

Source Metadata Object

FieldTypeDescription
descriptionstringSource description
homepagestringSource homepage URL
contactstringContact information

Example

sources:
- id: "company-bundles"
type: "github"
repository: "myorg/prompt-bundles"
branch: "main"
name: "Company Bundles"
enabled: true
priority: 100
config:
branch: "main"
metadata:
description: "Official company prompt bundles"
homepage: "https://github.com/myorg/prompt-bundles"

- id: "community-collection"
type: "awesome-copilot"
repository: "community/awesome-prompts"
enabled: true
priority: 50
config:
collectionsPath: "collections"
indexFile: "index.yml"

Profiles Array (Optional)

The profiles array defines predefined bundle collections.

Required Fields per Profile

FieldTypeDescription
idstringUnique identifier (alphanumeric, hyphens, underscores; 1-50 chars)
namestringHuman-readable name (1-100 characters)
descriptionstringDescription of the profile's purpose (1-500 characters)
bundlesarrayList of bundles included in this profile (minimum 1)

Optional Fields per Profile

FieldTypeDescription
iconstringIcon or emoji for the profile
activebooleanWhether this profile is currently active
createdAtstringISO 8601 timestamp of creation
updatedAtstringISO 8601 timestamp of last update
patharrayPath hierarchy for organizing in the UI

Bundle Object (within Profile)

FieldTypeRequiredDescription
idstringYesBundle identifier (1-50 chars)
versionstringYesBundle version (semver or "latest")
sourcestringYesSource ID where this bundle is available
requiredbooleanYesWhether this bundle is mandatory for the profile

Example

profiles:
- id: "frontend-dev"
name: "Frontend Development"
description: "Essential prompts for frontend developers"
icon: "🎨"
active: false
bundles:
- id: "react-patterns"
version: "latest"
source: "company-bundles"
required: true
- id: "css-helpers"
version: "2.0.0"
source: "company-bundles"
required: false
path:
- "engineering"
- "frontend"

Configuration Object (Optional)

Hub-level configuration settings.

FieldTypeDescription
autoSyncbooleanEnable automatic synchronization with hub sources
syncIntervalnumberSync interval in seconds (60-86400)
strictModebooleanEnable strict validation and security checks

Example

configuration:
autoSync: true
syncInterval: 3600
strictMode: true

Telemetry Object (Optional)

Hub-level telemetry configuration for forwarding extension events to an Elastic Search cluster.

Elastic Search Configuration

FieldTypeRequiredDescription
nodestringYesElastic Search telemetry proxy URL (e.g., https://es-proxy.internal:8080)
indexPrefixstringNoCustom index prefix (default: prompt-registry-telemetry)

Note: Authentication is handled by the telemetry proxy. The extension sends events to the proxy, which manages credentials and forwards data to Elastic Search.

Example

telemetry:
elasticSearch:
node: "https://es-proxy.internal:8080"
indexPrefix: "my-team-telemetry"

Complete Example

version: "1.0.0"

metadata:
name: "Engineering Team Hub"
description: "Centralized prompt management for the engineering organization"
maintainer: "Platform Team"
updatedAt: "2025-01-15T10:30:00Z"

sources:
- id: "official-bundles"
type: "github"
repository: "myorg/prompt-bundles"
name: "Official Bundles"
enabled: true
priority: 100
config:
branch: "main"

- id: "community"
type: "awesome-copilot"
repository: "community/awesome-prompts"
enabled: true
priority: 50

profiles:
- id: "backend-starter"
name: "Backend Starter Kit"
description: "Essential prompts for backend development"
icon: "⚙️"
bundles:
- id: "api-design"
version: "latest"
source: "official-bundles"
required: true
- id: "testing-helpers"
version: "1.2.0"
source: "official-bundles"
required: false

configuration:
autoSync: true
syncInterval: 3600

telemetry:
elasticSearch:
node: "https://es-proxy.internal:8080"

Validation

Hub configurations are automatically validated during import and loading operations using two validation phases:

Schema Validation

  • Uses JSON Schema validation with AJV
  • Validates against schemas/hub-config.schema.json
  • Checks field types, required fields, patterns, and constraints

Runtime Validation

  • Additional business logic checks
  • Validates hub references and security constraints
  • Verifies source configurations and accessibility

Manual Validation

To manually validate a hub configuration:

  1. Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
  2. Run "AI Primitives Hub: Import Hub"
  3. The extension validates the configuration before importing

Validation errors are displayed in VS Code notifications and logged to the output channel.

See Also