/greennode-agentbase:agentbase-teardownfrom greennode-agentbase
Guided cleanup of all AgentBase resources for a project or agent. Deletes runtime, identity, auth, memory, registry, and API keys. Use for full teardown or starting over.
Ships in greennode-agentbase. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Guided cleanup of all AgentBase resources for a project or agent.
Read the shared auth setup reference at /agentbase skill's references/auth-setup.md for full IAM credential configuration. In brief: run bash .claude/skills/agentbase/scripts/check_credentials.sh iam to verify credentials are configured. NEVER read .greennode.json or .env directly — always use the helper scripts. If check_credentials.sh iam returns MISSING, STOP — you MUST read the "If Credentials Are Not Found" section in /agentbase skill's references/auth-setup.md and follow it exactly. Do NOT skip this or provide your own credential setup instructions.
yes, confirm, ok, approve, proceed, go ahead, do it, lgtm, or equivalent affirmative) before any deletion begins. If the user responds with ANYTHING ELSE (deselecting items, questions, adjustments, or ambiguous text), treat it as additional input — update the plan and re-present for confirmation again. NEVER interpret a non-confirmation response as approval--dry-run, show the plan only and do not execute any deletionsDetermine which project/agent to tear down:
.agentbase-state.json exists in the current directory, read the agent/project name from itDiscover all resources matching the project name:
bash .claude/skills/agentbase/scripts/discovery.sh json
This returns JSON with all resources across all services. Parse the output to find resources matching the project name.
Resource matching priority:
.agentbase-state.json or .greennode.json (preferred — most precise)Warning: Always show exact resource IDs and full names in the deletion plan so the user can verify which resources will be affected. If matching finds resources that may belong to other projects, explicitly warn the user and ask them to confirm each resource individually.
Show the user a numbered plan of what will be deleted:
Teardown Plan for "my-agent":
1. Delete runtime endpoints (2 endpoints)
2. Delete runtime "my-agent-rt" (v3)
3. Delete auth provider "openai-key" (API Key)
4. Delete agent identity "my-agent"
5. Delete memory "my-agent-memory"
6. Delete CR images for this project (3 images, all artifacts)
7. Delete AIP API key "my-agent-key" (shared resource)
All deletions are IRREVERSIBLE.
Proceed with all? Or type numbers to exclude (e.g., "skip 6,7"):
If no related resources are found, tell the user and stop.
Wait for the user to:
Do NOT proceed without explicit confirmation.
Delete in this specific order to avoid dependency errors. If any script call returns an auth error (401/403) during the teardown sequence, re-authenticate with bash .claude/skills/agentbase/scripts/get_token.sh --force and retry the failed call once. If the retry also fails, report the error and continue with the next deletion.
Phase 1 — Runtime endpoints (MUST run before Phase 2):
Why order matters: The API rejects runtime deletion if custom endpoints still exist. You must delete all non-DEFAULT endpoints before deleting the runtime.
# List endpoints for each runtime
bash .claude/skills/agentbase/scripts/runtime.sh endpoints list $RUNTIME_ID
# Delete each non-DEFAULT endpoint
bash .claude/skills/agentbase/scripts/runtime.sh endpoints delete $RUNTIME_ID $ENDPOINT_ID
Phase 2 — Runtimes (only after all custom endpoints are deleted):
bash .claude/skills/agentbase/scripts/runtime.sh delete $RUNTIME_ID
Phase 3 — Auth providers (API Key, Delegated, OAuth2):
# API Key providers
bash .claude/skills/agentbase/scripts/auth.sh apikey delete --name $NAME
# Delegated providers
bash .claude/skills/agentbase/scripts/auth.sh delegated delete --name $NAME
# OAuth2 providers
bash .claude/skills/agentbase/scripts/auth.sh oauth2 delete --name $NAME
Phase 4 — Agent identity:
bash .claude/skills/agentbase/scripts/identity.sh delete $NAME
Phase 5 — Memory:
bash .claude/skills/agentbase/scripts/memory.sh delete $MEMORY_ID
Phase 6 — Container Registry images:
Important: Each user has one pre-provisioned repository that cannot be deleted. Teardown only removes images (and their artifacts) belonging to the project. List images first, filter by project name, then delete each one.
# Step 1: List images, filter by project name substring (paginate if totalPage > 1)
PAGE=1
while true; do
RESULT=$(bash .claude/skills/agentbase/scripts/cr.sh images list --name $PROJECT_NAME --page $PAGE --size 100)
# For each image in $RESULT.data[].name:
# bash .claude/skills/agentbase/scripts/cr.sh images delete --name $IMAGE_NAME
# (image delete cascades to all artifacts/tags under that image.)
TOTAL_PAGE=$(echo "$RESULT" | jq '.totalPage // 1')
[ "$PAGE" -ge "$TOTAL_PAGE" ] && break
PAGE=$((PAGE + 1))
done
# Step 2: Verify project images are gone
bash .claude/skills/agentbase/scripts/cr.sh images list --name $PROJECT_NAME
Phase 7 — AIP API keys (optional, may be shared):
bash .claude/skills/agentbase/scripts/aip.sh api-keys delete $KEY_NAME
The aip.sh api-keys delete command sends the DELETE request and returns immediately. Poll with aip.sh api-keys get $KEY_NAME until you get a 404 to confirm deletion.
Show a summary of what was deleted and any errors:
Teardown Results for "my-agent":
Deleted runtime endpoints (2)
Deleted runtime "my-agent-rt"
Deleted auth provider "openai-key"
Deleted agent identity "my-agent"
Deleted memory "my-agent-memory"
Skipped CR images for "my-agent" (user chose to keep)
Failed to delete AIP key "my-agent-key" (403 Forbidden)
Teardown finished. 5 of 7 resources removed. 2 failed — see errors above.
If .agentbase-state.json exists in the current directory, reset the wizard_step to 0 and clear resource IDs that were deleted (e.g., runtime_id, memory_id, agent_identity, aip_key_name, cr_repo_name). This prevents /agentbase-wizard resume from trying to resume with stale references to deleted resources. Only clear fields for resources that were actually deleted — keep fields for resources the user chose to skip/keep.
If .agentbase/ directory exists, offer to remove it:
Found local AgentBase files:
- .agentbase-state.json (wizard state — will be reset)
- .agentbase/ (token cache, temp files)
Reset wizard state and remove cache? (y/n)
If file operations fail (e.g., permission denied), report the specific error and suggest the user handle them manually.
| Error | Cause | Fix |
|---|---|---|
| Runtime deletion fails (400) | Custom endpoints still exist | Delete all non-DEFAULT endpoints first, then retry runtime deletion (see Phase 1 → Phase 2 order) |
| CR image delete fails (404) | Wrong --name (case-sensitive) or image already gone | List first with cr.sh images list --name $PROJECT_NAME to confirm exact names |
| 401 Unauthorized mid-teardown | IAM token expired during long teardown | Re-authenticate (get_token.sh --force) and retry the failed deletion |
| Resource belongs to another project | Name-based matching too broad (e.g., project "test" matches "api-test") | Always verify resource IDs in the deletion plan. Deselect items that don't belong to the target project |
| Identity deletion fails (404/500) | Identity name incorrect or already deleted | Verify identity name with identity.sh list before retrying |
| Memory deletion fails | Memory ID incorrect or already deleted | Verify memory ID with memory.sh list before retrying |
--dry-run flag..agentbase-state.json, or ask user).bash .claude/skills/agentbase/scripts/discovery.sh json.--dry-run, stop after showing the plan..agentbase-state.json and .agentbase/ directory if present.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
agentbase, teardown, cleanup, resource-deletion, project-decommission
npx claudepluginhub vngcloud/greennode-agentbase-skills --plugin greennode-agentbase10 skills in this plugin
/agentbasePlatform reference and getting-started guide. Use for general questions about the platform, architecture, available services, SDK, IAM setup, credentials, or which skill to use. IMPORTANT - If the user wants to BUILD an agent (not just learn about the platform), use /agentbase-wizard instead — do not answer with reference material. Trigger phrases include how does the platform work, what services are available, platform overview, explain the architecture, which skill should I use, how do I get started, what can I do here, how do I set up credentials, IAM setup. This is a reference guide — for specific operations, invoke the dedicated skill./agentbase-deployDeploy and operate AI agents on GreenNode AgentBase — covers runtime deploy & lifecycle (Custom Agent and OpenClaw), and the managed Container Registry. Trigger: deploy my agent, ship it, deploy a chatbot agent for Telegram/Zalo, list/scale/delete runtimes, switch OpenClaw version, docker login, push image. DO NOT use for scaffolding agent code (use /agentbase-wizard), platform LLM API keys (/agentbase-llm), agent memory (/agentbase-memory), agent identity or outbound auth (/agentbase-identity), logs or metrics (/agentbase-monitor), tearing down all resources (/agentbase-teardown), or general platform questions (/agentbase)./agentbase-gatewayManage GreenNode AgentBase Resource Gateway (MCP) — a managed proxy in front of user MCP servers with inbound auth, per-target outbound auth, and policy enforcement. Trigger: create/list/update/delete a gateway, register an MCP target, configure inbound auth (NONE/IAM/JWT) or per-target outbound auth (APIKEY/OAUTH, each with 2LO or 3LO flow), change VPC routes, bind a Policy Group. DO NOT use for agent runtimes (/agentbase-deploy) or for authoring policy rules (/agentbase-policy)./agentbase-identityRegister agent identities and manage outbound authentication providers for AI agents. Covers CRUD for agent identities, storing API keys or secrets for external services (OpenAI, Google, Slack), OAuth2 providers, and delegated keys. When user mentions an external service name with API key or credentials, trigger this skill — not /agentbase-llm. DO NOT use for agent source code (use /agentbase-wizard), platform LLM API keys (use /agentbase-llm), agent memory (use /agentbase-memory), or runtime logs (use /agentbase-monitor)./agentbase-llmManage platform LLM model access and API keys for AI agents. Use when user wants to set up LLM access, get a platform API key, browse available models, choose which LLM to use, configure model access, check rate limits, or get an OpenAI-compatible endpoint. Trigger for which models are available, set up LLM, API key for the model, list models, LLM key, connect to LLM. When user says API key without specifying an external service name, default to this skill. DO NOT use for storing API keys for external services (OpenAI, Google, Slack) — use /agentbase-identity instead./agentbase-memoryAdd memory to AI agents — conversation history, semantic fact extraction, and long-term memory records. Covers creating memory stores, managing events/sessions, memory records, long-term memory strategies (SEMANTIC, USER_PREFERENCE, CUSTOM), and LangChain/LangGraph memory integration. DO NOT use for agent source code (use /agentbase-wizard), agent identity or outbound auth (use /agentbase-identity), platform LLM API keys (use /agentbase-llm), or runtime logs (use /agentbase-monitor).Other plugins' skills for the same job