Skip to content

API Reference parrot.handlers.studio.skills_catalog

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.handlers.studio.skills_catalog

View source

Shared skills catalog — org-wide, category-ordered, owner-filterable (FEAT-467 TASK-2515).

Hybrid storage (spec §3 Module 7, resolved decision): Postgres (navigator.ai_skills_catalog / :class:SkillCatalogEntry) is the system-of-record and SQL query plane (ORDER BY category, WHERE owner); the shared-namespace SkillRegistry ("<org_id>/ _shared") is a best-effort secondary index for embedding search and git-like versioning. PG write always happens FIRST; the registry write is wrapped so a Redis/embedding outage never fails a publish — it only flags search_index_stale=True for later repair (startup reconciliation pass, or the admin /skills/resync endpoint).

Package layout (oversize-module split, owner decision D1): the three views live here with their verbs; the module-level helpers, the shared mixin and the database / legacy bodies are in _helpers.py / _mixin.py / _catalog_db.py / _catalog_legacy.py / _import.py / _resync.py. Shared code reads _get_shared_skill_registry / create_skill_registry / AGENTS_DIR through this package at call time, so patching them here works.

Alias AGENTS_DIR

Re-exported from parrot.conf.AGENTS_DIR.

Alias DEFAULT_ORG_ID

Re-exported from parrot.handlers.studio.skills_catalog._helpers.DEFAULT_ORG_ID.

Alias SHARED_NAMESPACE_SUFFIX

Re-exported from parrot.handlers.studio.skills_catalog._helpers.SHARED_NAMESPACE_SUFFIX.

Alias SkillsCatalogGlue

Re-exported from parrot.handlers.studio.skills_catalog._glue.SkillsCatalogGlue.

Class StudioSkillVisibilityHandler

PATCH /api/v1/astudio/skills/{id}/visibility — change who can see a catalogue skill.

Method StudioSkillVisibilityHandler.patch

Set visibility / allowed_groups of a skill (404 invisible, 403 not manageable, 422 rules).

patch()

Class StudioSkillsCatalogHandler

/api/v1/astudio/skills and /api/v1/astudio/skills/{id}.

GET (list ordered/grouped by category, or one entry + registry versions), POST (publish — PG first, registry best-effort), PUT/ DELETE (owner-or-admin).

Method StudioSkillsCatalogHandler.get

List / read skills (database mode: StudioSkillCatalogService).

get()

Method StudioSkillsCatalogHandler.post

Publish a skill (database mode: StudioSkillCatalogService).

post()

Method StudioSkillsCatalogHandler.put

Update a skill (database mode: StudioSkillCatalogService).

put()

Method StudioSkillsCatalogHandler.delete

Delete a skill (database mode: StudioSkillCatalogService).

delete()

Class StudioSkillsImportHandler

POST /api/v1/astudio/agents/{name}/skills/import/{id}.

Materializes a catalog entry as AGENTS_DIR/<agent>/skills/<name>.md — collision refused (409) unless overwrite=true. Owner-enforced: only the target agent's owner (or a superuser) may import onto it — reuses _StudioFilesMixin._resolve_agent, the same lookup the file-CRUD endpoints use (adversarial-review fix: this handler previously wrote into ANY agent's skills directory with no ownership check at all).

Method StudioSkillsImportHandler.post

Import a catalogue skill into an agent (database mode: an ai_agent_assets row).

post()

Class StudioSkillsResyncHandler

POST /api/v1/astudio/skills/resync — admin-only.

Re-uploads every search_index_stale catalog row into the shared registry; returns counts. Same routine the startup hook runs automatically (:func:reconcile_skills_catalog), exposed here for an on-demand admin retry.

Method StudioSkillsResyncHandler.post

Resync the derived index (database mode: rebuilt from Postgres).

post()

Alias create_skill_registry

Re-exported from parrot.skills.store.create_skill_registry.

Alias index_published_skill

Re-exported from parrot.handlers.studio.skills_catalog._helpers.index_published_skill.

Alias logger

Re-exported from parrot.handlers.studio.skills_catalog._helpers.logger.

Alias org_id_from_session

Re-exported from parrot.handlers.studio.skills_catalog._helpers.org_id_from_session.

Alias reconcile_skills_catalog

Re-exported from parrot.handlers.studio.skills_catalog._helpers.reconcile_skills_catalog.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally