From workflow-skills
Analyze account usage state and trends from Snowflake data. Use when analyzing account usage, investigating trends by product, reviewing account activity, examining organization metrics, or providing account insights. Accepts account name or organization identifier as input. (project, gitignored)
npx claudepluginhub arosenkranz/claude-code-config --plugin workflow-skillsThis skill uses the workspace's default tool permissions.
This skill analyzes account state and usage trends by querying Snowflake data sources. It identifies usage patterns by product over recent months and provides factual, evidence-based insights.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Designs, implements, and audits WCAG 2.2 AA accessible UIs for Web (ARIA/HTML5), iOS (SwiftUI traits), and Android (Compose semantics). Audits code for compliance gaps.
This skill analyzes account state and usage trends by querying Snowflake data sources. It identifies usage patterns by product over recent months and provides factual, evidence-based insights.
CRITICAL: This skill emphasizes factual analysis only. NEVER make up data, infer causation without evidence, or speculate about unclear trends. When reasons are unclear, explicitly state what is known and what remains uncertain.
When the user requests account analysis:
REPORTING.BILLING.FACT_USAGE_REVENUE_BY_PRODUCT_MONTHLY
ORG_ID, REVENUE_MONTH, TOTAL_REVENUE, ON_DEMAND_REVENUE, COMMITTED_REVENUE, BILLING_DIMENSION_ATTRIBUTEDREPORTING.GENERAL.DIM_PRODUCT_CATEGORY_MAPPING ⭐ CRITICAL
BILLING_DIMENSION, PRODUCT_CATEGORY_MBR, PRODUCT_FAMILY_MBRBILLING_DIMENSION = fact_table.BILLING_DIMENSION_ATTRIBUTEDREPORTING.GENERAL.DIM_SALESFORCE_ACCOUNT
ORG_ID, NAME, ACCOUNT_HEALTH_STATUS, CHURN_RISK_LIKELIHOOD, CHURN_RISK_REASON, CUSTOMER_TIERREPORTING.SALES.DIM_SALESFORCE_OPPORTUNITY
ORG_ID, SALESFORCE_ACCOUNT_ID, OPPORTUNITY_NAME, RISK_RED_FLAGS, PRIMARY_COMPETITOR, CLOSED_LOST_REASON'application performance monitoring' - APM'infrastructure monitoring' - Infrastructure'log management' - Logs'real user monitoring' - RUM'network monitoring' - Network'database monitoring' - Database Monitoring'serverless' - ServerlessALWAYS use this join pattern for accurate product categorization:
FROM REPORTING.BILLING.FACT_USAGE_REVENUE_BY_PRODUCT_MONTHLY f
JOIN REPORTING.GENERAL.DIM_PRODUCT_CATEGORY_MAPPING m
ON f.BILLING_DIMENSION_ATTRIBUTED = m.BILLING_DIMENSION
WHERE m.PRODUCT_CATEGORY_MBR = 'application performance monitoring' -- or other product
❌ NEVER do this:
WHERE PRODUCT_CATEGORY = 'apm' -- WRONG - incomplete/inaccurate data
Why this matters:
PRODUCT_CATEGORY field gives incomplete resultsGoal: Get high-level trends and identify which orgs need deep dives
SELECT ORG_ID, NAME, ACCOUNT_HEALTH_STATUS, CHURN_RISK_LIKELIHOOD
FROM REPORTING.GENERAL.DIM_SALESFORCE_ACCOUNT
WHERE ORG_ID IN (list_of_orgs);
WITH monthly_revenue AS (
SELECT
f.ORG_ID,
f.REVENUE_MONTH,
SUM(f.TOTAL_REVENUE) as revenue
FROM REPORTING.BILLING.FACT_USAGE_REVENUE_BY_PRODUCT_MONTHLY f
JOIN REPORTING.GENERAL.DIM_PRODUCT_CATEGORY_MAPPING m
ON f.BILLING_DIMENSION_ATTRIBUTED = m.BILLING_DIMENSION
WHERE m.PRODUCT_CATEGORY_MBR = 'application performance monitoring' -- adjust as needed
AND f.ORG_ID IN (list_of_orgs)
AND f.REVENUE_MONTH >= DATEADD(month, -6, CURRENT_DATE())
GROUP BY f.ORG_ID, f.REVENUE_MONTH
),
with_lag AS (
SELECT
ORG_ID,
REVENUE_MONTH,
revenue,
LAG(revenue) OVER (PARTITION BY ORG_ID ORDER BY REVENUE_MONTH) as prev_revenue
FROM monthly_revenue
)
SELECT
ORG_ID,
REVENUE_MONTH,
ROUND(revenue, 2) as current_revenue,
ROUND((revenue - prev_revenue) / NULLIF(prev_revenue, 0) * 100, 1) as mom_change_pct
FROM with_lag
ORDER BY ORG_ID, REVENUE_MONTH DESC;
SELECT
f.ORG_ID,
m.PRODUCT_CATEGORY_MBR,
f.REVENUE_MONTH,
SUM(f.TOTAL_REVENUE) as revenue
FROM REPORTING.BILLING.FACT_USAGE_REVENUE_BY_PRODUCT_MONTHLY f
JOIN REPORTING.GENERAL.DIM_PRODUCT_CATEGORY_MAPPING m
ON f.BILLING_DIMENSION_ATTRIBUTED = m.BILLING_DIMENSION
WHERE f.ORG_ID IN (list_of_orgs)
AND f.REVENUE_MONTH >= DATEADD(month, -6, CURRENT_DATE())
AND m.PRODUCT_CATEGORY_MBR IN (
'application performance monitoring',
'infrastructure monitoring',
'log management',
'real user monitoring',
'network monitoring'
)
GROUP BY f.ORG_ID, m.PRODUCT_CATEGORY_MBR, f.REVENUE_MONTH
ORDER BY f.ORG_ID, m.PRODUCT_CATEGORY_MBR, f.REVENUE_MONTH DESC;
Limit to 5-7 products to avoid token limits
SELECT
sa.NAME as account_name,
sa.ORG_ID,
sa.ACCOUNT_HEALTH_STATUS,
sa.CHURN_RISK_LIKELIHOOD,
sa.CHURN_RISK_REASON,
sa.CUSTOMER_TIER,
so.OPPORTUNITY_NAME,
so.STAGE_CURRENT,
so.RISK_RED_FLAGS,
so.PRIMARY_COMPETITOR,
so.CLOSE_DATE
FROM REPORTING.GENERAL.DIM_SALESFORCE_ACCOUNT sa
LEFT JOIN REPORTING.SALES.DIM_SALESFORCE_OPPORTUNITY so
ON sa.ID = so.SALESFORCE_ACCOUNT_ID
WHERE sa.ORG_ID IN (list_of_orgs)
AND (so.IS_OPEN = TRUE OR so.CLOSE_DATE >= DATEADD(month, -6, CURRENT_DATE()))
ORDER BY sa.ORG_ID, so.CLOSE_DATE DESC
LIMIT 50;
Goal: Understand "what changed" within the product
For orgs with:
SELECT
f.REVENUE_MONTH,
f.BILLING_DIMENSION_ATTRIBUTED,
ROUND(SUM(f.TOTAL_REVENUE), 2) as revenue,
ROUND(SUM(f.TOTAL_REVENUE) - LAG(SUM(f.TOTAL_REVENUE)) OVER (
PARTITION BY f.BILLING_DIMENSION_ATTRIBUTED
ORDER BY f.REVENUE_MONTH
), 2) as mom_change_abs,
ROUND(((SUM(f.TOTAL_REVENUE) - LAG(SUM(f.TOTAL_REVENUE)) OVER (
PARTITION BY f.BILLING_DIMENSION_ATTRIBUTED
ORDER BY f.REVENUE_MONTH
)) / NULLIF(LAG(SUM(f.TOTAL_REVENUE)) OVER (
PARTITION BY f.BILLING_DIMENSION_ATTRIBUTED
ORDER BY f.REVENUE_MONTH
), 0) * 100), 1) as mom_change_pct
FROM REPORTING.BILLING.FACT_USAGE_REVENUE_BY_PRODUCT_MONTHLY f
JOIN REPORTING.GENERAL.DIM_PRODUCT_CATEGORY_MAPPING m
ON f.BILLING_DIMENSION_ATTRIBUTED = m.BILLING_DIMENSION
WHERE f.ORG_ID = specific_org
AND m.PRODUCT_CATEGORY_MBR = 'application performance monitoring'
AND f.REVENUE_MONTH >= DATEADD(month, -6, CURRENT_DATE())
GROUP BY f.REVENUE_MONTH, f.BILLING_DIMENSION_ATTRIBUTED
ORDER BY f.REVENUE_MONTH DESC, revenue DESC;
This reveals:
Product revenue declining?
├─ YES → Are other products also declining?
│ ├─ YES → **Account-wide issue** (NEGATIVE)
│ │ Actions:
│ │ - Check Salesforce RISK_RED_FLAGS for root cause
│ │ - Look for: budget pressure, competitor threat, churn risk
│ │ - Assess if intervention needed (CSM, product team)
│ │
│ └─ NO → **Product-specific issue**
│ └─ Check billing dimensions breakdown
│ ├─ One dimension dropped sharply?
│ │ → Likely optimization (often POSITIVE)
│ │ → Example: ingested_spans dropped 70% while apm_host grew
│ │
│ └─ All dimensions declining?
│ → Coverage reduction (NEGATIVE)
│ → Teams may be migrating away from product
│
└─ NO → Product stable or growing
└─ Check for spike-then-drop pattern
├─ Large spike one month, then 30-70% drop next month?
│ → Migration with optimization (POSITIVE)
│ → Example: Enable full tracing, then implement sampling
│
└─ Steady growth?
→ Healthy expansion (POSITIVE)
What it looks like:
Likely cause: Optimization after migration
How to validate:
ingested_spans or similar volume metric dropped sharply while apm_host/infra_host grew → CONFIRMEDAssessment: ✅ POSITIVE - Sophisticated cost management, long-term commitment
Example: Itau Unibanco Aug→Sep 2025
What it looks like:
Likely causes:
How to validate:
RISK_RED_FLAGS and CHURN_RISK_REASONACCOUNT_HEALTH_STATUS (likely Red or Yellow)Assessment: 🔴 NEGATIVE - Requires immediate attention
Example: UKG
What it looks like:
Likely causes:
How to validate:
Assessment: ⚠️ NEUTRAL - Monitor but may not be concerning
Example: Pluto TV
apm_host - Core APM coverage (if this drops, coverage is down) 🔴apm_fargate - Fargate-specific APMingested_spans - Trace volume (drops here often = optimization) ✅apm_trace_search - Trace analysis usagedata_stream_monitoring - Data stream monitoringKey insight: If apm_host grows but ingested_spans drops → Optimization ✅
infra_host - Host count (core metric) 🔴infra_container - Container monitoringinfra_aas - Infrastructure as a servicelogs_indexed - Indexed log volumelogs_ingested - Total log ingestionrum_sessions - Session countrum_lite - RUM Lite sessionsBILLING_DIMENSION_ATTRIBUTEDWHERE revenue > 1000Token Limit Management:
WHERE revenue > 1000 to filter noiseLIMIT aggressively in exploratory queriesJoin Optimization:
REVENUE_MONTH early (reduces rows scanned)ROUND() to reduce precision (fewer tokens in output)Aggregation:
LAG, LEAD) for MoM calculationsFor each org:
IMPORTANT:
Analyze APM trends for orgs: 39037, 1561702, 1000113427, 604170, 700722
Product focus: application performance monitoring
Time range: Last 6 months
Expected flow:
Analyze account health for org: 700722
Compare: APM, Infrastructure, Logs, RUM, Serverless, Network
Time range: Last 12 months
Expected flow:
Find top 3 expansions and contractions for:
Product: application performance monitoring
Period: August 2025 vs September 2025
Expected flow:
WHERE revenue > 1000 to filter noiseLIMIT to cap result sizeWhen data is insufficient or unclear:
Example: "APM revenue dropped 40% in September (from $200K to $120K). Billing dimension data shows ingested_spans dropped 70% while apm_host grew 5%, indicating this is likely span sampling optimization rather than coverage reduction. However, without customer interviews, we cannot confirm the specific optimization techniques used."
The goal is not to guess why trends exist, but to:
When in doubt: Report the facts, classify the pattern, state uncertainty, and recommend follow-up.