writing-skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
agent-platform-model-registryAgent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.
Independent GitHub snapshot · Automated classification · Original documentation governs
This skill provides instructions for managing machine learning models in the Agent Platform Model Registry. It covers listing models, describing model details, uploading new models or versions, updating metadata, and deleting models.
Before executing any commands on behalf of the user, you MUST adhere to the following safety tiers based on the action requested:
list, describe, get)
upload, update)
--region=us-central1, --project=...,
--display-name="...") — natural-language paraphrases are NOT
sufficient.upload or update in Turn 1 without prior confirmation is strictly
prohibited.delete)
estimate_cost tool for Model Registry actions, as
estimate_cost is designed for serving infrastructure (endpoints/batch
prediction) and will return an error if called for registry operations. If
including cost in the preview card, state that Model Registry operations
incur no serving compute charges ($0.00 compute charges; standard Cloud
Storage pricing applies to model artifacts).CRITICAL: Before running any commands, verify that all necessary parameters are known:
gcloud config get project or gcloud config get compute/region). If still unresolved or ambiguous, pause and
explicitly ask the user for the missing parameter before executing mutating
or resource-specific commands.<unique-suffix>, [suffix], or <timestamp>),
generate a short unique alphanumeric string or timestamp and substitute it
cleanly. Never pass unexpanded literal placeholder tokens to the API.--region=$LOCATION_ID and
--project=$PROJECT_ID explicitly on all gcloud ai models commands. Do
NOT use global.Use this command to discover existing models in the registry and retrieve their numeric IDs. No confirmation is required.
Always pass --limit. A project can hold thousands of models, and an unbounded
list pages through every one of them, which can take over a minute and return
hundreds of KB of output. Results come back most recently updated first, so
--limit=50 returns the newest models in a few seconds.
gcloud ai models list \
--region=$LOCATION_ID \
--project=$PROJECT_ID \
--limit=50
Keep --limit=50 when the user asks to list "all" models, and say the reply
shows the 50 most recently updated models. Do NOT page through the whole
registry (with gcloud or Model.list()) unless the user asks for a count or
the complete inventory; offer to look up a specific model by display name
instead.
If the user pushes back and asks for the complete inventory, drop --limit
and print one compact line per model with
--format="value(name.basename(),displayName)". Warn that this can take a
minute or more in a large project.
If the user asks how many models there are, count the IDs without printing
the list. There is no count API, so this still pages through every model
(about a minute per 1,500 models); tell the user it may take a while. Do not
run a --limit list first.
gcloud ai models list \
--region=$LOCATION_ID \
--project=$PROJECT_ID \
--format="value(name)" | wc -l
Do NOT use --filter or --sort-by to narrow the list. gcloud applies both
client-side after fetching every page, so they are as slow as an unbounded
list.
To find a model by display name (e.g. to confirm an upload or deletion), filter on the server with the Python SDK:
python3 - <<'PY'
from google.cloud import aiplatform
aiplatform.init(project='<PROJECT_ID>', location='<LOCATION_ID>')
for m in aiplatform.Model.list(filter='display_name="<DISPLAY_NAME>"'):
print(m.name, m.display_name, m.create_time)
PY
Retrieve the full metadata for a specific model or version. No confirmation is required.
gcloud ai models describe $MODEL_ID \
--region=$LOCATION_ID \
--project=$PROJECT_ID
To target a specific version:
gcloud ai models describe ${MODEL_ID}@${VERSION_ID} \
--region=$LOCATION_ID \
--project=$PROJECT_ID
Register a new model or a new version of an existing model. This is a long-running operation. Action requires an inline confirmation card before proceeding.
gcloud ai models upload \
--region=$LOCATION_ID \
--project=$PROJECT_ID \
--display-name="<DISPLAY_NAME>" \
--container-image-uri="<CONTAINER_IMAGE_URI>" \
[--artifact-uri="<ARTIFACT_URI>"]
[!IMPORTANT]
This is a Tier M operation — see [Safety & Confirmation Tiers] above.
- If the user specifies "with no artifact URI", omit
--artifact-uri.- If registering a new version of an existing model, include
--parent-model=$PARENT_MODEL_ID.- Substitute
<DISPLAY_NAME>with the exact name requested by the user.
Update metadata fields like display name or description. Note that gcloud ai models does NOT have an update subcommand. Instead, model metadata updates
MUST be executed using the Vertex AI Python SDK
(google.cloud.aiplatform.Model).
Action requires an inline confirmation card containing the exact script before proceeding.
python3 -c "
from google.cloud import aiplatform
aiplatform.init(project='$PROJECT_ID', location='$LOCATION_ID')
model = aiplatform.Model('$MODEL_ID')
model.update(display_name='<NEW_DISPLAY_NAME>', description='<NEW_DESCRIPTION>')
print(f'Successfully updated model: {model.resource_name}')
"
[!IMPORTANT]
This is a Tier M operation — see [Safety & Confirmation Tiers] above.
- If only updating the display name, pass
model.update(display_name='<NEW_DISPLAY_NAME>').- If only updating the description, pass
model.update(description='<NEW_DESCRIPTION>').- The confirmation card MUST display the exact python command snippet above. NEVER execute in Turn 1; wait for explicit user approval.
Permanently delete a Model and all its versions. Action requires explicit typed confirmation before proceeding.
gcloud ai models delete $MODEL_ID \
--region=$LOCATION_ID \
--project=$PROJECT_ID
[!WARNING]
This operation is irreversible. All model versions must be undeployed from all Endpoints before deletion.
Before generating interactive model details, you MUST verify the model_id by
searching Model Garden Publisher Models. No confirmation is required.
Use the gcloud ai CLI to search for matching publisher models.
gcloud ai model-garden models list --model-filter="<model_name_or_query>" --full-resource-name --format=json
This will return a list of matching models. Extract the exact name field from
the result (e.g., publishers/google/models/gemma2 or
publishers/qwen/models/qwen3-coder) to use as the verified model_id.