lhm-template-manage
БесплатноЗапускает вложенные скриптыНе проверенManages CRUD operations (list/detail/create/update/delete) for LHM data validation templates.
от aliyun★ 303 звезды на GitHubОб этом скилле
lhm-template-manage
Dispatches template CRUD operations via --action. All operations reuse the template wrapper functions in the outer scripts/common.py.
Steps
0. Prerequisites
- aliyun CLI + aliyun-cli-lhm plugin (including the template APIs; see "Environment Preparation" in the root README)
- Credentials configured in
~/.lhm/data_validation_config.yamlor environment variables - The template APIs have been released to production (currently only available in staging)
1. List Available Templates
python atomic-skills/lhm-template-manage/scripts/run.py \
--action list \
[--check-type 1] [--name "MIX"] [--is-builtin 1]
2. View Template Details
python atomic-skills/lhm-template-manage/scripts/run.py \
--action detail \
--template-id <UUID or built-in ID>
3. Create a Metric Template
python atomic-skills/lhm-template-manage/scripts/run.py \
--action create \
--name "自定义指标模板" \
--check-type 1 \
--ds-engine-rels-json '[{"dsType":"MaxCompute","engineTypes":["MaxCompute"]}]' \
--metric-rules-json '[{"dataTypeClassify":0,"dataTypeGroup":0,"dataTypeList":["INT","BIGINT"],"checkMethods":"SUM,AVG","diffTolerateType":0,"diffTolerateValues":{"SAME":0},"isCountCheck":1}]'
4. Create a Weak-Content Template
python atomic-skills/lhm-template-manage/scripts/run.py \
--action create \
--name "自定义弱内容模板" \
--check-type 2 \
--ds-engine-rels-json '[{"dsType":"MaxCompute","engineTypes":["MaxCompute"]}]' \
--weak-content-rule-json '{"filterColumnTypes":["TEXT","BLOB"],"filterColumnExpression":".*_bak"}'
5. Update a Template (upsert semantics)
python atomic-skills/lhm-template-manage/scripts/run.py \
--action update \
--template-id <UUID> \
--metric-rules-json '[{"ruleId":"<existing ruleId>","dataTypeClassify":0,"dataTypeGroup":0,"dataTypeList":["INT","BIGINT"],"checkMethods":"SUM,AVG,MIN,MAX","diffTolerateType":0,"diffTolerateValues":{"SAME":0},"isCountCheck":1}]'
Upsert semantics: rules with a
ruleIdare updated, rules without aruleIdare added, and rules not present in the list are deleted.
6. Delete Templates
python atomic-skills/lhm-template-manage/scripts/run.py \
--action delete \
--template-ids <UUID1>,<UUID2>
Pitfalls
metricRulescannot be used on update: the backendUpdateCmd.getMetricRules()clearsmetricRules; you must usebasicMetricRules(dataTypeClassify=0) andcomplexMetricRules(dataTypeClassify=1).run.pyautomatically splits them bydataTypeClassifyinternally.checkMethodsis a comma-separated string: pass"SUM,AVG,MIN,MAX", not a list["SUM","AVG"].diffTolerateValuesformat: use{"SAME": 0}for uniform tolerance, or{"SUM": 0.01, "AVG": 0.001}for per-method customization; keys are uppercase.- Built-in templates cannot be modified/deleted: 1001/1002/1003 are system built-ins; detail returns empty rules (hardcoded in MetricPlanner).
- Backend required fields on update: the backend requires
checkType,dsEngineRels, and the rules to be present (even when only renaming), otherwiseE500R100/E500R102/E501R104is reported. When not provided,update_template()back-fills them automatically from the existing template, transparently to the caller. idListcannot filter built-in templates: theidListparameter of the list interface has no effect on built-in templates; use--is-builtin 1instead.
Verification
# List all templates
python atomic-skills/lhm-template-manage/scripts/run.py --action list
# Expected: {"ok": true, "templates": [...]}
# View built-in template details
python atomic-skills/lhm-template-manage/scripts/run.py --action detail --template-id 1001
# Expected: {"ok": true, "template": {"templateId": "1001", ..., "metricRules": []}}
# Full create → detail → update → delete flow
python atomic-skills/lhm-template-manage/scripts/run.py --action create --name "test" --check-type 1 \
--ds-engine-rels-json '[{"dsType":"MaxCompute","engineTypes":["MaxCompute"]}]' \
--metric-rules-json '[{"dataTypeClassify":0,"dataTypeGroup":0,"dataTypeList":["INT"],"checkMethods":"SUM"}]'
# Expected: {"ok": true, "templateId": "<UUID>"}
Input/Output Examples
list — list metric-type built-in templates
python atomic-skills/lhm-template-manage/scripts/run.py \
--action list --check-type 1 --is-builtin 1
{
"ok": true,
"templates": [
{"templateId": "1001", "templateName": "CUSTOM_METRIC_MIX", "checkType": 1, "isBuiltin": 1},
{"templateId": "1002", "templateName": "CUSTOM_METRIC_NUM", "checkType": 1, "isBuiltin": 1},
{"templateId": "1003", "templateName": "CUSTOM_METRIC_LEN", "checkType": 1, "isBuiltin": 1}
]
}
detail — view a custom template
python atomic-skills/lhm-template-manage/scripts/run.py \
--action detail --template-id cb9f7fc11b2948c5a5a07e45844ffe80
{
"ok": true,
"te
Установить lhm-template-manage в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл lhm-template-manage?
Manages CRUD operations (list/detail/create/update/delete) for LHM data validation templates.
Как установить скилл lhm-template-manage?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл lhm-template-manage запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
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