ワンクリックで
streetlights-demo-cleanup
Remove all demo resources (reverse order)
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Remove all demo resources (reverse order)
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | streetlights-demo-cleanup |
| description | Remove all demo resources (reverse order) |
This will DESTROY all demo resources.
.streetlights-demo/manifest.toml exists (to read resource names)Before executing anything, load the manifest and present the full cleanup plan in plan mode.
STOP — call enter_plan_mode and present this table (fill in values from manifest):
Resource | Value
----------------------------------|--------------------------------------------
Intelligence Agent | {database}.PUBLIC.STREETLIGHTS_AGENT
Cortex Search Service | {database}.PUBLIC.MAINTENANCE_SEARCH
Semantic View | {database}.PUBLIC.STREETLIGHTS_SEMANTIC_VIEW
CLD Database | {cld_database}
Catalog Integration | {prefix}_streetlights_catalog_int
Postgres Instance (optional ⚠️) | {pg_instance} — ask separately, billable
Network Policy (if demo-created) | {pg_network_policy} — blank = pre-existing, skip
Warehouse (if demo-created) | {warehouse} — skip if `warehouse_created_by_demo = false`
Main Database | {database}
Local config | .streetlights-demo/
Steps that existed (SiS app, Forecast model) are dropped with IF EXISTS — safe to run even if not created.
Use ask_user_question to confirm:
If user cancels: stop. Do not execute anything.
If user confirms: call exit_plan_mode, then execute the steps below in order.
Execute in this exact order — each step depends on the previous:
Must run BEFORE Drop Agent — removes the agent from the Intelligence UI registry.
-- Note: syntax is DROP AGENT (not REMOVE AGENT)
ALTER SNOWFLAKE INTELLIGENCE SNOWFLAKE_INTELLIGENCE_OBJECT_DEFAULT
DROP AGENT {database}.{schema}.STREETLIGHTS_AGENT;
DROP STREAMLIT IF EXISTS {database}.{schema}.STREETLIGHTS_APP;
DROP SNOWFLAKE.ML.FORECAST IF EXISTS {database}.{schema}.BULB_FAILURE_FORECASTER;
DROP AGENT IF EXISTS {database}.{schema}.STREETLIGHTS_AGENT;
DROP CORTEX SEARCH SERVICE IF EXISTS {database}.{schema}.MAINTENANCE_SEARCH;
DROP SEMANTIC VIEW IF EXISTS {database}.{schema}.STREETLIGHTS_SEMANTIC_VIEW;
DROP DATABASE IF EXISTS {cld_database};
DROP CATALOG INTEGRATION IF EXISTS {prefix}_streetlights_catalog_int;
⚠️ BILLABLE + DESTRUCTIVE — Use ask_user_question before proceeding:
{pg_instance}? This stops billing but permanently deletes all Iceberg data on managed storage."If user says No: skip this step and Steps 9–10 (warehouse and main database can still be dropped independently). Leave the PG instance, network policy, and managed Iceberg data intact.
If user says Yes, run in this order:
Detach and drop demo network policy (only if pg_network_policy is set in manifest — skip if blank, meaning a pre-existing policy was used):
ALTER POSTGRES INSTANCE {pg_instance} UNSET NETWORK_POLICY;
DROP NETWORK POLICY IF EXISTS {pg_network_policy};
Never drop a network policy that was not created by this demo. Check
pg_network_policyin manifest — if blank, skip both statements.
Drop the PG instance:
DROP POSTGRES INSTANCE IF EXISTS {pg_instance};
Route to $snowflake-postgres for the DROP POSTGRES INSTANCE operation.
Read warehouse_created_by_demo from manifest:
If true — the demo created this warehouse; drop it unconditionally:
DROP WAREHOUSE IF EXISTS {warehouse};
If false — this warehouse pre-existed the demo; use ask_user_question:
{warehouse} was pre-existing (not created by this demo). Drop it or keep it?"If "Keep it": skip. If "Drop it": run DROP WAREHOUSE IF EXISTS {warehouse};
DROP DATABASE IF EXISTS {database};
rm -rf .streetlights-demo/
Reset all step progress tracking (already handled by step 11 which removes .streetlights-demo/):
# The manifest removal in step 11 resets gate state automatically.
# If you want to reset only gate state without removing the full manifest:
uv run gate --step step-7 --action reset
uv run gate --step step-6 --action reset
uv run gate --step step-5 --action reset
uv run gate --step step-4 --action reset
uv run gate --step step-3 --action reset
uv run gate --step step-2 --action reset
uv run gate --step step-1 --action reset
uv run gate --step setup --action reset
Optional — only needed if you want a completely clean slate before re-running Step 1. Keep the CSVs if you want to reload the same data without regenerating.
rm -rf data/
Files removed: street_lights.csv, maintenance_records.csv, energy_consumption.csv,
light_sensors.csv, weather_enrichment.csv, demographics.csv, power_grid_zones.csv
Also removes the generated Iceberg DDL:
rm -f init/02_create_iceberg_tables.sql
ask_user_question — billable + destructive$snowflake-postgres for PG instance and CLD cleanup