关于 skill-system-gate
用于在实验注册或重跑决策前执行只读检查的技能,涵盖仓库与实验合规验证、注册表安全检查及状态概览。规则违规或检查错误会导致验证失败。
主要功能
- 01按规则验证仓库产物
- 02检查实验实现与日志
- 03判断注册表重置安全性
- 04汇总实验队列状态
- 05只读检查并阻止运行中重置
适用场景
- 01关闭关卡前核验仓库产物
- 02检查旧版 GNN/FraudDetect 实验
- 03重置或重跑前确认注册表安全
- 04查看实验状态与执行位置
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ arthur0824hao/ skills --skill skill-system-gate安装后在 Claude Code 中输入/skill-system-gate确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
SKILL.behavior.yamlSKILL.spec.yamlscripts/check_registry.shgate_validate.pystatus.shtest_gate_validate.pyvalidate_exp.sh详细介绍
技能系统门禁
在注册实验前实施默认拒绝的门禁,并提供只读的注册表安全性/状态检查。
决策矩阵
| 任务意图 | 操作 | 主要后端 | 适用场景 |
|---|---|---|---|
| 根据可配置的门禁规则验证仓库产物 | validate | scripts/gate_validate.py | 在做出关闭门禁的决定或执行确定性策略检查前 |
| 根据门禁规则验证实验实现和日志 | validate-experiment | preprocess_lib.gate_engine | 检查旧版 GNN/FraudDetect 流水线 |
| 检查注册表状态是否适合重新运行/重置 | verify-registry | db_registry.DBExperimentsDB | 执行任何手动重置/重新运行操作前 |
| 查看队列健康状况和状态计数 | status | db_registry.DBExperimentsDB | 需要快速查看当前实验状态概览时 |
核心模式
模式 1:验证仓库是否符合门禁要求
python3 scripts/gate_validate.py --rules config/gate_rules.yaml --artifact-root .
- 加载可配置的
gate_rules.yaml。 - 支持规则类型:
command、structural、eda-contract。 - 输出 Markdown 判定结果,并在最后一行输出 JSON 摘要。
模式 2:验证旧版实验是否符合门禁要求
scripts/validate_exp.sh <exp_name> [phase_root]
- 加载
gate_bank.json规则。 - 运行所有规则类别(
source_contains、source_not_contains、stderr_scan、file_exists、file_min_size)。 - 输出 Markdown 判定结果,并在最后一行输出 JSON 摘要。
模式 3:在决定重置前验证注册表安全性
scripts/check_registry.sh <exp_name> [phase_root]
- 读取实验的注册表条目。
- 对状态为
RUNNING的实验禁止给出重置建议。 - 返回状态详情和
safe_to_reset决策 JSON。
模式 4:显示当前注册表健康状况概览
scripts/status.sh [phase_root]
- 汇总活动集/已完成集中的计数。
- 显示正在运行的实验及其执行位置。
- 在最后一行返回简洁的 JSON 计数器。
指南
- 始终将验证视为默认拒绝:任何错误级别的规则违规都会导致门禁失败。
- 在执行面向注册表的操作前,始终先运行
validate-experiment。 - 检查期间,切勿修改实验源文件/配置文件。
- 切勿通过此技能执行重置/重新运行;只能报告建议。
- 切勿将状态为
RUNNING的实验判定为可安全重置。 - 对注册表和实验产物的所有操作都必须保持只读。
{
"schema_version": "2.0",
"id": "skill-system-gate",
"version": "1.0.0",
"capabilities": ["configurable-gate", "experiment-gate", "registry-safety", "experiment-status"],
"effects": ["fs.read", "db.read", "proc.exec"],
"operations": {
"validate-experiment": {
"description": "Validate experiment source artifacts and logs against gate_bank rules and return a pass/fail verdict.",
"input": {
"exp_name": { "type": "string", "required": true, "description": "Experiment directory name under experiments/" },
"phase_root": { "type": "string", "required": false, "description": "Phase directory path", "default": "/datas/store162/arthur0824hao/Study/GNN/FraudDetect/SubProject/Phase3" }
},
"output": {
"description": "Gate validation markdown plus machine-readable verdict.",
"fields": { "passed": "boolean", "errors": "number", "warnings": "number" }
},
"entrypoints": {
"unix": ["bash", "scripts/validate_exp.sh", "{exp_name}", "{phase_root}"]
}
},
"validate": {
"description": "Run configurable gate_rules.yaml checks and emit pass/fail with per-rule results.",
"input": {
"rules": { "type": "string", "required": false, "description": "Path to gate rules file", "default": "config/gate_rules.yaml" },
"artifact_root": { "type": "string", "required": false, "description": "Working directory for rule execution", "default": "." }
},
"output": {
"description": "Gate verdict with per-rule details.",
"fields": { "passed": "boolean", "errors": "number", "warnings": "number" }
},
"entrypoints": {
"unix": ["python3", "scripts/gate_validate.py", "--rules", "{rules}", "--artifact-root", "{artifact_root}"]
}
},
"verify-registry": {
"description": "Check registry state safety and recommend whether reset/rerun is safe without mutating state.",
"input": {
"exp_name": { "type": "string", "required": true, "description": "Experiment name in registry" },
"phase_root": { "type": "string", "required": false, "description": "Phase directory path", "default": "/datas/store162/arthur0824hao/Study/GNN/FraudDetect/SubProject/Phase3" }
},
"output": {
"description": "Registry safety markdown plus recommendation payload.",
"fields": { "found": "boolean", "status": "string", "safe_to_reset": "boolean" }
},
"entrypoints": {
"unix": ["bash", "scripts/check_registry.sh", "{exp_name}", "{phase_root}"]
}
},
"status": {
"description": "Show current registry dashboard with counts by status and running experiment details.",
"input": {
"phase_root": { "type": "string", "required": false, "description": "Phase directory path", "default": "/datas/store162/arthur0824hao/Study/GNN/FraudDetect/SubProject/Phase3" }
},
"output": {
"description": "Registry status dashboard and aggregate counters.",
"fields": { "running": "number", "needs_rerun": "number", "completed": "number", "total": "number" }
},
"entrypoints": {
"unix": ["bash", "scripts/status.sh", "{phase_root}"]
}
}
},
"stdout_contract": {
"last_line_json": true
}
}
评论
支持 Markdown