Communitygithub.com

delivery-gate

Claude Codeのセッション終了時に品質チェックを通過するまで完了をブロックするStopフック。言い訳パターン、古い学習ログ、低ディスク容量を検出します。

delivery-gate とは?

Delivery Gateは、Claude Codeがセッションを終了する前に機械的に検証可能な品質チェックを強制するためのStopフックです。言い訳パターン(「とりあえずテストはスキップ」など)、学習ライブラリの最終更新時刻、ディスク容量の3つをチェックし、不合格の場合はセッション完了をブロックします。このツールは、AIによる推論ではなくファイルの更新タイムスタンプやディスク使用量などの決定論的なチェックのみを使用する点が特徴で、CIパイプラインのゲートと同じ設計思想に基づいています。主な利用ケースは、複雑なタスクを実行したにもかかわらず学習ログを更新していない場合や、ディスク容量が不足している場合です。Python 3.8以上で動作し、Windows、macOS、Linuxに対応しており、標準ライブラリのみで動作するため追加の依存関係は不要です。このフックは学習ライブラリに「触れる」習慣を強制しますが、記録内容の品質までは保証しないため、コンテンツ品質の検証には別のツール(self-auditなど)と組み合わせることを推奨します。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/delivery-gate

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Delivery Gate — Claude Code用機械的品質ゲート

Stopフック。セッション終了時に3つの項目を決定論的チェック(ファイルの更新タイムスタンプ、ディスク使用量、トランスクリプトテキスト上の正規表現パターン)で検証します。AI推論は使用しません。

これは推論ゲート(self-auditなど)とは異なります。delivery-gateは機械的に検証可能な事実をチェックし、self-auditは4つの推論次元にわたって出力品質をチェックします。両者を組み合わせることで多層防御を実現します:

  • delivery-gate:「学習ライブラリは今日更新されたか?ディスク容量は安全か?」
  • self-audit:「ファイル内容は正しく、完全で、正直か?」

これはCIパイプラインゲートと同じパターンです。自己申告のステータスではなく、機械で読み取り可能な事実を検証する自動化された決定論的チェックです。

チェック内容

チェック仕組み結果
言い訳パターントランスクリプト末尾の正規表現警告のみ(ブロックはしない)
古い学習ライブラリ設定可能な5パスのmtime一部古い場合は警告、3以上が古い場合または成長ログが古くかつ複雑なタスクの場合はブロック
ディスク容量 < 50GBshutil.disk_usage警告
ディスク容量 < 15GBshutil.disk_usageブロック(exit 2)

言い訳検出は、「とりあえずテストはスキップ」「既存のバグ」といったパターンを警告します。これらは思考が途中で打ち切られた可能性を示す表面的なシグナルです。正規表現によるヒューリスティックは誤検出の可能性があるため、単独ではブロックしません。ブロック条件は次のとおりです:ディスククリティカル、3以上の学習ライブラリが古い、またはgrowth-logが特に古い(いずれも複雑なタスクで3回以上の編集が必要)。

なぜ必要か

Claude Codeの組み込みチェックはコード品質(ビルド→型→リント→テスト)をカバーしています。しかし、別の障害モードがあります:エージェントは動作するコードを作成している間、セッションの衛生状態がおろそかにされる——学習が記録されず、言い訳によるショートカットが行われ、ディスクが静かに枯渇する、といった問題です。

「作って放置」のセッションを繰り返すと、人間は成長しません。このフックは習慣を強制します:複雑なタスク→学習ライブラリに触れること。

インストール

cp quality-gate.py ~/.claude/scripts/

~/.claude/settings.jsonに追加:

{
  "hooks": {
    "Stop": [{
      "hooks": [{
        "type": "command",
        "command": "python3 ~/.claude/scripts/quality-gate.py",
        "timeout": 5000
      }]
    }]
  }
}

学習ライブラリ

プロジェクトのメモリディレクトリに以下のファイルを作成します。フックは少なくとも1つが今日更新されたかどうかをチェックします:

memory/
├── growth-log/          # 日々の学習記録(ディレクトリ)
├── decisions/log.md     # 決定ログ
├── output-index.md      # セッション出力のインデックス
├── ratings-tracker.md   # スキル評価の推移
└── tooling_capabilities.md  # 既知のツール一覧

LIBS辞書を編集して自分のファイル構造に合わせてカスタマイズしてください。

設定

quality-gate.pyを編集:

変数デフォルト目的
RATIONALIZE4パターン言い訳検出のための正規表現パターン
LIBS5ライブラリ今日の更新をチェックするファイル/ディレクトリ
COMPLEX_THRESHOLD3複雑とみなす編集/書き込み呼び出し数
DISK_WARN_GB50この値以下で警告
DISK_CRIT_GB15この値以下でブロック

例

単純なセッション——許可:

edit_count=1 (< 3、複雑ではない) → exit 0

複雑なタスク、学習記録あり——許可:

edit_count=5(複雑)→ LIBSをチェック → growth-logが今日更新済み → exit 0

複雑なタスク、学習なし——ブロック:

edit_count=4(複雑)→ LIBSをチェック → 5つすべて古い → exit 2
stderr: "ブロック:複雑なタスクが完了しましたが、今日の学習が記録されていません。"

ディスク容量不足——ブロック:

disk_free=12GB < 15GB(クリティカル)→ exit 2
stderr: "ブロック:ディスク容量が12GBです(しきい値:15GB)。"

制限事項

このフックは学習ライブラリに触れる習慣を強制しますが、記録内容の品質までは保証しません。output-index.mdが更新されていてもgrowth-logがスキップされた場合、フックは通過します(5つのライブラリのうち1つに触れたため)。これは意図的な設計です。機械的なゲートは機械で検証可能な事実をチェックします。コンテンツ品質の検証にはself-auditと組み合わせて使用してください。

互換性

  • Python 3.8以上(from __future__ import annotationsを使用)
  • クロスプラットフォーム:Windows、macOS、Linux
  • 標準ライブラリのみで動作、依存関係ゼロ

品質

このコードは4ラウンドの自動コードレビュー(CodeRabbit + Greptile)を経て、9件の実際のバグが発見・修正されました。

関連項目

  • self-audit — 推論品質ゲート(完全性/一貫性/根拠の確かさ/正直さ)
  • verification-loop — コード品質チェック(ビルド/型/リント/テスト)
  • gateguard — PreToolUse安全ゲート

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

関連スキル