mcpField
S
skill-system-gate

skill-system-gate

github.com/arthur0824haoテスト・品質37 回インストール
リポジトリ

skill-system-gate について

実験の登録や再実行を判断する前に、読み取り専用で確認するスキルです。リポジトリと実験の検証、レジストリの安全性確認、状態表示を行い、エラー時は検証を失敗として扱います。

主な機能

  1. 01ルールに基づく成果物検証
  2. 02実験コードとログの確認
  3. 03レジストリのリセット安全性判定
  4. 04実験キュー状態の集計
  5. 05読み取り専用で実行中の実験を保護

活用シーン

  1. 01ゲート判断前の成果物確認
  2. 02旧式 GNN/FraudDetect 実験の検証
  3. 03リセットや再実行前のレジストリ確認
  4. 04実験状態と実行場所の確認

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/arthur0824hao/skills --skill skill-system-gate

インストール後、Claude Code で/skill-system-gateを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

SKILL.behavior.yaml
SKILL.spec.yaml
scripts/
check_registry.sh
gate_validate.py
status.sh
test_gate_validate.py
validate_exp.sh

詳細

スキルシステムゲート

実験の登録前にフェイルクローズ方式のゲートを適用し、レジストリの安全性とステータスを読み取り専用で確認します。

判断マトリクス

タスクの意図操作主なバックエンド使用する場面
設定可能なゲートルールに照らしてリポジトリの成果物を検証するvalidatescripts/gate_validate.pyゲートを閉じる判断や決定論的なポリシーチェックを行う前
ゲートルールに照らして実験の実装とログを検証するvalidate-experimentpreprocess_lib.gate_engineレガシーの GNN/FraudDetect パイプラインをチェックする場合
レジストリの状態が再実行/リセットに対して安全か確認するverify-registrydb_registry.DBExperimentsDB手動でリセット/再実行する前
キューの健全性と状態別の件数を確認するstatusdb_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
  }
}

コメント