← ClaudeAtlas

kookr-oss-contribution-gatelisted

Rate limiting and blocked-repo enforcement for OSS contributions — hook behavior, oss-gate CLI, ledger format, configuration
kookr-ai/kookr · ★ 2 · AI & Automation · score 78
Install: claude install-skill kookr-ai/kookr
# OSS Contribution Gate A Claude Code PreToolUse hook that enforces per-repo daily PR rate limits and blocks contributions to repos with anti-AI policies. ## How It Works The hook intercepts every `Bash` tool call. If the command matches `gh pr create`, it: 1. Extracts the target repo from `--repo`/`-R` flag (or git remote) 2. Checks the blocked list in `~/.kookr/rate-limits.json` 3. Checks `~/.kookr/oss-repos.json` for `anti-ai` or `blocked` status 4. Counts today's `pr_created` entries in the ledger for that repo 5. Blocks if the repo is banned, registry-blocked, or the daily limit is reached 6. Records the result in the contribution ledger The hook is **fail-open**: if it crashes, the command proceeds (no rate limiting). Hook health is tracked via a heartbeat file. ## Files | File | Purpose | |------|---------| | `~/.claude/hooks/oss-contribution-gate.sh` | The hook script (PreToolUse, matcher: Bash) | | `~/.claude/hooks/oss-gate` | CLI helper for status, reset, log, health | | `~/.kookr/rate-limits.json` | Configuration: defaults, per-repo overrides, blocked list | | `~/.kookr/contribution-ledger.jsonl` | Append-only audit trail of all PR creation attempts | | `~/.kookr/oss-repos.json` | OSS repo registry: AI scores, eligibility status (checked after blocked list) | | `~/.kookr/gate-heartbeat` | Timestamp of last hook invocation | ## CLI Commands ```bash # Check today's PR counts per repo oss-gate status # Check a specific repo oss-gate status grafana/grafana #