用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Snowflake-Labs/sfquickstarts --skill setup-deploy命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| 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>.