Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions skills/cloud/skill-registry/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
name: skill-registry
description: >
Interact with the Gemini Enterprise Agent Platform Skill Registry to create
and search for available skills. Use this skill to enable agents to register
functionality or discover new capabilities.
---

# Skill Registry

This skill provides instructions for interacting with the **Skill Registry** on
the Gemini Enterprise Agent Platform.

## Core Capabilities

- **Skill Discovery** - Query the registry to easily search, list, get
specific skills, and inspect revision histories.
- **Skill Lifecycle Management** - Upload, update, or permanently delete
skills.
- **Operation Monitoring** - Utility to check the completion status of
long-running state changes (LROs).
- **Generate Skill** - Automate the initial scaffolding of new agent skills
locally.

## Core Directives

- **Mandatory Validation**: ALWAYS execute the environment validation check
before performing any operations.

Before any operation, you **must** validate the core environment.

```bash
# Execute the validation script
python3 scripts/validate_env.py
```

## Prerequisites & Authentication

### Library & Authentication

Ensure you have the latest Google Cloud credentials and libraries installed.

```bash
# Install required libraries
pip install google-auth requests

# Authenticate with Google Cloud
gcloud auth application-default login
```

### Environment Variables

The following variables are required for operations:

- `GCP_PROJECT_ID`: Your Google Cloud Project ID.
- `GCP_LOCATION`: The region (e.g., `us-central1`).

--------------------------------------------------------------------------------

## Quickstart

Quickly search for available skills in the registry:

```bash
python3 scripts/skill_registry_ops.py search \
--query "test skill" \
--top-k 5
```

--------------------------------------------------------------------------------

## Operations

- **Skill Discovery**: [query-skills.md](references/query-skills.md)
- **Skill Lifecycle**: [manage-skills.md](references/manage-skills.md)
- **Monitor Operations**:
[monitor-operations.md](references/monitor-operations.md)
- **Generate Skill**: [generate-skill.md](references/generate-skill.md)
38 changes: 38 additions & 0 deletions skills/cloud/skill-registry/references/generate-skill.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generate Skill

## Description

GenerateSkill automates the *initial* scaffolding of new agent skills by generating standardized documentation (`SKILL.md`) and directory structures based on user requirements. Note: This tool serves strictly as a starting point. It generates a foundational draft and requires human intervention to refine the logic, review the architecture, and ensure the final skill meets production-level quality standards.

**Use when:**

* Scaffolding a new agent skill from scratch.
* Establishing a standardized directory structure for a new tool.
* Drafting a properly formatted `SKILL.md` for a specific use case.

**Don't use when:**

* Executing an existing skill or performing a general query.
* Writing general code outside of a skill directory.

---

## Directory Structure

When generating a new skill, the following standardized architecture should be established:

* **`SKILL.md`**: The core documentation and instruction set for the skill *(Required)*.
* **`references/`**: Directory for storing heavy external documentation, API specs, or knowledge bases *(Optional)*.
* **`scripts/`**: Directory for executable scripts, helper functions, or setup files *(Optional)*. Offload complex code snippets, deterministic helper functions, or repetitive setup tasks into this directory to keep `SKILL.md` lean and focused entirely on high-level instructions and usage patterns.
* **`assets/`**: Directory for static files, templates, or media used by the skill *(Optional)*.

---

## Execution Workflow

To successfully generate and deliver a new skill draft, follow these sequential steps:

1. **Requirement Gathering:** Analyze the user's prompt to understand the purpose, inputs, outputs, and constraints of the desired skill.
2. **Drafting:** Generate the `SKILL.md` content based on the gathered requirements. Ensure the description is concise (under 300 words) and explicitly defines "Use when" and "Don't use when" conditions. Identify and map out necessary optional directories (`references/`, `scripts/`, `assets/`) if applicable, ensuring that any complex or repetitive code logic is offloaded into the `scripts/` directory.
3. **Validation:** Automatically parse and validate the drafted `SKILL.md` to ensure strictly valid Markdown formatting (e.g., correct header nesting, closed tags, proper list syntax). Fix any errors before proceeding.
4. **Review Request:** Present the generated `SKILL.md` and directory structure to the user. Explicitly request their review and manual revision, reiterating that human evaluation is required to finalize the draft for production.
71 changes: 71 additions & 0 deletions skills/cloud/skill-registry/references/manage-skills.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Skill Lifecycle Management

This document covers state-changing actions (uploading, updating, deleting)
for a skill.

## Upload Skill
Upload a new skill into the Skill Registry using either a zipped package or a
folder.

### Supported Flags

* `--skill-id` (Required): The unique identifier for the skill.
* `--display-name` (Required): The human-readable name of the skill.
* `--description` (Required): A description of what the skill does.
* `--zip-file` (Required, mutually exclusive with `--folder`): Path to a local
`.zip` file containing the skill.
* `--folder` (Required, mutually exclusive with `--zip-file`): Path to a local
folder containing the skill.

```bash
# Option 1: Upload a skill from a folder (recommended)
python3 scripts/skill_registry_ops.py upload \
--skill-id "my-sample-skill" \
--display-name "My Sample Skill" \
--description "A test skill uploaded via script." \
--folder "/path/to/skill/folder"

# Option 2: Upload a skill using a .zip file
python3 scripts/skill_registry_ops.py upload \
--skill-id "my-sample-skill" \
--display-name "My Sample Skill" \
--description "A test skill uploaded via script." \
--zip-file "/path/to/skill.zip"
```
*Note: This returns a long-running operation ID. See `monitor-operations.md`.*

## Update Skill
Update an existing skill's metadata or files. At least one update parameter
must be provided (`--display-name`, `--description`, `--zip-file`, or
`--folder`).

### Supported Flags

* `--skill-id` (Required): The unique identifier for the skill.
* `--display-name` (Optional): A new display name for the skill.
* `--description` (Optional): A new description for the skill.
* `--zip-file` (Optional, Mutually exclusive with `--folder`): Path to a new
`.zip` file payload.
* `--folder` (Optional, Mutually exclusive with `--zip-file`): Path to a new
folder payload.

```bash
python3 scripts/skill_registry_ops.py update \
--skill-id "my-sample-skill" \
--display-name "Updated Name" \
--description "Updated description." \
--folder "/path/to/updated/skill/folder"
```
*Note: This returns a long-running operation ID. See `monitor-operations.md`.*

## Delete Skill
Remove a specific skill from the registry forever.

### Supported Flags

* `--skill-id` (Required): The unique identifier for the skill to delete.

```bash
python3 scripts/skill_registry_ops.py delete --skill-id "my-skill"
```
*Note: This returns a long-running operation ID. See `monitor-operations.md`.*
20 changes: 20 additions & 0 deletions skills/cloud/skill-registry/references/monitor-operations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Monitor Operations

This document covers how to monitor the status of Long-Running Operations (LRO)
returned by lifecycle management actions (uploading, updating, or deleting a
skill).

## Check Operation Status

Check the status of a long-running operation using its `OPERATION_ID` (or full
resource name).

### Supported Flags

* `--operation-id` (Required): The unique identifier or full resource name of
the long-running operation returned from previous commands.

```bash
python3 scripts/skill_registry_ops.py monitor \
--operation-id "projects/my-project/locations/us-central1/operations/123456789"
```
67 changes: 67 additions & 0 deletions skills/cloud/skill-registry/references/query-skills.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Skill Discovery

This document covers safe, read-only operations for finding and inspecting
skills as well as their revision histories in the Skill Registry.

## Search Skills
Find skills matching a semantic search term.

### Supported Flags

* `--query` (Required): The semantic query to find matching skills.
* `--top-k` (Optional): The maximum number of skills to return. Defaults to 5.

```bash
python3 scripts/skill_registry_ops.py search \
--query "test skill" \
--top-k 5
```

## List Skills
List all skills in the registry for the configured project and location.

### Supported Flags

*(None)*

```bash
python3 scripts/skill_registry_ops.py list
```

## Get Skill
Retrieve details for a specific skill by its ID.

### Supported Flags

* `--skill-id` (Required): The unique identifier for the skill.

```bash
python3 scripts/skill_registry_ops.py get --skill-id "my-skill"
```

## List Revisions
Inspect the history of changes / versions for a specific skill. (Read-only
metadata about lifecycle).

### Supported Flags

* `--skill-id` (Required): The unique identifier for the skill.

```bash
python3 scripts/skill_registry_ops.py list-revision --skill-id "my-skill"
```

## Get Revision
Fetch details of a specific revision.

### Supported Flags

* `--skill-id` (Required): The unique identifier for the skill.
* `--revision-id` (Required): The specific revision ID to fetch (e.g., from
list-revision).

```bash
python3 scripts/skill_registry_ops.py get-revision \
--skill-id "my-skill" \
--revision-id "test-revision-123"
```
3 changes: 3 additions & 0 deletions skills/cloud/skill-registry/scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Required Python packages for Skill Registry Python scripts.
google-auth
requests
Loading
Loading