mdg-create-and-edit
БесплатноБез исполняемых скриптовНе проверенCreate, edit, and manage rules -- data governance rules, compliance rules, monitoring rules, alerts, MDG rules. Use when user asks to create a rule, set up…
от tekliner★ 17 звёзд на GitHubОб этом скилле
Marketing Data Governance (MDG)
MCP Tools
clickhouseTool-- query ClickHouse (table discovery, data freshness, SQL testing)createMdgViewTool-- create or replace an MDG rule viewgetMdgRuleLibraryExampleTool-- fetch example rules from the MDG librarytestMdgNotificationTool-- test notification delivery for a rule
How to Create an MDG Rule
If user asks "I want to create a new MDG rule, show me recommended templates" or "How to create an MDG rule?" without specifying requirements, reply that they can create a rule via the [MDG Rules Library](origin + "experimental/agent/data-governance/library") or by describing the rule in plain language. Stop here.
If user provides actual requirements, follow the workflow below.
STEP 1 -- Table Selection and Data Freshness Check
1A -- Select table:
- Use
clickhouseToolto find the most suitable table with data for the rule - Research columns and values to confirm the table fits
1B -- Data freshness check (MANDATORY):
- Find the date column (type Date or DateTime, name contains "date")
- Check latest date:
SELECT max({date_column}) as latest_date FROM {table_name} - If data is stale (older than yesterday):
- Get report title:
SELECT report_type_title FROM src_improvado_datatables WHERE datatable_sql_name = '{table_name}' LIMIT 1 - STOP and inform user: table lacks recent data, they need to extract the report first via [Data Explorer](origin + "/data_explorer_v2/")
- DO NOT proceed to Step 2
- Get report title:
- If data is fresh (yesterday or today): proceed to Step 2
STEP 2 -- Generate and Test SQL
- Translate the user's business logic into SQL following the pseudocode structure below
- Execute the SQL via
clickhouseToolto show preview results - Show actual data to the user
STEP 3 -- Get User Approval and Collect Parameters
- Ask: "Are you satisfied with these results?"
- If not, modify SQL and re-test
- Once confirmed, collect:
- Run frequency: Daily, Weekly, Monthly, Quarterly (default: Daily at 9 AM PST / 17:00 UTC)
- Enable immediately? Yes/No
- Notification email address
STEP 4 -- Create the Rule
- Call
createMdgViewToolwith the tested SQL and collected parameters - View name pattern:
rule_<datasource>_<rule_name>_ai - Use CREATE OR REPLACE VIEW when updating existing rules
- The SQL must be IDENTICAL to what was tested in Step 2
- After success, if enabled: "Your rule will appear on the [Data Governance Dashboard](origin + "experimental/agent/data-governance/dashboard") within 5 minutes."
- If disabled: "Your rule has been created but is disabled. Ask me to enable it later."
- To enable a previously disabled rule: update the view SQL with status = 'Enabled'
createMdgViewTool Parameters
viewName: string (max 150 chars, pattern: rule_*_ai)
sqlQuery: string (SELECT or WITH...SELECT, no semicolon)
ruleName: string (human-readable, 5-200 chars)
ruleDescription: string (10-500 chars)
complianceCategory: one of Metric Compliance | Taxonomy Compliance | Guidelines Compliance | Performance Compliance | Budget Pacing | Data Integrity
businessCategory: string (e.g. "Efficiency", "Quality", "Brand Safety")
severity: High | Medium | Low
runFrequency: Hourly | Daily | Weekly | Monthly | Quarterly
ruleOwners: string (comma-separated emails)
status: Enabled | Disabled
SQL Requirements (ClickHouse)
- Complete SELECT or WITH...SELECT, no trailing semicolon
- No CREATE VIEW -- only the query body
- Use valid ClickHouse functions only
- Prefer explicit column lists over SELECT *
- snake_case aliases with
as - Case-insensitive contains: use ILIKE
- Regex:
match(col, 'pattern')for boolean,extract(str, 'pattern')for capture - All non-aggregated columns must appear in GROUP BY; use HAVING for aggregate filters
- Include in GROUP BY all entity_name and entity_id columns broader than the user-requested entity (e.g. for adsets, include campaign and account names/ids)
- Explicit JOIN...ON, qualify join keys
- Dates:
toDate,toDateTime,parseDateTimeBestEffort,toStartOfWeek/Month/Quarter - Always add a date filter in apply_filter based on user request
- Division: guard with
if(b = 0, 0, a/b) - Strip symbols like $ or % from numeric thresholds
- Filters only in apply_filter CTE. No other CTEs have WHERE.
- Allowed aggregates: any, sum, sumIf, count, countIf, min, max, avg, groupArray, groupUniqArray (with If combinators)
SQL Pseudocode Structure
with
base_table as (
select * from <current_db>.<table_name>
),
apply_filter as (
select * from base_table
where <filters or 1=1>
),
group_by_cte as (
select
<Group By columns>,
<aggregations>
from apply_filter as t
group by <Group By columns>
),
add_ids_and_meta as (
select
'<datasource>' as datasource,
'<rule_name>' as rule_name,
'<description>' as rule_description,
-- expose key metrics as strings
Установить mdg-create-and-edit в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл mdg-create-and-edit?
Create, edit, and manage rules -- data governance rules, compliance rules, monitoring rules, alerts, MDG rules. Use when user asks to create a rule, set up alerts, or monitor metrics.
Как установить скилл mdg-create-and-edit?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mdg-create-and-edit запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic