delivery-gate
하는 일
AI 에이전트(Claude)가 중요한 몇 가지를 확인하기 전에 작업을 끝내지 않도록 하는 자동 점검 도구입니다. 디스크 공간이 충분한지, ‘학습 로그’가 업데이트되었는지 확인합니다.
사용하는 경우
- ✓에이전트가 학습 내용을 저장했는지 확인하고 싶을 때.
- ✓에이전트의 작업을 완료로 간주하기 전에.
- ✓에이전트의 디스크 공간 부족을 막고 싶을 때.
스킬 링크
https://github.com/affaan-m/ECC/blob/main/skills/delivery-gate/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“에이전트가 끝내기 전에 진행 상황을 저장했는지 확인해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
여유 디스크 공간을 확인하고, 학습 로그 파일이 최근에 수정되었는지 봅니다. 문제가 있으면 에이전트가 끝나지 않도록 막을 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Delivery Gate — Mechanical Quality Gate for Claude Code
A Stop hook that checks three things before Claude can finish a session, using only deterministic checks — file modification timestamps, disk usage, and regex patterns on the transcript text. No AI inference.
This is distinct from reasoning gates (like self-audit): delivery-gate checks machine-verifiable facts; self-audit checks output quality across four reasoning dimensions. Together they form defense in depth:
- delivery-gate: "Was the learning library touched today? Is disk space safe?"
- self-audit: "Is the file content correct, complete, and honest?"
This is the same pattern as CI pipeline gates — automated, deterministic checks that verify machine-readable facts rather than trusting self-reported status.
What It Checks
| Check | Mechanism | On Hit |
|---|---|---|
| Rationalization patterns | Regex on transcript tail | Warning only (never blocks) |
| Stale learning libraries | mtime on 5 configurable paths | Warning if some stale; Block if >=3 stale OR growth-log stale + complex task |
| Disk space < 50GB | shutil.disk_usage |
Warning |
| Disk space < 15GB | shutil.disk_usage |
Block (exit 2) |
Rationalization detection warns about patterns like "skip tests for now" and "pre-existing bug" — surface signals that thinking may have been cut short. It never blocks on its own, because regex heuristics can false-positive. The blocking conditions are: disk critical, >=3 learning libs stale, OR growth-log specifically stale (all require complex task >=3 edits).
Why
Claude Code's built-in checks cover code quality (build → type → lint → test). But there's a different failure mode: the agent produces working code while the session hygiene was neglected — learning not captured, rationalized shortcuts, disk running out silently.
Over many sessions of "ship and forget," the human hasn't grown. This hook enforces the habit: complex task → must touch learning libraries.
Install
From the ECC repository root:
mkdir -p ~/.claude/scripts
cp skills/delivery-gate/hooks/quality-gate.py ~/.claude/scripts/
Add to ~/.claude/settings.json:
{
"hooks": {
"Stop": [{
"hooks": [{
"type": "command",
"command": "python3 ~/.claude/scripts/quality-gate.py",
"timeout": 5000
}]
}]
}
}
Learning Libraries
Create these files in your project's memory directory. The hook checks if at least one was updated today:
memory/
├── growth-log/ # Daily learning entries (directory)
├── decisions/log.md # Decision log
├── output-index.md # Index of session outputs
├── ratings-tracker.md # Skill ratings over time
└── tooling_capabilities.md # Known tools inventory
Customize the LIBS dict to match your own file structure.
Configuration
Edit quality-gate.py:
| Variable | Default | Purpose |
|---|---|---|
RATIONALIZE |
4 patterns | Regex patterns for rationalization detection |
LIBS |
5 libraries | Files/dirs to check for today's updates |
COMPLEX_THRESHOLD |
3 | Edit/Write calls to classify as complex |
DISK_WARN_GB |
50 | Warn below this |
DISK_CRIT_GB |
15 | Block below this |
Examples
Simple session — allowed:
edit_count=1 (< 3, not complex) → exit 0
Complex task, learning captured — allowed:
edit_count=5 (complex) → checks LIBS → growth-log updated today → exit 0
Complex task, no learning — BLOCKED:
edit_count=4 (complex) → checks LIBS → all 5 stale → exit 2
stderr: "Blocked: complex task completed but no learning captured today."
Low disk space — BLOCKED:
disk_free=12GB < 15GB critical → exit 2
stderr: "Blocked: disk space at 12GB (threshold: 15GB)."
Limitations
The hook enforces the habit of touching learning libraries, not the quality of what was recorded. If output-index.md is updated but growth-log is skipped, the hook passes (1 of 5 libraries touched). This is by design: mechanical gates check machine-verifiable facts. For content quality verification, pair with self-audit.
Compatibility
- Python 3.8+ (uses
from __future__ import annotations) - Cross-platform: Windows, macOS, Linux
- Zero dependencies beyond stdlib
Quality
This code went through 4 rounds of automated code review (CodeRabbit + Greptile) with 9 real bugs found and fixed.
See Also
…
자주 묻는 질문
‘학습 라이브러리’란 무엇인가요?
에이전트가 내린 결정이나 작업 결과 같은 학습 내용을 기록하는 파일입니다. 예로는 ‘growth-log’, ‘decisions/log.md’, ‘output-index.md’가 있습니다.
에이전트가 ‘학습 로그’를 업데이트하지 않으면 어떻게 되나요?
에이전트가 복잡한 작업을 하고 있는데 학습 라이브러리를 하나도 업데이트하지 않았다면, 세션을 끝내는 것이 차단됩니다.
‘합리화 패턴’이란 무엇인가요?
에이전트가 지름길을 정당화하기 위해 쓸 수 있는 표현입니다. 예를 들어 ‘지금은 테스트를 건너뛰자’ 같은 말입니다. 이 점검기는 경고만 하며, 차단하지는 않습니다.
상세 정보
작성자의 원본 설명
Stop hook that blocks Claude from finishing until quality checks pass. Detects rationalization patterns (surface text heuristics), stale learning logs (filesystem mtime), and low disk space. Complements self-audit by mechanically enforcing learning capture habits. Use when Claude should be mechanically blocked from declaring work finished before quality checks and learning capture actually pass.
repo: affaan-m/ECC
인기도
- GitHub 스타
- 280k
- 순위
- #300
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
accessibility
280k에이전트가 모든 사람이 쓸 수 있는 인터페이스를 만들도록 돕습니다. 시각 장애나 운동 장애가 있는 사람도 쓸 수 있게 합니다.
agent-architecture-audit
280k에이전트가 모든 것이 올바르게 작동하는지 점검하도록 돕습니다. AI 시스템의 문제를 찾아 고쳐서 기대대로 작동하게 합니다.
agent-eval
280k에이전트가 서로 다른 AI 코딩 도구를 비교하도록 돕습니다. 특정 작업에서 어느 도구가 더 빠르고, 저렴하고, 믿을 만한지 측정합니다.
agent-harness-construction
280k에이전트가 작업을 더 잘 이해하도록 돕습니다. 에이전트가 쓰는 도구와 지시문을 최적화해 성공 가능성을 높입니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.