{"id":"b5fa641c-99e6-4b6e-b881-79d772d3ba76","shortId":"z7hrjt","kind":"skill","title":"monte-carlo-context-detection","tagline":"Route data-related requests to the right Monte Carlo skill or workflow. USE WHEN alerts, incidents, data broken, stale, coverage gaps, data quality, or any ambiguous data observability request.","description":"# Monte Carlo Context Detection\n\nThis skill determines which Monte Carlo skill or workflow best fits the user's current context. It activates reactively for ambiguous or multi-step data-related messages, gathers signals, and routes to the right skill or workflow.\n\nReference file for signal definitions: `references/signal-definitions.md` (relative to this file). Read it before routing.\n\n## When to activate this skill\n\nThis skill is activated by the CLAUDE.md routing table when:\n\n- The user's message relates to data quality, alerts, incidents, coverage, or Monte Carlo — but doesn't clearly match a single skill in the routing table\n- The user's intent is ambiguous or could span multiple skills\n- The user asks a broad question like \"help me with my data\" or \"what's going on?\"\n\n## When NOT to activate this skill\n\n- A skill or workflow is already active in the conversation — the active skill owns the conversation, do not intercept\n- The user's message clearly matches a single skill in the CLAUDE.md routing table — route directly, no need for context detection\n- The user is editing a dbt model — defer to the `prevent` skill which auto-activates via hooks\n- The user's message is not data-related at all\n\n---\n\n## Workflow: Reactive Routing\n\nThis skill is purely reactive — it activates for ambiguous or multi-step data-related messages and routes them.\n\nFollow these steps in order.\n\n### Step 0: Fast-path clear intent (stop early if matched)\n\nBefore doing anything else, check whether the user's message unambiguously matches a single existing skill. If so, **skip the rest of this workflow** and immediately load that skill — do NOT read `references/signal-definitions.md`, do NOT make API probes.\n\n| Clear user intent | Skill to load immediately |\n|---|---|\n| \"Check health of [named table]\" / \"status of [named table]\" | `../asset-health/SKILL.md` |\n| \"Create a [monitor type] on [named table]\" | `../monitoring-advisor/SKILL.md` |\n| \"Investigate alert on [named table]\" / \"why is [named table] stale/broken?\" | `../incident-response/SKILL.md` |\n| \"What should I monitor?\" / \"where are my coverage gaps?\" | `../proactive-monitoring/SKILL.md` |\n| \"Instrument my agent\" / \"set up Monte Carlo tracing on [named framework] agent\" / \"setting up an agent\" | `../instrument-agent/SKILL.md` |\n\nContext-detection is for **ambiguous** requests only. If the request is clear, routing through this skill wastes turns and tokens.\n\nIf no clear match, proceed to Step 1.\n\n### Step 1: Categorize intent\n\nRead `references/signal-definitions.md` for the full signal catalog. Determine which category the user's message falls into:\n\n| Category | Signals | Example messages |\n|----------|---------|-----------------|\n| **Specific asset** | User mentions a table name, or has a `.sql` model file open in their IDE | \"what's wrong with stg_payments?\", \"check this table\" |\n| **Active incident** | Keywords: alert, broken, stale, failing, incident, triage, wrong data | \"I have alerts firing\", \"data looks wrong\", \"something broke\" |\n| **Coverage/monitoring** | Keywords: monitor, coverage, gaps, unmonitored, what should I watch | \"what should I monitor?\", \"where are my gaps?\" |\n| **Agent instrumentation** | Keywords: instrument, set up tracing, set up Monte Carlo tracing, setting up an agent. Often mentions an AI framework (LangChain, LangGraph, OpenAI, Anthropic, CrewAI, Bedrock, SageMaker, Vertex AI) | \"instrument my agent\", \"set up MC tracing on my LangGraph agent\", \"setting up an agent\" |\n| **General/exploratory** | No clear category, broad question | \"help me with data quality\", \"what can Monte Carlo do?\" |\n\n### Step 2: Gather scope (only if needed)\n\n- **Specific asset known** (from file context or user mention) → proceed to Step 3\n- **Active incident, no scope** → ask: \"Want me to check recent alerts? Any specific time range or severity?\"\n- **Coverage/monitoring, no scope** → ask: \"Which warehouse should I look at, or should I check across all?\"\n- **General/exploratory** → present the categories: \"I can help with: (1) investigating active alerts or data issues, (2) analyzing monitoring coverage and creating monitors, or (3) checking the health of specific tables. What are you looking for?\"\n\n### Step 3: Scoped API probe (when scope is available)\n\nOnly make API calls when you have enough context to scope them:\n\n- **Specific asset** → call `get_alerts` with the table's MCON or name filter, and `get_monitors` for that table\n- **Active incident with scope** → call `get_alerts` with the user's time range / severity filters\n- **Coverage/monitoring** → skip API probe, route directly to proactive monitoring workflow (it handles its own API calls)\n- **If MCP tool calls fail** (auth not configured) → skip API, fall back to conversation intent alone\n\n**Always scope MCP calls tightly.** Unscoped `get_alerts`, `search`, or `get_monitors` on large accounts can return hundreds of results, overflow the tool-result token limit, spill to disk, and force expensive chunk reads — burning user tokens and risking workflow failure. Minimum scoping:\n\n- `get_alerts` → time filter (`created_after`, default last 7 days) + at least one of `warehouse`, `table_names`, `severity`\n- `search` → needed to resolve a table name to its MCON (`get_table` requires MCON). ALWAYS pass `limit` (e.g. 5), the table name as `query`, and filter by `warehouse_uuid` or `database`/`schema`. `warehouse_types` alone (\"snowflake\") matches thousands of tables. Disambiguation rules when multiple matches return:\n  1. If the user named a warehouse (e.g. \"analytics-snowflake\") → auto-pick the match whose `warehouse_display_name` matches and proceed. Do NOT stop to ask.\n  2. If the user named a database/schema → auto-pick the match in that database/schema.\n  3. If one match is flagged `is_key_asset: true` and others aren't → auto-pick the key asset.\n  4. Only ask the user to disambiguate when none of the above resolve it.\n- `get_monitors` → always filter by `mcons` (table MCON) or `warehouse_uuid`\n\nIf you don't have enough scope, ask the user before calling.\n\n### Step 4: Route\n\nBased on the combined signals from Steps 1-3:\n\n| Combined signals | Confidence | Action |\n|-----------------|------------|--------|\n| Active alerts found + incident intent | High | **Auto-activate** incident response workflow: read and follow `../incident-response/SKILL.md` |\n| Coverage intent + data project detected | High | **Auto-activate** proactive monitoring workflow: read and follow `../proactive-monitoring/SKILL.md` |\n| User asks to create a specific monitor (type + table known) | High | **Auto-activate** monitoring-advisor: read and follow `../monitoring-advisor/SKILL.md` |\n| Table mentioned + \"health\" / \"status\" / \"check\" intent | High | **Auto-activate** asset-health: read and follow `../asset-health/SKILL.md` |\n| Agent instrumentation intent (instrument / set up tracing / setting up an agent) + Python codebase context | High | **Auto-activate** instrument-agent: read and follow `../instrument-agent/SKILL.md` |\n| Ambiguous or conflicting signals | Low | **Suggest** options and wait for user to choose |\n\n**High confidence = auto-activate.** Load the target skill's SKILL.md and begin executing it immediately. Do not ask for confirmation.\n\n**Low confidence = suggest.** Present 2-3 options with brief descriptions and let the user choose. Example:\n\n> \"Based on what you've described, I can:\n> 1. **Investigate alerts** — triage and fix active data issues (incident response workflow)\n> 2. **Improve monitoring** — find coverage gaps and create monitors (proactive monitoring workflow)\n>\n> Which would be most helpful?\"\n\n### Prevent guardrail\n\nIf the user is **actively editing** a dbt model file (making code changes, not just viewing or asking about it) and the `prevent` skill's hooks are active, do NOT route to any other skill. Instead respond:\n\n> \"The prevent skill will automatically handle impact assessment for dbt model changes via its pre-edit hooks. No additional routing needed.\"","tags":["context","detection","agent","toolkit","monte-carlo-data","agent-observability","agent-skills","ai-agents","claude-code","codex-skills","cursor","data-observability"],"capabilities":["skill","source-monte-carlo-data","skill-context-detection","topic-agent-observability","topic-agent-skills","topic-ai-agents","topic-claude-code","topic-codex-skills","topic-cursor","topic-data-observability","topic-data-quality","topic-mcp","topic-monte-carlo","topic-opencode","topic-skill-md"],"categories":["mc-agent-toolkit"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/monte-carlo-data/mc-agent-toolkit/context-detection","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add monte-carlo-data/mc-agent-toolkit","source_repo":"https://github.com/monte-carlo-data/mc-agent-toolkit","install_from":"skills.sh"}},"qualityScore":"0.492","qualityRationale":"deterministic score 0.49 from registry signals: · indexed on github topic:agent-skills · 84 github stars · SKILL.md body (7,993 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:56:43.175Z","embedding":null,"createdAt":"2026-04-20T19:31:43.335Z","updatedAt":"2026-05-18T18:56:43.175Z","lastSeenAt":"2026-05-18T18:56:43.175Z","tsv":"'-3':949,1088 '/asset-health/skill.md':330,1023 '/incident-response/skill.md':349,969 '/instrument-agent/skill.md':376,1048 '/monitoring-advisor/skill.md':338,1006 '/proactive-monitoring/skill.md':359,985 '0':266 '1':405,407,616,838,948,1107 '2':556,623,866,1087,1119 '3':574,631,644,881 '4':901,939 '5':810 '7':782 'account':744 'across':606 'action':953 'activ':57,95,101,165,174,179,223,246,456,575,618,683,954,962,978,999,1016,1041,1066,1113,1142,1165 'addit':1194 'advisor':1002 'agent':362,371,375,494,509,526,534,538,1024,1034,1044 'ai':513,523 'alert':21,116,340,459,469,585,619,668,689,737,775,955,1109 'alon':729,826 'alreadi':173 'alway':730,806,917 'ambigu':32,60,139,248,382,1049 'analyt':847 'analytics-snowflak':846 'analyz':624 'anthrop':518 'anyth':278 'api':312,646,654,700,712,723 'aren':893 'ask':147,579,595,865,903,933,987,1080,1155 'assess':1182 'asset':431,563,665,889,900,1018 'asset-health':1017 'auth':719 'auto':222,850,874,896,961,977,998,1015,1040,1065 'auto-activ':221,960,976,997,1014,1039,1064 'auto-pick':849,873,895 'automat':1179 'avail':651 'back':725 'base':941,1099 'bedrock':520 'begin':1074 'best':49 'brief':1091 'broad':149,543 'broke':475 'broken':24,460 'burn':765 'call':655,666,687,713,717,733,937 'carlo':3,15,37,45,121,366,504,553 'catalog':416 'categor':408 'categori':419,426,542,611 'chang':1150,1186 'check':280,321,453,583,605,632,1011 'choos':1061,1097 'chunk':763 'claude.md':104,198 'clear':125,191,270,314,389,400,541 'code':1149 'codebas':1036 'combin':944,950 'confid':952,1063,1084 'configur':721 'confirm':1082 'conflict':1051 'context':4,38,55,206,378,567,660,1037 'context-detect':377 'convers':177,183,727 'could':141 'coverag':26,118,357,479,626,970,1123 'coverage/monitoring':476,592,698 'creat':331,628,778,989,1126 'crewai':519 'current':54 'data':8,23,28,33,66,114,156,233,254,466,471,548,621,972,1114 'data-rel':7,65,232,253 'databas':822 'database/schema':872,880 'day':783 'dbt':213,1145,1184 'default':780 'defer':215 'definit':83 'describ':1104 'descript':1092 'detect':5,39,207,379,974 'determin':42,417 'direct':202,703 'disambigu':832,907 'disk':759 'display':856 'doesn':123 'e.g':809,845 'earli':273 'edit':211,1143,1191 'els':279 'enough':659,931 'exampl':428,1098 'execut':1075 'exist':290 'expens':762 'fail':462,718 'failur':771 'fall':424,724 'fast':268 'fast-path':267 'file':80,88,442,566,1147 'filter':676,697,777,817,918 'find':1122 'fire':470 'fit':50 'fix':1112 'flag':886 'follow':260,968,984,1005,1022,1047 'forc':761 'found':956 'framework':370,514 'full':414 'gap':27,358,480,493,1124 'gather':69,557 'general/exploratory':539,608 'get':667,678,688,736,740,774,802,915 'go':160 'guardrail':1137 'handl':709,1180 'health':322,634,1009,1019 'help':152,545,614,1135 'high':959,975,996,1013,1038,1062 'hook':225,1163,1192 'hundr':747 'ide':446 'immedi':301,320,1077 'impact':1181 'improv':1120 'incid':22,117,457,463,576,684,957,963,1116 'instead':1173 'instrument':360,495,497,524,1025,1027,1043 'instrument-ag':1042 'intent':137,271,316,409,728,958,971,1012,1026 'intercept':186 'investig':339,617,1108 'issu':622,1115 'key':888,899 'keyword':458,477,496 'known':564,995 'langchain':515 'langgraph':516,533 'larg':743 'last':781 'least':785 'let':1094 'like':151 'limit':756,808 'load':302,319,1067 'look':472,600,641 'low':1053,1083 'make':311,653,1148 'match':126,192,275,287,401,828,836,853,858,877,884 'mc':529 'mcon':673,801,805,920,922 'mcp':715,732 'mention':433,511,570,1008 'messag':68,111,190,229,256,285,423,429 'minimum':772 'model':214,441,1146,1185 'monitor':333,353,478,489,625,629,679,706,741,916,980,992,1001,1121,1127,1129 'monitoring-advisor':1000 'mont':2,14,36,44,120,365,503,552 'monte-carlo-context-detect':1 'multi':63,251 'multi-step':62,250 'multipl':143,835 'name':324,328,336,342,346,369,436,675,790,798,813,842,857,870 'need':204,561,793,1196 'none':909 'observ':34 'often':510 'one':786,883 'open':443 'openai':517 'option':1055,1089 'order':264 'other':892 'overflow':750 'own':181 'pass':807 'path':269 'payment':452 'pick':851,875,897 'pre':1190 'pre-edit':1189 'present':609,1086 'prevent':218,1136,1160,1176 'proactiv':705,979,1128 'probe':313,647,701 'proceed':402,571,860 'project':973 'pure':243 'python':1035 'qualiti':29,115,549 'queri':815 'question':150,544 'rang':589,695 'reactiv':58,238,244 'read':89,307,410,764,966,982,1003,1020,1045 'recent':584 'refer':79 'references/signal-definitions.md':84,308,411 'relat':9,67,85,112,234,255 'request':10,35,383,387 'requir':804 'resolv':795,913 'respond':1174 'respons':964,1117 'rest':296 'result':749,754 'return':746,837 'right':13,75 'risk':769 'rout':6,72,92,105,132,199,201,239,258,390,702,940,1168,1195 'rule':833 'sagemak':521 'schema':823 'scope':558,578,594,645,649,662,686,731,773,932 'search':738,792 'set':363,372,498,501,506,527,535,1028,1031 'sever':591,696,791 'signal':70,82,415,427,945,951,1052 'singl':128,194,289 'skill':16,41,46,76,97,99,129,144,167,169,180,195,219,241,291,304,317,393,1070,1161,1172,1177 'skill-context-detection' 'skill.md':1072 'skip':294,699,722 'snowflak':827,848 'someth':474 'source-monte-carlo-data' 'span':142 'specif':430,562,587,636,664,991 'spill':757 'sql':440 'stale':25,461 'stale/broken':348 'status':326,1010 'step':64,252,262,265,404,406,555,573,643,938,947 'stg':451 'stop':272,863 'suggest':1054,1085 'tabl':106,133,200,325,329,337,343,347,435,455,637,671,682,789,797,803,812,831,921,994,1007 'target':1069 'thousand':829 'tight':734 'time':588,694,776 'token':397,755,767 'tool':716,753 'tool-result':752 'topic-agent-observability' 'topic-agent-skills' 'topic-ai-agents' 'topic-claude-code' 'topic-codex-skills' 'topic-cursor' 'topic-data-observability' 'topic-data-quality' 'topic-mcp' 'topic-monte-carlo' 'topic-opencode' 'topic-skill-md' 'trace':367,500,505,530,1030 'triag':464,1110 'true':890 'turn':395 'type':334,825,993 'unambigu':286 'unmonitor':481 'unscop':735 'use':19 'user':52,109,135,146,188,209,227,283,315,421,432,569,692,766,841,869,905,935,986,1059,1096,1140 'uuid':820,925 've':1103 'vertex':522 'via':224,1187 'view':1153 'wait':1057 'want':580 'warehous':597,788,819,824,844,855,924 'wast':394 'watch':485 'whether':281 'whose':854 'workflow':18,48,78,171,237,299,707,770,965,981,1118,1130 'would':1132 'wrong':449,465,473","prices":[{"id":"cc26b026-e9f2-45cf-8fc4-20bbbd9b595a","listingId":"b5fa641c-99e6-4b6e-b881-79d772d3ba76","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"monte-carlo-data","category":"mc-agent-toolkit","install_from":"skills.sh"},"createdAt":"2026-04-20T19:31:43.335Z"}],"sources":[{"listingId":"b5fa641c-99e6-4b6e-b881-79d772d3ba76","source":"github","sourceId":"monte-carlo-data/mc-agent-toolkit/context-detection","sourceUrl":"https://github.com/monte-carlo-data/mc-agent-toolkit/tree/main/skills/context-detection","isPrimary":false,"firstSeenAt":"2026-04-20T19:31:43.335Z","lastSeenAt":"2026-05-18T18:56:43.175Z"}],"details":{"listingId":"b5fa641c-99e6-4b6e-b881-79d772d3ba76","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"monte-carlo-data","slug":"context-detection","github":{"repo":"monte-carlo-data/mc-agent-toolkit","stars":84,"topics":["agent-observability","agent-skills","ai-agents","claude-code","codex-skills","cursor","data-observability","data-quality","mcp","monte-carlo","opencode","skill-md","skillsmp","vscode"],"license":"apache-2.0","html_url":"https://github.com/monte-carlo-data/mc-agent-toolkit","pushed_at":"2026-05-15T17:55:40Z","description":"Official Monte Carlo toolkit for AI coding agents. Skills and plugins that bring data and agent observability — monitoring, triaging, troubleshooting, health checks  — into Claude Code, Cursor, and more.","skill_md_sha":"d7611d32dd1ff99c9a9af5bbe291948bc1b21113","skill_md_path":"skills/context-detection/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/monte-carlo-data/mc-agent-toolkit/tree/main/skills/context-detection"},"layout":"multi","source":"github","category":"mc-agent-toolkit","frontmatter":{"name":"monte-carlo-context-detection","description":"Route data-related requests to the right Monte Carlo skill or workflow. USE WHEN alerts, incidents, data broken, stale, coverage gaps, data quality, or any ambiguous data observability request."},"skills_sh_url":"https://skills.sh/monte-carlo-data/mc-agent-toolkit/context-detection"},"updatedAt":"2026-05-18T18:56:43.175Z"}}