Communitygithub.com

delivery-gate

Claude Code가 품질 검사를 통과할 때까지 작업 완료를 차단하는 Stop 후크입니다. 합리화 패턴(표면 텍스트 휴리스틱), 오래된 학습 기록(파일 시스템 mtime), 낮은 디스크 공간을 감지합니다.

delivery-gate란 무엇인가요?

delivery-gate는 Claude Code 세션이 종료되기 전에 기계적 품질 게이트를 적용하는 Stop 후크입니다. 합리화 패턴 탐지(정규식 기반, 경고만), 학습 라이브러리 갱신 여부(파일 수정 시간 확인), 디스크 공간 부족 등 세 가지 결정론적 검사를 수행합니다. 이는 AI 추론 없이 파일 타임스탬프, 디스크 사용량, 텍스트 정규식 같은 기계가 확인 가능한 사실만 검사합니다. `self-audit`과 달리 내용의 품질이 아닌 학습 캡처 습관의 기계적 이행을 강제하며, 두 후크를 함께 사용하면 심층 방어(Defense in Depth)를 구성합니다. 복잡한 작업(3회 이상 편집) 후 학습 라이브러리가 갱신되지 않으면 세션을 차단하여 '배송 후 망각' 패턴을 방지합니다. Python 3.8+ 표준 라이브러리만 사용하며 Windows, macOS, Linux에서 크로스 플랫폼으로 동작합니다.

지원 대상✓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 후크로서, Claude가 세션을 종료하기 전에 결정론적 검사(파일 수정 타임스탬프, 디스크 사용량, 대화 텍스트의 정규식 패턴)만 사용하여 세 가지 사항을 확인합니다. AI 추론은 사용하지 않습니다.

이는 추론 게이트(예: self-audit)와 구별됩니다. delivery-gate는 기계가 확인 가능한 사실을 검사하고, self-audit은 네 가지 추론 차원에서 출력 품질을 검사합니다. 함께 사용하면 심층 방어를 구성합니다:

  • delivery-gate: "오늘 학습 라이브러리를 수정했는가? 디스크 공간은 안전한가?"
  • self-audit: "파일 내용이 정확하고, 완전하며, 정직한가?"

이는 CI 파이프라인 게이트와 동일한 패턴입니다. 자체 보고된 상태를 신뢰하는 대신 기계가 읽을 수 있는 사실을 자동으로 결정론적으로 검증합니다.

검사 항목

검사메커니즘적중 시 동작
합리화 패턴대화 꼬리의 정규식경고만 (차단하지 않음)
오래된 학습 라이브러리5개 설정 가능 경로의 mtime일부 오래됨: 경고; 3개 이상 오래됨 또는 복잡한 작업 + growth-log 오래됨: 차단
디스크 공간 < 50GBshutil.disk_usage경고
디스크 공간 < 15GBshutil.disk_usage차단 (exit 2)

합리화 탐지는 "일단 테스트는 건너뛰자", "기존 버그" 같은 패턴을 감지하여 사고가 조기 종료되었을 가능성을 경고합니다. 정규식 휴리스틱은 오탐지(false positive) 가능성이 있으므로 자체적으로는 절대 차단하지 않습니다. 차단 조건은: 디스크 임계, >=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
      }]
    }]
  }
}

학습 라이브러리

프로젝트의 memory 디렉토리에 다음 파일들을 생성하세요. 후크는 오늘 최소 하나가 업데이트되었는지 확인합니다:

memory/
├── growth-log/          # 일일 학습 항목 (디렉토리)
├── decisions/log.md     # 결정 로그
├── output-index.md      # 세션 출력 인덱스
├── ratings-tracker.md   # 시간에 따른 스킬 평가
└── tooling_capabilities.md  # 알려진 도구 목록

자신의 파일 구조에 맞게 LIBS 딕셔너리를 사용자 정의하세요.

설정

quality-gate.py를 편집하세요:

변수기본값용도
RATIONALIZE4개 패턴합리화 탐지를 위한 정규식 패턴
LIBS5개 라이브러리오늘 업데이트를 확인할 파일/디렉토리
COMPLEX_THRESHOLD3복잡한 작업으로 분류할 Edit/Write 호출 횟수
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.

관련 스킬