github-api-discipline
Use whenever build, deploy, or background code reads files from another GitHub repo at runtime — workshop content, manifests, configs fetched from a registry. Captures the rules that keep us under the GitHub App's 15000/hr installation rate limit (zipball over per-file, respect retry-after, share fetched content) and links the reference implementation.
What this skill does
# GitHub API discipline
## The rule
When build or deploy code fetches files from another GitHub repo at runtime, default to:
1. **One bulk fetch per repo, not one call per file.** Use `GET /repos/{owner}/{repo}/zipball/{ref}` (or the tarball/`/git/trees?recursive=true` endpoints) and read files from the in-memory archive. Per-file `/contents/{path}` is the trap.
2. **Honor rate-limit headers.** On `429` *or* `403 rate limit exceeded`, read `retry-after` or `x-ratelimit-reset`, sleep, retry (bounded). A single throttled response must never kill a deploy.
3. **Share fetched content within a workflow run.** Don't refetch the same files from two scripts in the same CI job; cache to disk between them.
4. **Authenticate.** Use a GitHub App installation token (15000/hr per installation, separate quota from user PATs). Don't use a user PAT for automation — it shares the user's 5000/hr quota with everything else they do on the same account.
The four are ranked by impact. The biggest single win is #1.
## Why
**Real incident (2026-05-29, learning-with-court/platform).** Each Deploy Dev / Deploy Prod ran two scripts (`bundle:{env}` in the server, `fetch-workshops.ts` in landing) that each iterated over ~8 workshops and called `GET /repos/{o}/{r}/contents/{path}` for each of ~25 files per workshop. ~400 calls per deploy. Under any meaningful burst — multiple PRs + cutover deploys in the same hour — we'd blow the App installation's 15000/hr ceiling and the deploy would fail with `403 API rate limit exceeded for installation ID …` in the middle of a build step.
The fix (`workshop-fetch-rate-limit-fix`) was just zipball + an `withRateLimitRetry` wrapper:
- **Before:** ~400 calls/deploy; Deploy Dev ~3m26s; sporadic deploy failure under bursts.
- **After:** ~16 calls/deploy (8 workshops × 2 scripts); Deploy Dev 1m13s (~3× faster); no rate-limit failures.
The audit also showed we'd been doing the *easy* GitHub best-practices items (authenticated requests, no polling, serial requests) but skipping every high-impact one (zipball, ETag, rate-limit-header backoff). It's the high-impact items that matter.
## How to apply
### When designing a new build/deploy pipeline that fetches GitHub content
- Reach for the **zipball/tarball endpoint** first. Don't list-then-fetch-each-file.
- Wrap the network call in a backoff helper — reference impl at `${CLAUDE_PLUGIN_ROOT}/templates/github-rate-limit/with-rate-limit-retry.ts`.
- If you have two pipeline stages that need the same content, fetch once and cache to a workspace-local dir; have the second stage read from cache.
### When auditing an existing build that hits the GitHub REST API
Walk this checklist; flag anything ❌:
| Practice | Doing it? |
|---|---|
| Authenticated requests (App token, not PAT) | |
| Avoid polling — use webhook/dispatch triggers | |
| Serial requests (not concurrent) | |
| Bulk fetch (zipball/tarball/trees) instead of per-file `/contents` | |
| Honor `retry-after` / `x-ratelimit-reset` on 429/403 | |
| Cache fetched content across stages in the same workflow | |
| Conditional requests with `If-None-Match` (ETag) for cross-run reuse | |
Tackle ❌s in the order shown — they're roughly ranked by payoff.
### When someone says "we should just raise the GitHub rate limit"
Push back. The 15000/hr App installation cap is already the standard high tier. Real fix is *cutting waste*, not asking GitHub for more headroom for waste.
## Reference implementation
- `${CLAUDE_PLUGIN_ROOT}/templates/github-rate-limit/manifest-fetch-zipball.ts` — `createGitHubFileFetcher` that downloads `/zipball/{ref}` once with `fflate` decompression and serves in-memory file reads. Same `FileFetcher` interface as a per-file fetcher — drop-in replacement.
- `${CLAUDE_PLUGIN_ROOT}/templates/github-rate-limit/with-rate-limit-retry.ts` — `withRateLimitRetry` helper + `isRateLimited` classifier.
Both lifted from `learning-with-court/platform`'s `packages/server/src/manifest/`. Same shape works for any "read files from a GitHub repo" use case.
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.