بنقرة واحدة
setup-deploy
Deploy AI Cost Dashboard stored procedures and Streamlit app to Snowflake.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Deploy AI Cost Dashboard stored procedures and Streamlit app to Snowflake.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Draft on-brand marketing copy – product announcement emails and slide outlines – that follows Peak Outfitters' brand voice and style guidelines. Use whenever the user wants to write marketing content, a launch email, an announcement, or a slide/deck outline, even if they don't mention the brand explicitly. Triggers: brand content, marketing copy, launch email, announcement, deck outline, slide outline, on-brand, style guide.
Detect anomalies in hot food sales data. Use this skill when the user asks about unusual patterns, spikes, drops, outliers, or unexpected changes in revenue, quantity sold, or transaction counts across stores, categories, states, or items.
Generate a comprehensive sales report by store or by state. Use this skill when the user asks for a sales report, performance summary, store report, state report, executive summary, or full analysis of a specific store or state.
**[REQUIRED]** Use for ALL tasks combining Snowflake Cortex AI functions with Ibis (Python dataframe library): AI_COMPLETE, AI_SENTIMENT, AI_CLASSIFY, AI_EXTRACT, AI_FILTER, AI_SUMMARIZE_AGG, SNOWFLAKE.CORTEX.COMPLETE, SNOWFLAKE.CORTEX.EMBED_TEXT_768/1024, vector similarity search, semantic search, EnrichmentPipeline, direct Cortex REST API calls (PAT auth, JWT auth, streaming SSE, tool calling), cortex_ibis, cortex_rest.
Analyze Snowflake AI cost data and generate insights and reports.
Build and manage a Snowflake AI Cost Dashboard using stored procedures and Streamlit. Use for **ALL** requests involving: AI cost, AI spending, cost dashboard, spending dashboard, Snowflake AI credits, Cortex cost tracking. DO NOT attempt AI cost dashboard work manually - invoke this skill first.
| name | setup-deploy |
| description | Deploy AI Cost Dashboard stored procedures and Streamlit app to Snowflake. |
| parent_skill | ai-cost-dashboard |
From ai-cost-dashboard SKILL.md when user selects Setup / Deploy intent.
cortex_ai_cost_dashboard/All object names are configurable. The source files use template placeholders ({{DATABASE}}, {{SCHEMA}}, {{WAREHOUSE}}). The deploy process resolves these before execution.
Goal: Collect or confirm all deployment targets.
Actions:
Ask user using ask_user_question with all parameters in a single call:
Store as CONNECTION, DATABASE, SCHEMA, WAREHOUSE, ROLE, CREDIT_RATE, HISTORICAL_CREDIT_RATE.
Output: Confirmed deployment parameters
Goal: Create database, schema, tables, stored procedures, rate tables, and daily task.
Actions:
Read cortex_ai_cost_dashboard/setup.sql
Resolve the {{WAREHOUSE}} placeholder with user's warehouse value
Update {{CREDIT_RATE}} with user's current credit rate and {{HISTORICAL_CREDIT_RATE}} with their historical rate
Write resolved SQL to /tmp/ai_cost_dashboard_deploy/setup.sql
Present deployment plan:
Will create in <DATABASE>.<SCHEMA>:
- 15+ tables (CORTEX_AI_UNIFIED_COSTS, USER_AI_COSTS, + detail tables)
- 2 stored procedures (REFRESH_CORTEX_AI_COSTS, REFRESH_USER_AI_COSTS)
- 1 scheduled task (REFRESH_CORTEX_AI_COSTS_DAILY - 6AM UTC daily)
- Credit rate tables (current: $<CREDIT_RATE>/credit, historical: $<HISTORICAL_CREDIT_RATE>/credit)
- Initial data load: 365 days
STOP: Get user approval before executing.
Execute via bash:
snow sql -f /tmp/ai_cost_dashboard_deploy/setup.sql \
--connection <CONNECTION> --role <ROLE> \
--warehouse <WAREHOUSE> --database <DATABASE> --schema <SCHEMA>
Verify:
SELECT TABLE_NAME, ROW_COUNT
FROM <DATABASE>.INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = '<SCHEMA>'
ORDER BY TABLE_NAME;
If errors occur:
Output: Created database objects
Goal: Deploy the Streamlit app to Snowflake.
Actions:
Resolve cortex_ai_cost_dashboard/snowflake.yml — replace {{DATABASE}} → <DATABASE>, {{SCHEMA}} → <SCHEMA>, {{WAREHOUSE}} → <WAREHOUSE>. Write back in-place (will restore after deploy).
Create stage:
USE SCHEMA <DATABASE>.<SCHEMA>;
CREATE STAGE IF NOT EXISTS STREAMLIT_STAGE;
Deploy via bash from the project directory:
snow streamlit deploy --connection <CONNECTION> --replace
Restore snowflake.yml to its template version (with {{}} placeholders).
Verify:
SHOW STREAMLITS LIKE 'CORTEX_AI_COST_DASHBOARD' IN SCHEMA <DATABASE>.<SCHEMA>;
Output: Deployed Streamlit app
Goal: Upload resolved semantic model YAML to stage.
Actions:
Resolve cortex_ai_cost_dashboard/cortex_ai_costs_model.yaml — replace {{DATABASE}} → <DATABASE>, {{SCHEMA}} → <SCHEMA>. Write to /tmp/ai_cost_dashboard_deploy/cortex_ai_costs_model.yaml.
Upload via bash:
snow stage copy /tmp/ai_cost_dashboard_deploy/cortex_ai_costs_model.yaml \
@<DATABASE>.<SCHEMA>.STREAMLIT_STAGE --connection <CONNECTION> --overwrite
Output: Semantic model on stage
Goal: Confirm everything works together.
Actions:
Test stored procedures:
CALL <DATABASE>.<SCHEMA>.REFRESH_CORTEX_AI_COSTS(7);
CALL <DATABASE>.<SCHEMA>.REFRESH_USER_AI_COSTS(7);
Check task status:
SHOW TASKS LIKE 'REFRESH_CORTEX_AI_COSTS_DAILY' IN SCHEMA <DATABASE>.<SCHEMA>;
Ask user if they want to resume the task.
Cleanup: rm -rf /tmp/ai_cost_dashboard_deploy
Present summary:
Deployment complete:
- Database/Schema: <DATABASE>.<SCHEMA>
- Warehouse: <WAREHOUSE>
- Credit Rate: $<CREDIT_RATE>/credit (current), $<HISTORICAL_CREDIT_RATE>/credit (historical)
- Tables: created and populated
- Procedures: REFRESH_CORTEX_AI_COSTS, REFRESH_USER_AI_COSTS
- Task: REFRESH_CORTEX_AI_COSTS_DAILY (suspended/resumed)
- Streamlit: <DATABASE>.<SCHEMA>.CORTEX_AI_COST_DASHBOARD
- Semantic Model: @<DATABASE>.<SCHEMA>.STREAMLIT_STAGE/cortex_ai_costs_model.yaml
Output: Validated deployment
Fully deployed AI Cost Dashboard with all objects in user-specified <DATABASE>.<SCHEMA>.