delivery-gate
Fungsinya
Ini adalah pemeriksa otomatis yang memastikan agent AI (Claude) tidak menyelesaikan pekerjaannya sebelum memverifikasi beberapa hal penting. Pemeriksa ini mengecek apakah ruang disk masih cukup dan apakah 'learning log' sudah diperbarui.
Kapan dipakai
- βSaat Anda ingin memastikan agent sudah menyimpan hasil pembelajarannya.
- βSebelum menganggap pekerjaan agent sudah selesai.
- βUntuk mencegah agent kehabisan ruang disk.
Link skill
https://github.com/affaan-m/ECC/blob/main/skills/delivery-gate/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βPastikan agent sudah menyimpan progres sebelum menyelesaikan tugasnya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Pemeriksa ini melihat sisa ruang disk dan mengecek apakah file learning log sudah diubah baru-baru ini. Jika ada yang tidak beres, pemeriksa ini bisa menghentikan agent agar tidak langsung menyelesaikan tugasnya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
β¦
Pertanyaan umum
Apa itu 'learning libraries'?
Ini adalah file tempat agent mencatat apa yang sudah dipelajarinya, seperti keputusan yang diambil dan hasil dari suatu tugas. Contohnya 'growth-log', 'decisions/log.md', dan 'output-index.md'.
Apa yang terjadi jika agent tidak memperbarui 'learning log'?
Jika agent sedang mengerjakan tugas yang kompleks dan belum memperbarui learning libraries apa pun, sesi kerjanya akan diblokir sehingga tidak bisa diselesaikan.
Apa itu 'rationalization patterns'?
Ini adalah frasa yang mungkin digunakan agent untuk membenarkan jalan pintas, misalnya 'lewati tes dulu'. Pemeriksa ini hanya memberi peringatan untuk pola seperti ini, tidak memblokirnya.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 280k
- Peringkat
- #300
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
accessibility
280kMembantu agent Anda membuat antarmuka yang ramah untuk semua orang. Memastikan website dan aplikasi tetap bisa dipakai penyandang disabilitas, seperti tunanetra.
agent-architecture-audit
280kMembuat agent Anda memeriksa apakah semuanya berjalan dengan benar. Agent akan menemukan dan memperbaiki masalah pada sistem AI agar bekerja sesuai harapan.
agent-eval
280kMembantu agent Anda membandingkan berbagai alat coding AI. Mengukur mana yang lebih cepat, lebih murah, dan lebih andal untuk tugas tertentu.
agent-harness-construction
280kMembuat agent Anda lebih memahami cara menyelesaikan tugas. Agent mengoptimalkan alat dan instruksi yang digunakan agar peluang berhasilnya lebih besar.
Skill serupa
test-driven-development
311kMengajari agent Anda menulis tes yang gagal dulu, melihatnya gagal, lalu menulis kode terkecil yang lulus, sebelum membangun fitur atau perbaikan apa pun.
verification-before-completion
311kMengajari agent Anda menjalankan pemeriksaan nyata dan membaca keluarannya sebelum menyatakan tugas, perbaikan, atau build sudah selesai atau lulus.
migrate-to-shoehorn
310kMengganti type cast berisiko di file tes Anda dengan pustaka shoehorn, sehingga tes bisa memakai data parsial dan tetap lulus pemeriksaan tipe.